@ethersphere/bee-js 10.2.0 → 10.3.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/README.md +2 -2
- package/dist/cjs/bee.js +75 -5
- package/dist/cjs/chunk/cac.js +26 -31
- package/dist/cjs/chunk/soc.js +17 -18
- package/dist/cjs/feed/index.js +4 -3
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/mjs/bee.js +76 -8
- package/dist/mjs/chunk/cac.js +21 -30
- package/dist/mjs/chunk/soc.js +16 -17
- package/dist/mjs/feed/index.js +7 -6
- package/dist/types/bee.d.ts +58 -3
- package/dist/types/chunk/cac.d.ts +27 -13
- package/dist/types/chunk/soc.d.ts +43 -11
- package/dist/types/index.d.ts +2 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAe,MAAID,IAEnBD,EAAY,MAAIC,GACjB,CATD,CASGK,MAAM,I,4BCTTH,EAAOD,QAAU,EAAjBC,K,8BCEA,IAAII,EAAQC,EAAQ,MAChBC,EAASD,EAAQ,MACjBE,EAAUF,EAAQ,MAClBG,EAAWH,EAAQ,MACnBI,EAAgBJ,EAAQ,MACxBK,EAAeL,EAAQ,KACvBM,EAAkBN,EAAQ,MAC1BO,EAAuBP,EAAQ,IAC/BQ,EAAaR,EAAQ,MACrBS,EAAgBT,EAAQ,MACxBU,EAAgBV,EAAQ,MACxBW,EAAWX,EAAQ,MAEvBL,EAAOD,QAAU,SAAoBkB,GACnC,OAAO,IAAIC,SAAQ,SAA4BC,EAASC,GACtD,IAIIC,EAJAC,EAAcL,EAAOM,KACrBC,EAAiBP,EAAOQ,QACxBC,E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AO,WACP74C,MAAOuzC,GAAgBY,SACvBwvB,eAAgB,IAGX,SAASI,KAMd,MAAO,CACLL,UACAE,UACAC,UACAC,YAEJ,CAEO,SAASE,GAAkBX,GAChC,GAAqB,iBAAVA,EACT,OAAQA,EAAMvhE,eACZ,IAAK,SACH,OAAO4hE,GACT,IAAK,SACH,OAAOE,GACT,IAAK,SACH,OAAOC,GACT,IAAK,WACH,OAAOC,GACT,QACE,MAAM,IAAIv7D,MAAM,6BAA6B86D,MAInD,OAAQA,GACN,KAAK9vB,GAAgBS,OACnB,OAAO0vB,GACT,KAAKnwB,GAAgBU,OACnB,OAAO2vB,GACT,KAAKrwB,GAAgBW,OACnB,OAAO2vB,GACT,KAAKtwB,GAAgBY,SACnB,OAAO2vB,GACT,QACE,MAAM,IAAIv7D,MAAM,6BAA6B86D,MAEnD,C","sources":["webpack://BeeJs/webpack/universalModuleDefinition","webpack://BeeJs/./node_modules/axios/index.js","webpack://BeeJs/./node_modules/axios/lib/adapters/xhr.js","webpack://BeeJs/./node_modules/axios/lib/axios.js","webpack://BeeJs/./node_modules/axios/lib/cancel/CancelToken.js","webpack://BeeJs/./node_modules/axios/lib/cancel/CanceledError.js","webpack://BeeJs/./node_modules/axios/lib/cancel/isCancel.js","webpack://BeeJs/./node_modules/axios/lib/core/Axios.js","webpack://BeeJs/./node_modules/axios/lib/core/AxiosError.js","webpack://BeeJs/./node_modules/axios/lib/core/InterceptorManager.js","webpack://BeeJs/./node_modules/axios/lib/core/buildFullPath.js","webpack://BeeJs/./node_modules/axios/lib/core/dispatchRequest.js","webpack://BeeJs/./node_modules/axios/lib/core/mergeConfig.js","webpack://BeeJs/./node_modules/axios/lib/core/settle.js","webpack://BeeJs/./node_modules/axios/lib/core/transformData.js","webpack://BeeJs/./node_modules/axios/lib/defaults/index.js","webpack://BeeJs/./node_modules/axios/lib/defaults/transitional.js","webpack://BeeJs/./node_modules/axios/lib/env/classes/FormData.js","webpack://BeeJs/./node_modules/axios/lib/env/data.js","webpack://BeeJs/./node_modules/axios/lib/helpers/AxiosURLSearchParams.js","webpack://BeeJs/./node_modules/axios/lib/helpers/bind.js","webpack://BeeJs/./node_modules/axios/lib/helpers/buildURL.js","webpack://BeeJs/./node_modules/axios/lib/helpers/combineURLs.js","webpack://BeeJs/./node_modules/axios/lib/helpers/cookies.js","webpack://BeeJs/./node_modules/axios/lib/helpers/formDataToJSON.js","webpack://BeeJs/./node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack://BeeJs/./node_modules/axios/lib/helpers/isAxiosError.js","webpack://BeeJs/./node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack://BeeJs/./node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack://BeeJs/./node_modules/axios/lib/helpers/parseHeaders.js","webpack://BeeJs/./node_modules/axios/lib/helpers/parseProtocol.js","webpack://BeeJs/./node_modules/axios/lib/helpers/spread.js","webpack://BeeJs/./node_modules/axios/lib/helpers/toFormData.js","webpack://BeeJs/./node_modules/axios/lib/helpers/toURLEncodedForm.js","webpack://BeeJs/./node_modules/axios/lib/helpers/validator.js","webpack://BeeJs/./node_modules/axios/lib/platform/browser/classes/FormData.js","webpack://BeeJs/./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","webpack://BeeJs/./node_modules/axios/lib/platform/browser/index.js","webpack://BeeJs/./node_modules/axios/lib/platform/index.js","webpack://BeeJs/./node_modules/axios/lib/utils.js","webpack://BeeJs/./node_modules/cafe-utility/index.js","webpack://BeeJs/./node_modules/debug/src/browser.js","webpack://BeeJs/./node_modules/debug/src/common.js","webpack://BeeJs/./node_modules/form-data/lib/browser.js","webpack://BeeJs/./node_modules/isomorphic-ws/browser.js","webpack://BeeJs/./node_modules/ms/index.js","webpack://BeeJs/./node_modules/semver/classes/semver.js","webpack://BeeJs/./node_modules/semver/functions/major.js","webpack://BeeJs/./node_modules/semver/internal/constants.js","webpack://BeeJs/./node_modules/semver/internal/debug.js","webpack://BeeJs/./node_modules/semver/internal/identifiers.js","webpack://BeeJs/./node_modules/semver/internal/parse-options.js","webpack://BeeJs/./node_modules/semver/internal/re.js","webpack://BeeJs/webpack/bootstrap","webpack://BeeJs/webpack/runtime/compat get default export","webpack://BeeJs/webpack/runtime/define property getters","webpack://BeeJs/webpack/runtime/global","webpack://BeeJs/webpack/runtime/hasOwnProperty shorthand","webpack://BeeJs/webpack/runtime/make namespace object","webpack://BeeJs/./node_modules/cafe-utility/module.mjs","webpack://BeeJs/./src/utils/bytes.ts","webpack://BeeJs/./src/utils/cid.ts","webpack://BeeJs/./src/utils/typed-bytes.ts","webpack://BeeJs/./src/utils/error.ts","webpack://BeeJs/./src/chunk/bmt.ts","webpack://BeeJs/./src/chunk/cac.ts","webpack://BeeJs/./src/types/debug.ts","webpack://BeeJs/./src/types/index.ts","webpack://BeeJs/./src/utils/duration.ts","webpack://BeeJs/./src/utils/tokens.ts","webpack://BeeJs/./src/utils/file.ts","webpack://BeeJs/./src/utils/type.ts","webpack://BeeJs/./src/utils/stamps.ts","webpack://BeeJs/./src/utils/headers.ts","webpack://BeeJs/./src/utils/http.ts","webpack://BeeJs/./src/modules/chunk.ts","webpack://BeeJs/./src/chunk/soc.ts","webpack://BeeJs/./src/modules/soc.ts","webpack://BeeJs/./src/modules/bytes.ts","webpack://BeeJs/./src/modules/feed.ts","webpack://BeeJs/./src/utils/resource-locator.ts","webpack://BeeJs/./src/feed/identifier.ts","webpack://BeeJs/./src/feed/index.ts","webpack://BeeJs/./src/feed/retrievable.ts","webpack://BeeJs/./src/utils/collection.ts","webpack://BeeJs/./src/utils/tar.ts","webpack://BeeJs/./src/utils/tar-uploader.ts","webpack://BeeJs/./src/utils/tar-writer.ts","webpack://BeeJs/./src/modules/bzz.ts","webpack://BeeJs/./src/modules/debug/balance.ts","webpack://BeeJs/./src/modules/debug/chequebook.ts","webpack://BeeJs/./src/modules/debug/connectivity.ts","webpack://BeeJs/./src/modules/debug/settlements.ts","webpack://BeeJs/./src/modules/debug/stake.ts","webpack://BeeJs/./src/utils/size.ts","webpack://BeeJs/./src/utils/workaround.ts","webpack://BeeJs/./src/modules/debug/stamps.ts","webpack://BeeJs/./src/modules/debug/states.ts","webpack://BeeJs/./src/modules/debug/status.ts","webpack://BeeJs/./src/modules/debug/transactions.ts","webpack://BeeJs/./src/modules/grantee.ts","webpack://BeeJs/./src/modules/gsoc.ts","webpack://BeeJs/./src/modules/pinning.ts","webpack://BeeJs/./src/modules/pss.ts","webpack://BeeJs/./src/modules/status.ts","webpack://BeeJs/./src/modules/stewardship.ts","webpack://BeeJs/./src/modules/tag.ts","webpack://BeeJs/./src/manifest/manifest.ts","webpack://BeeJs/./src/utils/collection.node.ts","webpack://BeeJs/./src/utils/mime.ts","webpack://BeeJs/./src/utils/chunk-stream.ts","webpack://BeeJs/./src/utils/data.ts","webpack://BeeJs/./src/utils/url.ts","webpack://BeeJs/./src/bee.ts","webpack://BeeJs/./src/utils/chunk-size.ts","webpack://BeeJs/./src/modules/envelope.ts","webpack://BeeJs/./src/modules/rchash.ts","webpack://BeeJs/./src/bee-dev.ts","webpack://BeeJs/./src/stamper/stamper.ts","webpack://BeeJs/./src/utils/constants.ts","webpack://BeeJs/./src/utils/pss.ts","webpack://BeeJs/./src/utils/redundancy.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"BeeJs\"] = factory();\n\telse\n\t\troot[\"BeeJs\"] = factory();\n})(this, () => {\nreturn ","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar transitionalDefaults = require('../defaults/transitional');\nvar AxiosError = require('../core/AxiosError');\nvar CanceledError = require('../cancel/CanceledError');\nvar parseProtocol = require('../helpers/parseProtocol');\nvar platform = require('../platform');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var withXSRFToken = config.withXSRFToken;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n var xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n // false, 0 (zero number), and '' (empty string) are valid JSON values\n if (!requestData && requestData !== false && requestData !== 0 && requestData !== '') {\n requestData = null;\n }\n\n var protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\nvar formDataToJSON = require('./helpers/formDataToJSON');\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = require('./cancel/CanceledError');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\naxios.toFormData = require('./helpers/toFormData');\n\n// Expose AxiosError class\naxios.AxiosError = require('../lib/core/AxiosError');\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\naxios.formToJSON = function(thing) {\n return formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n};\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar CanceledError = require('./CanceledError');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nvar AxiosError = require('../core/AxiosError');\nvar utils = require('../utils');\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nmodule.exports = CanceledError;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar buildFullPath = require('./buildFullPath');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n var paramsSerializer = config.paramsSerializer;\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n };\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n var fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url: url,\n data: data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nvar prototype = AxiosError.prototype;\nvar descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(function(code) {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = function(error, code, config, request, response, customProps) {\n var axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nmodule.exports = AxiosError;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Clear all interceptors from the stack\n */\nInterceptorManager.prototype.clear = function clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @param {boolean} allowAbsoluteUrls Set to true to allow absolute URLs\n *\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {\n var isRelativeURL = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeURL || allowAbsoluteUrls === false)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar CanceledError = require('../cancel/CanceledError');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n null,\n config.transformRequest\n );\n\n normalizeHeaderName(config.headers, 'Accept');\n normalizeHeaderName(config.headers, 'Content-Type');\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n response.status,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n reason.response.status,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isEmptyObject(source)) {\n return utils.merge({}, target);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'withXSRFToken': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'beforeRedirect': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","'use strict';\n\nvar AxiosError = require('./AxiosError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Number} status HTTP status code\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, status, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers, status);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\nvar AxiosError = require('../core/AxiosError');\nvar transitionalDefaults = require('./transitional');\nvar toFormData = require('../helpers/toFormData');\nvar toURLEncodedForm = require('../helpers/toURLEncodedForm');\nvar platform = require('../platform');\nvar formDataToJSON = require('../helpers/formDataToJSON');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('../adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('../adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n var contentType = headers && headers['Content-Type'] || '';\n var hasJSONContentType = contentType.indexOf('application/json') > -1;\n var isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n var isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n\n var isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') !== -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n var _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","// eslint-disable-next-line strict\nmodule.exports = require('form-data');\n","module.exports = {\n \"version\": \"0.30.0\"\n};","'use strict';\n\nvar toFormData = require('./toFormData');\n\nfunction encode(str) {\n var charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'\\(\\)~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nvar prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n var _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nmodule.exports = AxiosURLSearchParams;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar AxiosURLSearchParams = require('../helpers/AxiosURLSearchParams');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var hashmarkIndex = url.indexOf('#');\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n var _encode = options && options.encode || encode;\n\n var serializeFn = options && options.serialize;\n\n var serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(function(match) {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\nfunction arrayToObject(arr) {\n var obj = {};\n var keys = Object.keys(arr);\n var i;\n var len = keys.length;\n var key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n var name = path[index++];\n\n if (name === '__proto__') return true;\n\n var isNumericKey = Number.isFinite(+name);\n var isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProperty(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n var result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n var obj = {};\n\n utils.forEachEntry(formData, function(name, value) {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nmodule.exports = formDataToJSON;\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.slice(0, i)).toLowerCase();\n val = utils.trim(line.slice(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nmodule.exports = function parseProtocol(url) {\n var match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar AxiosError = require('../core/AxiosError');\nvar envFormData = require('../env/classes/FormData');\n\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nvar predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\nfunction isSpecCompliant(thing) {\n return thing && utils.isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator];\n}\n\n/**\n * Convert a data object to FormData\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n * @returns {Object}\n **/\n\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (envFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n var metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n var visitor = options.visitor || defaultVisitor;\n var dots = options.dots;\n var indexes = options.indexes;\n var _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n var useBlob = _Blob && isSpecCompliant(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n var arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n (utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n var stack = [];\n\n var exposedHelpers = Object.assign(predicates, {\n defaultVisitor: defaultVisitor,\n convertValue: convertValue,\n isVisitable: isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n var result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nmodule.exports = toFormData;\n","'use strict';\n\nvar utils = require('../utils');\nvar toFormData = require('./toFormData');\nvar platform = require('../platform/');\n\nmodule.exports = function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n};\n","'use strict';\n\nvar VERSION = require('../env/data').version;\nvar AxiosError = require('../core/AxiosError');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nmodule.exports = FormData;\n","'use strict';\n\nvar AxiosURLSearchParams = require('../../../helpers/AxiosURLSearchParams');\n\nmodule.exports = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nmodule.exports = {\n isBrowser: true,\n classes: {\n URLSearchParams: require('./classes/URLSearchParams'),\n FormData: require('./classes/FormData'),\n Blob: Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","'use strict';\n\nmodule.exports = require('./node/');\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n// eslint-disable-next-line func-names\nvar kindOf = (function(cache) {\n // eslint-disable-next-line func-names\n return function(thing) {\n var str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n };\n})(Object.create(null));\n\nfunction kindOfTest(type) {\n type = type.toLowerCase();\n return function isKindOf(thing) {\n return kindOf(thing) === type;\n };\n}\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nvar isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a empty Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a empty Object, otherwise false\n */\nfunction isEmptyObject(val) {\n return val && Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nvar isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nvar isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nvar isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nvar isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} thing The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(thing) {\n var pattern = '[object FormData]';\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) ||\n toString.call(thing) === pattern ||\n (isFunction(thing.toString) && thing.toString() === pattern)\n );\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nvar isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n var product;\n if (typeof navigator !== 'undefined' && (\n (product = navigator.product) === 'ReactNative' ||\n product === 'NativeScript' ||\n product === 'NS')\n ) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n */\n\nfunction inherits(constructor, superConstructor, props, descriptors) {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n * @returns {Object}\n */\n\nfunction toFlatObject(sourceObj, destObj, filter, propFilter) {\n var props;\n var i;\n var prop;\n var merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && Object.getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/*\n * determines whether a string ends with the characters of a specified string\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n * @returns {boolean}\n */\nfunction endsWith(str, searchString, position) {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n var lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n * @param {*} [thing]\n * @returns {?Array}\n */\nfunction toArray(thing) {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n var i = thing.length;\n if (!isNumber(i)) return null;\n var arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n// eslint-disable-next-line func-names\nvar isTypedArray = (function(TypedArray) {\n // eslint-disable-next-line func-names\n return function(thing) {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));\n\nfunction forEachEntry(obj, fn) {\n var generator = obj && obj[Symbol.iterator];\n\n var iterator = generator.call(obj);\n\n var result;\n\n while ((result = iterator.next()) && !result.done) {\n var pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\nfunction matchAll(regExp, str) {\n var matches;\n var arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\nvar isHTMLForm = kindOfTest('HTMLFormElement');\n\nvar hasOwnProperty = (function resolver(_hasOwnProperty) {\n return function(obj, prop) {\n return _hasOwnProperty.call(obj, prop);\n };\n})(Object.prototype.hasOwnProperty);\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isEmptyObject: isEmptyObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM,\n inherits: inherits,\n toFlatObject: toFlatObject,\n kindOf: kindOf,\n kindOfTest: kindOfTest,\n endsWith: endsWith,\n toArray: toArray,\n isTypedArray: isTypedArray,\n isFileList: isFileList,\n forEachEntry: forEachEntry,\n matchAll: matchAll,\n isHTMLForm: isHTMLForm,\n hasOwnProperty: hasOwnProperty\n};\n","'use strict'\nvar _a\nObject.defineProperty(exports, '__esModule', { value: !0 }), (exports.Vector = exports.Cache = exports.Assertions = exports.Strings = exports.Types = exports.Objects = exports.Dates = exports.Promises = exports.Numbers = exports.System = exports.Arrays = exports.Random = exports.Elliptic = exports.Binary = exports.TrieRouter = exports.AsyncQueue = exports.PubSubChannel = exports.FixedPointNumber = exports.MerkleTree = exports.Chunk = exports.Uint8ArrayWriter = exports.Uint8ArrayReader = exports.AsyncLazy = exports.Lazy = exports.Optional = void 0)\nasync function invertPromise(n) {\n\treturn new Promise((e, t) => n.then(t, e))\n}\nasync function raceFulfilled(n) {\n\treturn invertPromise(Promise.all(n.map(invertPromise)))\n}\nasync function runInParallelBatches(n, e = 1) {\n\tconst t = splitByCount(n, e),\n\t\tr = [],\n\t\to = t.map(async i => {\n\t\t\tfor (const u of i) r.push(await u())\n\t\t})\n\treturn await Promise.all(o), r\n}\nasync function sleepMillis(n) {\n\treturn new Promise(e =>\n\t\tsetTimeout(() => {\n\t\t\te(!0)\n\t\t}, n)\n\t)\n}\nfunction shuffle(n, e = Math.random) {\n\tfor (let t = n.length - 1; t > 0; t--) {\n\t\tconst r = Math.floor(e() * (t + 1)),\n\t\t\to = n[t]\n\t\t;(n[t] = n[r]), (n[r] = o)\n\t}\n\treturn n\n}\nfunction onlyOrThrow(n) {\n\tif (n.length === 1) return n[0]\n\tthrow Error(`Expected exactly one element, actual: ${n.length}`)\n}\nfunction onlyOrNull(n) {\n\treturn n.length === 1 ? n[0] : null\n}\nfunction firstOrNull(n) {\n\treturn n.length > 0 ? n[0] : null\n}\nfunction firstOrThrow(n) {\n\tif (!n.length) throw Error('Received empty array')\n\treturn n[0]\n}\nfunction initializeArray(n, e) {\n\tconst t = []\n\tfor (let r = 0; r < n; r++) t.push(e(r))\n\treturn t\n}\nfunction rotate2DArray(n) {\n\tconst e = []\n\tfor (let t = 0; t < n[0].length; t++) {\n\t\te.push([])\n\t\tfor (let r = 0; r < n.length; r++) e[t].push(n[r][t])\n\t}\n\treturn e\n}\nfunction initialize2DArray(n, e, t) {\n\tconst r = []\n\tfor (let o = 0; o < n; o++) {\n\t\tr.push([])\n\t\tfor (let i = 0; i < e; i++) r[o].push(t)\n\t}\n\treturn r\n}\nfunction containsShape(n, e, t, r) {\n\tif (t < 0 || r < 0 || r + e[0].length > n[0].length || t + e.length > n.length) return !1\n\tfor (let o = 0; o < e.length; o++) for (let i = 0; i < e[o].length; i++) if (e[o][i] !== void 0 && n[t + o][r + i] !== e[o][i]) return !1\n\treturn !0\n}\nfunction pickRandomIndices(n, e, t = Math.random) {\n\treturn shuffle(range(0, n.length - 1), t).slice(0, e)\n}\nfunction pluck(n, e) {\n\treturn n.map(t => t[e])\n}\nfunction makeSeededRng(n) {\n\tlet e = n,\n\t\tt = 3405648695,\n\t\tr = 3735928559\n\treturn function () {\n\t\treturn (e += t), (t ^= e << 7), (e *= r), (r ^= e << 13), (e ^= t ^ r), (e >>> 0) / 4294967296\n\t}\n}\nfunction intBetween(n, e, t = Math.random) {\n\treturn Math.floor(t() * (e - n + 1)) + n\n}\nfunction floatBetween(n, e, t = Math.random) {\n\treturn t() * (e - n) + n\n}\nfunction signedRandom() {\n\treturn Math.random() * 2 - 1\n}\nfunction containsPoint(n, e, t) {\n\treturn e >= n.x && e < n.x + n.width && t >= n.y && t < n.y + n.height\n}\nfunction randomPoint(n, e, t, r = Math.random) {\n\tlet o, i\n\tdo (o = intBetween(0, n - 1, r)), (i = intBetween(0, e - 1, r))\n\twhile (t && containsPoint(t, o, i))\n\treturn [o, i]\n}\nfunction procs(n, e = Math.random) {\n\tconst t = Math.floor(n),\n\t\tr = n - t\n\treturn chance(r, e) ? t + 1 : t\n}\nfunction chance(n, e = Math.random) {\n\treturn e() < n\n}\nfunction pick(n, e = Math.random) {\n\treturn n[Math.floor(n.length * e())]\n}\nfunction pickMany(n, e, t = Math.random) {\n\tif (e > n.length) throw new Error(`Count (${e}) is greater than array length (${n.length})`)\n\treturn pickRandomIndices(n, e, t).map(o => n[o])\n}\nfunction pickManyUnique(n, e, t, r = Math.random) {\n\tif (e > n.length) throw new Error(`Count (${e}) is greater than array length (${n.length})`)\n\tconst o = []\n\tfor (; o.length < e; ) {\n\t\tconst i = pick(n, r)\n\t\to.some(u => t(u, i)) || o.push(i)\n\t}\n\treturn o\n}\nfunction pickGuaranteed(n, e, t, r, o, i = Math.random) {\n\tconst u = n.filter(c => c !== e && c !== t),\n\t\ts = []\n\tfor (e !== null && s.push(e); u.length && s.length < r; ) {\n\t\tconst c = exports.Random.intBetween(0, u.length - 1, i)\n\t\to(u[c], s) && s.push(u[c]), u.splice(c, 1)\n\t}\n\treturn shuffle(s, i), { values: s, indexOfGuaranteed: e !== null ? s.indexOf(e) : -1 }\n}\nfunction last(n) {\n\tif (!n.length) throw Error('Received empty array')\n\treturn n[n.length - 1]\n}\nfunction pipe(n, e, t) {\n\treturn t(e.reduce((r, o) => o(r), n))\n}\nfunction makePipe(n, e) {\n\treturn t => pipe(t, n, e)\n}\nfunction pickWeighted(n, e, t) {\n\tif ((t === void 0 && (t = Math.random()), n.length !== e.length)) throw new Error('Array length mismatch')\n\tlet r = e.reduce((i, u) => i + u, 0)\n\tconst o = t * r\n\tfor (let i = 0; i < n.length - 1; i++) if (((r -= e[i]), o >= r)) return n[i]\n\treturn last(n)\n}\nfunction sortWeighted(n, e, t = Math.random) {\n\tconst r = e.map(i => t() * i),\n\t\to = []\n\tfor (let i = 0; i < n.length; i++) o.push([n[i], r[i]])\n\treturn o.sort((i, u) => u[1] - i[1]).map(i => i[0])\n}\nfunction getDeep(n, e) {\n\tif (n == null) return null\n\tconst t = e.split('.')\n\tlet r = n\n\tfor (const o of t) {\n\t\tif (r[o] === null || r[o] === void 0) return null\n\t\tr = r[o]\n\t}\n\treturn r\n}\nfunction setDeep(n, e, t) {\n\tconst r = e.split(/\\.|\\[/)\n\tlet o = n\n\tfor (let i = 0; i < r.length; i++) {\n\t\tconst u = r[i],\n\t\t\ts = i < r.length - 1 && r[i + 1].includes(']'),\n\t\t\tf = u.includes(']') ? u.replace(/\\[|\\]/g, '') : u\n\t\tif (i === r.length - 1) return (o[f] = t), t\n\t\tisObject(o[f]) || (s ? (o[f] = []) : (o[f] = {})), (o = o[f])\n\t}\n\treturn t\n}\nfunction incrementDeep(n, e, t = 1) {\n\tconst r = getDeep(n, e) || 0\n\treturn setDeep(n, e, r + t), r\n}\nfunction ensureDeep(n, e, t) {\n\treturn getDeep(n, e) || setDeep(n, e, t)\n}\nfunction deleteDeep(n, e) {\n\tconst t = beforeLast(e, '.'),\n\t\tr = afterLast(e, '.')\n\tif (!t || !r) return\n\tconst o = getDeep(n, t)\n\to && delete o[r]\n}\nfunction replaceDeep(n, e, t) {\n\tconst r = getDeep(n, e)\n\tif (!r) throw new Error(\"Key '\" + e + \"' does not exist.\")\n\treturn setDeep(n, e, t), r\n}\nfunction getFirstDeep(n, e, t) {\n\tfor (const r of e) {\n\t\tconst o = getDeep(n, r)\n\t\tif (o) return o\n\t}\n\tif (t) {\n\t\tconst r = Object.values(n)\n\t\tif (r.length) return r[0]\n\t}\n\treturn null\n}\nasync function forever(n, e, t) {\n\tfor (;;) {\n\t\ttry {\n\t\t\tawait n()\n\t\t} catch (r) {\n\t\t\tt && t('Error in forever', r)\n\t\t}\n\t\tawait sleepMillis(e)\n\t}\n}\nfunction runAndSetInterval(n, e) {\n\tn()\n\tconst t = setInterval(() => {\n\t\tn()\n\t}, e)\n\treturn () => clearInterval(t)\n}\nfunction whereAmI() {\n\tconst n = globalThis.process\n\treturn n ? (n.browser === !0 ? 'browser' : 'node') : 'browser'\n}\nfunction asMegabytes(n) {\n\treturn n / 1024 / 1024\n}\nfunction convertBytes(n, e = 1024) {\n\treturn n >= e * e * e * e ? (n / e / e / e / e).toFixed(3) + ' TB' : n >= e * e * e ? (n / e / e / e).toFixed(3) + ' GB' : n >= e * e ? (n / e / e).toFixed(3) + ' MB' : n >= e ? (n / e).toFixed(3) + ' KB' : n + ' B'\n}\nfunction hexToRgb(n) {\n\tconst e = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(n.toLowerCase())\n\tif (!e) throw new Error('Invalid hex color: ' + n)\n\treturn [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)]\n}\nfunction rgbToHex(n) {\n\treturn '#' + n.map(e => e.toString(16).padStart(2, '0')).join('')\n}\nfunction haversineDistanceToMeters(n, e, t, r) {\n\tconst i = (n * Math.PI) / 180,\n\t\tu = (t * Math.PI) / 180,\n\t\ts = ((t - n) * Math.PI) / 180,\n\t\tc = ((r - e) * Math.PI) / 180,\n\t\tf = Math.sin(s / 2) * Math.sin(s / 2) + Math.cos(i) * Math.cos(u) * Math.sin(c / 2) * Math.sin(c / 2)\n\treturn 6371e3 * (2 * Math.atan2(Math.sqrt(f), Math.sqrt(1 - f)))\n}\nfunction roundToNearest(n, e) {\n\treturn Math.round(n / e) * e\n}\nfunction formatDistance(n) {\n\treturn n > 1e3 ? (n / 1e3).toFixed(0) + ' km' : n >= 500 ? roundToNearest(n, 100) + ' m' : n >= 100 ? roundToNearest(n, 50) + ' m' : roundToNearest(n, 10) + ' m'\n}\nfunction triangularNumber(n) {\n\treturn (n * (n + 1)) / 2\n}\nfunction searchFloat(n) {\n\tconst e = n.match(/-?\\d+(\\.\\d+)?/)\n\tif (!e) throw Error('No float found in ' + n)\n\treturn parseFloat(e[0])\n}\nfunction binomialSample(n, e, t = Math.random) {\n\tconst r = n * e,\n\t\to = Math.sqrt(n * e * (1 - e)),\n\t\tu = (t() + t() + t() + t() + t() + t() - 3) * Math.SQRT2,\n\t\ts = Math.round(r + o * u)\n\treturn Math.max(0, Math.min(n, s))\n}\nfunction isObject(n, e = !0) {\n\treturn !n || (e && !isUndefined(n._readableState)) || (e && n.constructor && (n.constructor.isBuffer || n.constructor.name == 'Uint8Array' || n.constructor.name === 'ArrayBuffer' || n.constructor.name === 'ReadableStream')) ? !1 : typeof n == 'object'\n}\nfunction isStrictlyObject(n) {\n\treturn isObject(n) && !Array.isArray(n)\n}\nfunction isEmptyArray(n) {\n\treturn Array.isArray(n) && n.length === 0\n}\nfunction isEmptyObject(n) {\n\treturn isStrictlyObject(n) && Object.keys(n).length === 0\n}\nfunction isUndefined(n) {\n\treturn n === void 0\n}\nfunction isFunction(n) {\n\treturn Object.prototype.toString.call(n) === '[object Function]' || Object.prototype.toString.call(n) === '[object AsyncFunction]'\n}\nfunction isString(n) {\n\treturn Object.prototype.toString.call(n) === '[object String]'\n}\nfunction isNumber(n) {\n\treturn typeof n == 'number' && isFinite(n)\n}\nfunction isBoolean(n) {\n\treturn n === !0 || n === !1\n}\nfunction isDate(n) {\n\treturn Object.prototype.toString.call(n) === '[object Date]'\n}\nfunction isBlank(n) {\n\treturn !isString(n) || n.trim().length === 0\n}\nfunction isId(n) {\n\treturn isNumber(n) && Number.isInteger(n) && n >= 1\n}\nfunction isIntegerString(n) {\n\treturn isString(n) && n.match(/^-?\\d+$/) !== null\n}\nfunction isHexString(n) {\n\treturn isString(n) && n.match(/^(0x)?[0-9a-f]+$/i) !== null\n}\nconst symbols = '!@#$%^&*()_+-=[]{}|;:<>?,./',\n\tsymbolsArray = '!@#$%^&*()_+-=[]{}|;:<>?,./'.split(''),\n\tlowercaseAlphabet = 'abcdefghijklmnopqrstuvwxyz',\n\tuppercaseAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n\tnumericAlphabet = '1234567890',\n\talphanumericAlphabet = lowercaseAlphabet + uppercaseAlphabet + numericAlphabet,\n\trichAsciiAlphabet = alphanumericAlphabet + symbols,\n\tunicodeTestingAlphabet = ['\\u2014', '\\\\', '\\u6771', '\\u4EAC', '\\u90FD', '\\u{1D586}', '\\u{1D587}', '\\u{1D588}', '\\u{1F47E}', '\\u{1F647}', '\\u{1F481}', '\\u{1F645}', '\\u16A0', '\\u16C7', '\\u16BB', '\\u16E6'],\n\thexAlphabet = '0123456789abcdef'\nfunction randomLetterString(n, e = Math.random) {\n\tlet t = ''\n\tfor (let r = 0; r < n; r++) t += lowercaseAlphabet[Math.floor(e() * lowercaseAlphabet.length)]\n\treturn t\n}\nfunction randomAlphanumericString(n, e = Math.random) {\n\tlet t = ''\n\tfor (let r = 0; r < n; r++) t += alphanumericAlphabet[Math.floor(e() * alphanumericAlphabet.length)]\n\treturn t\n}\nfunction randomRichAsciiString(n, e = Math.random) {\n\tlet t = ''\n\tfor (let r = 0; r < n; r++) t += richAsciiAlphabet[Math.floor(e() * richAsciiAlphabet.length)]\n\treturn t\n}\nfunction randomUnicodeString(n, e = Math.random) {\n\tlet t = ''\n\tfor (let r = 0; r < n; r++) t += unicodeTestingAlphabet[Math.floor(e() * unicodeTestingAlphabet.length)]\n\treturn t\n}\nfunction searchHex(n, e) {\n\tconst t = new RegExp(`[0-9a-f]{${e}}`, 'i'),\n\t\tr = n.match(t)\n\treturn r ? r[0] : null\n}\nfunction searchSubstring(n, e, t = symbolsArray) {\n\tconst r = splitAll(n, t)\n\tfor (const o of r) if (e(o)) return o\n\treturn null\n}\nfunction randomHexString(n, e = Math.random) {\n\tlet t = ''\n\tfor (let r = 0; r < n; r++) t += hexAlphabet[Math.floor(e() * hexAlphabet.length)]\n\treturn t\n}\nfunction asIntegerString(n, e) {\n\tif (!isIntegerString(n)) throw new TypeError(`Expected integer string${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\tconst t = BigInt(n)\n\tif (e && ((e.min && t < e.min) || (e.max && t > e.max))) throw RangeError(`Expected integer string${e?.name ? ` for ${e.name}` : ''} in range: ${e.min ?? '-inf'}..${e.max ?? 'inf'}; got: ` + t)\n\treturn n\n}\nfunction asString(n, e) {\n\tif (isBlank(n)) throw new TypeError(`Expected string${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\tif (e && ((e.min !== void 0 && n.length < e.min) || (e.max !== void 0 && n.length > e.max))) throw RangeError(`Expected string${e?.name ? ` for ${e.name}` : ''} length in range: ${e.min ?? '-inf'}..${e.max ?? 'inf'}; got: ${n.length}`)\n\treturn n\n}\nfunction asHexString(n, e) {\n\tif (!isHexString(n)) throw new TypeError(`Expected hex string${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\tconst t = n.replace(/^0x/, '')\n\tif (t.length % 2 !== 0) throw RangeError(`Expected even number of hex digits${e?.name ? ` for ${e.name}` : ''}; got: ` + n)\n\tif (e && e.byteLength && t.length !== e.byteLength * 2) throw RangeError(`Expected hex string${e?.name ? ` for ${e.name}` : ''} of byte length ${e.byteLength}; got: ` + t)\n\treturn t\n}\nfunction asSafeString(n, e) {\n\tif (\n\t\t!asString(n, e)\n\t\t\t.split('')\n\t\t\t.every(t => t === '_' || isLetterOrDigit(t))\n\t)\n\t\tthrow new TypeError(`Expected safe string${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction checkLimits(n, e) {\n\tif ((e.min !== void 0 && n < e.min) || (e.max !== void 0 && n > e.max)) throw RangeError(`Expected value${e?.name ? ` for ${e.name}` : ''} in range: ${e.min ?? '-inf'}..${e.max ?? 'inf'}; got: ${n}`)\n}\nfunction asFunction(n, e) {\n\tif (!isFunction(n)) throw new TypeError(`Expected function${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction asNumber(n, e) {\n\tif (isNumber(n)) return e && checkLimits(n, e), n\n\tif (!isString(n) || !n.match(/^-?\\d+(\\.\\d+)?$/)) throw new TypeError(`Expected number${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\tconst t = parseFloat(n)\n\treturn e && checkLimits(t, e), t\n}\nfunction asInteger(n, e) {\n\treturn asNumber(n, e) | 0\n}\nfunction asBoolean(n, e) {\n\tif (n === 'true') return !0\n\tif (n === 'false') return !1\n\tif (!isBoolean(n)) throw new TypeError(`Expected boolean${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction asDate(n, e) {\n\tif (!isDate(n)) throw new TypeError(`Expected date${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction asNullableString(n) {\n\treturn isBlank(n) ? null : n\n}\nfunction asEmptiableString(n, e) {\n\tif (!isString(n)) throw new TypeError(`Expected string${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction asId(n, e) {\n\tif (isId(n)) return n\n\tconst t = parseInt(n, 10)\n\tif (!isId(t)) throw new TypeError(`Expected id${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn t\n}\nfunction asTime(n, e) {\n\tif (!isString(n)) throw new TypeError(`Expected time${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\tconst t = n.split(':')\n\tif (t.length !== 2) throw new TypeError(`Expected time${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\tconst r = parseInt(t[0], 10),\n\t\to = parseInt(t[1], 10)\n\tif (!isNumber(r) || !isNumber(o) || r < 0 || r > 23 || o < 0 || o > 59) throw new TypeError(`Expected time, got${e?.name ? ` for ${e.name}` : ''}: ` + n)\n\treturn `${String(r).padStart(2, '0')}:${String(o).padStart(2, '0')}`\n}\nfunction asArray(n, e) {\n\tif (!Array.isArray(n)) throw new TypeError(`Expected array${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction asObject(n, e) {\n\tif (!isStrictlyObject(n)) throw new TypeError(`Expected object${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction asNullableObject(n, e) {\n\treturn n === null ? null : asObject(n, e)\n}\nfunction asStringMap(n, e) {\n\tconst t = asObject(n, e)\n\tfor (const r of Object.keys(t)) if (!isString(t[r])) throw new TypeError(`Expected string map${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn t\n}\nfunction asNumericDictionary(n, e) {\n\tconst t = asObject(n),\n\t\tr = Object.keys(t),\n\t\to = Object.values(t)\n\tif (!r.every(isString) || !o.every(isNumber)) throw new TypeError(`Expected numeric dictionary${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn t\n}\nfunction isUrl(n) {\n\treturn isString(n) && n.match(/^https?:\\/\\/.+/) !== null\n}\nfunction asUrl(n, e) {\n\tif (!isUrl(n)) throw new TypeError(`Expected url${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction isNullable(n, e) {\n\treturn e == null ? !0 : n(e)\n}\nfunction asNullable(n, e) {\n\treturn e == null ? null : n(e)\n}\nfunction asEmptiable(n, e) {\n\treturn e === '' ? void 0 : n(e)\n}\nfunction asOptional(n, e) {\n\treturn e == null ? void 0 : n(e)\n}\nfunction enforceObjectShape(n, e) {\n\tfor (const [t, r] of Object.entries(e)) if (!r(n[t])) throw TypeError(`${t} in value does not exist or match shape`)\n\tfor (const t of Object.keys(n)) if (!e[t]) throw TypeError(`${t} exists in value but not in shape`)\n\treturn !0\n}\nfunction enforceArrayShape(n, e) {\n\treturn n.every(t => enforceObjectShape(t, e))\n}\nfunction represent(n, e = 'json', t = 0) {\n\tif (n && isFunction(n.represent)) {\n\t\tconst r = n.represent()\n\t\tif (isString(r)) return e === 'json' && t === 0 ? JSON.stringify(r) : r\n\t}\n\tif (isObject(n, !1)) {\n\t\tif (t > 1) return '[object Object]'\n\t\tif (e === 'json') {\n\t\t\tif (Array.isArray(n)) {\n\t\t\t\tconst o = n.map(i => represent(i, 'json', t + 1))\n\t\t\t\treturn t === 0 ? JSON.stringify(o) : o\n\t\t\t}\n\t\t\tconst r = {}\n\t\t\tn.message && (r.message = represent(n.message, 'json', t + 1))\n\t\t\tfor (const [o, i] of Object.entries(n)) r[o] = represent(i, 'json', t + 1)\n\t\t\treturn t === 0 ? JSON.stringify(r) : r\n\t\t} else if (e === 'key-value') {\n\t\t\tconst r = Object.keys(n)\n\t\t\treturn n.message && !r.includes('message') && r.unshift('message'), r.map(o => `${o}=${JSON.stringify(represent(n[o], 'json', t + 1))}`).join(' ')\n\t\t}\n\t}\n\treturn isUndefined(n) && (n = 'undefined'), t === 0 ? JSON.stringify(n) : n\n}\nfunction expandError(n, e) {\n\tif (isString(n)) return n\n\tconst t = Object.keys(n)\n\tn.message && !t.includes('message') && t.push('message')\n\tconst r = t.map(o => `${o}: ${n[o]}`).join('; ')\n\treturn e && n.stack\n\t\t? r +\n\t\t\t\t`\n` +\n\t\t\t\tn.stack\n\t\t: r\n}\nfunction deepMergeInPlace(n, e) {\n\tif (isStrictlyObject(n) && isStrictlyObject(e)) for (const t in e) isStrictlyObject(e[t]) ? (n[t] || (n[t] = {}), deepMergeInPlace(n[t], e[t])) : Array.isArray(e[t]) ? (n[t] = [...e[t]]) : ((e[t] !== null && e[t] !== void 0) || n[t] === null || n[t] === void 0) && (n[t] = e[t])\n\treturn n\n}\nfunction deepMerge2(n, e) {\n\tconst t = {}\n\treturn deepMergeInPlace(t, n), deepMergeInPlace(t, e), t\n}\nfunction deepMerge3(n, e, t) {\n\tconst r = {}\n\treturn deepMergeInPlace(r, n), deepMergeInPlace(r, e), deepMergeInPlace(r, t), r\n}\nfunction zip(n, e) {\n\tconst t = {}\n\tfor (const r of n) for (const o of Object.keys(r)) t[o] ? (t[o] = e(t[o], r[o])) : (t[o] = r[o])\n\treturn t\n}\nfunction zipSum(n) {\n\treturn zip(n, (e, t) => e + t)\n}\nfunction pushToBucket(n, e, t) {\n\tn[e] || (n[e] = []), n[e].push(t)\n}\nfunction unshiftAndLimit(n, e, t) {\n\tfor (n.unshift(e); n.length > t; ) n.pop()\n}\nfunction atRolling(n, e) {\n\tlet t = e % n.length\n\treturn t < 0 && (t += n.length), n[t]\n}\nfunction pushAll(n, e) {\n\tArray.prototype.push.apply(n, e)\n}\nfunction unshiftAll(n, e) {\n\tArray.prototype.unshift.apply(n, e)\n}\nasync function mapAllAsync(n, e) {\n\tconst t = []\n\tfor (const r of n) t.push(await e(r))\n\treturn t\n}\nfunction glue(n, e) {\n\tconst t = []\n\tfor (let r = 0; r < n.length; r++) t.push(n[r]), r < n.length - 1 && (isFunction(e) ? t.push(e()) : t.push(e))\n\treturn t\n}\nfunction asEqual(n, e) {\n\tif (n !== e) throw Error(`Expected [${n}] to equal [${e}]`)\n\treturn [n, e]\n}\nfunction asTrue(n) {\n\tif (n !== !0) throw Error(`Expected [true], got: [${n}]`)\n\treturn n\n}\nfunction asTruthy(n) {\n\tif (!n) throw Error(`Expected truthy value, got: [${n}]`)\n\treturn n\n}\nfunction asFalse(n) {\n\tif (n !== !1) throw Error(`Expected [false], got: [${n}]`)\n\treturn n\n}\nfunction asFalsy(n) {\n\tif (n) throw Error(`Expected falsy value, got: [${n}]`)\n\treturn n\n}\nfunction asEither(n, e) {\n\tif (!e.includes(n)) throw Error(`Expected any of [${e.join(', ')}], got: [${n}]`)\n\treturn n\n}\nfunction scheduleMany(n, e) {\n\tfor (let t = 0; t < n.length; t++) {\n\t\tconst r = n[t],\n\t\t\to = e[t],\n\t\t\ti = Math.max(0, o.getTime() - Date.now())\n\t\tsetTimeout(r, i)\n\t}\n}\nfunction interpolate(n, e, t) {\n\treturn n + (e - n) * t\n}\nfunction sum(n) {\n\treturn n.reduce((e, t) => e + t, 0)\n}\nfunction average(n) {\n\treturn n.reduce((e, t) => e + t, 0) / n.length\n}\nfunction median(n) {\n\tconst e = [...n].sort((r, o) => r - o),\n\t\tt = Math.floor(e.length / 2)\n\treturn e.length % 2 === 0 ? (e[t] + e[t - 1]) / 2 : e[t]\n}\nfunction getDistanceFromMidpoint(n, e) {\n\treturn n - (e - 1) / 2\n}\nfunction range(n, e) {\n\tconst t = []\n\tfor (let r = n; r <= e; r++) t.push(r)\n\treturn t\n}\nfunction includesAny(n, e) {\n\treturn e.some(t => n.includes(t))\n}\nfunction isChinese(n) {\n\treturn /^[\\u4E00-\\u9FA5]+$/.test(n)\n}\nfunction slugify(n, e = () => !1) {\n\treturn n\n\t\t.toLowerCase()\n\t\t.normalize('NFD')\n\t\t.replace(/[\\u0300-\\u036f]/g, '')\n\t\t.split('')\n\t\t.map(t => (/[a-z0-9]/.test(t) || e(t) ? t : '-'))\n\t\t.join('')\n\t\t.replace(/-+/g, '-')\n\t\t.replace(/^-|-$/g, '')\n}\nfunction normalForm(n) {\n\treturn slugify(n).replaceAll('-', '')\n}\nfunction camelToTitle(n) {\n\treturn capitalize(n.replace(/([A-Z])/g, ' $1'))\n}\nfunction slugToTitle(n) {\n\treturn n.split('-').map(capitalize).join(' ')\n}\nfunction slugToCamel(n) {\n\treturn decapitalize(n.split('-').map(capitalize).join(''))\n}\nfunction joinHumanly(n, e = ', ', t = ' and ') {\n\treturn !n || !n.length ? '' : n.length === 1 ? n[0] : n.length === 2 ? `${n[0]}${t}${n[1]}` : `${n.slice(0, n.length - 1).join(e)}${t}${n[n.length - 1]}`\n}\nfunction surroundInOut(n, e) {\n\treturn e + n.split('').join(e) + e\n}\nfunction enumify(n) {\n\treturn slugify(n).replace(/-/g, '_').toUpperCase()\n}\nfunction getFuzzyMatchScore(n, e) {\n\tif (e.length === 0) return 0\n\tconst t = n.toLowerCase(),\n\t\tr = e.toLowerCase()\n\treturn n === e ? 1e4 : t.startsWith(r) ? 1e4 - n.length : t.includes(r) ? 5e3 - n.length : new RegExp('.*' + r.split('').join('.*') + '.*').test(t) ? 1e3 - n.length : 0\n}\nfunction sortByFuzzyScore(n, e) {\n\treturn n.filter(t => getFuzzyMatchScore(t, e)).sort((t, r) => getFuzzyMatchScore(r, e) - getFuzzyMatchScore(t, e))\n}\nfunction escapeHtml(n) {\n\treturn n.replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"')\n}\nconst htmlEntityMap = { '&': '&', '"': '\"', ''': \"'\", '>': '>', '<': '<' }\nfunction decodeHtmlEntities(n) {\n\tlet e = n.replace(/&#(\\d+);/g, (t, r) => String.fromCharCode(r)).replace(/&#x(\\d+);/g, (t, r) => String.fromCharCode(parseInt(r, 16)))\n\tfor (const [t, r] of Object.entries(htmlEntityMap)) e = e.replaceAll(t, r)\n\treturn e\n}\nfunction before(n, e) {\n\tconst t = n.indexOf(e)\n\treturn t === -1 ? null : n.slice(0, t)\n}\nfunction after(n, e) {\n\tconst t = n.indexOf(e)\n\treturn t === -1 ? null : n.slice(t + e.length)\n}\nfunction beforeLast(n, e) {\n\tconst t = n.lastIndexOf(e)\n\treturn t === -1 ? null : n.slice(0, t)\n}\nfunction afterLast(n, e) {\n\tconst t = n.lastIndexOf(e)\n\treturn t === -1 ? null : n.slice(t + e.length)\n}\nfunction betweenWide(n, e, t) {\n\tconst r = beforeLast(n, t)\n\treturn r ? after(r, e) : null\n}\nfunction betweenNarrow(n, e, t) {\n\tconst r = after(n, e)\n\treturn r ? before(r, t) : null\n}\nfunction splitOnce(n, e, t = !1) {\n\tconst r = t ? n.lastIndexOf(e) : n.indexOf(e)\n\treturn r === -1 ? (t ? [null, n] : [n, null]) : [n.slice(0, r), n.slice(r + e.length)]\n}\nfunction splitAll(n, e) {\n\tlet t = [n]\n\tfor (const r of e) t = t.flatMap(o => o.split(r))\n\treturn t.filter(r => r)\n}\nfunction getExtension(n) {\n\tconst e = last(n.split(/\\\\|\\//g)),\n\t\tt = e.lastIndexOf('.', e.length - 1)\n\treturn t <= 0 ? '' : e.slice(t + 1)\n}\nfunction getBasename(n) {\n\tconst e = last(n.split(/\\\\|\\//g)),\n\t\tt = e.lastIndexOf('.', e.length - 1)\n\treturn t <= 0 ? e : e.slice(0, t)\n}\nfunction normalizeEmail(n) {\n\tlet [e, t] = n.split('@')\n\te = shrinkTrim(e.replaceAll('.', '').toLowerCase()).replaceAll(' ', '')\n\tconst [r] = e.split('+')\n\tif (!r || !t || t.indexOf('.') === -1 || t.indexOf('.') === t.length - 1) throw new Error('Invalid email')\n\treturn (t = shrinkTrim(t.toLowerCase()).replaceAll(' ', '')), `${r}@${t}`\n}\nfunction normalizeFilename(n) {\n\tconst e = getBasename(n),\n\t\tt = getExtension(n)\n\treturn t ? `${e}.${t}` : e\n}\nfunction parseFilename(n) {\n\tconst e = getBasename(n),\n\t\tt = getExtension(n)\n\treturn { basename: e, extension: t, filename: t ? `${e}.${t}` : e }\n}\nfunction randomize(n, e = Math.random) {\n\treturn n.replace(/\\{(.+?)\\}/g, (t, r) => pick(r.split('|'), e))\n}\nfunction expand(n) {\n\tconst e = /\\{(.+?)\\}/,\n\t\tt = n.match(e)\n\tif (!t || !t.index) return [n]\n\tconst r = t[1].split(','),\n\t\to = n.slice(0, t.index),\n\t\ti = n.slice(t.index + t[0].length)\n\tlet u = []\n\tfor (const s of r) {\n\t\tconst c = expand(o + s + i)\n\t\tu = u.concat(c)\n\t}\n\treturn u\n}\nfunction shrinkTrim(n) {\n\treturn n\n\t\t.split(\n\t\t\t`\n`\n\t\t)\n\t\t.map(e => e.trim().replace(/\\s+/g, ' '))\n\t\t.filter(e => e.length > 0).join(`\n`)\n}\nfunction capitalize(n) {\n\treturn n.charAt(0).toUpperCase() + n.slice(1)\n}\nfunction decapitalize(n) {\n\treturn n.charAt(0).toLowerCase() + n.slice(1)\n}\nfunction isLetter(n) {\n\tif (!n) return !1\n\tconst e = n.charCodeAt(0)\n\treturn (e >= 65 && e <= 90) || (e >= 97 && e <= 122)\n}\nfunction isDigit(n) {\n\tif (!n) return !1\n\tconst e = n.charCodeAt(0)\n\treturn e >= 48 && e <= 57\n}\nfunction isLetterOrDigit(n) {\n\treturn isLetter(n) || isDigit(n)\n}\nconst wordBreakCharacters = ` \n\t\\r.,?!:;\"'\\`(){}[]~@#$%^&*-+=|<>/\\\\`.split('')\nfunction isWordBreakCharacter(n) {\n\treturn wordBreakCharacters.includes(n)\n}\nfunction isValidObjectPathCharacter(n) {\n\treturn isLetterOrDigit(n) || n === '.' || n === '[' || n === ']' || n === '_'\n}\nfunction insertString(n, e, t, r, o) {\n\treturn n.slice(0, e) + r + n.slice(e, e + t) + o + n.slice(e + t)\n}\nfunction indexOfRegex(n, e, t = 0) {\n\tconst r = e.exec(n.slice(t))\n\treturn r ? { index: r.index, match: r[0] } : null\n}\nfunction lineMatches(n, e, t = !0) {\n\tif (!t) return e.every(o => (o instanceof RegExp ? o.test(n) : n.indexOf(o, 0) !== -1))\n\tlet r = 0\n\tfor (const o of e)\n\t\tif (o instanceof RegExp) {\n\t\t\tconst i = indexOfRegex(n, o, r)\n\t\t\tif (!i) return !1\n\t\t\tr = i.index + i.match.length\n\t\t} else {\n\t\t\tconst i = n.indexOf(o, r)\n\t\t\tif (i === -1) return !1\n\t\t\tr = i + o.length\n\t\t}\n\treturn !0\n}\nfunction linesMatchInOrder(n, e, t = !0) {\n\tlet r = 0\n\tfor (const o of e) {\n\t\tlet i = !1\n\t\tfor (; !i && r < n.length; ) lineMatches(n[r], o, t) && (i = !0), r++\n\t\tif (!i) return !1\n\t}\n\treturn !0\n}\nfunction csvEscape(n) {\n\treturn n.match(/\"|,/) ? `\"${n.replace(/\"/g, '\"\"')}\"` : n\n}\nfunction allIndexOf(n, e, t = 0) {\n\tconst r = []\n\tlet o = n.indexOf(e, t)\n\tfor (; o !== -1; ) r.push(o), (o = n.indexOf(e, o + e.length))\n\treturn r\n}\nfunction indexOfEarliest(n, e, t = 0) {\n\tlet r = -1\n\tfor (const o of e) {\n\t\tconst i = n.indexOf(o, t)\n\t\ti !== -1 && (r === -1 || i < r) && (r = i)\n\t}\n\treturn r\n}\nfunction indexOfWordBreak(n, e = 0) {\n\tfor (let t = e; t < n.length; t++) if (isWordBreakCharacter(n[t])) return t\n\treturn -1\n}\nfunction indexOfHashtag(n, e = 0) {\n\tfor (let t = e; t < n.length; t++) if (n[t] === '#' && isLetterOrDigit(n[t + 1])) return t\n\treturn -1\n}\nfunction lastIndexOfBefore(n, e, t = 0) {\n\treturn n.slice(0, t).lastIndexOf(e)\n}\nfunction findWeightedPair(n, e = 0, t = '{', r = '}') {\n\tlet o = 1\n\tfor (let i = e; i < n.length; i++)\n\t\tif (n.slice(i, i + r.length) === r) {\n\t\t\tif (--o === 0) return i\n\t\t} else n.slice(i, i + t.length) === t && o++\n\treturn -1\n}\nfunction extractBlock(n, e) {\n\tconst t = e.wordBoundary\n\t\t? indexOfEarliest(\n\t\t\t\tn,\n\t\t\t\t[\n\t\t\t\t\t`${e.opening} `,\n\t\t\t\t\t`${e.opening}\n`\n\t\t\t\t],\n\t\t\t\te.start || 0\n\t\t )\n\t\t: n.indexOf(e.opening, e.start || 0)\n\tif (t === -1) return null\n\tconst r = findWeightedPair(n, t + e.opening.length, e.opening, e.closing)\n\treturn r === -1 ? null : e.exclusive ? n.slice(t + e.opening.length, r) : n.slice(t, r + e.closing.length)\n}\nfunction extractAllBlocks(n, e) {\n\tconst t = []\n\tlet r = e.wordBoundary\n\t\t? indexOfEarliest(\n\t\t\t\tn,\n\t\t\t\t[\n\t\t\t\t\t`${e.opening} `,\n\t\t\t\t\t`${e.opening}\n`\n\t\t\t\t],\n\t\t\t\te.start || 0\n\t\t )\n\t\t: n.indexOf(e.opening, e.start || 0)\n\tfor (;;) {\n\t\tif (r === -1) return t\n\t\tconst o = extractBlock(n, { ...e, start: r })\n\t\tif (!o) return t\n\t\tt.push(o),\n\t\t\t(r = e.wordBoundary\n\t\t\t\t? indexOfEarliest(\n\t\t\t\t\t\tn,\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t`${e.opening} `,\n\t\t\t\t\t\t\t`${e.opening}\n`\n\t\t\t\t\t\t],\n\t\t\t\t\t\tr + o.length\n\t\t\t\t )\n\t\t\t\t: n.indexOf(e.opening, r + o.length))\n\t}\n}\nfunction replaceBlocks(n, e, t) {\n\tlet r = 0\n\tfor (;;) {\n\t\tconst o = exports.Strings.extractBlock(n, { ...t, start: r })\n\t\tif (!o) return n\n\t\tconst i = e(o)\n\t\t;(r = n.indexOf(o, r) + i.length), (n = n.replace(o, i))\n\t}\n}\nfunction splitFormatting(n, e) {\n\tconst t = []\n\tlet r = 0\n\tfor (; r < n.length; ) {\n\t\tconst o = n.indexOf(e, r)\n\t\tif (o === -1) {\n\t\t\tt.push({ string: n.slice(r), symbol: null })\n\t\t\tbreak\n\t\t}\n\t\tconst i = n.indexOf(e, o + e.length)\n\t\tif ((o > r && i !== -1 && t.push({ string: n.slice(r, o), symbol: null }), i === -1)) {\n\t\t\tt.push({ string: n.slice(r), symbol: null })\n\t\t\tbreak\n\t\t}\n\t\tt.push({ string: n.slice(o + e.length, i), symbol: e }), (r = i + e.length)\n\t}\n\treturn t\n}\nfunction splitHashtags(n) {\n\tconst e = []\n\tlet t = 0\n\tfor (; t < n.length; ) {\n\t\tconst r = indexOfHashtag(n, t)\n\t\tif (r === -1) {\n\t\t\te.push({ string: n.slice(t), symbol: null })\n\t\t\tbreak\n\t\t}\n\t\tconst o = indexOfWordBreak(n, r + 1)\n\t\tif (o === -1) {\n\t\t\te.push({ string: n.slice(t, r), symbol: null }), e.push({ string: n.slice(r + 1), symbol: '#' })\n\t\t\tbreak\n\t\t}\n\t\tr > t && e.push({ string: n.slice(t, r), symbol: null }), e.push({ string: n.slice(r + 1, o), symbol: '#' }), (t = o)\n\t}\n\treturn e\n}\nfunction splitUrls(n) {\n\tconst e = []\n\tlet t = 0\n\tfor (; t < n.length; ) {\n\t\tconst r = indexOfEarliest(n, ['http://', 'https://'], t)\n\t\tif (r === -1) {\n\t\t\te.push({ string: n.slice(t), symbol: null })\n\t\t\tbreak\n\t\t}\n\t\tconst o = indexOfEarliest(\n\t\t\tn,\n\t\t\t[\n\t\t\t\t' ',\n\t\t\t\t`\n`\n\t\t\t],\n\t\t\tr\n\t\t)\n\t\tif (o === -1) {\n\t\t\tr > t && e.push({ string: n.slice(t, r), symbol: null }), e.push({ string: n.slice(r), symbol: 'http' })\n\t\t\tbreak\n\t\t}\n\t\tr > t && e.push({ string: n.slice(t, r), symbol: null }), e.push({ string: n.slice(r, o), symbol: 'http' }), (t = o)\n\t}\n\treturn e\n}\nconst BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\tBASE32_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'\nfunction base64ToUint8Array(n) {\n\treturn baseToUint8Array(n, BASE64_CHARS)\n}\nfunction uint8ArrayToBase64(n) {\n\treturn uint8ArrayToBase(n, BASE64_CHARS)\n}\nfunction base32ToUint8Array(n) {\n\treturn baseToUint8Array(n, BASE32_CHARS)\n}\nfunction uint8ArrayToBase32(n) {\n\treturn uint8ArrayToBase(n, BASE32_CHARS)\n}\nfunction baseToUint8Array(n, e) {\n\tconst t = '=',\n\t\tr = e.length\n\tlet o = 0,\n\t\ti = 0\n\tconst u = []\n\tfor (let s = 0; s < n.length; s++) {\n\t\tconst c = n[s]\n\t\tif (c === t) break\n\t\tconst f = e.indexOf(c)\n\t\tif (f === -1) throw new Error(`Invalid character: ${c}`)\n\t\t;(i = (i << Math.log2(r)) | f), (o += Math.log2(r)), o >= 8 && ((o -= 8), u.push((i >> o) & 255))\n\t}\n\treturn new Uint8Array(u)\n}\nfunction uint8ArrayToBase(n, e) {\n\tconst t = e.length\n\tlet r = 0,\n\t\to = 0,\n\t\ti = ''\n\tfor (let u = 0; u < n.length; u++) for (o = (o << 8) | n[u], r += 8; r >= Math.log2(t); ) (r -= Math.log2(t)), (i += e[(o >> r) & (t - 1)])\n\treturn r > 0 && (i += e[(o << (Math.log2(t) - r)) & (t - 1)]), i.length % 4 !== 0 && (i += '='.repeat(4 - (i.length % 4))), i\n}\nfunction hexToUint8Array(n) {\n\t;(n.startsWith('0x') || n.startsWith('0X')) && (n = n.slice(2))\n\tconst e = n.length / 2,\n\t\tt = new Uint8Array(e)\n\tfor (let r = 0; r < e; r++) {\n\t\tconst o = parseInt(n.slice(r * 2, r * 2 + 2), 16)\n\t\tt[r] = o\n\t}\n\treturn t\n}\nfunction uint8ArrayToHex(n) {\n\treturn Array.from(n)\n\t\t.map(e => e.toString(16).padStart(2, '0'))\n\t\t.join('')\n}\nfunction uint8ArrayToBinary(n) {\n\treturn Array.from(n)\n\t\t.map(e => e.toString(2).padStart(8, '0'))\n\t\t.join('')\n}\nfunction binaryToUint8Array(n) {\n\tconst e = Math.ceil(n.length / 8),\n\t\tt = new Uint8Array(e)\n\tfor (let r = 0; r < e; r++) {\n\t\tconst o = parseInt(n.slice(r * 8, r * 8 + 8), 2)\n\t\tt[r] = o\n\t}\n\treturn t\n}\nfunction route(n, e) {\n\tconst t = n.split('/').filter(i => i),\n\t\tr = e.split('/').filter(i => i)\n\tif (t.length !== r.length) return null\n\tconst o = {}\n\tfor (let i = 0; i < t.length; i++) {\n\t\tconst u = t[i]\n\t\tif (u.startsWith(':')) o[u.slice(1)] = r[i]\n\t\telse if (u !== r[i]) return null\n\t}\n\treturn o\n}\nfunction explodeReplace(n, e, t) {\n\tconst r = []\n\tfor (const o of t) o !== e && r.push(n.replace(e, o))\n\treturn r\n}\nfunction generateVariants(n, e, t, r = Math.random) {\n\tconst o = exports.Arrays.shuffle(\n\t\t\te.map(u => ({\n\t\t\t\tvariants: exports.Arrays.shuffle(\n\t\t\t\t\tu.variants.map(s => s),\n\t\t\t\t\tr\n\t\t\t\t),\n\t\t\t\tavoid: u.avoid\n\t\t\t})),\n\t\t\tr\n\t\t),\n\t\ti = []\n\tfor (const u of o) {\n\t\tconst s = u.variants.filter(f => f !== u.avoid),\n\t\t\tc = s.find(f => n.includes(f))\n\t\tif (c && (pushAll(i, explodeReplace(n, c, s)), i.length >= t)) break\n\t}\n\tif (i.length < t)\n\t\tfor (const u of o) {\n\t\t\tconst s = u.variants.find(c => n.includes(c))\n\t\t\tif (s && (pushAll(i, explodeReplace(n, s, u.variants)), i.length >= t)) break\n\t\t}\n\treturn i.slice(0, t)\n}\nfunction replaceWord(n, e, t, r = !1) {\n\tconst o = new RegExp(r ? `(?<=\\\\s|^)${e}(?=\\\\s|$)` : `\\\\b${e}\\\\b`, 'g')\n\treturn n.replace(o, t)\n}\nfunction replacePascalCaseWords(n, e) {\n\tconst t = /\\b[A-Z][a-zA-Z0-9]*\\b/g\n\treturn n.replace(t, r => (r.toUpperCase() === r ? r : e(r)))\n}\nfunction stripHtml(n) {\n\treturn n.replace(/<[^>]*>/g, '')\n}\nfunction breakLine(n) {\n\tconst e = n.lastIndexOf(' ')\n\tif (e === -1) return { line: n, rest: '' }\n\tconst t = n.slice(0, e),\n\t\tr = n.slice(e + 1)\n\treturn { line: t, rest: r }\n}\nfunction measureTextWidth(n, e = {}) {\n\treturn [...n].reduce((t, r) => t + (e[r] || 1), 0)\n}\nfunction toLines(n, e, t = {}) {\n\tconst r = []\n\tlet o = '',\n\t\ti = 0\n\tfor (let u = 0; u < n.length; u++) {\n\t\tconst s = n[u],\n\t\t\tc = t[s] || 1\n\t\tif (((o += s), (i += c), i > e)) {\n\t\t\tconst { line: f, rest: l } = breakLine(o)\n\t\t\tr.push(f),\n\t\t\t\t(o = l),\n\t\t\t\t(i = l\n\t\t\t\t\t.split('')\n\t\t\t\t\t.map(a => t[a] || 1)\n\t\t\t\t\t.reduce((a, h) => a + h, 0))\n\t\t}\n\t}\n\treturn o && r.push(o), r\n}\nfunction levenshteinDistance(n, e) {\n\tconst t = []\n\tfor (let r = 0; r <= n.length; r++) t[r] = [r]\n\tfor (let r = 0; r <= e.length; r++) t[0][r] = r\n\tfor (let r = 1; r <= n.length; r++)\n\t\tfor (let o = 1; o <= e.length; o++) {\n\t\t\tconst i = n[r - 1] === e[o - 1] ? 0 : 1\n\t\t\tt[r][o] = Math.min(t[r - 1][o] + 1, t[r][o - 1] + 1, t[r - 1][o - 1] + i)\n\t\t}\n\treturn t[n.length][e.length]\n}\nfunction findCommonPrefix(n) {\n\tconst e = n.reduce((r, o) => (r.length < o.length ? r : o))\n\tlet t = ''\n\tfor (let r = 0; r < e.length; r++) {\n\t\tconst o = e[r]\n\t\tif (n.every(i => i[r] === o)) t += o\n\t\telse break\n\t}\n\treturn t\n}\nfunction findCommonDirectory(n) {\n\tconst e = findCommonPrefix(n),\n\t\tt = e.lastIndexOf('/')\n\treturn t === -1 ? '' : e.slice(0, t + 1)\n}\nfunction containsWord(n, e) {\n\treturn new RegExp(`\\\\b${e}\\\\b`).test(n)\n}\nfunction containsWords(n, e, t) {\n\treturn t === 'any' ? e.some(r => containsWord(n, r)) : e.every(r => containsWord(n, r))\n}\nfunction parseHtmlAttributes(n) {\n\tconst e = {},\n\t\tt = n.match(/([a-z\\-]+)=\"([^\"]+)\"/g)\n\tif (t)\n\t\tfor (const r of t) {\n\t\t\tconst [o, i] = splitOnce(r, '=')\n\t\t\te[o] = i.slice(1, i.length - 1)\n\t\t}\n\treturn e\n}\nfunction readNextWord(n, e, t = []) {\n\tlet r = ''\n\tfor (; e < n.length && (isLetterOrDigit(n[e]) || t.includes(n[e])); ) r += n[e++]\n\treturn r\n}\nfunction readWordsAfterAll(n, e, t = []) {\n\tconst r = allIndexOf(n, e),\n\t\to = []\n\tfor (const i of r) o.push(readNextWord(n, i + e.length, t))\n\treturn o\n}\nfunction resolveVariables(n, e, t = '$', r = ':') {\n\tfor (const o in e) n = resolveVariableWithDefaultSyntax(n, o, e[o], t, r)\n\treturn (n = resolveRemainingVariablesWithDefaults(n)), n\n}\nfunction resolveVariableWithDefaultSyntax(n, e, t, r = '$', o = ':') {\n\tif (t === '') return n\n\tlet i = n.indexOf(`${r}${e}`)\n\tfor (; i !== -1; ) {\n\t\tif (n[i + e.length + 1] === o)\n\t\t\tif (n[i + e.length + 2] === o) n = n.replace(`${r}${e}${o}${o}`, t)\n\t\t\telse {\n\t\t\t\tconst s = readNextWord(n, i + e.length + 2, ['_'])\n\t\t\t\tn = n.replace(`${r}${e}${o}${s}`, t)\n\t\t\t}\n\t\telse n = n.replace(`${r}${e}`, t)\n\t\ti = n.indexOf(`${r}${e}`, i + t.length)\n\t}\n\treturn n\n}\nfunction resolveRemainingVariablesWithDefaults(n, e = '$', t = ':') {\n\tlet r = n.indexOf(e)\n\tfor (; r !== -1; ) {\n\t\tconst o = readNextWord(n, r + 1)\n\t\tif (n[r + o.length + 1] === t)\n\t\t\tif (n[r + o.length + 2] === t) n = n.replace(`${e}${o}${t}${t}`, '')\n\t\t\telse {\n\t\t\t\tconst u = readNextWord(n, r + o.length + 2)\n\t\t\t\tn = n.replace(`${e}${o}${t}${u}`, u)\n\t\t\t}\n\t\tr = n.indexOf(e, r + 1)\n\t}\n\treturn n\n}\nfunction resolveMarkdownLinks(n, e) {\n\tlet t = n.indexOf('](')\n\tfor (; t !== -1; ) {\n\t\tconst r = lastIndexOfBefore(n, '[', t),\n\t\t\to = n.indexOf(')', t)\n\t\tif (r !== -1 && o !== -1) {\n\t\t\tconst [i, u] = n.slice(r + 1, o).split(']('),\n\t\t\t\ts = e(i, u)\n\t\t\tn = n.slice(0, r) + s + n.slice(o + 1)\n\t\t}\n\t\tt = n.indexOf('](', t + 1)\n\t}\n\treturn n\n}\nfunction toQueryString(n, e = !0) {\n\tconst t = Object.entries(n)\n\t\t.filter(([r, o]) => o != null)\n\t\t.map(([r, o]) => `${r}=${encodeURIComponent(o)}`)\n\t\t.join('&')\n\treturn t ? (e ? '?' : '') + t : ''\n}\nfunction parseQueryString(n) {\n\tconst e = {},\n\t\tt = n.split('&')\n\tfor (const r of t) {\n\t\tconst [o, i] = r.split('=')\n\t\to && i && (e[o] = decodeURIComponent(i))\n\t}\n\treturn e\n}\nfunction hasKey(n, e) {\n\treturn Object.prototype.hasOwnProperty.call(n, e)\n}\nfunction selectMax(n, e) {\n\tlet t = null,\n\t\tr = -1 / 0\n\tfor (const [o, i] of Object.entries(n)) {\n\t\tconst u = e(i)\n\t\tu > r && ((r = u), (t = o))\n\t}\n\treturn t ? [t, n[t]] : null\n}\nfunction reposition(n, e, t, r) {\n\tconst o = n.find(u => u[e] === t),\n\t\ti = n.find(u => u[e] === t + r)\n\to && i ? ((o[e] = t + r), (i[e] = t)) : o && (o[e] = t + r), n.sort((u, s) => asNumber(u[e]) - asNumber(s[e])), n.forEach((u, s) => (u[e] = s + 1))\n}\nfunction unwrapSingleKey(n) {\n\tconst e = Object.keys(n)\n\tif (e.length === 1) return n[e[0]]\n\tthrow new Error('Expected object to have a single key')\n}\nfunction parseKeyValues(n, e = ':') {\n\treturn Object.fromEntries(\n\t\tn\n\t\t\t.map(t => splitOnce(t, e))\n\t\t\t.map(t => (t[0] && t[1] ? [shrinkTrim(t[0]), shrinkTrim(t[1])] : null))\n\t\t\t.filter(t => t)\n\t)\n}\nfunction buildUrl(n, e, t) {\n\treturn joinUrl([n, e]) + toQueryString(t || {})\n}\nfunction parseCsv(n, e = ',', t = '\"') {\n\tconst r = []\n\tlet o = '',\n\t\ti = !1\n\tconst u = n.split('')\n\tfor (const s of u) s === e && !i ? (r.push(o), (o = '')) : s === t && ((!o && !i) || i) ? (i = !i) : (o += s)\n\treturn r.push(o), r\n}\nfunction humanizeProgress(n) {\n\treturn `[${Math.floor(n.progress * 100)}%] ${humanizeTime(n.deltaMs)} out of ${humanizeTime(n.totalTimeMs)} (${humanizeTime(n.remainingTimeMs)} left) [${Math.round(n.baseTimeMs)} ms each]`\n}\nasync function waitFor(n, e) {\n\tlet t = e.requiredConsecutivePasses || 1,\n\t\tr = 0\n\tfor (let o = 0; o < e.attempts; o++) {\n\t\ttry {\n\t\t\tif (await n()) {\n\t\t\t\tif ((r++, r >= t)) return\n\t\t\t} else r = 0\n\t\t} catch {\n\t\t\tr = 0\n\t\t}\n\t\to < e.attempts - 1 && (await sleepMillis(e.waitMillis))\n\t}\n\tthrow Error('Timed out waiting for predicate')\n}\nfunction filterAndRemove(n, e) {\n\tconst t = []\n\tfor (let r = n.length - 1; r >= 0; r--) e(n[r]) && t.push(n.splice(r, 1)[0])\n\treturn t\n}\nfunction cloneWithJson(n) {\n\treturn JSON.parse(JSON.stringify(n))\n}\nfunction unixTimestamp(n) {\n\treturn Math.ceil((n || Date.now()) / 1e3)\n}\nfunction isoDate(n) {\n\treturn (n || new Date()).toISOString().slice(0, 10)\n}\nfunction dateTimeSlug(n) {\n\treturn (n || new Date()).toISOString().slice(0, 19).replace(/T|:/g, '-')\n}\nfunction fromUtcString(n) {\n\tconst e = new Date(n)\n\treturn new Date(e.getTime() - e.getTimezoneOffset() * 6e4)\n}\nfunction fromMillis(n) {\n\treturn new Date(n)\n}\nfunction createTimeDigits(n) {\n\treturn String(Math.floor(n)).padStart(2, '0')\n}\nfunction normalizeTime(n) {\n\tlet [e, t] = n.split(':')\n\tisNumber(parseInt(e, 10)) || (e = '0'), isNumber(parseInt(t, 10)) || (t = '0')\n\tlet r = clamp(asInteger(e), 0, 23),\n\t\to = clamp(asInteger(t), 0, 59)\n\treturn `${createTimeDigits(r)}:${createTimeDigits(o)}`\n}\nfunction humanizeTime(n) {\n\tconst e = Math.floor(n / 36e5)\n\tn = n % 36e5\n\tconst t = Math.floor(n / 6e4)\n\tn = n % 6e4\n\tconst r = Math.floor(n / 1e3)\n\treturn e ? `${createTimeDigits(e)}:${createTimeDigits(t)}:${createTimeDigits(r)}` : `${createTimeDigits(t)}:${createTimeDigits(r)}`\n}\nfunction absoluteDays(n) {\n\treturn Math.floor((isDate(n) ? n.getTime() : n) / 864e5)\n}\nconst DefaultTimestampLabels = { today: (n, e) => createTimeDigits(n) + ':' + createTimeDigits(e), yesterday: () => 'Yesterday', monday: () => 'Mon', tuesday: () => 'Tue', wednesday: () => 'Wed', thursday: () => 'Thu', friday: () => 'Fri', saturday: () => 'Sat', sunday: () => 'Sun', weeks: n => `${n}w` }\nfunction getTimestamp(n, e) {\n\tconst t = new Date(e?.now || Date.now()),\n\t\tr = e?.labels || DefaultTimestampLabels,\n\t\to = isDate(n) ? n : new Date(n)\n\tif (absoluteDays(t) === absoluteDays(o)) return r.today(o.getUTCHours(), o.getUTCMinutes(), o.getUTCHours() > 12)\n\tif (absoluteDays(t) - absoluteDays(o) === 1) return r.yesterday()\n\tconst i = getDayInfoFromDate(o)\n\treturn absoluteDays(t) - absoluteDays(o) < 7 ? r[i.day]() : r.weeks(Math.round((t.getTime() - o.getTime()) / 6048e5))\n}\nconst DefaultTimeDeltaLabels = { now: () => 'A few seconds', seconds: n => `${n} seconds`, minutes: n => `${n} minutes`, hours: n => `${n} hours`, days: n => `${n} days`, weeks: n => `${n} weeks` }\nfunction getTimeDelta(n, e) {\n\tconst t = e?.now ?? Date.now(),\n\t\tr = e?.labels || DefaultTimeDeltaLabels,\n\t\to = exports.Types.isDate(n) ? n.getTime() : n\n\tlet i = (t - o) / 1e3\n\treturn i < 10 ? r.now() : i < 120 ? r.seconds(Math.floor(i)) : ((i /= 60), i < 120 ? r.minutes(Math.floor(i)) : ((i /= 60), i < 48 ? r.hours(Math.floor(i)) : ((i /= 24), i < 14 ? r.days(Math.floor(i)) : ((i /= 7), r.weeks(Math.floor(i))))))\n}\nfunction secondsToHumanTime(n, e = DefaultTimeDeltaLabels) {\n\treturn getTimeDelta(0, { now: n * 1e3, labels: e })\n}\nfunction countCycles(n, e, t) {\n\tconst o = (t?.now ?? Date.now()) - n,\n\t\ti = Math.floor(o / e),\n\t\tu = e / (t?.precision ?? 1) - Math.ceil((o % e) / (t?.precision ?? 1))\n\treturn { cycles: i, remaining: u }\n}\nconst throttleTimers = {}\nfunction throttle(n, e) {\n\treturn !throttleTimers[n] || Date.now() > throttleTimers[n] ? ((throttleTimers[n] = Date.now() + e), !0) : !1\n}\nconst timeUnits = { s: 1e3, m: 6e4, h: 36e5, d: 864e5 }\nfunction timeSince(n, e, t) {\n\treturn (e = isDate(e) ? e.getTime() : e), (t = t ? (isDate(t) ? t.getTime() : t) : Date.now()), (t - e) / timeUnits[n]\n}\nfunction getProgress(n, e, t, r) {\n\tr || (r = Date.now())\n\tconst o = e / t,\n\t\ti = r - n,\n\t\tu = i / e,\n\t\ts = u * t,\n\t\tc = s - i\n\treturn { deltaMs: i, progress: o, baseTimeMs: u, totalTimeMs: s, remainingTimeMs: c }\n}\nconst dayNumberIndex = { 0: 'sunday', 1: 'monday', 2: 'tuesday', 3: 'wednesday', 4: 'thursday', 5: 'friday', 6: 'saturday' }\nfunction mapDayNumber(n) {\n\treturn { zeroBasedIndex: n, day: dayNumberIndex[n] }\n}\nfunction getDayInfoFromDate(n) {\n\treturn mapDayNumber(n.getDay())\n}\nfunction getDayInfoFromDateTimeString(n) {\n\treturn getDayInfoFromDate(new Date(n))\n}\nfunction seconds(n) {\n\treturn n * 1e3\n}\nfunction minutes(n) {\n\treturn n * 6e4\n}\nfunction hours(n) {\n\treturn n * 36e5\n}\nfunction days(n) {\n\treturn n * 864e5\n}\nconst dateUnits = { ms: 1, milli: 1, millis: 1, millisecond: 1, milliseconds: 1, s: 1e3, sec: 1e3, second: 1e3, seconds: 1e3, m: 6e4, min: 6e4, minute: 6e4, minutes: 6e4, h: 36e5, hour: 36e5, hours: 36e5, d: 864e5, day: 864e5, days: 864e5, w: 6048e5, week: 6048e5, weeks: 6048e5, month: 2592e6, months: 2592e6, y: 31536e6, year: 31536e6, years: 31536e6 }\nfunction makeDate(n) {\n\tconst e = parseFloat(n)\n\tif (isNaN(e)) throw Error('makeDate got NaN for input')\n\tconst t = n\n\t\t\t.replace(/^-?[0-9.]+/, '')\n\t\t\t.trim()\n\t\t\t.toLowerCase(),\n\t\tr = t === '' ? 1 : dateUnits[t]\n\tif (!r) throw Error(`Unknown unit: \"${t}\"`)\n\treturn Math.ceil(e * r)\n}\nconst storageUnitExponents = { b: 0, byte: 0, bytes: 0, kb: 1, kilobyte: 1, kilobytes: 1, mb: 2, megabyte: 2, megabytes: 2, gb: 3, gigabyte: 3, gigabytes: 3, tb: 4, terabyte: 4, terabytes: 4 }\nfunction makeStorage(n, e = 1024) {\n\tconst t = parseFloat(n)\n\tif (isNaN(t)) throw Error('makeStorage got NaN for input')\n\tconst r = n\n\t\t\t.replace(/^-?[0-9.]+/, '')\n\t\t\t.trim()\n\t\t\t.toLowerCase(),\n\t\to = r === '' ? 0 : storageUnitExponents[r]\n\tif (o == null) throw Error(`Unknown unit: \"${r}\"`)\n\treturn Math.ceil(t * e ** o)\n}\nfunction getPreLine(n) {\n\treturn n.replace(/ +/g, ' ').replace(/^ /gm, '')\n}\nconst tinyCache = new Map()\nasync function getCached(n, e, t) {\n\tconst r = Date.now(),\n\t\to = tinyCache.get(n)\n\tif (o && o.validUntil > r) return o.value\n\tconst i = await t(),\n\t\tu = r + e\n\treturn tinyCache.set(n, { value: i, validUntil: u }), i\n}\nfunction deleteFromCache(n) {\n\ttinyCache.delete(n)\n}\nfunction deleteExpiredFromCache() {\n\tconst n = Date.now()\n\tfor (const [e, t] of tinyCache.entries()) t.validUntil <= n && tinyCache.delete(e)\n}\nfunction cacheSize() {\n\treturn tinyCache.size\n}\nfunction joinUrl(n, e = !1) {\n\t;(n = n.filter(i => i)), e && isString(n[1]) && (n[1] = '../' + n[1])\n\tlet t = ''\n\tisString(n[0]) && n[0].includes('://') && ((t = before(n[0], '://') ?? ''), (n[0] = after(n[0], '://') ?? ''))\n\tconst r = n.map(i => String(i)).flatMap(i => i.split('/')),\n\t\to = []\n\tfor (let i = 0; i < r.length; i++) r[i] !== '.' && (r[i] === '..' ? (!t || o.length > 1) && o.pop() : o.push(r[i]))\n\treturn (t ? t + '://' : '') + o.join('/').replaceAll(/\\/{2,}/g, '/')\n}\nfunction replaceBetweenStrings(n, e, t, r, o = !0) {\n\tconst i = n.indexOf(e),\n\t\tu = n.indexOf(t, i + e.length)\n\tif (i === -1 || u === -1) throw Error('Start or end not found')\n\treturn o ? n.substring(0, i + e.length) + r + n.substring(u) : n.substring(0, i) + r + n.substring(u + t.length)\n}\nfunction describeMarkdown(n) {\n\tlet e = 'p'\n\tn.startsWith('#') ? ((e = 'h1'), (n = n.slice(1).trim())) : n.startsWith('-') && ((e = 'li'), (n = n.slice(1).trim()))\n\tconst t = n[0] === n[0].toUpperCase(),\n\t\tr = /[.?!]$/.test(n),\n\t\to = /:$/.test(n)\n\treturn { type: e, isCapitalized: t, hasPunctuation: r, endsWithColon: o }\n}\nfunction isBalanced(n, e = '(', t = ')') {\n\tlet r = 0,\n\t\to = 0\n\tfor (; o < n.length; ) if ((n.startsWith(e, o) ? (r++, (o += e.length)) : n.startsWith(t, o) ? (r--, (o += t.length)) : o++, r < 0)) return !1\n\treturn e === t ? r % 2 === 0 : r === 0\n}\nfunction textToFormat(n) {\n\tn = n.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '')\n\tlet e = n.length\n\tfor (; (n = n.replace(/(\\w+)[\\s,']+\\w+/g, '$1')), n.length !== e; ) e = n.length\n\treturn (n = n.replaceAll(/[A-Z][a-zA-Z0-9]*/g, 'A')), (n = n.replaceAll(/[a-z][a-zA-Z0-9]*/g, 'a')), (n = n.replaceAll(/[\\u4E00-\\u9FA5]+/g, 'Z')), n\n}\nfunction sortObject(n) {\n\tconst t = Object.keys(n).sort((o, i) => o.localeCompare(i)),\n\t\tr = {}\n\tfor (const o of t) r[o] = sortAny(n[o])\n\treturn r\n}\nfunction sortArray(n) {\n\tconst e = []\n\treturn n.sort((t, r) => JSON.stringify(sortAny(t)).localeCompare(JSON.stringify(sortAny(r)))).forEach(t => e.push(sortAny(t))), e\n}\nfunction sortAny(n) {\n\treturn Array.isArray(n) ? sortArray(n) : isObject(n) ? sortObject(n) : n\n}\nfunction deepEquals(n, e) {\n\treturn JSON.stringify(sortAny(n)) === JSON.stringify(sortAny(e))\n}\nfunction deepEqualsEvery(...n) {\n\tfor (let e = 1; e < n.length; e++) if (!deepEquals(n[e - 1], n[e])) return !1\n\treturn !0\n}\nfunction safeParse(n) {\n\ttry {\n\t\treturn JSON.parse(n)\n\t} catch {\n\t\treturn null\n\t}\n}\nfunction createSequence() {\n\tlet n = 0\n\treturn { next: () => n++ }\n}\nfunction createOscillator(n) {\n\tlet e = 0\n\treturn { next: () => n[e++ % n.length] }\n}\nfunction createStatefulToggle(n) {\n\tlet e\n\treturn t => {\n\t\tconst r = t === n && e !== n\n\t\treturn (e = t), r\n\t}\n}\nfunction organiseWithLimits(n, e, t, r, o) {\n\tconst i = {}\n\tfor (const u of Object.keys(e)) i[u] = []\n\t;(i[r] = []), o && (n = n.sort(o))\n\tfor (const u of n) {\n\t\tconst s = u[t],\n\t\t\tc = e[s] ? s : r\n\t\ti[c].length >= e[c] ? i[r].push(u) : i[c].push(u)\n\t}\n\treturn i\n}\nfunction diffKeys(n, e) {\n\tconst t = Object.keys(n),\n\t\tr = Object.keys(e)\n\treturn { uniqueToA: t.filter(o => !r.includes(o)), uniqueToB: r.filter(o => !t.includes(o)) }\n}\nfunction pickRandomKey(n) {\n\tconst e = Object.keys(n)\n\treturn e[Math.floor(Math.random() * e.length)]\n}\nfunction mapRandomKey(n, e) {\n\tconst t = pickRandomKey(n)\n\treturn (n[t] = e(n[t])), t\n}\nfunction fromObjectString(n) {\n\treturn (\n\t\t(n = n.replace(\n\t\t\t/\\r\\n/g,\n\t\t\t`\n`\n\t\t)),\n\t\t(n = n.replace(/(\\w+)\\((.+)\\)/g, (e, t, r) => `${t}(${r.replaceAll(',', ',')})`)),\n\t\t(n = n.replace(/(,)(\\s+})/g, '$2')),\n\t\t(n = n.replace(/\\.\\.\\..+?,/g, '')),\n\t\t(n = n.replace(/({\\s+)([a-zA-Z]\\w+),/g, \"$1$2: '$2',\")),\n\t\t(n = n.replace(/(,\\s+)([a-zA-Z]\\w+),/g, \"$1$2: '$2',\")),\n\t\t(n = n.replace(/:(.+)\\?(.+):/g, (e, t, r) => `: (${t.trim()} && ${r.trim()}) ||`)),\n\t\t(n = n.replace(/([a-zA-Z0-9]+)( ?: ?{)/g, '\"$1\"$2')),\n\t\t(n = n.replace(/([a-zA-Z0-9]+) ?: ?(.+?)(,|\\n|})/g, (e, t, r, o) => `\"${t}\":\"${r.trim()}\"${o}`)),\n\t\t(n = n.replace(/(\"'|'\")/g, '\"')),\n\t\t(n = n.replaceAll(',', ',')),\n\t\tJSON.parse(n)\n\t)\n}\nconst thresholds = [1e3, 1e6, 1e9, 1e12, 1e15, 1e18, 1e21, 1e24, 1e27, 1e30, 1e9, 1e16, 1e18, 1e18, 1e18, 1e33],\n\tlongNumberUnits = ['thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion', 'octillion', 'nonillion', 'gwei', 'bzz', 'btc', 'eth', 'dai', 'decillion'],\n\tshortNumberUnits = ['K', 'M', 'B', 'T', 'Qa', 'Qi', 'Sx', 'Sp', 'O', 'N', 'gwei', 'bzz', 'eth', 'btc', 'dai', 'D']\nfunction fromDecimals(n, e, t) {\n\tlet r = n.length - e\n\tif (r <= 0) return '0.' + '0'.repeat(-r) + n + (t ? ' ' + t : '')\n\tlet o = n.substring(0, r),\n\t\ti = n.substring(r)\n\treturn o === '' && (o = '0'), o + '.' + i + (t ? ' ' + t : '')\n}\nfunction formatNumber(n, e) {\n\tconst t = e?.longForm ?? !1,\n\t\tr = e?.unit ? ` ${e.unit}` : '',\n\t\to = t ? longNumberUnits : shortNumberUnits,\n\t\ti = e?.precision ?? 1\n\tif (n < thresholds[0]) return `${n}${r}`\n\tfor (let u = 0; u < thresholds.length - 1; u++) if (n < thresholds[u + 1]) return `${(n / thresholds[u]).toFixed(i)}${t ? ' ' : ''}${o[u]}${r}`\n\treturn `${(n / thresholds[thresholds.length - 1]).toFixed(i)}${t ? ' ' : ''}${o[thresholds.length - 1]}${r}`\n}\nfunction makeNumber(n) {\n\tconst e = parseFloat(n)\n\tif (isNaN(e)) throw Error('makeNumber got NaN for input')\n\tconst t = n.replace(/^-?[0-9.]+/, '').trim(),\n\t\tr = shortNumberUnits.findIndex(o => o.toLowerCase() === t.toLowerCase())\n\treturn r === -1 ? e : e * thresholds[r]\n}\nfunction clamp(n, e, t) {\n\treturn n < e ? e : n > t ? t : n\n}\nfunction increment(n, e, t) {\n\tconst r = n + e\n\treturn r > t ? t : r\n}\nfunction decrement(n, e, t) {\n\tconst r = n - e\n\treturn r < t ? t : r\n}\nfunction runOn(n, e) {\n\treturn e(n), n\n}\nfunction ifPresent(n, e) {\n\tn && e(n)\n}\nfunction mergeArrays(n, e) {\n\tconst t = Object.keys(e)\n\tfor (const r of t) Array.isArray(e[r]) && Array.isArray(n[r]) && pushAll(n[r], e[r])\n}\nfunction empty(n) {\n\treturn n.splice(0, n.length), n\n}\nfunction removeEmptyArrays(n) {\n\tfor (const e of Object.keys(n)) (isEmptyArray(n[e]) || (Array.isArray(n[e]) && n[e].every(t => t == null))) && delete n[e]\n\treturn n\n}\nfunction removeEmptyValues(n) {\n\tfor (const e of Object.entries(n)) (e[1] === null || e[1] === void 0 || (isString(e[1]) && isBlank(e[1]))) && delete n[e[0]]\n\treturn n\n}\nfunction filterObjectKeys(n, e) {\n\tconst t = {}\n\tfor (const [r, o] of Object.entries(n)) e(r) && (t[r] = o)\n\treturn t\n}\nfunction filterObjectValues(n, e) {\n\tconst t = {}\n\tfor (const [r, o] of Object.entries(n)) e(o) && (t[r] = o)\n\treturn t\n}\nfunction mapObject(n, e) {\n\tconst t = {}\n\tfor (const r of Object.entries(n)) t[r[0]] = e(r[1])\n\treturn t\n}\nfunction mapIterable(n, e) {\n\tconst t = []\n\tlet r = 0\n\tfor (const o of n) t.push(e(o, r++))\n\treturn t\n}\nasync function rethrow(n, e) {\n\ttry {\n\t\treturn await n()\n\t} catch {\n\t\tthrow e\n\t}\n}\nfunction setSomeOnObject(n, e, t) {\n\tt != null && (n[e] = t)\n}\nfunction setSomeDeep(n, e, t, r) {\n\tconst o = getDeep(t, r)\n\to != null && setDeep(n, e, o)\n}\nfunction flip(n) {\n\tconst e = {}\n\tfor (const [t, r] of Object.entries(n)) e[r] = t\n\treturn e\n}\nfunction getAllPermutations(n) {\n\tconst e = Object.keys(n),\n\t\tt = e.map(s => n[s].length),\n\t\tr = t.reduce((s, c) => (s *= c))\n\tlet o = 1\n\tconst i = [1]\n\tfor (let s = 0; s < t.length - 1; s++) (o *= t[s]), i.push(o)\n\tconst u = []\n\tfor (let s = 0; s < r; s++) {\n\t\tconst c = {}\n\t\tfor (let f = 0; f < e.length; f++) {\n\t\t\tconst l = n[e[f]],\n\t\t\t\ta = Math.floor(s / i[f]) % l.length\n\t\t\tc[e[f]] = l[a]\n\t\t}\n\t\tu.push(c)\n\t}\n\treturn u\n}\nfunction countTruthyValues(n) {\n\treturn Object.values(n).filter(e => e).length\n}\nfunction getFlatNotation(n, e, t) {\n\treturn n + (t ? '[' + e + ']' : (n.length ? '.' : '') + e)\n}\nfunction flattenInner(n, e, t, r, o) {\n\tif (!isObject(e)) return e\n\tfor (const [i, u] of Object.entries(e)) {\n\t\tconst s = getFlatNotation(t, i, r)\n\t\tArray.isArray(u) ? (o ? flattenInner(n, u, s, !0, o) : (n[s] = u.map(c => flattenInner(Array.isArray(c) ? [] : {}, c, '', !1, o)))) : isObject(u) ? flattenInner(n, u, s, !1, o) : (n[s] = u)\n\t}\n\treturn n\n}\nfunction flatten(n, e = !1, t) {\n\treturn flattenInner({}, n, t || '', !1, e)\n}\nfunction unflatten(n) {\n\tif (!isObject(n)) return n\n\tconst e = Array.isArray(n) ? [] : {}\n\tfor (const [t, r] of Object.entries(n))\n\t\tArray.isArray(r)\n\t\t\t? setDeep(\n\t\t\t\t\te,\n\t\t\t\t\tt,\n\t\t\t\t\tr.map(o => unflatten(o))\n\t\t\t )\n\t\t\t: setDeep(e, t, r)\n\treturn e\n}\nfunction match(n, e, t) {\n\treturn e[n] ? e[n] : t\n}\nfunction indexArray(n, e) {\n\tconst t = {}\n\tfor (const r of n) {\n\t\tconst o = e(r)\n\t\tt[o] = r\n\t}\n\treturn t\n}\nfunction indexArrayToCollection(n, e) {\n\tconst t = {}\n\tfor (const r of n) {\n\t\tconst o = e(r)\n\t\tt[o] || (t[o] = []), t[o].push(r)\n\t}\n\treturn t\n}\nfunction splitBySize(n, e) {\n\tconst t = []\n\tfor (let r = 0; r < n.length; r += e) t.push(n.slice(r, r + e))\n\treturn t\n}\nfunction splitByCount(n, e) {\n\tconst t = Math.ceil(n.length / e),\n\t\tr = []\n\tfor (let o = 0; o < n.length; o += t) r.push(n.slice(o, o + t))\n\treturn r\n}\nfunction tokenizeByLength(n, e) {\n\tconst t = [],\n\t\tr = Math.ceil(n.length / e)\n\tfor (let o = 0; o < r; o++) t.push(n.slice(o * e, o * e + e))\n\treturn t\n}\nfunction tokenizeByCount(n, e) {\n\tconst t = Math.ceil(n.length / e)\n\treturn tokenizeByLength(n, t)\n}\nfunction makeUnique(n, e) {\n\treturn Object.values(indexArray(n, e))\n}\nfunction countUnique(n, e, t, r, o) {\n\tconst i = e ? n.map(e) : n,\n\t\tu = {}\n\tfor (const c of i) u[c] = (u[c] || 0) + 1\n\tconst s = r ? sortObjectValues(u, o ? (c, f) => c[1] - f[1] : (c, f) => f[1] - c[1]) : u\n\treturn t ? Object.keys(s) : s\n}\nfunction sortObjectValues(n, e) {\n\treturn Object.fromEntries(Object.entries(n).sort(e))\n}\nfunction transformToArray(n) {\n\tconst e = [],\n\t\tt = Object.keys(n),\n\t\tr = n[t[0]].length\n\tfor (let o = 0; o < r; o++) {\n\t\tconst i = {}\n\t\tfor (const u of t) i[u] = n[u][o]\n\t\te.push(i)\n\t}\n\treturn e\n}\nfunction incrementMulti(n, e, t = 1) {\n\tfor (const r of n) r[e] += t\n}\nfunction setMulti(n, e, t) {\n\tfor (const r of n) r[e] = t\n}\nfunction group(n, e) {\n\tconst t = []\n\tlet r = []\n\treturn (\n\t\tn.forEach((o, i) => {\n\t\t\t;(i === 0 || !e(o, n[i - 1])) && ((r = []), t.push(r)), r.push(o)\n\t\t}),\n\t\tt\n\t)\n}\nfunction createBidirectionalMap() {\n\treturn { map: new Map(), keys: [] }\n}\nfunction createTemporalBidirectionalMap() {\n\treturn { map: new Map(), keys: [] }\n}\nfunction pushToBidirectionalMap(n, e, t, r = 100) {\n\tif (n.map.has(e)) {\n\t\tconst o = n.keys.indexOf(e)\n\t\tn.keys.splice(o, 1)\n\t}\n\tif ((n.map.set(e, t), n.keys.push(e), n.keys.length > r)) {\n\t\tconst o = n.keys.shift()\n\t\to && n.map.delete(o)\n\t}\n}\nfunction unshiftToBidirectionalMap(n, e, t, r = 100) {\n\tif (n.map.has(e)) {\n\t\tconst o = n.keys.indexOf(e)\n\t\tn.keys.splice(o, 1)\n\t}\n\tif ((n.map.set(e, t), n.keys.unshift(e), n.keys.length > r)) {\n\t\tconst o = n.keys.shift()\n\t\to && n.map.delete(o)\n\t}\n}\nfunction addToTemporalBidirectionalMap(n, e, t, r, o = 100) {\n\tpushToBidirectionalMap(n, e, { validUntil: Date.now() + r, data: t }, o)\n}\nfunction getFromTemporalBidirectionalMap(n, e) {\n\tconst t = n.map.get(e)\n\treturn t && t.validUntil > Date.now() ? t.data : null\n}\nclass Optional {\n\tconstructor(e) {\n\t\tthis.value = e\n\t}\n\tstatic of(e) {\n\t\treturn new Optional(e)\n\t}\n\tstatic empty() {\n\t\treturn new Optional(null)\n\t}\n\tmap(e) {\n\t\treturn new Optional(this.value !== null && this.value !== void 0 ? e(this.value) : null)\n\t}\n\tmapAsync(e) {\n\t\treturn this.value !== null && this.value !== void 0 ? e(this.value).then(t => Optional.of(t)) : Promise.resolve(Optional.empty())\n\t}\n\tifPresent(e) {\n\t\treturn this.value !== null && this.value !== void 0 && e(this.value), this\n\t}\n\tifPresentAsync(e) {\n\t\treturn this.value !== null && this.value !== void 0 ? e(this.value).then(() => this) : Promise.resolve(this)\n\t}\n\tifAbsent(e) {\n\t\treturn (this.value === null || this.value === void 0) && e(), this\n\t}\n\tifAbsentAsync(e) {\n\t\treturn this.value === null || this.value === void 0 ? e().then(() => this) : Promise.resolve(this)\n\t}\n\tgetOrFallback(e) {\n\t\treturn this.value ?? e()\n\t}\n\tgetOrFallbackAsync(e) {\n\t\treturn this.value !== null && this.value !== void 0 ? Promise.resolve(this.value) : e()\n\t}\n\tgetOrThrow() {\n\t\tif (this.value === null || this.value === void 0) throw Error('Optional.value is empty')\n\t\treturn this.value\n\t}\n}\nexports.Optional = Optional\nclass Lazy {\n\tconstructor(e) {\n\t\t;(this.supplier = e), (this.value = null)\n\t}\n\tget() {\n\t\treturn this.value || (this.value = this.supplier()), this.value\n\t}\n}\nexports.Lazy = Lazy\nclass AsyncLazy {\n\tconstructor(e) {\n\t\t;(this.supplier = e), (this.value = null)\n\t}\n\tasync get() {\n\t\treturn this.value || (this.value = await this.supplier()), this.value\n\t}\n}\nexports.AsyncLazy = AsyncLazy\nfunction multicall(n) {\n\treturn () => n.forEach(e => e())\n}\nfunction maxBy(n, e) {\n\treturn n.reduce((t, r) => (e(t) > e(r) ? t : r))\n}\nfunction findInstance(n, e) {\n\tconst t = n.find(r => r instanceof e)\n\treturn Optional.of(t)\n}\nfunction filterInstances(n, e) {\n\treturn n.filter(t => t instanceof e)\n}\nfunction interleave(n, e) {\n\tconst t = [],\n\t\tr = Math.max(n.length, e.length)\n\tfor (let o = 0; o < r; o++) n[o] && t.push(n[o]), e[o] && t.push(e[o])\n\treturn t\n}\nfunction toggle(n, e) {\n\treturn n.includes(e) ? n.filter(t => t !== e) : [...n, e]\n}\nclass Node {\n\tconstructor(e) {\n\t\t;(this.value = e), (this.children = [])\n\t}\n}\nfunction createHierarchy(n, e, t, r, o = !1) {\n\tconst i = new Map(),\n\t\tu = []\n\tn.forEach(c => {\n\t\tconst f = new Node(c)\n\t\ti.set(c[e], f)\n\t}),\n\t\tn.forEach(c => {\n\t\t\tconst f = i.get(c[e])\n\t\t\tif (!f) return\n\t\t\tconst l = c[t]\n\t\t\tif (l) {\n\t\t\t\tconst a = i.get(l)\n\t\t\t\ta && a.children.push(f)\n\t\t\t} else u.push(f)\n\t\t})\n\tconst s = c => {\n\t\tc.children.sort((f, l) => {\n\t\t\tconst a = f.value[r],\n\t\t\t\th = l.value[r]\n\t\t\treturn o ? h - a : a - h\n\t\t}),\n\t\t\tc.children.forEach(s)\n\t}\n\treturn u.forEach(s), u\n}\nfunction log2Reduce(n, e) {\n\tif (Math.log2(n.length) % 1 !== 0) throw new Error('Array length must be a power of 2')\n\tlet t = [...n]\n\tfor (; t.length > 1; ) {\n\t\tconst r = []\n\t\tfor (let o = 0; o < t.length; o += 2) {\n\t\t\tconst i = t[o + 1]\n\t\t\tr.push(e(t[o], i))\n\t\t}\n\t\tt = r\n\t}\n\treturn t[0]\n}\nfunction concatBytes(...n) {\n\tconst e = n.reduce((o, i) => o + i.length, 0),\n\t\tt = new Uint8Array(e)\n\tlet r = 0\n\treturn (\n\t\tn.forEach(o => {\n\t\t\tt.set(o, r), (r += o.length)\n\t\t}),\n\t\tt\n\t)\n}\nfunction isPng(n) {\n\treturn n[0] === 137 && n[1] === 80 && n[2] === 78 && n[3] === 71\n}\nfunction isJpg(n) {\n\treturn n[0] === 255 && n[1] === 216\n}\nfunction isWebp(n) {\n\treturn n[8] === 87 && n[9] === 69 && n[10] === 66 && n[11] === 80\n}\nfunction isImage(n) {\n\treturn isPng(n) || isJpg(n) || isWebp(n)\n}\nfunction numberToUint8(n) {\n\treturn new Uint8Array([n])\n}\nfunction uint8ToNumber(n) {\n\treturn n[0]\n}\nfunction numberToUint16(n, e) {\n\tconst t = new ArrayBuffer(2)\n\treturn new DataView(t).setUint16(0, n, e === 'LE'), new Uint8Array(t)\n}\nfunction uint16ToNumber(n, e) {\n\treturn new DataView(n.buffer).getUint16(n.byteOffset, e === 'LE')\n}\nfunction numberToUint32(n, e) {\n\tconst t = new ArrayBuffer(4)\n\treturn new DataView(t).setUint32(0, n, e === 'LE'), new Uint8Array(t)\n}\nfunction uint32ToNumber(n, e) {\n\treturn new DataView(n.buffer).getUint32(n.byteOffset, e === 'LE')\n}\nfunction numberToUint64(n, e) {\n\tconst t = new ArrayBuffer(8)\n\treturn new DataView(t).setBigUint64(0, BigInt(n), e === 'LE'), new Uint8Array(t)\n}\nfunction uint64ToNumber(n, e) {\n\treturn new DataView(n.buffer).getBigUint64(n.byteOffset, e === 'LE')\n}\nfunction numberToUint256(n, e) {\n\tconst r = new Uint8Array(32)\n\tlet o = n\n\tif (e === 'LE') {\n\t\tfor (let i = 0; i < 32; i++) (r[i] = Number(o & 0xffn)), (o >>= 8n)\n\t\treturn r\n\t}\n\tfor (let i = 32 - 1; i >= 0; i--) (r[i] = Number(o & 0xffn)), (o >>= 8n)\n\treturn r\n}\nfunction uint256ToNumber(n, e) {\n\tlet r = 0n\n\tif (e === 'LE') {\n\t\tfor (let o = 32 - 1; o >= 0; o--) r = (r << 8n) | BigInt(n[o])\n\t\treturn r\n\t}\n\tfor (let o = 0; o < 32; o++) r = (r << 8n) | BigInt(n[o])\n\treturn r\n}\nfunction sliceBytes(n, e) {\n\tconst t = []\n\tlet r = 0\n\tfor (const o of e) t.push(n.subarray(r, r + o)), (r += o)\n\treturn t\n}\nfunction partition(n, e) {\n\tconst t = []\n\tfor (let r = 0; r < n.length; r += e) t.push(n.subarray(r, r + e))\n\treturn t\n}\nconst IOTA_CONSTANTS = [0, 1, 0, 32898, 2147483648, 32906, 2147483648, 2147516416, 0, 32907, 0, 2147483649, 2147483648, 2147516545, 2147483648, 32777, 0, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 2147483648, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 0, 32778, 2147483648, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 0, 2147483649, 2147483648, 2147516424]\nfunction keccakPermutate(n) {\n\tfor (let e = 0; e < 24; e++) {\n\t\tconst t = n[0] ^ n[10] ^ n[20] ^ n[30] ^ n[40],\n\t\t\tr = n[1] ^ n[11] ^ n[21] ^ n[31] ^ n[41],\n\t\t\to = n[2] ^ n[12] ^ n[22] ^ n[32] ^ n[42],\n\t\t\ti = n[3] ^ n[13] ^ n[23] ^ n[33] ^ n[43],\n\t\t\tu = n[4] ^ n[14] ^ n[24] ^ n[34] ^ n[44],\n\t\t\ts = n[5] ^ n[15] ^ n[25] ^ n[35] ^ n[45],\n\t\t\tc = n[6] ^ n[16] ^ n[26] ^ n[36] ^ n[46],\n\t\t\tf = n[7] ^ n[17] ^ n[27] ^ n[37] ^ n[47],\n\t\t\tl = n[8] ^ n[18] ^ n[28] ^ n[38] ^ n[48],\n\t\t\ta = n[9] ^ n[19] ^ n[29] ^ n[39] ^ n[49],\n\t\t\th = (o << 1) | (i >>> 31),\n\t\t\tbn = (i << 1) | (o >>> 31),\n\t\t\td = l ^ h,\n\t\t\tp = a ^ bn,\n\t\t\t$n = (u << 1) | (s >>> 31),\n\t\t\tAn = (s << 1) | (u >>> 31),\n\t\t\tm = t ^ $n,\n\t\t\tg = r ^ An,\n\t\t\tEn = (c << 1) | (f >>> 31),\n\t\t\tMn = (f << 1) | (c >>> 31),\n\t\t\tw = o ^ En,\n\t\t\tx = i ^ Mn,\n\t\t\tOn = (l << 1) | (a >>> 31),\n\t\t\tkn = (a << 1) | (l >>> 31),\n\t\t\ty = u ^ On,\n\t\t\tb = s ^ kn,\n\t\t\tTn = (t << 1) | (r >>> 31),\n\t\t\tSn = (r << 1) | (t >>> 31),\n\t\t\t$ = c ^ Tn,\n\t\t\tA = f ^ Sn\n\t\t;(n[0] ^= d), (n[1] ^= p), (n[2] ^= m), (n[3] ^= g), (n[4] ^= w), (n[5] ^= x), (n[6] ^= y), (n[7] ^= b), (n[8] ^= $), (n[9] ^= A), (n[10] ^= d), (n[11] ^= p), (n[12] ^= m), (n[13] ^= g), (n[14] ^= w), (n[15] ^= x), (n[16] ^= y), (n[17] ^= b), (n[18] ^= $), (n[19] ^= A), (n[20] ^= d), (n[21] ^= p), (n[22] ^= m), (n[23] ^= g), (n[24] ^= w), (n[25] ^= x), (n[26] ^= y), (n[27] ^= b), (n[28] ^= $), (n[29] ^= A), (n[30] ^= d), (n[31] ^= p), (n[32] ^= m), (n[33] ^= g), (n[34] ^= w), (n[35] ^= x), (n[36] ^= y), (n[37] ^= b), (n[38] ^= $), (n[39] ^= A), (n[40] ^= d), (n[41] ^= p), (n[42] ^= m), (n[43] ^= g), (n[44] ^= w), (n[45] ^= x), (n[46] ^= y), (n[47] ^= b), (n[48] ^= $), (n[49] ^= A)\n\t\tconst E = n[0],\n\t\t\tM = n[1],\n\t\t\tO = (n[2] << 1) | (n[3] >>> 31),\n\t\t\tk = (n[3] << 1) | (n[2] >>> 31),\n\t\t\tT = (n[5] << 30) | (n[4] >>> 2),\n\t\t\tS = (n[4] << 30) | (n[5] >>> 2),\n\t\t\tR = (n[6] << 28) | (n[7] >>> 4),\n\t\t\tI = (n[7] << 28) | (n[6] >>> 4),\n\t\t\tC = (n[8] << 27) | (n[9] >>> 5),\n\t\t\tD = (n[9] << 27) | (n[8] >>> 5),\n\t\t\tB = (n[11] << 4) | (n[10] >>> 28),\n\t\t\tP = (n[10] << 4) | (n[11] >>> 28),\n\t\t\tv = (n[13] << 12) | (n[12] >>> 20),\n\t\t\tU = (n[12] << 12) | (n[13] >>> 20),\n\t\t\tL = (n[14] << 6) | (n[15] >>> 26),\n\t\t\tN = (n[15] << 6) | (n[14] >>> 26),\n\t\t\tj = (n[17] << 23) | (n[16] >>> 9),\n\t\t\tz = (n[16] << 23) | (n[17] >>> 9),\n\t\t\tF = (n[18] << 20) | (n[19] >>> 12),\n\t\t\tW = (n[19] << 20) | (n[18] >>> 12),\n\t\t\tq = (n[20] << 3) | (n[21] >>> 29),\n\t\t\tH = (n[21] << 3) | (n[20] >>> 29),\n\t\t\tV = (n[22] << 10) | (n[23] >>> 22),\n\t\t\tJ = (n[23] << 10) | (n[22] >>> 22),\n\t\t\tK = (n[25] << 11) | (n[24] >>> 21),\n\t\t\tZ = (n[24] << 11) | (n[25] >>> 21),\n\t\t\tQ = (n[26] << 25) | (n[27] >>> 7),\n\t\t\tG = (n[27] << 25) | (n[26] >>> 7),\n\t\t\tY = (n[29] << 7) | (n[28] >>> 25),\n\t\t\t_ = (n[28] << 7) | (n[29] >>> 25),\n\t\t\tX = (n[31] << 9) | (n[30] >>> 23),\n\t\t\tnn = (n[30] << 9) | (n[31] >>> 23),\n\t\t\ten = (n[33] << 13) | (n[32] >>> 19),\n\t\t\ttn = (n[32] << 13) | (n[33] >>> 19),\n\t\t\trn = (n[34] << 15) | (n[35] >>> 17),\n\t\t\ton = (n[35] << 15) | (n[34] >>> 17),\n\t\t\tun = (n[36] << 21) | (n[37] >>> 11),\n\t\t\tcn = (n[37] << 21) | (n[36] >>> 11),\n\t\t\tsn = (n[38] << 8) | (n[39] >>> 24),\n\t\t\tfn = (n[39] << 8) | (n[38] >>> 24),\n\t\t\tln = (n[40] << 18) | (n[41] >>> 14),\n\t\t\tan = (n[41] << 18) | (n[40] >>> 14),\n\t\t\thn = (n[42] << 2) | (n[43] >>> 30),\n\t\t\tdn = (n[43] << 2) | (n[42] >>> 30),\n\t\t\tpn = (n[45] << 29) | (n[44] >>> 3),\n\t\t\tmn = (n[44] << 29) | (n[45] >>> 3),\n\t\t\tgn = (n[47] << 24) | (n[46] >>> 8),\n\t\t\twn = (n[46] << 24) | (n[47] >>> 8),\n\t\t\txn = (n[48] << 14) | (n[49] >>> 18),\n\t\t\tyn = (n[49] << 14) | (n[48] >>> 18)\n\t\t;(n[0] = E ^ (~v & K)), (n[1] = M ^ (~U & Z)), (n[2] = v ^ (~K & un)), (n[3] = U ^ (~Z & cn)), (n[4] = K ^ (~un & xn)), (n[5] = Z ^ (~cn & yn)), (n[6] = un ^ (~xn & E)), (n[7] = cn ^ (~yn & M)), (n[8] = xn ^ (~E & v)), (n[9] = yn ^ (~M & U)), (n[10] = R ^ (~F & q)), (n[11] = I ^ (~W & H)), (n[12] = F ^ (~q & en)), (n[13] = W ^ (~H & tn)), (n[14] = q ^ (~en & pn)), (n[15] = H ^ (~tn & mn)), (n[16] = en ^ (~pn & R)), (n[17] = tn ^ (~mn & I)), (n[18] = pn ^ (~R & F)), (n[19] = mn ^ (~I & W)), (n[20] = O ^ (~L & Q)), (n[21] = k ^ (~N & G)), (n[22] = L ^ (~Q & sn)), (n[23] = N ^ (~G & fn)), (n[24] = Q ^ (~sn & ln)), (n[25] = G ^ (~fn & an)), (n[26] = sn ^ (~ln & O)), (n[27] = fn ^ (~an & k)), (n[28] = ln ^ (~O & L)), (n[29] = an ^ (~k & N)), (n[30] = C ^ (~B & V)), (n[31] = D ^ (~P & J)), (n[32] = B ^ (~V & rn)), (n[33] = P ^ (~J & on)), (n[34] = V ^ (~rn & gn)), (n[35] = J ^ (~on & wn)), (n[36] = rn ^ (~gn & C)), (n[37] = on ^ (~wn & D)), (n[38] = gn ^ (~C & B)), (n[39] = wn ^ (~D & P)), (n[40] = T ^ (~j & Y)), (n[41] = S ^ (~z & _)), (n[42] = j ^ (~Y & X)), (n[43] = z ^ (~_ & nn)), (n[44] = Y ^ (~X & hn)), (n[45] = _ ^ (~nn & dn)), (n[46] = X ^ (~hn & T)), (n[47] = nn ^ (~dn & S)), (n[48] = hn ^ (~T & j)), (n[49] = dn ^ (~S & z)), (n[0] ^= IOTA_CONSTANTS[e * 2]), (n[1] ^= IOTA_CONSTANTS[e * 2 + 1])\n\t}\n}\nfunction bytesToNumbers(n) {\n\tconst e = []\n\tfor (let t = 0; t < n.length; t += 4) e.push(n[t] | (n[t + 1] << 8) | (n[t + 2] << 16) | (n[t + 3] << 24))\n\treturn e\n}\nfunction divideToBlocks(n, e) {\n\tif (!n.length) {\n\t\tconst o = new Uint8Array(136)\n\t\treturn (o[0] = e), (o[135] = 128), [bytesToNumbers(o)]\n\t}\n\tconst t = partition(n, 136),\n\t\tr = t[t.length - 1]\n\tif (r.length < 136) {\n\t\tconst o = new Uint8Array(136)\n\t\to.set(r), (o[r.length] = e), (o[135] |= 128), (t[t.length - 1] = o)\n\t}\n\tif (r.length === 136) {\n\t\tconst o = new Uint8Array(136)\n\t\t;(o[0] = e), (o[135] = 128), t.push(o)\n\t}\n\treturn t.map(bytesToNumbers)\n}\nfunction absorb(n, e) {\n\tfor (const t of e) {\n\t\tfor (let r = 0; r < 34; r += 2) (n[r] ^= t[r + 1]), (n[r + 1] ^= t[r])\n\t\tkeccakPermutate(n)\n\t}\n\treturn n\n}\nfunction squeeze(n) {\n\treturn new Uint8Array([n[1], n[1] >> -24, n[1] >> -16, n[1] >> -8, n[0], n[0] >> 8, n[0] >> 16, n[0] >> 24, n[3], n[3] >> -24, n[3] >> -16, n[3] >> -8, n[2], n[2] >> 8, n[2] >> 16, n[2] >> 24, n[5], n[5] >> -24, n[5] >> -16, n[5] >> -8, n[4], n[4] >> 8, n[4] >> 16, n[4] >> 24, n[7], n[7] >> -24, n[7] >> -16, n[7] >> -8, n[6], n[6] >> 8, n[6] >> 16, n[6] >> 24])\n}\nfunction keccak256(n) {\n\treturn squeeze(absorb(new Array(50).fill(0), divideToBlocks(n, 1)))\n}\nfunction sha3_256(n) {\n\treturn squeeze(absorb(new Array(50).fill(0), divideToBlocks(n, 6)))\n}\nfunction proximity(n, e) {\n\tconst t = Math.min(n.length, e.length)\n\tfor (let r = 0; r < t; r++) {\n\t\tconst o = n[r] ^ e[r]\n\t\tfor (let i = 0; i < 8; i++) if ((o >> (7 - i)) & 1) return r * 8 + i\n\t}\n\treturn Math.min(n.length, e.length) * 8\n}\nfunction commonPrefix(n, e) {\n\tconst t = Math.min(n.length, e.length)\n\tfor (let r = 0; r < t; r++) if (n[r] !== e[r]) return n.subarray(0, r)\n\treturn n.subarray(0, t)\n}\nfunction setBit(n, e, t, r) {\n\tconst o = Math.floor(e / 8),\n\t\ti = e % 8\n\tt === 1 ? (n[o] |= 1 << (r === 'BE' ? 7 - i : i)) : (n[o] &= ~(1 << (r === 'BE' ? 7 - i : i)))\n}\nfunction getBit(n, e, t) {\n\tconst r = Math.floor(e / 8),\n\t\to = e % 8\n\treturn (n[r] >> (t === 'BE' ? 7 - o : o)) & 1\n}\nfunction binaryIndexOf(n, e, t = 0) {\n\tfor (let r = t; r < n.length; r++) for (let o = 0; o < e.length && n[r + o] === e[o]; o++) if (o === e.length - 1) return r\n\treturn -1\n}\nfunction binaryPadStart(n, e, t = 0) {\n\tif (n.length >= e) return n\n\tconst r = new Uint8Array(e)\n\treturn r.fill(t), r.set(n, e - n.length), r\n}\nfunction binaryPadStartToMultiple(n, e, t = 0) {\n\tconst r = n.length % e\n\treturn r === 0 ? n : binaryPadStart(n, n.length + e - r, t)\n}\nfunction binaryPadEnd(n, e, t = 0) {\n\tif (n.length >= e) return n\n\tconst r = new Uint8Array(e)\n\treturn r.fill(t), r.set(n, 0), r\n}\nfunction binaryPadEndToMultiple(n, e, t = 0) {\n\tconst r = n.length % e\n\treturn r === 0 ? n : binaryPadEnd(n, n.length + e - r, t)\n}\nfunction xorCypher(n, e) {\n\tconst t = new Uint8Array(n.length)\n\tfor (let r = 0; r < n.length; r++) t[r] = n[r] ^ e[r % e.length]\n\treturn t\n}\nfunction isUtf8(n) {\n\tfor (let e = 0; e < n.length; e++) {\n\t\tconst t = n[e]\n\t\tif (!(t < 128))\n\t\t\tif ((t & 224) === 192) {\n\t\t\t\tif (e + 1 >= n.length || (n[e + 1] & 192) !== 128) return !1\n\t\t\t\te += 1\n\t\t\t} else if ((t & 240) === 224) {\n\t\t\t\tif (e + 2 >= n.length || (n[e + 1] & 192) !== 128 || (n[e + 2] & 192) !== 128) return !1\n\t\t\t\te += 2\n\t\t\t} else if ((t & 248) === 240) {\n\t\t\t\tif (e + 3 >= n.length || (n[e + 1] & 192) !== 128 || (n[e + 2] & 192) !== 128 || (n[e + 3] & 192) !== 128) return !1\n\t\t\t\te += 3\n\t\t\t} else return !1\n\t}\n\treturn !0\n}\nfunction binaryEquals(n, e) {\n\tif (n.length !== e.length) return !1\n\tfor (let t = 0; t < n.length; t++) if (n[t] !== e[t]) return !1\n\treturn !0\n}\nfunction mod(n, e) {\n\treturn ((n % e) + e) % e\n}\nfunction modInverse(n, e) {\n\tn = mod(n, e)\n\tlet [t, r] = [0n, 1n],\n\t\t[o, i] = [e, n]\n\tfor (; i !== 0n; ) {\n\t\tconst u = o / i\n\t\t;([t, r] = [r, t - u * r]), ([o, i] = [i, o - u * i])\n\t}\n\tif (o > 1n) throw new Error('a is not invertible')\n\treturn t < 0n && (t += e), t\n}\nfunction modPow(n, e, t) {\n\tlet r = 1n\n\tfor (n = mod(n, t); e > 0; ) e % 2n === 1n && (r = mod(r * n, t)), (n = mod(n * n, t)), (e = e / 2n)\n\treturn r\n}\nfunction modSqrt(n, e) {\n\treturn mod(n, e) === 0n ? 0n : e % 4n === 3n ? modPow(n, (e + 1n) / 4n, e) : null\n}\nconst SECP256K1_P = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,\n\tSECP256K1_N = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,\n\tSECP256K1_X = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,\n\tSECP256K1_Y = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n\nfunction ellipticDouble(n, e, t) {\n\tif (e === 0n) return [0n, 0n]\n\tconst r = mod(3n * n * n * modInverse(2n * e, t), t),\n\t\to = mod(r * r - 2n * n, t),\n\t\ti = mod(r * (n - o) - e, t)\n\treturn [o, i]\n}\nfunction ellipticAdd(n, e, t, r, o) {\n\tif (n === 0n && e === 0n) return [t, r]\n\tif (t === 0n && r === 0n) return [n, e]\n\tif (n === t && e === mod(-r, o)) return [0n, 0n]\n\tif (n === t && e === r) return ellipticDouble(n, e, o)\n\tconst i = mod((r - e) * modInverse(t - n, o), o),\n\t\tu = mod(i * i - n - t, o),\n\t\ts = mod(i * (n - u) - e, o)\n\treturn [u, s]\n}\nfunction privateKeyToPublicKey(n) {\n\tif (n <= 0n || n >= SECP256K1_N) throw new Error('Invalid private key')\n\treturn doubleAndAdd(SECP256K1_X, SECP256K1_Y, n, SECP256K1_P)\n}\nfunction compressPublicKey(n) {\n\tconst t = n[1] % 2n === 0n ? 2 : 3\n\treturn new Uint8Array([t, ...numberToUint256(n[0], 'BE')])\n}\nfunction publicKeyFromCompressed(n) {\n\tif (n.length !== 33 || (n[0] !== 2 && n[0] !== 3)) throw new Error('Invalid compressed public key')\n\tconst e = uint256ToNumber(n.slice(1), 'BE'),\n\t\tt = modSqrt(mod(e ** 3n + 7n, SECP256K1_P), SECP256K1_P)\n\tif (!t) throw Error('Invalid x: does not correspond to a valid curve point')\n\tconst r = mod(-t, SECP256K1_P),\n\t\to = t % 2n === 0n\n\treturn [e, n[0] === 2 ? (o ? t : r) : o ? r : t]\n}\nfunction publicKeyToAddress(n) {\n\tconst e = new Uint8Array(20),\n\t\tt = keccak256(concatBytes(numberToUint256(n[0], 'BE'), numberToUint256(n[1], 'BE')))\n\treturn e.set(t.subarray(12)), e\n}\nfunction checksumEncode(n) {\n\tconst e = exports.Binary.uint8ArrayToHex(n),\n\t\tt = exports.Binary.uint8ArrayToHex(exports.Binary.keccak256(new Uint8Array([...e].map(o => o.charCodeAt(0)))))\n\tlet r = '0x'\n\tfor (let o = 0; o < e.length; o++) parseInt(t[o], 16) > 7 ? (r += e[o].toUpperCase()) : (r += e[o])\n\treturn r\n}\nfunction doubleAndAdd(n, e, t, r) {\n\tlet o = [0n, 0n],\n\t\ti = [n, e]\n\tconst u = t.toString(2)\n\tfor (const s of u) s === '0' ? ((i = ellipticAdd(o[0], o[1], i[0], i[1], r)), (o = ellipticDouble(o[0], o[1], r))) : ((o = ellipticAdd(o[0], o[1], i[0], i[1], r)), (i = ellipticDouble(i[0], i[1], r)))\n\treturn o\n}\nfunction signMessage(n, e, t) {\n\treturn signHash(uint256ToNumber(keccak256(n), 'BE'), e, t)\n}\nfunction signHash(n, e, t) {\n\tif (e <= 0n || e >= SECP256K1_N) throw new Error('Invalid private key')\n\tif ((t || (t = mod(uint256ToNumber(keccak256(concatBytes(keccak256(numberToUint256(e, 'BE')), numberToUint256(n, 'BE'))), 'BE'), SECP256K1_N)), t <= 0n || t >= SECP256K1_N)) throw new Error('Invalid nonce')\n\tconst r = mod(n, SECP256K1_N),\n\t\to = doubleAndAdd(SECP256K1_X, SECP256K1_Y, t, SECP256K1_P),\n\t\ti = mod(o[0], SECP256K1_N)\n\tlet u = mod((r + mod(i, SECP256K1_N) * e) * modInverse(t, SECP256K1_N), SECP256K1_N)\n\tif (i === 0n || u === 0n) throw new Error('Invalid r or s value')\n\tlet s = o[1] % 2n === 0n ? 27n : 28n\n\treturn u > SECP256K1_N / 2n && ((u = SECP256K1_N - u), (s = s === 27n ? 28n : 27n)), [i, u, s]\n}\nfunction recoverPublicKey(n, e, t, r) {\n\tconst o = modSqrt(mod(e ** 3n + 7n, SECP256K1_P), SECP256K1_P)\n\tif (!o) throw new Error('Invalid r: does not correspond to a valid curve point')\n\tconst i = r === 27n ? 0n : 1n,\n\t\tu = o % 2n === i ? o : SECP256K1_P - o,\n\t\ts = mod(uint256ToNumber(keccak256(n), 'BE'), SECP256K1_N),\n\t\tc = doubleAndAdd(e, u, t, SECP256K1_P),\n\t\tf = doubleAndAdd(SECP256K1_X, SECP256K1_Y, s, SECP256K1_P),\n\t\tl = ellipticAdd(c[0], c[1], f[0], mod(-f[1], SECP256K1_P), SECP256K1_P)\n\treturn doubleAndAdd(l[0], l[1], modInverse(e, SECP256K1_N), SECP256K1_P)\n}\nfunction verifySignature(n, e, t, r) {\n\tconst o = mod(uint256ToNumber(keccak256(n), 'BE'), SECP256K1_N),\n\t\ti = modInverse(r, SECP256K1_N),\n\t\tu = mod(o * i, SECP256K1_N),\n\t\ts = mod(t * i, SECP256K1_N),\n\t\tc = doubleAndAdd(SECP256K1_X, SECP256K1_Y, u, SECP256K1_P),\n\t\tf = doubleAndAdd(e[0], e[1], s, SECP256K1_P),\n\t\tl = ellipticAdd(c[0], c[1], f[0], f[1], SECP256K1_P)\n\treturn t === mod(l[0], SECP256K1_N)\n}\nclass Uint8ArrayReader {\n\tconstructor(e) {\n\t\t;(this.cursor = 0), (this.buffer = e)\n\t}\n\tread(e) {\n\t\tconst t = this.buffer.subarray(this.cursor, this.cursor + e)\n\t\treturn (this.cursor += e), t\n\t}\n\tmax() {\n\t\treturn this.buffer.length - this.cursor\n\t}\n}\nexports.Uint8ArrayReader = Uint8ArrayReader\nclass Uint8ArrayWriter {\n\tconstructor(e) {\n\t\t;(this.buffer = e), (this.cursor = 0)\n\t}\n\twrite(e) {\n\t\tconst t = Math.min(this.max(), e.max())\n\t\treturn this.buffer.set(e.read(t), this.cursor), (this.cursor += t), t\n\t}\n\tmax() {\n\t\treturn this.buffer.length - this.cursor\n\t}\n}\nexports.Uint8ArrayWriter = Uint8ArrayWriter\nclass Chunk {\n\tconstructor(e, t = 0n) {\n\t\t;(this.span = t), (this.writer = new Uint8ArrayWriter(new Uint8Array(e)))\n\t}\n\tbuild() {\n\t\treturn concatBytes(numberToUint64(this.span, 'LE'), this.writer.buffer)\n\t}\n\thash() {\n\t\tconst e = log2Reduce(partition(this.writer.buffer, 32), (t, r) => Chunk.hashFunction(concatBytes(t, r)))\n\t\treturn Chunk.hashFunction(concatBytes(numberToUint64(this.span, 'LE'), e))\n\t}\n}\n;(exports.Chunk = Chunk), (Chunk.hashFunction = keccak256)\nclass MerkleTree {\n\tconstructor(e, t = 4096) {\n\t\t;(this.counters = [1]), (this.capacity = t), (this.chunks = [new Chunk(t)]), (this.onChunk = e)\n\t}\n\tstatic async root(e, t = 4096) {\n\t\tconst r = new _a(_a.NOOP, t)\n\t\treturn await r.append(e), r.finalize()\n\t}\n\tasync append(e, t = 0, r = 0n) {\n\t\tconst o = new Uint8ArrayReader(e)\n\t\tfor (; o.max() > 0; ) {\n\t\t\tthis.chunks[t].writer.max() === 0 && (await this.elevate(t))\n\t\t\tconst i = this.chunks[t].writer.write(o)\n\t\t\tr ? (this.chunks[t].span += r) : (this.chunks[0].span += BigInt(i))\n\t\t}\n\t}\n\tasync elevate(e) {\n\t\t;(this.counters[e] = ++this.counters[e] % (this.capacity / 32)), this.chunks[e + 1] || (this.chunks.push(new Chunk(this.capacity)), this.counters.push(1)), await this.append(this.chunks[e].hash(), e + 1, this.chunks[e].span), await this.onChunk(this.chunks[e]), (this.chunks[e] = new Chunk(this.capacity))\n\t}\n\tasync finalize(e = 0) {\n\t\treturn this.chunks[e + 1] ? (this.counters[e] === 1 ? (await this.elevate(e + 1), (this.chunks[e + 1] = this.chunks[e]), this.finalize(e + 1)) : (await this.elevate(e), this.finalize(e + 1))) : (await this.onChunk(this.chunks[e]), this.chunks[e])\n\t}\n}\n;(exports.MerkleTree = MerkleTree), (_a = MerkleTree), (MerkleTree.NOOP = async n => {})\nclass FixedPointNumber {\n\tconstructor(e, t) {\n\t\tif (t < 0) throw Error('Scale must be non-negative')\n\t\t;(this.value = BigInt(e)), (this.scale = t)\n\t}\n\tstatic fromDecimalString(e, t) {\n\t\tlet [r, o] = e.split('.')\n\t\treturn (o = (o || '').padEnd(t, '0').slice(0, t)), new FixedPointNumber(BigInt(r + o), t)\n\t}\n\tadd(e) {\n\t\treturn this.assertSameScale(e), new FixedPointNumber(this.value + e.value, this.scale)\n\t}\n\tsubtract(e) {\n\t\treturn this.assertSameScale(e), new FixedPointNumber(this.value - e.value, this.scale)\n\t}\n\tmultiply(e) {\n\t\treturn new FixedPointNumber(this.value * e, this.scale)\n\t}\n\tdivmod(e) {\n\t\tif (e === 0n) throw new Error('Division by zero is not allowed')\n\t\tconst t = this.value / e,\n\t\t\tr = this.value % e\n\t\treturn [new FixedPointNumber(t, this.scale), new FixedPointNumber(r, this.scale)]\n\t}\n\texchange(e, t, r) {\n\t\tif (e === '*') {\n\t\t\tconst i = (this.value * t.value) / 10n ** BigInt(this.scale)\n\t\t\treturn new FixedPointNumber(i, r)\n\t\t}\n\t\tthis.assertSameScale(t)\n\t\tconst o = (this.value * 10n ** BigInt(r)) / t.value\n\t\treturn new FixedPointNumber(o, r)\n\t}\n\tcompare(e) {\n\t\treturn this.assertSameScale(e), this.value > e.value ? 1 : this.value < e.value ? -1 : 0\n\t}\n\ttoDecimalString() {\n\t\tif (this.scale === 0) return this.value.toString()\n\t\tconst e = this.value.toString(),\n\t\t\tt = e.slice(0, -this.scale) || '0',\n\t\t\tr = e.slice(-this.scale).padStart(this.scale, '0')\n\t\treturn `${t}.${r}`\n\t}\n\ttoString() {\n\t\treturn this.value.toString()\n\t}\n\ttoJSON() {\n\t\treturn this.toString()\n\t}\n\tassertSameScale(e) {\n\t\tif (this.scale !== e.scale) throw new Error(`Scale mismatch: expected ${this.scale}, but got ${e.scale}`)\n\t}\n}\nexports.FixedPointNumber = FixedPointNumber\nfunction tickPlaybook(n) {\n\tif (n.length === 0) return null\n\tconst e = n[0]\n\treturn e.ttlMax ? --e.ttl <= 0 && n.shift() : (e.ttlMax = e.ttl), { progress: (e.ttlMax - e.ttl) / e.ttlMax, data: e.data }\n}\nfunction getArgument(n, e, t, r) {\n\tconst o = n.findIndex(s => s === `--${e}` || s.startsWith(`--${e}=`)),\n\t\ti = n[o]\n\tif (!i) return (t || {})[r || e || ''] || null\n\tif (i.includes('=')) return i.split('=')[1]\n\tconst u = n[o + 1]\n\treturn u && !u.startsWith('-') ? u : (t || {})[r || e || ''] || null\n}\nfunction getNumberArgument(n, e, t, r) {\n\tconst o = getArgument(n, e, t, r)\n\tif (!o) return null\n\ttry {\n\t\treturn makeNumber(o)\n\t} catch {\n\t\tthrow new Error(`Invalid number argument ${e}: ${o}`)\n\t}\n}\nfunction getBooleanArgument(n, e, t, r) {\n\tconst o = n.some(c => c.endsWith('-' + e)),\n\t\ti = getArgument(n, e, t, r)\n\tif (!i && o) return !0\n\tif (!i && !o) return null\n\tconst u = ['true', '1', 'yes', 'y', 'on'],\n\t\ts = ['false', '0', 'no', 'n', 'off']\n\tif (u.includes(i.toLowerCase())) return !0\n\tif (s.includes(i.toLowerCase())) return !1\n\tthrow Error(`Invalid boolean argument ${e}: ${i}`)\n}\nfunction requireStringArgument(n, e, t, r) {\n\tconst o = getArgument(n, e, t, r)\n\tif (!o) throw new Error(`Missing argument ${e}`)\n\treturn o\n}\nfunction requireNumberArgument(n, e, t, r) {\n\tconst o = requireStringArgument(n, e, t, r)\n\ttry {\n\t\treturn makeNumber(o)\n\t} catch {\n\t\tthrow new Error(`Invalid argument ${e}: ${o}`)\n\t}\n}\nfunction bringToFrontInPlace(n, e) {\n\tconst t = n[e]\n\tn.splice(e, 1), n.unshift(t)\n}\nfunction bringToFront(n, e) {\n\tconst t = [...n]\n\treturn bringToFrontInPlace(t, e), t\n}\nfunction addPoint(n, e) {\n\treturn { x: n.x + e.x, y: n.y + e.y }\n}\nfunction subtractPoint(n, e) {\n\treturn { x: n.x - e.x, y: n.y - e.y }\n}\nfunction multiplyPoint(n, e) {\n\treturn { x: n.x * e, y: n.y * e }\n}\nfunction normalizePoint(n) {\n\tconst e = Math.sqrt(n.x * n.x + n.y * n.y)\n\treturn { x: n.x / e, y: n.y / e }\n}\nfunction pushPoint(n, e, t) {\n\treturn { x: n.x + Math.cos(e) * t, y: n.y + Math.sin(e) * t }\n}\nfunction getDistanceBetweenPoints(n, e) {\n\treturn Math.sqrt((n.x - e.x) ** 2 + (n.y - e.y) ** 2)\n}\nfunction filterCoordinates(n, e, t = 'row-first') {\n\tconst r = []\n\tif (t === 'column-first') for (let o = 0; o < n.length; o++) for (let i = 0; i < n[0].length; i++) e(o, i) && r.push({ x: o, y: i })\n\telse for (let o = 0; o < n[0].length; o++) for (let i = 0; i < n.length; i++) e(i, o) && r.push({ x: i, y: o })\n\treturn r\n}\nfunction isHorizontalLine(n, e, t) {\n\treturn n[e + 1]?.[t] && n[e - 1]?.[t] && !n[e][t - 1] && !n[e][t + 1]\n}\nfunction isVerticalLine(n, e, t) {\n\treturn n[e][t + 1] && n[e][t - 1] && !n[e - 1]?.[t] && !n[e + 1]?.[t]\n}\nfunction isLeftmost(n, e, t) {\n\treturn !n[e - 1]?.[t]\n}\nfunction isRightmost(n, e, t) {\n\treturn !n[e + 1]?.[t]\n}\nfunction isTopmost(n, e, t) {\n\treturn !n[e][t - 1]\n}\nfunction isBottommost(n, e, t) {\n\treturn !n[e][t + 1]\n}\nfunction getCorners(n, e, t) {\n\tconst r = []\n\treturn n[e][t] ? (isHorizontalLine(n, e, t) || isVerticalLine(n, e, t) ? [] : (!n[e - 1]?.[t - 1] && isLeftmost(n, e, t) && isTopmost(n, e, t) && r.push({ x: e, y: t }), !n[e + 1]?.[t - 1] && isRightmost(n, e, t) && isTopmost(n, e, t) && r.push({ x: e + 1, y: t }), !n[e - 1]?.[t + 1] && isLeftmost(n, e, t) && isBottommost(n, e, t) && r.push({ x: e, y: t + 1 }), !n[e + 1]?.[t + 1] && isRightmost(n, e, t) && isBottommost(n, e, t) && r.push({ x: e + 1, y: t + 1 }), r)) : (n[e - 1]?.[t] && n[e][t - 1] && r.push({ x: e, y: t }), n[e + 1]?.[t] && n[e][t - 1] && r.push({ x: e + 1, y: t }), n[e - 1]?.[t] && n[e][t + 1] && r.push({ x: e, y: t + 1 }), n[e + 1]?.[t] && n[e][t + 1] && r.push({ x: e + 1, y: t + 1 }), r)\n}\nfunction findCorners(n, e, t, r) {\n\tconst o = [\n\t\t{ x: 0, y: 0 },\n\t\t{ x: t, y: 0 },\n\t\t{ x: 0, y: r },\n\t\t{ x: t, y: r }\n\t]\n\tfor (let i = 0; i < n.length; i++)\n\t\tfor (let u = 0; u < n[0].length; u++) {\n\t\t\tconst s = getCorners(n, i, u)\n\t\t\tfor (const c of s) o.some(f => f.x === c.x && f.y === c.y) || o.push(c)\n\t\t}\n\treturn o.map(i => ({ x: i.x * e, y: i.y * e }))\n}\nfunction findLines(n, e) {\n\tconst t = filterCoordinates(n, (c, f) => n[c][f] === 0 && n[c][f + 1] !== 0, 'row-first').map(c => ({ ...c, dx: 1, dy: 0 })),\n\t\tr = filterCoordinates(n, (c, f) => n[c][f] === 0 && n[c][f - 1] !== 0, 'row-first').map(c => ({ ...c, dx: 1, dy: 0 })),\n\t\to = filterCoordinates(n, (c, f) => n[c][f] === 0 && n[c - 1]?.[f] !== 0, 'column-first').map(c => ({ ...c, dx: 0, dy: 1 })),\n\t\ti = filterCoordinates(n, (c, f) => n[c][f] === 0 && n[c + 1]?.[f] !== 0, 'column-first').map(c => ({ ...c, dx: 0, dy: 1 }))\n\tt.forEach(c => c.y++), i.forEach(c => c.x++)\n\tconst u = group([...o, ...i], (c, f) => c.x === f.x && c.y - 1 === f.y),\n\t\ts = group([...r, ...t], (c, f) => c.y === f.y && c.x - 1 === f.x)\n\treturn [...u, ...s].map(c => ({ start: c[0], end: last(c) })).map(c => ({ start: multiplyPoint(c.start, e), end: multiplyPoint(addPoint(c.end, { x: c.start.dx, y: c.start.dy }), e) }))\n}\nfunction getAngleInRadians(n, e) {\n\treturn Math.atan2(e.y - n.y, e.x - n.x)\n}\nfunction getSortedRayAngles(n, e) {\n\treturn e.map(t => getAngleInRadians(n, t)).sort((t, r) => t - r)\n}\nfunction getLineIntersectionPoint(n, e, t, r) {\n\tconst o = (r.y - t.y) * (e.x - n.x) - (r.x - t.x) * (e.y - n.y)\n\tif (o === 0) return null\n\tlet i = n.y - t.y,\n\t\tu = n.x - t.x\n\tconst s = (r.x - t.x) * i - (r.y - t.y) * u,\n\t\tc = (e.x - n.x) * i - (e.y - n.y) * u\n\treturn (i = s / o), (u = c / o), i > 0 && i < 1 && u > 0 && u < 1 ? { x: n.x + i * (e.x - n.x), y: n.y + i * (e.y - n.y) } : null\n}\nfunction raycast(n, e, t) {\n\tconst r = [],\n\t\to = pushPoint(n, t, 1e4)\n\tfor (const i of e) {\n\t\tconst u = getLineIntersectionPoint(n, o, i.start, i.end)\n\t\tu && r.push(u)\n\t}\n\treturn r.length\n\t\t? r.reduce((i, u) => {\n\t\t\t\tconst s = getDistanceBetweenPoints(n, u),\n\t\t\t\t\tc = getDistanceBetweenPoints(n, i)\n\t\t\t\treturn s < c ? u : i\n\t\t })\n\t\t: null\n}\nfunction raycastCircle(n, e, t) {\n\tconst o = getSortedRayAngles(n, t),\n\t\ti = []\n\tfor (const u of o) {\n\t\tconst s = raycast(n, e, u - 0.001),\n\t\t\tc = raycast(n, e, u + 0.001)\n\t\ts && i.push(s), c && i.push(c)\n\t}\n\treturn i\n}\nclass PubSubChannel {\n\tconstructor() {\n\t\tthis.subscribers = []\n\t}\n\tsubscribe(e) {\n\t\treturn (\n\t\t\tthis.subscribers.push(e),\n\t\t\t() => {\n\t\t\t\tthis.subscribers = this.subscribers.filter(t => t !== e)\n\t\t\t}\n\t\t)\n\t}\n\tpublish(e) {\n\t\tthis.subscribers.forEach(t => t(e))\n\t}\n\tclear() {\n\t\tthis.subscribers = []\n\t}\n\tgetSubscriberCount() {\n\t\treturn this.subscribers.length\n\t}\n}\nexports.PubSubChannel = PubSubChannel\nclass AsyncQueue {\n\tconstructor(e, t) {\n\t\t;(this.queue = []), (this.running = 0), (this.onProcessed = new PubSubChannel()), (this.onDrained = new PubSubChannel()), (this.concurrency = e), (this.capacity = t)\n\t}\n\tprocess() {\n\t\tif (this.running >= this.concurrency) return\n\t\tconst e = this.queue.shift()\n\t\te &&\n\t\t\t(this.running++,\n\t\t\te().finally(() => {\n\t\t\t\tthis.running--, this.process(), this.onProcessed.publish(), this.running === 0 && this.onDrained.publish()\n\t\t\t}))\n\t}\n\tenqueue(e) {\n\t\tif (this.queue.length < this.capacity) return this.queue.push(e), this.process(), Promise.resolve()\n\t\tif (this.onProcessed.getSubscriberCount()) throw Error('Queue capacity is full')\n\t\treturn new Promise(t => {\n\t\t\tthis.onProcessed.subscribe(() => {\n\t\t\t\tthis.queue.length < this.capacity && (this.queue.push(e), this.process(), this.onProcessed.clear(), t())\n\t\t\t})\n\t\t})\n\t}\n\tdrain() {\n\t\tif (this.running === 0) return Promise.resolve()\n\t\tif (this.onDrained.getSubscriberCount()) throw Error('Already draining')\n\t\treturn new Promise(e => {\n\t\t\tthis.onDrained.subscribe(() => {\n\t\t\t\tthis.onDrained.clear(), e()\n\t\t\t})\n\t\t})\n\t}\n}\nexports.AsyncQueue = AsyncQueue\nclass TrieRouter {\n\tconstructor() {\n\t\tthis.forks = new Map()\n\t}\n\tinsert(e, t) {\n\t\tif (e.length === 0) {\n\t\t\tthis.handler = t\n\t\t\treturn\n\t\t}\n\t\tconst r = e[0]\n\t\tlet o = r,\n\t\t\ti\n\t\tif ((r.startsWith(':') && ((o = ':'), (i = r.slice(1))), !this.forks.has(o))) {\n\t\t\tconst u = new TrieRouter()\n\t\t\ti && (u.variableName = i), this.forks.set(o, u)\n\t\t}\n\t\tthis.forks.get(o).insert(e.slice(1), t)\n\t}\n\tasync handle(e, t, r, o) {\n\t\tif (e.length === 0) return this.handler ? (await this.handler(t, r, o), !0) : !1\n\t\tconst i = e[0],\n\t\t\tu = this.forks.get(i)\n\t\tif (u) return u.handle(e.slice(1), t, r, o)\n\t\tconst s = this.forks.get(':')\n\t\tif (s) return s.variableName && o.set(s.variableName, decodeURIComponent(i)), s.handle(e.slice(1), t, r, o)\n\t\tconst c = this.forks.get('*')\n\t\treturn c ? (o.set('wildcard', e.join('/')), c.handler ? (await c.handler(t, r, o), !0) : !1) : !1\n\t}\n}\n;(exports.TrieRouter = TrieRouter),\n\t(exports.Binary = { hexToUint8Array, uint8ArrayToHex, binaryToUint8Array, uint8ArrayToBinary, base64ToUint8Array, uint8ArrayToBase64, base32ToUint8Array, uint8ArrayToBase32, log2Reduce, partition, concatBytes, numberToUint8, uint8ToNumber, numberToUint16, uint16ToNumber, numberToUint32, uint32ToNumber, numberToUint64, uint64ToNumber, numberToUint256, uint256ToNumber, sliceBytes, keccak256, sha3_256, proximity, commonPrefix, setBit, getBit, indexOf: binaryIndexOf, equals: binaryEquals, padStart: binaryPadStart, padStartToMultiple: binaryPadStartToMultiple, padEnd: binaryPadEnd, padEndToMultiple: binaryPadEndToMultiple, xorCypher, isUtf8 }),\n\t(exports.Elliptic = { privateKeyToPublicKey, compressPublicKey, publicKeyFromCompressed, publicKeyToAddress, signMessage, signHash, verifySignature, recoverPublicKey, checksumEncode }),\n\t(exports.Random = { intBetween, floatBetween, chance, signed: signedRandom, makeSeededRng, point: randomPoint, procs }),\n\t(exports.Arrays = { countUnique, makeUnique, splitBySize, splitByCount, index: indexArray, indexCollection: indexArrayToCollection, onlyOrThrow, onlyOrNull, firstOrThrow, firstOrNull, shuffle, initialize: initializeArray, initialize2D: initialize2DArray, rotate2D: rotate2DArray, containsShape, glue, pluck, pick, pickMany, pickManyUnique, pickWeighted, pickRandomIndices, pickGuaranteed, last, pipe, makePipe, sortWeighted, pushAll, unshiftAll, filterAndRemove, merge: mergeArrays, empty, pushToBucket, unshiftAndLimit, atRolling, group, createOscillator, organiseWithLimits, tickPlaybook, getArgument, getBooleanArgument, getNumberArgument, requireStringArgument, requireNumberArgument, bringToFront, bringToFrontInPlace, findInstance, filterInstances, interleave, toggle, createHierarchy, multicall, maxBy }),\n\t(exports.System = { sleepMillis, forever, scheduleMany, waitFor, expandError, runAndSetInterval, whereAmI }),\n\t(exports.Numbers = { make: makeNumber, sum, average, median, getDistanceFromMidpoint, clamp, range, interpolate, createSequence, increment, decrement, format: formatNumber, fromDecimals, makeStorage, asMegabytes, convertBytes, hexToRgb, rgbToHex, haversineDistanceToMeters, roundToNearest, formatDistance, triangularNumber, searchFloat, binomialSample }),\n\t(exports.Promises = { raceFulfilled, invert: invertPromise, runInParallelBatches }),\n\t(exports.Dates = { getTimestamp, getTimeDelta, secondsToHumanTime, countCycles, isoDate, throttle, timeSince, dateTimeSlug, unixTimestamp, fromUtcString, fromMillis, getProgress, humanizeTime, humanizeProgress, createTimeDigits, mapDayNumber, getDayInfoFromDate, getDayInfoFromDateTimeString, seconds, minutes, hours, days, make: makeDate, normalizeTime, absoluteDays }),\n\t(exports.Objects = { safeParse, deleteDeep, getDeep, setDeep, incrementDeep, ensureDeep, replaceDeep, getFirstDeep, deepMergeInPlace, deepMerge2, deepMerge3, mapAllAsync, cloneWithJson, sortObject, sortArray, sortAny, deepEquals, deepEqualsEvery, runOn, ifPresent, zip, zipSum, removeEmptyArrays, removeEmptyValues, flatten, unflatten, match, sort: sortObjectValues, map: mapObject, mapIterable, filterKeys: filterObjectKeys, filterValues: filterObjectValues, rethrow, setSomeOnObject, setSomeDeep, flip, getAllPermutations, countTruthyValues, transformToArray, setMulti, incrementMulti, createBidirectionalMap, createTemporalBidirectionalMap, pushToBidirectionalMap, unshiftToBidirectionalMap, addToTemporalBidirectionalMap, getFromTemporalBidirectionalMap, createStatefulToggle, diffKeys, pickRandomKey, mapRandomKey, fromObjectString, toQueryString, parseQueryString, hasKey, selectMax, reposition, unwrapSingleKey, parseKeyValues }),\n\t(exports.Types = { isFunction, isObject, isStrictlyObject, isEmptyArray, isEmptyObject, isUndefined, isString, isNumber, isBoolean, isDate, isBlank, isId, isIntegerString, isHexString, isUrl, isNullable, asString, asHexString, asSafeString, asIntegerString, asNumber, asFunction, asInteger, asBoolean, asDate, asNullableString, asEmptiableString, asId, asTime, asArray, asObject, asNullableObject, asStringMap, asNumericDictionary, asUrl, asEmptiable, asNullable, asOptional, enforceObjectShape, enforceArrayShape, isPng, isJpg, isWebp, isImage }),\n\t(exports.Strings = { tokenizeByCount, tokenizeByLength, searchHex, searchSubstring, randomHex: randomHexString, randomLetter: randomLetterString, randomAlphanumeric: randomAlphanumericString, randomRichAscii: randomRichAsciiString, randomUnicode: randomUnicodeString, includesAny, slugify, normalForm, enumify, escapeHtml, decodeHtmlEntities, after, afterLast, before, beforeLast, betweenWide, betweenNarrow, getPreLine, containsWord, containsWords, joinUrl, getFuzzyMatchScore, sortByFuzzyScore, splitOnce, splitAll, randomize, expand, shrinkTrim, capitalize, decapitalize, csvEscape, parseCsv, surroundInOut, getExtension, getBasename, normalizeEmail, normalizeFilename, parseFilename, camelToTitle, slugToTitle, slugToCamel, joinHumanly, findWeightedPair, extractBlock, extractAllBlocks, replaceBlocks, indexOfEarliest, lastIndexOfBefore, parseHtmlAttributes, readNextWord, readWordsAfterAll, resolveVariables, resolveVariableWithDefaultSyntax, resolveRemainingVariablesWithDefaults, isLetter, isDigit, isLetterOrDigit, isValidObjectPathCharacter, insert: insertString, indexOfRegex, allIndexOf, lineMatches, linesMatchInOrder, represent, resolveMarkdownLinks, buildUrl, isChinese, replaceBetweenStrings, describeMarkdown, isBalanced, textToFormat, splitFormatting, splitHashtags, splitUrls, route, explodeReplace, generateVariants, replaceWord, replacePascalCaseWords, stripHtml, breakLine, measureTextWidth, toLines, levenshteinDistance, findCommonPrefix, findCommonDirectory }),\n\t(exports.Assertions = { asEqual, asTrue, asTruthy, asFalse, asFalsy, asEither }),\n\t(exports.Cache = { get: getCached, delete: deleteFromCache, deleteExpired: deleteExpiredFromCache, size: cacheSize }),\n\t(exports.Vector = { addPoint, subtractPoint, multiplyPoint, normalizePoint, pushPoint, filterCoordinates, findCorners, findLines, raycast, raycastCircle, getLineIntersectionPoint })\n","/* 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\tlet m;\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\t// eslint-disable-next-line no-return-assign\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 && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[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') || 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 = require('./common')(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 * 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 = require('ms');\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\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\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,\n\t\t\t...createDebug.skips.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\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\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* 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","/* eslint-env browser */\nmodule.exports = typeof self == 'object' ? self.FormData : window.FormData;\n","// https://github.com/maxogden/websocket-stream/blob/48dc3ddf943e5ada668c31ccd94e9186f02fafbd/ws-fallback.js\n\nvar ws = null\n\nif (typeof WebSocket !== 'undefined') {\n ws = WebSocket\n} else if (typeof MozWebSocket !== 'undefined') {\n ws = MozWebSocket\n} else if (typeof global !== 'undefined') {\n ws = global.WebSocket || global.MozWebSocket\n} else if (typeof window !== 'undefined') {\n ws = window.WebSocket || window.MozWebSocket\n} else if (typeof self !== 'undefined') {\n ws = self.WebSocket || self.MozWebSocket\n}\n\nmodule.exports = ws\n","/**\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","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('build compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier, identifierBase) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre': {\n const base = Number(identifierBase) ? 1 : 0\n\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty')\n }\n\n if (this.prerelease.length === 0) {\n this.prerelease = [base]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists')\n }\n this.prerelease.push(base)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base]\n if (identifierBase === false) {\n prerelease = [identifier]\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease\n }\n } else {\n this.prerelease = prerelease\n }\n }\n break\n }\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.raw = this.format()\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`\n }\n return this\n }\n}\n\nmodule.exports = SemVer\n","const SemVer = require('../classes/semver')\nconst major = (a, loose) => new SemVer(a, loose).major\nmodule.exports = major\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n/* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\n// Max safe length for a build identifier. The max length minus 6 characters for\n// the shortest version with a build 0.0.0+BUILD.\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6\n\nconst RELEASE_TYPES = [\n 'major',\n 'premajor',\n 'minor',\n 'preminor',\n 'patch',\n 'prepatch',\n 'prerelease',\n]\n\nmodule.exports = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010,\n}\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers,\n}\n","// parse out just the options we care about\nconst looseOption = Object.freeze({ loose: true })\nconst emptyOpts = Object.freeze({ })\nconst parseOptions = options => {\n if (!options) {\n return emptyOpts\n }\n\n if (typeof options !== 'object') {\n return looseOption\n }\n\n return options\n}\nmodule.exports = parseOptions\n","const {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH,\n} = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst safeRe = exports.safeRe = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst LETTERDASHNUMBER = '[a-zA-Z0-9-]'\n\n// Replace some greedy regex tokens to prevent regex dos issues. These regex are\n// used internally via the safeRe object since all inputs in this library get\n// normalized first to trim and collapse all extra whitespace. The original\n// regexes are exported for userland consumption and lower level usage. A\n// future breaking change could export the safer regex only with a note that\n// all input should have extra whitespace removed.\nconst safeRegexReplacements = [\n ['\\\\s', 1],\n ['\\\\d', MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],\n]\n\nconst makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value\n .split(`${token}*`).join(`${token}{0,${max}}`)\n .split(`${token}+`).join(`${token}{1,${max}}`)\n }\n return value\n}\n\nconst createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value)\n const index = R++\n debug(name, index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '\\\\d+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCEPLAIN', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)\ncreateToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\\\d])`)\ncreateToken('COERCEFULL', src[t.COERCEPLAIN] +\n `(?:${src[t.PRERELEASE]})?` +\n `(?:${src[t.BUILD]})?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\ncreateToken('COERCERTLFULL', src[t.COERCEFULL], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$')\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import utility from './index.js'\n\nexport const Arrays = utility.Arrays\nexport const Assertions = utility.Assertions\nexport const Binary = utility.Binary\nexport const Cache = utility.Cache\nexport const Dates = utility.Dates\nexport const Elliptic = utility.Elliptic\nexport const Numbers = utility.Numbers\nexport const Objects = utility.Objects\nexport const Pagination = utility.Pagination\nexport const Promises = utility.Promises\nexport const Random = utility.Random\nexport const Strings = utility.Strings\nexport const System = utility.System\nexport const Types = utility.Types\nexport const Optional = utility.Optional\nexport const Vector = utility.Vector\nexport const PubSubChannel = utility.PubSubChannel\nexport const Chunk = utility.Chunk\nexport const MerkleTree = utility.MerkleTree\nexport const FixedPointNumber = utility.FixedPointNumber\nexport const Lazy = utility.Lazy\nexport const AsyncLazy = utility.AsyncLazy\nexport const AsyncQueue = utility.AsyncQueue\nexport const Uint8ArrayReader = utility.Uint8ArrayReader\nexport const Uint8ArrayWriter = utility.Uint8ArrayWriter\nexport const TrieRouter = utility.TrieRouter\n","import { Binary, Objects, Types } from 'cafe-utility'\nimport _debug from 'debug'\n\nconst debug = _debug('bee-js:bytes')\n\nconst DECODER = new TextDecoder()\nconst ENCODER = new TextEncoder()\n\nexport class Bytes {\n protected readonly bytes: Uint8Array\n public readonly length: number\n\n constructor(bytes: Uint8Array | ArrayBuffer | string | Bytes, byteLength?: number | number[]) {\n if (!bytes) {\n throw Error(`Bytes#constructor: constructor parameter is falsy: ${bytes}`)\n }\n\n if (bytes instanceof Bytes) {\n this.bytes = bytes.bytes\n } else if (typeof bytes === 'string') {\n this.bytes = Binary.hexToUint8Array(Types.asHexString(bytes, { name: 'Bytes#constructor(bytes)' }))\n } else if (bytes instanceof ArrayBuffer) {\n this.bytes = new Uint8Array(bytes)\n } else if (bytes instanceof Uint8Array) {\n this.bytes = bytes\n } else {\n const unknownInput = bytes as unknown\n const toHex = Objects.getDeep(unknownInput, 'toHex')\n\n if (Types.isFunction(toHex)) {\n const hex = toHex.call(unknownInput)\n this.bytes = Binary.hexToUint8Array(Types.asHexString(hex, { name: 'Bytes#constructor(bytes)' }))\n } else {\n debug('bytes', bytes)\n throw new Error(`Bytes#constructor: unsupported type: ${typeof bytes}`)\n }\n }\n\n this.length = this.bytes.length\n\n if (byteLength) {\n if (Array.isArray(byteLength)) {\n if (!byteLength.includes(this.length)) {\n throw new Error(\n `Bytes#checkByteLength: bytes length is ${this.length} but expected ${byteLength.join(' or ')}`,\n )\n }\n } else if (this.length !== byteLength) {\n throw new Error(`Bytes#checkByteLength: bytes length is ${this.length} but expected ${byteLength}`)\n }\n }\n }\n\n static keccak256(bytes: Uint8Array | ArrayBuffer | string | Bytes): Bytes {\n return new Bytes(Binary.keccak256(new Bytes(bytes).toUint8Array()))\n }\n\n static fromUtf8(utf8: string): Bytes {\n return new Bytes(ENCODER.encode(utf8))\n }\n\n static fromSlice(bytes: Uint8Array, start: number, length?: number): Bytes {\n if (length === undefined) {\n return new Bytes(bytes.slice(start))\n }\n\n return new Bytes(bytes.slice(start, start + length))\n }\n\n offset(index: number): Uint8Array {\n return new Uint8Array(this.bytes.slice(index))\n }\n\n public toUint8Array(): Uint8Array {\n return new Uint8Array(this.bytes)\n }\n\n public toHex(): string {\n return Binary.uint8ArrayToHex(this.bytes)\n }\n\n public toBase64(): string {\n return Binary.uint8ArrayToBase64(this.bytes)\n }\n\n public toBase32(): string {\n return Binary.uint8ArrayToBase32(this.bytes)\n }\n\n public toString(): string {\n return this.toHex()\n }\n\n public toUtf8(): string {\n return DECODER.decode(this.bytes)\n }\n\n public toJSON(): unknown {\n return JSON.parse(this.toUtf8())\n }\n\n public equals(other: Bytes | Uint8Array | string): boolean {\n return this.toHex() === new Bytes(other).toHex()\n }\n\n public represent(): string {\n return this.toHex()\n }\n}\n\nexport function parseSizeToBytes(sizeStr: string): number {\n const units = {\n B: 1,\n kB: 1000,\n MB: 1000 ** 2,\n GB: 1000 ** 3,\n TB: 1000 ** 4,\n PB: 1000 ** 5,\n }\n\n const match = sizeStr.match(/^([\\d.]+)\\s*(B|kB|MB|GB|TB|PB)$/)\n\n if (!match) {\n throw new Error(`Invalid size format: ${sizeStr}`)\n }\n\n const value = parseFloat(match[1])\n const unit = match[2] as keyof typeof units\n\n return Math.ceil(value * units[unit])\n}\n","import { Binary } from 'cafe-utility'\nimport { Bytes } from './bytes'\nimport { Reference } from './typed-bytes'\n\nexport const SWARM_MANIFEST_CODEC = 0xfa\nexport const SWARM_FEED_CODEC = 0xfb\n\nconst CODEC_TABLE: Record<number, string | undefined> = {\n [SWARM_MANIFEST_CODEC]: 'manifest',\n [SWARM_FEED_CODEC]: 'feed',\n}\n\nexport type DecodedCID = {\n type: 'feed' | 'manifest'\n reference: Reference\n}\n\nexport function convertReferenceToCid(reference: string | Uint8Array | Bytes, type: 'feed' | 'manifest'): string {\n reference = new Reference(reference)\n const base32 = 'b'\n const version = new Uint8Array([1])\n const codec = new Uint8Array([type === 'feed' ? SWARM_FEED_CODEC : SWARM_MANIFEST_CODEC])\n const unknown = new Uint8Array([1])\n const sha256 = new Uint8Array([27])\n const size = new Uint8Array([32])\n const header = Binary.uint8ArrayToBase32(Binary.concatBytes(version, codec, unknown, sha256, size)).replace(\n /\\=+$/,\n '',\n )\n const hash = reference.toBase32().replace(/\\=+$/, '')\n\n return `${base32}${header}${hash}`.toLowerCase()\n}\n\nexport function convertCidToReference(cid: string): DecodedCID {\n const bytes = Binary.base32ToUint8Array(cid.toUpperCase().slice(1))\n const codec = bytes[1]\n\n if (!CODEC_TABLE[codec]) {\n throw new Error('Unknown codec')\n }\n const reference = new Reference(bytes.slice(-32))\n\n return {\n type: CODEC_TABLE[codec] as 'feed' | 'manifest',\n reference,\n }\n}\n","import { Binary, Elliptic } from 'cafe-utility'\nimport { Bytes } from './bytes'\nimport { convertCidToReference, convertReferenceToCid } from './cid'\n\n// TODO: add JSdocs for each class\n\nconst ENCODER = new TextEncoder()\n\nexport class PrivateKey extends Bytes {\n static readonly LENGTH = 32\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 32)\n }\n\n publicKey(): PublicKey {\n const [x, y] = Elliptic.privateKeyToPublicKey(Binary.uint256ToNumber(this.bytes, 'BE'))\n\n return new PublicKey(Binary.concatBytes(Binary.numberToUint256(x, 'BE'), Binary.numberToUint256(y, 'BE')))\n }\n\n sign(data: Uint8Array | string): Signature {\n const digest = Binary.concatBytes(\n ENCODER.encode(`\\x19Ethereum Signed Message:\\n32`),\n Binary.keccak256(data instanceof Uint8Array ? data : ENCODER.encode(data)),\n )\n const [r, s, v] = Elliptic.signMessage(digest, Binary.uint256ToNumber(this.bytes, 'BE'))\n\n return new Signature(\n Binary.concatBytes(Binary.numberToUint256(r, 'BE'), Binary.numberToUint256(s, 'BE'), new Uint8Array([Number(v)])),\n )\n }\n}\n\nexport class PublicKey extends Bytes {\n static readonly LENGTH = 64\n constructor(bytes: Uint8Array | string | Bytes) {\n const b = new Bytes(bytes)\n\n if (b.length === 33) {\n const [x, y] = Elliptic.publicKeyFromCompressed(b.toUint8Array())\n super(Binary.concatBytes(Binary.numberToUint256(x, 'BE'), Binary.numberToUint256(y, 'BE')), 64)\n } else {\n super(bytes, 64)\n }\n }\n\n address(): EthAddress {\n const x = Binary.uint256ToNumber(this.bytes.slice(0, 32), 'BE')\n const y = Binary.uint256ToNumber(this.bytes.slice(32, 64), 'BE')\n\n return new EthAddress(Elliptic.publicKeyToAddress([x, y]))\n }\n\n toCompressedUint8Array(): Uint8Array {\n const x = Binary.uint256ToNumber(this.bytes.slice(0, 32), 'BE')\n const y = Binary.uint256ToNumber(this.bytes.slice(32, 64), 'BE')\n\n return Elliptic.compressPublicKey([x, y])\n }\n\n toCompressedHex(): string {\n return Binary.uint8ArrayToHex(this.toCompressedUint8Array())\n }\n}\n\nexport class EthAddress extends Bytes {\n static readonly LENGTH = 20\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 20)\n }\n\n public toChecksum(): string {\n return Elliptic.checksumEncode(this.bytes)\n }\n}\n\nexport class Identifier extends Bytes {\n static readonly LENGTH = 32\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 32)\n }\n\n static fromString(value: string): Identifier {\n return new Identifier(Binary.keccak256(ENCODER.encode(value)))\n }\n}\n\nexport class Reference extends Bytes {\n static readonly LENGTH = 32\n constructor(bytes: Uint8Array | string | Bytes) {\n if (typeof bytes === 'string' && bytes.startsWith('bah5')) {\n const decoded = convertCidToReference(bytes)\n super(decoded.reference.bytes, 32)\n } else {\n super(bytes, [32, 64])\n }\n }\n\n toCid(type: 'feed' | 'manifest'): string {\n return convertReferenceToCid(this.bytes, type)\n }\n\n static isValid(value: string): boolean {\n try {\n new Reference(value)\n\n return true\n } catch {\n return false\n }\n }\n}\n\nexport class TransactionId extends Bytes {\n static readonly LENGTH = 32\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 32)\n }\n}\n\nexport class Span extends Bytes {\n static readonly LENGTH = 8\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 8)\n }\n\n static fromBigInt(number: bigint): Span {\n return new Span(Binary.numberToUint64(number, 'LE'))\n }\n\n toBigInt(): bigint {\n return Binary.uint64ToNumber(this.bytes, 'LE')\n }\n\n static fromSlice(bytes: Uint8Array, start: number): Span {\n return new Span(bytes.slice(start, start + Span.LENGTH))\n }\n}\n\nexport class PeerAddress extends Bytes {\n static readonly LENGTH = 32\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 32)\n }\n}\n\nexport class BatchId extends Bytes {\n static readonly LENGTH = 32\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 32)\n }\n}\n\nexport class Signature extends Bytes {\n static readonly LENGTH = 65\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 65)\n }\n\n static fromSlice(bytes: Uint8Array, start: number): Signature {\n return new Signature(bytes.slice(start, start + Signature.LENGTH))\n }\n\n recoverPublicKey(digest: Uint8Array | string): PublicKey {\n const r = Binary.uint256ToNumber(this.bytes.slice(0, 32), 'BE')\n const s = Binary.uint256ToNumber(this.bytes.slice(32, 64), 'BE')\n const v = BigInt(this.bytes[64]) as 27n | 28n\n const [x, y] = Elliptic.recoverPublicKey(\n Binary.concatBytes(\n ENCODER.encode(`\\x19Ethereum Signed Message:\\n32`),\n Binary.keccak256(digest instanceof Uint8Array ? digest : ENCODER.encode(digest)),\n ),\n r,\n s,\n v,\n )\n\n return new PublicKey(Binary.concatBytes(Binary.numberToUint256(x, 'BE'), Binary.numberToUint256(y, 'BE')))\n }\n\n isValid(digest: Uint8Array | string, expectedAddress: EthAddress | Uint8Array | string): boolean {\n const publicKey = this.recoverPublicKey(digest)\n const address = publicKey.address()\n\n return address.equals(expectedAddress)\n }\n}\n\nexport class Topic extends Bytes {\n static readonly LENGTH = 32\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 32)\n }\n\n static fromString(value: string): Topic {\n return new Topic(Binary.keccak256(ENCODER.encode(value)))\n }\n}\n\nconst MAX_UINT64 = new Uint8Array(8).fill(0xff, 0, 8)\n\nexport class FeedIndex extends Bytes {\n static readonly LENGTH = 8\n static readonly MINUS_ONE = new FeedIndex(MAX_UINT64)\n\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 8)\n }\n\n static fromBigInt(number: bigint): FeedIndex {\n return new FeedIndex(Binary.numberToUint64(number, 'BE'))\n }\n\n toBigInt(): bigint {\n return Binary.uint64ToNumber(this.bytes, 'BE')\n }\n\n next(): FeedIndex {\n if (Binary.equals(this.bytes, MAX_UINT64)) {\n return FeedIndex.fromBigInt(0n)\n }\n\n return FeedIndex.fromBigInt(this.toBigInt() + 1n)\n }\n}\n","export class BeeError extends Error {\n public constructor(message: string) {\n super(message)\n }\n}\n\nexport class BeeArgumentError extends BeeError {\n public constructor(message: string, readonly value: unknown) {\n super(message)\n }\n}\n\nexport class BeeResponseError extends BeeError {\n public constructor(\n public method: string,\n public url: string,\n message: string,\n public responseBody?: unknown,\n public status?: number,\n public statusText?: string,\n ) {\n super(message)\n }\n}\n","import { Binary } from 'cafe-utility'\nimport { BeeArgumentError } from '../utils/error'\nimport { Reference, Span } from '../utils/typed-bytes'\n\nconst MAX_CHUNK_PAYLOAD_SIZE = 4096\nconst SEGMENT_SIZE = 32\n\n/**\n * Calculate a Binary Merkle Tree hash for a chunk\n *\n * The BMT chunk address is the hash of the 8 byte span and the root\n * hash of a binary Merkle tree (BMT) built on the 32-byte segments\n * of the underlying data.\n *\n * If the chunk content is less than 4k, the hash is calculated as\n * if the chunk was padded with all zeros up to 4096 bytes.\n *\n * @param chunkContent Chunk data including span and payload as well\n *\n * @returns the keccak256 hash in a byte array\n */\nexport function calculateChunkAddress(chunkContent: Uint8Array): Reference {\n const span = chunkContent.slice(0, Span.LENGTH)\n const payload = chunkContent.slice(Span.LENGTH)\n const rootHash = calculateBmtRootHash(payload)\n const chunkHash = Binary.keccak256(Binary.concatBytes(span, rootHash))\n\n return new Reference(chunkHash)\n}\n\nfunction calculateBmtRootHash(payload: Uint8Array): Uint8Array {\n if (payload.length > MAX_CHUNK_PAYLOAD_SIZE) {\n throw new BeeArgumentError(\n `payload size ${payload.length} exceeds maximum chunk payload size ${MAX_CHUNK_PAYLOAD_SIZE}`,\n payload,\n )\n }\n const input = new Uint8Array(MAX_CHUNK_PAYLOAD_SIZE)\n input.set(payload)\n\n return Binary.log2Reduce(Binary.partition(input, SEGMENT_SIZE), (a, b) => Binary.keccak256(Binary.concatBytes(a, b)))\n}\n","import { Binary } from 'cafe-utility'\nimport { Bytes } from '../utils/bytes'\nimport { Reference, Span } from '../utils/typed-bytes'\nimport { calculateChunkAddress } from './bmt'\n\nexport const MIN_PAYLOAD_SIZE = 1\nexport const MAX_PAYLOAD_SIZE = 4096\n\nconst ENCODER = new TextEncoder()\n\n/**\n * General chunk interface for Swarm\n *\n * It stores the serialized data and provides functions to access\n * the fields of a chunk.\n *\n * It also provides an address function to calculate the address of\n * the chunk that is required for the Chunk API.\n */\nexport interface Chunk {\n readonly data: Uint8Array\n span: Span\n payload: Bytes\n address: Reference\n}\n\n/**\n * Creates a content addressed chunk and verifies the payload size.\n *\n * @param payloadBytes the data to be stored in the chunk\n */\nexport function makeContentAddressedChunk(payloadBytes: Uint8Array | string): Chunk {\n if (!(payloadBytes instanceof Uint8Array)) {\n payloadBytes = ENCODER.encode(payloadBytes)\n }\n\n if (payloadBytes.length < MIN_PAYLOAD_SIZE || payloadBytes.length > MAX_PAYLOAD_SIZE) {\n throw new RangeError(\n `payload size ${payloadBytes.length} exceeds limits [${MIN_PAYLOAD_SIZE}, ${MAX_PAYLOAD_SIZE}]`,\n )\n }\n\n const span = Span.fromBigInt(BigInt(payloadBytes.length))\n const data = Binary.concatBytes(span.toUint8Array(), payloadBytes)\n\n return {\n data,\n span,\n payload: Bytes.fromSlice(data, Span.LENGTH),\n address: calculateChunkAddress(data),\n }\n}\n\nexport function asContentAddressedChunk(chunkBytes: Uint8Array): Chunk {\n if (chunkBytes.length < MIN_PAYLOAD_SIZE + Span.LENGTH || chunkBytes.length > MAX_PAYLOAD_SIZE + Span.LENGTH) {\n throw new RangeError(\n `chunk size ${chunkBytes.length} exceeds limits [${MIN_PAYLOAD_SIZE + Span.LENGTH}, ${Span.LENGTH}]`,\n )\n }\n\n const span = Span.fromSlice(chunkBytes, 0)\n const data = Binary.concatBytes(span.toUint8Array(), chunkBytes.slice(Span.LENGTH))\n\n return {\n data,\n span,\n payload: Bytes.fromSlice(data, Span.LENGTH),\n address: calculateChunkAddress(data),\n }\n}\n","import { BZZ, DAI } from '../utils/tokens'\nimport { EthAddress, PeerAddress, PublicKey, TransactionId } from '../utils/typed-bytes'\nimport { NumberString } from './index'\n\nexport interface Settlements {\n peer: string\n received: BZZ\n sent: BZZ\n}\n\nexport interface AllSettlements {\n totalReceived: BZZ\n totalSent: BZZ\n settlements: Settlements[]\n}\n\nexport interface NodeAddresses {\n overlay: PeerAddress\n underlay: string[]\n ethereum: EthAddress\n publicKey: PublicKey\n pssPublicKey: PublicKey\n}\n\nexport interface Peer {\n address: string\n fullNode?: boolean\n}\n\nexport interface ChequebookAddressResponse {\n chequebookAddress: EthAddress\n}\n\nexport interface ChequebookBalanceResponse {\n totalBalance: BZZ\n availableBalance: BZZ\n}\n\nexport interface TransactionOptions {\n /**\n * Gas price for the cashout transaction in WEI\n */\n gasPrice?: NumberString | string | bigint\n\n /**\n * Gas limit for the cashout transaction in WEI\n */\n gasLimit?: NumberString | string | bigint\n}\n\nexport interface CashoutResult {\n recipient: string\n lastPayout: BZZ\n bounced: boolean\n}\n\nexport interface LastCashoutActionResponse {\n peer: string\n uncashedAmount: BZZ\n transactionHash: string | null\n lastCashedCheque: Cheque | null\n result: CashoutResult | null\n}\n\nexport interface TransactionResponse {\n transactionHash: TransactionId\n}\n\nexport interface Cheque {\n beneficiary: EthAddress\n chequebook: EthAddress\n payout: BZZ\n}\n\nexport interface LastChequesForPeerResponse {\n peer: string\n lastreceived: Cheque | null\n lastsent: Cheque | null\n}\n\nexport interface LastChequesResponse {\n lastcheques: LastChequesForPeerResponse[]\n}\n\nexport interface PeerBalance {\n peer: string\n balance: BZZ\n}\n\nexport interface BalanceResponse {\n balances: PeerBalance[]\n}\n\nexport interface DebugStatus {\n overlay: string\n proximity: number\n beeMode: BeeModes\n reserveSize: number\n reserveSizeWithinRadius: number\n pullsyncRate: number\n storageRadius: number\n connectedPeers: number\n neighborhoodSize: number\n batchCommitment: number\n isReachable: boolean\n lastSyncedBlock: number\n committedDepth: number\n isWarmingUp: boolean\n}\n\nexport interface Health {\n status: 'ok'\n version: string\n apiVersion: string\n}\n\nexport interface Readiness {\n status: 'ready' | string\n version: string\n apiVersion: string\n}\n\nexport interface BeeVersions {\n supportedBeeVersion: string\n supportedBeeApiVersion: string\n beeVersion: string\n beeApiVersion: string\n}\n\nexport enum BeeModes {\n FULL = 'full',\n LIGHT = 'light',\n ULTRA_LIGHT = 'ultra-light',\n DEV = 'dev',\n}\n\nexport function toBeeMode(value: string) {\n switch (value) {\n case 'full':\n return BeeModes.FULL\n case 'light':\n return BeeModes.LIGHT\n case 'ultra-light':\n return BeeModes.ULTRA_LIGHT\n case 'dev':\n return BeeModes.DEV\n default:\n throw new Error(`Unknown Bee mode: ${value}`)\n }\n}\n\nexport interface RedistributionState {\n minimumGasFunds: DAI\n hasSufficientFunds: boolean\n isFrozen: boolean\n isFullySynced: boolean\n phase: string\n round: number\n lastWonRound: number\n lastPlayedRound: number\n lastFrozenRound: number\n lastSelectedRound: number\n lastSampleDurationSeconds: number\n block: number\n reward: BZZ\n fees: DAI\n isHealthy: boolean\n}\n\n/**\n * Information about Bee node and its configuration\n */\nexport interface NodeInfo {\n /**\n * Indicates in what mode Bee is running.\n */\n beeMode: BeeModes\n\n /**\n * Indicates whether the Bee node has its own deployed chequebook.\n *\n * @see [Bee docs - Chequebook](https://docs.ethswarm.org/docs/references/glossary/#cheques--chequebook)\n */\n chequebookEnabled: boolean\n\n /**\n * Indicates whether SWAP is enabled for the Bee node.\n *\n * @see [Bee docs - SWAP](https://docs.ethswarm.org/docs/references/glossary/#swap)\n */\n swapEnabled: boolean\n}\n\nexport interface RemovePeerResponse {\n message: string\n code: 0\n}\n\nexport interface Bin {\n population: number\n connected: number\n disconnectedPeers: Peer[]\n connectedPeers: Peer[]\n}\n\nexport interface Topology {\n baseAddr: string\n population: number\n connected: number\n timestamp: string\n nnLowWatermark: number\n depth: number\n reachability: string\n networkAvailability: string\n bins: {\n bin_0: Bin\n bin_1: Bin\n bin_2: Bin\n bin_3: Bin\n bin_4: Bin\n bin_5: Bin\n bin_6: Bin\n bin_7: Bin\n bin_8: Bin\n bin_9: Bin\n bin_10: Bin\n bin_11: Bin\n bin_12: Bin\n bin_13: Bin\n bin_14: Bin\n bin_15: Bin\n bin_16: Bin\n bin_17: Bin\n bin_18: Bin\n bin_19: Bin\n bin_20: Bin\n bin_21: Bin\n bin_22: Bin\n bin_23: Bin\n bin_24: Bin\n bin_25: Bin\n bin_26: Bin\n bin_27: Bin\n bin_28: Bin\n bin_29: Bin\n bin_30: Bin\n bin_31: Bin\n }\n}\n\nexport interface PingResponse {\n rtt: string\n}\n\nexport interface ReserveState {\n radius: number\n storageRadius: number\n commitment: number\n}\n\nexport interface ChainState {\n chainTip: number\n block: number\n totalAmount: NumberString\n currentPrice: number\n}\n\nexport interface WalletBalance {\n bzzBalance: BZZ\n nativeTokenBalance: DAI\n chainID: number\n chequebookContractAddress: string\n walletAddress: string\n}\n","import { Optional } from 'cafe-utility'\nimport type { SingleOwnerChunk } from '../chunk/soc'\nimport type { FeedUploadOptions } from '../feed'\nimport type { FeedPayloadResult, FeedReferenceResult, FeedUpdateOptions } from '../modules/feed'\nimport { Bytes } from '../utils/bytes'\nimport { Duration } from '../utils/duration'\nimport type { BeeError } from '../utils/error'\nimport { Size } from '../utils/size'\nimport {\n BatchId,\n EthAddress,\n Identifier,\n PrivateKey,\n PublicKey,\n Reference,\n Topic,\n TransactionId,\n} from '../utils/typed-bytes'\n\nexport * from './debug'\n\nexport const SECTION_SIZE = 32\nexport const BRANCHES = 128\nexport const CHUNK_SIZE = SECTION_SIZE * BRANCHES\n\nexport const PSS_TARGET_HEX_LENGTH_MAX = 4\n\n/**\n * Minimum postage batch depth.\n */\nexport const STAMPS_DEPTH_MIN = 17\n\n/**\n * Maximum postage batch depth.\n */\nexport const STAMPS_DEPTH_MAX = 255\n\n/**\n * Minimum tags API page size.\n */\nexport const TAGS_LIMIT_MIN = 1\n\n/**\n * Maximum tags API page size.\n */\nexport const TAGS_LIMIT_MAX = 1000\n\n/**\n * Behavior of the HTTP client, such as `timeout`, additional `headers`, custom `httpAgent`, etc.\n */\nexport type BeeRequestOptions = {\n baseURL?: string\n timeout?: number\n headers?: Record<string, string>\n onRequest?: (request: BeeRequest) => void\n httpAgent?: unknown\n httpsAgent?: unknown\n endlesslyRetry?: boolean\n}\n\n/**\n * Options for the Bee client which affect all method calls *(unless overridden in the method call itself)*.\n *\n * Extends `BeeRequestOptions`, which allows configuring the HTTP client behavior,\n * such as `timeout`, additional `headers`, custom `httpAgent`, etc.\n */\nexport interface BeeOptions extends BeeRequestOptions {\n /**\n * Default signer (a private key) used for signing.\n *\n * Mainly used in single-owner chunk (SOC) related operations, and consequently in feeds.\n *\n * If not provided, methods such as `makeFeedWriter` and `makeSOCWriter`\n * must be provided with a private key in their respective function calls.\n */\n signer?: PrivateKey | Uint8Array | string\n\n /**\n * Network on which the Bee node is running.\n *\n * This is currently used to determine block time for postage batch time-to-live (TTL) calculations.\n * The block time for `gnosis` is `5` seconds, and for `sepolia` it is `15` seconds.\n *\n * Default value is `gnosis`.\n */\n network?: 'gnosis' | 'sepolia'\n}\n\nexport interface GranteesResult {\n status: number\n statusText: string\n ref: Reference\n historyref: Reference\n}\n\nexport interface GetGranteesResult {\n status: number\n statusText: string\n grantees: PublicKey[]\n}\n\n/**\n * Result of upload calls.\n */\nexport interface UploadResult {\n /**\n * Reference of the uploaded data\n */\n reference: Reference\n\n /**\n * Automatically created tag's UID.\n */\n tagUid?: number\n\n /**\n * History address of the uploaded data with ACT.\n */\n historyAddress: Optional<Reference>\n}\n\nexport interface UploadOptions {\n /**\n * If set to true, an ACT will be created for the uploaded data.\n */\n act?: boolean\n\n actHistoryAddress?: Reference | Uint8Array | string\n\n /**\n * Will pin the data locally in the Bee node as well.\n *\n * Locally pinned data is possible to reupload to network if it disappear.\n *\n * @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n */\n pin?: boolean\n\n /**\n * Will encrypt the uploaded data and return longer hash which also includes the decryption key.\n *\n * @see [Bee docs - Store with Encryption](https://docs.ethswarm.org/docs/develop/access-the-swarm/store-with-encryption)\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n * @see Reference\n */\n encrypt?: boolean\n\n /**\n * Tags keep track of syncing the data with network. This option allows attach existing Tag UUID to the uploaded data.\n *\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)\n * @link Tag\n */\n tag?: number\n\n /**\n * Determines if the uploaded data should be sent to the network immediately (eq. deferred=false) or in a deferred fashion (eq. deferred=true).\n *\n * With deferred style client uploads all the data to Bee node first and only then Bee node starts push the data to network itself. The progress of this upload can be tracked with tags.\n * With non-deferred style client uploads the data to Bee which immediately starts pushing the data to network. The request is only finished once all the data was pushed through the Bee node to the network.\n *\n * In future there will be move to the non-deferred style and even the support for deferred upload will be removed from Bee itself.\n *\n * @default true\n */\n deferred?: boolean\n}\n\n/**\n * Add redundancy to the data being uploaded so that downloaders can download it with better UX.\n * 0 value is default and does not add any redundancy to the file.\n */\nexport enum RedundancyLevel {\n OFF = 0,\n MEDIUM = 1,\n STRONG = 2,\n INSANE = 3,\n PARANOID = 4,\n}\n\nexport interface RedundantUploadOptions extends UploadOptions {\n redundancyLevel?: RedundancyLevel\n}\n\n/**\n * Specify the retrieve strategy on redundant data.\n * The possible values are NONE, DATA, PROX and RACE.\n * Strategy NONE means no prefetching takes place.\n * Strategy DATA means only data chunks are prefetched.\n * Strategy PROX means only chunks that are close to the node are prefetched.\n * Strategy RACE means all chunks are prefetched: n data chunks and k parity chunks. The first n chunks to arrive are used to reconstruct the file.\n * Multiple strategies can be used in a fallback cascade if the swarm redundancy fallback mode is set to true.\n * The default strategy is NONE, DATA, falling back to PROX, falling back to RACE\n */\nexport enum RedundancyStrategy {\n NONE = 0,\n DATA = 1,\n PROX = 2,\n RACE = 3,\n}\n\nexport interface DownloadOptions {\n /**\n * Specify the retrieve strategy on redundant data.\n *\n * Only applicable for erasure coded data.\n */\n redundancyStrategy?: RedundancyStrategy\n\n /**\n * Specify if the retrieve strategies (chunk prefetching on redundant data) are used in a fallback cascade. The default is true.\n *\n * Only applicable for erasure coded data.\n */\n fallback?: boolean\n\n /**\n * Specify the timeout for chunk retrieval. The default is 30 seconds.\n *\n * This is not the timeout for the whole download operation, but rather for each chunk retrieval.\n */\n timeoutMs?: number\n\n actPublisher?: PublicKey | Uint8Array | string\n\n actHistoryAddress?: Reference | Uint8Array | string\n\n actTimestamp?: string | number\n}\n\nexport interface FileUploadOptions extends UploadOptions {\n /**\n * Specifies Content-Length for the given data. It is required when uploading with Readable.\n *\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n */\n size?: number\n\n /**\n * Specifies given Content-Type so when loaded in browser the file is correctly represented.\n *\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n */\n contentType?: string\n\n redundancyLevel?: RedundancyLevel\n}\n\nexport interface CollectionUploadOptions extends UploadOptions {\n /**\n * Default file to be returned when the root hash of collection is accessed.\n *\n * @see [Bee docs - Upload a directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory)\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n */\n indexDocument?: string\n\n /**\n * Configure custom error document to be returned when a specified path can not be found in collection.\n *\n * @see [Bee docs - Upload a directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory)\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n */\n errorDocument?: string\n\n redundancyLevel?: RedundancyLevel\n}\n\nexport interface UploadHeaders {\n 'swarm-act'?: string\n 'swarm-pin'?: string\n 'swarm-encrypt'?: string\n 'swarm-tag'?: string\n 'swarm-postage-batch-id'?: string\n}\n\n/**\n * Object that contains information about upload progress of data to network.\n *\n * The total amount of chunks is represented by `split` property.\n *\n * The actual progress of the upload can be tracked by the `seen + synced` properties.\n *\n * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)\n */\nexport interface Tag {\n split: number\n seen: number\n stored: number\n sent: number\n synced: number\n uid: number\n address: string\n startedAt: string\n}\n\nexport interface AllTagsOptions {\n limit?: number\n offset?: number\n}\n\nexport interface FileHeaders {\n name?: string\n tagUid?: number\n contentType?: string\n}\n\nexport interface FileData<T> extends FileHeaders {\n data: T\n}\n\nexport interface Pin {\n reference: Reference\n}\n\nexport interface ReferenceInformation {\n contentLength: number\n}\n\n/**\n * Helper interface that adds utility functions\n * to work more conveniently with bytes in normal\n * user scenarios.\n *\n * Concretely: text(), hex(), json()\n */\nexport interface Data extends Uint8Array {\n /**\n * Converts the binary data using UTF-8 decoding into string.\n */\n text(): string\n\n /**\n * Converts the binary data into hex-string.\n */\n hex(): string\n\n /**\n * Converts the binary data into string which is then parsed into JSON.\n */\n json(): Record<string, unknown>\n}\n\n/**\n * Object represents a file and some of its metadata in [[Directory]] object.\n */\nexport interface CollectionEntry {\n path: string\n size: number\n file?: File\n fsPath?: string\n}\n\n/**\n * Represents Collections\n */\nexport type Collection = Array<CollectionEntry>\n\nexport interface PssSubscription {\n readonly topic: Topic\n cancel: () => void\n}\n\nexport interface PssMessageHandler {\n onMessage: (message: Bytes, subscription: PssSubscription) => void\n onError: (error: BeeError, subscription: PssSubscription) => void\n onClose: (subscription: PssSubscription) => void\n}\n\nexport interface GsocSubscription {\n readonly address: EthAddress\n cancel: () => void\n}\n\nexport interface GsocMessageHandler {\n onMessage: (message: Bytes, subscription: GsocSubscription) => void\n onError: (error: BeeError, subscription: GsocSubscription) => void\n onClose: (subscription: GsocSubscription) => void\n}\n\nexport interface ReferenceResponse {\n reference: Reference\n}\n\nexport type HttpMethod = 'GET' | 'DELETE' | 'POST' | 'PATCH' | 'PUT'\n\nexport type HookCallback<V> = (value: V) => void | Promise<void>\n\nexport interface BeeRequest {\n url: string\n method: string\n headers?: Record<string, string>\n params?: Record<string, unknown>\n}\n\nexport interface BeeResponse {\n headers: Record<string, string>\n status: number\n statusText?: string\n request: BeeRequest\n}\n\n/**\n * FeedReader is an interface for downloading feed updates\n */\nexport interface FeedReader {\n readonly owner: EthAddress\n readonly topic: Topic\n\n /**\n * @deprecated Use `downloadReference` or `downloadPayload` instead to disambiguate how the data should be interpreted.\n */\n download(options?: FeedUpdateOptions): Promise<FeedPayloadResult>\n\n /**\n * Downloads the feed update (latest if no index is specified) and returns it as a reference.\n */\n downloadReference(options?: FeedUpdateOptions): Promise<FeedReferenceResult>\n\n /**\n * Downloads the feed update (latest if no index is specified) and returns it as a payload.\n */\n downloadPayload(options?: FeedUpdateOptions): Promise<FeedPayloadResult>\n}\n\n/**\n * FeedWriter is an interface for updating feeds\n */\nexport interface FeedWriter extends FeedReader {\n /**\n * Upload a new feed update\n *\n * @deprecated Use `uploadReference` or `uploadPayload` instead to disambiguate how the data should be interpreted.\n *\n * @param postageBatchId Postage BatchId to be used to upload the data with\n * @param reference The reference to be stored in the new update\n * @param options Additional options like `at`\n *\n * @returns UpdateResult that points at Single Owner Chunk that contains the new update and pointer to the updated chunk reference.\n */\n upload(\n postageBatchId: string | BatchId,\n reference: Reference | string | Uint8Array,\n options?: FeedUploadOptions,\n ): Promise<UploadResult>\n\n uploadReference(\n postageBatchId: string | BatchId,\n reference: Reference | string | Uint8Array,\n options?: FeedUploadOptions,\n ): Promise<UploadResult>\n\n uploadPayload(\n postageBatchId: string | BatchId,\n payload: Uint8Array | string,\n options?: FeedUploadOptions,\n ): Promise<UploadResult>\n}\n\n/**\n * Interface for downloading single owner chunks\n */\nexport interface SOCReader {\n readonly owner: EthAddress\n /**\n * Downloads a single owner chunk\n *\n * @param identifier The identifier of the chunk\n */\n download: (identifier: Identifier | Uint8Array | string) => Promise<SingleOwnerChunk>\n}\n\n/**\n * Interface for downloading and uploading single owner chunks\n */\nexport interface SOCWriter extends SOCReader {\n /**\n * Uploads a single owner chunk\n *\n * @param identifier The identifier of the chunk\n * @param data The chunk payload data\n * @param options Upload options\n */\n upload: (\n stamp: BatchId | Uint8Array | string,\n identifier: Identifier | Uint8Array | string,\n data: Uint8Array,\n options?: UploadOptions,\n ) => Promise<UploadResult>\n}\n\nexport interface GlobalPostageBatch {\n batchID: BatchId\n value: NumberString\n start: number\n owner: EthAddress\n depth: number\n bucketDepth: number\n immutable: boolean\n batchTTL: number\n}\n\nexport interface PostageBatch {\n batchID: BatchId\n /**\n * Represents how much of the batch is used up.\n *\n * Max utilization = `2 ** (depth - bucketDepth)`\n *\n * Since the smallest depth is 17, and one batch has 65,536 buckets, and one chunk is 4,096 bytes,\n * the 512MB theoretical max size for the smallest stamp comes from `2 * 65536 * 4096 = 512MB`\n */\n utilization: number\n usable: boolean\n label: string\n depth: number\n amount: NumberString\n bucketDepth: number\n blockNumber: number\n immutableFlag: boolean\n /**\n * Estimated time until the batch expires\n */\n duration: Duration\n /**\n * A floating point number from 0 to 1, where 0 is no usage, 1 is full usage.\n */\n usage: number\n /**\n * Human readable usage text, like \"50%\" or \"100%\", no fractions\n */\n usageText: string\n /**\n * Effective size\n */\n size: Size\n /**\n * Estimated remaining size\n */\n remainingSize: Size\n /**\n * Theoretical size in bytes\n */\n theoreticalSize: Size\n /**\n * Calculates the effective size of data that can be uploaded with this postage batch\n * based on whether encryption is used and the desired redundancy level.\n */\n calculateSize(encryption: boolean, redundancyLevel: RedundancyLevel): Size\n /**\n * Calculates the remaining size of data that can be uploaded with this postage batch\n * based on whether encryption is used and the desired redundancy level.\n */\n calculateRemainingSize(encryption: boolean, redundancyLevel: RedundancyLevel): Size\n}\n\nexport interface BatchBucket {\n bucketID: number\n collisions: number\n}\n\nexport interface PostageBatchBuckets {\n depth: number\n bucketDepth: number\n bucketUpperBound: number\n buckets: BatchBucket[]\n}\n\nexport interface TransactionInfo {\n transactionHash: TransactionId\n to: string\n nonce: number\n gasPrice: NumberString\n gasLimit: number\n data: string\n created: string\n description: string\n value: string\n}\n\n/**\n * Options for creation of postage batch\n */\nexport interface PostageBatchOptions {\n /**\n * Sets label for the postage batch\n */\n label?: string\n\n /**\n * Sets gas price in Wei for the transaction that creates the postage batch\n */\n gasPrice?: NumberString | string | bigint\n\n /**\n * Controls whether data can be overwritten that was uploaded with this postage batch.\n */\n immutableFlag?: boolean\n\n /**\n * The returned Promise will await until the purchased Postage Batch is usable.\n * In other word, it has to have enough block confirmations that Bee pronounce it usable.\n * When turned on, this significantly prolongs the creation of postage batch!\n *\n * If you plan to use the stamp right away for some action with Bee (like uploading using this stamp) it is\n * highly recommended to use this option, otherwise you might get errors \"stamp not usable\" from Bee.\n *\n * @default true\n */\n waitForUsable?: boolean\n\n /**\n * When waiting for the postage stamp to become usable, this specify the timeout for the waiting.\n * Default: 120s\n */\n waitForUsableTimeout?: number\n}\n\nexport interface Envelope {\n issuer: Uint8Array\n index: Uint8Array\n timestamp: Uint8Array\n signature: Uint8Array\n}\n\nexport interface EnvelopeWithBatchId extends Envelope {\n batchId: BatchId\n}\n\n/**\n * With this type a number should be represented in a string\n */\nexport type NumberString = string & { __numberString: never }\n\nexport const capacityBreakpoints = {\n ENCRYPTION_OFF: {\n [RedundancyLevel.OFF]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '44.70 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '6.66 MB', batchDepth: 18, utilizationRate: '0.61%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '112.06 MB', batchDepth: 19, utilizationRate: '5.09%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '687.62 MB', batchDepth: 20, utilizationRate: '15.65%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '2.60 GB', batchDepth: 21, utilizationRate: '30.27%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '7.73 GB', batchDepth: 22, utilizationRate: '44.99%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '19.94 GB', batchDepth: 23, utilizationRate: '58.03%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '47.06 GB', batchDepth: 24, utilizationRate: '68.48%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '105.51 GB', batchDepth: 25, utilizationRate: '76.77%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '227.98 GB', batchDepth: 26, utilizationRate: '82.94%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '476.68 GB', batchDepth: 27, utilizationRate: '86.71%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '993.65 GB', batchDepth: 28, utilizationRate: '88.37%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '2.04 TB', batchDepth: 29, utilizationRate: '92.88%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '4.17 TB', batchDepth: 30, utilizationRate: '94.81%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '8.45 TB', batchDepth: 31, utilizationRate: '96.06%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '17.07 TB', batchDepth: 32, utilizationRate: '97.01%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '34.36 TB', batchDepth: 33, utilizationRate: '97.65%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '69.04 TB', batchDepth: 34, utilizationRate: '98.11%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '138.54 TB', batchDepth: 35, utilizationRate: '98.44%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '277.72 TB', batchDepth: 36, utilizationRate: '98.67%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '556.35 TB', batchDepth: 37, utilizationRate: '98.83%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '1.11 PB', batchDepth: 38, utilizationRate: '98.91%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '2.23 PB', batchDepth: 39, utilizationRate: '98.96%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '4.46 PB', batchDepth: 40, utilizationRate: '98.98%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '8.93 PB', batchDepth: 41, utilizationRate: '99.11%' },\n ],\n [RedundancyLevel.MEDIUM]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '41.56 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '6.19 MB', batchDepth: 18, utilizationRate: '0.57%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '104.18 MB', batchDepth: 19, utilizationRate: '4.73%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '639.27 MB', batchDepth: 20, utilizationRate: '14.54%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '2.41 GB', batchDepth: 21, utilizationRate: '28.11%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '7.18 GB', batchDepth: 22, utilizationRate: '41.79%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '18.54 GB', batchDepth: 23, utilizationRate: '53.95%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '43.75 GB', batchDepth: 24, utilizationRate: '63.66%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '98.09 GB', batchDepth: 25, utilizationRate: '71.37%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '211.95 GB', batchDepth: 26, utilizationRate: '77.11%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '443.16 GB', batchDepth: 27, utilizationRate: '80.61%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '923.78 GB', batchDepth: 28, utilizationRate: '82.16%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '1.90 TB', batchDepth: 29, utilizationRate: '86.30%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '3.88 TB', batchDepth: 30, utilizationRate: '88.14%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '7.86 TB', batchDepth: 31, utilizationRate: '89.26%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '15.87 TB', batchDepth: 32, utilizationRate: '90.21%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '31.94 TB', batchDepth: 33, utilizationRate: '90.77%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '64.19 TB', batchDepth: 34, utilizationRate: '91.22%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '128.80 TB', batchDepth: 35, utilizationRate: '91.52%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '258.19 TB', batchDepth: 36, utilizationRate: '91.73%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '517.23 TB', batchDepth: 37, utilizationRate: '91.88%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '1.04 PB', batchDepth: 38, utilizationRate: '91.95%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '2.07 PB', batchDepth: 39, utilizationRate: '92.00%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '4.15 PB', batchDepth: 40, utilizationRate: '92.15%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '8.30 PB', batchDepth: 41, utilizationRate: '92.14%' },\n ],\n [RedundancyLevel.STRONG]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '37.37 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '5.57 MB', batchDepth: 18, utilizationRate: '0.51%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '93.68 MB', batchDepth: 19, utilizationRate: '4.25%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '574.81 MB', batchDepth: 20, utilizationRate: '13.07%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '2.17 GB', batchDepth: 21, utilizationRate: '25.26%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '6.46 GB', batchDepth: 22, utilizationRate: '37.58%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '16.67 GB', batchDepth: 23, utilizationRate: '48.50%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '39.34 GB', batchDepth: 24, utilizationRate: '57.24%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '88.20 GB', batchDepth: 25, utilizationRate: '64.17%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '190.58 GB', batchDepth: 26, utilizationRate: '69.33%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '398.47 GB', batchDepth: 27, utilizationRate: '72.48%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '830.63 GB', batchDepth: 28, utilizationRate: '73.85%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '1.71 TB', batchDepth: 29, utilizationRate: '77.59%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '3.49 TB', batchDepth: 30, utilizationRate: '79.27%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '7.07 TB', batchDepth: 31, utilizationRate: '80.34%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '14.27 TB', batchDepth: 32, utilizationRate: '81.12%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '28.72 TB', batchDepth: 33, utilizationRate: '81.63%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '57.71 TB', batchDepth: 34, utilizationRate: '82.01%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '115.81 TB', batchDepth: 35, utilizationRate: '82.29%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '232.16 TB', batchDepth: 36, utilizationRate: '82.48%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '465.07 TB', batchDepth: 37, utilizationRate: '82.61%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '931.23 TB', batchDepth: 38, utilizationRate: '82.67%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '1.86 PB', batchDepth: 39, utilizationRate: '82.71%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '3.73 PB', batchDepth: 40, utilizationRate: '82.78%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '7.46 PB', batchDepth: 41, utilizationRate: '82.79%' },\n ],\n [RedundancyLevel.INSANE]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '33.88 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '5.05 MB', batchDepth: 18, utilizationRate: '0.46%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '84.92 MB', batchDepth: 19, utilizationRate: '3.86%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '521.09 MB', batchDepth: 20, utilizationRate: '11.85%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '1.97 GB', batchDepth: 21, utilizationRate: '22.90%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '5.86 GB', batchDepth: 22, utilizationRate: '34.09%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '15.11 GB', batchDepth: 23, utilizationRate: '43.97%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '35.66 GB', batchDepth: 24, utilizationRate: '51.90%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '79.96 GB', batchDepth: 25, utilizationRate: '58.18%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '172.77 GB', batchDepth: 26, utilizationRate: '62.85%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '361.23 GB', batchDepth: 27, utilizationRate: '65.70%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '753.00 GB', batchDepth: 28, utilizationRate: '66.95%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '1.55 TB', batchDepth: 29, utilizationRate: '70.38%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '3.16 TB', batchDepth: 30, utilizationRate: '71.92%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '6.41 TB', batchDepth: 31, utilizationRate: '72.85%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '12.93 TB', batchDepth: 32, utilizationRate: '73.53%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '26.04 TB', batchDepth: 33, utilizationRate: '74.01%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '52.32 TB', batchDepth: 34, utilizationRate: '74.35%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '104.99 TB', batchDepth: 35, utilizationRate: '74.60%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '210.46 TB', batchDepth: 36, utilizationRate: '74.77%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '421.61 TB', batchDepth: 37, utilizationRate: '74.89%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '844.20 TB', batchDepth: 38, utilizationRate: '74.94%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '1.69 PB', batchDepth: 39, utilizationRate: '74.98%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '3.38 PB', batchDepth: 40, utilizationRate: '75.03%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '6.77 PB', batchDepth: 41, utilizationRate: '75.10%' },\n ],\n [RedundancyLevel.PARANOID]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '13.27 kB', batchDepth: 17, utilizationRate: '0.00%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '1.98 MB', batchDepth: 18, utilizationRate: '0.18%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '33.27 MB', batchDepth: 19, utilizationRate: '1.51%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '204.14 MB', batchDepth: 20, utilizationRate: '4.64%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '771.13 MB', batchDepth: 21, utilizationRate: '8.75%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '2.29 GB', batchDepth: 22, utilizationRate: '13.34%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '5.92 GB', batchDepth: 23, utilizationRate: '17.22%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '13.97 GB', batchDepth: 24, utilizationRate: '20.33%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '31.32 GB', batchDepth: 25, utilizationRate: '22.79%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '67.68 GB', batchDepth: 26, utilizationRate: '24.62%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '141.51 GB', batchDepth: 27, utilizationRate: '25.74%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '294.99 GB', batchDepth: 28, utilizationRate: '26.23%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '606.90 GB', batchDepth: 29, utilizationRate: '27.56%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '1.24 TB', batchDepth: 30, utilizationRate: '28.15%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '2.51 TB', batchDepth: 31, utilizationRate: '28.54%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '5.07 TB', batchDepth: 32, utilizationRate: '28.82%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '10.20 TB', batchDepth: 33, utilizationRate: '28.99%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '20.50 TB', batchDepth: 34, utilizationRate: '29.13%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '41.13 TB', batchDepth: 35, utilizationRate: '29.22%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '82.45 TB', batchDepth: 36, utilizationRate: '29.29%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '165.17 TB', batchDepth: 37, utilizationRate: '29.34%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '330.72 TB', batchDepth: 38, utilizationRate: '29.37%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '661.97 TB', batchDepth: 39, utilizationRate: '29.39%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '1.32 PB', batchDepth: 40, utilizationRate: '29.41%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '2.65 PB', batchDepth: 41, utilizationRate: '29.43%' },\n ],\n },\n\n ENCRYPTION_ON: {\n [RedundancyLevel.OFF]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '44.35 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '6.61 MB', batchDepth: 18, utilizationRate: '0.60%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '111.18 MB', batchDepth: 19, utilizationRate: '5.05%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '682.21 MB', batchDepth: 20, utilizationRate: '15.52%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '2.58 GB', batchDepth: 21, utilizationRate: '30.04%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '7.67 GB', batchDepth: 22, utilizationRate: '44.62%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '19.78 GB', batchDepth: 23, utilizationRate: '57.56%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '46.69 GB', batchDepth: 24, utilizationRate: '67.93%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '104.68 GB', batchDepth: 25, utilizationRate: '76.16%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '226.19 GB', batchDepth: 26, utilizationRate: '82.29%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '472.93 GB', batchDepth: 27, utilizationRate: '86.02%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '985.83 GB', batchDepth: 28, utilizationRate: '87.66%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '2.03 TB', batchDepth: 29, utilizationRate: '92.25%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '4.14 TB', batchDepth: 30, utilizationRate: '94.21%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '8.39 TB', batchDepth: 31, utilizationRate: '95.37%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '16.93 TB', batchDepth: 32, utilizationRate: '96.22%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '34.09 TB', batchDepth: 33, utilizationRate: '96.88%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '68.50 TB', batchDepth: 34, utilizationRate: '97.34%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '137.45 TB', batchDepth: 35, utilizationRate: '97.67%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '275.53 TB', batchDepth: 36, utilizationRate: '97.89%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '551.97 TB', batchDepth: 37, utilizationRate: '98.05%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '1.11 PB', batchDepth: 38, utilizationRate: '98.13%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '2.21 PB', batchDepth: 39, utilizationRate: '98.18%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '4.43 PB', batchDepth: 40, utilizationRate: '98.36%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '8.86 PB', batchDepth: 41, utilizationRate: '98.37%' },\n ],\n [RedundancyLevel.MEDIUM]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '40.89 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '6.09 MB', batchDepth: 18, utilizationRate: '0.56%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '102.49 MB', batchDepth: 19, utilizationRate: '4.65%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '628.91 MB', batchDepth: 20, utilizationRate: '14.30%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '2.38 GB', batchDepth: 21, utilizationRate: '27.68%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '7.07 GB', batchDepth: 22, utilizationRate: '41.15%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '18.24 GB', batchDepth: 23, utilizationRate: '53.09%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '43.04 GB', batchDepth: 24, utilizationRate: '62.63%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '96.50 GB', batchDepth: 25, utilizationRate: '70.21%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '208.52 GB', batchDepth: 26, utilizationRate: '75.86%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '435.98 GB', batchDepth: 27, utilizationRate: '79.30%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '908.81 GB', batchDepth: 28, utilizationRate: '80.82%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '1.87 TB', batchDepth: 29, utilizationRate: '84.98%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '3.81 TB', batchDepth: 30, utilizationRate: '86.67%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '7.73 TB', batchDepth: 31, utilizationRate: '87.84%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '15.61 TB', batchDepth: 32, utilizationRate: '88.74%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '31.43 TB', batchDepth: 33, utilizationRate: '89.34%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '63.15 TB', batchDepth: 34, utilizationRate: '89.74%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '126.71 TB', batchDepth: 35, utilizationRate: '90.03%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '254.01 TB', batchDepth: 36, utilizationRate: '90.24%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '508.85 TB', batchDepth: 37, utilizationRate: '90.39%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '1.02 PB', batchDepth: 38, utilizationRate: '90.47%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '2.04 PB', batchDepth: 39, utilizationRate: '90.51%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '4.08 PB', batchDepth: 40, utilizationRate: '90.64%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '8.17 PB', batchDepth: 41, utilizationRate: '90.65%' },\n ],\n [RedundancyLevel.STRONG]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '36.73 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '5.47 MB', batchDepth: 18, utilizationRate: '0.50%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '92.07 MB', batchDepth: 19, utilizationRate: '4.18%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '564.95 MB', batchDepth: 20, utilizationRate: '12.85%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '2.13 GB', batchDepth: 21, utilizationRate: '24.86%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '6.35 GB', batchDepth: 22, utilizationRate: '36.97%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '16.38 GB', batchDepth: 23, utilizationRate: '47.67%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '38.66 GB', batchDepth: 24, utilizationRate: '56.26%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '86.69 GB', batchDepth: 25, utilizationRate: '63.07%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '187.31 GB', batchDepth: 26, utilizationRate: '68.14%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '391.64 GB', batchDepth: 27, utilizationRate: '71.24%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '816.39 GB', batchDepth: 28, utilizationRate: '72.59%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '1.68 TB', batchDepth: 29, utilizationRate: '76.34%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '3.43 TB', batchDepth: 30, utilizationRate: '77.89%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '6.94 TB', batchDepth: 31, utilizationRate: '78.86%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '14.02 TB', batchDepth: 32, utilizationRate: '79.71%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '28.23 TB', batchDepth: 33, utilizationRate: '80.23%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '56.72 TB', batchDepth: 34, utilizationRate: '80.60%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '113.82 TB', batchDepth: 35, utilizationRate: '80.88%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '228.18 TB', batchDepth: 36, utilizationRate: '81.06%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '457.10 TB', batchDepth: 37, utilizationRate: '81.20%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '915.26 TB', batchDepth: 38, utilizationRate: '81.26%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '1.83 PB', batchDepth: 39, utilizationRate: '81.30%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '3.67 PB', batchDepth: 40, utilizationRate: '81.43%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '7.34 PB', batchDepth: 41, utilizationRate: '81.45%' },\n ],\n [RedundancyLevel.INSANE]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '33.26 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '4.96 MB', batchDepth: 18, utilizationRate: '0.45%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '83.38 MB', batchDepth: 19, utilizationRate: '3.79%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '511.65 MB', batchDepth: 20, utilizationRate: '11.64%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '1.93 GB', batchDepth: 21, utilizationRate: '22.52%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '5.75 GB', batchDepth: 22, utilizationRate: '33.50%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '14.84 GB', batchDepth: 23, utilizationRate: '43.19%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '35.02 GB', batchDepth: 24, utilizationRate: '50.96%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '78.51 GB', batchDepth: 25, utilizationRate: '57.12%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '169.64 GB', batchDepth: 26, utilizationRate: '61.71%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '354.69 GB', batchDepth: 27, utilizationRate: '64.52%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '739.37 GB', batchDepth: 28, utilizationRate: '65.74%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '1.52 TB', batchDepth: 29, utilizationRate: '69.15%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '3.10 TB', batchDepth: 30, utilizationRate: '70.56%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '6.29 TB', batchDepth: 31, utilizationRate: '71.48%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '12.70 TB', batchDepth: 32, utilizationRate: '72.18%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '25.57 TB', batchDepth: 33, utilizationRate: '72.67%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '51.37 TB', batchDepth: 34, utilizationRate: '73.00%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '103.08 TB', batchDepth: 35, utilizationRate: '73.24%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '206.65 TB', batchDepth: 36, utilizationRate: '73.42%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '413.98 TB', batchDepth: 37, utilizationRate: '73.54%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '828.91 TB', batchDepth: 38, utilizationRate: '73.59%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '1.66 PB', batchDepth: 39, utilizationRate: '73.62%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '3.32 PB', batchDepth: 40, utilizationRate: '73.72%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '6.64 PB', batchDepth: 41, utilizationRate: '73.74%' },\n ],\n [RedundancyLevel.PARANOID]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '13.17 kB', batchDepth: 17, utilizationRate: '0.00%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '1.96 MB', batchDepth: 18, utilizationRate: '0.18%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '33.01 MB', batchDepth: 19, utilizationRate: '1.50%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '202.53 MB', batchDepth: 20, utilizationRate: '4.61%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '765.05 MB', batchDepth: 21, utilizationRate: '8.68%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '2.28 GB', batchDepth: 22, utilizationRate: '13.27%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '5.87 GB', batchDepth: 23, utilizationRate: '17.08%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '13.86 GB', batchDepth: 24, utilizationRate: '20.17%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '31.08 GB', batchDepth: 25, utilizationRate: '22.61%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '67.15 GB', batchDepth: 26, utilizationRate: '24.43%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '140.40 GB', batchDepth: 27, utilizationRate: '25.54%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '292.67 GB', batchDepth: 28, utilizationRate: '26.03%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '602.12 GB', batchDepth: 29, utilizationRate: '27.35%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '1.23 TB', batchDepth: 30, utilizationRate: '27.94%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '2.49 TB', batchDepth: 31, utilizationRate: '28.32%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '5.03 TB', batchDepth: 32, utilizationRate: '28.60%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '10.12 TB', batchDepth: 33, utilizationRate: '28.77%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '20.34 TB', batchDepth: 34, utilizationRate: '28.91%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '40.80 TB', batchDepth: 35, utilizationRate: '29.00%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '81.80 TB', batchDepth: 36, utilizationRate: '29.06%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '163.87 TB', batchDepth: 37, utilizationRate: '29.11%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '328.11 TB', batchDepth: 38, utilizationRate: '29.14%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '656.76 TB', batchDepth: 39, utilizationRate: '29.16%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '1.31 PB', batchDepth: 40, utilizationRate: '29.18%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '2.63 PB', batchDepth: 41, utilizationRate: '29.19%' },\n ],\n },\n}\n","import { Dates } from 'cafe-utility'\n\nexport class Duration {\n private seconds: number\n static ZERO: Duration = new Duration(0)\n\n private constructor(seconds: number) {\n this.seconds = Math.ceil(seconds)\n\n if (seconds < 0) {\n this.seconds = 0\n }\n }\n\n static fromMilliseconds(milliseconds: number): Duration {\n return new Duration(milliseconds / 1000)\n }\n\n static fromSeconds(seconds: number): Duration {\n return new Duration(seconds)\n }\n\n static fromHours(hours: number): Duration {\n return new Duration(hours * 60 * 60)\n }\n\n static fromDays(days: number): Duration {\n return new Duration(days * 24 * 60 * 60)\n }\n\n static fromWeeks(weeks: number): Duration {\n return new Duration(weeks * 7 * 24 * 60 * 60)\n }\n\n static fromYears(years: number): Duration {\n return new Duration(years * 365 * 24 * 60 * 60)\n }\n\n static fromEndDate(endDate: Date, startDate?: Date): Duration {\n return new Duration((endDate.getTime() - (startDate ?? new Date()).getTime()) / 1000)\n }\n\n /**\n * Parses a duration string and returns a `Duration` instance.\n *\n * Case insensitive. E.g. both `\"28h\"` and `\"1D\"` are valid.\n *\n * Whitespaces are ignored. E.g. both `\"5 d\"` and `\"2weeks\"` are valid.\n *\n * Decimal numbers are supported. E.g. `\"1.5h\"` is valid.\n *\n * Supported units:\n *\n * - ms, milli, millis, millisecond, milliseconds\n * - s, sec, second, seconds\n * - m, min, minute, minutes\n * - h, hour, hours\n * - d, day, days\n * - w, week, weeks\n * - month, months\n * - y, year, years\n *\n * @param duration - A string representing a duration\n * @returns a `Duration` instance\n */\n static parseFromString(duration: string): Duration {\n return Duration.fromSeconds(Dates.make(duration) / 1000)\n }\n\n toSeconds(): number {\n return this.seconds\n }\n\n toHours(): number {\n return this.seconds / 60 / 60\n }\n\n toDays(): number {\n return this.seconds / 24 / 60 / 60\n }\n\n toWeeks(): number {\n return this.seconds / 7 / 24 / 60 / 60\n }\n\n toYears(): number {\n return this.seconds / 365 / 24 / 60 / 60\n }\n\n toEndDate(startDate?: Date): Date {\n return new Date((startDate ?? new Date()).getTime() + this.seconds * 1000)\n }\n\n represent(): string {\n return Dates.secondsToHumanTime(this.seconds)\n }\n\n isZero(): boolean {\n return this.seconds === 0\n }\n}\n","import { FixedPointNumber } from 'cafe-utility'\nimport { NumberString } from '..'\n\nexport class BZZ {\n public static readonly DIGITS = 16\n\n private state: FixedPointNumber\n\n private constructor(state: FixedPointNumber) {\n this.state = state\n }\n\n public static fromDecimalString(string: string) {\n return new BZZ(FixedPointNumber.fromDecimalString(string, BZZ.DIGITS))\n }\n\n public static fromPLUR(plur: NumberString | string | bigint) {\n return new BZZ(new FixedPointNumber(plur, BZZ.DIGITS))\n }\n\n public toPLURString() {\n return this.state.toString()\n }\n\n public toPLURBigInt() {\n return this.state.value\n }\n\n public toDecimalString() {\n return this.state.toDecimalString()\n }\n\n public toSignificantDigits(digits: number) {\n return this.toDecimalString().slice(0, this.toDecimalString().indexOf('.') + digits + 1)\n }\n\n /**\n * Does not mutate the current BZZ instance.\n *\n * @param other BZZ instance, or amount in PLUR\n * @returns New BZZ instance\n */\n public plus(other: BZZ | NumberString | string | bigint) {\n return new BZZ(this.state.add(other instanceof BZZ ? other.state : new FixedPointNumber(other, BZZ.DIGITS)))\n }\n\n /**\n * Does not mutate the current BZZ instance.\n *\n * @param other BZZ instance, or amount in PLUR\n * @returns New BZZ instance\n */\n public minus(other: BZZ | NumberString | string | bigint) {\n return new BZZ(this.state.subtract(other instanceof BZZ ? other.state : new FixedPointNumber(other, BZZ.DIGITS)))\n }\n\n /**\n * Does not mutate the current BZZ instance.\n *\n * @param other Divisor\n * @returns New BZZ instance\n */\n public divide(other: bigint) {\n return new BZZ(this.state.divmod(other)[0])\n }\n\n public gt(other: BZZ) {\n return this.state.compare(other.state) === 1\n }\n\n public gte(other: BZZ) {\n return this.state.compare(other.state) !== -1\n }\n\n public lt(other: BZZ) {\n return this.state.compare(other.state) === -1\n }\n\n public lte(other: BZZ) {\n return this.state.compare(other.state) !== 1\n }\n\n public eq(other: BZZ) {\n return this.state.compare(other.state) === 0\n }\n\n public exchangeToDAI(daiPerBzz: DAI): DAI {\n return DAI.fromWei(\n this.state.exchange('*', new FixedPointNumber(daiPerBzz.toWeiBigInt(), DAI.DIGITS), DAI.DIGITS).value,\n )\n }\n}\n\nexport class DAI {\n public static readonly DIGITS = 18\n\n private state: FixedPointNumber\n\n private constructor(state: FixedPointNumber) {\n this.state = state\n }\n\n public static fromDecimalString(string: string) {\n return new DAI(FixedPointNumber.fromDecimalString(string, DAI.DIGITS))\n }\n\n public static fromWei(wei: NumberString | string | bigint) {\n return new DAI(new FixedPointNumber(wei, DAI.DIGITS))\n }\n\n public toWeiString() {\n return this.state.toString()\n }\n\n public toWeiBigInt() {\n return this.state.value\n }\n\n public toDecimalString() {\n return this.state.toDecimalString()\n }\n\n public toSignificantDigits(digits: number) {\n return this.toDecimalString().slice(0, this.toDecimalString().indexOf('.') + digits + 1)\n }\n\n /**\n * Does not mutate the current DAI instance.\n *\n * @param other DAI instance, or amount in PLUR\n * @returns New DAI instance\n */\n public plus(other: DAI | NumberString | string | bigint) {\n return new DAI(this.state.add(other instanceof DAI ? other.state : new FixedPointNumber(other, DAI.DIGITS)))\n }\n\n /**\n * Does not mutate the current DAI instance.\n *\n * @param other DAI instance, or amount in PLUR\n * @returns New DAI instance\n */\n public minus(other: DAI | NumberString | string | bigint) {\n return new DAI(this.state.subtract(other instanceof DAI ? other.state : new FixedPointNumber(other, DAI.DIGITS)))\n }\n\n /**\n * Does not mutate the current DAI instance.\n *\n * @param other Divisor\n * @returns New DAI instance\n */\n public divide(other: bigint) {\n return new DAI(this.state.divmod(other)[0])\n }\n\n public gt(other: DAI) {\n return this.state.compare(other.state) === 1\n }\n\n public gte(other: DAI) {\n return this.state.compare(other.state) !== -1\n }\n\n public lt(other: DAI) {\n return this.state.compare(other.state) === -1\n }\n\n public lte(other: DAI) {\n return this.state.compare(other.state) !== 1\n }\n\n public eq(other: DAI) {\n return this.state.compare(other.state) === 0\n }\n\n public exchangeToBZZ(daiPerBzz: DAI): BZZ {\n return BZZ.fromPLUR(\n this.state.exchange('/', new FixedPointNumber(daiPerBzz.toWeiBigInt(), DAI.DIGITS), BZZ.DIGITS).value,\n )\n }\n}\n","/**\n * Compatibility functions for working with File API objects\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/File\n */\nexport function isFile(file: unknown): file is File {\n // browser\n if (typeof File === 'function' && file instanceof File) {\n return true\n }\n\n // node.js\n const f = file as File\n\n return (\n typeof f === 'object' &&\n typeof (f as File).name === 'string' &&\n (typeof (f as File).stream === 'function' || typeof (f as File).arrayBuffer === 'function')\n )\n}\n\n/**\n * Compatibility helper for browsers where the `arrayBuffer function is\n * missing from `File` objects.\n *\n * @param file A File object\n */\nexport async function fileArrayBuffer(file: File): Promise<ArrayBuffer> {\n if (file.arrayBuffer) {\n return file.arrayBuffer()\n }\n\n // workaround for Safari where arrayBuffer is not supported on Files\n return new Promise(resolve => {\n const fr = new FileReader()\n fr.onload = () => resolve(fr.result as ArrayBuffer)\n fr.readAsArrayBuffer(file)\n })\n}\n","import { Types } from 'cafe-utility'\nimport * as stream from 'stream'\nimport {\n AllTagsOptions,\n BeeRequestOptions,\n CollectionUploadOptions,\n DownloadOptions,\n FileUploadOptions,\n GsocMessageHandler,\n NumberString,\n PostageBatchOptions,\n PssMessageHandler,\n RedundantUploadOptions,\n Tag,\n TAGS_LIMIT_MAX,\n TAGS_LIMIT_MIN,\n TransactionOptions,\n UploadOptions,\n} from '../types'\nimport { isFile } from './file'\nimport { PublicKey, Reference } from './typed-bytes'\n\nexport function isReadable(value: unknown): value is stream.Readable {\n return typeof stream.Readable !== 'undefined' && value instanceof stream.Readable\n}\n\nexport function asNumberString(value: unknown, options?: { name?: string; min?: bigint; max?: bigint }): NumberString {\n if (typeof value === 'bigint') {\n value = value.toString()\n }\n\n return Types.asIntegerString(value, options) as NumberString\n}\n\nexport function prepareBeeRequestOptions(value: unknown): BeeRequestOptions {\n const object = Types.asObject(value, { name: 'BeeRequestOptions' })\n\n return {\n baseURL: Types.asOptional(x => Types.asString(x, { name: 'baseURL' }), object.baseURL),\n timeout: Types.asOptional(x => Types.asInteger(x, { name: 'timeout', min: 0 }), object.timeout),\n headers: Types.asOptional(x => Types.asStringMap(x, { name: 'headers' }), object.headers),\n onRequest: Types.asOptional(x => Types.asFunction(x, { name: 'onRequest' }), object.onRequest) as\n | BeeRequestOptions['onRequest']\n | undefined,\n httpAgent: object.httpAgent,\n httpsAgent: object.httpsAgent,\n endlesslyRetry: Types.asOptional(x => Types.asBoolean(x, { name: 'endlesslyRetry' }), object.endlesslyRetry),\n }\n}\n\nexport function prepareDownloadOptions(value: unknown): DownloadOptions {\n const object = Types.asObject(value, { name: 'DownloadOptions' })\n\n return {\n redundancyStrategy: Types.asOptional(\n x => Types.asInteger(x, { name: 'redundancyStrategy' }),\n object.redundancyStrategy,\n ),\n fallback: Types.asOptional(x => Types.asBoolean(x, { name: 'fallback' }), object.fallback),\n timeoutMs: Types.asOptional(x => Types.asInteger(x, { name: 'timeoutMs', min: 0 }), object.timeoutMs),\n actPublisher: Types.asOptional(x => new PublicKey(x), object.actPublisher),\n actHistoryAddress: Types.asOptional(x => new Reference(x), object.actHistoryAddress),\n actTimestamp: Types.asOptional(x => Types.asNumber(x, { name: 'actTimestamp' }), object.actTimestamp),\n }\n}\n\nexport function prepareUploadOptions(value: unknown, name = 'UploadOptions'): UploadOptions {\n const object = Types.asObject(value, { name })\n\n return {\n act: Types.asOptional(x => Types.asBoolean(x, { name: 'act' }), object.act),\n actHistoryAddress: Types.asOptional(x => new Reference(x), object.actHistoryAddress),\n deferred: Types.asOptional(x => Types.asBoolean(x, { name: 'deferred' }), object.deferred),\n encrypt: Types.asOptional(x => Types.asBoolean(x, { name: 'encrypt' }), object.encrypt),\n pin: Types.asOptional(x => Types.asBoolean(x, { name: 'pin' }), object.pin),\n tag: Types.asOptional(x => Types.asInteger(x, { name: 'tag', min: 0 }), object.tag),\n }\n}\n\nexport function prepareRedundantUploadOptions(value: unknown, name = 'UploadOptions'): RedundantUploadOptions {\n const uploadOptions = prepareUploadOptions(value, name)\n\n const object = Types.asObject(value, { name })\n\n return {\n ...uploadOptions,\n redundancyLevel: Types.asOptional(\n x => Types.asInteger(x, { name: 'redundancyLevel', min: 0 }),\n object.redundancyLevel,\n ),\n }\n}\n\nexport function prepareFileUploadOptions(value: unknown): FileUploadOptions {\n const uploadOptions = prepareUploadOptions(value, 'FileUploadOptions')\n\n const object = Types.asObject(value, { name: 'FileUploadOptions' })\n\n return {\n ...uploadOptions,\n size: Types.asOptional(x => Types.asInteger(x, { name: 'size', min: 0 }), object.size),\n contentType: Types.asOptional(x => Types.asString(x, { name: 'contentType' }), object.contentType),\n redundancyLevel: Types.asOptional(\n x => Types.asInteger(x, { name: 'redundancyLevel', min: 0 }),\n object.redundancyLevel,\n ),\n }\n}\n\nexport function prepareCollectionUploadOptions(value: unknown): CollectionUploadOptions {\n const uploadOptions = prepareUploadOptions(value, 'CollectionUploadOptions')\n\n const object = Types.asObject(value, { name: 'CollectionUploadOptions' })\n\n return {\n ...uploadOptions,\n errorDocument: Types.asOptional(x => Types.asString(x, { name: 'errorDocument' }), object.errorDocument),\n indexDocument: Types.asOptional(x => Types.asString(x, { name: 'indexDocument' }), object.indexDocument),\n redundancyLevel: Types.asOptional(\n x => Types.asInteger(x, { name: 'redundancyLevel', min: 0 }),\n object.redundancyLevel,\n ),\n }\n}\n\nexport function isTag(value: unknown): value is Tag {\n try {\n const object = Types.asObject(value, { name: 'Tag' })\n Types.asInteger(object.uid, { name: 'Tag.uid' })\n\n return true\n } catch {\n return false\n }\n}\n\nexport function preparePssMessageHandler(value: unknown): PssMessageHandler {\n const object = Types.asObject(value, { name: 'PssMessageHandler' })\n\n return {\n onMessage: Types.asFunction(object.onMessage, { name: 'onMessage' }) as PssMessageHandler['onMessage'],\n onError: Types.asFunction(object.onError, { name: 'onError' }) as PssMessageHandler['onError'],\n onClose: Types.asFunction(object.onClose, { name: 'onClose' }) as PssMessageHandler['onClose'],\n }\n}\n\nexport function prepareGsocMessageHandler(value: unknown): GsocMessageHandler {\n const object = Types.asObject(value, { name: 'GsocMessageHandler' })\n\n return {\n onMessage: Types.asFunction(object.onMessage, { name: 'onMessage' }) as GsocMessageHandler['onMessage'],\n onError: Types.asFunction(object.onError, { name: 'onError' }) as GsocMessageHandler['onError'],\n onClose: Types.asFunction(object.onClose, { name: 'onClose' }) as GsocMessageHandler['onClose'],\n }\n}\n\nexport function preparePostageBatchOptions(value: unknown): PostageBatchOptions {\n const object = Types.asObject(value, { name: 'PostageBatchOptions' })\n\n return {\n gasPrice: Types.asOptional(x => asNumberString(x, { name: 'gasPrice' }), object.gasPrice),\n immutableFlag: Types.asOptional(x => Types.asBoolean(x, { name: 'immutableFlag' }), object.immutableFlag),\n label: Types.asOptional(x => Types.asString(x, { name: 'label' }), object.label),\n waitForUsable: Types.asOptional(x => Types.asBoolean(x, { name: 'waitForUsable' }), object.waitForUsable),\n waitForUsableTimeout: Types.asOptional(\n x => Types.asInteger(x, { name: 'waitForUsableTimeout', min: 0 }),\n object.waitForUsableTimeout,\n ),\n }\n}\n\nexport function prepareTransactionOptions(value: unknown, name = 'TransactionOptions'): TransactionOptions {\n const object = Types.asObject(value, { name })\n\n return {\n gasLimit: Types.asOptional(x => asNumberString(x, { name: 'gasLimit', min: 0n }), object.gasLimit),\n gasPrice: Types.asOptional(x => asNumberString(x, { name: 'gasPrice', min: 0n }), object.gasPrice),\n }\n}\n\n/**\n * Check whether the given parameter is valid data to upload\n * @param value\n * @throws TypeError if not valid\n */\nexport function assertData(value: unknown): asserts value is string | Uint8Array {\n if (typeof value !== 'string' && !(value instanceof Uint8Array)) {\n throw new TypeError('Data must be either string or Uint8Array!')\n }\n}\n\n/**\n * Check whether the given parameter is a correct file representation to file upload.\n * @param value\n * @throws TypeError if not valid\n */\nexport function assertFileData(value: unknown): asserts value is string | Uint8Array | stream.Readable | File {\n if (typeof value !== 'string' && !(value instanceof Uint8Array) && !isFile(value) && !isReadable(value)) {\n throw new TypeError('Data must be either string, Readable, Uint8Array or File!')\n }\n}\n\n/**\n * Checks whether optional options for AllTags query are valid\n * @param options\n */\nexport function prepareAllTagsOptions(value: unknown): AllTagsOptions {\n const object = Types.asObject(value, { name: 'AllTagsOptions' })\n\n return {\n limit: Types.asOptional(\n x => Types.asInteger(x, { name: 'limit', min: TAGS_LIMIT_MIN, max: TAGS_LIMIT_MAX }),\n object.limit,\n ),\n offset: Types.asOptional(x => Types.asInteger(x, { name: 'offset', min: 0 }), object.offset),\n }\n}\n\n/**\n * Utility functions that return Tag UID\n * @param tagUid\n */\nexport function makeTagUid(tagUid: number | Tag | string | null | undefined): number {\n if (tagUid === undefined || tagUid === null) {\n throw new TypeError(`Expected number | Tag | string from tagUid, got: ${tagUid}`)\n }\n\n if (isTag(tagUid)) {\n return tagUid.uid\n } else if (typeof tagUid === 'number' || typeof tagUid === 'string') {\n return Types.asNumber(tagUid, { name: 'tagUid', min: 0 })\n }\n\n throw new TypeError(`Expected number | Tag | string from tagUid, got: ${tagUid}`)\n}\n","import { Binary } from 'cafe-utility'\nimport { capacityBreakpoints, EnvelopeWithBatchId, NumberString, RedundancyLevel } from '../types'\nimport { Bytes, parseSizeToBytes } from './bytes'\nimport { Duration } from './duration'\nimport { Size } from './size'\nimport { BZZ } from './tokens'\nimport { asNumberString } from './type'\n\nconst MAX_UTILIZATION = 0.9\n\n/**\n * Utility function that calculates usage of postage batch based on its utilization, depth and bucket depth.\n *\n * For smaller depths (up to 20), this may provide less accurate results.\n *\n * @returns {number} A number between 0 and 1 representing the usage of the postage batch.\n */\nexport function getStampUsage(utilization: number, depth: number, bucketDepth: number): number {\n return utilization / Math.pow(2, depth - bucketDepth)\n}\n\n/**\n * Utility function that calculates the theoritical maximum size of a postage batch based on its depth.\n *\n * For smaller depths (up to 22), this may provide less accurate results.\n *\n * @returns {number} The maximum theoretical size of the postage batch in bytes.\n */\nexport function getStampTheoreticalBytes(depth: number): number {\n return 4096 * 2 ** depth\n}\n\n/**\n * Based on https://docs.ethswarm.org/docs/learn/technology/contracts/postage-stamp/#effective-utilisation-table\n * Optimised for encrypted, medium erasure coding\n */\nconst effectiveSizeBreakpoints = [\n [17, 0.00004089],\n [18, 0.00609],\n [19, 0.10249],\n [20, 0.62891],\n [21, 2.38],\n [22, 7.07],\n [23, 18.24],\n [24, 43.04],\n [25, 96.5],\n [26, 208.52],\n [27, 435.98],\n [28, 908.81],\n [29, 1870],\n [30, 3810],\n [31, 7730],\n [32, 15610],\n [33, 31430],\n [34, 63150],\n]\n\n/**\n * Utility function that calculates the effective size of a postage batch based on its depth.\n *\n * Below 22 depth the effective size is 0\n * Above 34 it's always > 99%\n *\n * @returns {number} The effective size of the postage batch in bytes.\n */\nexport function getStampEffectiveBytes(\n depth: number,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n): number {\n if (depth < 17) {\n return 0\n }\n\n if (encryption !== undefined && erasureCodeLevel !== undefined) {\n const encryptionKey = encryption ? 'ENCRYPTION_ON' : 'ENCRYPTION_OFF'\n const breakpoints = capacityBreakpoints[encryptionKey][erasureCodeLevel]\n const entry = breakpoints.find(item => item.batchDepth === depth)\n\n if (entry?.effectiveVolume) {\n return parseSizeToBytes(entry.effectiveVolume)\n }\n } else {\n const breakpoint = effectiveSizeBreakpoints.find(([d, size]) => {\n if (depth === d) {\n return size\n }\n })\n\n if (breakpoint) {\n return breakpoint[1] * 1000 * 1000 * 1000\n }\n }\n\n return Math.ceil(getStampTheoreticalBytes(depth) * MAX_UTILIZATION)\n}\n\nexport function getStampEffectiveBytesBreakpoints(\n encryption: boolean,\n erasureCodeLevel?: RedundancyLevel,\n): Map<number, number> {\n const map = new Map<number, number>()\n\n for (let i = 17; i < 35; i++) {\n map.set(i, getStampEffectiveBytes(i, encryption, erasureCodeLevel))\n }\n\n return map\n}\n\n/**\n * Utility function that calculates the cost of a postage batch based on its depth and amount.\n */\nexport function getStampCost(depth: number, amount: NumberString | string | bigint): BZZ {\n return BZZ.fromPLUR(2n ** BigInt(depth) * BigInt(amount))\n}\n\n/**\n * Utility function that calculates the TTL of a postage batch based on its amount, price per block and block time.\n *\n * For more accurate results, get the price per block and block time from the Bee node or the blockchain.\n *\n * @returns {number} The TTL of the postage batch.\n */\nexport function getStampDuration(\n amount: NumberString | string | bigint,\n pricePerBlock: number,\n blockTime: number,\n): Duration {\n const amountBigInt = BigInt(asNumberString(amount))\n\n return Duration.fromSeconds(Number((amountBigInt * BigInt(blockTime)) / BigInt(pricePerBlock)))\n}\n\n/**\n * Get the postage batch `amount` required for a given `duration`.\n *\n * @param duration A duration object representing the duration of the storage.\n * @param pricePerBlock The price per block in PLUR.\n * @param blockTime The block time in seconds.\n */\nexport function getAmountForDuration(duration: Duration, pricePerBlock: number, blockTime: number): bigint {\n return (BigInt(duration.toSeconds()) / BigInt(blockTime)) * BigInt(pricePerBlock) + 1n\n}\n\n/**\n * Utility function that calculates the depth required for a postage batch to achieve the specified effective size\n *\n * @param size The effective size of the postage batch\n * @returns\n */\nexport function getDepthForSize(size: Size, encryption?: boolean, erasureCodeLevel?: RedundancyLevel): number {\n if (encryption !== undefined && erasureCodeLevel !== undefined) {\n const encryptionKey = encryption ? 'ENCRYPTION_ON' : 'ENCRYPTION_OFF'\n const breakpoints = capacityBreakpoints[encryptionKey][erasureCodeLevel]\n\n const entry = breakpoints.find(item => {\n return size.toBytes() <= parseSizeToBytes(item.effectiveVolume)\n })\n\n if (entry?.effectiveVolume) {\n return entry.batchDepth\n }\n } else {\n for (const [depth, sizeBreakpoint] of effectiveSizeBreakpoints) {\n if (size.toBytes() <= sizeBreakpoint * 1000 * 1000 * 1000) {\n return depth\n }\n }\n }\n\n return 35\n}\n\nexport function convertEnvelopeToMarshaledStamp(envelope: EnvelopeWithBatchId): Bytes {\n return marshalStamp(envelope.signature, envelope.batchId.toUint8Array(), envelope.timestamp, envelope.index)\n}\n\nexport function marshalStamp(\n signature: Uint8Array,\n batchId: Uint8Array,\n timestamp: Uint8Array,\n index: Uint8Array,\n): Bytes {\n if (signature.length !== 65) {\n throw Error('invalid signature length')\n }\n\n if (batchId.length !== 32) {\n throw Error('invalid batch ID length')\n }\n\n if (timestamp.length !== 8) {\n throw Error('invalid timestamp length')\n }\n\n if (index.length !== 8) {\n throw Error('invalid index length')\n }\n\n return new Bytes(Binary.concatBytes(batchId, index, timestamp, signature))\n}\n","import { Types } from 'cafe-utility'\nimport { EnvelopeWithBatchId, FileHeaders } from '../types'\nimport { BeeError } from './error'\nimport { convertEnvelopeToMarshaledStamp } from './stamps'\nimport { BatchId, PublicKey, Reference } from './typed-bytes'\n\nexport function readFileHeaders(headers: Record<string, string>): FileHeaders {\n const name = readContentDispositionFilename(headers['content-disposition'])\n const tagUid = readTagUid(headers['swarm-tag-uid'])\n const contentType = headers['content-type'] || undefined\n\n return {\n name,\n tagUid,\n contentType,\n }\n}\n\nfunction readContentDispositionFilename(header: string | null): string {\n if (!header) {\n throw new BeeError('missing content-disposition header')\n }\n\n // Regex was found here\n // https://stackoverflow.com/questions/23054475/javascript-regex-for-extracting-filename-from-content-disposition-header\n const dispositionMatch = header.match(/filename\\*?=['\"]?(?:UTF-\\d['\"]*)?([^;\\r\\n\"']*)['\"]?;?/i)\n\n if (dispositionMatch && dispositionMatch.length > 0) {\n return dispositionMatch[1]\n }\n throw new BeeError('invalid content-disposition header')\n}\n\nfunction readTagUid(header: string | null): number | undefined {\n if (!header) {\n return undefined\n }\n\n return parseInt(header, 10)\n}\n\nexport function prepareRequestHeaders(\n stamp: BatchId | Uint8Array | string | EnvelopeWithBatchId | null,\n nullableOptions?: unknown,\n): Record<string, string> {\n const headers: Record<string, string> = {}\n\n if (isEnvelopeWithBatchId(stamp)) {\n headers['swarm-postage-stamp'] = convertEnvelopeToMarshaledStamp(stamp).toHex()\n } else if (stamp) {\n stamp = new BatchId(stamp)\n headers['swarm-postage-batch-id'] = stamp.toHex()\n }\n\n if (!nullableOptions) {\n return headers\n }\n\n const options = Types.asObject(nullableOptions)\n\n if (options.size) {\n headers['content-length'] = String(options.size)\n }\n\n if (options.contentType) {\n headers['content-type'] = String(options.contentType)\n }\n\n if (options.redundancyLevel) {\n headers['swarm-redundancy-level'] = String(options.redundancyLevel)\n }\n\n if (Types.isBoolean(options.act)) {\n headers['swarm-act'] = String(options.act)\n }\n\n if (Types.isBoolean(options.pin)) {\n headers['swarm-pin'] = String(options.pin)\n }\n\n if (Types.isBoolean(options.encrypt)) {\n headers['swarm-encrypt'] = options.encrypt.toString()\n }\n\n if (options.tag) {\n headers['swarm-tag'] = String(options.tag)\n }\n\n if (Types.isBoolean(options.deferred)) {\n headers['swarm-deferred-upload'] = options.deferred.toString()\n }\n\n if (options.redundancyStrategy) {\n headers['swarm-redundancy-strategy'] = String(options.redundancyStrategy)\n }\n\n if (Types.isBoolean(options.fallback)) {\n headers['swarm-redundancy-fallback-mode'] = options.fallback.toString()\n }\n\n if (options.timeoutMs) {\n headers['swarm-chunk-retrieval-timeout'] = String(options.timeoutMs)\n }\n\n if (options.indexDocument) {\n headers['swarm-index-document'] = String(options.indexDocument)\n }\n\n if (options.errorDocument) {\n headers['swarm-error-document'] = String(options.errorDocument)\n }\n\n if (options.actPublisher) {\n headers['swarm-act-publisher'] = new PublicKey(options.actPublisher as any).toCompressedHex()\n }\n\n if (options.actHistoryAddress) {\n headers['swarm-act-history-address'] = new Reference(options.actHistoryAddress as any).toHex()\n }\n\n if (options.actTimestamp) {\n headers['swarm-act-timestamp'] = String(options.actTimestamp)\n }\n\n if (options.actPublisher || options.actHistoryAddress || options.actTimestamp) {\n headers['swarm-act'] = 'true'\n }\n\n if (options.gasPrice) {\n headers['gas-price'] = String(options.gasPrice)\n }\n\n if (options.gasLimit) {\n headers['gas-limit'] = String(options.gasLimit)\n }\n\n return headers\n}\n\nfunction isEnvelopeWithBatchId(value: unknown): value is EnvelopeWithBatchId {\n if (!Types.isObject(value)) {\n return false\n }\n\n const envelope = value as EnvelopeWithBatchId\n\n return (\n envelope.issuer !== undefined &&\n envelope.index !== undefined &&\n envelope.signature !== undefined &&\n envelope.timestamp !== undefined &&\n envelope.batchId !== undefined\n )\n}\n","import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'\nimport { Dates, Objects, Strings, System } from 'cafe-utility'\nimport _debug from 'debug'\nimport { BeeRequestOptions, BeeResponseError } from '../index'\n\nconst debug = _debug('bee-js:http')\n\nconst { AxiosError } = axios\n\nconst MAX_FAILED_ATTEMPTS = 100_000\nconst DELAY_FAST = 200\nconst DELAY_SLOW = 1000\nconst DELAY_THRESHOLD = Dates.minutes(1) / DELAY_FAST\n\nexport const DEFAULT_HTTP_CONFIG: AxiosRequestConfig = {\n headers: {\n accept: 'application/json, text/plain, */*',\n },\n maxBodyLength: Infinity,\n maxContentLength: Infinity,\n}\n\n/**\n * Main function to make HTTP requests.\n * @param options User defined settings\n * @param config Internal settings and/or Bee settings\n */\nexport async function http<T>(options: BeeRequestOptions, config: AxiosRequestConfig): Promise<AxiosResponse<T>> {\n const requestConfig: AxiosRequestConfig = Objects.deepMerge3(DEFAULT_HTTP_CONFIG, config, options)\n\n if (requestConfig.data && typeof Buffer !== 'undefined' && Buffer.isBuffer(requestConfig.data)) {\n requestConfig.data = requestConfig.data.buffer.slice(\n requestConfig.data.byteOffset,\n requestConfig.data.byteOffset + requestConfig.data.byteLength,\n )\n }\n\n if (requestConfig.params) {\n const keys = Object.keys(requestConfig.params)\n for (const key of keys) {\n const value = requestConfig.params[key]\n\n if (value === undefined) {\n delete requestConfig.params[key]\n }\n }\n }\n\n let failedAttempts = 0\n while (failedAttempts < MAX_FAILED_ATTEMPTS) {\n try {\n debug(\n `${requestConfig.method || 'get'} ${Strings.joinUrl([\n requestConfig.baseURL as string,\n requestConfig.url as string,\n ])}`,\n { headers: { ...requestConfig.headers } as Record<string, string>, params: requestConfig.params },\n )\n maybeRunOnRequestHook(options, requestConfig)\n const response = await axios(requestConfig)\n\n return response as AxiosResponse<T>\n } catch (e: unknown) {\n if (e instanceof AxiosError) {\n if (e.code === 'ECONNABORTED' && options.endlesslyRetry) {\n failedAttempts++\n await System.sleepMillis(failedAttempts < DELAY_THRESHOLD ? DELAY_FAST : DELAY_SLOW)\n } else {\n throw new BeeResponseError(\n config.method || 'get',\n config.url || '<unknown>',\n e.message,\n e.response?.data,\n e.response?.status,\n e.code,\n )\n }\n } else {\n throw e\n }\n }\n }\n throw Error('Max number of failed attempts reached')\n}\n\nfunction maybeRunOnRequestHook(options: BeeRequestOptions, requestConfig: AxiosRequestConfig) {\n if (options.onRequest) {\n options.onRequest({\n method: requestConfig.method || 'GET',\n url: Strings.joinUrl([requestConfig.baseURL as string, requestConfig.url as string]),\n headers: { ...requestConfig.headers } as Record<string, string>,\n params: requestConfig.params,\n })\n }\n}\n","import { Optional, Types } from 'cafe-utility'\nimport type { BeeRequestOptions, DownloadOptions, EnvelopeWithBatchId, UploadOptions, UploadResult } from '../types'\nimport { prepareRequestHeaders } from '../utils/headers'\nimport { http } from '../utils/http'\nimport { makeTagUid } from '../utils/type'\nimport { BatchId, Reference } from '../utils/typed-bytes'\n\nconst endpoint = 'chunks'\n\n/**\n * Upload chunk to a Bee node\n *\n * The chunk data consists of 8 byte span and up to 4096 bytes of payload data.\n * The span stores the length of the payload in uint64 little endian encoding.\n * Upload expects the chuck data to be set accordingly.\n *\n * @param requestOptions Options for making requests\n * @param data Chunk data to be uploaded\n * @param stamp BatchId or marshaled stamp to be used for the upload\n * @param options Additional options like tag, encryption, pinning\n */\nexport async function upload(\n requestOptions: BeeRequestOptions,\n data: Uint8Array,\n stamp: EnvelopeWithBatchId | BatchId | Uint8Array | string,\n options?: UploadOptions,\n): Promise<UploadResult> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: `${endpoint}`,\n data,\n headers: {\n 'content-type': 'application/octet-stream',\n ...prepareRequestHeaders(stamp, options),\n },\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n reference: new Reference(Types.asString(body.reference, { name: 'reference' })),\n tagUid: response.headers['swarm-tag'] ? makeTagUid(response.headers['swarm-tag']) : undefined,\n historyAddress: response.headers['swarm-act-history-address']\n ? Optional.of(new Reference(response.headers['swarm-act-history-address']))\n : Optional.empty(),\n }\n}\n\n/**\n * Download chunk data as a byte array\n *\n * @param requestOptions Options for making requests\n * @param hash Bee content reference\n *\n */\nexport async function download(\n requestOptions: BeeRequestOptions,\n reference: Reference | string | Uint8Array,\n options?: DownloadOptions,\n): Promise<Uint8Array> {\n reference = new Reference(reference)\n\n const response = await http<ArrayBuffer>(requestOptions, {\n responseType: 'arraybuffer',\n url: `${endpoint}/${reference}`,\n headers: prepareRequestHeaders(null, options),\n })\n\n return new Uint8Array(response.data)\n}\n","import { Binary } from 'cafe-utility'\nimport * as chunkAPI from '../modules/chunk'\nimport * as socAPI from '../modules/soc'\nimport { BeeRequestOptions, UploadOptions, UploadResult } from '../types'\nimport { Bytes } from '../utils/bytes'\nimport { BeeError } from '../utils/error'\nimport { BatchId, EthAddress, Identifier, PrivateKey, Reference, Signature, Span } from '../utils/typed-bytes'\nimport { calculateChunkAddress } from './bmt'\nimport { asContentAddressedChunk, Chunk, makeContentAddressedChunk } from './cac'\n\nconst SOC_SIGNATURE_OFFSET = Identifier.LENGTH\nconst SOC_SPAN_OFFSET = SOC_SIGNATURE_OFFSET + Signature.LENGTH\nconst SOC_PAYLOAD_OFFSET = SOC_SPAN_OFFSET + Span.LENGTH\n\n/**\n * With single owner chunks, a user can assign arbitrary data to an\n * address and attest chunk integrity with their digital signature.\n *\n * This interface extends the Chunk interface so it has the same\n * properties, but the address calculation is based on the identifier\n * and the owner of the chunk.\n */\nexport interface SingleOwnerChunk extends Chunk {\n identifier: Identifier\n signature: Signature\n owner: EthAddress\n}\n\nfunction recoverChunkOwner(data: Uint8Array): EthAddress {\n const cacData = data.slice(SOC_SPAN_OFFSET)\n const chunkAddress = calculateChunkAddress(cacData)\n const signature = Signature.fromSlice(data, SOC_SIGNATURE_OFFSET)\n const identifier = Bytes.fromSlice(data, 0, Identifier.LENGTH)\n const digest = Binary.concatBytes(identifier.toUint8Array(), chunkAddress.toUint8Array())\n const ownerAddress = signature.recoverPublicKey(digest).address()\n\n return ownerAddress\n}\n\n/**\n * Verifies if the data is a valid single owner chunk\n *\n * @param data The chunk data\n * @param address The address of the single owner chunk\n *\n * @returns a single owner chunk or throws error\n */\nexport function makeSingleOwnerChunkFromData(\n data: Bytes | Uint8Array,\n address: Reference | Uint8Array | string,\n): SingleOwnerChunk {\n data = data instanceof Bytes ? data.toUint8Array() : data\n address = new Reference(address)\n const ownerAddress = recoverChunkOwner(data)\n const identifier = Bytes.fromSlice(data, 0, Identifier.LENGTH)\n const socAddress = new Reference(\n Binary.keccak256(Binary.concatBytes(identifier.toUint8Array(), ownerAddress.toUint8Array())),\n )\n\n if (!Binary.equals(address.toUint8Array(), socAddress.toUint8Array())) {\n throw new BeeError('SOC Data does not match given address!')\n }\n\n const signature = Signature.fromSlice(data, SOC_SIGNATURE_OFFSET)\n const span = Span.fromSlice(data, SOC_SPAN_OFFSET)\n const payload = Bytes.fromSlice(data, SOC_PAYLOAD_OFFSET)\n\n return {\n data,\n identifier,\n signature,\n span,\n payload,\n address: socAddress,\n owner: ownerAddress,\n }\n}\n\nexport function makeSOCAddress(identifier: Identifier, address: EthAddress): Reference {\n return new Reference(Binary.keccak256(Binary.concatBytes(identifier.toUint8Array(), address.toUint8Array())))\n}\n\n/**\n * Creates a single owner chunk object\n *\n * @param chunk A chunk object used for the span and payload\n * @param identifier The identifier of the chunk\n * @param signer The signer interface for signing the chunk\n */\nexport function makeSingleOwnerChunk(\n chunk: Chunk,\n identifier: Identifier | Uint8Array | string,\n signer: PrivateKey | Uint8Array | string,\n): SingleOwnerChunk {\n identifier = new Identifier(identifier)\n signer = new PrivateKey(signer)\n const address = makeSOCAddress(identifier, signer.publicKey().address())\n const signature = signer.sign(Binary.concatBytes(identifier.toUint8Array(), chunk.address.toUint8Array()))\n const data = Binary.concatBytes(identifier.toUint8Array(), signature.toUint8Array(), chunk.data)\n\n const span = Span.fromSlice(chunk.data, 0)\n const payload = Bytes.fromSlice(chunk.data, Span.LENGTH)\n\n return {\n data,\n identifier,\n signature,\n span,\n payload,\n address,\n owner: signer.publicKey().address(),\n }\n}\n\n/**\n * Helper function to upload a chunk.\n *\n * It uses the Chunk API and calculates the address before uploading.\n *\n * @param requestOptions Options for making requests\n * @param chunk A chunk object\n * @param stamp Postage BatchId that will be assigned to uploaded data\n * @param options Upload options\n */\nexport async function uploadSingleOwnerChunk(\n requestOptions: BeeRequestOptions,\n chunk: SingleOwnerChunk,\n stamp: BatchId | Uint8Array | string,\n options?: UploadOptions,\n): Promise<UploadResult> {\n const data = Binary.concatBytes(chunk.span.toUint8Array(), chunk.payload.toUint8Array())\n\n return socAPI.upload(requestOptions, chunk.owner, chunk.identifier, chunk.signature, data, stamp, options)\n}\n\n/**\n * Helper function to create and upload SOC.\n *\n * @param requestOptions Options for making requests\n * @param signer The signer interface for signing the chunk\n * @param postageBatchId\n * @param identifier The identifier of the chunk\n * @param data The chunk data\n * @param options\n */\nexport async function uploadSingleOwnerChunkData(\n requestOptions: BeeRequestOptions,\n signer: PrivateKey | Uint8Array | string,\n stamp: BatchId | Uint8Array | string,\n identifier: Identifier | Uint8Array | string,\n data: Uint8Array,\n options?: UploadOptions,\n): Promise<UploadResult> {\n signer = new PrivateKey(signer)\n identifier = new Identifier(identifier)\n const cac = makeContentAddressedChunk(data)\n const soc = makeSingleOwnerChunk(cac, identifier, signer)\n\n return uploadSingleOwnerChunk(requestOptions, soc, stamp, options)\n}\n\nexport async function uploadSingleOwnerChunkWithWrappedChunk(\n requestOptions: BeeRequestOptions,\n signer: PrivateKey | Uint8Array | string,\n stamp: BatchId | Uint8Array | string,\n identifier: Identifier | Uint8Array | string,\n rootChunk: Uint8Array,\n options?: UploadOptions,\n): Promise<UploadResult> {\n signer = new PrivateKey(signer)\n identifier = new Identifier(identifier)\n const soc = makeSingleOwnerChunk(asContentAddressedChunk(rootChunk), identifier, signer)\n\n return uploadSingleOwnerChunk(requestOptions, soc, stamp, options)\n}\n\n/**\n * Helper function to download SOC.\n *\n * @param url The url of the Bee service\n * @param ownerAddress The signer interface for signing the chunk\n * @param identifier The identifier of the chunk\n */\nexport async function downloadSingleOwnerChunk(\n requestOptions: BeeRequestOptions,\n ownerAddress: EthAddress | Uint8Array | string,\n identifier: Identifier | Uint8Array | string,\n): Promise<SingleOwnerChunk> {\n identifier = new Identifier(identifier)\n ownerAddress = new EthAddress(ownerAddress)\n const address = makeSOCAddress(identifier, ownerAddress)\n const cac = await chunkAPI.download(requestOptions, address.toHex())\n\n return makeSingleOwnerChunkFromData(cac, address)\n}\n","import { Optional, Types } from 'cafe-utility'\nimport { BeeRequestOptions, UploadOptions, UploadResult } from '../types'\nimport { prepareRequestHeaders } from '../utils/headers'\nimport { http } from '../utils/http'\nimport { makeTagUid } from '../utils/type'\nimport { BatchId, EthAddress, Identifier, Reference, Signature } from '../utils/typed-bytes'\n\nconst socEndpoint = 'soc'\n\n/**\n * Upload single owner chunk (SOC) to a Bee node\n *\n * @param requestOptions Options for making requests\n * @param owner Owner's ethereum address in hex\n * @param identifier Arbitrary identifier in hex\n * @param signature Signature in hex\n * @param data Content addressed chunk data to be uploaded\n * @param postageBatchId Postage BatchId that will be assigned to uploaded data\n * @param options Additional options like tag, encryption, pinning\n */\nexport async function upload(\n requestOptions: BeeRequestOptions,\n owner: EthAddress,\n identifier: Identifier,\n signature: Signature,\n data: Uint8Array,\n stamp: BatchId | Uint8Array | string,\n options?: UploadOptions,\n): Promise<UploadResult> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: `${socEndpoint}/${owner}/${identifier}`,\n data,\n headers: {\n 'content-type': 'application/octet-stream',\n ...prepareRequestHeaders(stamp, options),\n },\n responseType: 'json',\n params: { sig: signature.toHex() },\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n reference: new Reference(Types.asHexString(body.reference)),\n tagUid: response.headers['swarm-tag'] ? makeTagUid(response.headers['swarm-tag']) : undefined,\n historyAddress: response.headers['swarm-act-history-address']\n ? Optional.of(new Reference(response.headers['swarm-act-history-address']))\n : Optional.empty(),\n }\n}\n","import { Optional, Types } from 'cafe-utility'\nimport type { BeeRequestOptions, DownloadOptions, RedundantUploadOptions, ReferenceInformation } from '../types'\nimport { UploadResult } from '../types'\nimport { Bytes } from '../utils/bytes'\nimport { prepareRequestHeaders } from '../utils/headers'\nimport { http } from '../utils/http'\nimport { ResourceLocator } from '../utils/resource-locator'\nimport { makeTagUid, prepareDownloadOptions } from '../utils/type'\nimport { BatchId, Reference } from '../utils/typed-bytes'\n\nconst endpoint = 'bytes'\n\n/**\n * Upload data to a Bee node\n *\n * @param requestOptions Options for making requests\n * @param data Data to be uploaded\n * @param postageBatchId Postage BatchId that will be assigned to uploaded data\n * @param options Additional options like tag, encryption, pinning\n */\nexport async function upload(\n requestOptions: BeeRequestOptions,\n data: string | Uint8Array,\n postageBatchId: BatchId,\n options?: RedundantUploadOptions,\n): Promise<UploadResult> {\n const response = await http<unknown>(requestOptions, {\n url: endpoint,\n method: 'post',\n responseType: 'json',\n data,\n headers: {\n 'content-type': 'application/octet-stream',\n ...prepareRequestHeaders(postageBatchId, options),\n },\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n reference: new Reference(Types.asHexString(body.reference)),\n tagUid: response.headers['swarm-tag'] ? makeTagUid(response.headers['swarm-tag']) : undefined,\n historyAddress: response.headers['swarm-act-history-address']\n ? Optional.of(new Reference(response.headers['swarm-act-history-address']))\n : Optional.empty(),\n }\n}\n\n/**\n * Requests content length for a reference\n *\n * @param requestOptions Options for making requests\n * @param hash Bee content reference\n */\nexport async function head(\n requestOptions: BeeRequestOptions,\n reference: Reference | Uint8Array | string,\n): Promise<ReferenceInformation> {\n reference = new Reference(reference)\n\n const response = await http<void>(requestOptions, {\n url: `${endpoint}/${reference}`,\n method: 'head',\n responseType: 'json',\n })\n\n return {\n contentLength: parseInt(response.headers['content-length'] as string),\n }\n}\n\n/**\n * Download data as a byte array\n *\n * @param requestOptions Options for making requests\n * @param hash Bee content reference\n */\nexport async function download(\n requestOptions: BeeRequestOptions,\n resource: ResourceLocator,\n options?: DownloadOptions,\n): Promise<Bytes> {\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n const response = await http<unknown>(requestOptions, {\n responseType: 'arraybuffer',\n url: `${endpoint}/${resource}`,\n headers: prepareRequestHeaders(null, options),\n })\n\n return new Bytes(response.data as ArrayBuffer)\n}\n\n/**\n * Download data as a readable stream\n *\n * @param requestOptions Options for making requests\n * @param hash Bee content reference\n */\nexport async function downloadReadable(\n requestOptions: BeeRequestOptions,\n resource: ResourceLocator,\n options?: DownloadOptions,\n): Promise<ReadableStream<Uint8Array>> {\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n const response = await http<ReadableStream<Uint8Array>>(requestOptions, {\n responseType: 'stream',\n url: `${endpoint}/${resource}`,\n headers: prepareRequestHeaders(null, options),\n })\n\n return response.data\n}\n","import { Types } from 'cafe-utility'\nimport { BeeRequestOptions, UploadOptions } from '../types'\nimport { Bytes } from '../utils/bytes'\nimport { BeeError } from '../utils/error'\nimport { prepareRequestHeaders } from '../utils/headers'\nimport { http } from '../utils/http'\nimport { BatchId, EthAddress, FeedIndex, Reference, Topic } from '../utils/typed-bytes'\n\nconst feedEndpoint = 'feeds'\n\nexport interface FeedUpdateOptions {\n /**\n * Specifies the start date as unix time stamp\n */\n at?: number\n\n /**\n * Fetch specific previous Feed's update (default fetches latest update)\n */\n index?: FeedIndex | number\n\n /**\n * Whether the first 8 bytes of the payload are a timestamp\n */\n hasTimestamp?: boolean\n}\n\ninterface FeedUpdateHeaders {\n /**\n * The current feed's index\n */\n feedIndex: FeedIndex\n\n /**\n * The feed's index for next update.\n * Only set for the latest update. If update is fetched using previous index, then this is an empty string.\n */\n feedIndexNext?: FeedIndex\n}\n\nexport interface FeedPayloadResult extends FeedUpdateHeaders {\n payload: Bytes\n}\n\nexport interface FeedReferenceResult extends FeedUpdateHeaders {\n reference: Reference\n}\n\n/**\n * Create an initial feed root manifest\n *\n * @param requestOptions Options for making requests\n * @param owner Owner's ethereum address in hex\n * @param topic Topic in hex\n * @param postageBatchId Postage BatchId to be used to create the Feed Manifest\n * @param options Additional options, like type (default: 'sequence')\n */\nexport async function createFeedManifest(\n requestOptions: BeeRequestOptions,\n owner: EthAddress,\n topic: Topic,\n stamp: BatchId | Uint8Array | string,\n options?: UploadOptions,\n): Promise<Reference> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n responseType: 'json',\n url: `${feedEndpoint}/${owner}/${topic}`,\n headers: prepareRequestHeaders(stamp, options),\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new Reference(Types.asHexString(body.reference))\n}\n\nfunction readFeedUpdateHeaders(headers: Record<string, string>): FeedUpdateHeaders {\n const feedIndex = headers['swarm-feed-index']\n const feedIndexNext = headers['swarm-feed-index-next']\n\n if (!feedIndex) {\n throw new BeeError('Response did not contain expected swarm-feed-index!')\n }\n\n if (!feedIndexNext) {\n throw new BeeError('Response did not contain expected swarm-feed-index-next!')\n }\n\n return {\n feedIndex: new FeedIndex(feedIndex),\n feedIndexNext: new FeedIndex(feedIndexNext),\n }\n}\n\n/**\n * Find and retrieve feed update\n *\n * The feed consists of updates. This endpoint looks up an\n * update that matches the provided parameters and returns\n * the reference it contains along with its index and the\n * index of the subsequent update.\n *\n * @param requestOptions Options for making requests\n * @param owner Owner's ethereum address\n * @param topic Topic\n * @param options Additional options, like index, at, type\n */\nexport async function fetchLatestFeedUpdate(\n requestOptions: BeeRequestOptions,\n owner: EthAddress,\n topic: Topic,\n options?: FeedUpdateOptions,\n): Promise<FeedPayloadResult> {\n const response = await http<ArrayBuffer>(requestOptions, {\n responseType: 'arraybuffer',\n url: `${feedEndpoint}/${owner}/${topic}`,\n params: options,\n })\n\n return {\n payload: new Bytes(response.data),\n ...readFeedUpdateHeaders(response.headers as Record<string, string>),\n }\n}\n\nexport async function probeFeed(\n requestOptions: BeeRequestOptions,\n owner: EthAddress,\n topic: Topic,\n): Promise<FeedUpdateHeaders> {\n const response = await http<ArrayBuffer>(requestOptions, {\n responseType: 'arraybuffer',\n url: `${feedEndpoint}/${owner}/${topic}`,\n params: {\n 'Swarm-Only-Root-Chunk': true,\n },\n })\n\n return readFeedUpdateHeaders(response.headers as Record<string, string>)\n}\n","import { Types } from 'cafe-utility'\nimport { Reference } from './typed-bytes'\n\nexport class ResourceLocator {\n constructor(private raw: Reference | Uint8Array | string) {}\n\n toString() {\n if (Types.isString(this.raw) && this.raw.includes('.eth')) {\n return this.raw\n }\n\n return new Reference(this.raw).toHex()\n }\n}\n","import { Binary } from 'cafe-utility'\nimport { FeedIndex, Identifier, Topic } from '../utils/typed-bytes'\n\nexport function makeFeedIdentifier(topic: Topic, index: FeedIndex | number): Identifier {\n index = typeof index === 'number' ? FeedIndex.fromBigInt(BigInt(index)) : index\n\n return new Identifier(Binary.keccak256(Binary.concatBytes(topic.toUint8Array(), index.toUint8Array())))\n}\n","import { Binary, Optional, Types } from 'cafe-utility'\nimport { asContentAddressedChunk, Chunk } from '../chunk/cac'\nimport {\n makeSingleOwnerChunkFromData,\n uploadSingleOwnerChunkData,\n uploadSingleOwnerChunkWithWrappedChunk,\n} from '../chunk/soc'\nimport * as bytes from '../modules/bytes'\nimport * as chunkAPI from '../modules/chunk'\nimport {\n FeedPayloadResult,\n FeedReferenceResult,\n FeedUpdateOptions,\n fetchLatestFeedUpdate,\n probeFeed,\n} from '../modules/feed'\nimport { BeeRequestOptions, FeedReader, FeedWriter, UploadOptions, UploadResult } from '../types'\nimport { Bytes } from '../utils/bytes'\nimport { BeeResponseError } from '../utils/error'\nimport { ResourceLocator } from '../utils/resource-locator'\nimport {\n BatchId,\n EthAddress,\n FeedIndex,\n Identifier,\n PrivateKey,\n Reference,\n Signature,\n Topic,\n} from '../utils/typed-bytes'\nimport { makeFeedIdentifier } from './identifier'\n\nconst TIMESTAMP_PAYLOAD_OFFSET = 0\nconst TIMESTAMP_PAYLOAD_SIZE = 8\nconst REFERENCE_PAYLOAD_OFFSET = TIMESTAMP_PAYLOAD_SIZE\n\nexport interface Epoch {\n time: number\n level: number\n}\n\nexport interface FeedUploadOptions extends UploadOptions, FeedUpdateOptions {}\n\nexport interface FeedUpdate {\n timestamp: Optional<number>\n payload: Bytes\n}\n\nexport async function findNextIndex(\n requestOptions: BeeRequestOptions,\n owner: EthAddress,\n topic: Topic,\n): Promise<FeedIndex> {\n try {\n const feedUpdate = await fetchLatestFeedUpdate(requestOptions, owner, topic)\n\n if (!feedUpdate.feedIndexNext) {\n throw Error('Feed index next is not defined. This should happen when fetching an exact index.')\n }\n\n return feedUpdate.feedIndexNext\n } catch (e) {\n if (e instanceof BeeResponseError) {\n return FeedIndex.fromBigInt(0n)\n }\n throw e\n }\n}\n\nexport async function updateFeedWithReference(\n requestOptions: BeeRequestOptions,\n signer: PrivateKey,\n topic: Topic,\n reference: Reference | string | Uint8Array,\n postageBatchId: BatchId,\n options?: FeedUploadOptions,\n): Promise<UploadResult> {\n reference = new Reference(reference)\n const nextIndex = options?.index ?? (await findNextIndex(requestOptions, signer.publicKey().address(), topic))\n\n const identifier = makeFeedIdentifier(topic, nextIndex)\n const at = options?.at ?? Date.now() / 1000.0\n const timestamp = Binary.numberToUint64(BigInt(Math.floor(at)), 'BE')\n const payloadBytes = Binary.concatBytes(timestamp, reference.toUint8Array())\n\n return uploadSingleOwnerChunkData(requestOptions, signer, postageBatchId, identifier, payloadBytes, options)\n}\n\nexport async function updateFeedWithPayload(\n requestOptions: BeeRequestOptions,\n signer: PrivateKey,\n topic: Topic,\n data: Uint8Array | string,\n postageBatchId: BatchId,\n options?: FeedUploadOptions,\n): Promise<UploadResult> {\n const nextIndex = options?.index ?? (await findNextIndex(requestOptions, signer.publicKey().address(), topic))\n\n const identifier = makeFeedIdentifier(topic, nextIndex)\n\n if (data.length > 4096) {\n const uploadResult = await bytes.upload(requestOptions, data, postageBatchId, options)\n const rootChunk = await chunkAPI.download(requestOptions, uploadResult.reference)\n\n return uploadSingleOwnerChunkWithWrappedChunk(\n requestOptions,\n signer,\n postageBatchId,\n identifier,\n rootChunk,\n options,\n )\n }\n\n return uploadSingleOwnerChunkData(\n requestOptions,\n signer,\n postageBatchId,\n identifier,\n Types.isString(data) ? Bytes.fromUtf8(data).toUint8Array() : data,\n options,\n )\n}\n\nexport function getFeedUpdateChunkReference(owner: EthAddress, topic: Topic, index: FeedIndex): Reference {\n const identifier = makeFeedIdentifier(topic, index)\n\n return new Reference(Binary.keccak256(Binary.concatBytes(identifier.toUint8Array(), owner.toUint8Array())))\n}\n\nexport async function downloadFeedUpdate(\n requestOptions: BeeRequestOptions,\n owner: EthAddress,\n topic: Topic,\n index: FeedIndex | number,\n hasTimestamp = false,\n): Promise<FeedUpdate> {\n index = typeof index === 'number' ? FeedIndex.fromBigInt(BigInt(index)) : index\n const address = getFeedUpdateChunkReference(owner, topic, index)\n const data = await chunkAPI.download(requestOptions, address.toHex())\n const soc = makeSingleOwnerChunkFromData(data, address)\n let timestamp: Optional<number> = Optional.empty()\n\n if (hasTimestamp) {\n const timestampBytes = Bytes.fromSlice(soc.payload.toUint8Array(), TIMESTAMP_PAYLOAD_OFFSET, TIMESTAMP_PAYLOAD_SIZE)\n timestamp = Optional.of(Number(Binary.uint64ToNumber(timestampBytes.toUint8Array(), 'BE')))\n }\n\n return {\n timestamp,\n payload: new Bytes(soc.payload.offset(hasTimestamp ? REFERENCE_PAYLOAD_OFFSET : 0)),\n }\n}\n\nexport async function downloadFeedUpdateAsCAC(\n requestOptions: BeeRequestOptions,\n owner: EthAddress,\n topic: Topic,\n index: FeedIndex | number,\n): Promise<Chunk> {\n index = typeof index === 'number' ? FeedIndex.fromBigInt(BigInt(index)) : index\n const address = getFeedUpdateChunkReference(owner, topic, index)\n const data = await chunkAPI.download(requestOptions, address)\n\n return asContentAddressedChunk(data.slice(Identifier.LENGTH + Signature.LENGTH))\n}\n\nexport function makeFeedReader(requestOptions: BeeRequestOptions, topic: Topic, owner: EthAddress): FeedReader {\n // TODO: remove after enough time has passed in deprecated version\n const download = async (options?: FeedUpdateOptions): Promise<FeedPayloadResult> => {\n if (options?.index === undefined) {\n return fetchLatestFeedUpdate(requestOptions, owner, topic)\n }\n\n const update = await downloadFeedUpdate(requestOptions, owner, topic, options.index, options.hasTimestamp ?? true)\n\n const feedIndex = typeof options.index === 'number' ? FeedIndex.fromBigInt(BigInt(options.index)) : options.index\n\n return {\n payload: update.payload,\n feedIndex,\n feedIndexNext: feedIndex.next(),\n }\n }\n\n const downloadPayload = async (options?: FeedUpdateOptions): Promise<FeedPayloadResult> => {\n if (options?.index === undefined) {\n return fetchLatestFeedUpdate(requestOptions, owner, topic)\n }\n\n const cac = await downloadFeedUpdateAsCAC(requestOptions, owner, topic, options.index)\n\n const payload =\n cac.span.toBigInt() <= 4096n\n ? cac.payload\n : await bytes.download(requestOptions, new ResourceLocator(cac.address))\n\n const feedIndex = typeof options.index === 'number' ? FeedIndex.fromBigInt(BigInt(options.index)) : options.index\n\n return {\n payload,\n feedIndex,\n feedIndexNext: feedIndex.next(),\n }\n }\n\n const downloadReference = async (options?: FeedUpdateOptions): Promise<FeedReferenceResult> => {\n let index = options?.index\n\n if (index === undefined) {\n index = (await probeFeed(requestOptions, owner, topic)).feedIndex\n }\n\n const payload = await download({ ...options, index: index })\n\n return {\n reference: new Reference(payload.payload.toUint8Array()),\n feedIndex: payload.feedIndex,\n feedIndexNext: payload.feedIndexNext ?? payload.feedIndex.next(),\n }\n }\n\n return {\n download,\n downloadPayload,\n downloadReference,\n owner,\n topic,\n }\n}\n\nexport function makeFeedWriter(requestOptions: BeeRequestOptions, topic: Topic, signer: PrivateKey): FeedWriter {\n const upload = async (\n postageBatchId: BatchId,\n reference: Reference | string | Uint8Array,\n options?: FeedUploadOptions,\n ) => {\n return updateFeedWithReference(requestOptions, signer, topic, reference, postageBatchId, options)\n }\n\n const uploadPayload = async (postageBatchId: BatchId, data: Uint8Array | string, options?: FeedUploadOptions) => {\n return updateFeedWithPayload(requestOptions, signer, topic, data, postageBatchId, options)\n }\n\n return {\n ...makeFeedReader(requestOptions, topic, signer.publicKey().address()),\n upload,\n uploadReference: upload,\n uploadPayload,\n }\n}\n","import { Objects } from 'cafe-utility'\nimport { Bee } from '../bee'\nimport { BeeRequestOptions, DownloadOptions } from '../types'\nimport { EthAddress, FeedIndex, Reference, Topic } from '../utils/typed-bytes'\nimport { getFeedUpdateChunkReference } from './index'\n\n/**\n * Function that checks if a chunk is retrievable by actually downloading it.\n * The /stewardship/{reference} endpoint does not support verification of chunks, but only manifest's references.\n *\n * @param bee\n * @param ref\n * @param options\n */\nasync function isChunkRetrievable(\n bee: Bee,\n reference: Reference,\n options: DownloadOptions | undefined,\n requestOptions: BeeRequestOptions,\n): Promise<boolean> {\n try {\n await bee.downloadChunk(reference, options, requestOptions)\n\n return true\n } catch (e: unknown) {\n const status = Objects.getDeep(e, 'status')\n\n if (status === 404 || status === 500) {\n return false\n }\n\n throw e\n }\n}\n\n/**\n * Creates array of references for all sequence updates chunk up to the given index.\n *\n * @param owner\n * @param topic\n * @param index\n */\nfunction getAllSequenceUpdateReferences(owner: EthAddress, topic: Topic, index: FeedIndex): Reference[] {\n const count = index.toBigInt()\n const updateReferences: Reference[] = []\n\n for (let i = 0n; i <= count; i++) {\n updateReferences.push(getFeedUpdateChunkReference(owner, topic, FeedIndex.fromBigInt(i)))\n }\n\n return updateReferences\n}\n\nexport async function areAllSequentialFeedsUpdateRetrievable(\n bee: Bee,\n owner: EthAddress,\n topic: Topic,\n index: FeedIndex,\n options: DownloadOptions | undefined,\n requestOptions: BeeRequestOptions,\n): Promise<boolean> {\n const chunkRetrievablePromises = getAllSequenceUpdateReferences(owner, topic, index).map(async reference =>\n isChunkRetrievable(bee, reference, options, requestOptions),\n )\n\n return (await Promise.all(chunkRetrievablePromises)).every(result => result)\n}\n","import { Collection } from '../types'\nimport { BeeArgumentError } from './error'\n\nexport function isCollection(data: unknown): data is Collection {\n if (!Array.isArray(data)) {\n return false\n }\n\n return data.every(entry => typeof entry === 'object' && entry.path && entry.size !== undefined)\n}\n\nexport function assertCollection(data: unknown): asserts data is Collection {\n if (!isCollection(data)) {\n throw new BeeArgumentError('invalid collection', data)\n }\n}\n\nexport function makeFilePath(file: File) {\n if (file.webkitRelativePath && file.webkitRelativePath !== '') {\n return file.webkitRelativePath.replace(/.*?\\//i, '')\n }\n\n if (file.name) {\n return file.name\n }\n\n throw new TypeError('file is not valid File object')\n}\n\nexport function makeCollectionFromFileList(fileList: FileList | File[]): Collection {\n return Array.from(fileList).map(file => ({\n path: makeFilePath(file),\n size: file.size,\n file,\n }))\n}\n\n/**\n * Calculate cumulative size of files\n *\n * @param fileList list of files to check\n * @returns size in bytes\n */\nexport function getCollectionSize(fileList: FileList | File[]): number {\n return Array.from(fileList).reduce((sum, file) => sum + file.size, 0)\n}\n","import { PassThrough } from 'stream'\n\nexport class TarStream {\n output = new PassThrough()\n currentFileSize = 0\n\n beginFile(path: string, size: number) {\n if (path.length > 100) {\n throw new Error(`File name too long: ${path}`)\n }\n const header = createHeader(path, size)\n this.output.write(header)\n this.currentFileSize = 0\n }\n\n async appendFile(data: Uint8Array) {\n return new Promise<void>(resolve => {\n if (!this.output.write(data)) {\n this.output.once('drain', () => {\n resolve()\n })\n } else {\n resolve()\n }\n this.currentFileSize += data.length\n })\n }\n\n async endFile() {\n const padding = this.currentFileSize % 512 === 0 ? 0 : 512 - (this.currentFileSize % 512)\n\n if (padding > 0) {\n this.output.write(Buffer.alloc(padding, 0))\n }\n }\n\n async end() {\n return new Promise<void>(resolve => {\n this.output.write(createEndOfArchive())\n this.output.end(() => {\n resolve()\n })\n })\n }\n}\n\nfunction createHeader(path: string, size: number): Uint8Array {\n // Initialize header with zeros\n const header = Buffer.alloc(512, 0)\n\n // File name, truncated to 100 characters if necessary\n header.write(path.slice(0, 100).padEnd(100, '\\0'), 0, 100)\n\n // File mode (octal) and null-terminated\n header.write('0000777\\0', 100, 8)\n\n // UID and GID (octal) and null-terminated\n header.write('0001750\\0', 108, 8) // UID\n header.write('0001750\\0', 116, 8) // GID\n\n // File size in octal (11 chars) and null-terminated\n header.write(size.toString(8).padStart(11, '0') + '\\0', 124, 12)\n\n // Modification time in octal and null-terminated\n const modTime = Math.floor(new Date().getTime() / 1000)\n header.write(modTime.toString(8).padStart(11, '0') + '\\0', 136, 12)\n\n // Checksum placeholder (8 spaces)\n header.write(' ', 148, 8)\n\n // Typeflag (normal file)\n header.write('0', 156, 1)\n\n // USTAR magic and version\n header.write('ustar\\0\\0', 257, 8)\n\n // Calculate checksum\n let checksum = 0\n for (let i = 0; i < 512; i++) {\n checksum += header[i]\n }\n\n header.write(checksum.toString(8).padStart(6, '0') + '\\0 ', 148, 8)\n\n return header\n}\n\nfunction createEndOfArchive(): Uint8Array {\n return Buffer.alloc(1024, 0)\n}\n","import { BeeRequestOptions, Collection, CollectionUploadOptions } from '..'\nimport { prepareRequestHeaders } from './headers'\nimport { http } from './http'\nimport { TarStream } from './tar'\nimport { writeTar } from './tar-writer'\nimport { BatchId } from './typed-bytes'\n\nconst bzzEndpoint = 'bzz'\n\nexport async function uploadTar(\n requestOptions: BeeRequestOptions,\n collection: Collection,\n postageBatchId: BatchId,\n options?: CollectionUploadOptions,\n) {\n const tarStream = new TarStream()\n const responsePromise = http<unknown>(requestOptions, {\n method: 'post',\n url: bzzEndpoint,\n data: tarStream.output,\n responseType: 'json',\n headers: {\n 'content-type': 'application/x-tar',\n 'swarm-collection': 'true',\n ...prepareRequestHeaders(postageBatchId, options),\n },\n })\n\n await writeTar(collection, tarStream)\n await tarStream.end()\n const response = await responsePromise\n\n return response\n}\n","import { createReadStream } from 'fs'\nimport { Collection } from '..'\nimport { TarStream } from './tar'\n\nexport async function writeTar(collection: Collection, tarStream: TarStream) {\n for (const item of collection) {\n tarStream.beginFile(item.path, item.size)\n\n if (item.fsPath) {\n const stream = createReadStream(item.fsPath)\n\n for await (const chunk of stream) {\n await tarStream.appendFile(chunk)\n }\n await tarStream.endFile()\n stream.close()\n } else if (item.file) {\n await tarStream.appendFile(new Uint8Array(await item.file.arrayBuffer()))\n await tarStream.endFile()\n } else {\n throw new Error('Invalid collection item')\n }\n }\n}\n","import { Optional, Types } from 'cafe-utility'\nimport { Readable } from 'stream'\nimport {\n BeeRequestOptions,\n Collection,\n CollectionUploadOptions,\n DownloadOptions,\n FileData,\n FileUploadOptions,\n UploadResult,\n} from '../types'\nimport { Bytes } from '../utils/bytes'\nimport { assertCollection } from '../utils/collection'\nimport { prepareRequestHeaders, readFileHeaders } from '../utils/headers'\nimport { http } from '../utils/http'\nimport { ResourceLocator } from '../utils/resource-locator'\nimport { uploadTar } from '../utils/tar-uploader'\nimport { isReadable, makeTagUid } from '../utils/type'\nimport { BatchId, Reference } from '../utils/typed-bytes'\n\nconst bzzEndpoint = 'bzz'\n\n/**\n * Upload single file\n *\n * @param requestOptions Options for making requests\n * @param data Files data\n * @param postageBatchId Postage BatchId that will be assigned to uploaded data\n * @param name Name that will be attached to the uploaded file. Wraps the data into manifest with set index document.\n * @param options\n */\nexport async function uploadFile(\n requestOptions: BeeRequestOptions,\n data: string | Uint8Array | Readable | ArrayBuffer,\n postageBatchId: BatchId,\n name?: string,\n options?: FileUploadOptions,\n): Promise<UploadResult> {\n if (isReadable(data) && !options?.contentType) {\n if (!options) {\n options = {}\n }\n options.contentType = 'application/octet-stream'\n }\n\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: bzzEndpoint,\n data,\n headers: prepareRequestHeaders(postageBatchId, options),\n params: { name },\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n reference: new Reference(Types.asHexString(body.reference)),\n tagUid: response.headers['swarm-tag'] ? makeTagUid(response.headers['swarm-tag']) : undefined,\n historyAddress: response.headers['swarm-act-history-address']\n ? Optional.of(new Reference(response.headers['swarm-act-history-address']))\n : Optional.empty(),\n }\n}\n\n/**\n * Download single file as a buffer\n *\n * @param requestOptions Options for making requests\n * @param hash Bee file or collection hash\n * @param path If hash is collection then this defines path to a single file in the collection\n */\nexport async function downloadFile(\n requestOptions: BeeRequestOptions,\n resource: ResourceLocator,\n path = '',\n options?: DownloadOptions,\n): Promise<FileData<Bytes>> {\n const response = await http<ArrayBuffer>(requestOptions, {\n method: 'GET',\n responseType: 'arraybuffer',\n url: `${bzzEndpoint}/${resource}/${path}`,\n headers: prepareRequestHeaders(null, options),\n })\n const file = {\n ...readFileHeaders(response.headers as Record<string, string>),\n data: new Bytes(response.data),\n }\n\n return file\n}\n\n/**\n * Download single file as a readable stream\n *\n * @param requestOptions Options for making requests\n * @param hash Bee file or collection hash\n * @param path If hash is collection then this defines path to a single file in the collection\n */\nexport async function downloadFileReadable(\n requestOptions: BeeRequestOptions,\n reference: Reference,\n path = '',\n options?: DownloadOptions,\n): Promise<FileData<ReadableStream<Uint8Array>>> {\n reference = new Reference(reference)\n\n const response = await http<ReadableStream<Uint8Array>>(requestOptions, {\n method: 'GET',\n responseType: 'stream',\n url: `${bzzEndpoint}/${reference}/${path}`,\n headers: prepareRequestHeaders(null, options),\n })\n const file = {\n ...readFileHeaders(response.headers as Record<string, string>),\n data: response.data,\n }\n\n return file\n}\n\n/*******************************************************************************************************************/\n\n// Collections\n\n/**\n * Upload collection\n * @param requestOptions Options for making requests\n * @param collection Collection of Uint8Array buffers to upload\n * @param postageBatchId Postage BatchId that will be assigned to uploaded data\n * @param options\n */\nexport async function uploadCollection(\n requestOptions: BeeRequestOptions,\n collection: Collection,\n postageBatchId: BatchId,\n options?: CollectionUploadOptions,\n): Promise<UploadResult> {\n assertCollection(collection)\n const response = await uploadTar(requestOptions, collection, postageBatchId, options)\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n reference: new Reference(Types.asHexString(body.reference)),\n tagUid: response.headers['swarm-tag'] ? makeTagUid(response.headers['swarm-tag']) : undefined,\n historyAddress: response.headers['swarm-act-history-address']\n ? Optional.of(new Reference(response.headers['swarm-act-history-address']))\n : Optional.empty(),\n }\n}\n","import { Types } from 'cafe-utility'\nimport type { BalanceResponse, BeeRequestOptions, PeerBalance } from '../../types'\nimport { http } from '../../utils/http'\nimport { BZZ } from '../../utils/tokens'\nimport { asNumberString } from '../../utils/type'\nimport { PeerAddress } from '../../utils/typed-bytes'\n\nconst balancesEndpoint = 'balances'\nconst consumedEndpoint = 'consumed'\n\n/**\n * Get the balances with all known peers including prepaid services\n *\n * @param requestOptions Options for making requests\n */\nexport async function getAllBalances(requestOptions: BeeRequestOptions): Promise<BalanceResponse> {\n const response = await http<unknown>(requestOptions, {\n url: balancesEndpoint,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const balances = Types.asArray(body.balances, { name: 'balances' }).map(x => Types.asObject(x, { name: 'balance' }))\n\n return {\n balances: balances.map(x => ({\n peer: Types.asString(x.peer, { name: 'peer' }),\n balance: BZZ.fromPLUR(asNumberString(x.balance, { name: 'balance' })),\n })),\n }\n}\n\n/**\n * Get the balances with a specific peer including prepaid services\n *\n * @param requestOptions Options for making requests\n * @param address Swarm address of peer\n */\nexport async function getPeerBalance(requestOptions: BeeRequestOptions, address: PeerAddress): Promise<PeerBalance> {\n const response = await http<unknown>(requestOptions, {\n url: `${balancesEndpoint}/${address}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n peer: Types.asString(body.peer, { name: 'peer' }),\n balance: BZZ.fromPLUR(asNumberString(body.balance, { name: 'balance' })),\n }\n}\n\n/**\n * Get the past due consumption balances with all known peers\n *\n * @param requestOptions Options for making requests\n */\nexport async function getPastDueConsumptionBalances(requestOptions: BeeRequestOptions): Promise<BalanceResponse> {\n const response = await http<unknown>(requestOptions, {\n url: consumedEndpoint,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const balances = Types.asArray(body.balances, { name: 'balances' }).map(x => Types.asObject(x, { name: 'balance' }))\n\n return {\n balances: balances.map(x => ({\n peer: Types.asString(x.peer, { name: 'peer' }),\n balance: BZZ.fromPLUR(asNumberString(x.balance, { name: 'balance' })),\n })),\n }\n}\n\n/**\n * Get the past due consumption balance with a specific peer\n *\n * @param requestOptions Options for making requests\n * @param address Swarm address of peer\n */\nexport async function getPastDueConsumptionPeerBalance(\n requestOptions: BeeRequestOptions,\n address: PeerAddress,\n): Promise<PeerBalance> {\n const response = await http<unknown>(requestOptions, {\n url: `${consumedEndpoint}/${address}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n peer: Types.asString(body.peer, { name: 'peer' }),\n balance: BZZ.fromPLUR(asNumberString(body.balance, { name: 'balance' })),\n }\n}\n","import { Types } from 'cafe-utility'\nimport type {\n BeeRequestOptions,\n CashoutResult,\n Cheque,\n ChequebookAddressResponse,\n ChequebookBalanceResponse,\n LastCashoutActionResponse,\n LastChequesForPeerResponse,\n LastChequesResponse,\n NumberString,\n TransactionOptions,\n} from '../../types'\nimport { prepareRequestHeaders } from '../../utils/headers'\nimport { http } from '../../utils/http'\nimport { BZZ } from '../../utils/tokens'\nimport { asNumberString } from '../../utils/type'\nimport { EthAddress, PeerAddress, TransactionId } from '../../utils/typed-bytes'\n\nconst chequebookEndpoint = 'chequebook'\n\n/**\n * Get the address of the chequebook contract used\n *\n * @param requestOptions Options for making requests\n */\nexport async function getChequebookAddress(requestOptions: BeeRequestOptions): Promise<ChequebookAddressResponse> {\n const response = await http<unknown>(requestOptions, {\n url: chequebookEndpoint + '/address',\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n chequebookAddress: new EthAddress(Types.asString(body.chequebookAddress, { name: 'chequebookAddress' })),\n }\n}\n\n/**\n * Get the balance of the chequebook\n *\n * @param requestOptions Options for making requests\n */\nexport async function getChequebookBalance(requestOptions: BeeRequestOptions): Promise<ChequebookBalanceResponse> {\n const response = await http<unknown>(requestOptions, {\n url: chequebookEndpoint + '/balance',\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n availableBalance: BZZ.fromPLUR(asNumberString(body.availableBalance, { name: 'availableBalance' })),\n totalBalance: BZZ.fromPLUR(asNumberString(body.totalBalance, { name: 'totalBalance' })),\n }\n}\n\n/**\n * Get last cashout action for the peer\n *\n * @param requestOptions Options for making requests\n * @param peer Swarm address of peer\n */\nexport async function getLastCashoutAction(\n requestOptions: BeeRequestOptions,\n peer: PeerAddress,\n): Promise<LastCashoutActionResponse> {\n const response = await http<unknown>(requestOptions, {\n url: chequebookEndpoint + `/cashout/${peer}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n peer: Types.asString(body.peer, { name: 'peer' }),\n uncashedAmount: BZZ.fromPLUR(asNumberString(body.uncashedAmount, { name: 'uncashedAmount' })),\n transactionHash: Types.asNullableString(body.transactionHash),\n lastCashedCheque: Types.asNullable(x => asCheque(x), body.lastCashedCheque),\n result: Types.asNullable(x => asCashoutResult(x), body.result),\n }\n}\n\n/**\n * Cashout the last cheque for the peer\n *\n * @param requestOptions Options for making requests\n * @param peer Swarm address of peer\n * @param options\n */\nexport async function cashoutLastCheque(\n requestOptions: BeeRequestOptions,\n peer: PeerAddress,\n options?: TransactionOptions,\n): Promise<TransactionId> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: chequebookEndpoint + `/cashout/${peer}`,\n responseType: 'json',\n headers: prepareRequestHeaders(null, options),\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asString(body.transactionHash, { name: 'transactionHash' }))\n}\n\n/**\n * Get last cheques for the peer\n *\n * @param requestOptions Options for making requests\n * @param peer Swarm address of peer\n */\nexport async function getLastChequesForPeer(\n requestOptions: BeeRequestOptions,\n peer: PeerAddress,\n): Promise<LastChequesForPeerResponse> {\n const response = await http<unknown>(requestOptions, {\n url: chequebookEndpoint + `/cheque/${peer}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n peer: Types.asString(body.peer, { name: 'peer' }),\n lastreceived: Types.asNullable(x => asCheque(x), body.lastreceived),\n lastsent: Types.asNullable(x => asCheque(x), body.lastsent),\n }\n}\n\n/**\n * Get last cheques for all peers\n *\n * @param requestOptions Options for making requests\n */\nexport async function getLastCheques(requestOptions: BeeRequestOptions): Promise<LastChequesResponse> {\n const response = await http<unknown>(requestOptions, {\n url: chequebookEndpoint + '/cheque',\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const lastcheques = Types.asArray(body.lastcheques, { name: 'lastcheques' }).map(x =>\n Types.asObject(x, { name: 'lastcheque' }),\n )\n\n return {\n lastcheques: lastcheques.map(x => ({\n peer: Types.asString(x.peer, { name: 'peer' }),\n lastreceived: Types.asNullable(y => asCheque(y), x.lastreceived),\n lastsent: Types.asNullable(y => asCheque(y), x.lastsent),\n })),\n }\n}\n\nfunction asCheque(x: unknown): Cheque {\n const object = Types.asObject(x, { name: 'cheque' })\n\n return {\n beneficiary: new EthAddress(Types.asString(object.beneficiary, { name: 'beneficiary' })),\n chequebook: new EthAddress(Types.asString(object.chequebook, { name: 'chequebook' })),\n payout: BZZ.fromPLUR(asNumberString(object.payout, { name: 'payout' })),\n }\n}\n\nfunction asCashoutResult(x: unknown): CashoutResult {\n const object = Types.asObject(x, { name: 'cashout result' })\n\n return {\n recipient: Types.asString(object.recipient, { name: 'recipient' }),\n lastPayout: BZZ.fromPLUR(asNumberString(object.lastPayout, { name: 'lastPayout' })),\n bounced: Types.asBoolean(object.bounced, { name: 'bounced' }),\n }\n}\n\n/**\n * Deposit tokens from overlay address into chequebook\n *\n * @param requestOptions Options for making requests\n * @param amount Amount of tokens to deposit\n * @param gasPrice Gas Price in WEI for the transaction call\n * @return string Hash of the transaction\n */\nexport async function depositTokens(\n requestOptions: BeeRequestOptions,\n amount: NumberString | string | bigint,\n gasPrice?: NumberString | string | bigint,\n): Promise<TransactionId> {\n const headers: Record<string, string> = {}\n\n if (gasPrice) {\n headers['gas-price'] = gasPrice.toString()\n }\n\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: chequebookEndpoint + '/deposit',\n responseType: 'json',\n params: { amount: amount.toString(10) },\n headers,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asString(body.transactionHash, { name: 'transactionHash' }))\n}\n\n/**\n * Withdraw tokens from the chequebook to the overlay address\n *\n * @param requestOptions Options for making requests\n * @param amount Amount of tokens to withdraw\n * @param gasPrice Gas Price in WEI for the transaction call\n * @return string Hash of the transaction\n */\nexport async function withdrawTokens(\n requestOptions: BeeRequestOptions,\n amount: NumberString | string | bigint,\n gasPrice?: NumberString | string | bigint,\n): Promise<TransactionId> {\n const headers: Record<string, string> = {}\n\n if (gasPrice) {\n headers['gas-price'] = gasPrice.toString()\n }\n\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: chequebookEndpoint + '/withdraw',\n responseType: 'json',\n params: { amount: amount.toString(10) },\n headers,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asString(body.transactionHash, { name: 'transactionHash' }))\n}\n","import { Types } from 'cafe-utility'\nimport type {\n BeeRequestOptions,\n Bin,\n NodeAddresses,\n Peer,\n PingResponse,\n RemovePeerResponse,\n Topology,\n} from '../../types'\nimport { http } from '../../utils/http'\nimport { EthAddress, PeerAddress, PublicKey } from '../../utils/typed-bytes'\n\nexport async function getNodeAddresses(requestOptions: BeeRequestOptions): Promise<NodeAddresses> {\n const response = await http<unknown>(requestOptions, {\n url: 'addresses',\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n overlay: new PeerAddress(Types.asString(body.overlay, { name: 'overlay' })),\n underlay: Types.asArray(body.underlay, { name: 'underlay' }).map(x => Types.asString(x, { name: 'underlay' })),\n ethereum: new EthAddress(Types.asString(body.ethereum, { name: 'ethereum' })),\n publicKey: new PublicKey(Types.asString(body.publicKey, { name: 'publicKey' })),\n pssPublicKey: new PublicKey(Types.asString(body.pssPublicKey, { name: 'pssPublicKey' })),\n }\n}\n\ninterface Peers {\n peers: Peer[]\n}\n\nexport async function getPeers(requestOptions: BeeRequestOptions): Promise<Peer[]> {\n const response = await http<unknown>(requestOptions, {\n url: 'peers',\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return Types.asArray(body.peers, { name: 'peers' }).map(x => ({\n address: Types.asString(Types.asObject(x, { name: 'peer' }).address, { name: 'address' }),\n fullNode: Types.asBoolean(Types.asObject(x, { name: 'peer' }).fullNode, { name: 'fullNode' }),\n }))\n}\n\nexport async function getBlocklist(requestOptions: BeeRequestOptions): Promise<Peer[]> {\n const response = await http<Peers>(requestOptions, {\n url: 'blocklist',\n responseType: 'json',\n })\n\n return response.data.peers\n}\n\nexport async function removePeer(requestOptions: BeeRequestOptions, peer: PeerAddress): Promise<RemovePeerResponse> {\n const response = await http<RemovePeerResponse>(requestOptions, {\n url: `peers/${peer}`,\n responseType: 'json',\n method: 'DELETE',\n })\n\n return response.data\n}\n\nexport async function getTopology(requestOptions: BeeRequestOptions): Promise<Topology> {\n const response = await http<unknown>(requestOptions, {\n url: `topology`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const bins = Types.asObject(body.bins, { name: 'bins' })\n\n return {\n baseAddr: Types.asString(body.baseAddr, { name: 'baseAddr' }),\n population: Types.asNumber(body.population, { name: 'population' }),\n connected: Types.asNumber(body.connected, { name: 'connected' }),\n timestamp: Types.asString(body.timestamp, { name: 'timestamp' }),\n nnLowWatermark: Types.asNumber(body.nnLowWatermark, { name: 'nnLowWatermark' }),\n depth: Types.asNumber(body.depth, { name: 'depth' }),\n reachability: Types.asString(body.reachability, { name: 'reachability' }),\n networkAvailability: Types.asString(body.networkAvailability, { name: 'networkAvailability' }),\n bins: {\n bin_0: asBin(bins.bin_0, 'bin_0'),\n bin_1: asBin(bins.bin_1, 'bin_1'),\n bin_2: asBin(bins.bin_2, 'bin_2'),\n bin_3: asBin(bins.bin_3, 'bin_3'),\n bin_4: asBin(bins.bin_4, 'bin_4'),\n bin_5: asBin(bins.bin_5, 'bin_5'),\n bin_6: asBin(bins.bin_6, 'bin_6'),\n bin_7: asBin(bins.bin_7, 'bin_7'),\n bin_8: asBin(bins.bin_8, 'bin_8'),\n bin_9: asBin(bins.bin_9, 'bin_9'),\n bin_10: asBin(bins.bin_10, 'bin_10'),\n bin_11: asBin(bins.bin_11, 'bin_11'),\n bin_12: asBin(bins.bin_12, 'bin_12'),\n bin_13: asBin(bins.bin_13, 'bin_13'),\n bin_14: asBin(bins.bin_14, 'bin_14'),\n bin_15: asBin(bins.bin_15, 'bin_15'),\n bin_16: asBin(bins.bin_16, 'bin_16'),\n bin_17: asBin(bins.bin_17, 'bin_17'),\n bin_18: asBin(bins.bin_18, 'bin_18'),\n bin_19: asBin(bins.bin_19, 'bin_19'),\n bin_20: asBin(bins.bin_20, 'bin_20'),\n bin_21: asBin(bins.bin_21, 'bin_21'),\n bin_22: asBin(bins.bin_22, 'bin_22'),\n bin_23: asBin(bins.bin_23, 'bin_23'),\n bin_24: asBin(bins.bin_24, 'bin_24'),\n bin_25: asBin(bins.bin_25, 'bin_25'),\n bin_26: asBin(bins.bin_26, 'bin_26'),\n bin_27: asBin(bins.bin_27, 'bin_27'),\n bin_28: asBin(bins.bin_28, 'bin_28'),\n bin_29: asBin(bins.bin_29, 'bin_29'),\n bin_30: asBin(bins.bin_30, 'bin_30'),\n bin_31: asBin(bins.bin_31, 'bin_31'),\n },\n }\n}\n\nexport async function pingPeer(requestOptions: BeeRequestOptions, peer: PeerAddress): Promise<PingResponse> {\n const response = await http<PingResponse>(requestOptions, {\n url: `pingpong/${peer}`,\n responseType: 'json',\n method: 'POST',\n })\n\n return response.data\n}\n\nexport function asBin(value: unknown, name: string): Bin {\n const bin = Types.asObject(value, { name })\n\n if (!bin.disconnectedPeers) {\n bin.disconnectedPeers = []\n }\n\n if (!bin.connectedPeers) {\n bin.connectedPeers = []\n }\n\n return {\n population: Types.asNumber(bin.population, { name: 'population' }),\n connected: Types.asNumber(bin.connected, { name: 'connected' }),\n connectedPeers: Types.asArray(bin.connectedPeers, { name: 'connectedPeers' }).map(x => ({\n address: Types.asString(Types.asObject(x, { name: 'connectedPeer' }).address, { name: 'address' }),\n })),\n disconnectedPeers: Types.asArray(bin.disconnectedPeers, { name: 'disconnectedPeers' }).map(x => ({\n address: Types.asString(Types.asObject(x, { name: 'disconnectedPeer' }).address, { name: 'address' }),\n })),\n }\n}\n","import { Types } from 'cafe-utility'\nimport type { AllSettlements, BeeRequestOptions, Settlements } from '../../types'\nimport { http } from '../../utils/http'\nimport { BZZ } from '../../utils/tokens'\nimport { asNumberString } from '../../utils/type'\nimport { PeerAddress } from '../../utils/typed-bytes'\n\nconst settlementsEndpoint = 'settlements'\n\n/**\n * Get amount of sent and received from settlements with a peer\n *\n * @param requestOptions Options for making requests\n * @param peer Swarm address of peer\n */\nexport async function getSettlements(requestOptions: BeeRequestOptions, peer: PeerAddress): Promise<Settlements> {\n const response = await http<unknown>(requestOptions, {\n url: `${settlementsEndpoint}/${peer}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n peer: Types.asString(body.peer, { name: 'peer' }),\n sent: BZZ.fromPLUR(asNumberString(body.sent, { name: 'sent' })),\n received: BZZ.fromPLUR(asNumberString(body.received, { name: 'received' })),\n }\n}\n\n/**\n * Get settlements with all known peers and total amount sent or received\n *\n * @param requestOptions Options for making requests\n */\nexport async function getAllSettlements(requestOptions: BeeRequestOptions): Promise<AllSettlements> {\n const response = await http<unknown>(requestOptions, {\n url: settlementsEndpoint,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n const totalSent = BZZ.fromPLUR(asNumberString(body.totalSent, { name: 'totalSent' }))\n const totalReceived = BZZ.fromPLUR(asNumberString(body.totalReceived, { name: 'totalReceived' }))\n const settlements = Types.asArray(body.settlements, { name: 'settlements' }).map(x =>\n Types.asObject(x, { name: 'settlement' }),\n )\n\n return {\n totalSent,\n totalReceived,\n settlements: settlements.map(x => ({\n peer: Types.asString(x.peer, { name: 'peer' }),\n sent: BZZ.fromPLUR(asNumberString(x.sent, { name: 'sent' })),\n received: BZZ.fromPLUR(asNumberString(x.received, { name: 'received' })),\n })),\n }\n}\n","import { Types } from 'cafe-utility'\nimport { BeeRequestOptions, NumberString, RedistributionState, TransactionOptions } from '../../types'\nimport { prepareRequestHeaders } from '../../utils/headers'\nimport { http } from '../../utils/http'\nimport { BZZ, DAI } from '../../utils/tokens'\nimport { asNumberString } from '../../utils/type'\nimport { TransactionId } from '../../utils/typed-bytes'\n\nconst STAKE_ENDPOINT = 'stake'\nconst REDISTRIBUTION_ENDPOINT = 'redistributionstate'\n\n/**\n * Gets the amount of staked BZZ\n *\n * @param requestOptions Options for making requests\n */\nexport async function getStake(requestOptions: BeeRequestOptions): Promise<BZZ> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n responseType: 'json',\n url: `${STAKE_ENDPOINT}`,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return BZZ.fromPLUR(asNumberString(body.stakedAmount, { name: 'stakedAmount' }))\n}\n\n/**\n * Gets the amount of withdrawable staked BZZ\n *\n * @param requestOptions Options for making requests\n */\nexport async function getWithdrawableStake(requestOptions: BeeRequestOptions): Promise<BZZ> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n responseType: 'json',\n url: `${STAKE_ENDPOINT}/withdrawable`,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return BZZ.fromPLUR(asNumberString(body.withdrawableAmount, { name: 'withdrawableAmount' }))\n}\n\nexport async function withdrawSurplusStake(requestOptions: BeeRequestOptions): Promise<TransactionId> {\n const response = await http<unknown>(requestOptions, {\n method: 'delete',\n responseType: 'json',\n url: `${STAKE_ENDPOINT}/withdrawable`,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asHexString(body.txHash, { name: 'txHash' }))\n}\n\nexport async function migrateStake(requestOptions: BeeRequestOptions): Promise<TransactionId> {\n const response = await http<unknown>(requestOptions, {\n method: 'delete',\n responseType: 'json',\n url: STAKE_ENDPOINT,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asHexString(body.txHash, { name: 'txHash' }))\n}\n\n/**\n * Stake given amount of tokens.\n *\n * @param requestOptions Options for making requests\n * @param amount\n */\nexport async function stake(\n requestOptions: BeeRequestOptions,\n amount: NumberString | string | bigint,\n options?: TransactionOptions,\n): Promise<TransactionId> {\n const repsonse = await http<unknown>(requestOptions, {\n method: 'post',\n responseType: 'json',\n url: `${STAKE_ENDPOINT}/${amount}`,\n headers: prepareRequestHeaders(null, options),\n })\n\n const body = Types.asObject(repsonse.data, { name: 'response.data' })\n\n return new TransactionId(Types.asHexString(body.txHash, { name: 'txHash' }))\n}\n\n/**\n * Get current status of node in redistribution game\n *\n * @param requestOptions Options for making requests\n */\nexport async function getRedistributionState(requestOptions: BeeRequestOptions): Promise<RedistributionState> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n responseType: 'json',\n url: REDISTRIBUTION_ENDPOINT,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n minimumGasFunds: DAI.fromWei(asNumberString(body.minimumGasFunds, { name: 'minimumGasFunds' })),\n hasSufficientFunds: Types.asBoolean(body.hasSufficientFunds, { name: 'hasSufficientFunds' }),\n isFrozen: Types.asBoolean(body.isFrozen, { name: 'isFrozen' }),\n isFullySynced: Types.asBoolean(body.isFullySynced, { name: 'isFullySynced' }),\n phase: Types.asString(body.phase, { name: 'phase' }),\n round: Types.asNumber(body.round, { name: 'round' }),\n lastWonRound: Types.asNumber(body.lastWonRound, { name: 'lastWonRound' }),\n lastPlayedRound: Types.asNumber(body.lastPlayedRound, { name: 'lastPlayedRound' }),\n lastFrozenRound: Types.asNumber(body.lastFrozenRound, { name: 'lastFrozenRound' }),\n lastSelectedRound: Types.asNumber(body.lastSelectedRound, { name: 'lastSelectedRound' }),\n lastSampleDurationSeconds: Types.asNumber(body.lastSampleDurationSeconds, { name: 'lastSampleDurationSeconds' }),\n block: Types.asNumber(body.block, { name: 'block' }),\n reward: BZZ.fromPLUR(asNumberString(body.reward, { name: 'reward' })),\n fees: DAI.fromWei(asNumberString(body.fees, { name: 'fees' })),\n isHealthy: Types.asBoolean(body.isHealthy, { name: 'isHealthy' }),\n }\n}\n","import { Numbers } from 'cafe-utility'\n\n/**\n * Represents a size in bytes.\n *\n * Uses 1000 instead of 1024 for converting between units.\n * This is to stay consistent with the Swarm papers\n * on theoretical and effective storage capacity.\n */\nexport class Size {\n private bytes: number\n\n private constructor(bytes: number) {\n this.bytes = Math.ceil(bytes)\n\n if (bytes < 0) {\n throw Error('Size must be at least 0')\n }\n }\n\n static fromBytes(bytes: number): Size {\n return new Size(bytes)\n }\n\n static fromKilobytes(kilobytes: number): Size {\n return new Size(kilobytes * 1000)\n }\n\n static fromMegabytes(megabytes: number): Size {\n return new Size(megabytes * 1000 * 1000)\n }\n\n static fromGigabytes(gigabytes: number): Size {\n return new Size(gigabytes * 1000 * 1000 * 1000)\n }\n\n /**\n * Parses a size string and returns a `Size` instance.\n *\n * Case insensitive. E.g. both `\"28MB\"` and `\"1gb\"` are valid.\n *\n * Whitespaces are ignored. E.g. both `\"512 kb\"` and `\"2megabytes\"` are valid.\n *\n * Decimal numbers are supported. E.g. `\"1.5gb\"` is valid.\n *\n * Uses 1000 as the base for conversions. E.g. 1kb = 1000 bytes.\n * This is consistent with the effective stamp utilization table.\n *\n * Supported units:\n * - b, byte, bytes\n * - kb, kilobyte, kilobytes\n * - mb, megabyte, megabytes\n * - gb, gigabyte, gigabytes\n * - tb, terabyte, terabytes\n *\n * @param size - A string representing a size\n * @returns a `Size` instance\n */\n static parseFromString(size: string): Size {\n return Size.fromBytes(Numbers.makeStorage(size, 1000))\n }\n\n toBytes(): number {\n return this.bytes\n }\n\n toGigabytes(): number {\n return this.bytes / 1000 / 1000 / 1000\n }\n\n toFormattedString(): string {\n return Numbers.convertBytes(this.bytes, 1000)\n }\n\n represent(): string {\n return this.toFormattedString()\n }\n}\n","// TODO: Remove this file after the issue is fixed\n\nexport function normalizeBatchTTL(batchTTL: number) {\n if (!Number.isInteger(batchTTL)) {\n return 1\n }\n\n if (batchTTL < 1) {\n return 1\n }\n\n if (batchTTL > 315569260) {\n return 315569260\n }\n\n return batchTTL\n}\n\nexport function normalizeCurrentPrice(currentPrice: number) {\n if (!Number.isInteger(currentPrice)) {\n return 24000\n }\n\n if (currentPrice < 24000) {\n return 24000\n }\n\n return currentPrice\n}\n","import { Types } from 'cafe-utility'\nimport type {\n BeeRequestOptions,\n GlobalPostageBatch,\n NumberString,\n PostageBatch,\n PostageBatchBuckets,\n PostageBatchOptions,\n RedundancyLevel,\n} from '../../types'\nimport { Duration } from '../../utils/duration'\nimport { http } from '../../utils/http'\nimport { Size } from '../../utils/size'\nimport { getStampEffectiveBytes, getStampTheoreticalBytes, getStampUsage } from '../../utils/stamps'\nimport { asNumberString } from '../../utils/type'\nimport { BatchId, EthAddress } from '../../utils/typed-bytes'\nimport { normalizeBatchTTL } from '../../utils/workaround'\n\nconst STAMPS_ENDPOINT = 'stamps'\nconst BATCHES_ENDPOINT = 'batches'\n\nexport async function getGlobalPostageBatches(requestOptions: BeeRequestOptions): Promise<GlobalPostageBatch[]> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${BATCHES_ENDPOINT}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const batches = Types.asArray(body.batches, { name: 'batches' }).map(x => Types.asObject(x, { name: 'batch' }))\n\n return batches.map(x => ({\n batchID: new BatchId(Types.asString(x.batchID, { name: 'batchID' })),\n batchTTL: Types.asNumber(x.batchTTL, { name: 'batchTTL' }),\n bucketDepth: Types.asNumber(x.bucketDepth, { name: 'bucketDepth' }),\n depth: Types.asNumber(x.depth, { name: 'depth' }),\n immutable: Types.asBoolean(x.immutable, { name: 'immutable' }),\n owner: new EthAddress(Types.asString(x.owner, { name: 'owner' })),\n start: Types.asNumber(x.start, { name: 'start' }),\n value: asNumberString(x.value, { name: 'value' }),\n }))\n}\n\nexport async function getAllPostageBatches(requestOptions: BeeRequestOptions): Promise<PostageBatch[]> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${STAMPS_ENDPOINT}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const stamps = Types.asArray(body.stamps, { name: 'stamps' }).map(x => Types.asObject(x, { name: 'stamp' }))\n\n return stamps.map(x => {\n const utilization = Types.asNumber(x.utilization, { name: 'utilization' })\n const depth = Types.asNumber(x.depth, { name: 'depth' })\n const bucketDepth = Types.asNumber(x.bucketDepth, { name: 'bucketDepth' })\n const usage = getStampUsage(utilization, depth, bucketDepth)\n const batchTTL = normalizeBatchTTL(Types.asNumber(x.batchTTL, { name: 'batchTTL' }))\n const duration = Duration.fromSeconds(batchTTL)\n\n const effectiveBytes = getStampEffectiveBytes(depth)\n\n return {\n batchID: new BatchId(Types.asString(x.batchID, { name: 'batchID' })),\n utilization,\n usable: Types.asBoolean(x.usable, { name: 'usable' }),\n label: Types.asEmptiableString(x.label, { name: 'label' }),\n depth,\n amount: asNumberString(x.amount, { name: 'amount' }),\n bucketDepth,\n blockNumber: Types.asNumber(x.blockNumber, { name: 'blockNumber' }),\n immutableFlag: Types.asBoolean(x.immutableFlag, { name: 'immutableFlag' }),\n usage,\n usageText: `${Math.round(usage * 100)}%`,\n size: Size.fromBytes(effectiveBytes),\n remainingSize: Size.fromBytes(Math.ceil(effectiveBytes * (1 - usage))),\n theoreticalSize: Size.fromBytes(getStampTheoreticalBytes(depth)),\n duration,\n calculateSize(encryption, redundancyLevel) {\n const effectiveBytes = getStampEffectiveBytes(this.depth, encryption, redundancyLevel)\n\n return Size.fromBytes(effectiveBytes)\n },\n calculateRemainingSize(encryption, redundancyLevel) {\n const effectiveBytes = getStampEffectiveBytes(this.depth, encryption, redundancyLevel)\n\n return Size.fromBytes(Math.ceil(effectiveBytes * (1 - this.usage)))\n },\n }\n })\n}\n\nexport async function getPostageBatch(\n requestOptions: BeeRequestOptions,\n postageBatchId: BatchId,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n): Promise<PostageBatch> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${STAMPS_ENDPOINT}/${postageBatchId}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n const utilization = Types.asNumber(body.utilization, { name: 'utilization' })\n const depth = Types.asNumber(body.depth, { name: 'depth' })\n const bucketDepth = Types.asNumber(body.bucketDepth, { name: 'bucketDepth' })\n const usage = getStampUsage(utilization, depth, bucketDepth)\n const batchTTL = normalizeBatchTTL(Types.asNumber(body.batchTTL, { name: 'batchTTL' }))\n const duration = Duration.fromSeconds(batchTTL)\n\n const effectiveBytes = getStampEffectiveBytes(depth, encryption, erasureCodeLevel)\n\n return {\n batchID: new BatchId(Types.asString(body.batchID, { name: 'batchID' })),\n utilization,\n usable: Types.asBoolean(body.usable, { name: 'usable' }),\n label: Types.asEmptiableString(body.label, { name: 'label' }),\n depth,\n amount: asNumberString(body.amount, { name: 'amount' }),\n bucketDepth,\n blockNumber: Types.asNumber(body.blockNumber, { name: 'blockNumber' }),\n immutableFlag: Types.asBoolean(body.immutableFlag, { name: 'immutableFlag' }),\n usage,\n usageText: `${Math.round(usage * 100)}%`,\n size: Size.fromBytes(effectiveBytes),\n remainingSize: Size.fromBytes(Math.ceil(effectiveBytes * (1 - usage))),\n theoreticalSize: Size.fromBytes(getStampTheoreticalBytes(depth)),\n duration,\n calculateSize(encryption, redundancyLevel) {\n const effectiveBytes = getStampEffectiveBytes(depth, encryption, redundancyLevel)\n\n return Size.fromBytes(effectiveBytes)\n },\n calculateRemainingSize(encryption, redundancyLevel) {\n const effectiveBytes = getStampEffectiveBytes(depth, encryption, redundancyLevel)\n\n return Size.fromBytes(Math.ceil(effectiveBytes * (1 - usage)))\n },\n }\n}\n\nexport async function getPostageBatchBuckets(\n requestOptions: BeeRequestOptions,\n postageBatchId: BatchId,\n): Promise<PostageBatchBuckets> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${STAMPS_ENDPOINT}/${postageBatchId}/buckets`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n depth: Types.asNumber(body.depth, { name: 'depth' }),\n bucketDepth: Types.asNumber(body.bucketDepth, { name: 'bucketDepth' }),\n bucketUpperBound: Types.asNumber(body.bucketUpperBound, { name: 'bucketUpperBound' }),\n buckets: Types.asArray(body.buckets, { name: 'buckets' })\n .map(x => Types.asObject(x, { name: 'bucket' }))\n .map(x => ({\n bucketID: Types.asNumber(x.bucketID, { name: 'bucketID' }),\n collisions: Types.asNumber(x.collisions, { name: 'collisions' }),\n })),\n }\n}\n\nexport async function createPostageBatch(\n requestOptions: BeeRequestOptions,\n amount: NumberString,\n depth: number,\n options?: PostageBatchOptions,\n): Promise<BatchId> {\n const headers: Record<string, string> = {}\n\n if (options?.gasPrice) {\n headers['gas-price'] = options.gasPrice.toString()\n }\n\n if (options?.immutableFlag !== undefined) {\n headers.immutable = String(options.immutableFlag)\n }\n\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: `${STAMPS_ENDPOINT}/${amount}/${depth}`,\n responseType: 'json',\n params: { label: options?.label },\n headers,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new BatchId(Types.asString(body.batchID, { name: 'batchID' }))\n}\n\nexport async function topUpBatch(\n requestOptions: BeeRequestOptions,\n id: BatchId,\n amount: NumberString,\n): Promise<BatchId> {\n const response = await http<unknown>(requestOptions, {\n method: 'patch',\n url: `${STAMPS_ENDPOINT}/topup/${id}/${amount}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new BatchId(Types.asString(body.batchID, { name: 'batchID' }))\n}\n\nexport async function diluteBatch(requestOptions: BeeRequestOptions, id: BatchId, depth: number): Promise<BatchId> {\n const response = await http<unknown>(requestOptions, {\n method: 'patch',\n url: `${STAMPS_ENDPOINT}/dilute/${id}/${depth}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new BatchId(Types.asString(body.batchID, { name: 'batchID' }))\n}\n","import { Types } from 'cafe-utility'\nimport { BeeRequestOptions, ChainState, ReserveState, WalletBalance } from '../../types'\nimport { http } from '../../utils/http'\nimport { BZZ, DAI } from '../../utils/tokens'\nimport { asNumberString } from '../../utils/type'\nimport { EthAddress, TransactionId } from '../../utils/typed-bytes'\nimport { normalizeCurrentPrice } from '../../utils/workaround'\n\nconst RESERVE_STATE_ENDPOINT = 'reservestate'\nconst WALLET_ENDPOINT = 'wallet'\nconst CHAIN_STATE_ENDPOINT = 'chainstate'\n\n/**\n * Get state of reserve\n *\n * @param requestOptions Options for making requests\n */\nexport async function getReserveState(requestOptions: BeeRequestOptions): Promise<ReserveState> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${RESERVE_STATE_ENDPOINT}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n commitment: Types.asNumber(body.commitment, { name: 'commitment' }),\n radius: Types.asNumber(body.radius, { name: 'radius' }),\n storageRadius: Types.asNumber(body.storageRadius, { name: 'storageRadius' }),\n }\n}\n\n/**\n * Get state of reserve\n *\n * @param requestOptions Options for making requests\n */\nexport async function getChainState(requestOptions: BeeRequestOptions): Promise<ChainState> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${CHAIN_STATE_ENDPOINT}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n block: Types.asNumber(body.block, { name: 'block' }),\n chainTip: Types.asNumber(body.chainTip, { name: 'chainTip' }),\n totalAmount: asNumberString(body.totalAmount, { name: 'totalAmount' }),\n currentPrice: normalizeCurrentPrice(Types.asNumber(body.currentPrice, { name: 'currentPrice' })),\n }\n}\n\n/**\n * Get wallet balances for xDai and BZZ of the node\n *\n * @param requestOptions Options for making requests\n */\nexport async function getWalletBalance(requestOptions: BeeRequestOptions): Promise<WalletBalance> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${WALLET_ENDPOINT}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n bzzBalance: BZZ.fromPLUR(asNumberString(body.bzzBalance, { name: 'bzzBalance' })),\n nativeTokenBalance: DAI.fromWei(asNumberString(body.nativeTokenBalance, { name: 'nativeTokenBalance' })),\n chainID: Types.asNumber(body.chainID, { name: 'chainID' }),\n chequebookContractAddress: Types.asString(body.chequebookContractAddress, { name: 'chequebookContractAddress' }),\n walletAddress: Types.asString(body.walletAddress, { name: 'walletAddress' }),\n }\n}\n\nexport async function withdrawBZZ(\n requestOptions: BeeRequestOptions,\n amount: BZZ,\n address: EthAddress,\n): Promise<TransactionId> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: `${WALLET_ENDPOINT}/withdraw/bzz`,\n responseType: 'json',\n params: { amount: amount.toPLURString(), address: address.toHex() },\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asString(body.transactionHash, { name: 'transactionHash' }))\n}\n\nexport async function withdrawDAI(\n requestOptions: BeeRequestOptions,\n amount: DAI,\n address: EthAddress,\n): Promise<TransactionId> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: `${WALLET_ENDPOINT}/withdraw/nativetoken`,\n responseType: 'json',\n params: { amount: amount.toWeiString(), address: address.toHex() },\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asString(body.transactionHash, { name: 'transactionHash' }))\n}\n","import { Types } from 'cafe-utility'\nimport getMajorSemver from 'semver/functions/major.js'\nimport { BeeRequestOptions } from '../../index'\nimport type { DebugStatus, Health, NodeInfo, Readiness } from '../../types/debug'\nimport { BeeVersions, toBeeMode } from '../../types/debug'\nimport { http } from '../../utils/http'\n\nexport const SUPPORTED_BEE_VERSION_EXACT = '2.6.0-d0aa8b93'\nexport const SUPPORTED_BEE_VERSION = SUPPORTED_BEE_VERSION_EXACT.split('-')[0]\nexport const SUPPORTED_API_VERSION = '7.3.0'\n\nconst NODE_INFO_URL = 'node'\nconst STATUS_URL = 'status'\nconst HEALTH_URL = 'health'\nconst READINESS_URL = 'readiness'\n\nexport async function getDebugStatus(requestOptions: BeeRequestOptions): Promise<DebugStatus> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: STATUS_URL,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n overlay: Types.asString(body.overlay, { name: 'overlay' }),\n proximity: Types.asNumber(body.proximity, { name: 'proximity' }),\n beeMode: toBeeMode(Types.asString(body.beeMode, { name: 'beeMode' })),\n reserveSize: Types.asNumber(body.reserveSize, { name: 'reserveSize' }),\n reserveSizeWithinRadius: Types.asNumber(body.reserveSizeWithinRadius, { name: 'reserveSizeWithinRadius' }),\n pullsyncRate: Types.asNumber(body.pullsyncRate, { name: 'pullsyncRate' }),\n storageRadius: Types.asNumber(body.storageRadius, { name: 'storageRadius' }),\n connectedPeers: Types.asNumber(body.connectedPeers, { name: 'connectedPeers' }),\n neighborhoodSize: Types.asNumber(body.neighborhoodSize, { name: 'neighborhoodSize' }),\n batchCommitment: Types.asNumber(body.batchCommitment, { name: 'batchCommitment' }),\n isReachable: Types.asBoolean(body.isReachable, { name: 'isReachable' }),\n lastSyncedBlock: Types.asNumber(body.lastSyncedBlock, { name: 'lastSyncedBlock' }),\n committedDepth: Types.asNumber(body.committedDepth, { name: 'committedDepth' }),\n isWarmingUp: Types.asBoolean(body.isWarmingUp, { name: 'isWarmingUp' }),\n }\n}\n\n/**\n * Get health of node\n *\n * @param requestOptions Options for making requests\n */\nexport async function getHealth(requestOptions: BeeRequestOptions): Promise<Health> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: HEALTH_URL,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n apiVersion: Types.asString(body.apiVersion, { name: 'apiVersion' }),\n version: Types.asString(body.version, { name: 'version' }),\n status: Types.asString(body.status, { name: 'status' }) as 'ok',\n }\n}\n\n/**\n * Get readiness of node\n *\n * @param requestOptions Options for making requests\n */\nexport async function getReadiness(requestOptions: BeeRequestOptions): Promise<Readiness> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: READINESS_URL,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n apiVersion: Types.asString(body.apiVersion, { name: 'apiVersion' }),\n version: Types.asString(body.version, { name: 'version' }),\n status: Types.asString(body.status, { name: 'status' }),\n }\n}\n\n/**\n * Get information about Bee node\n *\n * @param requestOptions Options for making requests\n */\nexport async function getNodeInfo(requestOptions: BeeRequestOptions): Promise<NodeInfo> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: NODE_INFO_URL,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n beeMode: toBeeMode(Types.asString(body.beeMode, { name: 'beeMode' })),\n chequebookEnabled: Types.asBoolean(body.chequebookEnabled, { name: 'chequebookEnabled' }),\n swapEnabled: Types.asBoolean(body.swapEnabled, { name: 'swapEnabled' }),\n }\n}\n\n/**\n * Connects to a node and checks if its version matches with the one that bee-js supports.\n *\n * This is the most strict version check and most probably you will\n * want to use the relaxed API-versions check `isSupportedApiVersion`.\n *\n * @param requestOptions Options for making requests\n */\nexport async function isSupportedExactVersion(requestOptions: BeeRequestOptions): Promise<boolean> {\n const { version } = await getHealth(requestOptions)\n\n return version === SUPPORTED_BEE_VERSION_EXACT\n}\n\n/**\n * Connects to a node and checks if its Main API versions matches with the one that bee-js supports.\n *\n * This should be the main way how to check compatibility for your app and Bee node.\n *\n * @param requestOptions Options for making requests\n */\nexport async function isSupportedApiVersion(requestOptions: BeeRequestOptions): Promise<boolean> {\n const { apiVersion } = await getHealth(requestOptions)\n\n return getMajorSemver(apiVersion) === getMajorSemver(SUPPORTED_API_VERSION)\n}\n\n/**\n * Returns object with all versions specified by the connected Bee node (properties prefixed with `bee*`)\n * and versions that bee-js supports (properties prefixed with `supported*`).\n *\n * @param requestOptions Options for making requests\n */\nexport async function getVersions(requestOptions: BeeRequestOptions): Promise<BeeVersions> {\n const { version, apiVersion } = await getHealth(requestOptions)\n\n return {\n supportedBeeVersion: SUPPORTED_BEE_VERSION_EXACT,\n supportedBeeApiVersion: SUPPORTED_API_VERSION,\n beeVersion: version,\n beeApiVersion: apiVersion,\n }\n}\n","import { Types } from 'cafe-utility'\nimport { BeeRequestOptions, NumberString, TransactionInfo } from '../../types'\nimport { http } from '../../utils/http'\nimport { asNumberString } from '../../utils/type'\nimport { TransactionId } from '../../utils/typed-bytes'\n\nconst transactionsEndpoint = 'transactions'\n\n/**\n * Get list of all pending transactions\n *\n * @param requestOptions Options for making requests\n */\nexport async function getAllTransactions(requestOptions: BeeRequestOptions): Promise<TransactionInfo[]> {\n const response = await http<unknown>(requestOptions, {\n url: transactionsEndpoint,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const pendingTransactions = Types.asArray(body.pendingTransactions, { name: 'pendingTransactions' })\n\n return pendingTransactions.map(toTransaction)\n}\n\n/**\n * Get information for specific pending transactions\n *\n * @param requestOptions Options for making requests\n * @param transactionHash Hash of the transaction\n */\nexport async function getTransaction(\n requestOptions: BeeRequestOptions,\n transactionHash: TransactionId,\n): Promise<TransactionInfo> {\n const response = await http<unknown>(requestOptions, {\n url: `${transactionsEndpoint}/${transactionHash}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return toTransaction(body)\n}\n\nfunction toTransaction(value: unknown) {\n const object = Types.asObject(value, { name: 'transaction' })\n\n return {\n transactionHash: new TransactionId(Types.asString(object.transactionHash, { name: 'transactionHash' })),\n to: Types.asString(object.to, { name: 'to' }),\n nonce: Types.asNumber(object.nonce, { name: 'nonce' }),\n gasPrice: asNumberString(object.gasPrice, { name: 'gasPrice' }),\n gasLimit: Types.asNumber(object.gasLimit, { name: 'gasLimit' }),\n data: Types.asString(object.data, { name: 'data' }),\n created: Types.asString(object.created, { name: 'created' }),\n description: Types.asString(object.description, { name: 'description' }),\n value: asNumberString(object.value, { name: 'value' }),\n }\n}\n\n/**\n * Rebroadcast existing transaction\n *\n * @param requestOptions Options for making requests\n * @param transactionHash Hash of the transaction\n */\nexport async function rebroadcastTransaction(\n requestOptions: BeeRequestOptions,\n transactionHash: TransactionId,\n): Promise<TransactionId> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: `${transactionsEndpoint}/${transactionHash}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asString(body.transactionHash, { name: 'transactionHash' }))\n}\n\n/**\n * Cancel existing transaction\n *\n * @param requestOptions Options for making requests\n * @param transactionHash Hash of the transaction\n * @param gasPrice Optional gas price\n */\nexport async function cancelTransaction(\n requestOptions: BeeRequestOptions,\n transactionHash: TransactionId,\n gasPrice?: NumberString | string | bigint,\n): Promise<TransactionId> {\n const headers: Record<string, string | number> = {}\n\n if (gasPrice) {\n headers['gas-price'] = gasPrice.toString()\n }\n const response = await http<unknown>(requestOptions, {\n method: 'delete',\n headers,\n url: `${transactionsEndpoint}/${transactionHash}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asString(body.transactionHash, { name: 'transactionHash' }))\n}\n","import { Types } from 'cafe-utility'\nimport { BeeRequestOptions, GetGranteesResult, GranteesResult } from '../types'\nimport { prepareRequestHeaders } from '../utils/headers'\nimport { http } from '../utils/http'\nimport { BatchId, PublicKey, Reference } from '../utils/typed-bytes'\n\nconst granteeEndpoint = 'grantee'\n\nexport async function getGrantees(reference: Reference, requestOptions: BeeRequestOptions): Promise<GetGranteesResult> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${granteeEndpoint}/${reference}`,\n responseType: 'json',\n })\n\n const body = Types.asArray(response.data, { name: 'response.data' }).map(\n x => new PublicKey(Types.asString(x, { name: 'grantee' })),\n )\n\n return {\n status: response.status,\n statusText: response.statusText,\n grantees: body,\n }\n}\n\nexport async function createGrantees(\n requestOptions: BeeRequestOptions,\n postageBatchId: BatchId,\n grantees: PublicKey[],\n): Promise<GranteesResult> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: granteeEndpoint,\n data: { grantees: grantees.map(x => x.toCompressedHex()) },\n headers: prepareRequestHeaders(postageBatchId),\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n status: response.status,\n statusText: response.statusText,\n ref: new Reference(Types.asString(body.ref, { name: 'ref' })),\n historyref: new Reference(Types.asString(body.historyref, { name: 'historyref' })),\n }\n}\n\nexport async function patchGrantees(\n postageBatchId: BatchId,\n reference: Reference,\n historyRef: Reference,\n grantees: { add?: PublicKey[]; revoke?: PublicKey[] },\n requestOptions: BeeRequestOptions,\n): Promise<GranteesResult> {\n const response = await http<unknown>(requestOptions, {\n method: 'patch',\n url: `${granteeEndpoint}/${reference}`,\n data: {\n add: grantees.add?.map(x => x.toCompressedHex()),\n revoke: grantees.revoke?.map(x => x.toCompressedHex()),\n },\n headers: {\n ...prepareRequestHeaders(postageBatchId),\n 'swarm-act-history-address': historyRef.toHex(),\n },\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n status: response.status,\n statusText: response.statusText,\n ref: new Reference(Types.asString(body.ref, { name: 'ref' })),\n historyref: new Reference(Types.asString(body.historyref, { name: 'historyref' })),\n }\n}\n","import { System } from 'cafe-utility'\nimport WebSocket from 'isomorphic-ws'\nimport { BeeRequestOptions, UploadOptions } from '..'\nimport { SingleOwnerChunk, uploadSingleOwnerChunk } from '../chunk/soc'\nimport { BatchId, Reference } from '../utils/typed-bytes'\n\nconst endpoint = 'gsoc'\n\nexport async function send(\n requestOptions: BeeRequestOptions,\n soc: SingleOwnerChunk,\n stamp: BatchId,\n options?: UploadOptions,\n) {\n return uploadSingleOwnerChunk(requestOptions, soc, stamp, options)\n}\n\nexport function subscribe(url: string, reference: Reference, headers?: Record<string, string>) {\n const wsUrl = url.replace(/^http/i, 'ws')\n\n if (System.whereAmI() === 'browser') {\n return new WebSocket(`${wsUrl}/${endpoint}/subscribe/${reference.toHex()}`)\n }\n\n return new WebSocket(`${wsUrl}/${endpoint}/subscribe/${reference.toHex()}`, {\n headers,\n })\n}\n","import { Types } from 'cafe-utility'\nimport type { BeeRequestOptions, Pin } from '../types'\nimport { http } from '../utils/http'\nimport { Reference } from '../utils/typed-bytes'\n\nconst PINNING_ENDPOINT = 'pins'\n\n/**\n * Pin data with given reference\n *\n * @param requestOptions Options for making requests\n * @param reference Bee data reference\n */\nexport async function pin(requestOptions: BeeRequestOptions, reference: Reference): Promise<void> {\n await http<unknown>(requestOptions, {\n method: 'post',\n responseType: 'json',\n url: `${PINNING_ENDPOINT}/${reference}`,\n })\n}\n\n/**\n * Unpin data with given reference\n *\n * @param requestOptions Options for making requests\n * @param reference Bee data reference\n */\nexport async function unpin(requestOptions: BeeRequestOptions, reference: Reference): Promise<void> {\n await http<unknown>(requestOptions, {\n method: 'delete',\n responseType: 'json',\n url: `${PINNING_ENDPOINT}/${reference}`,\n })\n}\n\n/**\n * Get pin status for specific address.\n *\n * @param requestOptions Options for making requests\n * @param reference\n * @throws Error if given address is not pinned\n */\nexport async function getPin(requestOptions: BeeRequestOptions, reference: Reference): Promise<Pin> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n responseType: 'json',\n url: `${PINNING_ENDPOINT}/${reference}`,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n reference: new Reference(Types.asString(body.reference, { name: 'reference' })),\n }\n}\n\n/**\n * Get list of all pins\n *\n * @param requestOptions Options for making requests\n */\nexport async function getAllPins(requestOptions: BeeRequestOptions): Promise<Reference[]> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n responseType: 'json',\n url: `${PINNING_ENDPOINT}`,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n // TODO: https://github.com/ethersphere/bee/issues/4964\n if (body.references === null) {\n return []\n }\n\n const references = Types.asArray(body.references, { name: 'references' }).map(x =>\n Types.asString(x, { name: 'reference' }),\n )\n\n return references.map(x => new Reference(x))\n}\n","import { System } from 'cafe-utility'\nimport WebSocket from 'isomorphic-ws'\nimport type { BeeRequestOptions } from '../types'\nimport { prepareRequestHeaders } from '../utils/headers'\nimport { http } from '../utils/http'\nimport { BatchId, PublicKey, Topic } from '../utils/typed-bytes'\n\nconst endpoint = 'pss'\n\n/**\n * Send to recipient or target with Postal Service for Swarm\n *\n * @param requestOptions Options for making requests\n * @param topic Topic name\n * @param target Target message address prefix\n * @param data\n * @param postageBatchId Postage BatchId that will be assigned to sent message\n * @param recipient Recipient public key\n *\n */\nexport async function send(\n requestOptions: BeeRequestOptions,\n topic: Topic,\n target: string,\n data: string | Uint8Array,\n postageBatchId: BatchId,\n recipient?: PublicKey,\n): Promise<void> {\n await http<unknown>(requestOptions, {\n method: 'post',\n url: `${endpoint}/send/${topic}/${target}`,\n data,\n responseType: 'json',\n params: { recipient },\n headers: prepareRequestHeaders(postageBatchId),\n })\n}\n\n/**\n * Subscribe for messages on the given topic\n *\n * @param url Bee node URL\n * @param topic Topic name\n */\nexport function subscribe(url: string, topic: Topic, headers?: Record<string, string>): WebSocket {\n const wsUrl = url.replace(/^http/i, 'ws')\n\n if (System.whereAmI() === 'browser') {\n return new WebSocket(`${wsUrl}/${endpoint}/subscribe/${topic.toHex()}`)\n }\n\n return new WebSocket(`${wsUrl}/${endpoint}/subscribe/${topic.toHex()}`, {\n headers,\n })\n}\n","import { Types } from 'cafe-utility'\nimport { BeeRequestOptions } from '../index'\nimport { http } from '../utils/http'\n\n/**\n * Ping the base bee URL. If connection was not successful throw error\n *\n * @param requestOptions Options for making requests\n */\nexport async function checkConnection(requestOptions: BeeRequestOptions): Promise<void> | never {\n await http<unknown>(requestOptions, {\n url: '',\n })\n}\n\nexport async function isGateway(requestOptions: BeeRequestOptions): Promise<boolean> {\n try {\n const response = await http<unknown>(requestOptions, {\n url: '/gateway',\n })\n const data = Types.asObject(response.data)\n\n return Types.asBoolean(data.gateway)\n } catch (error) {\n return false\n }\n}\n","import { Types } from 'cafe-utility'\nimport type { BeeRequestOptions } from '../types'\nimport { http } from '../utils/http'\nimport { BatchId, Reference } from '../utils/typed-bytes'\n\nconst stewardshipEndpoint = 'stewardship'\n\n/**\n * Reupload locally pinned data\n * @param requestOptions Options for making requests\n * @param reference\n * @throws BeeResponseError if not locally pinned or invalid data\n */\nexport async function reupload(requestOptions: BeeRequestOptions, stamp: BatchId, reference: Reference): Promise<void> {\n await http(requestOptions, {\n method: 'put',\n url: `${stewardshipEndpoint}/${reference}`,\n headers: { 'swarm-postage-batch-id': stamp.toHex() },\n })\n}\n\nexport async function isRetrievable(\n requestOptions: BeeRequestOptions,\n reference: Reference | Uint8Array | string,\n): Promise<boolean> {\n reference = new Reference(reference)\n\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n responseType: 'json',\n url: `${stewardshipEndpoint}/${reference}`,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return Types.asBoolean(body.isRetrievable, { name: 'isRetrievable' })\n}\n","import { Types } from 'cafe-utility'\nimport { BeeRequestOptions, Tag } from '../types'\nimport { http } from '../utils/http'\nimport { Reference } from '../utils/typed-bytes'\n\nconst endpoint = 'tags'\n\n/**\n * Create new tag on the Bee node\n *\n * @param url Bee tag URL\n */\nexport async function createTag(requestOptions: BeeRequestOptions): Promise<Tag> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: endpoint,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n address: Types.asEmptiableString(body.address, { name: 'address' }),\n seen: Types.asNumber(body.seen, { name: 'seen' }),\n sent: Types.asNumber(body.sent, { name: 'sent' }),\n split: Types.asNumber(body.split, { name: 'split' }),\n startedAt: Types.asString(body.startedAt, { name: 'startedAt' }),\n stored: Types.asNumber(body.stored, { name: 'stored' }),\n synced: Types.asNumber(body.synced, { name: 'synced' }),\n uid: Types.asNumber(body.uid, { name: 'uid' }),\n }\n}\n\n/**\n * Retrieve tag information from Bee node\n *\n * @param url Bee tag URL\n * @param uid UID of tag to be retrieved\n */\nexport async function retrieveTag(requestOptions: BeeRequestOptions, uid: number): Promise<Tag> {\n const response = await http<unknown>(requestOptions, {\n url: `${endpoint}/${uid}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n address: Types.asEmptiableString(body.address, { name: 'address' }),\n seen: Types.asNumber(body.seen, { name: 'seen' }),\n sent: Types.asNumber(body.sent, { name: 'sent' }),\n split: Types.asNumber(body.split, { name: 'split' }),\n startedAt: Types.asString(body.startedAt, { name: 'startedAt' }),\n stored: Types.asNumber(body.stored, { name: 'stored' }),\n synced: Types.asNumber(body.synced, { name: 'synced' }),\n uid: Types.asNumber(body.uid, { name: 'uid' }),\n }\n}\n\n/**\n * Get limited listing of all tags.\n *\n * @param url\n * @param offset\n * @param limit\n */\nexport async function getAllTags(requestOptions: BeeRequestOptions, offset?: number, limit?: number): Promise<Tag[]> {\n const response = await http<unknown>(requestOptions, {\n url: endpoint,\n params: { offset, limit },\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const tags = Types.asArray(body.tags, { name: 'tags' }).map(x => Types.asObject(x, { name: 'tag' }))\n\n return tags.map(x => ({\n address: Types.asEmptiableString(x.address, { name: 'address' }),\n seen: Types.asNumber(x.seen, { name: 'seen' }),\n sent: Types.asNumber(x.sent, { name: 'sent' }),\n split: Types.asNumber(x.split, { name: 'split' }),\n startedAt: Types.asString(x.startedAt, { name: 'startedAt' }),\n stored: Types.asNumber(x.stored, { name: 'stored' }),\n synced: Types.asNumber(x.synced, { name: 'synced' }),\n uid: Types.asNumber(x.uid, { name: 'uid' }),\n }))\n}\n\n/**\n * Removes tag from the Bee node.\n * @param url\n * @param uid\n */\nexport async function deleteTag(requestOptions: BeeRequestOptions, uid: number): Promise<void> {\n await http<void>(requestOptions, {\n method: 'delete',\n url: `${endpoint}/${uid}`,\n })\n}\n\n/**\n * Updates tag\n * @param url\n * @param uid\n * @param reference\n */\nexport async function updateTag(requestOptions: BeeRequestOptions, uid: number, reference: Reference): Promise<void> {\n await http<void>(requestOptions, {\n method: 'patch',\n url: `${endpoint}/${uid}`,\n data: {\n reference,\n },\n })\n}\n","import { Binary, MerkleTree, Optional, Uint8ArrayReader } from 'cafe-utility'\nimport _debug from 'debug'\nimport { Bee, BeeRequestOptions, DownloadOptions, NULL_ADDRESS, UploadOptions, UploadResult } from '..'\nimport { FeedPayloadResult } from '../modules/feed'\nimport { Bytes } from '../utils/bytes'\nimport { BatchId, Reference } from '../utils/typed-bytes'\n\nconst debug = _debug('bee-js:manifest')\n\nconst ENCODER = new TextEncoder()\nconst DECODER = new TextDecoder()\n\nconst TYPE_VALUE = 2\nconst TYPE_EDGE = 4\nconst TYPE_WITH_PATH_SEPARATOR = 8\nconst TYPE_WITH_METADATA = 16\nconst PATH_SEPARATOR = new Uint8Array([47])\nconst VERSION_02_HASH_HEX = '5768b3b6a7db56d21d1abff40d41cebfc83448fed8d7e9b06ec0d3b073f28f7b'\nconst VERSION_02_HASH = Binary.hexToUint8Array(VERSION_02_HASH_HEX)\n\nexport class Fork {\n prefix: Uint8Array\n node: MantarayNode\n\n constructor(prefix: Uint8Array, node: MantarayNode) {\n this.prefix = prefix\n this.node = node\n }\n\n static split(a: Fork, b: Fork): Fork {\n const commonPart = Binary.commonPrefix(a.prefix, b.prefix)\n\n if (commonPart.length === a.prefix.length) {\n const remainingB = b.prefix.slice(commonPart.length)\n b.node.path = b.prefix.slice(commonPart.length)\n b.prefix = b.prefix.slice(commonPart.length)\n b.node.parent = a.node\n a.node.forks.set(remainingB[0], b)\n\n return a\n }\n\n if (commonPart.length === b.prefix.length) {\n const remainingA = a.prefix.slice(commonPart.length)\n a.node.path = a.prefix.slice(commonPart.length)\n a.prefix = a.prefix.slice(commonPart.length)\n a.node.parent = b.node\n b.node.forks.set(remainingA[0], a)\n\n return b\n }\n\n const node = new MantarayNode({ path: commonPart })\n\n const newAFork = new Fork(a.prefix.slice(commonPart.length), a.node)\n const newBFork = new Fork(b.prefix.slice(commonPart.length), b.node)\n\n a.node.path = a.prefix.slice(commonPart.length)\n b.node.path = b.prefix.slice(commonPart.length)\n a.prefix = a.prefix.slice(commonPart.length)\n b.prefix = b.prefix.slice(commonPart.length)\n\n node.forks.set(newAFork.prefix[0], newAFork)\n node.forks.set(newBFork.prefix[0], newBFork)\n\n newAFork.node.parent = node\n newBFork.node.parent = node\n\n return new Fork(commonPart, node)\n }\n\n marshal(): Uint8Array {\n if (!this.node.selfAddress) {\n throw Error('Fork#marshal node.selfAddress is not set')\n }\n const data: Uint8Array[] = []\n data.push(new Uint8Array([this.node.determineType()]))\n data.push(Binary.numberToUint8(this.prefix.length))\n data.push(this.prefix)\n\n if (this.prefix.length < 30) {\n data.push(new Uint8Array(30 - this.prefix.length))\n }\n data.push(this.node.selfAddress)\n\n debug('marshalling fork', {\n prefixLength: this.prefix.length,\n prefix: DECODER.decode(this.prefix),\n address: Binary.uint8ArrayToHex(this.node.selfAddress),\n })\n\n if (this.node.metadata) {\n const metadataBytes = Binary.padEndToMultiple(\n new Uint8Array([0x00, 0x00, ...ENCODER.encode(JSON.stringify(this.node.metadata))]),\n 32,\n 0x0a,\n )\n const metadataLengthBytes = Binary.numberToUint16(metadataBytes.length - 2, 'BE')\n metadataBytes.set(metadataLengthBytes, 0)\n data.push(metadataBytes)\n }\n\n return Binary.concatBytes(...data)\n }\n\n static unmarshal(reader: Uint8ArrayReader, addressLength: number): Fork {\n const type = Binary.uint8ToNumber(reader.read(1))\n const prefixLength = Binary.uint8ToNumber(reader.read(1))\n const prefix = reader.read(prefixLength)\n\n if (prefixLength < 30) {\n reader.read(30 - prefixLength)\n }\n const selfAddress = reader.read(addressLength)\n debug('unmarshalling fork', {\n type,\n prefixLength,\n prefix: DECODER.decode(prefix),\n addressLength,\n address: Binary.uint8ArrayToHex(selfAddress),\n })\n let metadata: Record<string, string> | undefined = undefined\n\n if (isType(type, TYPE_WITH_METADATA)) {\n const metadataLength = Binary.uint16ToNumber(reader.read(2), 'BE')\n metadata = JSON.parse(DECODER.decode(reader.read(metadataLength)))\n }\n\n return new Fork(prefix, new MantarayNode({ selfAddress, metadata, path: prefix }))\n }\n}\n\ninterface MantarayNodeOptions {\n selfAddress?: Uint8Array\n targetAddress?: Uint8Array\n obfuscationKey?: Uint8Array\n metadata?: Record<string, string> | null\n path?: Uint8Array | null\n parent?: MantarayNode | null\n}\n\nexport class MantarayNode {\n public obfuscationKey: Uint8Array = new Uint8Array(32)\n public selfAddress: Uint8Array | null = null\n public targetAddress: Uint8Array = new Uint8Array(32)\n public metadata: Record<string, string> | undefined | null = null\n public path: Uint8Array = new Uint8Array(0)\n public forks: Map<number, Fork> = new Map()\n public parent: MantarayNode | null = null\n\n constructor(options?: MantarayNodeOptions) {\n if (options?.targetAddress) {\n this.targetAddress = options.targetAddress\n }\n\n if (options?.selfAddress) {\n this.selfAddress = options.selfAddress\n }\n\n if (options?.metadata) {\n this.metadata = options.metadata\n }\n\n if (options?.obfuscationKey) {\n this.obfuscationKey = options.obfuscationKey\n }\n\n if (options?.path) {\n this.path = options.path\n }\n\n if (options?.parent) {\n this.parent = options.parent\n }\n }\n\n get fullPath(): Uint8Array {\n return Binary.concatBytes(this.parent?.fullPath ?? new Uint8Array(0), this.path)\n }\n\n get fullPathString(): string {\n return DECODER.decode(this.fullPath)\n }\n\n /**\n * Returns the metadata at the `/` path to access idiomatic properties.\n */\n getRootMetadata(): Optional<Record<string, string>> {\n const node = this.find('/')\n\n if (node && node.metadata) {\n return Optional.of(node.metadata)\n }\n\n return Optional.empty()\n }\n\n /**\n * Returns the `swarm-index-document` and `swarm-error-document` metadata values.\n */\n getDocsMetadata(): {\n indexDocument: string | null\n errorDocument: string | null\n } {\n const node = this.find('/')\n\n if (!node || !node.metadata) {\n return { indexDocument: null, errorDocument: null }\n }\n\n return {\n indexDocument: node.metadata['website-index-document'] ?? null,\n errorDocument: node.metadata['website-error-document'] ?? null,\n }\n }\n\n /**\n * Attempts to resolve the manifest as a feed, returning the latest update.\n */\n async resolveFeed(bee: Bee, requestOptions?: BeeRequestOptions): Promise<Optional<FeedPayloadResult>> {\n const node = this.find('/')\n\n if (!node || !node.metadata) {\n return Optional.empty()\n }\n\n const owner = node.metadata['swarm-feed-owner']\n const topic = node.metadata['swarm-feed-topic']\n\n if (!owner || !topic) {\n return Optional.empty()\n }\n\n return Optional.of(await bee.fetchLatestFeedUpdate(topic, owner, requestOptions))\n }\n\n /**\n * Gets the binary representation of the node.\n */\n async marshal(): Promise<Uint8Array> {\n for (const fork of this.forks.values()) {\n if (!fork.node.selfAddress) {\n fork.node.selfAddress = (await fork.node.calculateSelfAddress()).toUint8Array()\n }\n }\n const header = new Uint8Array(32)\n header.set(VERSION_02_HASH, 0)\n header.set(\n Binary.equals(this.targetAddress, NULL_ADDRESS) && Binary.equals(this.path, new Uint8Array([47]))\n ? Binary.numberToUint8(0)\n : Binary.numberToUint8(this.targetAddress.length),\n 31,\n )\n const forkBitmap = new Uint8Array(32)\n for (const fork of this.forks.keys()) {\n Binary.setBit(forkBitmap, fork, 1, 'LE')\n }\n const forks: Uint8Array[] = []\n for (let i = 0; i < 256; i++) {\n if (Binary.getBit(forkBitmap, i, 'LE')) {\n forks.push(this.forks.get(i)!.marshal())\n }\n }\n const data = Binary.xorCypher(\n Binary.concatBytes(\n header,\n Binary.equals(this.targetAddress, NULL_ADDRESS) && Binary.equals(this.path, new Uint8Array([47]))\n ? new Uint8Array(0)\n : this.targetAddress,\n forkBitmap,\n ...forks,\n ),\n this.obfuscationKey,\n )\n\n return Binary.concatBytes(this.obfuscationKey, data)\n }\n\n /**\n * Downloads and unmarshals a MantarayNode from the given reference.\n *\n * Do not forget calling `loadRecursively` on the returned node to load the entire tree.\n */\n static async unmarshal(\n bee: Bee,\n reference: Reference | Uint8Array | string,\n options?: DownloadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<MantarayNode> {\n reference = new Reference(reference)\n const data = (await bee.downloadData(reference, options, requestOptions)).toUint8Array()\n\n return this.unmarshalFromData(data, reference.toUint8Array())\n }\n\n /**\n * Unmarshals a MantarayNode from the given data.\n *\n * Do not forget calling `loadRecursively` on the returned node to load the entire tree.\n */\n static unmarshalFromData(data: Uint8Array, selfAddress: Uint8Array): MantarayNode {\n const obfuscationKey = data.subarray(0, 32)\n const decrypted = Binary.xorCypher(data.subarray(32), obfuscationKey)\n const reader = new Uint8ArrayReader(decrypted)\n const versionHash = reader.read(31)\n\n if (!Binary.equals(versionHash, VERSION_02_HASH.slice(0, 31))) {\n throw new Error('MantarayNode#unmarshal invalid version hash')\n }\n const targetAddressLength = Binary.uint8ToNumber(reader.read(1))\n const targetAddress = targetAddressLength ? reader.read(targetAddressLength) : NULL_ADDRESS\n const node = new MantarayNode({ selfAddress, targetAddress, obfuscationKey })\n const forkBitmap = reader.read(32)\n for (let i = 0; i < 256; i++) {\n if (Binary.getBit(forkBitmap, i, 'LE')) {\n const newFork = Fork.unmarshal(reader, selfAddress.length)\n node.forks.set(i, newFork)\n newFork.node.parent = node\n }\n }\n\n return node\n }\n\n /**\n * Adds a fork to the node.\n */\n addFork(\n path: string | Uint8Array,\n reference: string | Uint8Array | Bytes | Reference,\n metadata?: Record<string, string> | null,\n ) {\n this.selfAddress = null\n path = path instanceof Uint8Array ? path : ENCODER.encode(path)\n debug('adding fork', { path: DECODER.decode(path), reference: new Reference(reference).represent() })\n // TODO: this should not be ignored\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let tip: MantarayNode = this\n while (path.length) {\n const prefix = path.slice(0, 30)\n path = path.slice(30)\n const isLast = path.length === 0\n\n const [bestMatch, matchedPath] = tip.findClosest(prefix)\n const remainingPath = prefix.slice(matchedPath.length)\n\n if (matchedPath.length) {\n tip = bestMatch\n }\n\n if (!remainingPath.length) {\n continue\n }\n\n const newFork = new Fork(\n remainingPath,\n new MantarayNode({\n targetAddress: isLast ? new Reference(reference).toUint8Array() : undefined,\n metadata: isLast ? metadata : undefined,\n path: remainingPath,\n }),\n )\n\n const existing = bestMatch.forks.get(remainingPath[0])\n\n if (existing) {\n const fork = Fork.split(newFork, existing)\n tip.forks.set(remainingPath[0], fork)\n fork.node.parent = tip\n tip.selfAddress = null\n tip = newFork.node\n } else {\n tip.forks.set(remainingPath[0], newFork)\n newFork.node.parent = tip\n tip.selfAddress = null\n tip = newFork.node\n }\n }\n }\n\n /**\n * Removes a fork from the node.\n */\n removeFork(path: string | Uint8Array) {\n this.selfAddress = null\n path = path instanceof Uint8Array ? path : ENCODER.encode(path)\n\n if (path.length === 0) {\n throw Error('MantarayNode#removeFork [path] parameter cannot be empty')\n }\n\n const match = this.find(path)\n\n if (!match) {\n throw Error('MantarayNode#removeFork fork not found')\n }\n\n const [parent, matchedPath] = this.findClosest(path.slice(0, path.length - 1))\n\n parent.forks.delete(path.slice(matchedPath.length)[0])\n for (const fork of match.forks.values()) {\n parent.addFork(Binary.concatBytes(match.path, fork.prefix), fork.node.targetAddress, fork.node.metadata)\n }\n }\n\n /**\n * Calculates the self address of the node.\n */\n async calculateSelfAddress(): Promise<Reference> {\n if (this.selfAddress) {\n return new Reference(this.selfAddress)\n }\n\n return new Reference((await MerkleTree.root(await this.marshal())).hash())\n }\n\n /**\n * Saves the node and its children recursively.\n */\n async saveRecursively(\n bee: Bee,\n postageBatchId: string | BatchId,\n options?: UploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<UploadResult> {\n for (const fork of this.forks.values()) {\n const uploadResult = await fork.node.saveRecursively(bee, postageBatchId, options, requestOptions)\n\n if (options?.act) {\n let historyAddress: Reference | undefined\n uploadResult.historyAddress.ifPresent(ref => (historyAddress = ref))\n\n if (historyAddress) {\n if (!fork.node.metadata) {\n fork.node.metadata = {}\n }\n fork.node.metadata['swarm-act-history-address'] = historyAddress.toHex()\n }\n }\n }\n const result = await bee.uploadData(postageBatchId, await this.marshal(), options, requestOptions)\n this.selfAddress = result.reference.toUint8Array()\n\n return result\n }\n\n /**\n * Loads the node and its children recursively.\n */\n async loadRecursively(bee: Bee, options?: DownloadOptions, requestOptions?: BeeRequestOptions): Promise<void> {\n for (const fork of this.forks.values()) {\n if (!fork.node.selfAddress) {\n throw Error('MantarayNode#loadRecursively fork.node.selfAddress is not set')\n }\n\n let downloadOptions = options\n\n if (fork.node.metadata && fork.node.metadata['swarm-act-history-address']) {\n downloadOptions = {\n ...options,\n actHistoryAddress: fork.node.metadata['swarm-act-history-address'],\n }\n }\n\n const node = await MantarayNode.unmarshal(bee, fork.node.selfAddress, downloadOptions, requestOptions)\n fork.node.targetAddress = node.targetAddress\n fork.node.forks = node.forks\n fork.node.path = fork.prefix\n fork.node.parent = this\n await fork.node.loadRecursively(bee, options, requestOptions)\n }\n }\n\n /**\n * Finds a node in the tree by its path.\n */\n find(path: string | Uint8Array): MantarayNode | null {\n const [closest, match] = this.findClosest(path)\n\n return match.length === path.length ? closest : null\n }\n\n /**\n * Finds the closest node in the tree to the given path.\n */\n findClosest(path: string | Uint8Array, current: Uint8Array = new Uint8Array()): [MantarayNode, Uint8Array] {\n path = path instanceof Uint8Array ? path : ENCODER.encode(path)\n\n if (path.length === 0) {\n return [this, current]\n }\n\n const fork = this.forks.get(path[0])\n\n if (fork && Binary.commonPrefix(fork.prefix, path).length === fork.prefix.length) {\n return fork.node.findClosest(path.slice(fork.prefix.length), Binary.concatBytes(current, fork.prefix))\n }\n\n return [this, current]\n }\n\n /**\n * Returns an array of all nodes in the tree which have a target address set.\n *\n * Must be called after `loadRecursively`.\n */\n collect(nodes: MantarayNode[] = []): MantarayNode[] {\n for (const fork of this.forks.values()) {\n if (!Binary.equals(fork.node.targetAddress, NULL_ADDRESS)) {\n nodes.push(fork.node)\n }\n fork.node.collect(nodes)\n }\n\n return nodes\n }\n\n /**\n * Returns a path:reference map of all nodes in the tree which have a target address set.\n *\n * Must be called after `loadRecursively`.\n */\n collectAndMap(): Record<string, string> {\n const nodes = this.collect()\n const result: Record<string, string> = {}\n\n for (const node of nodes) {\n result[node.fullPathString] = new Reference(node.targetAddress).toHex()\n }\n\n return result\n }\n\n determineType() {\n let type = 0\n\n if (!Binary.equals(this.targetAddress, NULL_ADDRESS) || Binary.equals(this.path, PATH_SEPARATOR)) {\n type |= TYPE_VALUE\n }\n\n if (this.forks.size > 0) {\n type |= TYPE_EDGE\n }\n\n if (Binary.indexOf(this.path, PATH_SEPARATOR) !== -1 && !Binary.equals(this.path, PATH_SEPARATOR)) {\n type |= TYPE_WITH_PATH_SEPARATOR\n }\n\n if (this.metadata) {\n type |= TYPE_WITH_METADATA\n }\n\n return type\n }\n}\n\nfunction isType(value: number, type: number): boolean {\n return (value & type) === type\n}\n","import fs from 'fs'\nimport path from 'path'\nimport { Collection } from '../types'\n\n/**\n * Creates array in the format of Collection with data loaded from directory on filesystem.\n *\n * @param dir path to the directory\n */\nexport async function makeCollectionFromFS(dir: string): Promise<Collection> {\n if (typeof dir !== 'string') {\n throw new TypeError('dir has to be string!')\n }\n\n if (dir === '') {\n throw new TypeError('dir must not be empty string!')\n }\n\n return buildCollectionRelative(dir, '')\n}\n\nasync function buildCollectionRelative(dir: string, relativePath: string): Promise<Collection> {\n const dirname = path.join(dir, relativePath)\n const entries = await fs.promises.opendir(dirname)\n let collection: Collection = []\n\n for await (const entry of entries) {\n const fullPath = path.join(dir, relativePath, entry.name)\n const entryPath = path.join(relativePath, entry.name)\n\n if (entry.isFile()) {\n collection.push({\n path: entryPath,\n size: (await fs.promises.stat(fullPath)).size,\n fsPath: fullPath,\n })\n } else if (entry.isDirectory()) {\n collection = [...(await buildCollectionRelative(dir, entryPath)), ...collection]\n }\n }\n\n return collection\n}\n\n/**\n * Calculate folder size recursively\n *\n * @param dir the path to the folder to check\n * @returns size in bytes\n */\nexport async function getFolderSize(dir: string): Promise<number> {\n if (typeof dir !== 'string') {\n throw new TypeError('dir has to be string!')\n }\n\n if (dir === '') {\n throw new TypeError('dir must not be empty string!')\n }\n\n const entries = await fs.promises.opendir(dir)\n let size = 0\n\n for await (const entry of entries) {\n if (entry.isFile()) {\n const stats = await fs.promises.stat(path.join(dir, entry.name))\n size += stats.size\n } else if (entry.isDirectory()) {\n size += await getFolderSize(path.join(dir, entry.name))\n }\n }\n\n return size\n}\n","export const mimes: Record<string, string> = {\n aac: 'audio/aac',\n abw: 'application/x-abiword',\n ai: 'application/postscript',\n arc: 'application/octet-stream',\n avi: 'video/x-msvideo',\n azw: 'application/vnd.amazon.ebook',\n bin: 'application/octet-stream',\n bz: 'application/x-bzip',\n bz2: 'application/x-bzip2',\n csh: 'application/x-csh',\n css: 'text/css',\n csv: 'text/csv',\n doc: 'application/msword',\n dll: 'application/octet-stream',\n dmg: 'application/x-apple-diskimage',\n eot: 'application/vnd.ms-fontobject',\n epub: 'application/epub+zip',\n gif: 'image/gif',\n htm: 'text/html',\n html: 'text/html',\n ico: 'image/x-icon',\n ics: 'text/calendar',\n jar: 'application/java-archive',\n jpeg: 'image/jpeg',\n jpg: 'image/jpeg',\n js: 'application/javascript',\n json: 'application/json',\n mid: 'audio/midi',\n midi: 'audio/midi',\n mp2: 'audio/mpeg',\n mp3: 'audio/mpeg',\n mp4: 'video/mp4',\n mpa: 'video/mpeg',\n mpe: 'video/mpeg',\n mpeg: 'video/mpeg',\n mpkg: 'application/vnd.apple.installer+xml',\n odp: 'application/vnd.oasis.opendocument.presentation',\n ods: 'application/vnd.oasis.opendocument.spreadsheet',\n odt: 'application/vnd.oasis.opendocument.text',\n oga: 'audio/ogg',\n ogv: 'video/ogg',\n ogx: 'application/ogg',\n otf: 'font/otf',\n png: 'image/png',\n pdf: 'application/pdf',\n ppt: 'application/vnd.ms-powerpoint',\n rar: 'application/x-rar-compressed',\n rtf: 'application/rtf',\n sh: 'application/x-sh',\n svg: 'image/svg+xml',\n swf: 'application/x-shockwave-flash',\n tar: 'application/x-tar',\n tif: 'image/tiff',\n tiff: 'image/tiff',\n ts: 'application/typescript',\n ttf: 'font/ttf',\n txt: 'text/plain',\n vsd: 'application/vnd.visio',\n wav: 'audio/x-wav',\n weba: 'audio/webm',\n webm: 'video/webm',\n webp: 'image/webp',\n woff: 'font/woff',\n woff2: 'font/woff2',\n xhtml: 'application/xhtml+xml',\n xls: 'application/vnd.ms-excel',\n xlsx: 'application/vnd.ms-excel',\n xml: 'application/xml',\n xul: 'application/vnd.mozilla.xul+xml',\n zip: 'application/zip',\n '3gp': 'video/3gpp',\n '3gp2': 'video/3gpp2',\n '7z': 'application/x-7z-compressed',\n}\n","import { AsyncQueue, Chunk, MerkleTree, Strings } from 'cafe-utility'\nimport { createReadStream } from 'fs'\nimport { Bee, BeeRequestOptions, CollectionUploadOptions, NULL_ADDRESS, UploadOptions, UploadResult } from '..'\nimport { MantarayNode } from '../manifest/manifest'\nimport { totalChunks } from './chunk-size'\nimport { makeCollectionFromFS } from './collection.node'\nimport { mimes } from './mime'\nimport { BatchId } from './typed-bytes'\nimport { UploadProgress } from './upload-progress'\n\nexport async function hashDirectory(dir: string) {\n const files = await makeCollectionFromFS(dir)\n const mantaray = new MantarayNode()\n for (const file of files) {\n const tree = new MerkleTree(MerkleTree.NOOP)\n\n if (!file.fsPath) {\n throw Error('File does not have fsPath, which should never happen in node. Please report this issue.')\n }\n const readStream = createReadStream(file.fsPath)\n for await (const data of readStream) {\n await tree.append(data)\n }\n const rootChunk = await tree.finalize()\n const { filename, extension } = Strings.parseFilename(file.path)\n mantaray.addFork(file.path, rootChunk.hash(), {\n 'Content-Type': maybeEnrichMime(mimes[extension.toLowerCase()] || 'application/octet-stream'),\n Filename: filename,\n })\n }\n\n return mantaray.calculateSelfAddress()\n}\n\nexport async function streamDirectory(\n bee: Bee,\n dir: string,\n postageBatchId: BatchId | string | Uint8Array,\n onUploadProgress?: (progress: UploadProgress) => void,\n options?: CollectionUploadOptions,\n requestOptions?: BeeRequestOptions,\n) {\n const queue = new AsyncQueue(64, 64)\n let total = 0\n let processed = 0\n postageBatchId = new BatchId(postageBatchId)\n const files = await makeCollectionFromFS(dir)\n for (const file of files) {\n total += totalChunks(file.size)\n }\n\n let hasIndexHtml = false\n\n async function onChunk(chunk: Chunk) {\n await queue.enqueue(async () => {\n await bee.uploadChunk(postageBatchId, chunk.build(), options, requestOptions)\n onUploadProgress?.({ total, processed: ++processed })\n })\n }\n const mantaray = new MantarayNode()\n for (const file of files) {\n if (!file.fsPath) {\n throw Error('File does not have fsPath, which should never happen in node. Please report this issue.')\n }\n const readStream = createReadStream(file.fsPath)\n\n const tree = new MerkleTree(onChunk)\n for await (const data of readStream) {\n await tree.append(data)\n }\n const rootChunk = await tree.finalize()\n await queue.drain()\n const { filename, extension } = Strings.parseFilename(file.path)\n mantaray.addFork(file.path, rootChunk.hash(), {\n 'Content-Type': maybeEnrichMime(mimes[extension.toLowerCase()] || 'application/octet-stream'),\n Filename: filename,\n })\n\n if (file.path === 'index.html') {\n hasIndexHtml = true\n }\n }\n\n if (hasIndexHtml || options?.indexDocument || options?.errorDocument) {\n const metadata: Record<string, string> = {}\n\n if (options?.indexDocument) {\n metadata['website-index-document'] = options.indexDocument\n } else if (hasIndexHtml) {\n metadata['website-index-document'] = 'index.html'\n }\n\n if (options?.errorDocument) {\n metadata['website-error-document'] = options.errorDocument\n }\n mantaray.addFork('/', NULL_ADDRESS, metadata)\n }\n\n return mantaray.saveRecursively(bee, postageBatchId, options, requestOptions)\n}\n\nfunction maybeEnrichMime(mime: string) {\n if (['text/html', 'text/css'].includes(mime)) {\n return `${mime}; charset=utf-8`\n }\n\n return mime\n}\n\nexport async function streamFiles(\n _bee: Bee,\n _files: File[] | FileList,\n _postageBatchId: BatchId,\n _onUploadProgress?: (progress: UploadProgress) => void,\n _options?: UploadOptions,\n _requestOptions?: BeeRequestOptions,\n): Promise<UploadResult> {\n throw new Error('Streaming files is not supported in Node.js')\n}\n","import type { Data } from 'ws'\n\nfunction isBufferArray(buffer: unknown): buffer is Buffer[] {\n return Array.isArray(buffer) && buffer.length > 0 && buffer.every(data => data instanceof Buffer)\n}\n\nexport async function prepareWebsocketData(data: Data | Blob): Promise<Uint8Array> | never {\n if (typeof data === 'string') {\n return new TextEncoder().encode(data)\n }\n\n if (data instanceof Buffer) {\n return new Uint8Array(data)\n }\n\n if (data instanceof ArrayBuffer) {\n return new Uint8Array(data)\n }\n\n if (isBufferArray(data)) {\n return new Uint8Array(Buffer.concat(data))\n }\n\n throw new TypeError('unknown websocket data type')\n}\n","import { BeeArgumentError } from './error'\n\n/**\n * Validates that passed string is valid URL of Bee.\n * We support only HTTP and HTTPS protocols.\n *\n * @param url\n */\nexport function isValidBeeUrl(url: unknown): url is URL {\n try {\n if (typeof url !== 'string') {\n return false\n }\n\n const urlObject = new URL(url)\n\n // There can be wide range of protocols passed.\n return urlObject.protocol === 'http:' || urlObject.protocol === 'https:'\n } catch (e) {\n return false\n }\n}\n\n/**\n * Validates that passed string is valid URL of Bee, if not it throws BeeArgumentError.\n * We support only HTTP and HTTPS protocols.\n * @param url\n * @throws BeeArgumentError if non valid URL\n */\nexport function assertBeeUrl(url: unknown): asserts url is URL {\n if (!isValidBeeUrl(url)) {\n throw new BeeArgumentError('URL is not valid!', url)\n }\n}\n\n/**\n * Removes trailing slash out of the given string.\n * @param url\n */\nexport function stripLastSlash(url: string): string {\n if (url.endsWith('/')) {\n return url.slice(0, -1)\n }\n\n return url\n}\n","import { Binary, Objects, System, Types } from 'cafe-utility'\nimport { Readable } from 'stream'\nimport { Chunk, makeContentAddressedChunk } from './chunk/cac'\nimport { downloadSingleOwnerChunk, makeSOCAddress, makeSingleOwnerChunk, uploadSingleOwnerChunkData } from './chunk/soc'\nimport { makeFeedReader, makeFeedWriter } from './feed'\nimport { areAllSequentialFeedsUpdateRetrievable } from './feed/retrievable'\nimport * as bytes from './modules/bytes'\nimport * as bzz from './modules/bzz'\nimport * as chunk from './modules/chunk'\nimport * as balance from './modules/debug/balance'\nimport * as chequebook from './modules/debug/chequebook'\nimport * as connectivity from './modules/debug/connectivity'\nimport * as settlements from './modules/debug/settlements'\nimport * as stake from './modules/debug/stake'\nimport * as stamps from './modules/debug/stamps'\nimport * as states from './modules/debug/states'\nimport * as debugStatus from './modules/debug/status'\nimport * as transactions from './modules/debug/transactions'\nimport { postEnvelope } from './modules/envelope'\nimport { FeedPayloadResult, createFeedManifest, fetchLatestFeedUpdate } from './modules/feed'\nimport * as grantee from './modules/grantee'\nimport * as gsoc from './modules/gsoc'\nimport * as pinning from './modules/pinning'\nimport * as pss from './modules/pss'\nimport { rchash } from './modules/rchash'\nimport * as status from './modules/status'\nimport * as stewardship from './modules/stewardship'\nimport * as tag from './modules/tag'\nimport type {\n AllSettlements,\n BalanceResponse,\n BeeOptions,\n BeeRequestOptions,\n BeeVersions,\n ChainState,\n ChequebookAddressResponse,\n ChequebookBalanceResponse,\n CollectionUploadOptions,\n DebugStatus,\n DownloadOptions,\n EnvelopeWithBatchId,\n FeedReader,\n FeedWriter,\n FileData,\n FileUploadOptions,\n GetGranteesResult,\n GlobalPostageBatch,\n GranteesResult,\n GsocMessageHandler,\n GsocSubscription,\n Health,\n LastCashoutActionResponse,\n LastChequesForPeerResponse,\n LastChequesResponse,\n NodeAddresses,\n NodeInfo,\n NumberString,\n Peer,\n PeerBalance,\n Pin,\n PingResponse,\n PostageBatch,\n PostageBatchBuckets,\n PssMessageHandler,\n PssSubscription,\n Readiness,\n RedistributionState,\n RedundancyLevel,\n RedundantUploadOptions,\n ReferenceInformation,\n RemovePeerResponse,\n ReserveState,\n SOCReader,\n SOCWriter,\n Settlements,\n Tag,\n Topology,\n TransactionInfo,\n UploadOptions,\n WalletBalance,\n} from './types'\nimport {\n AllTagsOptions,\n CHUNK_SIZE,\n Collection,\n PostageBatchOptions,\n STAMPS_DEPTH_MAX,\n STAMPS_DEPTH_MIN,\n TransactionOptions,\n UploadResult,\n} from './types'\nimport { Bytes } from './utils/bytes'\nimport { hashDirectory, streamDirectory, streamFiles } from './utils/chunk-stream'\nimport { assertCollection, makeCollectionFromFileList } from './utils/collection'\nimport { makeCollectionFromFS } from './utils/collection.node'\nimport { prepareWebsocketData } from './utils/data'\nimport { Duration } from './utils/duration'\nimport { BeeArgumentError, BeeError } from './utils/error'\nimport { fileArrayBuffer, isFile } from './utils/file'\nimport { ResourceLocator } from './utils/resource-locator'\nimport { Size } from './utils/size'\nimport { getAmountForDuration, getDepthForSize, getStampCost } from './utils/stamps'\nimport { BZZ, DAI } from './utils/tokens'\nimport {\n asNumberString,\n assertData,\n assertFileData,\n makeTagUid,\n prepareAllTagsOptions,\n prepareBeeRequestOptions,\n prepareCollectionUploadOptions,\n prepareDownloadOptions,\n prepareFileUploadOptions,\n prepareGsocMessageHandler,\n preparePostageBatchOptions,\n preparePssMessageHandler,\n prepareRedundantUploadOptions,\n prepareTransactionOptions,\n prepareUploadOptions,\n} from './utils/type'\nimport {\n BatchId,\n EthAddress,\n FeedIndex,\n Identifier,\n PeerAddress,\n PrivateKey,\n PublicKey,\n Reference,\n Span,\n Topic,\n TransactionId,\n} from './utils/typed-bytes'\nimport { UploadProgress } from './utils/upload-progress'\nimport { assertBeeUrl, stripLastSlash } from './utils/url'\n\n/**\n * The main component that abstracts operations available on the Bee API.\n *\n * Instantiate with `new Bee(url, options)` where `url` is the Bee node URL and `options` are optional parameters.\n *\n * @example\n * const bee = new Bee('http://localhost:1633')\n */\nexport class Bee {\n /**\n * Bee node API URL.\n *\n * @example\n * `http://localhost:1633`\n */\n public readonly url: string\n\n /**\n * Default signer (a private key) used for signing.\n *\n * Mainly used in single-owner chunk (SOC) related operations, and consequently in feeds.\n *\n * If not provided, methods such as `makeFeedWriter` and `makeSOCWriter`\n * must be provided with a private key in their respective function calls.\n */\n public readonly signer?: PrivateKey\n\n /**\n * Network on which the Bee node is running.\n *\n * This is currently used to determine block time for postage batch time-to-live (TTL) calculations.\n * The block time for `gnosis` is `5` seconds, and for `sepolia` it is `15` seconds.\n *\n * @default 'gnosis'\n */\n public readonly network: 'gnosis' | 'sepolia'\n\n /**\n * Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n private readonly requestOptions: BeeRequestOptions\n\n /**\n * @param url URL on which is the main API of Bee node exposed\n * @param options\n *\n * @example\n * const bee = new Bee('http://localhost:1633')\n */\n constructor(url: string, options?: BeeOptions) {\n assertBeeUrl(url)\n\n this.url = stripLastSlash(url)\n\n if (options?.signer) {\n this.signer = new PrivateKey(options.signer)\n }\n\n this.network = options?.network ?? 'gnosis'\n\n this.requestOptions = {\n baseURL: this.url,\n timeout: options?.timeout ?? 0,\n headers: options?.headers,\n onRequest: options?.onRequest,\n httpAgent: options?.httpAgent,\n httpsAgent: options?.httpsAgent,\n }\n }\n\n /**\n * Uploads raw data to the network (as opposed to uploading chunks or files).\n *\n * Data uploaded with this method should be retrieved with the {@link downloadData} method.\n *\n * @param postageBatchId Usable Postage Batch ID with sufficient capacity to upload the data.\n * @param data A `string` (text data) or `Uint8Array` (raw data) to be uploaded.\n * @param options Additional options like tag, encryption, pinning, content-type and request options.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @returns reference is a content hash of the data\n *\n * @see [Bee API reference - `POST /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes/post)\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n */\n async uploadData(\n postageBatchId: BatchId | Uint8Array | string,\n data: string | Uint8Array,\n options?: RedundantUploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<UploadResult> {\n postageBatchId = new BatchId(postageBatchId)\n assertData(data)\n\n if (options) {\n options = prepareRedundantUploadOptions(options)\n }\n\n return bytes.upload(this.getRequestOptionsForCall(requestOptions), data, postageBatchId, options)\n }\n\n /**\n * Fetches content length for a `/bytes` reference.\n *\n * @param reference\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee API reference - `HEAD /bytes/{reference}`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1%7Breference%7D/head)\n */\n async probeData(\n reference: Reference | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<ReferenceInformation> {\n reference = new Reference(reference)\n\n return bytes.head(this.getRequestOptionsForCall(requestOptions), reference)\n }\n\n /**\n * Downloads raw data through the `GET /bytes/{reference}` endpoint.\n *\n * This method may be used to download data that was uploaded with the {@link uploadData} method.\n *\n * For downloading files or using the `GET /bzz/{reference}/` endpoint, use the {@link downloadFile} method instead.\n * For downloading chunks or using the `GET /chunks/{reference} endpoint, use the `downloadChunk` method instead.\n *\n * @param resource Swarm reference, Swarm CID, or ENS domain.\n * @param options Options that affects the request behavior\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @throws TypeError if some of the input parameters is not expected type\n * @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters\n *\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n * @see [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get)\n */\n async downloadData(\n resource: Reference | string | Uint8Array,\n options?: DownloadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<Bytes> {\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n return bytes.download(this.getRequestOptionsForCall(requestOptions), new ResourceLocator(resource), options)\n }\n\n /**\n * Download raw data through the `GET /bytes/{reference}` endpoint.\n *\n * This method may be used to download data that was uploaded with the {@link uploadData} method.\n *\n * Only tested in Node.js environment.\n *\n * @param resource Swarm reference, Swarm CID, or ENS domain.\n * @param options Options that affects the request behavior.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @returns ReadableStream of Uint8Array\n *\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n * @see [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get)\n */\n async downloadReadableData(\n resource: Reference | Uint8Array | string,\n options?: DownloadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<ReadableStream<Uint8Array>> {\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n return bytes.downloadReadable(this.getRequestOptionsForCall(requestOptions), new ResourceLocator(resource), options)\n }\n\n /**\n * Uploads a chunk to the network.\n *\n * Chunks uploaded with this method should be retrieved with the {@link downloadChunk} method.\n *\n * @param stamp Postage Batch ID or an Envelope created with the {@link createEnvelope} method.\n * @param data Raw chunk to be uploaded\n * @param options Additional options like tag, encryption, pinning, content-type and request options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @returns reference is a content hash of the data\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n * @see [Bee API reference - `POST /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post)\n */\n async uploadChunk(\n stamp: EnvelopeWithBatchId | BatchId | Uint8Array | string,\n data: Uint8Array | Chunk,\n options?: UploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<UploadResult> {\n data = data instanceof Uint8Array ? data : data.data\n\n if (options) {\n options = prepareUploadOptions(options)\n }\n\n if (data.length < Span.LENGTH) {\n throw new BeeArgumentError(`Chunk has to have size of at least ${Span.LENGTH}.`, data)\n }\n\n if (data.length > CHUNK_SIZE + Span.LENGTH) {\n throw new BeeArgumentError(`Chunk has to have size of at most ${CHUNK_SIZE + Span.LENGTH}.`, data)\n }\n\n return chunk.upload(this.getRequestOptionsForCall(requestOptions), data, stamp, options)\n }\n\n /**\n * Downloads a chunk as a `Uint8Array`.\n *\n * May be used to download chunks uploaded with the {@link uploadChunk} method.\n *\n * Use {@link downloadData} method to download raw data uploaded with the {@link uploadData} method.\n * Use {@link downloadFile} method to download files uploaded with the {@link uploadFile} method.\n *\n * @param reference Bee chunk reference in hex string (either 64 or 128 chars long) or ENS domain.\n * @param options Options that affects the request behavior\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n * @see [Bee API reference - `GET /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks~1{address}/get)\n */\n async downloadChunk(\n reference: Reference | Uint8Array | string,\n options?: DownloadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<Uint8Array> {\n reference = new Reference(reference)\n\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n return chunk.download(this.getRequestOptionsForCall(requestOptions), reference, options)\n }\n\n /**\n * Create a grantees list from the given array of public keys.\n *\n * The grantees list can be obtained with the {@link getGrantees} method.\n *\n * @param postageBatchId - The ID of the postage batch.\n * @param grantees - An array of public keys representing the grantees.\n * @param requestOptions - Optional request options.\n * @returns A promise that resolves to a `GranteesResult` object.\n */\n async createGrantees(\n postageBatchId: BatchId | Uint8Array | string,\n grantees: PublicKey[] | Uint8Array[] | string[],\n requestOptions?: BeeRequestOptions,\n ): Promise<GranteesResult> {\n postageBatchId = new BatchId(postageBatchId)\n grantees = grantees.map(x => new PublicKey(x))\n\n return grantee.createGrantees(this.getRequestOptionsForCall(requestOptions), postageBatchId, grantees)\n }\n\n /**\n * Retrieves the grantees for a given reference.\n *\n * @param reference - The reference.\n * @param requestOptions - Optional request options.\n * @returns A promise that resolves to a `GetGranteesResult` object.\n */\n async getGrantees(\n reference: Reference | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<GetGranteesResult> {\n reference = new Reference(reference)\n\n return grantee.getGrantees(reference, this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Updates the grantees of a specific reference and history.\n *\n * @param reference - The reference.\n * @param history - The history.\n * @param postageBatchId - The ID of the postage batch.\n * @param grantees - The grantees.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns A Promise that resolves to to a `GranteesResult` object.\n */\n async patchGrantees(\n postageBatchId: BatchId | Uint8Array | string,\n reference: Reference | Uint8Array | string,\n history: Reference | Uint8Array | string,\n grantees: { add?: PublicKey[] | Uint8Array[] | string[]; revoke?: PublicKey[] | Uint8Array[] | string[] },\n requestOptions?: BeeRequestOptions,\n ): Promise<GranteesResult> {\n postageBatchId = new BatchId(postageBatchId)\n reference = new Reference(reference)\n history = new Reference(history)\n\n const publicKeys = {\n add: grantees.add?.map(x => new PublicKey(x)) ?? [],\n revoke: grantees.revoke?.map(x => new PublicKey(x)) ?? [],\n }\n\n return grantee.patchGrantees(\n postageBatchId,\n reference,\n history,\n publicKeys,\n this.getRequestOptionsForCall(requestOptions),\n )\n }\n\n /**\n * Uploads a single file to a Bee node.\n *\n * To download the file, use the {@link downloadFile} method.\n *\n * Use {@link uploadData} method to upload raw data that can be downloaded with the {@link downloadData} method.\n * Use {@link uploadChunk} method to upload chunks that can be downloaded with the {@link downloadChunk} method.\n *\n * @param postageBatchId Postage BatchId to be used to upload the data with\n * @param data Data or file to be uploaded\n * @param name Optional name of the uploaded file\n * @param options Additional options like tag, encryption, pinning, content-type and request options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n * @returns reference is a content hash of the file\n */\n async uploadFile(\n postageBatchId: BatchId | Uint8Array | string,\n data: string | Uint8Array | Readable | File,\n name?: string,\n options?: FileUploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<UploadResult> {\n postageBatchId = new BatchId(postageBatchId)\n assertFileData(data)\n\n if (options) {\n options = prepareFileUploadOptions(options)\n }\n\n if (name && typeof name !== 'string') {\n throw new TypeError('name has to be string or undefined!')\n }\n\n if (isFile(data)) {\n const fileData = await fileArrayBuffer(data)\n const fileName = name ?? data.name\n const contentType = data.type\n const fileOptions = { contentType, ...options }\n\n return bzz.uploadFile(\n this.getRequestOptionsForCall(requestOptions),\n fileData,\n postageBatchId,\n fileName,\n fileOptions,\n )\n } else {\n return bzz.uploadFile(this.getRequestOptionsForCall(requestOptions), data, postageBatchId, name, options)\n }\n }\n\n /**\n * Downloads a single file.\n *\n * @param resource Swarm reference, Swarm CID, or ENS domain.\n * @param path If reference points to manifest, then this parameter defines path to the file\n * @param options Options that affects the request behavior\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n * @see [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get)\n */\n async downloadFile(\n resource: Reference | Uint8Array | string,\n path = '',\n options?: DownloadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<FileData<Bytes>> {\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n return bzz.downloadFile(this.getRequestOptionsForCall(requestOptions), new ResourceLocator(resource), path, options)\n }\n\n /**\n * Download single file as a readable stream\n *\n * @param reference Bee file reference in hex string (either 64 or 128 chars long), ENS domain or Swarm CID.\n * @param path If reference points to manifest / collections, then this parameter defines path to the file\n * @param options Options that affects the request behavior\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n * @see [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get)\n */\n async downloadReadableFile(\n reference: Reference | Uint8Array | string,\n path = '',\n options?: DownloadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<FileData<ReadableStream<Uint8Array>>> {\n reference = new Reference(reference)\n\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n return bzz.downloadFileReadable(this.getRequestOptionsForCall(requestOptions), reference, path, options)\n }\n\n /**\n * Upload collection of files to a Bee node\n *\n * Uses the FileList API from the browser.\n *\n * The returned `UploadResult.tag` might be undefined if called in CORS-enabled environment.\n * This will be fixed upon next Bee release. https://github.com/ethersphere/bee-js/issues/406\n *\n * @param postageBatchId Postage BatchId to be used to upload the data with\n * @param fileList list of files to be uploaded\n * @param options Additional options like tag, encryption, pinning and request options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee docs - Upload directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory)\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n */\n async uploadFiles(\n postageBatchId: BatchId | Uint8Array | string,\n fileList: FileList | File[],\n options?: CollectionUploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<UploadResult> {\n postageBatchId = new BatchId(postageBatchId)\n\n if (options) {\n options = prepareCollectionUploadOptions(options)\n }\n\n const data = makeCollectionFromFileList(fileList)\n\n return bzz.uploadCollection(this.getRequestOptionsForCall(requestOptions), data, postageBatchId, options)\n }\n\n /**\n * Hashes a directory locally and returns the root hash (Swarm reference).\n *\n * The actual Swarm reference may be different as there is no canonical hashing of directories.\n * For example, metadata may have different casing, or the order of metadata may differ.\n * Such small differences will result in different Swarm references.\n *\n * Different implementations of the Mantaray structure may also result in different Swarm references.\n *\n * @param dir\n * @returns\n */\n async hashDirectory(dir: string) {\n return hashDirectory(dir)\n }\n\n /**\n * Uploads a directory to the network. The difference between this method and {@link uploadFilesFromDirectory} is that\n * this method streams the directory contents directly to the Bee node, which supports arbitrary directory sizes,\n * but may be slower due to uploading chunks one by one.\n *\n * Options such as encryption, erasure coding and ACT are not yet available for this method.\n *\n * Only intended for the Node.js environment.\n *\n * @param postageBatchId\n * @param dir\n * @param onUploadProgress\n * @param options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async streamDirectory(\n postageBatchId: BatchId | Uint8Array | string,\n dir: string,\n onUploadProgress?: (progress: UploadProgress) => void,\n options?: CollectionUploadOptions,\n requestOptions?: BeeRequestOptions,\n ) {\n postageBatchId = new BatchId(postageBatchId)\n\n return streamDirectory(\n this,\n dir,\n postageBatchId,\n onUploadProgress,\n options,\n this.getRequestOptionsForCall(requestOptions),\n )\n }\n\n /**\n * Uploads a collection of files to the network. The difference between this method and {@link uploadFiles} is that\n * this method streams the files to the Bee node, which supports arbitrary sizes,\n * but may be slower due to uploading chunks one by one.\n *\n * Options such as encryption, erasure coding and ACT are not yet available for this method.\n *\n * Only intended for the browser environment.\n *\n * @param postageBatchId\n * @param files\n * @param onUploadProgress\n * @param options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async streamFiles(\n postageBatchId: BatchId | Uint8Array | string,\n files: File[] | FileList,\n onUploadProgress?: (progress: UploadProgress) => void,\n options?: UploadOptions,\n requestOptions?: BeeRequestOptions,\n ) {\n postageBatchId = new BatchId(postageBatchId)\n\n return streamFiles(\n this,\n files,\n postageBatchId,\n onUploadProgress,\n options,\n this.getRequestOptionsForCall(requestOptions),\n )\n }\n\n /**\n * Upload Collection that you can assembly yourself.\n *\n * The returned `UploadResult.tag` might be undefined if called in CORS-enabled environment.\n * This will be fixed upon next Bee release. https://github.com/ethersphere/bee-js/issues/406\n *\n * @param postageBatchId\n * @param collection\n * @param options Collections and request options\n */\n async uploadCollection(\n postageBatchId: BatchId | Uint8Array | string,\n collection: Collection,\n options?: CollectionUploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<UploadResult> {\n postageBatchId = new BatchId(postageBatchId)\n assertCollection(collection)\n\n if (options) {\n options = prepareCollectionUploadOptions(options)\n }\n\n return bzz.uploadCollection(this.getRequestOptionsForCall(requestOptions), collection, postageBatchId, options)\n }\n\n /**\n * Upload collection of files.\n *\n * Available only in Node.js as it uses the `fs` module.\n *\n * The returned `UploadResult.tag` might be undefined if called in CORS-enabled environment.\n * This will be fixed upon next Bee release. https://github.com/ethersphere/bee-js/issues/406\n *\n * @param postageBatchId Postage BatchId to be used to upload the data with\n * @param dir the path of the files to be uploaded\n * @param options Additional options like tag, encryption, pinning and request options\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee docs - Upload directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory)\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n */\n async uploadFilesFromDirectory(\n postageBatchId: BatchId | Uint8Array | string,\n dir: string,\n options?: CollectionUploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<UploadResult> {\n postageBatchId = new BatchId(postageBatchId)\n\n if (options) {\n options = prepareCollectionUploadOptions(options)\n }\n\n const data = await makeCollectionFromFS(dir)\n\n return bzz.uploadCollection(this.getRequestOptionsForCall(requestOptions), data, postageBatchId, options)\n }\n\n /**\n * Creates a new Tag which is meant for tracking upload and synchronization progress.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)\n * @see [Bee API reference - `POST /tags`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/post)\n */\n async createTag(requestOptions?: BeeRequestOptions): Promise<Tag> {\n return tag.createTag(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Fetches all tags in a paginated manner.\n *\n * The listing is limited by options.limit. So you have to iterate using options.offset to get all tags.\n *\n * @param options Specify `limit` and `offset` to paginate through the tags.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)\n * @see [Bee API reference - `GET /tags`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/get)\n */\n async getAllTags(options?: AllTagsOptions, requestOptions?: BeeRequestOptions): Promise<Tag[]> {\n if (options) {\n options = prepareAllTagsOptions(options)\n }\n\n return tag.getAllTags(this.getRequestOptionsForCall(requestOptions), options?.offset, options?.limit)\n }\n\n /**\n * Retrieves tag information from Bee node.\n *\n * @param tagUid UID or tag object to be retrieved\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)\n * @see [Bee API reference - `GET /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/get)\n *\n */\n async retrieveTag(tagUid: number | Tag, requestOptions?: BeeRequestOptions): Promise<Tag> {\n tagUid = makeTagUid(tagUid)\n\n return tag.retrieveTag(this.getRequestOptionsForCall(requestOptions), tagUid)\n }\n\n /**\n * Deletes Tag.\n *\n * @param tagUid UID or tag object to be retrieved\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)\n * @see [Bee API reference - `DELETE /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/delete)\n */\n async deleteTag(tagUid: number | Tag, requestOptions?: BeeRequestOptions): Promise<void> {\n tagUid = makeTagUid(tagUid)\n\n return tag.deleteTag(this.getRequestOptionsForCall(requestOptions), tagUid)\n }\n\n /**\n * Update tag's total chunks count.\n *\n * This is important if you are uploading individual chunks with a tag. Then upon finishing the final root chunk,\n * you can use this method to update the total chunks count for the tag.\n *\n * @param tagUid UID or tag object to be retrieved\n * @param reference The root reference that contains all the chunks to be counted\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)\n * @see [Bee API reference - `PATCH /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/patch)\n */\n async updateTag(\n tagUid: number | Tag,\n reference: Reference | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<void> {\n reference = new Reference(reference)\n\n tagUid = makeTagUid(tagUid)\n\n return tag.updateTag(this.getRequestOptionsForCall(requestOptions), tagUid, reference)\n }\n\n /**\n * Pins local data with given reference.\n *\n * @param reference Data reference\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)\n */\n async pin(reference: Reference | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<void> {\n reference = new Reference(reference)\n\n return pinning.pin(this.getRequestOptionsForCall(requestOptions), reference)\n }\n\n /**\n * Unpins local data with given reference.\n *\n * @param reference Data reference\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)\n */\n async unpin(reference: Reference | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<void> {\n reference = new Reference(reference)\n\n return pinning.unpin(this.getRequestOptionsForCall(requestOptions), reference)\n }\n\n /**\n * Gets list of all locally pinned references.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)\n */\n async getAllPins(requestOptions?: BeeRequestOptions): Promise<Reference[]> {\n return pinning.getAllPins(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Get pinning status of chunk with given reference\n *\n * @param reference Bee data reference in hex string (either 64 or 128 chars long) or ENS domain.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)\n */\n async getPin(reference: Reference | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<Pin> {\n reference = new Reference(reference)\n\n return pinning.getPin(this.getRequestOptionsForCall(requestOptions), reference)\n }\n\n /**\n * Instructs the Bee node to reupload a locally pinned data into the network.\n *\n * @param postageBatchId Postage Batch ID that will be used to re-upload the data.\n * @param reference Bee data reference to be re-uploaded in hex string (either 64 or 128 chars long) or ENS domain.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee API reference - `PUT /stewardship`](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1{reference}/put)\n */\n async reuploadPinnedData(\n postageBatchId: BatchId | Uint8Array | string,\n reference: Reference | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<void> {\n postageBatchId = new BatchId(postageBatchId)\n reference = new Reference(reference)\n\n await stewardship.reupload(this.getRequestOptionsForCall(requestOptions), postageBatchId, reference)\n }\n\n /**\n * Checks if content specified by reference is retrievable from the network.\n *\n * @param reference Bee data reference to be checked in hex string (either 64 or 128 chars long) or ENS domain.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee API reference - `GET /stewardship`](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1{reference}/get)\n */\n async isReferenceRetrievable(\n reference: Reference | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<boolean> {\n reference = new Reference(reference)\n\n return stewardship.isRetrievable(this.getRequestOptionsForCall(requestOptions), reference)\n }\n\n /**\n * Functions that validate if feed is retrievable in the network.\n *\n * If no index is passed then it check for \"latest\" update, which is a weaker guarantee as nobody can be really\n * sure what is the \"latest\" update.\n *\n * If index is passed then it validates all previous sequence index chunks if they are available as they are required\n * to correctly resolve the feed upto the given index update.\n *\n * @param type\n * @param owner\n * @param topic\n * @param index\n * @param options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async isFeedRetrievable(\n owner: EthAddress | Uint8Array | string,\n topic: Topic | Uint8Array | string,\n index?: FeedIndex,\n options?: DownloadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<boolean> {\n owner = new EthAddress(owner)\n topic = new Topic(topic)\n\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n if (!index) {\n try {\n await this.makeFeedReader(topic, owner, requestOptions).download()\n\n return true\n } catch (e: unknown) {\n const status = Objects.getDeep(e, 'status')\n\n if (status === 404 || status === 500) {\n return false\n }\n\n throw e\n }\n }\n\n return areAllSequentialFeedsUpdateRetrievable(\n this,\n owner,\n topic,\n index,\n options,\n this.getRequestOptionsForCall(requestOptions),\n )\n }\n\n /**\n * Send data to recipient or target with Postal Service for Swarm.\n *\n * Because sending a PSS message is slow and CPU intensive,\n * it is not supposed to be used for general messaging but\n * most likely for setting up an encrypted communication\n * channel by sending an one-off message.\n *\n * **Warning! Only full nodes can accept PSS messages.**\n *\n * @param postageBatchId Postage BatchId that will be assigned to sent message\n * @param topic Topic name\n * @param target Target message address prefix. Has a limit on length. Recommend to use `Utils.Pss.makeMaxTarget()` to get the most specific target that Bee node will accept.\n * @param data Message to be sent\n * @param recipient Recipient public key\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)\n * @see [Bee API reference - `POST /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1send~1{topic}~1{targets}/post)\n */\n async pssSend(\n postageBatchId: BatchId | Uint8Array | string,\n topic: Topic,\n target: string,\n data: string | Uint8Array,\n recipient?: string | PublicKey,\n requestOptions?: BeeRequestOptions,\n ): Promise<void> {\n postageBatchId = new BatchId(postageBatchId)\n assertData(data)\n\n if (recipient) {\n recipient = new PublicKey(recipient)\n\n return pss.send(this.getRequestOptionsForCall(requestOptions), topic, target, data, postageBatchId, recipient)\n } else {\n return pss.send(this.getRequestOptionsForCall(requestOptions), topic, target, data, postageBatchId)\n }\n }\n\n /**\n * Subscribes to messages for given topic with the Postal Service for Swarm.\n *\n * **Warning! Only full nodes can accept PSS messages.**\n *\n * @param topic Topic name\n * @param handler Message handler interface\n *\n * @returns Subscription to a given topic\n *\n * @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)\n * @see [Bee API reference - `GET /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1{topic}/get)\n */\n pssSubscribe(topic: Topic, handler: PssMessageHandler): PssSubscription {\n handler = preparePssMessageHandler(handler)\n\n const ws = pss.subscribe(this.url, topic, this.requestOptions.headers)\n\n let cancelled = false\n const cancel = () => {\n if (!cancelled) {\n cancelled = true\n\n if (ws.terminate) {\n ws.terminate()\n } else {\n ws.close()\n }\n }\n }\n\n const subscription = {\n topic,\n cancel,\n }\n\n ws.onmessage = async event => {\n const data = await prepareWebsocketData(event.data)\n\n if (data.length) {\n handler.onMessage(new Bytes(data), subscription)\n }\n }\n ws.onerror = event => {\n if (!cancelled) {\n handler.onError(new BeeError(event.message), subscription)\n }\n }\n ws.onclose = () => {\n handler.onClose(subscription)\n }\n\n return subscription\n }\n\n /**\n * Receives message using the Postal Service for Swarm.\n *\n * This is a helper function to wait for exactly one message to\n * arrive and then cancel the subscription. Additionally a\n * timeout can be provided for the message to arrive or else\n * an error will be thrown.\n *\n * **Warning! Only full nodes can accept PSS messages.**\n *\n * @param topic Topic name\n * @param timeoutMsec Timeout in milliseconds\n *\n * @returns Message in byte array\n *\n * @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)\n * @see [Bee API reference - `GET /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1{topic}/get)\n */\n async pssReceive(topic: Topic, timeoutMsec = 0): Promise<Bytes> {\n if (typeof timeoutMsec !== 'number') {\n throw new TypeError('timeoutMsc parameter has to be a number!')\n }\n\n return new Promise((resolve, reject) => {\n let timeout: ReturnType<typeof setTimeout> | undefined\n const subscription = this.pssSubscribe(topic, {\n onError: error => {\n clearTimeout(timeout)\n subscription.cancel()\n reject(error.message)\n },\n onMessage: message => {\n clearTimeout(timeout)\n subscription.cancel()\n resolve(message)\n },\n onClose: () => {\n clearTimeout(timeout)\n subscription.cancel()\n },\n })\n\n if (timeoutMsec > 0) {\n timeout = setTimeout(() => {\n subscription.cancel()\n reject(new BeeError('pssReceive timeout'))\n }, timeoutMsec)\n }\n })\n }\n\n /**\n * Mines the signer (a private key) to be used to send GSOC messages to the specific target overlay address.\n *\n * Use {@link gsocSend} to send GSOC messages with the mined signer.\n *\n * Use {@link gsocSubscribe} to subscribe to GSOC messages for the specified owner (of the signer) and identifier.\n *\n * See {@link gsocSend} or {@link gsocSubscribe} for concrete examples of usage.\n *\n * **Warning! Only full nodes can accept GSOC messages.**\n *\n * @param targetOverlay\n * @param identifier\n * @param proximity\n * @returns\n */\n gsocMine(\n targetOverlay: PeerAddress | Uint8Array | string,\n identifier: Identifier | Uint8Array | string,\n proximity = 12,\n ): PrivateKey {\n targetOverlay = new PeerAddress(targetOverlay)\n identifier = new Identifier(identifier)\n const start = 0xb33n\n for (let i = 0n; i < 0xffffn; i++) {\n const signer = new PrivateKey(Binary.numberToUint256(start + i, 'BE'))\n const socAddress = makeSOCAddress(identifier, signer.publicKey().address())\n // TODO: test the significance of the hardcoded 256\n const actualProximity = 256 - Binary.proximity(socAddress.toUint8Array(), targetOverlay.toUint8Array())\n\n if (actualProximity <= 256 - proximity) {\n return signer\n }\n }\n throw Error('Could not mine a valid signer')\n }\n\n /**\n * Sends a GSOC message with the specified signer and identifier.\n *\n * Use {@link gsocMine} to mine a signer for the target overlay address.\n *\n * Use {@link gsocSubscribe} to subscribe to GSOC messages for the specified owner (of the signer) and identifier.\n *\n * **Warning! Only full nodes can accept GSOC messages.**\n *\n * @param postageBatchId\n * @param signer\n * @param identifier\n * @param data\n * @param options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n *\n * @example\n * const identifier = NULL_IDENTIFIER\n * const overlay = '0x1234567890123456789012345678901234567890'\n * const signer = bee.gsocMine(overlay, identifier)\n * await bee.gsocSend(postageBatchId, signer, identifier, 'GSOC!')\n */\n async gsocSend(\n postageBatchId: BatchId | Uint8Array | string,\n signer: PrivateKey | Uint8Array | string,\n identifier: Identifier | Uint8Array | string,\n data: string | Uint8Array,\n options?: UploadOptions,\n requestOptions?: BeeRequestOptions,\n ) {\n postageBatchId = new BatchId(postageBatchId)\n signer = new PrivateKey(signer)\n identifier = new Identifier(identifier)\n\n const cac = makeContentAddressedChunk(data)\n const soc = makeSingleOwnerChunk(cac, identifier, signer)\n\n return gsoc.send(this.getRequestOptionsForCall(requestOptions), soc, postageBatchId, options)\n }\n\n /**\n * Subscribes to GSOC messages for the specified owner (of the signer) and identifier.\n *\n * Use {@link gsocMine} to mine a signer for the target overlay address.\n *\n * Use {@link gsocSend} to send GSOC messages with the mined signer.\n *\n * **Warning! Only full nodes can accept GSOC messages.**\n *\n * @param address\n * @param identifier\n * @param handler\n * @returns\n *\n * @example\n * const identifier = NULL_IDENTIFIER\n * const { overlay } = await bee.getNodeAddresses()\n * const signer = bee.gsocMine(overlay, identifier)\n *\n * const subscription = bee.gsocSubscribe(signer.publicKey().address(), identifier, {\n * onMessage(message) {\n * // handle\n * },\n * onError(error) {\n * // handle\n * },\n * onClose() {\n * // handle\n * }\n * })\n */\n gsocSubscribe(\n address: EthAddress | Uint8Array | string,\n identifier: Identifier | Uint8Array | string,\n handler: GsocMessageHandler,\n ): GsocSubscription {\n address = new EthAddress(address)\n identifier = new Identifier(identifier)\n handler = prepareGsocMessageHandler(handler)\n\n const socAddress = makeSOCAddress(identifier, address)\n\n const ws = gsoc.subscribe(this.url, socAddress, this.requestOptions.headers)\n\n let cancelled = false\n const cancel = () => {\n if (!cancelled) {\n cancelled = true\n\n if (ws.terminate) {\n ws.terminate()\n } else {\n ws.close()\n }\n }\n }\n\n const subscription = {\n address,\n cancel,\n }\n\n ws.onmessage = async event => {\n const data = await prepareWebsocketData(event.data)\n\n if (data.length) {\n handler.onMessage(new Bytes(data), subscription)\n }\n }\n ws.onerror = event => {\n if (!cancelled) {\n handler.onError(new BeeError(event.message), subscription)\n }\n }\n ws.onclose = () => {\n handler.onClose(subscription)\n }\n\n return subscription\n }\n\n /**\n * Creates a feed manifest chunk and returns the reference to it.\n *\n * Feed manifest chunks allow for a feed to be able to be resolved through `/bzz` endpoint.\n *\n * @param postageBatchId Postage BatchId to be used to create the Feed Manifest\n * @param topic Topic in hex or bytes\n * @param owner Owner's ethereum address in hex or bytes\n * @param options Options that affects the request behavior\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)\n * @see [Bee API reference - `POST /feeds`](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post)\n */\n async createFeedManifest(\n postageBatchId: BatchId | Uint8Array | string,\n topic: Topic | Uint8Array | string,\n owner: EthAddress | Uint8Array | string,\n options?: UploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<Reference> {\n postageBatchId = new BatchId(postageBatchId)\n topic = new Topic(topic)\n owner = new EthAddress(owner)\n\n if (options) {\n options = prepareUploadOptions(options)\n }\n\n return createFeedManifest(this.getRequestOptionsForCall(requestOptions), owner, topic, postageBatchId, options)\n }\n\n /**\n * Makes a new feed reader for downloading feed updates.\n *\n * @param topic Topic in hex or bytes\n * @param owner Owner's ethereum address in hex or bytes\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)\n */\n makeFeedReader(\n topic: Topic | Uint8Array | string,\n owner: EthAddress | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): FeedReader {\n topic = new Topic(topic)\n owner = new EthAddress(owner)\n\n return makeFeedReader(this.getRequestOptionsForCall(requestOptions), topic, owner)\n }\n\n /**\n * Makes a new feed writer for updating feeds\n *\n * @param topic Topic in hex or bytes\n * @param signer The signer's private key or a Signer instance that can sign data\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)\n */\n makeFeedWriter(\n topic: Topic | Uint8Array | string,\n signer?: PrivateKey | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): FeedWriter {\n topic = new Topic(topic)\n signer = signer ? new PrivateKey(signer) : this.signer\n\n if (!signer) {\n throw Error('No signer provided')\n }\n\n return makeFeedWriter(this.getRequestOptionsForCall(requestOptions), topic, signer)\n }\n\n async fetchLatestFeedUpdate(\n topic: Topic | Uint8Array | string,\n owner: EthAddress | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<FeedPayloadResult> {\n topic = new Topic(topic)\n owner = new EthAddress(owner)\n\n return fetchLatestFeedUpdate(this.getRequestOptionsForCall(requestOptions), owner, topic)\n }\n\n /**\n * Returns an object for reading single owner chunks\n *\n * @param ownerAddress The ethereum address of the owner\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @see [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/develop/tools-and-features/chunk-types#single-owner-chunks)\n */\n makeSOCReader(ownerAddress: EthAddress | Uint8Array | string, requestOptions?: BeeRequestOptions): SOCReader {\n ownerAddress = new EthAddress(ownerAddress)\n\n return {\n owner: ownerAddress,\n download: downloadSingleOwnerChunk.bind(null, this.getRequestOptionsForCall(requestOptions), ownerAddress),\n }\n }\n\n /**\n * Returns an object for reading and writing single owner chunks\n *\n * @param signer The signer's private key or a Signer instance that can sign data\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @see [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/develop/tools-and-features/chunk-types#single-owner-chunks)\n */\n makeSOCWriter(signer?: PrivateKey | Uint8Array | string, requestOptions?: BeeRequestOptions): SOCWriter {\n signer = signer ? new PrivateKey(signer) : this.signer\n\n if (!signer) {\n throw Error('No signer provided')\n }\n\n return {\n ...this.makeSOCReader((signer as PrivateKey).publicKey().address(), requestOptions),\n upload: uploadSingleOwnerChunkData.bind(null, this.getRequestOptionsForCall(requestOptions), signer),\n }\n }\n\n /**\n * Creates the postage batch signature for a specific chunk address.\n *\n * This is for advanced usage, where a pre-signed chunk can be uploaded\n * through a different Bee node.\n *\n * @param postageBatchId\n * @param reference\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @example\n * const envelope = await bee.createEnvelope(batchId, chunk.address)\n * await bee.uploadChunk(envelope, chunk)\n *\n * @returns\n */\n async createEnvelope(\n postageBatchId: BatchId | Uint8Array | string,\n reference: Reference | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<EnvelopeWithBatchId> {\n postageBatchId = new BatchId(postageBatchId)\n reference = new Reference(reference)\n\n return postEnvelope(this.getRequestOptionsForCall(requestOptions), postageBatchId, reference)\n }\n\n /**\n * Gets reserve commitment hash duration seconds.\n *\n * To be able to participe in the storage incentives and not get frozen, this should\n * ideally run under 5 minutes.\n *\n * This is a CPU intensice operation, as roughly 2^22 chunks are hashed in the process.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @example\n * const addresses = await bee.getNodeAddresses()\n * const topology = await bee.getTopology()\n * const result = await bee.rchash(topology.depth, addresses.overlay.toHex(), addresses.overlay.toHex())\n * // result is a number of seconds\n */\n async rchash(depth: number, anchor1: string, anchor2: string, requestOptions?: BeeRequestOptions): Promise<number> {\n return rchash(this.getRequestOptionsForCall(requestOptions), depth, anchor1, anchor2)\n }\n\n /**\n * Pings the Bee node to see if there is a live Bee node on the given URL.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @throws If connection was not successful throw error\n */\n async checkConnection(requestOptions?: BeeRequestOptions): Promise<void> | never {\n return status.checkConnection(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Pings the Bee node to see if there is a live Bee node on the given URL.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns true if successful, false on error\n */\n async isConnected(requestOptions?: BeeRequestOptions): Promise<boolean> {\n try {\n await status.checkConnection(this.getRequestOptionsForCall(requestOptions))\n } catch (e) {\n return false\n }\n\n return true\n }\n\n /**\n * Checks the `/gateway` endpoint to see if the remote API is a gateway.\n *\n * Do note that this is not a standard way to check for gateway nodes,\n * but some of the gateway tooling expose this endpoint.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async isGateway(requestOptions?: BeeRequestOptions): Promise<boolean> {\n return status.isGateway(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Fetches the overlay, underlay, Ethereum, and other addresses of the Bee node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async getNodeAddresses(requestOptions?: BeeRequestOptions): Promise<NodeAddresses> {\n return connectivity.getNodeAddresses(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Fetches the list of blocked peers for this node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async getBlocklist(requestOptions?: BeeRequestOptions): Promise<Peer[]> {\n return connectivity.getBlocklist(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets list of peers for this node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getPeers(requestOptions?: BeeRequestOptions): Promise<Peer[]> {\n return connectivity.getPeers(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Disconnects from a specific peer.\n *\n * @param peer Overlay address of the peer to be removed.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async removePeer(peer: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<RemovePeerResponse> {\n peer = new PeerAddress(peer)\n\n return connectivity.removePeer(this.getRequestOptionsForCall(requestOptions), peer)\n }\n\n /**\n * Fetches topology and connectivity information of the Bee node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async getTopology(requestOptions?: BeeRequestOptions): Promise<Topology> {\n return connectivity.getTopology(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Pings a specific peer to check its availability.\n *\n * @param peer Overlay address of the peer to be pinged.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async pingPeer(peer: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<PingResponse> {\n peer = new PeerAddress(peer)\n\n return connectivity.pingPeer(this.getRequestOptionsForCall(requestOptions), peer)\n }\n\n /**\n * Gets the SWAP balances with all known peers including prepaid services.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getAllBalances(requestOptions?: BeeRequestOptions): Promise<BalanceResponse> {\n return balance.getAllBalances(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the SWAP balances for a specific peer including prepaid services.\n *\n * @param address Swarm address of peer\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getPeerBalance(address: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<PeerBalance> {\n address = new PeerAddress(address)\n\n return balance.getPeerBalance(this.getRequestOptionsForCall(requestOptions), address)\n }\n\n /**\n * Gets the past due consumption balances for all known peers.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getPastDueConsumptionBalances(requestOptions?: BeeRequestOptions): Promise<BalanceResponse> {\n return balance.getPastDueConsumptionBalances(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the past due consumption balance for a specific peer.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param address Swarm address of peer\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getPastDueConsumptionPeerBalance(\n address: PeerAddress | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<PeerBalance> {\n address = new PeerAddress(address)\n\n return balance.getPastDueConsumptionPeerBalance(this.getRequestOptionsForCall(requestOptions), address)\n }\n\n /**\n * Gets the address of the deloyed chequebook.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getChequebookAddress(requestOptions?: BeeRequestOptions): Promise<ChequebookAddressResponse> {\n return chequebook.getChequebookAddress(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the balance of the chequebook.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getChequebookBalance(requestOptions?: BeeRequestOptions): Promise<ChequebookBalanceResponse> {\n return chequebook.getChequebookBalance(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the last cheques for all peers.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getLastCheques(requestOptions?: BeeRequestOptions): Promise<LastChequesResponse> {\n return chequebook.getLastCheques(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the last cheques for a specific peer.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param address Overlay address of peer.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getLastChequesForPeer(\n address: PeerAddress | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<LastChequesForPeerResponse> {\n address = new PeerAddress(address)\n\n return chequebook.getLastChequesForPeer(this.getRequestOptionsForCall(requestOptions), address)\n }\n\n /**\n * Gets the last cashout action for a specific peer.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param address Overlay address of peer.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getLastCashoutAction(\n address: PeerAddress | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<LastCashoutActionResponse> {\n address = new PeerAddress(address)\n\n return chequebook.getLastCashoutAction(this.getRequestOptionsForCall(requestOptions), address)\n }\n\n /**\n * Cashes out the last cheque for a specific peer.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param address Swarm address of peer\n * @param options\n * @param options.gasPrice Gas price for the cashout transaction in WEI\n * @param options.gasLimit Gas limit for the cashout transaction in WEI\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async cashoutLastCheque(\n address: PeerAddress | string,\n options?: TransactionOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n address = new PeerAddress(address)\n\n if (options) {\n prepareTransactionOptions(options)\n }\n\n return chequebook.cashoutLastCheque(this.getRequestOptionsForCall(requestOptions), address, options)\n }\n\n /**\n * Deposits tokens from the node wallet into the chequebook.\n *\n * @param amount Amount of tokens to deposit (must be positive integer)\n * @param gasPrice Gas Price in WEI for the transaction call\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @return string Hash of the transaction\n * @deprecated Use `depositBZZToChequebook` instead.\n */\n async depositTokens(\n amount: BZZ | NumberString | string | bigint,\n gasPrice?: NumberString | string | bigint,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n return this.depositBZZToChequebook(amount, gasPrice, requestOptions)\n }\n\n /**\n * Deposits tokens from the node wallet into the chequebook.\n *\n * @param amount Amount of tokens to deposit (must be positive integer)\n * @param gasPrice Gas Price in WEI for the transaction call\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @return string Hash of the transaction\n */\n async depositBZZToChequebook(\n amount: BZZ | NumberString | string | bigint,\n gasPrice?: NumberString | string | bigint,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n const amountString =\n amount instanceof BZZ ? amount.toPLURString() : asNumberString(amount, { min: 1n, name: 'amount' })\n\n let gasPriceString\n\n if (gasPrice) {\n gasPriceString = asNumberString(amount, { min: 0n, name: 'gasPrice' })\n }\n\n return chequebook.depositTokens(this.getRequestOptionsForCall(requestOptions), amountString, gasPriceString)\n }\n\n /**\n * Withdraws tokens from the chequebook to the node wallet.\n *\n * @param amount Amount of tokens to withdraw (must be positive integer)\n * @param gasPrice Gas Price in WEI for the transaction call\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @return string Hash of the transaction\n * @deprecated Use `withdrawBZZFromChequebook` instead.\n */\n async withdrawTokens(\n amount: BZZ | NumberString | string | bigint,\n gasPrice?: NumberString | string | bigint,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n return this.withdrawBZZFromChequebook(amount, gasPrice, requestOptions)\n }\n\n /**\n * Withdraws tokens from the chequebook to the node wallet.\n *\n * @param amount Amount of BZZ tokens to withdraw. If not providing a `BZZ` instance, the amount is denoted in PLUR.\n * @param gasPrice Gas Price in WEI for the transaction call.\n * @return Transaction ID\n */\n async withdrawBZZFromChequebook(\n amount: BZZ | NumberString | string | bigint,\n gasPrice?: NumberString | string | bigint,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n // TODO: check BZZ in tests\n const amountString =\n amount instanceof BZZ ? amount.toPLURString() : asNumberString(amount, { min: 1n, name: 'amount' })\n\n let gasPriceString\n\n if (gasPrice) {\n gasPriceString = asNumberString(amount, { min: 0n, name: 'gasPrice' })\n }\n\n return chequebook.withdrawTokens(this.getRequestOptionsForCall(requestOptions), amountString, gasPriceString)\n }\n\n /**\n * Withdraws BZZ from the node wallet (not chequebook) to a whitelisted external wallet address.\n *\n * @param amount Amount of BZZ tokens to withdraw. If not providing a `BZZ` instance, the amount is denoted in PLUR.\n * @param address\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @return Transaction ID\n */\n async withdrawBZZToExternalWallet(\n amount: BZZ | NumberString | string | bigint,\n address: EthAddress | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n amount = amount instanceof BZZ ? amount : BZZ.fromPLUR(amount)\n address = new EthAddress(address)\n\n return states.withdrawBZZ(this.getRequestOptionsForCall(requestOptions), amount, address)\n }\n\n /**\n * Withdraws DAI from the node wallet (not chequebook) to a whitelisted external wallet address.\n *\n * @param amount Amount of DAI tokens to withdraw. If not providing a `DAI` instance, the amount is denoted in wei.\n * @param address\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @return Transaction ID\n */\n async withdrawDAIToExternalWallet(\n amount: DAI | NumberString | string | bigint,\n address: EthAddress | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n amount = amount instanceof DAI ? amount : DAI.fromWei(amount)\n address = new EthAddress(address)\n\n return states.withdrawDAI(this.getRequestOptionsForCall(requestOptions), amount, address)\n }\n\n /**\n * Gets the amount of sent and received micropayments from settlements with a peer.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param address Swarm address of peer\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getSettlements(address: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<Settlements> {\n address = new PeerAddress(address)\n\n return settlements.getSettlements(this.getRequestOptionsForCall(requestOptions), address)\n }\n\n /**\n * Gets settlements with all known peers and total amount sent or received.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getAllSettlements(requestOptions?: BeeRequestOptions): Promise<AllSettlements> {\n return settlements.getAllSettlements(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the general status of the node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getStatus(requestOptions?: BeeRequestOptions): Promise<DebugStatus> {\n return debugStatus.getDebugStatus(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the health of the node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getHealth(requestOptions?: BeeRequestOptions): Promise<Health> {\n return debugStatus.getHealth(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the readiness status of the node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getReadiness(requestOptions?: BeeRequestOptions): Promise<Readiness> {\n return debugStatus.getReadiness(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Get mode information of node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getNodeInfo(requestOptions?: BeeRequestOptions): Promise<NodeInfo> {\n return debugStatus.getNodeInfo(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Connects to a node and checks if its version matches with the one that bee-js supports.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async isSupportedExactVersion(requestOptions?: BeeRequestOptions): Promise<boolean> | never {\n return debugStatus.isSupportedExactVersion(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n *\n * Connects to a node and checks if its Main API version matches with the one that bee-js supports.\n *\n * This should be the main way how to check compatibility for your app and Bee node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async isSupportedApiVersion(requestOptions?: BeeRequestOptions): Promise<boolean> | never {\n return debugStatus.isSupportedApiVersion(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Returns object with all versions specified by the connected Bee node (properties prefixed with `bee*`)\n * and versions that bee-js supports (properties prefixed with `supported*`).\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getVersions(requestOptions?: BeeRequestOptions): Promise<BeeVersions> | never {\n return debugStatus.getVersions(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Get reserve state.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getReserveState(requestOptions?: BeeRequestOptions): Promise<ReserveState> {\n return states.getReserveState(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets chain state.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getChainState(requestOptions?: BeeRequestOptions): Promise<ChainState> {\n return states.getChainState(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets DAI and BZZ balances of the Bee node wallet.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getWalletBalance(requestOptions?: BeeRequestOptions): Promise<WalletBalance> {\n return states.getWalletBalance(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Creates a new postage batch, spending BZZ tokens from the node wallet.\n *\n * Use {@link buyStorage} for a more convenient way to create postage batch.\n *\n * For better understanding what each parameter means and what the optimal values are, see\n * [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction#keep-your-data-alive).\n *\n * @param amount TTL parameter - 1 day at the minimum of 24,000 storage price requires an amount of 414,720,000.\n * @param depth Capacity parameter - 17..255 - depth 17 provides 512MB of theoretical capacity, 18 provides 1GB, 19 provides 2GB, etc.\n * @param options Options for creation of postage batch\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee Debug API reference - `POST /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1{amount}~1{depth}/post)\n */\n async createPostageBatch(\n amount: NumberString | string | bigint,\n depth: number,\n options?: PostageBatchOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<BatchId> {\n const amountString = asNumberString(amount, { min: 0n, name: 'amount' })\n\n if (options) {\n options = preparePostageBatchOptions(options)\n }\n\n if (depth < STAMPS_DEPTH_MIN || depth > STAMPS_DEPTH_MAX) {\n throw new BeeArgumentError(`Depth has to be between ${STAMPS_DEPTH_MIN}..${STAMPS_DEPTH_MAX}`, depth)\n }\n\n const chainState = await this.getChainState()\n const minimumAmount = BigInt(chainState.currentPrice) * 17280n + 1n\n\n if (BigInt(amountString) < minimumAmount) {\n throw new BeeArgumentError(\n `Amount has to be at least ${minimumAmount} (1 day at current price ${chainState.currentPrice})`,\n amountString,\n )\n }\n\n const stamp = await stamps.createPostageBatch(\n this.getRequestOptionsForCall(requestOptions),\n amountString,\n depth,\n options,\n )\n\n if (options?.waitForUsable !== false) {\n await this.waitForUsablePostageStamp(stamp, options?.waitForUsableTimeout)\n }\n\n return stamp\n }\n\n /**\n * A more convenient method to create a postage batch, which is analogous\n * to buying storage for a certain size and duration on the Swarm network.\n *\n * Use {@link getStorageCost} to calculate the cost of creating a postage batch.\n * \n * For the low level API, use {@link createPostageBatch}.\n * \n * @example const batchId = await bee.buyStorage(Size.fromGigabytes(8), Duration.fromDays(31))\n\n * @param size\n * @param duration\n * @param options\n * @param requestOptions\n * @param encryption\n * @param erasureCodeLevel\n * @returns\n */\n async buyStorage(\n size: Size,\n duration: Duration,\n options?: PostageBatchOptions,\n requestOptions?: BeeRequestOptions,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n ): Promise<BatchId> {\n const chainState = await this.getChainState(requestOptions)\n const amount = getAmountForDuration(duration, chainState.currentPrice, this.network === 'gnosis' ? 5 : 15)\n const depth = getDepthForSize(size, encryption, erasureCodeLevel)\n\n if (options) {\n options = preparePostageBatchOptions(options)\n }\n\n return this.createPostageBatch(amount, depth, options, requestOptions)\n }\n\n /**\n * Calculates the estimated BZZ cost for creating a postage batch for the given size and duration.\n *\n * Use {@link buyStorage} to create a postage batch with the calculated cost.\n *\n * @example const bzz = await bee.getStorageCost(Size.fromGigabytes(1), Duration.fromDays(30))\n *\n * @param size Size of the data to be stored.\n * @param duration Duration for which the data should be stored.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.\n * @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.\n * @returns\n */\n async getStorageCost(\n size: Size,\n duration: Duration,\n requestOptions?: BeeRequestOptions,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n ): Promise<BZZ> {\n const chainState = await this.getChainState(requestOptions)\n const amount = getAmountForDuration(duration, chainState.currentPrice, this.network === 'gnosis' ? 5 : 15)\n const depth = getDepthForSize(size, encryption, erasureCodeLevel)\n\n return getStampCost(depth, amount)\n }\n\n /**\n * Extends the storage of a postage batch by either increasing its size, duration or both.\n *\n * The size is ABSOLUTE, while the duration is RELATIVE to the current duration of the postage batch.\n *\n * Use {@link getExtensionCost} to calculate the cost of extending the storage.\n *\n * @example\n * // Increases the size to 8GB (unless it is already at 8GB or higher)\n * // and extends the duration by 30 days (regardless of the current duration).\n * await bee.extendStorage(batchId, Size.fromGigabytes(8), Duration.fromDays(30))\n *\n * @example\n * // To increase the duration to a desired date, pass a second parameter to `Duration.fromEndDate`.\n * // With the second parameter, the duration is set to the difference between the current end date and the desired end date.\n * const oneMonth = new Date(Date.now() + Dates.days(31))\n * const batch = await bee.getPostageBatch(batchId)\n * await bee.extendStorage(batchId, Size.fromGigabytes(8), Duration.fromEndDate(oneMonth, batch.duration.toEndDate()))\n *\n * @param postageBatchId Batch ID of the postage batch to extend.\n * @param size Absolute size to extend the postage batch to.\n * @param duration Relative duration to extend the postage batch by.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.\n * @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.\n * @returns\n */\n async extendStorage(\n postageBatchId: BatchId | Uint8Array | string,\n size: Size,\n duration: Duration,\n requestOptions?: BeeRequestOptions,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n ) {\n const batch = await this.getPostageBatch(postageBatchId, requestOptions)\n const depth = getDepthForSize(size, encryption, erasureCodeLevel)\n const chainState = await this.getChainState(requestOptions)\n const depthDelta = depth - batch.depth\n const multiplier = depthDelta <= 0 ? 1n : 2n ** BigInt(depthDelta)\n const blockTime = this.network === 'gnosis' ? 5 : 15\n const additionalAmount = getAmountForDuration(duration, chainState.currentPrice, blockTime)\n const currentAmount = getAmountForDuration(batch.duration, chainState.currentPrice, blockTime)\n const targetAmount = duration.isZero() ? currentAmount * multiplier : currentAmount + additionalAmount * multiplier\n\n const amountDelta = targetAmount - currentAmount\n\n const transactionId = await this.topUpBatch(batch.batchID, amountDelta, requestOptions)\n\n if (depthDelta > 0) {\n return this.diluteBatch(batch.batchID, depth, requestOptions)\n }\n\n return transactionId\n }\n\n /**\n * Extends the storage size of a postage batch by increasing its depth.\n *\n * Use {@link getSizeExtensionCost} to calculate the cost of extending the size.\n * Use {@link extendStorage} to extend both size and duration.\n *\n * @param postageBatchId\n * @param size Absolute size to extend the postage batch to.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.\n * @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.\n * @returns\n */\n async extendStorageSize(\n postageBatchId: BatchId | Uint8Array | string,\n size: Size,\n requestOptions?: BeeRequestOptions,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n ) {\n const chainState = await this.getChainState(requestOptions)\n const batch = await this.getPostageBatch(postageBatchId, requestOptions)\n const depth = getDepthForSize(size, encryption, erasureCodeLevel)\n const delta = depth - batch.depth\n\n if (delta <= 0) {\n throw new BeeArgumentError('New depth has to be greater than the original depth', depth)\n }\n\n const currentAmount = getAmountForDuration(\n batch.duration,\n chainState.currentPrice,\n this.network === 'gnosis' ? 5 : 15,\n )\n await this.topUpBatch(batch.batchID, currentAmount * (2n ** BigInt(delta) - 1n) + 1n, requestOptions)\n\n return this.diluteBatch(batch.batchID, depth, requestOptions)\n }\n\n /**\n * Extends the duration of a postage batch.\n *\n * Use {@link getDurationExtensionCost} to calculate the cost of extending the duration.\n * Use {@link extendStorage} to extend both size and duration.\n *\n * @param postageBatchId\n * @param duration Relative duration to extend the postage batch by.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async extendStorageDuration(\n postageBatchId: BatchId | Uint8Array | string,\n duration: Duration,\n requestOptions?: BeeRequestOptions,\n ) {\n const batch = await this.getPostageBatch(postageBatchId, requestOptions)\n const chainState = await this.getChainState(requestOptions)\n const amount = getAmountForDuration(duration, chainState.currentPrice, this.network === 'gnosis' ? 5 : 15)\n\n return this.topUpBatch(batch.batchID, amount, requestOptions)\n }\n\n /**\n * Calculates the cost of extending both the duration and the capacity of a postage batch.\n *\n * The size is ABSOLUTE, while the duration is RELATIVE to the current duration of the postage batch.\n *\n * Use {@link extendStorage} to extend the the duration and capacity of a postage batch.\n *\n * @param postageBatchId\n * @param size Absolute size to extend the postage batch to.\n * @param duration Relative duration to extend the postage batch by.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.\n * @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.\n * @returns\n */\n async getExtensionCost(\n postageBatchId: BatchId | Uint8Array | string,\n size: Size,\n duration: Duration,\n requestOptions?: BeeRequestOptions,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n ): Promise<BZZ> {\n const batch = await this.getPostageBatch(postageBatchId, requestOptions)\n const chainState = await this.getChainState(requestOptions)\n const blockTime = this.network === 'gnosis' ? 5 : 15\n const amount = duration.isZero() ? 0n : getAmountForDuration(duration, chainState.currentPrice, blockTime)\n const depth = getDepthForSize(size, encryption, erasureCodeLevel)\n\n const currentAmount = getAmountForDuration(batch.duration, chainState.currentPrice, blockTime)\n const currentCost = getStampCost(batch.depth, currentAmount)\n const newCost = getStampCost(Math.max(batch.depth, depth), currentAmount + amount)\n\n return newCost.minus(currentCost)\n }\n\n /**\n * Calculates the cost of extending the size of a postage batch.\n *\n * The size is ABSOLUTE, so if the postage batch already equals or is greater than the given size,\n * the cost will be zero.\n *\n * Use {@link extendStorageSize} to extend the size of a postage batch.\n *\n * Use {@link getExtensionCost} to get the cost of extending both size and duration.\n * Use {@link getDurationExtensionCost} to get the cost of extending only the duration.\n *\n * @param postageBatchId\n * @param size\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.\n * @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.\n * @returns\n */\n async getSizeExtensionCost(\n postageBatchId: BatchId | Uint8Array | string,\n size: Size,\n requestOptions?: BeeRequestOptions,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n ): Promise<BZZ> {\n const batch = await this.getPostageBatch(postageBatchId, requestOptions)\n const chainState = await this.getChainState(requestOptions)\n const depth = getDepthForSize(size, encryption, erasureCodeLevel)\n const delta = depth - batch.depth\n\n if (delta <= 0) {\n throw new BeeArgumentError('New depth has to be greater than the original depth', depth)\n }\n\n const currentAmount = getAmountForDuration(\n batch.duration,\n chainState.currentPrice,\n this.network === 'gnosis' ? 5 : 15,\n )\n const currentCost = getStampCost(batch.depth, currentAmount)\n const newCost = getStampCost(depth, currentAmount)\n\n return newCost.minus(currentCost)\n }\n\n /**\n * Calculates the cost of extending the duration of a postage batch.\n *\n * The duration is RELATIVE to the current duration of the postage batch,\n * e.g. specifying `Duration.fromDays(30)` will extend the current duration by 30 days,\n * regardless of the current duration.\n *\n * Use {@link extendStorageDuration} to extend the duration of a postage batch.\n *\n * Use {@link getExtensionCost} to get the cost of extending both size and duration.\n * Use {@link getSizeExtensionCost} to get the cost of extending only the size.\n *\n * @param postageBatchId\n * @param duration\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async getDurationExtensionCost(\n postageBatchId: BatchId | Uint8Array | string,\n duration: Duration,\n requestOptions?: BeeRequestOptions,\n ): Promise<BZZ> {\n const batch = await this.getPostageBatch(postageBatchId, requestOptions)\n const chainState = await this.getChainState(requestOptions)\n const amount = getAmountForDuration(duration, chainState.currentPrice, this.network === 'gnosis' ? 5 : 15)\n\n return getStampCost(batch.depth, amount)\n }\n\n /**\n * Increases the duration of a postage batch by increasing its amount.\n *\n * For a more convenient way to extend the postage batch, refer to the methods below.\n *\n * Use {@link getDurationExtensionCost}, {@link getSizeExtensionCost} or {@link getExtensionCost}\n * to calculate the costs of extending the postage batch properties.\n *\n * Use {@link extendStorageDuration}, {@link extendStorageSize} or {@link extendStorage}\n * to extend the postage batch properties.\n *\n * For better understanding what each parameter means and what are the optimal values please see\n * [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive).\n *\n * @param postageBatchId Batch ID\n * @param amount Amount to be added to the batch\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee Debug API reference - `PATCH /stamps/topup/${id}/${amount}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1topup~1{batch_id}~1{amount}/patch)\n */\n async topUpBatch(\n postageBatchId: BatchId | Uint8Array | string,\n amount: NumberString | string | bigint,\n requestOptions?: BeeRequestOptions,\n ): Promise<BatchId> {\n postageBatchId = new BatchId(postageBatchId)\n const amountString = asNumberString(amount, { min: 1n, name: 'amount' })\n\n return stamps.topUpBatch(this.getRequestOptionsForCall(requestOptions), postageBatchId, amountString)\n }\n\n /**\n * Dilutes a postage batch to extend its capacity by increasing its depth.\n *\n * This is a free operation, as for every depth increase, the capacity is doubled,\n * but the amount (duration) is halved.\n *\n * To increase the capacity of the postage batch while retaining the same amount (duration),\n * you need to top up the postage batch first using {@link topUpBatch}.\n *\n * For a more convenient way to extend the postage batch, refer to the methods below.\n *\n * Use {@link getDurationExtensionCost}, {@link getSizeExtensionCost} or {@link getExtensionCost}\n * to calculate the costs of extending the postage batch properties.\n *\n * Use {@link extendStorageDuration}, {@link extendStorageSize} or {@link extendStorage}\n * to extend the postage batch properties.\n *\n * For better understanding what each parameter means and what are the optimal values please see\n * [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive).\n *\n * @param postageBatchId Batch ID\n * @param depth Amount to be added to the batch\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee Debug API reference - `PATCH /stamps/topup/${id}/${amount}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1dilute~1%7Bbatch_id%7D~1%7Bdepth%7D/patch)\n */\n async diluteBatch(\n postageBatchId: BatchId | Uint8Array | string,\n depth: number,\n requestOptions?: BeeRequestOptions,\n ): Promise<BatchId> {\n postageBatchId = new BatchId(postageBatchId)\n depth = Types.asNumber(depth, { name: 'depth', min: 18, max: 255 })\n\n return stamps.diluteBatch(this.getRequestOptionsForCall(requestOptions), postageBatchId, depth)\n }\n\n /**\n * Returns details for specific postage batch.\n *\n * @param postageBatchId Batch ID\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @param encryption Assume that uploads with this postage batch are encrypted, which skews the capacity.\n * @param erasureCodeLevel Assume that uploads with this postage batch are erasure coded, which skews the capacity.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee Debug API reference - `GET /stamps/${id}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D/get)\n */\n async getPostageBatch(\n postageBatchId: BatchId | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n ): Promise<PostageBatch> {\n postageBatchId = new BatchId(postageBatchId)\n\n return stamps.getPostageBatch(\n this.getRequestOptionsForCall(requestOptions),\n postageBatchId,\n encryption,\n erasureCodeLevel,\n )\n }\n\n /**\n * Return detailed information related to buckets for specific postage batch.\n *\n * @param postageBatchId Batch ID\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee Debug API reference - `GET /stamps/${id}/buckets`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D~1buckets/get)\n */\n async getPostageBatchBuckets(\n postageBatchId: BatchId | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<PostageBatchBuckets> {\n postageBatchId = new BatchId(postageBatchId)\n\n return stamps.getPostageBatchBuckets(this.getRequestOptionsForCall(requestOptions), postageBatchId)\n }\n\n /**\n * Returns all postage batches that belongs to the node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps/get)\n * @deprecated Use `getPostageBatches` instead\n */\n async getAllPostageBatch(requestOptions?: BeeRequestOptions): Promise<PostageBatch[]> {\n return stamps.getAllPostageBatches(this.getRequestOptionsForCall(requestOptions)) // TODO: remove in June 2025\n }\n\n /**\n * Returns all postage batches that are globally available on the Swarm network.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @deprecated Use `getGlobalPostageBatches` instead\n */\n async getAllGlobalPostageBatch(requestOptions?: BeeRequestOptions): Promise<GlobalPostageBatch[]> {\n return stamps.getGlobalPostageBatches(this.getRequestOptionsForCall(requestOptions)) // TODO: remove in June 2025\n }\n\n /**\n * Returns all postage batches that belong to the node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps/get)\n */\n async getPostageBatches(requestOptions?: BeeRequestOptions): Promise<PostageBatch[]> {\n return stamps.getAllPostageBatches(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Returns all globally available postage batches.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getGlobalPostageBatches(requestOptions?: BeeRequestOptions): Promise<GlobalPostageBatch[]> {\n return stamps.getGlobalPostageBatches(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Fetches the list of all current pending transactions for the Bee node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getAllPendingTransactions(requestOptions?: BeeRequestOptions): Promise<TransactionInfo[]> {\n return transactions.getAllTransactions(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Fetches the transaction information for a specific transaction.\n *\n * @param transactionHash\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getPendingTransaction(\n transactionHash: TransactionId | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionInfo> {\n transactionHash = new TransactionId(transactionHash)\n\n return transactions.getTransaction(this.getRequestOptionsForCall(requestOptions), transactionHash)\n }\n\n /**\n * Rebroadcasts already created transaction.\n *\n * This is mainly needed when the transaction falls off mempool or is not incorporated into any block.\n *\n * @param transactionHash\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async rebroadcastPendingTransaction(\n transactionHash: TransactionId | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n transactionHash = new TransactionId(transactionHash)\n\n return transactions.rebroadcastTransaction(this.getRequestOptionsForCall(requestOptions), transactionHash)\n }\n\n /**\n * Cancels a currently pending transaction.\n *\n * @param transactionHash\n * @param gasPrice\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async cancelPendingTransaction(\n transactionHash: TransactionId | Uint8Array | string,\n gasPrice?: NumberString | string | bigint,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n transactionHash = new TransactionId(transactionHash)\n\n let gasPriceString\n\n if (gasPrice) {\n gasPriceString = asNumberString(gasPrice, { min: 0n, name: 'gasPrice' })\n }\n\n return transactions.cancelTransaction(\n this.getRequestOptionsForCall(requestOptions),\n transactionHash,\n gasPriceString,\n )\n }\n\n /**\n * Gets the amount of staked BZZ.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getStake(requestOptions?: BeeRequestOptions): Promise<BZZ> {\n return stake.getStake(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the amount of withdrawable staked BZZ.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getWithdrawableStake(requestOptions?: BeeRequestOptions): Promise<BZZ> {\n return stake.getWithdrawableStake(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Withdraws all surplus staked BZZ to the node wallet.\n *\n * Use the {@link getWithdrawableStake} method to check how much surplus stake is available.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async withdrawSurplusStake(requestOptions?: BeeRequestOptions): Promise<TransactionId> {\n return stake.withdrawSurplusStake(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Withdraws all staked BZZ to the node wallet.\n *\n * **Only available when the staking contract is paused and is in the process of being migrated to a new contract!**\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async migrateStake(requestOptions?: BeeRequestOptions): Promise<TransactionId> {\n return stake.migrateStake(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Stakes the given amount of BZZ. Initial deposit must be at least 10 BZZ.\n *\n * Be aware that staked BZZ tokens can **not** be withdrawn.\n *\n * @param amount Amount of BZZ tokens to be staked. If not providing a `BZZ` instance, the amount is denoted in PLUR.\n * @param options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async depositStake(\n amount: BZZ | NumberString | string | bigint,\n options?: TransactionOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n const amountString =\n amount instanceof BZZ ? amount.toPLURString() : asNumberString(amount, { min: 1n, name: 'amount' })\n\n if (options) {\n options = prepareTransactionOptions(options)\n }\n\n return stake.stake(this.getRequestOptionsForCall(requestOptions), amountString, options)\n }\n\n /**\n * Gets current status of node in redistribution game.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee API reference - `GET /redistributionstate`](https://docs.ethswarm.org/api/#tag/RedistributionState/paths/~1redistributionstate/get)\n */\n async getRedistributionState(requestOptions?: BeeRequestOptions): Promise<RedistributionState> {\n return stake.getRedistributionState(this.getRequestOptionsForCall(requestOptions))\n }\n\n private async waitForUsablePostageStamp(id: BatchId, timeout = 240_000): Promise<void> {\n const TIME_STEP = 3_000\n for (let time = 0; time < timeout; time += TIME_STEP) {\n try {\n const stamp = await this.getPostageBatch(id)\n\n if (stamp.usable) {\n return\n }\n } catch (error) {\n // ignore error\n }\n\n await System.sleepMillis(TIME_STEP)\n }\n\n throw new BeeError('Timeout on waiting for postage stamp to become usable')\n }\n\n protected getRequestOptionsForCall(requestOptions?: BeeRequestOptions): BeeRequestOptions {\n if (requestOptions) {\n requestOptions = prepareBeeRequestOptions(requestOptions)\n }\n\n return requestOptions ? Objects.deepMerge2(this.requestOptions, requestOptions) : this.requestOptions\n }\n}\n","export function totalChunks(fileSize: number) {\n const chunkSize = 4096\n const hashesPerChunk = 128\n\n function chunksAtLevel(chunkCount: number): number {\n if (chunkCount <= 1) {\n return chunkCount\n }\n const upperLevelChunks = Math.ceil(chunkCount / hashesPerChunk)\n\n return chunkCount + chunksAtLevel(upperLevelChunks)\n }\n\n const baseLevelChunks = Math.ceil(fileSize / chunkSize)\n\n return chunksAtLevel(baseLevelChunks)\n}\n","import { Binary, Types } from 'cafe-utility'\nimport type { BeeRequestOptions, EnvelopeWithBatchId } from '../types'\nimport { http } from '../utils/http'\nimport { BatchId, Reference } from '../utils/typed-bytes'\n\nconst ENVELOPE_ENDPOINT = 'envelope'\n\nexport async function postEnvelope(\n requestOptions: BeeRequestOptions,\n postageBatchId: BatchId,\n reference: Reference,\n): Promise<EnvelopeWithBatchId> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n responseType: 'json',\n url: `${ENVELOPE_ENDPOINT}/${reference}`,\n headers: {\n 'swarm-postage-batch-id': postageBatchId.toHex(),\n },\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n issuer: Binary.hexToUint8Array(Types.asHexString(body.issuer, { name: 'issuer', byteLength: 20 })),\n index: Binary.hexToUint8Array(Types.asHexString(body.index, { name: 'index', byteLength: 8 })),\n timestamp: Binary.hexToUint8Array(Types.asHexString(body.timestamp, { name: 'timestamp', byteLength: 8 })),\n signature: Binary.hexToUint8Array(Types.asHexString(body.signature, { name: 'signature', byteLength: 65 })),\n batchId: postageBatchId,\n }\n}\n","import { Types } from 'cafe-utility'\nimport type { BeeRequestOptions } from '../types'\nimport { http } from '../utils/http'\n\nconst RCHASH_ENDPOINT = 'rchash'\n\nexport async function rchash(\n requestOptions: BeeRequestOptions,\n depth: number,\n anchor1: string,\n anchor2: string,\n): Promise<number> {\n const response = await http<unknown>(requestOptions, {\n responseType: 'json',\n url: `${RCHASH_ENDPOINT}/${depth}/${anchor1}/${anchor2}`,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return Types.asNumber(body.durationSeconds, { name: 'durationSeconds' })\n}\n","import { Types } from 'cafe-utility'\nimport { Bee, BeeRequestOptions, EthAddress, NodeAddresses, PeerAddress, PublicKey, Topology } from '.'\nimport { asBin } from './modules/debug/connectivity'\nimport { http } from './utils/http'\n\nexport class BeeDev extends Bee {\n async getNodeAddresses(options?: BeeRequestOptions): Promise<NodeAddresses> {\n const requestOptions = super.getRequestOptionsForCall(options)\n\n const response = await http<unknown>(requestOptions, {\n url: 'addresses',\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n overlay: new PeerAddress(Types.asString(body.overlay, { name: 'overlay' })),\n underlay: [],\n ethereum: new EthAddress(Types.asString(body.ethereum, { name: 'ethereum' })),\n publicKey: new PublicKey(Types.asString(body.publicKey, { name: 'publicKey' })),\n pssPublicKey: new PublicKey(Types.asString(body.pssPublicKey, { name: 'pssPublicKey' })),\n }\n }\n\n async getTopology(options?: BeeRequestOptions): Promise<Topology> {\n const requestOptions = super.getRequestOptionsForCall(options)\n\n const response = await http<unknown>(requestOptions, {\n url: `topology`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const bins = Types.asObject(body.bins, { name: 'bins' })\n\n return {\n baseAddr: '0bab5ca208a980950604f900f2791613fc980676c2dee7dd92a4fdda5a54bf26',\n population: Types.asNumber(body.population, { name: 'population' }),\n connected: Types.asNumber(body.connected, { name: 'connected' }),\n timestamp: Types.asString(body.timestamp, { name: 'timestamp' }),\n nnLowWatermark: Types.asNumber(body.nnLowWatermark, { name: 'nnLowWatermark' }),\n depth: Types.asNumber(body.depth, { name: 'depth' }),\n reachability: 'Public',\n networkAvailability: 'Available',\n bins: {\n bin_0: asBin(bins.bin_0, 'bin_0'),\n bin_1: asBin(bins.bin_1, 'bin_1'),\n bin_2: asBin(bins.bin_2, 'bin_2'),\n bin_3: asBin(bins.bin_3, 'bin_3'),\n bin_4: asBin(bins.bin_4, 'bin_4'),\n bin_5: asBin(bins.bin_5, 'bin_5'),\n bin_6: asBin(bins.bin_6, 'bin_6'),\n bin_7: asBin(bins.bin_7, 'bin_7'),\n bin_8: asBin(bins.bin_8, 'bin_8'),\n bin_9: asBin(bins.bin_9, 'bin_9'),\n bin_10: asBin(bins.bin_10, 'bin_10'),\n bin_11: asBin(bins.bin_11, 'bin_11'),\n bin_12: asBin(bins.bin_12, 'bin_12'),\n bin_13: asBin(bins.bin_13, 'bin_13'),\n bin_14: asBin(bins.bin_14, 'bin_14'),\n bin_15: asBin(bins.bin_15, 'bin_15'),\n bin_16: asBin(bins.bin_16, 'bin_16'),\n bin_17: asBin(bins.bin_17, 'bin_17'),\n bin_18: asBin(bins.bin_18, 'bin_18'),\n bin_19: asBin(bins.bin_19, 'bin_19'),\n bin_20: asBin(bins.bin_20, 'bin_20'),\n bin_21: asBin(bins.bin_21, 'bin_21'),\n bin_22: asBin(bins.bin_22, 'bin_22'),\n bin_23: asBin(bins.bin_23, 'bin_23'),\n bin_24: asBin(bins.bin_24, 'bin_24'),\n bin_25: asBin(bins.bin_25, 'bin_25'),\n bin_26: asBin(bins.bin_26, 'bin_26'),\n bin_27: asBin(bins.bin_27, 'bin_27'),\n bin_28: asBin(bins.bin_28, 'bin_28'),\n bin_29: asBin(bins.bin_29, 'bin_29'),\n bin_30: asBin(bins.bin_30, 'bin_30'),\n bin_31: asBin(bins.bin_31, 'bin_31'),\n },\n }\n }\n}\n","import { Binary, Chunk } from 'cafe-utility'\nimport { EnvelopeWithBatchId } from '../types'\nimport { BatchId, PrivateKey } from '../utils/typed-bytes'\n\nexport class Stamper {\n signer: PrivateKey\n batchId: BatchId\n buckets: Uint32Array\n depth: number\n maxSlot: number\n\n private constructor(\n signer: PrivateKey | Uint8Array | string,\n batchId: BatchId | Uint8Array | string,\n buckets: Uint32Array,\n depth: number,\n ) {\n this.signer = new PrivateKey(signer)\n this.batchId = new BatchId(batchId)\n this.buckets = buckets\n this.depth = depth\n this.maxSlot = 2 ** (this.depth - 16)\n }\n\n static fromBlank(signer: PrivateKey | Uint8Array | string, batchId: BatchId | Uint8Array | string, depth: number) {\n return new Stamper(signer, batchId, new Uint32Array(65536), depth)\n }\n\n static fromState(\n signer: PrivateKey | Uint8Array | string,\n batchId: BatchId | Uint8Array | string,\n buckets: Uint32Array,\n depth: number,\n ) {\n return new Stamper(signer, batchId, buckets, depth)\n }\n\n stamp(chunk: Chunk): EnvelopeWithBatchId {\n const address = chunk.hash()\n const bucket = Binary.uint16ToNumber(address, 'BE')\n const height = this.buckets[bucket]\n\n if (height >= this.maxSlot) {\n throw Error('Bucket is full')\n }\n this.buckets[bucket]++\n const index = Binary.concatBytes(Binary.numberToUint32(bucket, 'BE'), Binary.numberToUint32(height, 'BE'))\n const timestamp = Binary.numberToUint64(BigInt(Date.now()), 'BE')\n const signature = this.signer.sign(Binary.concatBytes(address, this.batchId.toUint8Array(), index, timestamp))\n\n return {\n batchId: this.batchId,\n index,\n issuer: this.signer.publicKey().address().toUint8Array(),\n signature: signature.toUint8Array(),\n timestamp,\n }\n }\n\n getState(): Uint32Array {\n return this.buckets\n }\n}\n","import { BatchId, Topic } from './typed-bytes'\n\nexport const SWARM_GATEWAY_URL = 'https://api.gateway.ethswarm.org'\nexport const NULL_STAMP = new BatchId('0000000000000000000000000000000000000000000000000000000000000000')\nexport const NULL_TOPIC = new Topic('0000000000000000000000000000000000000000000000000000000000000000')\nexport const NULL_ADDRESS = new Uint8Array(32)\nexport const NULL_IDENTIFIER = new Uint8Array(32)\nexport const NULL_OWNER = new Uint8Array(20)\n","import { PSS_TARGET_HEX_LENGTH_MAX } from '../types'\nimport { PeerAddress } from './typed-bytes'\n\n/**\n * Utility function that for given strings/reference takes the most specific\n * target that Bee node will except.\n *\n * @param target is a non-prefixed hex string Bee address\n * @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)\n */\nexport function makeMaxTarget(target: PeerAddress | Uint8Array | string): string {\n target = new PeerAddress(target)\n\n return target.toHex().slice(0, PSS_TARGET_HEX_LENGTH_MAX)\n}\n","import { RedundancyLevel } from '..'\n\nconst mediumTable = [\n [94, 68, 46, 28, 14, 5, 1],\n [9, 8, 7, 6, 5, 4, 3],\n]\nconst encMediumTable = [\n [47, 34, 23, 14, 7, 2],\n [9, 8, 7, 6, 5, 4],\n]\nconst strongTable = [\n [104, 95, 86, 77, 69, 61, 53, 46, 39, 32, 26, 20, 15, 10, 6, 3, 1],\n [21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5],\n]\nconst encStrongTable = [\n [52, 47, 43, 38, 34, 30, 26, 23, 19, 16, 13, 10, 7, 5, 3, 1],\n [21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6],\n]\nconst insaneTable = [\n [92, 87, 82, 77, 73, 68, 63, 59, 54, 50, 45, 41, 37, 33, 29, 26, 22, 19, 16, 13, 10, 8, 5, 3, 2, 1],\n [31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6],\n]\nconst encInsaneTable = [\n [46, 43, 41, 38, 36, 34, 31, 29, 27, 25, 22, 20, 18, 16, 14, 13, 11, 9, 8, 6, 5, 4, 2, 1],\n [31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 7],\n]\nconst paranoidTable = [\n [\n 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9,\n 8, 7, 6, 5, 4, 3, 2, 1,\n ],\n [\n 90, 88, 87, 85, 84, 82, 81, 79, 77, 76, 74, 72, 71, 69, 67, 66, 64, 62, 60, 59, 57, 55, 53, 51, 49, 48, 46, 44, 41,\n 39, 37, 35, 32, 30, 27, 24, 20,\n ],\n]\nconst encParanoidTable = [\n [18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],\n [88, 85, 82, 79, 76, 72, 69, 66, 62, 59, 55, 51, 48, 44, 39, 35, 30, 24],\n]\n\n/**\n * Returns an approximate multiplier for the overhead of a given redundancy level.\n * Redundancy level is a tradeoff between storage overhead and fault tolerance.\n * Use this number to estimate the amount of chunks that will be stored for a given\n * redundancy level.\n */\nexport function approximateOverheadForRedundancyLevel(chunks: number, level: RedundancyLevel, encrypted: boolean) {\n if (level === RedundancyLevel.OFF) {\n return 0\n }\n\n const table = selectTable(level, encrypted)\n const [supportedChunks, parities] = table\n\n for (let i = 0; i < supportedChunks.length; i++) {\n if (chunks >= supportedChunks[i]) {\n return parities[i] / supportedChunks[i]\n }\n }\n\n return parities[parities.length - 1] / supportedChunks[supportedChunks.length - 1]\n}\n\nfunction selectTable(level: RedundancyLevel, encrypted: boolean) {\n switch (level) {\n case RedundancyLevel.MEDIUM:\n return encrypted ? encMediumTable : mediumTable\n case RedundancyLevel.STRONG:\n return encrypted ? encStrongTable : strongTable\n case RedundancyLevel.INSANE:\n return encrypted ? encInsaneTable : insaneTable\n case RedundancyLevel.PARANOID:\n return encrypted ? encParanoidTable : paranoidTable\n default:\n throw new Error(`Unknown redundancy level ${level}`)\n }\n}\n\ninterface RedundancyStats {\n label: string\n value: RedundancyLevel\n errorTolerance: number\n}\n\nconst medium = {\n label: 'medium',\n value: RedundancyLevel.MEDIUM,\n errorTolerance: 0.01,\n}\nconst strong = {\n label: 'strong',\n value: RedundancyLevel.STRONG,\n errorTolerance: 0.05,\n}\nconst insane = {\n label: 'insane',\n value: RedundancyLevel.INSANE,\n errorTolerance: 0.1,\n}\nconst paranoid = {\n label: 'paranoid',\n value: RedundancyLevel.PARANOID,\n errorTolerance: 0.5,\n}\n\nexport function getRedundancyStats(): {\n medium: RedundancyStats\n strong: RedundancyStats\n insane: RedundancyStats\n paranoid: RedundancyStats\n} {\n return {\n medium,\n strong,\n insane,\n paranoid,\n }\n}\n\nexport function getRedundancyStat(level?: string | RedundancyLevel): RedundancyStats {\n if (typeof level === 'string') {\n switch (level.toLowerCase()) {\n case 'medium':\n return medium\n case 'strong':\n return strong\n case 'insane':\n return insane\n case 'paranoid':\n return paranoid\n default:\n throw new Error(`Unknown redundancy level '${level}'`)\n }\n }\n\n switch (level) {\n case RedundancyLevel.MEDIUM:\n return medium\n case RedundancyLevel.STRONG:\n return strong\n case RedundancyLevel.INSANE:\n return insane\n case RedundancyLevel.PARANOID:\n return paranoid\n default:\n throw new Error(`Unknown redundancy level '${level}'`)\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","utils","require","settle","cookies","buildURL","buildFullPath","parseHeaders","isURLSameOrigin","transitionalDefaults","AxiosError","CanceledError","parseProtocol","platform","config","Promise","resolve","reject","onCanceled","requestData","data","requestHeaders","headers","responseType","withXSRFToken","done","cancelToken","unsubscribe","signal","removeEventListener","isFormData","isStandardBrowserEnv","request","XMLHttpRequest","auth","username","password","unescape","encodeURIComponent","Authorization","btoa","fullPath","baseURL","url","allowAbsoluteUrls","onloadend","responseHeaders","getAllResponseHeaders","response","responseText","status","statusText","value","err","open","method","toUpperCase","params","paramsSerializer","timeout","onreadystatechange","readyState","responseURL","indexOf","setTimeout","onabort","ECONNABORTED","onerror","ERR_NETWORK","ontimeout","timeoutErrorMessage","transitional","clarifyTimeoutError","ETIMEDOUT","isFunction","xsrfValue","xsrfHeaderName","xsrfCookieName","read","forEach","val","key","toLowerCase","setRequestHeader","isUndefined","withCredentials","onDownloadProgress","addEventListener","onUploadProgress","upload","cancel","type","abort","subscribe","aborted","protocol","protocols","ERR_BAD_REQUEST","send","bind","Axios","mergeConfig","defaults","formDataToJSON","axios","createInstance","defaultConfig","context","instance","prototype","extend","create","instanceConfig","CancelToken","isCancel","VERSION","toFormData","Cancel","all","promises","spread","isAxiosError","formToJSON","thing","isHTMLForm","FormData","executor","TypeError","resolvePromise","promise","token","then","_listeners","i","length","onfulfilled","_resolve","message","reason","throwIfRequested","listener","push","index","splice","source","c","call","ERR_CANCELED","name","inherits","__CANCEL__","InterceptorManager","dispatchRequest","validator","validators","interceptors","configOrUrl","undefined","assertOptions","silentJSONParsing","boolean","forcedJSONParsing","serialize","encode","function","requestInterceptorChain","synchronousRequestInterceptors","interceptor","runWhen","synchronous","unshift","fulfilled","rejected","responseInterceptorChain","chain","Array","apply","concat","shift","newConfig","onFulfilled","onRejected","error","getUri","generateHTTPMethod","isForm","code","Error","captureStackTrace","constructor","stack","toJSON","description","number","fileName","lineNumber","columnNumber","descriptors","Object","defineProperties","defineProperty","from","customProps","axiosError","toFlatObject","obj","cause","assign","handlers","use","options","eject","id","clear","fn","h","isAbsoluteURL","combineURLs","requestedURL","isRelativeURL","transformData","normalizeHeaderName","throwIfCancellationRequested","transformRequest","merge","common","adapter","transformResponse","config1","config2","getMergedValue","target","isPlainObject","isEmptyObject","isArray","slice","mergeDeepProperties","prop","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","keys","configValue","validateStatus","ERR_BAD_RESPONSE","Math","floor","fns","toURLEncodedForm","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","process","toString","isFileList","contentType","hasJSONContentType","isObjectPayload","isObject","JSON","stringify","isArrayBuffer","isBuffer","isStream","isFile","isBlob","isArrayBufferView","buffer","isURLSearchParams","formSerializer","_FormData","env","rawValue","parser","encoder","isString","parse","trim","e","stringifySafely","JSONRequested","strictJSONParsing","maxContentLength","maxBodyLength","classes","Blob","str","charMap","replace","match","AxiosURLSearchParams","_pairs","append","_encode","map","pair","join","thisArg","arguments","hashmarkIndex","serializedParams","serializeFn","relativeURL","write","expires","path","domain","secure","cookie","isNumber","Date","toGMTString","document","RegExp","decodeURIComponent","remove","now","formData","buildPath","isNumericKey","Number","isFinite","isLast","hasOwnProperty","arr","len","arrayToObject","entries","forEachEntry","matchAll","parsePropPath","test","payload","originURL","msie","navigator","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","host","search","hash","hostname","port","pathname","charAt","window","location","requestURL","parsed","normalizedName","ignoreDuplicateOf","split","line","exec","callback","envFormData","isVisitable","removeBrackets","endsWith","renderKey","dots","predicates","metaTokens","indexes","option","visitor","defaultVisitor","useBlob","Symbol","toStringTag","iterator","convertValue","isDate","toISOString","isTypedArray","Buffer","some","isFlatArray","toArray","el","exposedHelpers","build","pop","URLSearchParams","helpers","isNode","deprecatedWarnings","version","formatMessage","opt","desc","opts","ERR_DEPRECATED","console","warn","schema","allowUnknown","ERR_BAD_OPTION_VALUE","result","ERR_BAD_OPTION","isBrowser","cache","kindOf","kindOfTest","getPrototypeOf","l","TypedArray","Uint8Array","_hasOwnProperty","pattern","ArrayBuffer","isView","pipe","product","assignValue","a","b","stripBOM","content","charCodeAt","superConstructor","props","sourceObj","destObj","filter","propFilter","merged","getOwnPropertyNames","searchString","position","String","lastIndex","next","regExp","matches","_a","async","invertPromise","n","t","sleepMillis","shuffle","random","r","o","pickRandomIndices","range","intBetween","containsPoint","x","width","y","height","chance","pick","last","reduce","getDeep","setDeep","u","s","includes","f","roundToNearest","round","_readableState","isStrictlyObject","isEmptyArray","isBoolean","isBlank","isId","isInteger","isIntegerString","isHexString","symbolsArray","lowercaseAlphabet","alphanumericAlphabet","richAsciiAlphabet","unicodeTestingAlphabet","hexAlphabet","asString","min","max","RangeError","checkLimits","asNumber","parseFloat","asInteger","asObject","isUrl","enforceObjectShape","deepMergeInPlace","zip","pushAll","slugify","normalize","getFuzzyMatchScore","startsWith","htmlEntityMap","before","after","beforeLast","lastIndexOf","afterLast","splitOnce","splitAll","flatMap","getExtension","getBasename","shrinkTrim","capitalize","decapitalize","isLetter","isDigit","isLetterOrDigit","wordBreakCharacters","isWordBreakCharacter","indexOfRegex","lineMatches","every","allIndexOf","indexOfEarliest","indexOfWordBreak","indexOfHashtag","lastIndexOfBefore","findWeightedPair","extractBlock","wordBoundary","opening","start","closing","exclusive","BASE64_CHARS","BASE32_CHARS","baseToUint8Array","log2","uint8ArrayToBase","repeat","explodeReplace","breakLine","rest","findCommonPrefix","containsWord","readNextWord","resolveVariableWithDefaultSyntax","resolveRemainingVariablesWithDefaults","toQueryString","createTimeDigits","padStart","humanizeTime","absoluteDays","getTime","DefaultTimestampLabels","today","yesterday","monday","tuesday","wednesday","thursday","friday","saturday","sunday","weeks","DefaultTimeDeltaLabels","seconds","minutes","hours","days","getTimeDelta","labels","throttleTimers","timeUnits","m","d","dayNumberIndex","mapDayNumber","zeroBasedIndex","day","getDayInfoFromDate","getDay","dateUnits","ms","milli","millis","millisecond","milliseconds","sec","second","minute","hour","w","week","month","months","year","years","storageUnitExponents","byte","bytes","kb","kilobyte","kilobytes","mb","megabyte","megabytes","gb","gigabyte","gigabytes","tb","terabyte","terabytes","tinyCache","Map","joinUrl","replaceAll","sortObject","sort","localeCompare","sortAny","sortArray","deepEquals","pickRandomKey","thresholds","longNumberUnits","shortNumberUnits","makeNumber","isNaN","findIndex","clamp","getFlatNotation","flattenInner","indexArray","splitByCount","ceil","tokenizeByLength","sortObjectValues","fromEntries","group","pushToBidirectionalMap","has","set","delete","Optional","of","empty","mapAsync","ifPresent","ifPresentAsync","ifAbsent","ifAbsentAsync","getOrFallback","getOrFallbackAsync","getOrThrow","supplier","get","Node","children","log2Reduce","concatBytes","isPng","isJpg","isWebp","numberToUint64","DataView","setBigUint64","BigInt","numberToUint256","uint256ToNumber","partition","subarray","IOTA_CONSTANTS","keccakPermutate","p","g","$","A","E","M","O","k","T","S","R","I","C","D","B","P","v","U","L","N","j","z","F","W","q","H","V","J","K","Z","Q","G","Y","_","X","nn","en","tn","rn","on","un","cn","sn","ln","an","hn","dn","pn","mn","gn","wn","xn","yn","bytesToNumbers","divideToBlocks","absorb","squeeze","keccak256","fill","binaryPadStart","binaryPadEnd","mod","modInverse","modSqrt","modPow","SECP256K1_P","SECP256K1_N","SECP256K1_X","SECP256K1_Y","ellipticDouble","ellipticAdd","doubleAndAdd","signHash","Uint8ArrayReader","cursor","Uint8ArrayWriter","Chunk","span","writer","hashFunction","MerkleTree","counters","capacity","chunks","onChunk","NOOP","finalize","elevate","FixedPointNumber","scale","fromDecimalString","padEnd","add","assertSameScale","subtract","multiply","divmod","exchange","compare","toDecimalString","getArgument","requireStringArgument","bringToFrontInPlace","addPoint","multiplyPoint","pushPoint","cos","sin","getDistanceBetweenPoints","sqrt","filterCoordinates","isLeftmost","isRightmost","isTopmost","isBottommost","getCorners","isHorizontalLine","isVerticalLine","getSortedRayAngles","atan2","getAngleInRadians","getLineIntersectionPoint","raycast","end","PubSubChannel","subscribers","publish","getSubscriberCount","queue","running","onProcessed","onDrained","concurrency","finally","enqueue","drain","TrieRouter","forks","insert","handler","variableName","handle","hexToUint8Array","parseInt","uint8ArrayToHex","binaryToUint8Array","uint8ArrayToBinary","base64ToUint8Array","uint8ArrayToBase64","base32ToUint8Array","uint8ArrayToBase32","numberToUint8","uint8ToNumber","numberToUint16","setUint16","uint16ToNumber","getUint16","byteOffset","numberToUint32","setUint32","uint32ToNumber","getUint32","uint64ToNumber","getBigUint64","sliceBytes","sha3_256","proximity","commonPrefix","setBit","getBit","equals","padStartToMultiple","padEndToMultiple","xorCypher","isUtf8","privateKeyToPublicKey","compressPublicKey","publicKeyFromCompressed","publicKeyToAddress","signMessage","verifySignature","recoverPublicKey","checksumEncode","floatBetween","signed","makeSeededRng","point","procs","countUnique","makeUnique","values","splitBySize","indexCollection","onlyOrThrow","onlyOrNull","firstOrThrow","firstOrNull","initialize","initialize2D","rotate2D","containsShape","glue","pluck","pickMany","pickManyUnique","pickWeighted","pickGuaranteed","indexOfGuaranteed","makePipe","sortWeighted","unshiftAll","filterAndRemove","pushToBucket","unshiftAndLimit","atRolling","createOscillator","organiseWithLimits","tickPlaybook","ttlMax","ttl","progress","getBooleanArgument","getNumberArgument","requireNumberArgument","bringToFront","findInstance","find","filterInstances","interleave","toggle","createHierarchy","multicall","maxBy","forever","scheduleMany","waitFor","requiredConsecutivePasses","attempts","waitMillis","expandError","runAndSetInterval","setInterval","clearInterval","whereAmI","globalThis","browser","make","sum","average","median","getDistanceFromMidpoint","interpolate","createSequence","increment","decrement","format","longForm","unit","precision","toFixed","fromDecimals","substring","makeStorage","asMegabytes","convertBytes","hexToRgb","rgbToHex","haversineDistanceToMeters","PI","formatDistance","triangularNumber","searchFloat","binomialSample","SQRT2","raceFulfilled","invert","runInParallelBatches","getTimestamp","getUTCHours","getUTCMinutes","secondsToHumanTime","countCycles","cycles","remaining","isoDate","throttle","timeSince","dateTimeSlug","unixTimestamp","fromUtcString","getTimezoneOffset","fromMillis","getProgress","deltaMs","baseTimeMs","totalTimeMs","remainingTimeMs","humanizeProgress","getDayInfoFromDateTimeString","normalizeTime","safeParse","deleteDeep","incrementDeep","ensureDeep","replaceDeep","getFirstDeep","deepMerge2","deepMerge3","mapAllAsync","cloneWithJson","deepEqualsEvery","runOn","zipSum","removeEmptyArrays","removeEmptyValues","flatten","unflatten","mapIterable","filterKeys","filterValues","rethrow","setSomeOnObject","setSomeDeep","flip","getAllPermutations","countTruthyValues","transformToArray","setMulti","incrementMulti","createBidirectionalMap","createTemporalBidirectionalMap","unshiftToBidirectionalMap","addToTemporalBidirectionalMap","validUntil","getFromTemporalBidirectionalMap","createStatefulToggle","diffKeys","uniqueToA","uniqueToB","mapRandomKey","fromObjectString","parseQueryString","hasKey","selectMax","reposition","unwrapSingleKey","parseKeyValues","isNullable","asHexString","byteLength","asSafeString","asIntegerString","asFunction","asBoolean","asDate","asNullableString","asEmptiableString","asId","asTime","asArray","asNullableObject","asStringMap","asNumericDictionary","asUrl","asEmptiable","asNullable","asOptional","enforceArrayShape","isImage","tokenizeByCount","searchHex","searchSubstring","randomHex","randomLetter","randomAlphanumeric","randomRichAscii","randomUnicode","includesAny","normalForm","enumify","escapeHtml","decodeHtmlEntities","fromCharCode","betweenWide","betweenNarrow","getPreLine","containsWords","sortByFuzzyScore","randomize","expand","csvEscape","parseCsv","surroundInOut","normalizeEmail","normalizeFilename","parseFilename","basename","extension","filename","camelToTitle","slugToTitle","slugToCamel","joinHumanly","extractAllBlocks","replaceBlocks","parseHtmlAttributes","readWordsAfterAll","resolveVariables","isValidObjectPathCharacter","linesMatchInOrder","represent","resolveMarkdownLinks","buildUrl","isChinese","replaceBetweenStrings","describeMarkdown","isCapitalized","hasPunctuation","endsWithColon","isBalanced","textToFormat","splitFormatting","string","symbol","splitHashtags","splitUrls","route","generateVariants","variants","avoid","replaceWord","replacePascalCaseWords","stripHtml","measureTextWidth","toLines","levenshteinDistance","findCommonDirectory","asEqual","asTrue","asTruthy","asFalse","asFalsy","asEither","deleteExpired","size","subtractPoint","normalizePoint","findCorners","findLines","dx","dy","raycastCircle","formatArgs","args","useColors","namespace","humanize","diff","color","lastC","save","namespaces","storage","setItem","removeItem","load","getItem","DEBUG","__nwjs","documentElement","style","WebkitAppearance","firebug","exception","table","localStorage","localstorage","destroy","warned","colors","log","debug","formatters","createDebug","prevTime","namespacesCache","enabledCache","enableOverride","enabled","self","curr","prev","coerce","formatter","selectColor","enumerable","configurable","init","delimiter","newDebug","matchesTemplate","template","searchIndex","templateIndex","starIndex","matchIndex","default","disable","names","skips","enable","Boolean","ns","skip","abs","ws","WebSocket","MozWebSocket","global","plural","msAbs","isPlural","long","fmtLong","fmtShort","MAX_LENGTH","MAX_SAFE_INTEGER","safeRe","re","parseOptions","compareIdentifiers","SemVer","loose","includePrerelease","LOOSE","FULL","raw","major","minor","patch","prerelease","num","other","compareMain","comparePre","compareBuild","inc","release","identifier","identifierBase","base","MAX_SAFE_COMPONENT_LENGTH","MAX_SAFE_BUILD_LENGTH","RELEASE_TYPES","SEMVER_SPEC_VERSION","FLAG_INCLUDE_PRERELEASE","FLAG_LOOSE","NODE_DEBUG","numeric","anum","bnum","rcompareIdentifiers","looseOption","freeze","emptyOpts","src","LETTERDASHNUMBER","safeRegexReplacements","createToken","isGlobal","safe","makeSafeRegex","NUMERICIDENTIFIER","NUMERICIDENTIFIERLOOSE","NONNUMERICIDENTIFIER","PRERELEASEIDENTIFIER","PRERELEASEIDENTIFIERLOOSE","BUILDIDENTIFIER","MAINVERSION","PRERELEASE","BUILD","FULLPLAIN","MAINVERSIONLOOSE","PRERELEASELOOSE","LOOSEPLAIN","XRANGEIDENTIFIER","XRANGEIDENTIFIERLOOSE","GTLT","XRANGEPLAIN","XRANGEPLAINLOOSE","COERCEPLAIN","COERCE","COERCEFULL","LONETILDE","tildeTrimReplace","LONECARET","caretTrimReplace","comparatorTrimReplace","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","Function","Binary","Dates","Elliptic","Numbers","Objects","Strings","Pagination","System","Types","AsyncQueue","_debug","DECODER","TextDecoder","ENCODER","TextEncoder","Bytes","unknownInput","toHex","hex","toUint8Array","fromUtf8","utf8","fromSlice","offset","toBase64","toBase32","toUtf8","decode","parseSizeToBytes","sizeStr","kB","MB","GB","TB","PB","SWARM_MANIFEST_CODEC","SWARM_FEED_CODEC","CODEC_TABLE","PrivateKey","static","super","publicKey","PublicKey","sign","digest","Signature","address","EthAddress","toCompressedUint8Array","toCompressedHex","toChecksum","Identifier","fromString","Reference","decoded","cid","codec","reference","convertCidToReference","toCid","unknown","sha256","convertReferenceToCid","isValid","TransactionId","Span","fromBigInt","toBigInt","LENGTH","PeerAddress","BatchId","expectedAddress","Topic","MAX_UINT64","FeedIndex","BeeError","BeeArgumentError","BeeResponseError","responseBody","MAX_CHUNK_PAYLOAD_SIZE","calculateChunkAddress","chunkContent","rootHash","input","calculateBmtRootHash","chunkHash","MAX_PAYLOAD_SIZE","makeContentAddressedChunk","payloadBytes","asContentAddressedChunk","chunkBytes","BeeModes","toBeeMode","LIGHT","ULTRA_LIGHT","DEV","SECTION_SIZE","BRANCHES","CHUNK_SIZE","PSS_TARGET_HEX_LENGTH_MAX","STAMPS_DEPTH_MIN","STAMPS_DEPTH_MAX","TAGS_LIMIT_MIN","TAGS_LIMIT_MAX","RedundancyLevel","RedundancyStrategy","capacityBreakpoints","ENCRYPTION_OFF","OFF","theoreticalVolume","effectiveVolume","batchDepth","utilizationRate","MEDIUM","STRONG","INSANE","PARANOID","ENCRYPTION_ON","Duration","fromMilliseconds","fromSeconds","fromHours","fromDays","fromWeeks","fromYears","fromEndDate","endDate","startDate","parseFromString","duration","toSeconds","toHours","toDays","toWeeks","toYears","toEndDate","isZero","BZZ","state","DIGITS","fromPLUR","plur","toPLURString","toPLURBigInt","toSignificantDigits","digits","plus","minus","divide","gt","gte","lt","lte","eq","exchangeToDAI","daiPerBzz","DAI","fromWei","toWeiBigInt","wei","toWeiString","exchangeToBZZ","file","File","stream","arrayBuffer","isReadable","asNumberString","prepareDownloadOptions","object","redundancyStrategy","fallback","timeoutMs","actPublisher","actHistoryAddress","actTimestamp","prepareUploadOptions","act","deferred","encrypt","pin","tag","prepareCollectionUploadOptions","uploadOptions","errorDocument","indexDocument","redundancyLevel","preparePostageBatchOptions","gasPrice","immutableFlag","label","waitForUsable","waitForUsableTimeout","prepareTransactionOptions","gasLimit","assertData","makeTagUid","tagUid","uid","isTag","MAX_UTILIZATION","getStampUsage","utilization","depth","bucketDepth","pow","getStampTheoreticalBytes","effectiveSizeBreakpoints","getStampEffectiveBytes","encryption","erasureCodeLevel","entry","item","breakpoint","getStampEffectiveBytesBreakpoints","getStampCost","amount","getStampDuration","pricePerBlock","blockTime","amountBigInt","getAmountForDuration","getDepthForSize","toBytes","sizeBreakpoint","convertEnvelopeToMarshaledStamp","envelope","signature","batchId","timestamp","marshalStamp","readFileHeaders","header","dispositionMatch","readContentDispositionFilename","readTagUid","prepareRequestHeaders","stamp","nullableOptions","issuer","isEnvelopeWithBatchId","DELAY_THRESHOLD","DEFAULT_HTTP_CONFIG","accept","Infinity","http","requestConfig","failedAttempts","maybeRunOnRequestHook","endlesslyRetry","onRequest","endpoint","download","requestOptions","SOC_SIGNATURE_OFFSET","SOC_SPAN_OFFSET","SOC_PAYLOAD_OFFSET","makeSingleOwnerChunkFromData","ownerAddress","chunkAddress","recoverChunkOwner","socAddress","owner","makeSOCAddress","makeSingleOwnerChunk","chunk","signer","uploadSingleOwnerChunk","sig","body","historyAddress","socAPI","uploadSingleOwnerChunkData","downloadSingleOwnerChunk","chunkAPI","postageBatchId","resource","feedEndpoint","readFeedUpdateHeaders","feedIndex","feedIndexNext","fetchLatestFeedUpdate","topic","ResourceLocator","makeFeedIdentifier","findNextIndex","feedUpdate","updateFeedWithPayload","uploadResult","rootChunk","uploadSingleOwnerChunkWithWrappedChunk","getFeedUpdateChunkReference","downloadFeedUpdate","hasTimestamp","soc","timestampBytes","downloadFeedUpdateAsCAC","makeFeedReader","update","downloadPayload","cac","downloadReference","probeFeed","makeFeedWriter","at","updateFeedWithReference","uploadReference","uploadPayload","areAllSequentialFeedsUpdateRetrievable","bee","chunkRetrievablePromises","count","updateReferences","getAllSequenceUpdateReferences","downloadChunk","isChunkRetrievable","assertCollection","isCollection","makeFilePath","webkitRelativePath","makeCollectionFromFileList","fileList","getCollectionSize","TarStream","output","PassThrough","currentFileSize","beginFile","alloc","modTime","checksum","createHeader","appendFile","once","endFile","padding","uploadTar","collection","tarStream","responsePromise","fsPath","createReadStream","close","writeTar","bzzEndpoint","uploadFile","uploadCollection","balancesEndpoint","consumedEndpoint","chequebookEndpoint","getLastCashoutAction","peer","uncashedAmount","transactionHash","lastCashedCheque","asCheque","recipient","lastPayout","bounced","asCashoutResult","beneficiary","chequebook","payout","asBin","bin","disconnectedPeers","connectedPeers","population","connected","settlementsEndpoint","STAKE_ENDPOINT","Size","fromBytes","fromKilobytes","fromMegabytes","fromGigabytes","toGigabytes","toFormattedString","normalizeBatchTTL","batchTTL","STAMPS_ENDPOINT","getGlobalPostageBatches","batches","batchID","immutable","getAllPostageBatches","stamps","usage","effectiveBytes","usable","blockNumber","usageText","remainingSize","theoreticalSize","calculateSize","calculateRemainingSize","WALLET_ENDPOINT","SUPPORTED_BEE_VERSION_EXACT","SUPPORTED_BEE_VERSION","SUPPORTED_API_VERSION","getHealth","apiVersion","transactionsEndpoint","toTransaction","to","nonce","created","granteeEndpoint","PINNING_ENDPOINT","checkConnection","stewardshipEndpoint","PATH_SEPARATOR","VERSION_02_HASH","Fork","prefix","node","commonPart","remainingB","parent","remainingA","MantarayNode","newAFork","newBFork","marshal","selfAddress","determineType","prefixLength","metadata","metadataBytes","metadataLengthBytes","unmarshal","reader","addressLength","isType","metadataLength","obfuscationKey","targetAddress","fullPathString","getRootMetadata","getDocsMetadata","resolveFeed","fork","calculateSelfAddress","NULL_ADDRESS","forkBitmap","downloadData","unmarshalFromData","decrypted","versionHash","targetAddressLength","newFork","addFork","tip","bestMatch","matchedPath","findClosest","remainingPath","existing","removeFork","saveRecursively","ref","uploadData","loadRecursively","downloadOptions","closest","current","collect","nodes","collectAndMap","makeCollectionFromFS","dir","buildCollectionRelative","relativePath","dirname","fs","opendir","entryPath","stat","isDirectory","getFolderSize","mimes","aac","abw","ai","arc","avi","azw","bz","bz2","csh","css","csv","doc","dll","dmg","eot","epub","gif","htm","html","ico","ics","jar","jpeg","jpg","js","json","mid","midi","mp2","mp3","mp4","mpa","mpe","mpeg","mpkg","odp","ods","odt","oga","ogv","ogx","otf","png","pdf","ppt","rar","rtf","sh","svg","swf","tar","tif","tiff","ts","ttf","txt","vsd","wav","weba","webm","webp","woff","woff2","xhtml","xls","xlsx","xml","xul","maybeEnrichMime","mime","prepareWebsocketData","assertBeeUrl","urlObject","URL","isValidBeeUrl","Bee","stripLastSlash","network","httpAgent","httpsAgent","prepareRedundantUploadOptions","getRequestOptionsForCall","probeData","contentLength","downloadReadableData","uploadChunk","createGrantees","grantees","historyref","grantee","getGrantees","patchGrantees","history","historyRef","revoke","assertFileData","prepareFileUploadOptions","fileData","fr","FileReader","onload","readAsArrayBuffer","fileArrayBuffer","fileOptions","bzz","downloadFile","downloadReadableFile","uploadFiles","hashDirectory","files","mantaray","tree","readStream","Filename","streamDirectory","total","processed","fileSize","chunksAtLevel","chunkCount","hasIndexHtml","streamFiles","uploadFilesFromDirectory","createTag","seen","sent","startedAt","stored","synced","getAllTags","limit","prepareAllTagsOptions","tags","retrieveTag","deleteTag","updateTag","pinning","unpin","getAllPins","references","getPin","reuploadPinnedData","stewardship","isReferenceRetrievable","isRetrievable","isFeedRetrievable","pssSend","pss","pssSubscribe","onMessage","onError","onClose","preparePssMessageHandler","wsUrl","cancelled","subscription","terminate","onmessage","event","onclose","pssReceive","timeoutMsec","clearTimeout","gsocMine","targetOverlay","gsocSend","gsoc","gsocSubscribe","prepareGsocMessageHandler","createFeedManifest","makeSOCReader","makeSOCWriter","createEnvelope","postEnvelope","rchash","anchor1","anchor2","durationSeconds","isConnected","isGateway","gateway","getNodeAddresses","overlay","underlay","ethereum","pssPublicKey","connectivity","getBlocklist","peers","getPeers","fullNode","removePeer","getTopology","bins","baseAddr","nnLowWatermark","reachability","networkAvailability","bin_0","bin_1","bin_2","bin_3","bin_4","bin_5","bin_6","bin_7","bin_8","bin_9","bin_10","bin_11","bin_12","bin_13","bin_14","bin_15","bin_16","bin_17","bin_18","bin_19","bin_20","bin_21","bin_22","bin_23","bin_24","bin_25","bin_26","bin_27","bin_28","bin_29","bin_30","bin_31","pingPeer","getAllBalances","balances","balance","getPeerBalance","getPastDueConsumptionBalances","getPastDueConsumptionPeerBalance","getChequebookAddress","chequebookAddress","getChequebookBalance","availableBalance","totalBalance","getLastCheques","lastcheques","lastreceived","lastsent","getLastChequesForPeer","cashoutLastCheque","depositTokens","depositBZZToChequebook","amountString","gasPriceString","withdrawTokens","withdrawBZZFromChequebook","withdrawBZZToExternalWallet","states","withdrawDAIToExternalWallet","getSettlements","received","settlements","getAllSettlements","totalSent","totalReceived","getStatus","beeMode","reserveSize","reserveSizeWithinRadius","pullsyncRate","storageRadius","neighborhoodSize","batchCommitment","isReachable","lastSyncedBlock","committedDepth","isWarmingUp","debugStatus","getReadiness","getNodeInfo","chequebookEnabled","swapEnabled","isSupportedExactVersion","isSupportedApiVersion","getMajorSemver","getVersions","supportedBeeVersion","supportedBeeApiVersion","beeVersion","beeApiVersion","getReserveState","commitment","radius","getChainState","block","chainTip","totalAmount","currentPrice","getWalletBalance","bzzBalance","nativeTokenBalance","chainID","chequebookContractAddress","walletAddress","createPostageBatch","chainState","minimumAmount","waitForUsablePostageStamp","buyStorage","getStorageCost","extendStorage","batch","getPostageBatch","depthDelta","multiplier","additionalAmount","currentAmount","amountDelta","transactionId","topUpBatch","diluteBatch","extendStorageSize","delta","extendStorageDuration","getExtensionCost","currentCost","getSizeExtensionCost","getDurationExtensionCost","getPostageBatchBuckets","bucketUpperBound","buckets","bucketID","collisions","getAllPostageBatch","getAllGlobalPostageBatch","getPostageBatches","getAllPendingTransactions","pendingTransactions","transactions","getPendingTransaction","rebroadcastPendingTransaction","cancelPendingTransaction","getStake","stakedAmount","stake","getWithdrawableStake","withdrawableAmount","withdrawSurplusStake","txHash","migrateStake","depositStake","repsonse","getRedistributionState","minimumGasFunds","hasSufficientFunds","isFrozen","isFullySynced","phase","lastWonRound","lastPlayedRound","lastFrozenRound","lastSelectedRound","lastSampleDurationSeconds","reward","fees","isHealthy","time","prepareBeeRequestOptions","BeeDev","Stamper","maxSlot","fromBlank","Uint32Array","fromState","bucket","getState","SWARM_GATEWAY_URL","NULL_STAMP","NULL_TOPIC","NULL_IDENTIFIER","NULL_OWNER","makeMaxTarget","mediumTable","encMediumTable","strongTable","encStrongTable","insaneTable","encInsaneTable","paranoidTable","encParanoidTable","approximateOverheadForRedundancyLevel","level","encrypted","selectTable","supportedChunks","parities","medium","errorTolerance","strong","insane","paranoid","getRedundancyStats","getRedundancyStat"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"index.browser.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAe,MAAID,IAEnBD,EAAY,MAAIC,GACjB,CATD,CASGK,MAAM,I,4BCTTH,EAAOD,QAAU,EAAjBC,K,8BCEA,IAAII,EAAQC,EAAQ,MAChBC,EAASD,EAAQ,MACjBE,EAAUF,EAAQ,MAClBG,EAAWH,EAAQ,MACnBI,EAAgBJ,EAAQ,MACxBK,EAAeL,EAAQ,KACvBM,EAAkBN,EAAQ,MAC1BO,EAAuBP,EAAQ,IAC/BQ,EAAaR,EAAQ,MACrBS,EAAgBT,EAAQ,MACxBU,EAAgBV,EAAQ,MACxBW,EAAWX,EAAQ,MAEvBL,EAAOD,QAAU,SAAoBkB,GACnC,OAAO,IAAIC,SAAQ,SAA4BC,EAASC,GACtD,IAIIC,EAJAC,EAAcL,EAAOM,KACrBC,EAAiBP,EAAOQ,QACxBC,EAAeT,EAAOS,aACtBC,EAAgBV,EAAOU,cAE3B,SAASC,IACHX,EAAOY,aACTZ,EAAOY,YAAYC,YAAYT,GAG7BJ,EAAOc,QACTd,EAAOc,OAAOC,oBAAoB,QAASX,EAE/C,CAEIjB,EAAM6B,WAAWX,IAAgBlB,EAAM8B,+BAClCV,EAAe,gBAGxB,IAAIW,EAAU,IAAIC,eAGlB,GAAInB,EAAOo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BD,GACtC,KAAKrwB,GAAgBY,SACnB,OAAO+vB,EAAYH,GAAmBD,GACxC,QACE,MAAM,IAAI77D,MAAM,4BAA4Bg8D,KAElD,CAzBgBE,CAAYF,EAAOC,IAC1BE,EAAiBC,GAAYv/B,EAEpC,IAAK,IAAIngC,EAAI,EAAGA,EAAIy/D,EAAgBx/D,OAAQD,IAC1C,GAAImnB,GAAUs4C,EAAgBz/D,GAC5B,OAAO0/D,EAAS1/D,GAAKy/D,EAAgBz/D,GAIzC,OAAO0/D,EAASA,EAASz/D,OAAS,GAAKw/D,EAAgBA,EAAgBx/D,OAAS,EAClF,CAuBA,MAAM0/D,GAAS,CACb1rB,MAAO,SACPl5C,MAAO6zC,GAAgBS,OACvBuwB,eAAgB,KAEZC,GAAS,CACb5rB,MAAO,SACPl5C,MAAO6zC,GAAgBU,OACvBswB,eAAgB,KAEZE,GAAS,CACb7rB,MAAO,SACPl5C,MAAO6zC,GAAgBW,OACvBqwB,eAAgB,IAEZG,GAAW,CACf9rB,MAAO,WACPl5C,MAAO6zC,GAAgBY,SACvBowB,eAAgB,IAGX,SAASI,KAMd,MAAO,CACLL,UACAE,UACAC,UACAC,YAEJ,CAEO,SAASE,GAAkBX,GAChC,GAAqB,iBAAVA,EACT,OAAQA,EAAMziE,eACZ,IAAK,SACH,OAAO8iE,GACT,IAAK,SACH,OAAOE,GACT,IAAK,SACH,OAAOC,GACT,IAAK,WACH,OAAOC,GACT,QACE,MAAM,IAAIz8D,MAAM,6BAA6Bg8D,MAInD,OAAQA,GACN,KAAK1wB,GAAgBS,OACnB,OAAOswB,GACT,KAAK/wB,GAAgBU,OACnB,OAAOuwB,GACT,KAAKjxB,GAAgBW,OACnB,OAAOuwB,GACT,KAAKlxB,GAAgBY,SACnB,OAAOuwB,GACT,QACE,MAAM,IAAIz8D,MAAM,6BAA6Bg8D,MAEnD,C","sources":["webpack://BeeJs/webpack/universalModuleDefinition","webpack://BeeJs/./node_modules/axios/index.js","webpack://BeeJs/./node_modules/axios/lib/adapters/xhr.js","webpack://BeeJs/./node_modules/axios/lib/axios.js","webpack://BeeJs/./node_modules/axios/lib/cancel/CancelToken.js","webpack://BeeJs/./node_modules/axios/lib/cancel/CanceledError.js","webpack://BeeJs/./node_modules/axios/lib/cancel/isCancel.js","webpack://BeeJs/./node_modules/axios/lib/core/Axios.js","webpack://BeeJs/./node_modules/axios/lib/core/AxiosError.js","webpack://BeeJs/./node_modules/axios/lib/core/InterceptorManager.js","webpack://BeeJs/./node_modules/axios/lib/core/buildFullPath.js","webpack://BeeJs/./node_modules/axios/lib/core/dispatchRequest.js","webpack://BeeJs/./node_modules/axios/lib/core/mergeConfig.js","webpack://BeeJs/./node_modules/axios/lib/core/settle.js","webpack://BeeJs/./node_modules/axios/lib/core/transformData.js","webpack://BeeJs/./node_modules/axios/lib/defaults/index.js","webpack://BeeJs/./node_modules/axios/lib/defaults/transitional.js","webpack://BeeJs/./node_modules/axios/lib/env/classes/FormData.js","webpack://BeeJs/./node_modules/axios/lib/env/data.js","webpack://BeeJs/./node_modules/axios/lib/helpers/AxiosURLSearchParams.js","webpack://BeeJs/./node_modules/axios/lib/helpers/bind.js","webpack://BeeJs/./node_modules/axios/lib/helpers/buildURL.js","webpack://BeeJs/./node_modules/axios/lib/helpers/combineURLs.js","webpack://BeeJs/./node_modules/axios/lib/helpers/cookies.js","webpack://BeeJs/./node_modules/axios/lib/helpers/formDataToJSON.js","webpack://BeeJs/./node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack://BeeJs/./node_modules/axios/lib/helpers/isAxiosError.js","webpack://BeeJs/./node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack://BeeJs/./node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack://BeeJs/./node_modules/axios/lib/helpers/parseHeaders.js","webpack://BeeJs/./node_modules/axios/lib/helpers/parseProtocol.js","webpack://BeeJs/./node_modules/axios/lib/helpers/spread.js","webpack://BeeJs/./node_modules/axios/lib/helpers/toFormData.js","webpack://BeeJs/./node_modules/axios/lib/helpers/toURLEncodedForm.js","webpack://BeeJs/./node_modules/axios/lib/helpers/validator.js","webpack://BeeJs/./node_modules/axios/lib/platform/browser/classes/FormData.js","webpack://BeeJs/./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","webpack://BeeJs/./node_modules/axios/lib/platform/browser/index.js","webpack://BeeJs/./node_modules/axios/lib/platform/index.js","webpack://BeeJs/./node_modules/axios/lib/utils.js","webpack://BeeJs/./node_modules/cafe-utility/index.js","webpack://BeeJs/./node_modules/debug/src/browser.js","webpack://BeeJs/./node_modules/debug/src/common.js","webpack://BeeJs/./node_modules/form-data/lib/browser.js","webpack://BeeJs/./node_modules/isomorphic-ws/browser.js","webpack://BeeJs/./node_modules/ms/index.js","webpack://BeeJs/./node_modules/semver/classes/semver.js","webpack://BeeJs/./node_modules/semver/functions/major.js","webpack://BeeJs/./node_modules/semver/internal/constants.js","webpack://BeeJs/./node_modules/semver/internal/debug.js","webpack://BeeJs/./node_modules/semver/internal/identifiers.js","webpack://BeeJs/./node_modules/semver/internal/parse-options.js","webpack://BeeJs/./node_modules/semver/internal/re.js","webpack://BeeJs/webpack/bootstrap","webpack://BeeJs/webpack/runtime/compat get default export","webpack://BeeJs/webpack/runtime/define property getters","webpack://BeeJs/webpack/runtime/global","webpack://BeeJs/webpack/runtime/hasOwnProperty shorthand","webpack://BeeJs/webpack/runtime/make namespace object","webpack://BeeJs/./node_modules/cafe-utility/module.mjs","webpack://BeeJs/./src/utils/bytes.ts","webpack://BeeJs/./src/utils/cid.ts","webpack://BeeJs/./src/utils/typed-bytes.ts","webpack://BeeJs/./src/utils/error.ts","webpack://BeeJs/./src/chunk/bmt.ts","webpack://BeeJs/./src/types/debug.ts","webpack://BeeJs/./src/types/index.ts","webpack://BeeJs/./src/utils/duration.ts","webpack://BeeJs/./src/utils/tokens.ts","webpack://BeeJs/./src/utils/file.ts","webpack://BeeJs/./src/utils/type.ts","webpack://BeeJs/./src/utils/stamps.ts","webpack://BeeJs/./src/utils/headers.ts","webpack://BeeJs/./src/utils/http.ts","webpack://BeeJs/./src/modules/chunk.ts","webpack://BeeJs/./src/modules/soc.ts","webpack://BeeJs/./src/chunk/soc.ts","webpack://BeeJs/./src/chunk/cac.ts","webpack://BeeJs/./src/modules/bytes.ts","webpack://BeeJs/./src/modules/feed.ts","webpack://BeeJs/./src/utils/resource-locator.ts","webpack://BeeJs/./src/feed/identifier.ts","webpack://BeeJs/./src/feed/index.ts","webpack://BeeJs/./src/feed/retrievable.ts","webpack://BeeJs/./src/utils/collection.ts","webpack://BeeJs/./src/utils/tar.ts","webpack://BeeJs/./src/utils/tar-uploader.ts","webpack://BeeJs/./src/utils/tar-writer.ts","webpack://BeeJs/./src/modules/bzz.ts","webpack://BeeJs/./src/modules/debug/balance.ts","webpack://BeeJs/./src/modules/debug/chequebook.ts","webpack://BeeJs/./src/modules/debug/connectivity.ts","webpack://BeeJs/./src/modules/debug/settlements.ts","webpack://BeeJs/./src/modules/debug/stake.ts","webpack://BeeJs/./src/utils/size.ts","webpack://BeeJs/./src/utils/workaround.ts","webpack://BeeJs/./src/modules/debug/stamps.ts","webpack://BeeJs/./src/modules/debug/states.ts","webpack://BeeJs/./src/modules/debug/status.ts","webpack://BeeJs/./src/modules/debug/transactions.ts","webpack://BeeJs/./src/modules/grantee.ts","webpack://BeeJs/./src/modules/gsoc.ts","webpack://BeeJs/./src/modules/pinning.ts","webpack://BeeJs/./src/modules/pss.ts","webpack://BeeJs/./src/modules/status.ts","webpack://BeeJs/./src/modules/stewardship.ts","webpack://BeeJs/./src/modules/tag.ts","webpack://BeeJs/./src/manifest/manifest.ts","webpack://BeeJs/./src/utils/collection.node.ts","webpack://BeeJs/./src/utils/mime.ts","webpack://BeeJs/./src/utils/chunk-stream.ts","webpack://BeeJs/./src/utils/data.ts","webpack://BeeJs/./src/utils/url.ts","webpack://BeeJs/./src/bee.ts","webpack://BeeJs/./src/utils/chunk-size.ts","webpack://BeeJs/./src/modules/envelope.ts","webpack://BeeJs/./src/modules/rchash.ts","webpack://BeeJs/./src/bee-dev.ts","webpack://BeeJs/./src/stamper/stamper.ts","webpack://BeeJs/./src/utils/constants.ts","webpack://BeeJs/./src/utils/pss.ts","webpack://BeeJs/./src/utils/redundancy.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"BeeJs\"] = factory();\n\telse\n\t\troot[\"BeeJs\"] = factory();\n})(this, () => {\nreturn ","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar transitionalDefaults = require('../defaults/transitional');\nvar AxiosError = require('../core/AxiosError');\nvar CanceledError = require('../cancel/CanceledError');\nvar parseProtocol = require('../helpers/parseProtocol');\nvar platform = require('../platform');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var withXSRFToken = config.withXSRFToken;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n var xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n // false, 0 (zero number), and '' (empty string) are valid JSON values\n if (!requestData && requestData !== false && requestData !== 0 && requestData !== '') {\n requestData = null;\n }\n\n var protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\nvar formDataToJSON = require('./helpers/formDataToJSON');\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = require('./cancel/CanceledError');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\naxios.toFormData = require('./helpers/toFormData');\n\n// Expose AxiosError class\naxios.AxiosError = require('../lib/core/AxiosError');\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\naxios.formToJSON = function(thing) {\n return formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n};\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar CanceledError = require('./CanceledError');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nvar AxiosError = require('../core/AxiosError');\nvar utils = require('../utils');\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nmodule.exports = CanceledError;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar buildFullPath = require('./buildFullPath');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n var paramsSerializer = config.paramsSerializer;\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n };\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n var fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url: url,\n data: data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nvar prototype = AxiosError.prototype;\nvar descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(function(code) {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = function(error, code, config, request, response, customProps) {\n var axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nmodule.exports = AxiosError;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Clear all interceptors from the stack\n */\nInterceptorManager.prototype.clear = function clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @param {boolean} allowAbsoluteUrls Set to true to allow absolute URLs\n *\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {\n var isRelativeURL = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeURL || allowAbsoluteUrls === false)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar CanceledError = require('../cancel/CanceledError');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n null,\n config.transformRequest\n );\n\n normalizeHeaderName(config.headers, 'Accept');\n normalizeHeaderName(config.headers, 'Content-Type');\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n response.status,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n reason.response.status,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isEmptyObject(source)) {\n return utils.merge({}, target);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'withXSRFToken': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'beforeRedirect': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","'use strict';\n\nvar AxiosError = require('./AxiosError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Number} status HTTP status code\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, status, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers, status);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\nvar AxiosError = require('../core/AxiosError');\nvar transitionalDefaults = require('./transitional');\nvar toFormData = require('../helpers/toFormData');\nvar toURLEncodedForm = require('../helpers/toURLEncodedForm');\nvar platform = require('../platform');\nvar formDataToJSON = require('../helpers/formDataToJSON');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('../adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('../adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n var contentType = headers && headers['Content-Type'] || '';\n var hasJSONContentType = contentType.indexOf('application/json') > -1;\n var isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n var isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n\n var isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') !== -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n var _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","// eslint-disable-next-line strict\nmodule.exports = require('form-data');\n","module.exports = {\n \"version\": \"0.30.0\"\n};","'use strict';\n\nvar toFormData = require('./toFormData');\n\nfunction encode(str) {\n var charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'\\(\\)~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nvar prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n var _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nmodule.exports = AxiosURLSearchParams;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar AxiosURLSearchParams = require('../helpers/AxiosURLSearchParams');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var hashmarkIndex = url.indexOf('#');\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n var _encode = options && options.encode || encode;\n\n var serializeFn = options && options.serialize;\n\n var serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(function(match) {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\nfunction arrayToObject(arr) {\n var obj = {};\n var keys = Object.keys(arr);\n var i;\n var len = keys.length;\n var key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n var name = path[index++];\n\n if (name === '__proto__') return true;\n\n var isNumericKey = Number.isFinite(+name);\n var isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProperty(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n var result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n var obj = {};\n\n utils.forEachEntry(formData, function(name, value) {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nmodule.exports = formDataToJSON;\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.slice(0, i)).toLowerCase();\n val = utils.trim(line.slice(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nmodule.exports = function parseProtocol(url) {\n var match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar AxiosError = require('../core/AxiosError');\nvar envFormData = require('../env/classes/FormData');\n\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nvar predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\nfunction isSpecCompliant(thing) {\n return thing && utils.isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator];\n}\n\n/**\n * Convert a data object to FormData\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n * @returns {Object}\n **/\n\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (envFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n var metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n var visitor = options.visitor || defaultVisitor;\n var dots = options.dots;\n var indexes = options.indexes;\n var _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n var useBlob = _Blob && isSpecCompliant(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n var arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n (utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n var stack = [];\n\n var exposedHelpers = Object.assign(predicates, {\n defaultVisitor: defaultVisitor,\n convertValue: convertValue,\n isVisitable: isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n var result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nmodule.exports = toFormData;\n","'use strict';\n\nvar utils = require('../utils');\nvar toFormData = require('./toFormData');\nvar platform = require('../platform/');\n\nmodule.exports = function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n};\n","'use strict';\n\nvar VERSION = require('../env/data').version;\nvar AxiosError = require('../core/AxiosError');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nmodule.exports = FormData;\n","'use strict';\n\nvar AxiosURLSearchParams = require('../../../helpers/AxiosURLSearchParams');\n\nmodule.exports = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nmodule.exports = {\n isBrowser: true,\n classes: {\n URLSearchParams: require('./classes/URLSearchParams'),\n FormData: require('./classes/FormData'),\n Blob: Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","'use strict';\n\nmodule.exports = require('./node/');\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n// eslint-disable-next-line func-names\nvar kindOf = (function(cache) {\n // eslint-disable-next-line func-names\n return function(thing) {\n var str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n };\n})(Object.create(null));\n\nfunction kindOfTest(type) {\n type = type.toLowerCase();\n return function isKindOf(thing) {\n return kindOf(thing) === type;\n };\n}\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nvar isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a empty Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a empty Object, otherwise false\n */\nfunction isEmptyObject(val) {\n return val && Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nvar isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nvar isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nvar isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nvar isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} thing The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(thing) {\n var pattern = '[object FormData]';\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) ||\n toString.call(thing) === pattern ||\n (isFunction(thing.toString) && thing.toString() === pattern)\n );\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nvar isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n var product;\n if (typeof navigator !== 'undefined' && (\n (product = navigator.product) === 'ReactNative' ||\n product === 'NativeScript' ||\n product === 'NS')\n ) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n */\n\nfunction inherits(constructor, superConstructor, props, descriptors) {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n * @returns {Object}\n */\n\nfunction toFlatObject(sourceObj, destObj, filter, propFilter) {\n var props;\n var i;\n var prop;\n var merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && Object.getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/*\n * determines whether a string ends with the characters of a specified string\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n * @returns {boolean}\n */\nfunction endsWith(str, searchString, position) {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n var lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n * @param {*} [thing]\n * @returns {?Array}\n */\nfunction toArray(thing) {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n var i = thing.length;\n if (!isNumber(i)) return null;\n var arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n// eslint-disable-next-line func-names\nvar isTypedArray = (function(TypedArray) {\n // eslint-disable-next-line func-names\n return function(thing) {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));\n\nfunction forEachEntry(obj, fn) {\n var generator = obj && obj[Symbol.iterator];\n\n var iterator = generator.call(obj);\n\n var result;\n\n while ((result = iterator.next()) && !result.done) {\n var pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\nfunction matchAll(regExp, str) {\n var matches;\n var arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\nvar isHTMLForm = kindOfTest('HTMLFormElement');\n\nvar hasOwnProperty = (function resolver(_hasOwnProperty) {\n return function(obj, prop) {\n return _hasOwnProperty.call(obj, prop);\n };\n})(Object.prototype.hasOwnProperty);\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isEmptyObject: isEmptyObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM,\n inherits: inherits,\n toFlatObject: toFlatObject,\n kindOf: kindOf,\n kindOfTest: kindOfTest,\n endsWith: endsWith,\n toArray: toArray,\n isTypedArray: isTypedArray,\n isFileList: isFileList,\n forEachEntry: forEachEntry,\n matchAll: matchAll,\n isHTMLForm: isHTMLForm,\n hasOwnProperty: hasOwnProperty\n};\n","'use strict'\nvar _a\nObject.defineProperty(exports, '__esModule', { value: !0 }), (exports.Vector = exports.Cache = exports.Assertions = exports.Strings = exports.Types = exports.Objects = exports.Dates = exports.Promises = exports.Numbers = exports.System = exports.Arrays = exports.Random = exports.Elliptic = exports.Binary = exports.RollingValueProvider = exports.TrieRouter = exports.AsyncQueue = exports.PubSubChannel = exports.FixedPointNumber = exports.MerkleTree = exports.Chunk = exports.Uint8ArrayWriter = exports.Uint8ArrayReader = exports.AsyncLazy = exports.Lazy = exports.Optional = void 0)\nasync function invertPromise(n) {\n\treturn new Promise((e, t) => n.then(t, e))\n}\nasync function raceFulfilled(n) {\n\treturn invertPromise(Promise.all(n.map(invertPromise)))\n}\nasync function runInParallelBatches(n, e = 1) {\n\tconst t = splitByCount(n, e),\n\t\tr = [],\n\t\to = t.map(async i => {\n\t\t\tfor (const u of i) r.push(await u())\n\t\t})\n\treturn await Promise.all(o), r\n}\nasync function sleepMillis(n) {\n\treturn new Promise(e =>\n\t\tsetTimeout(() => {\n\t\t\te(!0)\n\t\t}, n)\n\t)\n}\nfunction shuffle(n, e = Math.random) {\n\tfor (let t = n.length - 1; t > 0; t--) {\n\t\tconst r = Math.floor(e() * (t + 1)),\n\t\t\to = n[t]\n\t\t;(n[t] = n[r]), (n[r] = o)\n\t}\n\treturn n\n}\nfunction onlyOrThrow(n) {\n\tif (n.length === 1) return n[0]\n\tthrow Error(`Expected exactly one element, actual: ${n.length}`)\n}\nfunction onlyOrNull(n) {\n\treturn n.length === 1 ? n[0] : null\n}\nfunction firstOrNull(n) {\n\treturn n.length > 0 ? n[0] : null\n}\nfunction firstOrThrow(n) {\n\tif (!n.length) throw Error('Received empty array')\n\treturn n[0]\n}\nfunction initializeArray(n, e) {\n\tconst t = []\n\tfor (let r = 0; r < n; r++) t.push(e(r))\n\treturn t\n}\nfunction rotate2DArray(n) {\n\tconst e = []\n\tfor (let t = 0; t < n[0].length; t++) {\n\t\te.push([])\n\t\tfor (let r = 0; r < n.length; r++) e[t].push(n[r][t])\n\t}\n\treturn e\n}\nfunction initialize2DArray(n, e, t) {\n\tconst r = []\n\tfor (let o = 0; o < n; o++) {\n\t\tr.push([])\n\t\tfor (let i = 0; i < e; i++) r[o].push(t)\n\t}\n\treturn r\n}\nfunction containsShape(n, e, t, r) {\n\tif (t < 0 || r < 0 || r + e[0].length > n[0].length || t + e.length > n.length) return !1\n\tfor (let o = 0; o < e.length; o++) for (let i = 0; i < e[o].length; i++) if (e[o][i] !== void 0 && n[t + o][r + i] !== e[o][i]) return !1\n\treturn !0\n}\nfunction pickRandomIndices(n, e, t = Math.random) {\n\treturn shuffle(range(0, n.length - 1), t).slice(0, e)\n}\nfunction pluck(n, e) {\n\treturn n.map(t => t[e])\n}\nfunction makeSeededRng(n) {\n\tlet e = n,\n\t\tt = 3405648695,\n\t\tr = 3735928559\n\treturn function () {\n\t\treturn (e += t), (t ^= e << 7), (e *= r), (r ^= e << 13), (e ^= t ^ r), (e >>> 0) / 4294967296\n\t}\n}\nfunction intBetween(n, e, t = Math.random) {\n\treturn Math.floor(t() * (e - n + 1)) + n\n}\nfunction floatBetween(n, e, t = Math.random) {\n\treturn t() * (e - n) + n\n}\nfunction signedRandom() {\n\treturn Math.random() * 2 - 1\n}\nfunction containsPoint(n, e, t) {\n\treturn e >= n.x && e < n.x + n.width && t >= n.y && t < n.y + n.height\n}\nfunction randomPoint(n, e, t, r = Math.random) {\n\tlet o, i\n\tdo (o = intBetween(0, n - 1, r)), (i = intBetween(0, e - 1, r))\n\twhile (t && containsPoint(t, o, i))\n\treturn [o, i]\n}\nfunction procs(n, e = Math.random) {\n\tconst t = Math.floor(n),\n\t\tr = n - t\n\treturn chance(r, e) ? t + 1 : t\n}\nfunction chance(n, e = Math.random) {\n\treturn e() < n\n}\nfunction pick(n, e = Math.random) {\n\treturn n[Math.floor(n.length * e())]\n}\nfunction pickMany(n, e, t = Math.random) {\n\tif (e > n.length) throw new Error(`Count (${e}) is greater than array length (${n.length})`)\n\treturn pickRandomIndices(n, e, t).map(o => n[o])\n}\nfunction pickManyUnique(n, e, t, r = Math.random) {\n\tif (e > n.length) throw new Error(`Count (${e}) is greater than array length (${n.length})`)\n\tconst o = []\n\tfor (; o.length < e; ) {\n\t\tconst i = pick(n, r)\n\t\to.some(u => t(u, i)) || o.push(i)\n\t}\n\treturn o\n}\nfunction pickGuaranteed(n, e, t, r, o, i = Math.random) {\n\tconst u = n.filter(c => c !== e && c !== t),\n\t\ts = []\n\tfor (e !== null && s.push(e); u.length && s.length < r; ) {\n\t\tconst c = exports.Random.intBetween(0, u.length - 1, i)\n\t\to(u[c], s) && s.push(u[c]), u.splice(c, 1)\n\t}\n\treturn shuffle(s, i), { values: s, indexOfGuaranteed: e !== null ? s.indexOf(e) : -1 }\n}\nfunction last(n) {\n\tif (!n.length) throw Error('Received empty array')\n\treturn n[n.length - 1]\n}\nfunction pipe(n, e, t) {\n\treturn t(e.reduce((r, o) => o(r), n))\n}\nfunction makePipe(n, e) {\n\treturn t => pipe(t, n, e)\n}\nfunction pickWeighted(n, e, t) {\n\tif ((t === void 0 && (t = Math.random()), n.length !== e.length)) throw new Error('Array length mismatch')\n\tlet r = e.reduce((i, u) => i + u, 0)\n\tconst o = t * r\n\tfor (let i = 0; i < n.length - 1; i++) if (((r -= e[i]), o >= r)) return n[i]\n\treturn last(n)\n}\nfunction sortWeighted(n, e, t = Math.random) {\n\tconst r = e.map(i => t() * i),\n\t\to = []\n\tfor (let i = 0; i < n.length; i++) o.push([n[i], r[i]])\n\treturn o.sort((i, u) => u[1] - i[1]).map(i => i[0])\n}\nfunction getDeep(n, e) {\n\tif (n == null) return null\n\tconst t = e.split('.')\n\tlet r = n\n\tfor (const o of t) {\n\t\tif (r[o] === null || r[o] === void 0) return null\n\t\tr = r[o]\n\t}\n\treturn r\n}\nfunction setDeep(n, e, t) {\n\tconst r = e.split(/\\.|\\[/)\n\tlet o = n\n\tfor (let i = 0; i < r.length; i++) {\n\t\tconst u = r[i],\n\t\t\ts = i < r.length - 1 && r[i + 1].includes(']'),\n\t\t\tf = u.includes(']') ? u.replace(/\\[|\\]/g, '') : u\n\t\tif (i === r.length - 1) return (o[f] = t), t\n\t\tisObject(o[f]) || (s ? (o[f] = []) : (o[f] = {})), (o = o[f])\n\t}\n\treturn t\n}\nfunction incrementDeep(n, e, t = 1) {\n\tconst r = getDeep(n, e) || 0\n\treturn setDeep(n, e, r + t), r\n}\nfunction ensureDeep(n, e, t) {\n\treturn getDeep(n, e) || setDeep(n, e, t)\n}\nfunction deleteDeep(n, e) {\n\tconst t = beforeLast(e, '.'),\n\t\tr = afterLast(e, '.')\n\tif (!t || !r) return\n\tconst o = getDeep(n, t)\n\to && delete o[r]\n}\nfunction replaceDeep(n, e, t) {\n\tconst r = getDeep(n, e)\n\tif (!r) throw new Error(\"Key '\" + e + \"' does not exist.\")\n\treturn setDeep(n, e, t), r\n}\nfunction getFirstDeep(n, e, t) {\n\tfor (const r of e) {\n\t\tconst o = getDeep(n, r)\n\t\tif (o) return o\n\t}\n\tif (t) {\n\t\tconst r = Object.values(n)\n\t\tif (r.length) return r[0]\n\t}\n\treturn null\n}\nasync function forever(n, e, t) {\n\tfor (;;) {\n\t\ttry {\n\t\t\tawait n()\n\t\t} catch (r) {\n\t\t\tt && t('Error in forever', r)\n\t\t}\n\t\tawait sleepMillis(e)\n\t}\n}\nfunction runAndSetInterval(n, e) {\n\tn()\n\tconst t = setInterval(() => {\n\t\tn()\n\t}, e)\n\treturn () => clearInterval(t)\n}\nfunction whereAmI() {\n\tconst n = globalThis.process\n\treturn n ? (n.browser === !0 ? 'browser' : 'node') : 'browser'\n}\nasync function withRetries(n, e, t, r, o, i) {\n\tlet u = null\n\tfor (let s = 0; s <= e; s++)\n\t\ttry {\n\t\t\treturn await n()\n\t\t} catch (c) {\n\t\t\tif (((u = c), s === e)) break\n\t\t\tconst f = t + (r - t) * (s / (e - 1))\n\t\t\to && o('Error in withRetries, retrying', { attempt: s + 1, allowedFailures: e, delayMillis: f, error: c }), i && i(), await sleepMillis(f)\n\t\t}\n\tthrow u\n}\nfunction asMegabytes(n) {\n\treturn n / 1024 / 1024\n}\nfunction convertBytes(n, e = 1024) {\n\treturn n >= e * e * e * e ? (n / e / e / e / e).toFixed(3) + ' TB' : n >= e * e * e ? (n / e / e / e).toFixed(3) + ' GB' : n >= e * e ? (n / e / e).toFixed(3) + ' MB' : n >= e ? (n / e).toFixed(3) + ' KB' : n + ' B'\n}\nfunction hexToRgb(n) {\n\tconst e = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(n.toLowerCase())\n\tif (!e) throw new Error('Invalid hex color: ' + n)\n\treturn [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)]\n}\nfunction rgbToHex(n) {\n\treturn '#' + n.map(e => e.toString(16).padStart(2, '0')).join('')\n}\nfunction haversineDistanceToMeters(n, e, t, r) {\n\tconst i = (n * Math.PI) / 180,\n\t\tu = (t * Math.PI) / 180,\n\t\ts = ((t - n) * Math.PI) / 180,\n\t\tc = ((r - e) * Math.PI) / 180,\n\t\tf = Math.sin(s / 2) * Math.sin(s / 2) + Math.cos(i) * Math.cos(u) * Math.sin(c / 2) * Math.sin(c / 2)\n\treturn 6371e3 * (2 * Math.atan2(Math.sqrt(f), Math.sqrt(1 - f)))\n}\nfunction roundToNearest(n, e) {\n\treturn Math.round(n / e) * e\n}\nfunction formatDistance(n) {\n\treturn n > 1e3 ? (n / 1e3).toFixed(0) + ' km' : n >= 500 ? roundToNearest(n, 100) + ' m' : n >= 100 ? roundToNearest(n, 50) + ' m' : roundToNearest(n, 10) + ' m'\n}\nfunction triangularNumber(n) {\n\treturn (n * (n + 1)) / 2\n}\nfunction searchFloat(n) {\n\tconst e = n.match(/-?\\d+(\\.\\d+)?/)\n\tif (!e) throw Error('No float found in ' + n)\n\treturn parseFloat(e[0])\n}\nfunction binomialSample(n, e, t = Math.random) {\n\tconst r = n * e,\n\t\to = Math.sqrt(n * e * (1 - e)),\n\t\tu = (t() + t() + t() + t() + t() + t() - 3) * Math.SQRT2,\n\t\ts = Math.round(r + o * u)\n\treturn Math.max(0, Math.min(n, s))\n}\nfunction toSignificantDigits(n, e) {\n\tif (!n.includes('.')) return n\n\tif (parseFloat(n) === 0) return '0'\n\tconst [t, r] = n.split('.'),\n\t\to = t.replace('-', ''),\n\t\ti = o.length\n\tif (i >= e) return t\n\tif (!(o === '0')) {\n\t\tconst f = e - i,\n\t\t\tl = r.slice(0, f)\n\t\treturn /[1-9]/.test(l) ? `${t}.${l.replace(/0+$/, '')}` : t\n\t}\n\tconst s = r.match(/^0*/)?.[0].length ?? 0,\n\t\tc = e + s\n\treturn `${t}.${r.slice(0, c)}`\n}\nfunction isObject(n, e = !0) {\n\treturn !n || (e && !isUndefined(n._readableState)) || (e && n.constructor && (n.constructor.isBuffer || n.constructor.name == 'Uint8Array' || n.constructor.name === 'ArrayBuffer' || n.constructor.name === 'ReadableStream')) ? !1 : typeof n == 'object'\n}\nfunction isStrictlyObject(n) {\n\treturn isObject(n) && !Array.isArray(n)\n}\nfunction isEmptyArray(n) {\n\treturn Array.isArray(n) && n.length === 0\n}\nfunction isEmptyObject(n) {\n\treturn isStrictlyObject(n) && Object.keys(n).length === 0\n}\nfunction isUndefined(n) {\n\treturn n === void 0\n}\nfunction isFunction(n) {\n\treturn Object.prototype.toString.call(n) === '[object Function]' || Object.prototype.toString.call(n) === '[object AsyncFunction]'\n}\nfunction isString(n) {\n\treturn Object.prototype.toString.call(n) === '[object String]'\n}\nfunction isNumber(n) {\n\treturn typeof n == 'number' && isFinite(n)\n}\nfunction isBoolean(n) {\n\treturn n === !0 || n === !1\n}\nfunction isDate(n) {\n\treturn Object.prototype.toString.call(n) === '[object Date]'\n}\nfunction isBlank(n) {\n\treturn !isString(n) || n.trim().length === 0\n}\nfunction isId(n) {\n\treturn isNumber(n) && Number.isInteger(n) && n >= 1\n}\nfunction isIntegerString(n) {\n\treturn isString(n) && n.match(/^-?\\d+$/) !== null\n}\nfunction isHexString(n) {\n\treturn isString(n) && n.match(/^(0x)?[0-9a-f]+$/i) !== null\n}\nconst symbols = '!@#$%^&*()_+-=[]{}|;:<>?,./',\n\tsymbolsArray = '!@#$%^&*()_+-=[]{}|;:<>?,./'.split(''),\n\tlowercaseAlphabet = 'abcdefghijklmnopqrstuvwxyz',\n\tuppercaseAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n\tnumericAlphabet = '1234567890',\n\talphanumericAlphabet = lowercaseAlphabet + uppercaseAlphabet + numericAlphabet,\n\trichAsciiAlphabet = alphanumericAlphabet + symbols,\n\tunicodeTestingAlphabet = ['\\u2014', '\\\\', '\\u6771', '\\u4EAC', '\\u90FD', '\\u{1D586}', '\\u{1D587}', '\\u{1D588}', '\\u{1F47E}', '\\u{1F647}', '\\u{1F481}', '\\u{1F645}', '\\u16A0', '\\u16C7', '\\u16BB', '\\u16E6'],\n\thexAlphabet = '0123456789abcdef'\nfunction randomLetterString(n, e = Math.random) {\n\tlet t = ''\n\tfor (let r = 0; r < n; r++) t += lowercaseAlphabet[Math.floor(e() * lowercaseAlphabet.length)]\n\treturn t\n}\nfunction randomAlphanumericString(n, e = Math.random) {\n\tlet t = ''\n\tfor (let r = 0; r < n; r++) t += alphanumericAlphabet[Math.floor(e() * alphanumericAlphabet.length)]\n\treturn t\n}\nfunction randomRichAsciiString(n, e = Math.random) {\n\tlet t = ''\n\tfor (let r = 0; r < n; r++) t += richAsciiAlphabet[Math.floor(e() * richAsciiAlphabet.length)]\n\treturn t\n}\nfunction randomUnicodeString(n, e = Math.random) {\n\tlet t = ''\n\tfor (let r = 0; r < n; r++) t += unicodeTestingAlphabet[Math.floor(e() * unicodeTestingAlphabet.length)]\n\treturn t\n}\nfunction searchHex(n, e) {\n\tconst t = new RegExp(`[0-9a-f]{${e}}`, 'i'),\n\t\tr = n.match(t)\n\treturn r ? r[0] : null\n}\nfunction searchSubstring(n, e, t = symbolsArray) {\n\tconst r = splitAll(n, t)\n\tfor (const o of r) if (e(o)) return o\n\treturn null\n}\nfunction randomHexString(n, e = Math.random) {\n\tlet t = ''\n\tfor (let r = 0; r < n; r++) t += hexAlphabet[Math.floor(e() * hexAlphabet.length)]\n\treturn t\n}\nfunction asIntegerString(n, e) {\n\tif (!isIntegerString(n)) throw new TypeError(`Expected integer string${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\tconst t = BigInt(n)\n\tif (e && ((e.min && t < e.min) || (e.max && t > e.max))) throw RangeError(`Expected integer string${e?.name ? ` for ${e.name}` : ''} in range: ${e.min ?? '-inf'}..${e.max ?? 'inf'}; got: ` + t)\n\treturn n\n}\nfunction asString(n, e) {\n\tif (isBlank(n)) throw new TypeError(`Expected string${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\tif (e && ((e.min !== void 0 && n.length < e.min) || (e.max !== void 0 && n.length > e.max))) throw RangeError(`Expected string${e?.name ? ` for ${e.name}` : ''} length in range: ${e.min ?? '-inf'}..${e.max ?? 'inf'}; got: ${n.length}`)\n\treturn n\n}\nfunction asHexString(n, e) {\n\tif (!isHexString(n)) throw new TypeError(`Expected hex string${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\tif (e?.strictPrefix && !n.startsWith('0x') && !n.startsWith('0X')) throw new TypeError(`Expected hex string with 0x prefix${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\tconst t = n.replace(/^0x/i, '')\n\tif (t.length % 2 !== 0 && !e?.uneven) throw RangeError(`Expected even number of hex digits${e?.name ? ` for ${e.name}` : ''}; got: ` + n)\n\tif (e && e.byteLength && t.length !== e.byteLength * 2) throw RangeError(`Expected hex string${e?.name ? ` for ${e.name}` : ''} of byte length ${e.byteLength}; got: ` + t)\n\treturn `0x${t}`\n}\nfunction asSafeString(n, e) {\n\tif (\n\t\t!asString(n, e)\n\t\t\t.split('')\n\t\t\t.every(t => t === '_' || isLetterOrDigit(t))\n\t)\n\t\tthrow new TypeError(`Expected safe string${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction checkLimits(n, e) {\n\tif ((e.min !== void 0 && n < e.min) || (e.max !== void 0 && n > e.max)) throw RangeError(`Expected value${e?.name ? ` for ${e.name}` : ''} in range: ${e.min ?? '-inf'}..${e.max ?? 'inf'}; got: ${n}`)\n}\nfunction asFunction(n, e) {\n\tif (!isFunction(n)) throw new TypeError(`Expected function${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction asNumber(n, e) {\n\tif (isNumber(n)) return e && checkLimits(n, e), n\n\tif (!isString(n) || !n.match(/^-?\\d+(\\.\\d+)?$/)) throw new TypeError(`Expected number${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\tconst t = parseFloat(n)\n\treturn e && checkLimits(t, e), t\n}\nfunction asInteger(n, e) {\n\treturn Math.trunc(asNumber(n, e))\n}\nfunction asBoolean(n, e) {\n\tif (n === 'true') return !0\n\tif (n === 'false') return !1\n\tif (!isBoolean(n)) throw new TypeError(`Expected boolean${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction asDate(n, e) {\n\tif (!isDate(n)) throw new TypeError(`Expected date${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction asNullableString(n) {\n\treturn isBlank(n) ? null : n\n}\nfunction asEmptiableString(n, e) {\n\tif (!isString(n)) throw new TypeError(`Expected string${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction asId(n, e) {\n\tif (isId(n)) return n\n\tconst t = parseInt(n, 10)\n\tif (!isId(t)) throw new TypeError(`Expected id${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn t\n}\nfunction asTime(n, e) {\n\tif (!isString(n)) throw new TypeError(`Expected time${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\tconst t = n.split(':')\n\tif (t.length !== 2) throw new TypeError(`Expected time${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\tconst r = parseInt(t[0], 10),\n\t\to = parseInt(t[1], 10)\n\tif (!isNumber(r) || !isNumber(o) || r < 0 || r > 23 || o < 0 || o > 59) throw new TypeError(`Expected time, got${e?.name ? ` for ${e.name}` : ''}: ` + n)\n\treturn `${String(r).padStart(2, '0')}:${String(o).padStart(2, '0')}`\n}\nfunction asArray(n, e) {\n\tif (!Array.isArray(n)) throw new TypeError(`Expected array${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction asObject(n, e) {\n\tif (!isStrictlyObject(n)) throw new TypeError(`Expected object${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction asNullableObject(n, e) {\n\treturn n === null ? null : asObject(n, e)\n}\nfunction asStringMap(n, e) {\n\tconst t = asObject(n, e)\n\tfor (const r of Object.keys(t)) if (!isString(t[r])) throw new TypeError(`Expected string map${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn t\n}\nfunction asNumericDictionary(n, e) {\n\tconst t = asObject(n),\n\t\tr = Object.keys(t),\n\t\to = Object.values(t)\n\tif (!r.every(isString) || !o.every(isNumber)) throw new TypeError(`Expected numeric dictionary${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn t\n}\nfunction isUrl(n) {\n\treturn isString(n) && n.match(/^https?:\\/\\/.+/) !== null\n}\nfunction asUrl(n, e) {\n\tif (!isUrl(n)) throw new TypeError(`Expected url${e?.name ? ` for ${e.name}` : ''}, got: ` + n)\n\treturn n\n}\nfunction isNullable(n, e) {\n\treturn e == null ? !0 : n(e)\n}\nfunction asNullable(n, e) {\n\treturn e == null ? null : n(e)\n}\nfunction asEmptiable(n, e) {\n\treturn e === '' ? void 0 : n(e)\n}\nfunction asOptional(n, e) {\n\treturn e == null ? void 0 : n(e)\n}\nfunction enforceObjectShape(n, e) {\n\tfor (const [t, r] of Object.entries(e)) if (!r(n[t])) throw TypeError(`${t} in value does not exist or match shape`)\n\tfor (const t of Object.keys(n)) if (!e[t]) throw TypeError(`${t} exists in value but not in shape`)\n\treturn !0\n}\nfunction enforceArrayShape(n, e) {\n\treturn n.every(t => enforceObjectShape(t, e))\n}\nfunction represent(n, e = 'json', t = 0) {\n\tif (n && isFunction(n.represent)) {\n\t\tconst r = n.represent()\n\t\tif (isString(r)) return e === 'json' && t === 0 ? JSON.stringify(r) : r\n\t}\n\tif (isObject(n, !1)) {\n\t\tif (t > 1) return '[object Object]'\n\t\tif (e === 'json') {\n\t\t\tif (Array.isArray(n)) {\n\t\t\t\tconst o = n.map(i => represent(i, 'json', t + 1))\n\t\t\t\treturn t === 0 ? JSON.stringify(o) : o\n\t\t\t}\n\t\t\tconst r = {}\n\t\t\tn.message && (r.message = represent(n.message, 'json', t + 1))\n\t\t\tfor (const [o, i] of Object.entries(n)) r[o] = represent(i, 'json', t + 1)\n\t\t\treturn t === 0 ? JSON.stringify(r) : r\n\t\t} else if (e === 'key-value') {\n\t\t\tconst r = Object.keys(n)\n\t\t\treturn n.message && !r.includes('message') && r.unshift('message'), r.map(o => `${o}=${JSON.stringify(represent(n[o], 'json', t + 1))}`).join(' ')\n\t\t}\n\t}\n\treturn isUndefined(n) && (n = 'undefined'), t === 0 ? JSON.stringify(n) : n\n}\nfunction expandError(n, e) {\n\tif (isString(n)) return n\n\tconst t = Object.keys(n)\n\tn.message && !t.includes('message') && t.push('message')\n\tconst r = t.map(o => `${o}: ${n[o]}`).join('; ')\n\treturn e && n.stack\n\t\t? r +\n\t\t\t\t`\n` +\n\t\t\t\tn.stack\n\t\t: r\n}\nfunction deepMergeInPlace(n, e) {\n\tif (isStrictlyObject(n) && isStrictlyObject(e)) for (const t in e) isStrictlyObject(e[t]) ? (n[t] || (n[t] = {}), deepMergeInPlace(n[t], e[t])) : Array.isArray(e[t]) ? (n[t] = [...e[t]]) : ((e[t] !== null && e[t] !== void 0) || n[t] === null || n[t] === void 0) && (n[t] = e[t])\n\treturn n\n}\nfunction deepMerge2(n, e) {\n\tconst t = {}\n\treturn deepMergeInPlace(t, n), deepMergeInPlace(t, e), t\n}\nfunction deepMerge3(n, e, t) {\n\tconst r = {}\n\treturn deepMergeInPlace(r, n), deepMergeInPlace(r, e), deepMergeInPlace(r, t), r\n}\nfunction zip(n, e) {\n\tconst t = {}\n\tfor (const r of n) for (const o of Object.keys(r)) t[o] ? (t[o] = e(t[o], r[o])) : (t[o] = r[o])\n\treturn t\n}\nfunction zipSum(n) {\n\treturn zip(n, (e, t) => e + t)\n}\nfunction pushToBucket(n, e, t) {\n\tn[e] || (n[e] = []), n[e].push(t)\n}\nfunction unshiftAndLimit(n, e, t) {\n\tfor (n.unshift(e); n.length > t; ) n.pop()\n}\nfunction atRolling(n, e) {\n\tlet t = e % n.length\n\treturn t < 0 && (t += n.length), n[t]\n}\nfunction pushAll(n, e) {\n\tArray.prototype.push.apply(n, e)\n}\nfunction unshiftAll(n, e) {\n\tArray.prototype.unshift.apply(n, e)\n}\nasync function mapAllAsync(n, e) {\n\tconst t = []\n\tfor (const r of n) t.push(await e(r))\n\treturn t\n}\nfunction glue(n, e) {\n\tconst t = []\n\tfor (let r = 0; r < n.length; r++) t.push(n[r]), r < n.length - 1 && (isFunction(e) ? t.push(e()) : t.push(e))\n\treturn t\n}\nfunction asEqual(n, e) {\n\tif (n !== e) throw Error(`Expected [${n}] to equal [${e}]`)\n\treturn [n, e]\n}\nfunction asTrue(n) {\n\tif (n !== !0) throw Error(`Expected [true], got: [${n}]`)\n\treturn n\n}\nfunction asTruthy(n) {\n\tif (!n) throw Error(`Expected truthy value, got: [${n}]`)\n\treturn n\n}\nfunction asFalse(n) {\n\tif (n !== !1) throw Error(`Expected [false], got: [${n}]`)\n\treturn n\n}\nfunction asFalsy(n) {\n\tif (n) throw Error(`Expected falsy value, got: [${n}]`)\n\treturn n\n}\nfunction asEither(n, e) {\n\tif (!e.includes(n)) throw Error(`Expected any of [${e.join(', ')}], got: [${n}]`)\n\treturn n\n}\nfunction scheduleMany(n, e) {\n\tfor (let t = 0; t < n.length; t++) {\n\t\tconst r = n[t],\n\t\t\to = e[t],\n\t\t\ti = Math.max(0, o.getTime() - Date.now())\n\t\tsetTimeout(r, i)\n\t}\n}\nfunction interpolate(n, e, t) {\n\treturn n + (e - n) * t\n}\nfunction sum(n) {\n\treturn n.reduce((e, t) => e + t, 0)\n}\nfunction average(n) {\n\treturn n.reduce((e, t) => e + t, 0) / n.length\n}\nfunction median(n) {\n\tconst e = [...n].sort((r, o) => r - o),\n\t\tt = Math.floor(e.length / 2)\n\treturn e.length % 2 === 0 ? (e[t] + e[t - 1]) / 2 : e[t]\n}\nfunction getDistanceFromMidpoint(n, e) {\n\treturn n - (e - 1) / 2\n}\nfunction range(n, e) {\n\tconst t = []\n\tfor (let r = n; r <= e; r++) t.push(r)\n\treturn t\n}\nfunction includesAny(n, e) {\n\treturn e.some(t => n.includes(t))\n}\nfunction isChinese(n) {\n\treturn /^[\\u4E00-\\u9FA5]+$/.test(n)\n}\nfunction slugify(n, e = () => !1) {\n\treturn n\n\t\t.toLowerCase()\n\t\t.normalize('NFD')\n\t\t.replace(/[\\u0300-\\u036f]/g, '')\n\t\t.split('')\n\t\t.map(t => (/[a-z0-9]/.test(t) || e(t) ? t : '-'))\n\t\t.join('')\n\t\t.replace(/-+/g, '-')\n\t\t.replace(/^-|-$/g, '')\n}\nfunction normalForm(n) {\n\treturn slugify(n).replaceAll('-', '')\n}\nfunction camelToTitle(n) {\n\treturn capitalize(n.replace(/([A-Z])/g, ' $1'))\n}\nfunction slugToTitle(n) {\n\treturn n.split('-').map(capitalize).join(' ')\n}\nfunction slugToCamel(n) {\n\treturn decapitalize(n.split('-').map(capitalize).join(''))\n}\nfunction joinHumanly(n, e = ', ', t = ' and ') {\n\treturn !n || !n.length ? '' : n.length === 1 ? n[0] : n.length === 2 ? `${n[0]}${t}${n[1]}` : `${n.slice(0, n.length - 1).join(e)}${t}${n[n.length - 1]}`\n}\nfunction surroundInOut(n, e) {\n\treturn e + n.split('').join(e) + e\n}\nfunction enumify(n) {\n\treturn slugify(n).replace(/-/g, '_').toUpperCase()\n}\nfunction getFuzzyMatchScore(n, e) {\n\tif (e.length === 0) return 0\n\tconst t = n.toLowerCase(),\n\t\tr = e.toLowerCase()\n\treturn n === e ? 1e4 : t.startsWith(r) ? 1e4 - n.length : t.includes(r) ? 5e3 - n.length : new RegExp('.*' + r.split('').join('.*') + '.*').test(t) ? 1e3 - n.length : 0\n}\nfunction sortByFuzzyScore(n, e) {\n\treturn n.filter(t => getFuzzyMatchScore(t, e)).sort((t, r) => getFuzzyMatchScore(r, e) - getFuzzyMatchScore(t, e))\n}\nfunction escapeHtml(n) {\n\treturn n.replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"')\n}\nconst htmlEntityMap = { '&': '&', '"': '\"', ''': \"'\", '>': '>', '<': '<' }\nfunction decodeHtmlEntities(n) {\n\tlet e = n.replace(/&#(\\d+);/g, (t, r) => String.fromCharCode(r)).replace(/&#x(\\d+);/g, (t, r) => String.fromCharCode(parseInt(r, 16)))\n\tfor (const [t, r] of Object.entries(htmlEntityMap)) e = e.replaceAll(t, r)\n\treturn e\n}\nfunction before(n, e) {\n\tconst t = n.indexOf(e)\n\treturn t === -1 ? null : n.slice(0, t)\n}\nfunction after(n, e) {\n\tconst t = n.indexOf(e)\n\treturn t === -1 ? null : n.slice(t + e.length)\n}\nfunction beforeLast(n, e) {\n\tconst t = n.lastIndexOf(e)\n\treturn t === -1 ? null : n.slice(0, t)\n}\nfunction afterLast(n, e) {\n\tconst t = n.lastIndexOf(e)\n\treturn t === -1 ? null : n.slice(t + e.length)\n}\nfunction betweenWide(n, e, t) {\n\tconst r = beforeLast(n, t)\n\treturn r ? after(r, e) : null\n}\nfunction betweenNarrow(n, e, t) {\n\tconst r = after(n, e)\n\treturn r ? before(r, t) : null\n}\nfunction splitOnce(n, e, t = !1) {\n\tconst r = t ? n.lastIndexOf(e) : n.indexOf(e)\n\treturn r === -1 ? (t ? [null, n] : [n, null]) : [n.slice(0, r), n.slice(r + e.length)]\n}\nfunction splitAll(n, e) {\n\tlet t = [n]\n\tfor (const r of e) t = t.flatMap(o => o.split(r))\n\treturn t.filter(r => r)\n}\nfunction getExtension(n) {\n\tconst e = last(n.split(/\\\\|\\//g)),\n\t\tt = e.lastIndexOf('.', e.length - 1)\n\treturn t <= 0 ? '' : e.slice(t + 1)\n}\nfunction getBasename(n) {\n\tconst e = last(n.split(/\\\\|\\//g)),\n\t\tt = e.lastIndexOf('.', e.length - 1)\n\treturn t <= 0 ? e : e.slice(0, t)\n}\nfunction normalizeEmail(n) {\n\tlet [e, t] = n.split('@')\n\te = shrinkTrim(e.replaceAll('.', '').toLowerCase()).replaceAll(' ', '')\n\tconst [r] = e.split('+')\n\tif (!r || !t || t.indexOf('.') === -1 || t.indexOf('.') === t.length - 1) throw new Error('Invalid email')\n\treturn (t = shrinkTrim(t.toLowerCase()).replaceAll(' ', '')), `${r}@${t}`\n}\nfunction normalizeFilename(n) {\n\tconst e = getBasename(n),\n\t\tt = getExtension(n)\n\treturn t ? `${e}.${t}` : e\n}\nfunction parseFilename(n) {\n\tconst e = getBasename(n),\n\t\tt = getExtension(n)\n\treturn { basename: e, extension: t, filename: t ? `${e}.${t}` : e }\n}\nfunction randomize(n, e = Math.random) {\n\treturn n.replace(/\\{(.+?)\\}/g, (t, r) => pick(r.split('|'), e))\n}\nfunction expand(n) {\n\tconst e = /\\{(.+?)\\}/,\n\t\tt = n.match(e)\n\tif (!t || !t.index) return [n]\n\tconst r = t[1].split(','),\n\t\to = n.slice(0, t.index),\n\t\ti = n.slice(t.index + t[0].length)\n\tlet u = []\n\tfor (const s of r) {\n\t\tconst c = expand(o + s + i)\n\t\tu = u.concat(c)\n\t}\n\treturn u\n}\nfunction shrinkTrim(n) {\n\treturn n\n\t\t.split(\n\t\t\t`\n`\n\t\t)\n\t\t.map(e => e.trim().replace(/\\s+/g, ' '))\n\t\t.filter(e => e.length > 0).join(`\n`)\n}\nfunction capitalize(n) {\n\treturn n.charAt(0).toUpperCase() + n.slice(1)\n}\nfunction decapitalize(n) {\n\treturn n.charAt(0).toLowerCase() + n.slice(1)\n}\nfunction isLetter(n) {\n\tif (!n) return !1\n\tconst e = n.charCodeAt(0)\n\treturn (e >= 65 && e <= 90) || (e >= 97 && e <= 122)\n}\nfunction isDigit(n) {\n\tif (!n) return !1\n\tconst e = n.charCodeAt(0)\n\treturn e >= 48 && e <= 57\n}\nfunction isLetterOrDigit(n) {\n\treturn isLetter(n) || isDigit(n)\n}\nconst wordBreakCharacters = ` \n\t\\r.,?!:;\"'\\`(){}[]~@#$%^&*-+=|<>/\\\\`.split('')\nfunction isWordBreakCharacter(n) {\n\treturn wordBreakCharacters.includes(n)\n}\nfunction isValidObjectPathCharacter(n) {\n\treturn isLetterOrDigit(n) || n === '.' || n === '[' || n === ']' || n === '_'\n}\nfunction insertString(n, e, t, r, o) {\n\treturn n.slice(0, e) + r + n.slice(e, e + t) + o + n.slice(e + t)\n}\nfunction indexOfRegex(n, e, t = 0) {\n\tconst r = e.exec(n.slice(t))\n\treturn r ? { index: r.index, match: r[0] } : null\n}\nfunction lineMatches(n, e, t = !0) {\n\tif (!t) return e.every(o => (o instanceof RegExp ? o.test(n) : n.indexOf(o, 0) !== -1))\n\tlet r = 0\n\tfor (const o of e)\n\t\tif (o instanceof RegExp) {\n\t\t\tconst i = indexOfRegex(n, o, r)\n\t\t\tif (!i) return !1\n\t\t\tr = i.index + i.match.length\n\t\t} else {\n\t\t\tconst i = n.indexOf(o, r)\n\t\t\tif (i === -1) return !1\n\t\t\tr = i + o.length\n\t\t}\n\treturn !0\n}\nfunction linesMatchInOrder(n, e, t = !0) {\n\tlet r = 0\n\tfor (const o of e) {\n\t\tlet i = !1\n\t\tfor (; !i && r < n.length; ) lineMatches(n[r], o, t) && (i = !0), r++\n\t\tif (!i) return !1\n\t}\n\treturn !0\n}\nfunction csvEscape(n) {\n\treturn n.match(/\"|,/) ? `\"${n.replace(/\"/g, '\"\"')}\"` : n\n}\nfunction allIndexOf(n, e, t = 0) {\n\tconst r = []\n\tlet o = n.indexOf(e, t)\n\tfor (; o !== -1; ) r.push(o), (o = n.indexOf(e, o + e.length))\n\treturn r\n}\nfunction indexOfEarliest(n, e, t = 0) {\n\tlet r = -1\n\tfor (const o of e) {\n\t\tconst i = n.indexOf(o, t)\n\t\ti !== -1 && (r === -1 || i < r) && (r = i)\n\t}\n\treturn r\n}\nfunction indexOfWordBreak(n, e = 0) {\n\tfor (let t = e; t < n.length; t++) if (isWordBreakCharacter(n[t])) return t\n\treturn -1\n}\nfunction indexOfHashtag(n, e = 0) {\n\tfor (let t = e; t < n.length; t++) if (n[t] === '#' && isLetterOrDigit(n[t + 1])) return t\n\treturn -1\n}\nfunction lastIndexOfBefore(n, e, t = 0) {\n\treturn n.slice(0, t).lastIndexOf(e)\n}\nfunction findWeightedPair(n, e = 0, t = '{', r = '}') {\n\tlet o = 1\n\tfor (let i = e; i < n.length; i++)\n\t\tif (n.slice(i, i + r.length) === r) {\n\t\t\tif (--o === 0) return i\n\t\t} else n.slice(i, i + t.length) === t && o++\n\treturn -1\n}\nfunction extractBlock(n, e) {\n\tconst t = e.wordBoundary\n\t\t? indexOfEarliest(\n\t\t\t\tn,\n\t\t\t\t[\n\t\t\t\t\t`${e.opening} `,\n\t\t\t\t\t`${e.opening}\n`\n\t\t\t\t],\n\t\t\t\te.start || 0\n\t\t )\n\t\t: n.indexOf(e.opening, e.start || 0)\n\tif (t === -1) return null\n\tconst r = findWeightedPair(n, t + e.opening.length, e.opening, e.closing)\n\treturn r === -1 ? null : e.exclusive ? n.slice(t + e.opening.length, r) : n.slice(t, r + e.closing.length)\n}\nfunction extractAllBlocks(n, e) {\n\tconst t = []\n\tlet r = e.wordBoundary\n\t\t? indexOfEarliest(\n\t\t\t\tn,\n\t\t\t\t[\n\t\t\t\t\t`${e.opening} `,\n\t\t\t\t\t`${e.opening}\n`\n\t\t\t\t],\n\t\t\t\te.start || 0\n\t\t )\n\t\t: n.indexOf(e.opening, e.start || 0)\n\tfor (;;) {\n\t\tif (r === -1) return t\n\t\tconst o = extractBlock(n, { ...e, start: r })\n\t\tif (!o) return t\n\t\tt.push(o),\n\t\t\t(r = e.wordBoundary\n\t\t\t\t? indexOfEarliest(\n\t\t\t\t\t\tn,\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t`${e.opening} `,\n\t\t\t\t\t\t\t`${e.opening}\n`\n\t\t\t\t\t\t],\n\t\t\t\t\t\tr + o.length\n\t\t\t\t )\n\t\t\t\t: n.indexOf(e.opening, r + o.length))\n\t}\n}\nfunction replaceBlocks(n, e, t) {\n\tlet r = 0\n\tfor (;;) {\n\t\tconst o = exports.Strings.extractBlock(n, { ...t, start: r })\n\t\tif (!o) return n\n\t\tconst i = e(o)\n\t\t;(r = n.indexOf(o, r) + i.length), (n = n.replace(o, i))\n\t}\n}\nfunction splitFormatting(n, e) {\n\tconst t = []\n\tlet r = 0\n\tfor (; r < n.length; ) {\n\t\tconst o = n.indexOf(e, r)\n\t\tif (o === -1) {\n\t\t\tt.push({ string: n.slice(r), symbol: null })\n\t\t\tbreak\n\t\t}\n\t\tconst i = n.indexOf(e, o + e.length)\n\t\tif ((o > r && i !== -1 && t.push({ string: n.slice(r, o), symbol: null }), i === -1)) {\n\t\t\tt.push({ string: n.slice(r), symbol: null })\n\t\t\tbreak\n\t\t}\n\t\tt.push({ string: n.slice(o + e.length, i), symbol: e }), (r = i + e.length)\n\t}\n\treturn t\n}\nfunction splitHashtags(n) {\n\tconst e = []\n\tlet t = 0\n\tfor (; t < n.length; ) {\n\t\tconst r = indexOfHashtag(n, t)\n\t\tif (r === -1) {\n\t\t\te.push({ string: n.slice(t), symbol: null })\n\t\t\tbreak\n\t\t}\n\t\tconst o = indexOfWordBreak(n, r + 1)\n\t\tif (o === -1) {\n\t\t\te.push({ string: n.slice(t, r), symbol: null }), e.push({ string: n.slice(r + 1), symbol: '#' })\n\t\t\tbreak\n\t\t}\n\t\tr > t && e.push({ string: n.slice(t, r), symbol: null }), e.push({ string: n.slice(r + 1, o), symbol: '#' }), (t = o)\n\t}\n\treturn e\n}\nfunction splitUrls(n) {\n\tconst e = []\n\tlet t = 0\n\tfor (; t < n.length; ) {\n\t\tconst r = indexOfEarliest(n, ['http://', 'https://'], t)\n\t\tif (r === -1) {\n\t\t\te.push({ string: n.slice(t), symbol: null })\n\t\t\tbreak\n\t\t}\n\t\tconst o = indexOfEarliest(\n\t\t\tn,\n\t\t\t[\n\t\t\t\t' ',\n\t\t\t\t`\n`\n\t\t\t],\n\t\t\tr\n\t\t)\n\t\tif (o === -1) {\n\t\t\tr > t && e.push({ string: n.slice(t, r), symbol: null }), e.push({ string: n.slice(r), symbol: 'http' })\n\t\t\tbreak\n\t\t}\n\t\tr > t && e.push({ string: n.slice(t, r), symbol: null }), e.push({ string: n.slice(r, o), symbol: 'http' }), (t = o)\n\t}\n\treturn e\n}\nconst BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\tBASE32_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'\nfunction base64ToUint8Array(n) {\n\treturn baseToUint8Array(n, BASE64_CHARS)\n}\nfunction uint8ArrayToBase64(n) {\n\treturn uint8ArrayToBase(n, BASE64_CHARS)\n}\nfunction base32ToUint8Array(n) {\n\treturn baseToUint8Array(n, BASE32_CHARS)\n}\nfunction uint8ArrayToBase32(n) {\n\treturn uint8ArrayToBase(n, BASE32_CHARS)\n}\nfunction baseToUint8Array(n, e) {\n\tconst t = '=',\n\t\tr = e.length\n\tlet o = 0,\n\t\ti = 0\n\tconst u = []\n\tfor (let s = 0; s < n.length; s++) {\n\t\tconst c = n[s]\n\t\tif (c === t) break\n\t\tconst f = e.indexOf(c)\n\t\tif (f === -1) throw new Error(`Invalid character: ${c}`)\n\t\t;(i = (i << Math.log2(r)) | f), (o += Math.log2(r)), o >= 8 && ((o -= 8), u.push((i >> o) & 255))\n\t}\n\treturn new Uint8Array(u)\n}\nfunction uint8ArrayToBase(n, e) {\n\tconst t = e.length\n\tlet r = 0,\n\t\to = 0,\n\t\ti = ''\n\tfor (let u = 0; u < n.length; u++) for (o = (o << 8) | n[u], r += 8; r >= Math.log2(t); ) (r -= Math.log2(t)), (i += e[(o >> r) & (t - 1)])\n\treturn r > 0 && (i += e[(o << (Math.log2(t) - r)) & (t - 1)]), i.length % 4 !== 0 && (i += '='.repeat(4 - (i.length % 4))), i\n}\nfunction hexToUint8Array(n) {\n\t;(n.startsWith('0x') || n.startsWith('0X')) && (n = n.slice(2))\n\tconst e = n.length / 2,\n\t\tt = new Uint8Array(e)\n\tfor (let r = 0; r < e; r++) {\n\t\tconst o = parseInt(n.slice(r * 2, r * 2 + 2), 16)\n\t\tt[r] = o\n\t}\n\treturn t\n}\nfunction uint8ArrayToHex(n) {\n\treturn Array.from(n)\n\t\t.map(e => e.toString(16).padStart(2, '0'))\n\t\t.join('')\n}\nfunction uint8ArrayToBinary(n) {\n\treturn Array.from(n)\n\t\t.map(e => e.toString(2).padStart(8, '0'))\n\t\t.join('')\n}\nfunction binaryToUint8Array(n) {\n\tconst e = Math.ceil(n.length / 8),\n\t\tt = new Uint8Array(e)\n\tfor (let r = 0; r < e; r++) {\n\t\tconst o = parseInt(n.slice(r * 8, r * 8 + 8), 2)\n\t\tt[r] = o\n\t}\n\treturn t\n}\nfunction route(n, e) {\n\tconst t = n.split('/').filter(i => i),\n\t\tr = e.split('/').filter(i => i)\n\tif (t.length !== r.length) return null\n\tconst o = {}\n\tfor (let i = 0; i < t.length; i++) {\n\t\tconst u = t[i]\n\t\tif (u.startsWith(':')) o[u.slice(1)] = r[i]\n\t\telse if (u !== r[i]) return null\n\t}\n\treturn o\n}\nfunction explodeReplace(n, e, t) {\n\tconst r = []\n\tfor (const o of t) o !== e && r.push(n.replace(e, o))\n\treturn r\n}\nfunction generateVariants(n, e, t, r = Math.random) {\n\tconst o = exports.Arrays.shuffle(\n\t\t\te.map(u => ({\n\t\t\t\tvariants: exports.Arrays.shuffle(\n\t\t\t\t\tu.variants.map(s => s),\n\t\t\t\t\tr\n\t\t\t\t),\n\t\t\t\tavoid: u.avoid\n\t\t\t})),\n\t\t\tr\n\t\t),\n\t\ti = []\n\tfor (const u of o) {\n\t\tconst s = u.variants.filter(f => f !== u.avoid),\n\t\t\tc = s.find(f => n.includes(f))\n\t\tif (c && (pushAll(i, explodeReplace(n, c, s)), i.length >= t)) break\n\t}\n\tif (i.length < t)\n\t\tfor (const u of o) {\n\t\t\tconst s = u.variants.find(c => n.includes(c))\n\t\t\tif (s && (pushAll(i, explodeReplace(n, s, u.variants)), i.length >= t)) break\n\t\t}\n\treturn i.slice(0, t)\n}\nfunction replaceWord(n, e, t, r = !1) {\n\tconst o = new RegExp(r ? `(?<=\\\\s|^)${e}(?=\\\\s|$)` : `\\\\b${e}\\\\b`, 'g')\n\treturn n.replace(o, t)\n}\nfunction replacePascalCaseWords(n, e) {\n\tconst t = /\\b[A-Z][a-zA-Z0-9]*\\b/g\n\treturn n.replace(t, r => (r.toUpperCase() === r ? r : e(r)))\n}\nfunction stripHtml(n) {\n\treturn n.replace(/<[^>]*>/g, '')\n}\nfunction breakLine(n) {\n\tconst e = n.lastIndexOf(' ')\n\tif (e === -1) return { line: n, rest: '' }\n\tconst t = n.slice(0, e),\n\t\tr = n.slice(e + 1)\n\treturn { line: t, rest: r }\n}\nfunction measureTextWidth(n, e = {}) {\n\treturn [...n].reduce((t, r) => t + (e[r] || 1), 0)\n}\nfunction toLines(n, e, t = {}) {\n\tconst r = []\n\tlet o = '',\n\t\ti = 0\n\tfor (let u = 0; u < n.length; u++) {\n\t\tconst s = n[u],\n\t\t\tc = t[s] || 1\n\t\tif (((o += s), (i += c), i > e)) {\n\t\t\tconst { line: f, rest: l } = breakLine(o)\n\t\t\tr.push(f),\n\t\t\t\t(o = l),\n\t\t\t\t(i = l\n\t\t\t\t\t.split('')\n\t\t\t\t\t.map(a => t[a] || 1)\n\t\t\t\t\t.reduce((a, h) => a + h, 0))\n\t\t}\n\t}\n\treturn o && r.push(o), r\n}\nfunction levenshteinDistance(n, e) {\n\tconst t = []\n\tfor (let r = 0; r <= n.length; r++) t[r] = [r]\n\tfor (let r = 0; r <= e.length; r++) t[0][r] = r\n\tfor (let r = 1; r <= n.length; r++)\n\t\tfor (let o = 1; o <= e.length; o++) {\n\t\t\tconst i = n[r - 1] === e[o - 1] ? 0 : 1\n\t\t\tt[r][o] = Math.min(t[r - 1][o] + 1, t[r][o - 1] + 1, t[r - 1][o - 1] + i)\n\t\t}\n\treturn t[n.length][e.length]\n}\nfunction findCommonPrefix(n) {\n\tconst e = n.reduce((r, o) => (r.length < o.length ? r : o))\n\tlet t = ''\n\tfor (let r = 0; r < e.length; r++) {\n\t\tconst o = e[r]\n\t\tif (n.every(i => i[r] === o)) t += o\n\t\telse break\n\t}\n\treturn t\n}\nfunction findCommonDirectory(n) {\n\tconst e = findCommonPrefix(n),\n\t\tt = e.lastIndexOf('/')\n\treturn t === -1 ? '' : e.slice(0, t + 1)\n}\nfunction containsWord(n, e) {\n\treturn new RegExp(`\\\\b${e}\\\\b`).test(n)\n}\nfunction containsWords(n, e, t) {\n\treturn t === 'any' ? e.some(r => containsWord(n, r)) : e.every(r => containsWord(n, r))\n}\nfunction parseHtmlAttributes(n) {\n\tconst e = {},\n\t\tt = n.match(/([a-z\\-]+)=\"([^\"]+)\"/g)\n\tif (t)\n\t\tfor (const r of t) {\n\t\t\tconst [o, i] = splitOnce(r, '=')\n\t\t\te[o] = i.slice(1, i.length - 1)\n\t\t}\n\treturn e\n}\nfunction readNextWord(n, e, t = []) {\n\tlet r = ''\n\tfor (; e < n.length && (isLetterOrDigit(n[e]) || t.includes(n[e])); ) r += n[e++]\n\treturn r\n}\nfunction readWordsAfterAll(n, e, t = []) {\n\tconst r = allIndexOf(n, e),\n\t\to = []\n\tfor (const i of r) o.push(readNextWord(n, i + e.length, t))\n\treturn o\n}\nfunction resolveVariables(n, e, t = '$', r = ':') {\n\tfor (const o in e) n = resolveVariableWithDefaultSyntax(n, o, e[o], t, r)\n\treturn (n = resolveRemainingVariablesWithDefaults(n)), n\n}\nfunction resolveVariableWithDefaultSyntax(n, e, t, r = '$', o = ':') {\n\tif (t === '') return n\n\tlet i = n.indexOf(`${r}${e}`)\n\tfor (; i !== -1; ) {\n\t\tif (n[i + e.length + 1] === o)\n\t\t\tif (n[i + e.length + 2] === o) n = n.replace(`${r}${e}${o}${o}`, t)\n\t\t\telse {\n\t\t\t\tconst s = readNextWord(n, i + e.length + 2, ['_'])\n\t\t\t\tn = n.replace(`${r}${e}${o}${s}`, t)\n\t\t\t}\n\t\telse n = n.replace(`${r}${e}`, t)\n\t\ti = n.indexOf(`${r}${e}`, i + t.length)\n\t}\n\treturn n\n}\nfunction resolveRemainingVariablesWithDefaults(n, e = '$', t = ':') {\n\tlet r = n.indexOf(e)\n\tfor (; r !== -1; ) {\n\t\tconst o = readNextWord(n, r + 1)\n\t\tif (n[r + o.length + 1] === t)\n\t\t\tif (n[r + o.length + 2] === t) n = n.replace(`${e}${o}${t}${t}`, '')\n\t\t\telse {\n\t\t\t\tconst u = readNextWord(n, r + o.length + 2)\n\t\t\t\tn = n.replace(`${e}${o}${t}${u}`, u)\n\t\t\t}\n\t\tr = n.indexOf(e, r + 1)\n\t}\n\treturn n\n}\nfunction resolveMarkdownLinks(n, e) {\n\tlet t = n.indexOf('](')\n\tfor (; t !== -1; ) {\n\t\tconst r = lastIndexOfBefore(n, '[', t),\n\t\t\to = n.indexOf(')', t)\n\t\tif (r !== -1 && o !== -1) {\n\t\t\tconst [i, u] = n.slice(r + 1, o).split(']('),\n\t\t\t\ts = e(i, u)\n\t\t\tn = n.slice(0, r) + s + n.slice(o + 1)\n\t\t}\n\t\tt = n.indexOf('](', t + 1)\n\t}\n\treturn n\n}\nfunction toQueryString(n, e = !0) {\n\tconst t = Object.entries(n)\n\t\t.filter(([r, o]) => o != null)\n\t\t.map(([r, o]) => `${r}=${encodeURIComponent(o)}`)\n\t\t.join('&')\n\treturn t ? (e ? '?' : '') + t : ''\n}\nfunction parseQueryString(n) {\n\tconst e = {},\n\t\tt = n.split('&')\n\tfor (const r of t) {\n\t\tconst [o, i] = r.split('=')\n\t\to && i && (e[o] = decodeURIComponent(i))\n\t}\n\treturn e\n}\nfunction hasKey(n, e) {\n\treturn Object.prototype.hasOwnProperty.call(n, e)\n}\nfunction selectMax(n, e) {\n\tlet t = null,\n\t\tr = -1 / 0\n\tfor (const [o, i] of Object.entries(n)) {\n\t\tconst u = e(i)\n\t\tu > r && ((r = u), (t = o))\n\t}\n\treturn t ? [t, n[t]] : null\n}\nfunction reposition(n, e, t, r) {\n\tconst o = n.find(u => u[e] === t),\n\t\ti = n.find(u => u[e] === t + r)\n\to && i ? ((o[e] = t + r), (i[e] = t)) : o && (o[e] = t + r), n.sort((u, s) => asNumber(u[e]) - asNumber(s[e])), n.forEach((u, s) => (u[e] = s + 1))\n}\nfunction unwrapSingleKey(n) {\n\tconst e = Object.keys(n)\n\tif (e.length === 1) return n[e[0]]\n\tthrow new Error('Expected object to have a single key')\n}\nfunction parseKeyValues(n, e = ':') {\n\treturn Object.fromEntries(\n\t\tn\n\t\t\t.map(t => splitOnce(t, e))\n\t\t\t.map(t => (t[0] && t[1] ? [shrinkTrim(t[0]), shrinkTrim(t[1])] : null))\n\t\t\t.filter(t => t)\n\t)\n}\nfunction errorMatches(n, e) {\n\tif (!n) return !1\n\tconst t = n.message\n\treturn typeof t == 'string' && t.includes(e)\n}\nfunction buildUrl(n, e, t) {\n\treturn joinUrl([n, e]) + toQueryString(t || {})\n}\nfunction parseCsv(n, e = ',', t = '\"') {\n\tconst r = []\n\tlet o = '',\n\t\ti = !1\n\tconst u = n.split('')\n\tfor (const s of u) s === e && !i ? (r.push(o), (o = '')) : s === t && ((!o && !i) || i) ? (i = !i) : (o += s)\n\treturn r.push(o), r\n}\nfunction humanizeProgress(n) {\n\treturn `[${Math.floor(n.progress * 100)}%] ${humanizeTime(n.deltaMs)} out of ${humanizeTime(n.totalTimeMs)} (${humanizeTime(n.remainingTimeMs)} left) [${Math.round(n.baseTimeMs)} ms each]`\n}\nasync function waitFor(n, e) {\n\tlet t = e.requiredConsecutivePasses || 1,\n\t\tr = 0\n\tfor (let o = 0; o < e.attempts; o++) {\n\t\ttry {\n\t\t\tif (await n()) {\n\t\t\t\tif ((r++, r >= t)) return\n\t\t\t} else r = 0\n\t\t} catch {\n\t\t\tr = 0\n\t\t}\n\t\to < e.attempts - 1 && (await sleepMillis(e.waitMillis))\n\t}\n\tthrow Error('Timed out waiting for predicate')\n}\nfunction filterAndRemove(n, e) {\n\tconst t = []\n\tfor (let r = n.length - 1; r >= 0; r--) e(n[r]) && t.push(n.splice(r, 1)[0])\n\treturn t\n}\nfunction cloneWithJson(n) {\n\treturn JSON.parse(JSON.stringify(n))\n}\nfunction unixTimestamp(n) {\n\treturn Math.ceil((n || Date.now()) / 1e3)\n}\nfunction isoDate(n) {\n\treturn (n || new Date()).toISOString().slice(0, 10)\n}\nfunction dateTimeSlug(n) {\n\treturn (n || new Date()).toISOString().slice(0, 19).replace(/T|:/g, '-')\n}\nfunction fromUtcString(n) {\n\tconst e = new Date(n)\n\treturn new Date(e.getTime() - e.getTimezoneOffset() * 6e4)\n}\nfunction fromMillis(n) {\n\treturn new Date(n)\n}\nfunction createTimeDigits(n) {\n\treturn String(Math.floor(n)).padStart(2, '0')\n}\nfunction normalizeTime(n) {\n\tlet [e, t] = n.split(':')\n\tisNumber(parseInt(e, 10)) || (e = '0'), isNumber(parseInt(t, 10)) || (t = '0')\n\tlet r = clamp(asInteger(e), 0, 23),\n\t\to = clamp(asInteger(t), 0, 59)\n\treturn `${createTimeDigits(r)}:${createTimeDigits(o)}`\n}\nfunction humanizeTime(n) {\n\tconst e = Math.floor(n / 36e5)\n\tn = n % 36e5\n\tconst t = Math.floor(n / 6e4)\n\tn = n % 6e4\n\tconst r = Math.floor(n / 1e3)\n\treturn e ? `${createTimeDigits(e)}:${createTimeDigits(t)}:${createTimeDigits(r)}` : `${createTimeDigits(t)}:${createTimeDigits(r)}`\n}\nfunction absoluteDays(n) {\n\treturn Math.floor((isDate(n) ? n.getTime() : n) / 864e5)\n}\nconst DefaultTimestampLabels = { today: (n, e) => createTimeDigits(n) + ':' + createTimeDigits(e), yesterday: () => 'Yesterday', monday: () => 'Mon', tuesday: () => 'Tue', wednesday: () => 'Wed', thursday: () => 'Thu', friday: () => 'Fri', saturday: () => 'Sat', sunday: () => 'Sun', weeks: n => `${n}w` }\nfunction getTimestamp(n, e) {\n\tconst t = new Date(e?.now || Date.now()),\n\t\tr = e?.labels || DefaultTimestampLabels,\n\t\to = isDate(n) ? n : new Date(n)\n\tif (absoluteDays(t) === absoluteDays(o)) return r.today(o.getUTCHours(), o.getUTCMinutes(), o.getUTCHours() > 12)\n\tif (absoluteDays(t) - absoluteDays(o) === 1) return r.yesterday()\n\tconst i = getDayInfoFromDate(o)\n\treturn absoluteDays(t) - absoluteDays(o) < 7 ? r[i.day]() : r.weeks(Math.round((t.getTime() - o.getTime()) / 6048e5))\n}\nconst DefaultTimeDeltaLabels = { now: () => 'A few seconds', seconds: n => `${n} seconds`, minutes: n => `${n} minutes`, hours: n => `${n} hours`, days: n => `${n} days`, weeks: n => `${n} weeks` }\nfunction getTimeDelta(n, e) {\n\tconst t = e?.now ?? Date.now(),\n\t\tr = e?.labels || DefaultTimeDeltaLabels,\n\t\to = exports.Types.isDate(n) ? n.getTime() : n\n\tlet i = (t - o) / 1e3\n\treturn i < 10 ? r.now() : i < 120 ? r.seconds(Math.floor(i)) : ((i /= 60), i < 120 ? r.minutes(Math.floor(i)) : ((i /= 60), i < 48 ? r.hours(Math.floor(i)) : ((i /= 24), i < 14 ? r.days(Math.floor(i)) : ((i /= 7), r.weeks(Math.floor(i))))))\n}\nfunction secondsToHumanTime(n, e = DefaultTimeDeltaLabels) {\n\treturn getTimeDelta(0, { now: n * 1e3, labels: e })\n}\nfunction countCycles(n, e, t) {\n\tconst o = (t?.now ?? Date.now()) - n,\n\t\ti = Math.floor(o / e),\n\t\tu = e / (t?.precision ?? 1) - Math.ceil((o % e) / (t?.precision ?? 1))\n\treturn { cycles: i, remaining: u }\n}\nconst throttleTimers = {}\nfunction throttle(n, e) {\n\treturn !throttleTimers[n] || Date.now() > throttleTimers[n] ? ((throttleTimers[n] = Date.now() + e), !0) : !1\n}\nconst timeUnits = { s: 1e3, m: 6e4, h: 36e5, d: 864e5 }\nfunction timeSince(n, e, t) {\n\treturn (e = isDate(e) ? e.getTime() : e), (t = t ? (isDate(t) ? t.getTime() : t) : Date.now()), (t - e) / timeUnits[n]\n}\nfunction getProgress(n, e, t, r) {\n\tr || (r = Date.now())\n\tconst o = e / t,\n\t\ti = r - n,\n\t\tu = i / e,\n\t\ts = u * t,\n\t\tc = s - i\n\treturn { deltaMs: i, progress: o, baseTimeMs: u, totalTimeMs: s, remainingTimeMs: c }\n}\nconst dayNumberIndex = { 0: 'sunday', 1: 'monday', 2: 'tuesday', 3: 'wednesday', 4: 'thursday', 5: 'friday', 6: 'saturday' }\nfunction mapDayNumber(n) {\n\treturn { zeroBasedIndex: n, day: dayNumberIndex[n] }\n}\nfunction getDayInfoFromDate(n) {\n\treturn mapDayNumber(n.getDay())\n}\nfunction getDayInfoFromDateTimeString(n) {\n\treturn getDayInfoFromDate(new Date(n))\n}\nfunction seconds(n) {\n\treturn n * 1e3\n}\nfunction minutes(n) {\n\treturn n * 6e4\n}\nfunction hours(n) {\n\treturn n * 36e5\n}\nfunction days(n) {\n\treturn n * 864e5\n}\nconst dateUnits = { ms: 1, milli: 1, millis: 1, millisecond: 1, milliseconds: 1, s: 1e3, sec: 1e3, second: 1e3, seconds: 1e3, m: 6e4, min: 6e4, minute: 6e4, minutes: 6e4, h: 36e5, hour: 36e5, hours: 36e5, d: 864e5, day: 864e5, days: 864e5, w: 6048e5, week: 6048e5, weeks: 6048e5, month: 2592e6, months: 2592e6, y: 31536e6, year: 31536e6, years: 31536e6 }\nfunction makeDate(n) {\n\tconst e = parseFloat(n)\n\tif (isNaN(e)) throw Error('makeDate got NaN for input')\n\tconst t = n\n\t\t\t.replace(/^-?[0-9.]+/, '')\n\t\t\t.trim()\n\t\t\t.toLowerCase(),\n\t\tr = t === '' ? 1 : dateUnits[t]\n\tif (!r) throw Error(`Unknown unit: \"${t}\"`)\n\treturn Math.ceil(e * r)\n}\nconst storageUnitExponents = { b: 0, byte: 0, bytes: 0, kb: 1, kilobyte: 1, kilobytes: 1, mb: 2, megabyte: 2, megabytes: 2, gb: 3, gigabyte: 3, gigabytes: 3, tb: 4, terabyte: 4, terabytes: 4 }\nfunction makeStorage(n, e = 1024) {\n\tconst t = parseFloat(n)\n\tif (isNaN(t)) throw Error('makeStorage got NaN for input')\n\tconst r = n\n\t\t\t.replace(/^-?[0-9.]+/, '')\n\t\t\t.trim()\n\t\t\t.toLowerCase(),\n\t\to = r === '' ? 0 : storageUnitExponents[r]\n\tif (o == null) throw Error(`Unknown unit: \"${r}\"`)\n\treturn Math.ceil(t * e ** o)\n}\nfunction getPreLine(n) {\n\treturn n.replace(/ +/g, ' ').replace(/^ /gm, '')\n}\nconst tinyCache = new Map()\nasync function getCached(n, e, t) {\n\tconst r = Date.now(),\n\t\to = tinyCache.get(n)\n\tif (o && o.validUntil > r) return o.value\n\tconst i = await t(),\n\t\tu = r + e\n\treturn tinyCache.set(n, { value: i, validUntil: u }), i\n}\nfunction deleteFromCache(n) {\n\ttinyCache.delete(n)\n}\nfunction deleteExpiredFromCache() {\n\tconst n = Date.now()\n\tfor (const [e, t] of tinyCache.entries()) t.validUntil <= n && tinyCache.delete(e)\n}\nfunction cacheSize() {\n\treturn tinyCache.size\n}\nfunction joinUrl(n, e = !1) {\n\t;(n = n.filter(i => i)), e && isString(n[1]) && (n[1] = '../' + n[1])\n\tlet t = ''\n\tisString(n[0]) && n[0].includes('://') && ((t = before(n[0], '://') ?? ''), (n[0] = after(n[0], '://') ?? ''))\n\tconst r = n.map(i => String(i)).flatMap(i => i.split('/')),\n\t\to = []\n\tfor (let i = 0; i < r.length; i++) r[i] !== '.' && (r[i] === '..' ? (!t || o.length > 1) && o.pop() : o.push(r[i]))\n\treturn (t ? t + '://' : '') + o.join('/').replaceAll(/\\/{2,}/g, '/')\n}\nfunction replaceBetweenStrings(n, e, t, r, o = !0) {\n\tconst i = n.indexOf(e),\n\t\tu = n.indexOf(t, i + e.length)\n\tif (i === -1 || u === -1) throw Error('Start or end not found')\n\treturn o ? n.substring(0, i + e.length) + r + n.substring(u) : n.substring(0, i) + r + n.substring(u + t.length)\n}\nfunction describeMarkdown(n) {\n\tlet e = 'p'\n\tn.startsWith('#') ? ((e = 'h1'), (n = n.slice(1).trim())) : n.startsWith('-') && ((e = 'li'), (n = n.slice(1).trim()))\n\tconst t = n[0] === n[0].toUpperCase(),\n\t\tr = /[.?!]$/.test(n),\n\t\to = /:$/.test(n)\n\treturn { type: e, isCapitalized: t, hasPunctuation: r, endsWithColon: o }\n}\nfunction isBalanced(n, e = '(', t = ')') {\n\tlet r = 0,\n\t\to = 0\n\tfor (; o < n.length; ) if ((n.startsWith(e, o) ? (r++, (o += e.length)) : n.startsWith(t, o) ? (r--, (o += t.length)) : o++, r < 0)) return !1\n\treturn e === t ? r % 2 === 0 : r === 0\n}\nfunction textToFormat(n) {\n\tn = n.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '')\n\tlet e = n.length\n\tfor (; (n = n.replace(/(\\w+)[\\s,']+\\w+/g, '$1')), n.length !== e; ) e = n.length\n\treturn (n = n.replaceAll(/[A-Z][a-zA-Z0-9]*/g, 'A')), (n = n.replaceAll(/[a-z][a-zA-Z0-9]*/g, 'a')), (n = n.replaceAll(/[\\u4E00-\\u9FA5]+/g, 'Z')), n\n}\nfunction sortObject(n) {\n\tconst t = Object.keys(n).sort((o, i) => o.localeCompare(i)),\n\t\tr = {}\n\tfor (const o of t) r[o] = sortAny(n[o])\n\treturn r\n}\nfunction sortArray(n) {\n\tconst e = []\n\treturn n.sort((t, r) => JSON.stringify(sortAny(t)).localeCompare(JSON.stringify(sortAny(r)))).forEach(t => e.push(sortAny(t))), e\n}\nfunction sortAny(n) {\n\treturn Array.isArray(n) ? sortArray(n) : isObject(n) ? sortObject(n) : n\n}\nfunction deepEquals(n, e) {\n\treturn JSON.stringify(sortAny(n)) === JSON.stringify(sortAny(e))\n}\nfunction deepEqualsEvery(...n) {\n\tfor (let e = 1; e < n.length; e++) if (!deepEquals(n[e - 1], n[e])) return !1\n\treturn !0\n}\nfunction safeParse(n) {\n\ttry {\n\t\treturn JSON.parse(n)\n\t} catch {\n\t\treturn null\n\t}\n}\nfunction createSequence() {\n\tlet n = 0\n\treturn { next: () => n++ }\n}\nfunction createOscillator(n) {\n\tlet e = 0\n\treturn { next: () => n[e++ % n.length] }\n}\nfunction createStatefulToggle(n) {\n\tlet e\n\treturn t => {\n\t\tconst r = t === n && e !== n\n\t\treturn (e = t), r\n\t}\n}\nfunction organiseWithLimits(n, e, t, r, o) {\n\tconst i = {}\n\tfor (const u of Object.keys(e)) i[u] = []\n\t;(i[r] = []), o && (n = n.sort(o))\n\tfor (const u of n) {\n\t\tconst s = u[t],\n\t\t\tc = e[s] ? s : r\n\t\ti[c].length >= e[c] ? i[r].push(u) : i[c].push(u)\n\t}\n\treturn i\n}\nfunction diffKeys(n, e) {\n\tconst t = Object.keys(n),\n\t\tr = Object.keys(e)\n\treturn { uniqueToA: t.filter(o => !r.includes(o)), uniqueToB: r.filter(o => !t.includes(o)) }\n}\nfunction pickRandomKey(n) {\n\tconst e = Object.keys(n)\n\treturn e[Math.floor(Math.random() * e.length)]\n}\nfunction mapRandomKey(n, e) {\n\tconst t = pickRandomKey(n)\n\treturn (n[t] = e(n[t])), t\n}\nfunction fromObjectString(n) {\n\treturn (\n\t\t(n = n.replace(\n\t\t\t/\\r\\n/g,\n\t\t\t`\n`\n\t\t)),\n\t\t(n = n.replace(/(\\w+)\\((.+)\\)/g, (e, t, r) => `${t}(${r.replaceAll(',', ',')})`)),\n\t\t(n = n.replace(/(,)(\\s+})/g, '$2')),\n\t\t(n = n.replace(/\\.\\.\\..+?,/g, '')),\n\t\t(n = n.replace(/({\\s+)([a-zA-Z]\\w+),/g, \"$1$2: '$2',\")),\n\t\t(n = n.replace(/(,\\s+)([a-zA-Z]\\w+),/g, \"$1$2: '$2',\")),\n\t\t(n = n.replace(/:(.+)\\?(.+):/g, (e, t, r) => `: (${t.trim()} && ${r.trim()}) ||`)),\n\t\t(n = n.replace(/([a-zA-Z0-9]+)( ?: ?{)/g, '\"$1\"$2')),\n\t\t(n = n.replace(/([a-zA-Z0-9]+) ?: ?(.+?)(,|\\n|})/g, (e, t, r, o) => `\"${t}\":\"${r.trim()}\"${o}`)),\n\t\t(n = n.replace(/(\"'|'\")/g, '\"')),\n\t\t(n = n.replaceAll(',', ',')),\n\t\tJSON.parse(n)\n\t)\n}\nconst thresholds = [1e3, 1e6, 1e9, 1e12, 1e15, 1e18, 1e21, 1e24, 1e27, 1e30, 1e9, 1e16, 1e18, 1e18, 1e18, 1e33],\n\tlongNumberUnits = ['thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion', 'octillion', 'nonillion', 'gwei', 'bzz', 'btc', 'eth', 'dai', 'decillion'],\n\tshortNumberUnits = ['K', 'M', 'B', 'T', 'Qa', 'Qi', 'Sx', 'Sp', 'O', 'N', 'gwei', 'bzz', 'eth', 'btc', 'dai', 'D']\nfunction fromDecimals(n, e, t) {\n\tlet r = n.length - e\n\tif (r <= 0) return '0.' + '0'.repeat(-r) + n + (t ? ' ' + t : '')\n\tlet o = n.substring(0, r),\n\t\ti = n.substring(r)\n\treturn o === '' && (o = '0'), o + '.' + i + (t ? ' ' + t : '')\n}\nfunction formatNumber(n, e) {\n\tconst t = e?.longForm ?? !1,\n\t\tr = e?.unit ? ` ${e.unit}` : '',\n\t\to = t ? longNumberUnits : shortNumberUnits,\n\t\ti = e?.precision ?? 1\n\tif (n < thresholds[0]) return `${n}${r}`\n\tfor (let u = 0; u < thresholds.length - 1; u++) if (n < thresholds[u + 1]) return `${(n / thresholds[u]).toFixed(i)}${t ? ' ' : ''}${o[u]}${r}`\n\treturn `${(n / thresholds[thresholds.length - 1]).toFixed(i)}${t ? ' ' : ''}${o[thresholds.length - 1]}${r}`\n}\nfunction makeNumber(n) {\n\tconst e = parseFloat(n)\n\tif (isNaN(e)) throw Error('makeNumber got NaN for input')\n\tconst t = n.replace(/^-?[0-9.]+/, '').trim(),\n\t\tr = shortNumberUnits.findIndex(o => o.toLowerCase() === t.toLowerCase())\n\treturn r === -1 ? e : e * thresholds[r]\n}\nfunction clamp(n, e, t) {\n\treturn n < e ? e : n > t ? t : n\n}\nfunction increment(n, e, t) {\n\tconst r = n + e\n\treturn r > t ? t : r\n}\nfunction decrement(n, e, t) {\n\tconst r = n - e\n\treturn r < t ? t : r\n}\nfunction runOn(n, e) {\n\treturn e(n), n\n}\nfunction ifPresent(n, e) {\n\tn && e(n)\n}\nfunction mergeArrays(n, e) {\n\tconst t = Object.keys(e)\n\tfor (const r of t) Array.isArray(e[r]) && Array.isArray(n[r]) && pushAll(n[r], e[r])\n}\nfunction empty(n) {\n\treturn n.splice(0, n.length), n\n}\nfunction removeEmptyArrays(n) {\n\tfor (const e of Object.keys(n)) (isEmptyArray(n[e]) || (Array.isArray(n[e]) && n[e].every(t => t == null))) && delete n[e]\n\treturn n\n}\nfunction removeEmptyValues(n) {\n\tfor (const e of Object.entries(n)) (e[1] === null || e[1] === void 0 || (isString(e[1]) && isBlank(e[1]))) && delete n[e[0]]\n\treturn n\n}\nfunction filterObjectKeys(n, e) {\n\tconst t = {}\n\tfor (const [r, o] of Object.entries(n)) e(r) && (t[r] = o)\n\treturn t\n}\nfunction filterObjectValues(n, e) {\n\tconst t = {}\n\tfor (const [r, o] of Object.entries(n)) e(o) && (t[r] = o)\n\treturn t\n}\nfunction mapObject(n, e) {\n\tconst t = {}\n\tfor (const r of Object.entries(n)) t[r[0]] = e(r[1])\n\treturn t\n}\nfunction mapIterable(n, e) {\n\tconst t = []\n\tlet r = 0\n\tfor (const o of n) t.push(e(o, r++))\n\treturn t\n}\nasync function rethrow(n, e) {\n\ttry {\n\t\treturn await n()\n\t} catch {\n\t\tthrow e\n\t}\n}\nfunction setSomeOnObject(n, e, t) {\n\tt != null && (n[e] = t)\n}\nfunction setSomeDeep(n, e, t, r) {\n\tconst o = getDeep(t, r)\n\to != null && setDeep(n, e, o)\n}\nfunction flip(n) {\n\tconst e = {}\n\tfor (const [t, r] of Object.entries(n)) e[r] = t\n\treturn e\n}\nfunction getAllPermutations(n) {\n\tconst e = Object.keys(n),\n\t\tt = e.map(s => n[s].length),\n\t\tr = t.reduce((s, c) => (s *= c))\n\tlet o = 1\n\tconst i = [1]\n\tfor (let s = 0; s < t.length - 1; s++) (o *= t[s]), i.push(o)\n\tconst u = []\n\tfor (let s = 0; s < r; s++) {\n\t\tconst c = {}\n\t\tfor (let f = 0; f < e.length; f++) {\n\t\t\tconst l = n[e[f]],\n\t\t\t\ta = Math.floor(s / i[f]) % l.length\n\t\t\tc[e[f]] = l[a]\n\t\t}\n\t\tu.push(c)\n\t}\n\treturn u\n}\nfunction countTruthyValues(n) {\n\treturn Object.values(n).filter(e => e).length\n}\nfunction getFlatNotation(n, e, t) {\n\treturn n + (t ? '[' + e + ']' : (n.length ? '.' : '') + e)\n}\nfunction flattenInner(n, e, t, r, o) {\n\tif (!isObject(e)) return e\n\tfor (const [i, u] of Object.entries(e)) {\n\t\tconst s = getFlatNotation(t, i, r)\n\t\tArray.isArray(u) ? (o ? flattenInner(n, u, s, !0, o) : (n[s] = u.map(c => flattenInner(Array.isArray(c) ? [] : {}, c, '', !1, o)))) : isObject(u) ? flattenInner(n, u, s, !1, o) : (n[s] = u)\n\t}\n\treturn n\n}\nfunction flatten(n, e = !1, t) {\n\treturn flattenInner({}, n, t || '', !1, e)\n}\nfunction unflatten(n) {\n\tif (!isObject(n)) return n\n\tconst e = Array.isArray(n) ? [] : {}\n\tfor (const [t, r] of Object.entries(n))\n\t\tArray.isArray(r)\n\t\t\t? setDeep(\n\t\t\t\t\te,\n\t\t\t\t\tt,\n\t\t\t\t\tr.map(o => unflatten(o))\n\t\t\t )\n\t\t\t: setDeep(e, t, r)\n\treturn e\n}\nfunction match(n, e, t) {\n\treturn e[n] ? e[n] : t\n}\nfunction indexArray(n, e) {\n\tconst t = {}\n\tfor (const r of n) {\n\t\tconst o = e(r)\n\t\tt[o] = r\n\t}\n\treturn t\n}\nfunction indexArrayToCollection(n, e) {\n\tconst t = {}\n\tfor (const r of n) {\n\t\tconst o = e(r)\n\t\tt[o] || (t[o] = []), t[o].push(r)\n\t}\n\treturn t\n}\nfunction splitBySize(n, e) {\n\tconst t = []\n\tfor (let r = 0; r < n.length; r += e) t.push(n.slice(r, r + e))\n\treturn t\n}\nfunction splitByCount(n, e) {\n\tconst t = Math.ceil(n.length / e),\n\t\tr = []\n\tfor (let o = 0; o < n.length; o += t) r.push(n.slice(o, o + t))\n\treturn r\n}\nfunction tokenizeByLength(n, e) {\n\tconst t = [],\n\t\tr = Math.ceil(n.length / e)\n\tfor (let o = 0; o < r; o++) t.push(n.slice(o * e, o * e + e))\n\treturn t\n}\nfunction tokenizeByCount(n, e) {\n\tconst t = Math.ceil(n.length / e)\n\treturn tokenizeByLength(n, t)\n}\nfunction makeUnique(n, e) {\n\treturn Object.values(indexArray(n, e))\n}\nfunction countUnique(n, e, t, r, o) {\n\tconst i = e ? n.map(e) : n,\n\t\tu = {}\n\tfor (const c of i) u[c] = (u[c] || 0) + 1\n\tconst s = r ? sortObjectValues(u, o ? (c, f) => c[1] - f[1] : (c, f) => f[1] - c[1]) : u\n\treturn t ? Object.keys(s) : s\n}\nfunction sortObjectValues(n, e) {\n\treturn Object.fromEntries(Object.entries(n).sort(e))\n}\nfunction transformToArray(n) {\n\tconst e = [],\n\t\tt = Object.keys(n),\n\t\tr = n[t[0]].length\n\tfor (let o = 0; o < r; o++) {\n\t\tconst i = {}\n\t\tfor (const u of t) i[u] = n[u][o]\n\t\te.push(i)\n\t}\n\treturn e\n}\nfunction incrementMulti(n, e, t = 1) {\n\tfor (const r of n) r[e] += t\n}\nfunction setMulti(n, e, t) {\n\tfor (const r of n) r[e] = t\n}\nfunction group(n, e) {\n\tconst t = []\n\tlet r = []\n\treturn (\n\t\tn.forEach((o, i) => {\n\t\t\t;(i === 0 || !e(o, n[i - 1])) && ((r = []), t.push(r)), r.push(o)\n\t\t}),\n\t\tt\n\t)\n}\nfunction createBidirectionalMap() {\n\treturn { map: new Map(), keys: [] }\n}\nfunction createTemporalBidirectionalMap() {\n\treturn { map: new Map(), keys: [] }\n}\nfunction pushToBidirectionalMap(n, e, t, r = 100) {\n\tif (n.map.has(e)) {\n\t\tconst o = n.keys.indexOf(e)\n\t\tn.keys.splice(o, 1)\n\t}\n\tif ((n.map.set(e, t), n.keys.push(e), n.keys.length > r)) {\n\t\tconst o = n.keys.shift()\n\t\to && n.map.delete(o)\n\t}\n}\nfunction unshiftToBidirectionalMap(n, e, t, r = 100) {\n\tif (n.map.has(e)) {\n\t\tconst o = n.keys.indexOf(e)\n\t\tn.keys.splice(o, 1)\n\t}\n\tif ((n.map.set(e, t), n.keys.unshift(e), n.keys.length > r)) {\n\t\tconst o = n.keys.shift()\n\t\to && n.map.delete(o)\n\t}\n}\nfunction addToTemporalBidirectionalMap(n, e, t, r, o = 100) {\n\tpushToBidirectionalMap(n, e, { validUntil: Date.now() + r, data: t }, o)\n}\nfunction getFromTemporalBidirectionalMap(n, e) {\n\tconst t = n.map.get(e)\n\treturn t && t.validUntil > Date.now() ? t.data : null\n}\nclass Optional {\n\tconstructor(e) {\n\t\tthis.value = e\n\t}\n\tstatic of(e) {\n\t\treturn new Optional(e)\n\t}\n\tstatic empty() {\n\t\treturn new Optional(null)\n\t}\n\tmap(e) {\n\t\treturn new Optional(this.value !== null && this.value !== void 0 ? e(this.value) : null)\n\t}\n\tmapAsync(e) {\n\t\treturn this.value !== null && this.value !== void 0 ? e(this.value).then(t => Optional.of(t)) : Promise.resolve(Optional.empty())\n\t}\n\tifPresent(e) {\n\t\treturn this.value !== null && this.value !== void 0 && e(this.value), this\n\t}\n\tifPresentAsync(e) {\n\t\treturn this.value !== null && this.value !== void 0 ? e(this.value).then(() => this) : Promise.resolve(this)\n\t}\n\tifAbsent(e) {\n\t\treturn (this.value === null || this.value === void 0) && e(), this\n\t}\n\tifAbsentAsync(e) {\n\t\treturn this.value === null || this.value === void 0 ? e().then(() => this) : Promise.resolve(this)\n\t}\n\tgetOrFallback(e) {\n\t\treturn this.value ?? e()\n\t}\n\tgetOrFallbackAsync(e) {\n\t\treturn this.value !== null && this.value !== void 0 ? Promise.resolve(this.value) : e()\n\t}\n\tgetOrThrow() {\n\t\tif (this.value === null || this.value === void 0) throw Error('Optional.value is empty')\n\t\treturn this.value\n\t}\n}\nexports.Optional = Optional\nclass Lazy {\n\tconstructor(e) {\n\t\t;(this.supplier = e), (this.value = null)\n\t}\n\tget() {\n\t\treturn this.value || (this.value = this.supplier()), this.value\n\t}\n}\nexports.Lazy = Lazy\nclass AsyncLazy {\n\tconstructor(e) {\n\t\t;(this.supplier = e), (this.value = null)\n\t}\n\tasync get() {\n\t\treturn this.value || (this.value = await this.supplier()), this.value\n\t}\n}\nexports.AsyncLazy = AsyncLazy\nfunction multicall(n) {\n\treturn () => n.forEach(e => e())\n}\nfunction maxBy(n, e) {\n\treturn n.reduce((t, r) => (e(t) > e(r) ? t : r))\n}\nfunction findInstance(n, e) {\n\tconst t = n.find(r => r instanceof e)\n\treturn Optional.of(t)\n}\nfunction filterInstances(n, e) {\n\treturn n.filter(t => t instanceof e)\n}\nfunction interleave(n, e) {\n\tconst t = [],\n\t\tr = Math.max(n.length, e.length)\n\tfor (let o = 0; o < r; o++) n[o] && t.push(n[o]), e[o] && t.push(e[o])\n\treturn t\n}\nfunction toggle(n, e) {\n\treturn n.includes(e) ? n.filter(t => t !== e) : [...n, e]\n}\nclass Node {\n\tconstructor(e) {\n\t\t;(this.value = e), (this.children = [])\n\t}\n}\nfunction createHierarchy(n, e, t, r, o = !1) {\n\tconst i = new Map(),\n\t\tu = []\n\tn.forEach(c => {\n\t\tconst f = new Node(c)\n\t\ti.set(c[e], f)\n\t}),\n\t\tn.forEach(c => {\n\t\t\tconst f = i.get(c[e])\n\t\t\tif (!f) return\n\t\t\tconst l = c[t]\n\t\t\tif (l) {\n\t\t\t\tconst a = i.get(l)\n\t\t\t\ta && a.children.push(f)\n\t\t\t} else u.push(f)\n\t\t})\n\tconst s = c => {\n\t\tc.children.sort((f, l) => {\n\t\t\tconst a = f.value[r],\n\t\t\t\th = l.value[r]\n\t\t\treturn o ? h - a : a - h\n\t\t}),\n\t\t\tc.children.forEach(s)\n\t}\n\treturn u.forEach(s), u\n}\nfunction log2Reduce(n, e) {\n\tif (Math.log2(n.length) % 1 !== 0) throw new Error('Array length must be a power of 2')\n\tlet t = [...n]\n\tfor (; t.length > 1; ) {\n\t\tconst r = []\n\t\tfor (let o = 0; o < t.length; o += 2) {\n\t\t\tconst i = t[o + 1]\n\t\t\tr.push(e(t[o], i))\n\t\t}\n\t\tt = r\n\t}\n\treturn t[0]\n}\nfunction concatBytes(...n) {\n\tconst e = n.reduce((o, i) => o + i.length, 0),\n\t\tt = new Uint8Array(e)\n\tlet r = 0\n\treturn (\n\t\tn.forEach(o => {\n\t\t\tt.set(o, r), (r += o.length)\n\t\t}),\n\t\tt\n\t)\n}\nfunction isPng(n) {\n\treturn n[0] === 137 && n[1] === 80 && n[2] === 78 && n[3] === 71\n}\nfunction isJpg(n) {\n\treturn n[0] === 255 && n[1] === 216\n}\nfunction isWebp(n) {\n\treturn n[8] === 87 && n[9] === 69 && n[10] === 66 && n[11] === 80\n}\nfunction isImage(n) {\n\treturn isPng(n) || isJpg(n) || isWebp(n)\n}\nfunction numberToUint8(n) {\n\treturn new Uint8Array([n])\n}\nfunction uint8ToNumber(n) {\n\treturn n[0]\n}\nfunction numberToUint16(n, e) {\n\tconst t = new ArrayBuffer(2)\n\treturn new DataView(t).setUint16(0, n, e === 'LE'), new Uint8Array(t)\n}\nfunction uint16ToNumber(n, e) {\n\treturn new DataView(n.buffer).getUint16(n.byteOffset, e === 'LE')\n}\nfunction numberToUint32(n, e) {\n\tconst t = new ArrayBuffer(4)\n\treturn new DataView(t).setUint32(0, n, e === 'LE'), new Uint8Array(t)\n}\nfunction uint32ToNumber(n, e) {\n\treturn new DataView(n.buffer).getUint32(n.byteOffset, e === 'LE')\n}\nfunction numberToUint64(n, e) {\n\tconst t = new ArrayBuffer(8)\n\treturn new DataView(t).setBigUint64(0, BigInt(n), e === 'LE'), new Uint8Array(t)\n}\nfunction uint64ToNumber(n, e) {\n\treturn new DataView(n.buffer).getBigUint64(n.byteOffset, e === 'LE')\n}\nfunction numberToUint256(n, e) {\n\tconst r = new Uint8Array(32)\n\tlet o = n\n\tif (e === 'LE') {\n\t\tfor (let i = 0; i < 32; i++) (r[i] = Number(o & 0xffn)), (o >>= 8n)\n\t\treturn r\n\t}\n\tfor (let i = 31; i >= 0; i--) (r[i] = Number(o & 0xffn)), (o >>= 8n)\n\treturn r\n}\nfunction uint256ToNumber(n, e) {\n\tlet r = 0n\n\tif (e === 'LE') {\n\t\tfor (let o = 31; o >= 0; o--) r = (r << 8n) | BigInt(n[o])\n\t\treturn r\n\t}\n\tfor (let o = 0; o < 32; o++) r = (r << 8n) | BigInt(n[o])\n\treturn r\n}\nfunction sliceBytes(n, e) {\n\tconst t = []\n\tlet r = 0\n\tfor (const o of e) t.push(n.subarray(r, r + o)), (r += o)\n\treturn t\n}\nfunction partition(n, e) {\n\tconst t = []\n\tfor (let r = 0; r < n.length; r += e) t.push(n.subarray(r, r + e))\n\treturn t\n}\nconst IOTA_CONSTANTS = [0, 1, 0, 32898, 2147483648, 32906, 2147483648, 2147516416, 0, 32907, 0, 2147483649, 2147483648, 2147516545, 2147483648, 32777, 0, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 2147483648, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 0, 32778, 2147483648, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 0, 2147483649, 2147483648, 2147516424]\nfunction keccakPermutate(n) {\n\tfor (let e = 0; e < 24; e++) {\n\t\tconst t = n[0] ^ n[10] ^ n[20] ^ n[30] ^ n[40],\n\t\t\tr = n[1] ^ n[11] ^ n[21] ^ n[31] ^ n[41],\n\t\t\to = n[2] ^ n[12] ^ n[22] ^ n[32] ^ n[42],\n\t\t\ti = n[3] ^ n[13] ^ n[23] ^ n[33] ^ n[43],\n\t\t\tu = n[4] ^ n[14] ^ n[24] ^ n[34] ^ n[44],\n\t\t\ts = n[5] ^ n[15] ^ n[25] ^ n[35] ^ n[45],\n\t\t\tc = n[6] ^ n[16] ^ n[26] ^ n[36] ^ n[46],\n\t\t\tf = n[7] ^ n[17] ^ n[27] ^ n[37] ^ n[47],\n\t\t\tl = n[8] ^ n[18] ^ n[28] ^ n[38] ^ n[48],\n\t\t\ta = n[9] ^ n[19] ^ n[29] ^ n[39] ^ n[49],\n\t\t\th = (o << 1) | (i >>> 31),\n\t\t\tbn = (i << 1) | (o >>> 31),\n\t\t\td = l ^ h,\n\t\t\tp = a ^ bn,\n\t\t\t$n = (u << 1) | (s >>> 31),\n\t\t\tAn = (s << 1) | (u >>> 31),\n\t\t\tm = t ^ $n,\n\t\t\tg = r ^ An,\n\t\t\tEn = (c << 1) | (f >>> 31),\n\t\t\tMn = (f << 1) | (c >>> 31),\n\t\t\tw = o ^ En,\n\t\t\tx = i ^ Mn,\n\t\t\tOn = (l << 1) | (a >>> 31),\n\t\t\tkn = (a << 1) | (l >>> 31),\n\t\t\ty = u ^ On,\n\t\t\tb = s ^ kn,\n\t\t\tTn = (t << 1) | (r >>> 31),\n\t\t\tSn = (r << 1) | (t >>> 31),\n\t\t\t$ = c ^ Tn,\n\t\t\tA = f ^ Sn\n\t\t;(n[0] ^= d), (n[1] ^= p), (n[2] ^= m), (n[3] ^= g), (n[4] ^= w), (n[5] ^= x), (n[6] ^= y), (n[7] ^= b), (n[8] ^= $), (n[9] ^= A), (n[10] ^= d), (n[11] ^= p), (n[12] ^= m), (n[13] ^= g), (n[14] ^= w), (n[15] ^= x), (n[16] ^= y), (n[17] ^= b), (n[18] ^= $), (n[19] ^= A), (n[20] ^= d), (n[21] ^= p), (n[22] ^= m), (n[23] ^= g), (n[24] ^= w), (n[25] ^= x), (n[26] ^= y), (n[27] ^= b), (n[28] ^= $), (n[29] ^= A), (n[30] ^= d), (n[31] ^= p), (n[32] ^= m), (n[33] ^= g), (n[34] ^= w), (n[35] ^= x), (n[36] ^= y), (n[37] ^= b), (n[38] ^= $), (n[39] ^= A), (n[40] ^= d), (n[41] ^= p), (n[42] ^= m), (n[43] ^= g), (n[44] ^= w), (n[45] ^= x), (n[46] ^= y), (n[47] ^= b), (n[48] ^= $), (n[49] ^= A)\n\t\tconst E = n[0],\n\t\t\tM = n[1],\n\t\t\tO = (n[2] << 1) | (n[3] >>> 31),\n\t\t\tk = (n[3] << 1) | (n[2] >>> 31),\n\t\t\tT = (n[5] << 30) | (n[4] >>> 2),\n\t\t\tS = (n[4] << 30) | (n[5] >>> 2),\n\t\t\tR = (n[6] << 28) | (n[7] >>> 4),\n\t\t\tI = (n[7] << 28) | (n[6] >>> 4),\n\t\t\tC = (n[8] << 27) | (n[9] >>> 5),\n\t\t\tP = (n[9] << 27) | (n[8] >>> 5),\n\t\t\tD = (n[11] << 4) | (n[10] >>> 28),\n\t\t\tB = (n[10] << 4) | (n[11] >>> 28),\n\t\t\tv = (n[13] << 12) | (n[12] >>> 20),\n\t\t\tU = (n[12] << 12) | (n[13] >>> 20),\n\t\t\tL = (n[14] << 6) | (n[15] >>> 26),\n\t\t\tN = (n[15] << 6) | (n[14] >>> 26),\n\t\t\tj = (n[17] << 23) | (n[16] >>> 9),\n\t\t\tz = (n[16] << 23) | (n[17] >>> 9),\n\t\t\tF = (n[18] << 20) | (n[19] >>> 12),\n\t\t\tW = (n[19] << 20) | (n[18] >>> 12),\n\t\t\tq = (n[20] << 3) | (n[21] >>> 29),\n\t\t\tH = (n[21] << 3) | (n[20] >>> 29),\n\t\t\tV = (n[22] << 10) | (n[23] >>> 22),\n\t\t\tJ = (n[23] << 10) | (n[22] >>> 22),\n\t\t\tK = (n[25] << 11) | (n[24] >>> 21),\n\t\t\tZ = (n[24] << 11) | (n[25] >>> 21),\n\t\t\tQ = (n[26] << 25) | (n[27] >>> 7),\n\t\t\tG = (n[27] << 25) | (n[26] >>> 7),\n\t\t\tY = (n[29] << 7) | (n[28] >>> 25),\n\t\t\t_ = (n[28] << 7) | (n[29] >>> 25),\n\t\t\tX = (n[31] << 9) | (n[30] >>> 23),\n\t\t\tnn = (n[30] << 9) | (n[31] >>> 23),\n\t\t\ten = (n[33] << 13) | (n[32] >>> 19),\n\t\t\ttn = (n[32] << 13) | (n[33] >>> 19),\n\t\t\trn = (n[34] << 15) | (n[35] >>> 17),\n\t\t\ton = (n[35] << 15) | (n[34] >>> 17),\n\t\t\tun = (n[36] << 21) | (n[37] >>> 11),\n\t\t\tcn = (n[37] << 21) | (n[36] >>> 11),\n\t\t\tsn = (n[38] << 8) | (n[39] >>> 24),\n\t\t\tfn = (n[39] << 8) | (n[38] >>> 24),\n\t\t\tln = (n[40] << 18) | (n[41] >>> 14),\n\t\t\tan = (n[41] << 18) | (n[40] >>> 14),\n\t\t\thn = (n[42] << 2) | (n[43] >>> 30),\n\t\t\tdn = (n[43] << 2) | (n[42] >>> 30),\n\t\t\tpn = (n[45] << 29) | (n[44] >>> 3),\n\t\t\tmn = (n[44] << 29) | (n[45] >>> 3),\n\t\t\tgn = (n[47] << 24) | (n[46] >>> 8),\n\t\t\twn = (n[46] << 24) | (n[47] >>> 8),\n\t\t\txn = (n[48] << 14) | (n[49] >>> 18),\n\t\t\tyn = (n[49] << 14) | (n[48] >>> 18)\n\t\t;(n[0] = E ^ (~v & K)), (n[1] = M ^ (~U & Z)), (n[2] = v ^ (~K & un)), (n[3] = U ^ (~Z & cn)), (n[4] = K ^ (~un & xn)), (n[5] = Z ^ (~cn & yn)), (n[6] = un ^ (~xn & E)), (n[7] = cn ^ (~yn & M)), (n[8] = xn ^ (~E & v)), (n[9] = yn ^ (~M & U)), (n[10] = R ^ (~F & q)), (n[11] = I ^ (~W & H)), (n[12] = F ^ (~q & en)), (n[13] = W ^ (~H & tn)), (n[14] = q ^ (~en & pn)), (n[15] = H ^ (~tn & mn)), (n[16] = en ^ (~pn & R)), (n[17] = tn ^ (~mn & I)), (n[18] = pn ^ (~R & F)), (n[19] = mn ^ (~I & W)), (n[20] = O ^ (~L & Q)), (n[21] = k ^ (~N & G)), (n[22] = L ^ (~Q & sn)), (n[23] = N ^ (~G & fn)), (n[24] = Q ^ (~sn & ln)), (n[25] = G ^ (~fn & an)), (n[26] = sn ^ (~ln & O)), (n[27] = fn ^ (~an & k)), (n[28] = ln ^ (~O & L)), (n[29] = an ^ (~k & N)), (n[30] = C ^ (~D & V)), (n[31] = P ^ (~B & J)), (n[32] = D ^ (~V & rn)), (n[33] = B ^ (~J & on)), (n[34] = V ^ (~rn & gn)), (n[35] = J ^ (~on & wn)), (n[36] = rn ^ (~gn & C)), (n[37] = on ^ (~wn & P)), (n[38] = gn ^ (~C & D)), (n[39] = wn ^ (~P & B)), (n[40] = T ^ (~j & Y)), (n[41] = S ^ (~z & _)), (n[42] = j ^ (~Y & X)), (n[43] = z ^ (~_ & nn)), (n[44] = Y ^ (~X & hn)), (n[45] = _ ^ (~nn & dn)), (n[46] = X ^ (~hn & T)), (n[47] = nn ^ (~dn & S)), (n[48] = hn ^ (~T & j)), (n[49] = dn ^ (~S & z)), (n[0] ^= IOTA_CONSTANTS[e * 2]), (n[1] ^= IOTA_CONSTANTS[e * 2 + 1])\n\t}\n}\nfunction bytesToNumbers(n) {\n\tconst e = []\n\tfor (let t = 0; t < n.length; t += 4) e.push(n[t] | (n[t + 1] << 8) | (n[t + 2] << 16) | (n[t + 3] << 24))\n\treturn e\n}\nfunction divideToBlocks(n, e) {\n\tif (!n.length) {\n\t\tconst o = new Uint8Array(136)\n\t\treturn (o[0] = e), (o[135] = 128), [bytesToNumbers(o)]\n\t}\n\tconst t = partition(n, 136),\n\t\tr = t[t.length - 1]\n\tif (r.length < 136) {\n\t\tconst o = new Uint8Array(136)\n\t\to.set(r), (o[r.length] = e), (o[135] |= 128), (t[t.length - 1] = o)\n\t}\n\tif (r.length === 136) {\n\t\tconst o = new Uint8Array(136)\n\t\t;(o[0] = e), (o[135] = 128), t.push(o)\n\t}\n\treturn t.map(bytesToNumbers)\n}\nfunction absorb(n, e) {\n\tfor (const t of e) {\n\t\tfor (let r = 0; r < 34; r += 2) (n[r] ^= t[r + 1]), (n[r + 1] ^= t[r])\n\t\tkeccakPermutate(n)\n\t}\n\treturn n\n}\nfunction squeeze(n) {\n\treturn new Uint8Array([n[1], n[1] >> -24, n[1] >> -16, n[1] >> -8, n[0], n[0] >> 8, n[0] >> 16, n[0] >> 24, n[3], n[3] >> -24, n[3] >> -16, n[3] >> -8, n[2], n[2] >> 8, n[2] >> 16, n[2] >> 24, n[5], n[5] >> -24, n[5] >> -16, n[5] >> -8, n[4], n[4] >> 8, n[4] >> 16, n[4] >> 24, n[7], n[7] >> -24, n[7] >> -16, n[7] >> -8, n[6], n[6] >> 8, n[6] >> 16, n[6] >> 24])\n}\nfunction keccak256(n) {\n\treturn squeeze(absorb(new Array(50).fill(0), divideToBlocks(n, 1)))\n}\nfunction sha3_256(n) {\n\treturn squeeze(absorb(new Array(50).fill(0), divideToBlocks(n, 6)))\n}\nfunction proximity(n, e) {\n\tconst t = Math.min(n.length, e.length)\n\tfor (let r = 0; r < t; r++) {\n\t\tconst o = n[r] ^ e[r]\n\t\tfor (let i = 0; i < 8; i++) if ((o >> (7 - i)) & 1) return r * 8 + i\n\t}\n\treturn Math.min(n.length, e.length) * 8\n}\nfunction commonPrefix(n, e) {\n\tconst t = Math.min(n.length, e.length)\n\tfor (let r = 0; r < t; r++) if (n[r] !== e[r]) return n.subarray(0, r)\n\treturn n.subarray(0, t)\n}\nfunction setBit(n, e, t, r) {\n\tconst o = Math.floor(e / 8),\n\t\ti = e % 8\n\tt === 1 ? (n[o] |= 1 << (r === 'BE' ? 7 - i : i)) : (n[o] &= ~(1 << (r === 'BE' ? 7 - i : i)))\n}\nfunction getBit(n, e, t) {\n\tconst r = Math.floor(e / 8),\n\t\to = e % 8\n\treturn (n[r] >> (t === 'BE' ? 7 - o : o)) & 1\n}\nfunction binaryIndexOf(n, e, t = 0) {\n\tfor (let r = t; r < n.length; r++) for (let o = 0; o < e.length && n[r + o] === e[o]; o++) if (o === e.length - 1) return r\n\treturn -1\n}\nfunction binaryPadStart(n, e, t = 0) {\n\tif (n.length >= e) return n\n\tconst r = new Uint8Array(e)\n\treturn r.fill(t), r.set(n, e - n.length), r\n}\nfunction binaryPadStartToMultiple(n, e, t = 0) {\n\tconst r = n.length % e\n\treturn r === 0 ? n : binaryPadStart(n, n.length + e - r, t)\n}\nfunction binaryPadEnd(n, e, t = 0) {\n\tif (n.length >= e) return n\n\tconst r = new Uint8Array(e)\n\treturn r.fill(t), r.set(n, 0), r\n}\nfunction binaryPadEndToMultiple(n, e, t = 0) {\n\tconst r = n.length % e\n\treturn r === 0 ? n : binaryPadEnd(n, n.length + e - r, t)\n}\nfunction xorCypher(n, e) {\n\tconst t = new Uint8Array(n.length)\n\tfor (let r = 0; r < n.length; r++) t[r] = n[r] ^ e[r % e.length]\n\treturn t\n}\nfunction isUtf8(n) {\n\tfor (let e = 0; e < n.length; e++) {\n\t\tconst t = n[e]\n\t\tif (!(t < 128))\n\t\t\tif ((t & 224) === 192) {\n\t\t\t\tif (e + 1 >= n.length || (n[e + 1] & 192) !== 128) return !1\n\t\t\t\te += 1\n\t\t\t} else if ((t & 240) === 224) {\n\t\t\t\tif (e + 2 >= n.length || (n[e + 1] & 192) !== 128 || (n[e + 2] & 192) !== 128) return !1\n\t\t\t\te += 2\n\t\t\t} else if ((t & 248) === 240) {\n\t\t\t\tif (e + 3 >= n.length || (n[e + 1] & 192) !== 128 || (n[e + 2] & 192) !== 128 || (n[e + 3] & 192) !== 128) return !1\n\t\t\t\te += 3\n\t\t\t} else return !1\n\t}\n\treturn !0\n}\nfunction binaryEquals(n, e) {\n\tif (n.length !== e.length) return !1\n\tfor (let t = 0; t < n.length; t++) if (n[t] !== e[t]) return !1\n\treturn !0\n}\nfunction mod(n, e) {\n\treturn ((n % e) + e) % e\n}\nfunction modInverse(n, e) {\n\tn = mod(n, e)\n\tlet [t, r] = [0n, 1n],\n\t\t[o, i] = [e, n]\n\tfor (; i !== 0n; ) {\n\t\tconst u = o / i\n\t\t;([t, r] = [r, t - u * r]), ([o, i] = [i, o - u * i])\n\t}\n\tif (o > 1n) throw new Error('a is not invertible')\n\treturn t < 0n && (t += e), t\n}\nfunction modPow(n, e, t) {\n\tlet r = 1n\n\tfor (n = mod(n, t); e > 0; ) e % 2n === 1n && (r = mod(r * n, t)), (n = mod(n * n, t)), (e = e / 2n)\n\treturn r\n}\nfunction modSqrt(n, e) {\n\treturn mod(n, e) === 0n ? 0n : e % 4n === 3n ? modPow(n, (e + 1n) / 4n, e) : null\n}\nconst SECP256K1_P = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,\n\tSECP256K1_N = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,\n\tSECP256K1_X = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,\n\tSECP256K1_Y = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n\nfunction ellipticDouble(n, e, t) {\n\tif (e === 0n) return [0n, 0n]\n\tconst r = mod(3n * n * n * modInverse(2n * e, t), t),\n\t\to = mod(r * r - 2n * n, t),\n\t\ti = mod(r * (n - o) - e, t)\n\treturn [o, i]\n}\nfunction ellipticAdd(n, e, t, r, o) {\n\tif (n === 0n && e === 0n) return [t, r]\n\tif (t === 0n && r === 0n) return [n, e]\n\tif (n === t && e === mod(-r, o)) return [0n, 0n]\n\tif (n === t && e === r) return ellipticDouble(n, e, o)\n\tconst i = mod((r - e) * modInverse(t - n, o), o),\n\t\tu = mod(i * i - n - t, o),\n\t\ts = mod(i * (n - u) - e, o)\n\treturn [u, s]\n}\nfunction privateKeyToPublicKey(n) {\n\tif (n <= 0n || n >= SECP256K1_N) throw new Error('Invalid private key')\n\treturn doubleAndAdd(SECP256K1_X, SECP256K1_Y, n, SECP256K1_P)\n}\nfunction compressPublicKey(n) {\n\tconst t = n[1] % 2n === 0n ? 2 : 3\n\treturn new Uint8Array([t, ...numberToUint256(n[0], 'BE')])\n}\nfunction publicKeyFromCompressed(n) {\n\tif (n.length !== 33 || (n[0] !== 2 && n[0] !== 3)) throw new Error('Invalid compressed public key')\n\tconst e = uint256ToNumber(n.slice(1), 'BE'),\n\t\tt = modSqrt(mod(e ** 3n + 7n, SECP256K1_P), SECP256K1_P)\n\tif (!t) throw Error('Invalid x: does not correspond to a valid curve point')\n\tconst r = mod(-t, SECP256K1_P),\n\t\to = t % 2n === 0n\n\treturn [e, n[0] === 2 ? (o ? t : r) : o ? r : t]\n}\nfunction publicKeyToAddress(n) {\n\tconst e = new Uint8Array(20),\n\t\tt = keccak256(concatBytes(numberToUint256(n[0], 'BE'), numberToUint256(n[1], 'BE')))\n\treturn e.set(t.subarray(12)), e\n}\nfunction checksumEncode(n) {\n\tconst e = exports.Binary.uint8ArrayToHex(n),\n\t\tt = exports.Binary.uint8ArrayToHex(exports.Binary.keccak256(new Uint8Array([...e].map(o => o.charCodeAt(0)))))\n\tlet r = '0x'\n\tfor (let o = 0; o < e.length; o++) parseInt(t[o], 16) > 7 ? (r += e[o].toUpperCase()) : (r += e[o])\n\treturn r\n}\nfunction doubleAndAdd(n, e, t, r) {\n\tlet o = [0n, 0n],\n\t\ti = [n, e]\n\tconst u = t.toString(2)\n\tfor (const s of u) s === '0' ? ((i = ellipticAdd(o[0], o[1], i[0], i[1], r)), (o = ellipticDouble(o[0], o[1], r))) : ((o = ellipticAdd(o[0], o[1], i[0], i[1], r)), (i = ellipticDouble(i[0], i[1], r)))\n\treturn o\n}\nfunction signMessage(n, e, t) {\n\treturn signHash(uint256ToNumber(keccak256(n), 'BE'), e, t)\n}\nfunction signHash(n, e, t) {\n\tif (e <= 0n || e >= SECP256K1_N) throw new Error('Invalid private key')\n\tif ((t || (t = mod(uint256ToNumber(keccak256(concatBytes(keccak256(numberToUint256(e, 'BE')), numberToUint256(n, 'BE'))), 'BE'), SECP256K1_N)), t <= 0n || t >= SECP256K1_N)) throw new Error('Invalid nonce')\n\tconst r = mod(n, SECP256K1_N),\n\t\to = doubleAndAdd(SECP256K1_X, SECP256K1_Y, t, SECP256K1_P),\n\t\ti = mod(o[0], SECP256K1_N)\n\tlet u = mod((r + mod(i, SECP256K1_N) * e) * modInverse(t, SECP256K1_N), SECP256K1_N)\n\tif (i === 0n || u === 0n) throw new Error('Invalid r or s value')\n\tlet s = o[1] % 2n === 0n ? 27n : 28n\n\treturn u > SECP256K1_N / 2n && ((u = SECP256K1_N - u), (s = s === 27n ? 28n : 27n)), [i, u, s]\n}\nfunction recoverPublicKey(n, e, t, r) {\n\tconst o = modSqrt(mod(e ** 3n + 7n, SECP256K1_P), SECP256K1_P)\n\tif (!o) throw new Error('Invalid r: does not correspond to a valid curve point')\n\tconst i = r === 27n ? 0n : 1n,\n\t\tu = o % 2n === i ? o : SECP256K1_P - o,\n\t\ts = mod(uint256ToNumber(keccak256(n), 'BE'), SECP256K1_N),\n\t\tc = doubleAndAdd(e, u, t, SECP256K1_P),\n\t\tf = doubleAndAdd(SECP256K1_X, SECP256K1_Y, s, SECP256K1_P),\n\t\tl = ellipticAdd(c[0], c[1], f[0], mod(-f[1], SECP256K1_P), SECP256K1_P)\n\treturn doubleAndAdd(l[0], l[1], modInverse(e, SECP256K1_N), SECP256K1_P)\n}\nfunction verifySignature(n, e, t, r) {\n\tconst o = mod(uint256ToNumber(keccak256(n), 'BE'), SECP256K1_N),\n\t\ti = modInverse(r, SECP256K1_N),\n\t\tu = mod(o * i, SECP256K1_N),\n\t\ts = mod(t * i, SECP256K1_N),\n\t\tc = doubleAndAdd(SECP256K1_X, SECP256K1_Y, u, SECP256K1_P),\n\t\tf = doubleAndAdd(e[0], e[1], s, SECP256K1_P),\n\t\tl = ellipticAdd(c[0], c[1], f[0], f[1], SECP256K1_P)\n\treturn t === mod(l[0], SECP256K1_N)\n}\nclass Uint8ArrayReader {\n\tconstructor(e) {\n\t\t;(this.cursor = 0), (this.buffer = e)\n\t}\n\tread(e) {\n\t\tconst t = this.buffer.subarray(this.cursor, this.cursor + e)\n\t\treturn (this.cursor += e), t\n\t}\n\tmax() {\n\t\treturn this.buffer.length - this.cursor\n\t}\n}\nexports.Uint8ArrayReader = Uint8ArrayReader\nclass Uint8ArrayWriter {\n\tconstructor(e) {\n\t\t;(this.buffer = e), (this.cursor = 0)\n\t}\n\twrite(e) {\n\t\tconst t = Math.min(this.max(), e.max())\n\t\treturn this.buffer.set(e.read(t), this.cursor), (this.cursor += t), t\n\t}\n\tmax() {\n\t\treturn this.buffer.length - this.cursor\n\t}\n}\nexports.Uint8ArrayWriter = Uint8ArrayWriter\nclass Chunk {\n\tconstructor(e, t = 0n) {\n\t\t;(this.span = t), (this.writer = new Uint8ArrayWriter(new Uint8Array(e)))\n\t}\n\tbuild() {\n\t\treturn concatBytes(numberToUint64(this.span, 'LE'), this.writer.buffer)\n\t}\n\thash() {\n\t\tconst e = log2Reduce(partition(this.writer.buffer, 32), (t, r) => Chunk.hashFunction(concatBytes(t, r)))\n\t\treturn Chunk.hashFunction(concatBytes(numberToUint64(this.span, 'LE'), e))\n\t}\n}\n;(exports.Chunk = Chunk), (Chunk.hashFunction = keccak256)\nclass MerkleTree {\n\tconstructor(e, t = 4096) {\n\t\t;(this.counters = [1]), (this.capacity = t), (this.chunks = [new Chunk(t)]), (this.onChunk = e)\n\t}\n\tstatic async root(e, t = 4096) {\n\t\tconst r = new _a(_a.NOOP, t)\n\t\treturn await r.append(e), r.finalize()\n\t}\n\tasync append(e, t = 0, r = 0n) {\n\t\tconst o = new Uint8ArrayReader(e)\n\t\tfor (; o.max() > 0; ) {\n\t\t\tthis.chunks[t].writer.max() === 0 && (await this.elevate(t))\n\t\t\tconst i = this.chunks[t].writer.write(o)\n\t\t\tr ? (this.chunks[t].span += r) : (this.chunks[0].span += BigInt(i))\n\t\t}\n\t}\n\tasync elevate(e) {\n\t\t;(this.counters[e] = ++this.counters[e] % (this.capacity / 32)), this.chunks[e + 1] || (this.chunks.push(new Chunk(this.capacity)), this.counters.push(1)), await this.append(this.chunks[e].hash(), e + 1, this.chunks[e].span), await this.onChunk(this.chunks[e]), (this.chunks[e] = new Chunk(this.capacity))\n\t}\n\tasync finalize(e = 0) {\n\t\treturn this.chunks[e + 1] ? (this.counters[e] === 1 ? (await this.elevate(e + 1), (this.chunks[e + 1] = this.chunks[e]), this.finalize(e + 1)) : (await this.elevate(e), this.finalize(e + 1))) : (await this.onChunk(this.chunks[e]), this.chunks[e])\n\t}\n}\n;(exports.MerkleTree = MerkleTree), (_a = MerkleTree), (MerkleTree.NOOP = async n => {})\nclass FixedPointNumber {\n\tconstructor(e, t) {\n\t\tif (t < 0) throw Error('Scale must be non-negative')\n\t\t;(this.value = BigInt(e)), (this.scale = t)\n\t}\n\tstatic fromDecimalString(e, t) {\n\t\tlet [r, o] = e.split('.')\n\t\treturn (o = (o || '').padEnd(t, '0').slice(0, t)), new FixedPointNumber(BigInt(r + o), t)\n\t}\n\tadd(e) {\n\t\treturn this.assertSameScale(e), new FixedPointNumber(this.value + e.value, this.scale)\n\t}\n\tsubtract(e) {\n\t\treturn this.assertSameScale(e), new FixedPointNumber(this.value - e.value, this.scale)\n\t}\n\tmultiply(e) {\n\t\treturn new FixedPointNumber(this.value * e, this.scale)\n\t}\n\tdivmod(e) {\n\t\tif (e === 0n) throw new Error('Division by zero is not allowed')\n\t\tconst t = this.value / e,\n\t\t\tr = this.value % e\n\t\treturn [new FixedPointNumber(t, this.scale), new FixedPointNumber(r, this.scale)]\n\t}\n\texchange(e, t, r) {\n\t\tif (e === '*') {\n\t\t\tconst i = (this.value * t.value) / 10n ** BigInt(this.scale)\n\t\t\treturn new FixedPointNumber(i, r)\n\t\t}\n\t\tthis.assertSameScale(t)\n\t\tconst o = (this.value * 10n ** BigInt(r)) / t.value\n\t\treturn new FixedPointNumber(o, r)\n\t}\n\tcompare(e) {\n\t\treturn this.assertSameScale(e), this.value > e.value ? 1 : this.value < e.value ? -1 : 0\n\t}\n\ttoDecimalString() {\n\t\tif (this.scale === 0) return this.value.toString()\n\t\tconst e = this.value.toString(),\n\t\t\tt = e.slice(0, -this.scale) || '0',\n\t\t\tr = e.slice(-this.scale).padStart(this.scale, '0')\n\t\treturn `${t}.${r}`\n\t}\n\ttoString() {\n\t\treturn this.value.toString()\n\t}\n\ttoJSON() {\n\t\treturn this.toString()\n\t}\n\tassertSameScale(e) {\n\t\tif (this.scale !== e.scale) throw new Error(`Scale mismatch: expected ${this.scale}, but got ${e.scale}`)\n\t}\n}\nexports.FixedPointNumber = FixedPointNumber\nfunction tickPlaybook(n) {\n\tif (n.length === 0) return null\n\tconst e = n[0]\n\treturn e.ttlMax ? --e.ttl <= 0 && n.shift() : (e.ttlMax = e.ttl), { progress: (e.ttlMax - e.ttl) / e.ttlMax, data: e.data }\n}\nfunction getArgument(n, e, t, r) {\n\tconst o = n.findIndex(s => s === `--${e}` || s.startsWith(`--${e}=`)),\n\t\ti = n[o]\n\tif (!i) return (t || {})[r || e || ''] || null\n\tif (i.includes('=')) return i.split('=')[1]\n\tconst u = n[o + 1]\n\treturn u && !u.startsWith('-') ? u : (t || {})[r || e || ''] || null\n}\nfunction getNumberArgument(n, e, t, r) {\n\tconst o = getArgument(n, e, t, r)\n\tif (!o) return null\n\ttry {\n\t\treturn makeNumber(o)\n\t} catch {\n\t\tthrow new Error(`Invalid number argument ${e}: ${o}`)\n\t}\n}\nfunction getBooleanArgument(n, e, t, r) {\n\tconst o = n.some(c => c.endsWith('-' + e)),\n\t\ti = getArgument(n, e, t, r)\n\tif (!i && o) return !0\n\tif (!i && !o) return null\n\tconst u = ['true', '1', 'yes', 'y', 'on'],\n\t\ts = ['false', '0', 'no', 'n', 'off']\n\tif (u.includes(i.toLowerCase())) return !0\n\tif (s.includes(i.toLowerCase())) return !1\n\tthrow Error(`Invalid boolean argument ${e}: ${i}`)\n}\nfunction requireStringArgument(n, e, t, r) {\n\tconst o = getArgument(n, e, t, r)\n\tif (!o) throw new Error(`Missing argument ${e}`)\n\treturn o\n}\nfunction requireNumberArgument(n, e, t, r) {\n\tconst o = requireStringArgument(n, e, t, r)\n\ttry {\n\t\treturn makeNumber(o)\n\t} catch {\n\t\tthrow new Error(`Invalid argument ${e}: ${o}`)\n\t}\n}\nfunction bringToFrontInPlace(n, e) {\n\tconst t = n[e]\n\tn.splice(e, 1), n.unshift(t)\n}\nfunction bringToFront(n, e) {\n\tconst t = [...n]\n\treturn bringToFrontInPlace(t, e), t\n}\nfunction addPoint(n, e) {\n\treturn { x: n.x + e.x, y: n.y + e.y }\n}\nfunction subtractPoint(n, e) {\n\treturn { x: n.x - e.x, y: n.y - e.y }\n}\nfunction multiplyPoint(n, e) {\n\treturn { x: n.x * e, y: n.y * e }\n}\nfunction normalizePoint(n) {\n\tconst e = Math.sqrt(n.x * n.x + n.y * n.y)\n\treturn { x: n.x / e, y: n.y / e }\n}\nfunction pushPoint(n, e, t) {\n\treturn { x: n.x + Math.cos(e) * t, y: n.y + Math.sin(e) * t }\n}\nfunction getDistanceBetweenPoints(n, e) {\n\treturn Math.sqrt((n.x - e.x) ** 2 + (n.y - e.y) ** 2)\n}\nfunction filterCoordinates(n, e, t = 'row-first') {\n\tconst r = []\n\tif (t === 'column-first') for (let o = 0; o < n.length; o++) for (let i = 0; i < n[0].length; i++) e(o, i) && r.push({ x: o, y: i })\n\telse for (let o = 0; o < n[0].length; o++) for (let i = 0; i < n.length; i++) e(i, o) && r.push({ x: i, y: o })\n\treturn r\n}\nfunction isHorizontalLine(n, e, t) {\n\treturn n[e + 1]?.[t] && n[e - 1]?.[t] && !n[e][t - 1] && !n[e][t + 1]\n}\nfunction isVerticalLine(n, e, t) {\n\treturn n[e][t + 1] && n[e][t - 1] && !n[e - 1]?.[t] && !n[e + 1]?.[t]\n}\nfunction isLeftmost(n, e, t) {\n\treturn !n[e - 1]?.[t]\n}\nfunction isRightmost(n, e, t) {\n\treturn !n[e + 1]?.[t]\n}\nfunction isTopmost(n, e, t) {\n\treturn !n[e][t - 1]\n}\nfunction isBottommost(n, e, t) {\n\treturn !n[e][t + 1]\n}\nfunction getCorners(n, e, t) {\n\tconst r = []\n\treturn n[e][t] ? (isHorizontalLine(n, e, t) || isVerticalLine(n, e, t) ? [] : (!n[e - 1]?.[t - 1] && isLeftmost(n, e, t) && isTopmost(n, e, t) && r.push({ x: e, y: t }), !n[e + 1]?.[t - 1] && isRightmost(n, e, t) && isTopmost(n, e, t) && r.push({ x: e + 1, y: t }), !n[e - 1]?.[t + 1] && isLeftmost(n, e, t) && isBottommost(n, e, t) && r.push({ x: e, y: t + 1 }), !n[e + 1]?.[t + 1] && isRightmost(n, e, t) && isBottommost(n, e, t) && r.push({ x: e + 1, y: t + 1 }), r)) : (n[e - 1]?.[t] && n[e][t - 1] && r.push({ x: e, y: t }), n[e + 1]?.[t] && n[e][t - 1] && r.push({ x: e + 1, y: t }), n[e - 1]?.[t] && n[e][t + 1] && r.push({ x: e, y: t + 1 }), n[e + 1]?.[t] && n[e][t + 1] && r.push({ x: e + 1, y: t + 1 }), r)\n}\nfunction findCorners(n, e, t, r) {\n\tconst o = [\n\t\t{ x: 0, y: 0 },\n\t\t{ x: t, y: 0 },\n\t\t{ x: 0, y: r },\n\t\t{ x: t, y: r }\n\t]\n\tfor (let i = 0; i < n.length; i++)\n\t\tfor (let u = 0; u < n[0].length; u++) {\n\t\t\tconst s = getCorners(n, i, u)\n\t\t\tfor (const c of s) o.some(f => f.x === c.x && f.y === c.y) || o.push(c)\n\t\t}\n\treturn o.map(i => ({ x: i.x * e, y: i.y * e }))\n}\nfunction findLines(n, e) {\n\tconst t = filterCoordinates(n, (c, f) => n[c][f] === 0 && n[c][f + 1] !== 0, 'row-first').map(c => ({ ...c, dx: 1, dy: 0 })),\n\t\tr = filterCoordinates(n, (c, f) => n[c][f] === 0 && n[c][f - 1] !== 0, 'row-first').map(c => ({ ...c, dx: 1, dy: 0 })),\n\t\to = filterCoordinates(n, (c, f) => n[c][f] === 0 && n[c - 1]?.[f] !== 0, 'column-first').map(c => ({ ...c, dx: 0, dy: 1 })),\n\t\ti = filterCoordinates(n, (c, f) => n[c][f] === 0 && n[c + 1]?.[f] !== 0, 'column-first').map(c => ({ ...c, dx: 0, dy: 1 }))\n\tt.forEach(c => c.y++), i.forEach(c => c.x++)\n\tconst u = group([...o, ...i], (c, f) => c.x === f.x && c.y - 1 === f.y),\n\t\ts = group([...r, ...t], (c, f) => c.y === f.y && c.x - 1 === f.x)\n\treturn [...u, ...s].map(c => ({ start: c[0], end: last(c) })).map(c => ({ start: multiplyPoint(c.start, e), end: multiplyPoint(addPoint(c.end, { x: c.start.dx, y: c.start.dy }), e) }))\n}\nfunction getAngleInRadians(n, e) {\n\treturn Math.atan2(e.y - n.y, e.x - n.x)\n}\nfunction getSortedRayAngles(n, e) {\n\treturn e.map(t => getAngleInRadians(n, t)).sort((t, r) => t - r)\n}\nfunction getLineIntersectionPoint(n, e, t, r) {\n\tconst o = (r.y - t.y) * (e.x - n.x) - (r.x - t.x) * (e.y - n.y)\n\tif (o === 0) return null\n\tlet i = n.y - t.y,\n\t\tu = n.x - t.x\n\tconst s = (r.x - t.x) * i - (r.y - t.y) * u,\n\t\tc = (e.x - n.x) * i - (e.y - n.y) * u\n\treturn (i = s / o), (u = c / o), i > 0 && i < 1 && u > 0 && u < 1 ? { x: n.x + i * (e.x - n.x), y: n.y + i * (e.y - n.y) } : null\n}\nfunction raycast(n, e, t) {\n\tconst r = [],\n\t\to = pushPoint(n, t, 1e4)\n\tfor (const i of e) {\n\t\tconst u = getLineIntersectionPoint(n, o, i.start, i.end)\n\t\tu && r.push(u)\n\t}\n\treturn r.length\n\t\t? r.reduce((i, u) => {\n\t\t\t\tconst s = getDistanceBetweenPoints(n, u),\n\t\t\t\t\tc = getDistanceBetweenPoints(n, i)\n\t\t\t\treturn s < c ? u : i\n\t\t })\n\t\t: null\n}\nfunction raycastCircle(n, e, t) {\n\tconst o = getSortedRayAngles(n, t),\n\t\ti = []\n\tfor (const u of o) {\n\t\tconst s = raycast(n, e, u - 0.001),\n\t\t\tc = raycast(n, e, u + 0.001)\n\t\ts && i.push(s), c && i.push(c)\n\t}\n\treturn i\n}\nclass PubSubChannel {\n\tconstructor() {\n\t\tthis.subscribers = []\n\t}\n\tsubscribe(e) {\n\t\treturn (\n\t\t\tthis.subscribers.push(e),\n\t\t\t() => {\n\t\t\t\tthis.subscribers = this.subscribers.filter(t => t !== e)\n\t\t\t}\n\t\t)\n\t}\n\tpublish(e) {\n\t\tthis.subscribers.forEach(t => t(e))\n\t}\n\tclear() {\n\t\tthis.subscribers = []\n\t}\n\tgetSubscriberCount() {\n\t\treturn this.subscribers.length\n\t}\n}\nexports.PubSubChannel = PubSubChannel\nclass AsyncQueue {\n\tconstructor(e, t) {\n\t\t;(this.queue = []), (this.running = 0), (this.onProcessed = new PubSubChannel()), (this.onDrained = new PubSubChannel()), (this.concurrency = e), (this.capacity = t)\n\t}\n\tprocess() {\n\t\tif (this.running >= this.concurrency) return\n\t\tconst e = this.queue.shift()\n\t\te &&\n\t\t\t(this.running++,\n\t\t\te().finally(() => {\n\t\t\t\tthis.running--, this.process(), this.onProcessed.publish(), this.running === 0 && this.onDrained.publish()\n\t\t\t}))\n\t}\n\tenqueue(e) {\n\t\tif (this.queue.length < this.capacity) return this.queue.push(e), this.process(), Promise.resolve()\n\t\tif (this.onProcessed.getSubscriberCount()) throw Error('Queue capacity is full')\n\t\treturn new Promise(t => {\n\t\t\tthis.onProcessed.subscribe(() => {\n\t\t\t\tthis.queue.length < this.capacity && (this.queue.push(e), this.process(), this.onProcessed.clear(), t())\n\t\t\t})\n\t\t})\n\t}\n\tdrain() {\n\t\tif (this.running === 0) return Promise.resolve()\n\t\tif (this.onDrained.getSubscriberCount()) throw Error('Already draining')\n\t\treturn new Promise(e => {\n\t\t\tthis.onDrained.subscribe(() => {\n\t\t\t\tthis.onDrained.clear(), e()\n\t\t\t})\n\t\t})\n\t}\n}\nexports.AsyncQueue = AsyncQueue\nclass TrieRouter {\n\tconstructor() {\n\t\tthis.forks = new Map()\n\t}\n\tinsert(e, t) {\n\t\tif (e.length === 0) {\n\t\t\tthis.handler = t\n\t\t\treturn\n\t\t}\n\t\tconst r = e[0]\n\t\tlet o = r,\n\t\t\ti\n\t\tif ((r.startsWith(':') && ((o = ':'), (i = r.slice(1))), !this.forks.has(o))) {\n\t\t\tconst u = new TrieRouter()\n\t\t\ti && (u.variableName = i), this.forks.set(o, u)\n\t\t}\n\t\tthis.forks.get(o).insert(e.slice(1), t)\n\t}\n\tasync handle(e, t, r, o) {\n\t\tif (e.length === 0) return this.handler ? (await this.handler(t, r, o), !0) : !1\n\t\tconst i = e[0],\n\t\t\tu = this.forks.get(i)\n\t\tif (u) return u.handle(e.slice(1), t, r, o)\n\t\tconst s = this.forks.get(':')\n\t\tif (s) return s.variableName && o.set(s.variableName, decodeURIComponent(i)), s.handle(e.slice(1), t, r, o)\n\t\tconst c = this.forks.get('*')\n\t\treturn c ? (o.set('wildcard', e.join('/')), c.handler ? (await c.handler(t, r, o), !0) : !1) : !1\n\t}\n}\nexports.TrieRouter = TrieRouter\nclass RollingValueProvider {\n\tconstructor(e) {\n\t\t;(this.index = 0), (this.values = e)\n\t}\n\tcurrent() {\n\t\treturn this.values[this.index]\n\t}\n\tnext() {\n\t\treturn (this.index = (this.index + 1) % this.values.length), this.values[this.index]\n\t}\n}\n;(exports.RollingValueProvider = RollingValueProvider),\n\t(exports.Binary = { hexToUint8Array, uint8ArrayToHex, binaryToUint8Array, uint8ArrayToBinary, base64ToUint8Array, uint8ArrayToBase64, base32ToUint8Array, uint8ArrayToBase32, log2Reduce, partition, concatBytes, numberToUint8, uint8ToNumber, numberToUint16, uint16ToNumber, numberToUint32, uint32ToNumber, numberToUint64, uint64ToNumber, numberToUint256, uint256ToNumber, sliceBytes, keccak256, sha3_256, proximity, commonPrefix, setBit, getBit, indexOf: binaryIndexOf, equals: binaryEquals, padStart: binaryPadStart, padStartToMultiple: binaryPadStartToMultiple, padEnd: binaryPadEnd, padEndToMultiple: binaryPadEndToMultiple, xorCypher, isUtf8 }),\n\t(exports.Elliptic = { privateKeyToPublicKey, compressPublicKey, publicKeyFromCompressed, publicKeyToAddress, signMessage, signHash, verifySignature, recoverPublicKey, checksumEncode }),\n\t(exports.Random = { intBetween, floatBetween, chance, signed: signedRandom, makeSeededRng, point: randomPoint, procs }),\n\t(exports.Arrays = { countUnique, makeUnique, splitBySize, splitByCount, index: indexArray, indexCollection: indexArrayToCollection, onlyOrThrow, onlyOrNull, firstOrThrow, firstOrNull, shuffle, initialize: initializeArray, initialize2D: initialize2DArray, rotate2D: rotate2DArray, containsShape, glue, pluck, pick, pickMany, pickManyUnique, pickWeighted, pickRandomIndices, pickGuaranteed, last, pipe, makePipe, sortWeighted, pushAll, unshiftAll, filterAndRemove, merge: mergeArrays, empty, pushToBucket, unshiftAndLimit, atRolling, group, createOscillator, organiseWithLimits, tickPlaybook, getArgument, getBooleanArgument, getNumberArgument, requireStringArgument, requireNumberArgument, bringToFront, bringToFrontInPlace, findInstance, filterInstances, interleave, toggle, createHierarchy, multicall, maxBy }),\n\t(exports.System = { sleepMillis, forever, scheduleMany, waitFor, expandError, runAndSetInterval, whereAmI, withRetries }),\n\t(exports.Numbers = { make: makeNumber, sum, average, median, getDistanceFromMidpoint, clamp, range, interpolate, createSequence, increment, decrement, format: formatNumber, fromDecimals, makeStorage, asMegabytes, convertBytes, hexToRgb, rgbToHex, haversineDistanceToMeters, roundToNearest, formatDistance, triangularNumber, searchFloat, binomialSample, toSignificantDigits }),\n\t(exports.Promises = { raceFulfilled, invert: invertPromise, runInParallelBatches }),\n\t(exports.Dates = { getTimestamp, getTimeDelta, secondsToHumanTime, countCycles, isoDate, throttle, timeSince, dateTimeSlug, unixTimestamp, fromUtcString, fromMillis, getProgress, humanizeTime, humanizeProgress, createTimeDigits, mapDayNumber, getDayInfoFromDate, getDayInfoFromDateTimeString, seconds, minutes, hours, days, make: makeDate, normalizeTime, absoluteDays }),\n\t(exports.Objects = { safeParse, deleteDeep, getDeep, setDeep, incrementDeep, ensureDeep, replaceDeep, getFirstDeep, deepMergeInPlace, deepMerge2, deepMerge3, mapAllAsync, cloneWithJson, sortObject, sortArray, sortAny, deepEquals, deepEqualsEvery, runOn, ifPresent, zip, zipSum, removeEmptyArrays, removeEmptyValues, flatten, unflatten, match, sort: sortObjectValues, map: mapObject, mapIterable, filterKeys: filterObjectKeys, filterValues: filterObjectValues, rethrow, setSomeOnObject, setSomeDeep, flip, getAllPermutations, countTruthyValues, transformToArray, setMulti, incrementMulti, createBidirectionalMap, createTemporalBidirectionalMap, pushToBidirectionalMap, unshiftToBidirectionalMap, addToTemporalBidirectionalMap, getFromTemporalBidirectionalMap, createStatefulToggle, diffKeys, pickRandomKey, mapRandomKey, fromObjectString, toQueryString, parseQueryString, hasKey, selectMax, reposition, unwrapSingleKey, parseKeyValues, errorMatches }),\n\t(exports.Types = { isFunction, isObject, isStrictlyObject, isEmptyArray, isEmptyObject, isUndefined, isString, isNumber, isBoolean, isDate, isBlank, isId, isIntegerString, isHexString, isUrl, isNullable, asString, asHexString, asSafeString, asIntegerString, asNumber, asFunction, asInteger, asBoolean, asDate, asNullableString, asEmptiableString, asId, asTime, asArray, asObject, asNullableObject, asStringMap, asNumericDictionary, asUrl, asEmptiable, asNullable, asOptional, enforceObjectShape, enforceArrayShape, isPng, isJpg, isWebp, isImage }),\n\t(exports.Strings = { tokenizeByCount, tokenizeByLength, searchHex, searchSubstring, randomHex: randomHexString, randomLetter: randomLetterString, randomAlphanumeric: randomAlphanumericString, randomRichAscii: randomRichAsciiString, randomUnicode: randomUnicodeString, includesAny, slugify, normalForm, enumify, escapeHtml, decodeHtmlEntities, after, afterLast, before, beforeLast, betweenWide, betweenNarrow, getPreLine, containsWord, containsWords, joinUrl, getFuzzyMatchScore, sortByFuzzyScore, splitOnce, splitAll, randomize, expand, shrinkTrim, capitalize, decapitalize, csvEscape, parseCsv, surroundInOut, getExtension, getBasename, normalizeEmail, normalizeFilename, parseFilename, camelToTitle, slugToTitle, slugToCamel, joinHumanly, findWeightedPair, extractBlock, extractAllBlocks, replaceBlocks, indexOfEarliest, lastIndexOfBefore, parseHtmlAttributes, readNextWord, readWordsAfterAll, resolveVariables, resolveVariableWithDefaultSyntax, resolveRemainingVariablesWithDefaults, isLetter, isDigit, isLetterOrDigit, isValidObjectPathCharacter, insert: insertString, indexOfRegex, allIndexOf, lineMatches, linesMatchInOrder, represent, resolveMarkdownLinks, buildUrl, isChinese, replaceBetweenStrings, describeMarkdown, isBalanced, textToFormat, splitFormatting, splitHashtags, splitUrls, route, explodeReplace, generateVariants, replaceWord, replacePascalCaseWords, stripHtml, breakLine, measureTextWidth, toLines, levenshteinDistance, findCommonPrefix, findCommonDirectory }),\n\t(exports.Assertions = { asEqual, asTrue, asTruthy, asFalse, asFalsy, asEither }),\n\t(exports.Cache = { get: getCached, delete: deleteFromCache, deleteExpired: deleteExpiredFromCache, size: cacheSize }),\n\t(exports.Vector = { addPoint, subtractPoint, multiplyPoint, normalizePoint, pushPoint, filterCoordinates, findCorners, findLines, raycast, raycastCircle, getLineIntersectionPoint })\n","/* 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\tlet m;\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\t// eslint-disable-next-line no-return-assign\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 && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[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') || 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 = require('./common')(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 * 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 = require('ms');\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\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\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,\n\t\t\t...createDebug.skips.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\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\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* 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","/* eslint-env browser */\nmodule.exports = typeof self == 'object' ? self.FormData : window.FormData;\n","// https://github.com/maxogden/websocket-stream/blob/48dc3ddf943e5ada668c31ccd94e9186f02fafbd/ws-fallback.js\n\nvar ws = null\n\nif (typeof WebSocket !== 'undefined') {\n ws = WebSocket\n} else if (typeof MozWebSocket !== 'undefined') {\n ws = MozWebSocket\n} else if (typeof global !== 'undefined') {\n ws = global.WebSocket || global.MozWebSocket\n} else if (typeof window !== 'undefined') {\n ws = window.WebSocket || window.MozWebSocket\n} else if (typeof self !== 'undefined') {\n ws = self.WebSocket || self.MozWebSocket\n}\n\nmodule.exports = ws\n","/**\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","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('build compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier, identifierBase) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre': {\n const base = Number(identifierBase) ? 1 : 0\n\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty')\n }\n\n if (this.prerelease.length === 0) {\n this.prerelease = [base]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists')\n }\n this.prerelease.push(base)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base]\n if (identifierBase === false) {\n prerelease = [identifier]\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease\n }\n } else {\n this.prerelease = prerelease\n }\n }\n break\n }\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.raw = this.format()\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`\n }\n return this\n }\n}\n\nmodule.exports = SemVer\n","const SemVer = require('../classes/semver')\nconst major = (a, loose) => new SemVer(a, loose).major\nmodule.exports = major\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n/* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\n// Max safe length for a build identifier. The max length minus 6 characters for\n// the shortest version with a build 0.0.0+BUILD.\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6\n\nconst RELEASE_TYPES = [\n 'major',\n 'premajor',\n 'minor',\n 'preminor',\n 'patch',\n 'prepatch',\n 'prerelease',\n]\n\nmodule.exports = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010,\n}\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers,\n}\n","// parse out just the options we care about\nconst looseOption = Object.freeze({ loose: true })\nconst emptyOpts = Object.freeze({ })\nconst parseOptions = options => {\n if (!options) {\n return emptyOpts\n }\n\n if (typeof options !== 'object') {\n return looseOption\n }\n\n return options\n}\nmodule.exports = parseOptions\n","const {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH,\n} = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst safeRe = exports.safeRe = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst LETTERDASHNUMBER = '[a-zA-Z0-9-]'\n\n// Replace some greedy regex tokens to prevent regex dos issues. These regex are\n// used internally via the safeRe object since all inputs in this library get\n// normalized first to trim and collapse all extra whitespace. The original\n// regexes are exported for userland consumption and lower level usage. A\n// future breaking change could export the safer regex only with a note that\n// all input should have extra whitespace removed.\nconst safeRegexReplacements = [\n ['\\\\s', 1],\n ['\\\\d', MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],\n]\n\nconst makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value\n .split(`${token}*`).join(`${token}{0,${max}}`)\n .split(`${token}+`).join(`${token}{1,${max}}`)\n }\n return value\n}\n\nconst createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value)\n const index = R++\n debug(name, index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '\\\\d+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCEPLAIN', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)\ncreateToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\\\d])`)\ncreateToken('COERCEFULL', src[t.COERCEPLAIN] +\n `(?:${src[t.PRERELEASE]})?` +\n `(?:${src[t.BUILD]})?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\ncreateToken('COERCERTLFULL', src[t.COERCEFULL], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$')\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import utility from './index.js'\n\nexport const Arrays = utility.Arrays\nexport const Assertions = utility.Assertions\nexport const Binary = utility.Binary\nexport const Cache = utility.Cache\nexport const Dates = utility.Dates\nexport const Elliptic = utility.Elliptic\nexport const Numbers = utility.Numbers\nexport const Objects = utility.Objects\nexport const Pagination = utility.Pagination\nexport const Promises = utility.Promises\nexport const Random = utility.Random\nexport const Strings = utility.Strings\nexport const System = utility.System\nexport const Types = utility.Types\nexport const Optional = utility.Optional\nexport const Vector = utility.Vector\nexport const PubSubChannel = utility.PubSubChannel\nexport const Chunk = utility.Chunk\nexport const MerkleTree = utility.MerkleTree\nexport const FixedPointNumber = utility.FixedPointNumber\nexport const Lazy = utility.Lazy\nexport const AsyncLazy = utility.AsyncLazy\nexport const AsyncQueue = utility.AsyncQueue\nexport const Uint8ArrayReader = utility.Uint8ArrayReader\nexport const Uint8ArrayWriter = utility.Uint8ArrayWriter\nexport const TrieRouter = utility.TrieRouter\nexport const RollingValueProvider = utility.RollingValueProvider\n","import { Binary, Objects, Types } from 'cafe-utility'\nimport _debug from 'debug'\n\nconst debug = _debug('bee-js:bytes')\n\nconst DECODER = new TextDecoder()\nconst ENCODER = new TextEncoder()\n\nexport class Bytes {\n protected readonly bytes: Uint8Array\n public readonly length: number\n\n constructor(bytes: Uint8Array | ArrayBuffer | string | Bytes, byteLength?: number | number[]) {\n if (!bytes) {\n throw Error(`Bytes#constructor: constructor parameter is falsy: ${bytes}`)\n }\n\n if (bytes instanceof Bytes) {\n this.bytes = bytes.bytes\n } else if (typeof bytes === 'string') {\n this.bytes = Binary.hexToUint8Array(Types.asHexString(bytes, { name: 'Bytes#constructor(bytes)' }))\n } else if (bytes instanceof ArrayBuffer) {\n this.bytes = new Uint8Array(bytes)\n } else if (bytes instanceof Uint8Array) {\n this.bytes = bytes\n } else {\n const unknownInput = bytes as unknown\n const toHex = Objects.getDeep(unknownInput, 'toHex')\n\n if (Types.isFunction(toHex)) {\n const hex = toHex.call(unknownInput)\n this.bytes = Binary.hexToUint8Array(Types.asHexString(hex, { name: 'Bytes#constructor(bytes)' }))\n } else {\n debug('bytes', bytes)\n throw new Error(`Bytes#constructor: unsupported type: ${typeof bytes}`)\n }\n }\n\n this.length = this.bytes.length\n\n if (byteLength) {\n if (Array.isArray(byteLength)) {\n if (!byteLength.includes(this.length)) {\n throw new Error(\n `Bytes#checkByteLength: bytes length is ${this.length} but expected ${byteLength.join(' or ')}`,\n )\n }\n } else if (this.length !== byteLength) {\n throw new Error(`Bytes#checkByteLength: bytes length is ${this.length} but expected ${byteLength}`)\n }\n }\n }\n\n static keccak256(bytes: Uint8Array | ArrayBuffer | string | Bytes): Bytes {\n return new Bytes(Binary.keccak256(new Bytes(bytes).toUint8Array()))\n }\n\n static fromUtf8(utf8: string): Bytes {\n return new Bytes(ENCODER.encode(utf8))\n }\n\n static fromSlice(bytes: Uint8Array, start: number, length?: number): Bytes {\n if (length === undefined) {\n return new Bytes(bytes.slice(start))\n }\n\n return new Bytes(bytes.slice(start, start + length))\n }\n\n offset(index: number): Uint8Array {\n return new Uint8Array(this.bytes.slice(index))\n }\n\n public toUint8Array(): Uint8Array {\n return new Uint8Array(this.bytes)\n }\n\n public toHex(): string {\n return Binary.uint8ArrayToHex(this.bytes)\n }\n\n public toBase64(): string {\n return Binary.uint8ArrayToBase64(this.bytes)\n }\n\n public toBase32(): string {\n return Binary.uint8ArrayToBase32(this.bytes)\n }\n\n public toString(): string {\n return this.toHex()\n }\n\n public toUtf8(): string {\n return DECODER.decode(this.bytes)\n }\n\n public toJSON(): unknown {\n return JSON.parse(this.toUtf8())\n }\n\n public equals(other: Bytes | Uint8Array | string): boolean {\n return this.toHex() === new Bytes(other).toHex()\n }\n\n public represent(): string {\n return this.toHex()\n }\n}\n\nexport function parseSizeToBytes(sizeStr: string): number {\n const units = {\n B: 1,\n kB: 1000,\n MB: 1000 ** 2,\n GB: 1000 ** 3,\n TB: 1000 ** 4,\n PB: 1000 ** 5,\n }\n\n const match = sizeStr.match(/^([\\d.]+)\\s*(B|kB|MB|GB|TB|PB)$/)\n\n if (!match) {\n throw new Error(`Invalid size format: ${sizeStr}`)\n }\n\n const value = parseFloat(match[1])\n const unit = match[2] as keyof typeof units\n\n return Math.ceil(value * units[unit])\n}\n","import { Binary } from 'cafe-utility'\nimport { Bytes } from './bytes'\nimport { Reference } from './typed-bytes'\n\nexport const SWARM_MANIFEST_CODEC = 0xfa\nexport const SWARM_FEED_CODEC = 0xfb\n\nconst CODEC_TABLE: Record<number, string | undefined> = {\n [SWARM_MANIFEST_CODEC]: 'manifest',\n [SWARM_FEED_CODEC]: 'feed',\n}\n\nexport type DecodedCID = {\n type: 'feed' | 'manifest'\n reference: Reference\n}\n\nexport function convertReferenceToCid(reference: string | Uint8Array | Bytes, type: 'feed' | 'manifest'): string {\n reference = new Reference(reference)\n const base32 = 'b'\n const version = new Uint8Array([1])\n const codec = new Uint8Array([type === 'feed' ? SWARM_FEED_CODEC : SWARM_MANIFEST_CODEC])\n const unknown = new Uint8Array([1])\n const sha256 = new Uint8Array([27])\n const size = new Uint8Array([32])\n const header = Binary.uint8ArrayToBase32(Binary.concatBytes(version, codec, unknown, sha256, size)).replace(\n /\\=+$/,\n '',\n )\n const hash = reference.toBase32().replace(/\\=+$/, '')\n\n return `${base32}${header}${hash}`.toLowerCase()\n}\n\nexport function convertCidToReference(cid: string): DecodedCID {\n const bytes = Binary.base32ToUint8Array(cid.toUpperCase().slice(1))\n const codec = bytes[1]\n\n if (!CODEC_TABLE[codec]) {\n throw new Error('Unknown codec')\n }\n const reference = new Reference(bytes.slice(-32))\n\n return {\n type: CODEC_TABLE[codec] as 'feed' | 'manifest',\n reference,\n }\n}\n","import { Binary, Elliptic } from 'cafe-utility'\nimport { Bytes } from './bytes'\nimport { convertCidToReference, convertReferenceToCid } from './cid'\n\n// TODO: add JSdocs for each class\n\nconst ENCODER = new TextEncoder()\n\nexport class PrivateKey extends Bytes {\n static readonly LENGTH = 32\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 32)\n }\n\n publicKey(): PublicKey {\n const [x, y] = Elliptic.privateKeyToPublicKey(Binary.uint256ToNumber(this.bytes, 'BE'))\n\n return new PublicKey(Binary.concatBytes(Binary.numberToUint256(x, 'BE'), Binary.numberToUint256(y, 'BE')))\n }\n\n sign(data: Uint8Array | string): Signature {\n const digest = Binary.concatBytes(\n ENCODER.encode(`\\x19Ethereum Signed Message:\\n32`),\n Binary.keccak256(data instanceof Uint8Array ? data : ENCODER.encode(data)),\n )\n const [r, s, v] = Elliptic.signMessage(digest, Binary.uint256ToNumber(this.bytes, 'BE'))\n\n return new Signature(\n Binary.concatBytes(Binary.numberToUint256(r, 'BE'), Binary.numberToUint256(s, 'BE'), new Uint8Array([Number(v)])),\n )\n }\n}\n\nexport class PublicKey extends Bytes {\n static readonly LENGTH = 64\n constructor(bytes: Uint8Array | string | Bytes) {\n const b = new Bytes(bytes)\n\n if (b.length === 33) {\n const [x, y] = Elliptic.publicKeyFromCompressed(b.toUint8Array())\n super(Binary.concatBytes(Binary.numberToUint256(x, 'BE'), Binary.numberToUint256(y, 'BE')), 64)\n } else {\n super(bytes, 64)\n }\n }\n\n address(): EthAddress {\n const x = Binary.uint256ToNumber(this.bytes.slice(0, 32), 'BE')\n const y = Binary.uint256ToNumber(this.bytes.slice(32, 64), 'BE')\n\n return new EthAddress(Elliptic.publicKeyToAddress([x, y]))\n }\n\n toCompressedUint8Array(): Uint8Array {\n const x = Binary.uint256ToNumber(this.bytes.slice(0, 32), 'BE')\n const y = Binary.uint256ToNumber(this.bytes.slice(32, 64), 'BE')\n\n return Elliptic.compressPublicKey([x, y])\n }\n\n toCompressedHex(): string {\n return Binary.uint8ArrayToHex(this.toCompressedUint8Array())\n }\n}\n\nexport class EthAddress extends Bytes {\n static readonly LENGTH = 20\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 20)\n }\n\n public toChecksum(): string {\n return Elliptic.checksumEncode(this.bytes)\n }\n}\n\nexport class Identifier extends Bytes {\n static readonly LENGTH = 32\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 32)\n }\n\n static fromString(value: string): Identifier {\n return new Identifier(Binary.keccak256(ENCODER.encode(value)))\n }\n}\n\nexport class Reference extends Bytes {\n static readonly LENGTH = 32\n constructor(bytes: Uint8Array | string | Bytes) {\n if (typeof bytes === 'string' && bytes.startsWith('bah5')) {\n const decoded = convertCidToReference(bytes)\n super(decoded.reference.bytes, 32)\n } else {\n super(bytes, [32, 64])\n }\n }\n\n toCid(type: 'feed' | 'manifest'): string {\n return convertReferenceToCid(this.bytes, type)\n }\n\n static isValid(value: string): boolean {\n try {\n new Reference(value)\n\n return true\n } catch {\n return false\n }\n }\n}\n\nexport class TransactionId extends Bytes {\n static readonly LENGTH = 32\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 32)\n }\n}\n\nexport class Span extends Bytes {\n static readonly LENGTH = 8\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 8)\n }\n\n static fromBigInt(number: bigint): Span {\n return new Span(Binary.numberToUint64(number, 'LE'))\n }\n\n toBigInt(): bigint {\n return Binary.uint64ToNumber(this.bytes, 'LE')\n }\n\n static fromSlice(bytes: Uint8Array, start: number): Span {\n return new Span(bytes.slice(start, start + Span.LENGTH))\n }\n}\n\nexport class PeerAddress extends Bytes {\n static readonly LENGTH = 32\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 32)\n }\n}\n\nexport class BatchId extends Bytes {\n static readonly LENGTH = 32\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 32)\n }\n}\n\nexport class Signature extends Bytes {\n static readonly LENGTH = 65\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 65)\n }\n\n static fromSlice(bytes: Uint8Array, start: number): Signature {\n return new Signature(bytes.slice(start, start + Signature.LENGTH))\n }\n\n recoverPublicKey(digest: Uint8Array | string): PublicKey {\n const r = Binary.uint256ToNumber(this.bytes.slice(0, 32), 'BE')\n const s = Binary.uint256ToNumber(this.bytes.slice(32, 64), 'BE')\n const v = BigInt(this.bytes[64]) as 27n | 28n\n const [x, y] = Elliptic.recoverPublicKey(\n Binary.concatBytes(\n ENCODER.encode(`\\x19Ethereum Signed Message:\\n32`),\n Binary.keccak256(digest instanceof Uint8Array ? digest : ENCODER.encode(digest)),\n ),\n r,\n s,\n v,\n )\n\n return new PublicKey(Binary.concatBytes(Binary.numberToUint256(x, 'BE'), Binary.numberToUint256(y, 'BE')))\n }\n\n isValid(digest: Uint8Array | string, expectedAddress: EthAddress | Uint8Array | string): boolean {\n const publicKey = this.recoverPublicKey(digest)\n const address = publicKey.address()\n\n return address.equals(expectedAddress)\n }\n}\n\nexport class Topic extends Bytes {\n static readonly LENGTH = 32\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 32)\n }\n\n static fromString(value: string): Topic {\n return new Topic(Binary.keccak256(ENCODER.encode(value)))\n }\n}\n\nconst MAX_UINT64 = new Uint8Array(8).fill(0xff, 0, 8)\n\nexport class FeedIndex extends Bytes {\n static readonly LENGTH = 8\n static readonly MINUS_ONE = new FeedIndex(MAX_UINT64)\n\n constructor(bytes: Uint8Array | string | Bytes) {\n super(bytes, 8)\n }\n\n static fromBigInt(number: bigint): FeedIndex {\n return new FeedIndex(Binary.numberToUint64(number, 'BE'))\n }\n\n toBigInt(): bigint {\n return Binary.uint64ToNumber(this.bytes, 'BE')\n }\n\n next(): FeedIndex {\n if (Binary.equals(this.bytes, MAX_UINT64)) {\n return FeedIndex.fromBigInt(0n)\n }\n\n return FeedIndex.fromBigInt(this.toBigInt() + 1n)\n }\n}\n","export class BeeError extends Error {\n public constructor(message: string) {\n super(message)\n }\n}\n\nexport class BeeArgumentError extends BeeError {\n public constructor(message: string, readonly value: unknown) {\n super(message)\n }\n}\n\nexport class BeeResponseError extends BeeError {\n public constructor(\n public method: string,\n public url: string,\n message: string,\n public responseBody?: unknown,\n public status?: number,\n public statusText?: string,\n ) {\n super(message)\n }\n}\n","import { Binary } from 'cafe-utility'\nimport { BeeArgumentError } from '../utils/error'\nimport { Reference, Span } from '../utils/typed-bytes'\n\nconst MAX_CHUNK_PAYLOAD_SIZE = 4096\nconst SEGMENT_SIZE = 32\n\n/**\n * Calculate a Binary Merkle Tree hash for a chunk\n *\n * The BMT chunk address is the hash of the 8 byte span and the root\n * hash of a binary Merkle tree (BMT) built on the 32-byte segments\n * of the underlying data.\n *\n * If the chunk content is less than 4k, the hash is calculated as\n * if the chunk was padded with all zeros up to 4096 bytes.\n *\n * @param chunkContent Chunk data including span and payload as well\n *\n * @returns the keccak256 hash in a byte array\n */\nexport function calculateChunkAddress(chunkContent: Uint8Array): Reference {\n const span = chunkContent.slice(0, Span.LENGTH)\n const payload = chunkContent.slice(Span.LENGTH)\n const rootHash = calculateBmtRootHash(payload)\n const chunkHash = Binary.keccak256(Binary.concatBytes(span, rootHash))\n\n return new Reference(chunkHash)\n}\n\nfunction calculateBmtRootHash(payload: Uint8Array): Uint8Array {\n if (payload.length > MAX_CHUNK_PAYLOAD_SIZE) {\n throw new BeeArgumentError(\n `payload size ${payload.length} exceeds maximum chunk payload size ${MAX_CHUNK_PAYLOAD_SIZE}`,\n payload,\n )\n }\n const input = new Uint8Array(MAX_CHUNK_PAYLOAD_SIZE)\n input.set(payload)\n\n return Binary.log2Reduce(Binary.partition(input, SEGMENT_SIZE), (a, b) => Binary.keccak256(Binary.concatBytes(a, b)))\n}\n","import { BZZ, DAI } from '../utils/tokens'\nimport { EthAddress, PeerAddress, PublicKey, TransactionId } from '../utils/typed-bytes'\nimport { NumberString } from './index'\n\nexport interface Settlements {\n peer: string\n received: BZZ\n sent: BZZ\n}\n\nexport interface AllSettlements {\n totalReceived: BZZ\n totalSent: BZZ\n settlements: Settlements[]\n}\n\nexport interface NodeAddresses {\n overlay: PeerAddress\n underlay: string[]\n ethereum: EthAddress\n publicKey: PublicKey\n pssPublicKey: PublicKey\n}\n\nexport interface Peer {\n address: string\n fullNode?: boolean\n}\n\nexport interface ChequebookAddressResponse {\n chequebookAddress: EthAddress\n}\n\nexport interface ChequebookBalanceResponse {\n totalBalance: BZZ\n availableBalance: BZZ\n}\n\nexport interface TransactionOptions {\n /**\n * Gas price for the cashout transaction in WEI\n */\n gasPrice?: NumberString | string | bigint\n\n /**\n * Gas limit for the cashout transaction in WEI\n */\n gasLimit?: NumberString | string | bigint\n}\n\nexport interface CashoutResult {\n recipient: string\n lastPayout: BZZ\n bounced: boolean\n}\n\nexport interface LastCashoutActionResponse {\n peer: string\n uncashedAmount: BZZ\n transactionHash: string | null\n lastCashedCheque: Cheque | null\n result: CashoutResult | null\n}\n\nexport interface TransactionResponse {\n transactionHash: TransactionId\n}\n\nexport interface Cheque {\n beneficiary: EthAddress\n chequebook: EthAddress\n payout: BZZ\n}\n\nexport interface LastChequesForPeerResponse {\n peer: string\n lastreceived: Cheque | null\n lastsent: Cheque | null\n}\n\nexport interface LastChequesResponse {\n lastcheques: LastChequesForPeerResponse[]\n}\n\nexport interface PeerBalance {\n peer: string\n balance: BZZ\n}\n\nexport interface BalanceResponse {\n balances: PeerBalance[]\n}\n\nexport interface DebugStatus {\n overlay: string\n proximity: number\n beeMode: BeeModes\n reserveSize: number\n reserveSizeWithinRadius: number\n pullsyncRate: number\n storageRadius: number\n connectedPeers: number\n neighborhoodSize: number\n batchCommitment: number\n isReachable: boolean\n lastSyncedBlock: number\n committedDepth: number\n isWarmingUp: boolean\n}\n\nexport interface Health {\n status: 'ok'\n version: string\n apiVersion: string\n}\n\nexport interface Readiness {\n status: 'ready' | string\n version: string\n apiVersion: string\n}\n\nexport interface BeeVersions {\n supportedBeeVersion: string\n supportedBeeApiVersion: string\n beeVersion: string\n beeApiVersion: string\n}\n\nexport enum BeeModes {\n FULL = 'full',\n LIGHT = 'light',\n ULTRA_LIGHT = 'ultra-light',\n DEV = 'dev',\n}\n\nexport function toBeeMode(value: string) {\n switch (value) {\n case 'full':\n return BeeModes.FULL\n case 'light':\n return BeeModes.LIGHT\n case 'ultra-light':\n return BeeModes.ULTRA_LIGHT\n case 'dev':\n return BeeModes.DEV\n default:\n throw new Error(`Unknown Bee mode: ${value}`)\n }\n}\n\nexport interface RedistributionState {\n minimumGasFunds: DAI\n hasSufficientFunds: boolean\n isFrozen: boolean\n isFullySynced: boolean\n phase: string\n round: number\n lastWonRound: number\n lastPlayedRound: number\n lastFrozenRound: number\n lastSelectedRound: number\n lastSampleDurationSeconds: number\n block: number\n reward: BZZ\n fees: DAI\n isHealthy: boolean\n}\n\n/**\n * Information about Bee node and its configuration\n */\nexport interface NodeInfo {\n /**\n * Indicates in what mode Bee is running.\n */\n beeMode: BeeModes\n\n /**\n * Indicates whether the Bee node has its own deployed chequebook.\n *\n * @see [Bee docs - Chequebook](https://docs.ethswarm.org/docs/references/glossary/#cheques--chequebook)\n */\n chequebookEnabled: boolean\n\n /**\n * Indicates whether SWAP is enabled for the Bee node.\n *\n * @see [Bee docs - SWAP](https://docs.ethswarm.org/docs/references/glossary/#swap)\n */\n swapEnabled: boolean\n}\n\nexport interface RemovePeerResponse {\n message: string\n code: 0\n}\n\nexport interface Bin {\n population: number\n connected: number\n disconnectedPeers: Peer[]\n connectedPeers: Peer[]\n}\n\nexport interface Topology {\n baseAddr: string\n population: number\n connected: number\n timestamp: string\n nnLowWatermark: number\n depth: number\n reachability: string\n networkAvailability: string\n bins: {\n bin_0: Bin\n bin_1: Bin\n bin_2: Bin\n bin_3: Bin\n bin_4: Bin\n bin_5: Bin\n bin_6: Bin\n bin_7: Bin\n bin_8: Bin\n bin_9: Bin\n bin_10: Bin\n bin_11: Bin\n bin_12: Bin\n bin_13: Bin\n bin_14: Bin\n bin_15: Bin\n bin_16: Bin\n bin_17: Bin\n bin_18: Bin\n bin_19: Bin\n bin_20: Bin\n bin_21: Bin\n bin_22: Bin\n bin_23: Bin\n bin_24: Bin\n bin_25: Bin\n bin_26: Bin\n bin_27: Bin\n bin_28: Bin\n bin_29: Bin\n bin_30: Bin\n bin_31: Bin\n }\n}\n\nexport interface PingResponse {\n rtt: string\n}\n\nexport interface ReserveState {\n radius: number\n storageRadius: number\n commitment: number\n}\n\nexport interface ChainState {\n chainTip: number\n block: number\n totalAmount: NumberString\n currentPrice: number\n}\n\nexport interface WalletBalance {\n bzzBalance: BZZ\n nativeTokenBalance: DAI\n chainID: number\n chequebookContractAddress: string\n walletAddress: string\n}\n","import { Optional } from 'cafe-utility'\nimport type { SingleOwnerChunk } from '../chunk/soc'\nimport type { FeedUploadOptions } from '../feed'\nimport type { FeedPayloadResult, FeedReferenceResult, FeedUpdateOptions } from '../modules/feed'\nimport { Bytes } from '../utils/bytes'\nimport { Duration } from '../utils/duration'\nimport type { BeeError } from '../utils/error'\nimport { Size } from '../utils/size'\nimport {\n BatchId,\n EthAddress,\n Identifier,\n PrivateKey,\n PublicKey,\n Reference,\n Topic,\n TransactionId,\n} from '../utils/typed-bytes'\n\nexport * from './debug'\n\nexport const SECTION_SIZE = 32\nexport const BRANCHES = 128\nexport const CHUNK_SIZE = SECTION_SIZE * BRANCHES\n\nexport const PSS_TARGET_HEX_LENGTH_MAX = 4\n\n/**\n * Minimum postage batch depth.\n */\nexport const STAMPS_DEPTH_MIN = 17\n\n/**\n * Maximum postage batch depth.\n */\nexport const STAMPS_DEPTH_MAX = 255\n\n/**\n * Minimum tags API page size.\n */\nexport const TAGS_LIMIT_MIN = 1\n\n/**\n * Maximum tags API page size.\n */\nexport const TAGS_LIMIT_MAX = 1000\n\n/**\n * Behavior of the HTTP client, such as `timeout`, additional `headers`, custom `httpAgent`, etc.\n */\nexport type BeeRequestOptions = {\n baseURL?: string\n timeout?: number\n headers?: Record<string, string>\n onRequest?: (request: BeeRequest) => void\n httpAgent?: unknown\n httpsAgent?: unknown\n endlesslyRetry?: boolean\n}\n\n/**\n * Options for the Bee client which affect all method calls *(unless overridden in the method call itself)*.\n *\n * Extends `BeeRequestOptions`, which allows configuring the HTTP client behavior,\n * such as `timeout`, additional `headers`, custom `httpAgent`, etc.\n */\nexport interface BeeOptions extends BeeRequestOptions {\n /**\n * Default signer (a private key) used for signing.\n *\n * Mainly used in single-owner chunk (SOC) related operations, and consequently in feeds.\n *\n * If not provided, methods such as `makeFeedWriter` and `makeSOCWriter`\n * must be provided with a private key in their respective function calls.\n */\n signer?: PrivateKey | Uint8Array | string\n\n /**\n * Network on which the Bee node is running.\n *\n * This is currently used to determine block time for postage batch time-to-live (TTL) calculations.\n * The block time for `gnosis` is `5` seconds, and for `sepolia` it is `15` seconds.\n *\n * Default value is `gnosis`.\n */\n network?: 'gnosis' | 'sepolia'\n}\n\nexport interface GranteesResult {\n status: number\n statusText: string\n ref: Reference\n historyref: Reference\n}\n\nexport interface GetGranteesResult {\n status: number\n statusText: string\n grantees: PublicKey[]\n}\n\n/**\n * Result of upload calls.\n */\nexport interface UploadResult {\n /**\n * Reference of the uploaded data\n */\n reference: Reference\n\n /**\n * Automatically created tag's UID.\n */\n tagUid?: number\n\n /**\n * History address of the uploaded data with ACT.\n */\n historyAddress: Optional<Reference>\n}\n\nexport interface UploadOptions {\n /**\n * If set to true, an ACT will be created for the uploaded data.\n */\n act?: boolean\n\n actHistoryAddress?: Reference | Uint8Array | string\n\n /**\n * Will pin the data locally in the Bee node as well.\n *\n * Locally pinned data is possible to reupload to network if it disappear.\n *\n * @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n */\n pin?: boolean\n\n /**\n * Will encrypt the uploaded data and return longer hash which also includes the decryption key.\n *\n * @see [Bee docs - Store with Encryption](https://docs.ethswarm.org/docs/develop/access-the-swarm/store-with-encryption)\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n * @see Reference\n */\n encrypt?: boolean\n\n /**\n * Tags keep track of syncing the data with network. This option allows attach existing Tag UUID to the uploaded data.\n *\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)\n * @link Tag\n */\n tag?: number\n\n /**\n * Determines if the uploaded data should be sent to the network immediately (eq. deferred=false) or in a deferred fashion (eq. deferred=true).\n *\n * With deferred style client uploads all the data to Bee node first and only then Bee node starts push the data to network itself. The progress of this upload can be tracked with tags.\n * With non-deferred style client uploads the data to Bee which immediately starts pushing the data to network. The request is only finished once all the data was pushed through the Bee node to the network.\n *\n * In future there will be move to the non-deferred style and even the support for deferred upload will be removed from Bee itself.\n *\n * @default true\n */\n deferred?: boolean\n}\n\n/**\n * Add redundancy to the data being uploaded so that downloaders can download it with better UX.\n * 0 value is default and does not add any redundancy to the file.\n */\nexport enum RedundancyLevel {\n OFF = 0,\n MEDIUM = 1,\n STRONG = 2,\n INSANE = 3,\n PARANOID = 4,\n}\n\nexport interface RedundantUploadOptions extends UploadOptions {\n redundancyLevel?: RedundancyLevel\n}\n\n/**\n * Specify the retrieve strategy on redundant data.\n * The possible values are NONE, DATA, PROX and RACE.\n * Strategy NONE means no prefetching takes place.\n * Strategy DATA means only data chunks are prefetched.\n * Strategy PROX means only chunks that are close to the node are prefetched.\n * Strategy RACE means all chunks are prefetched: n data chunks and k parity chunks. The first n chunks to arrive are used to reconstruct the file.\n * Multiple strategies can be used in a fallback cascade if the swarm redundancy fallback mode is set to true.\n * The default strategy is NONE, DATA, falling back to PROX, falling back to RACE\n */\nexport enum RedundancyStrategy {\n NONE = 0,\n DATA = 1,\n PROX = 2,\n RACE = 3,\n}\n\nexport interface DownloadOptions {\n /**\n * Specify the retrieve strategy on redundant data.\n *\n * Only applicable for erasure coded data.\n */\n redundancyStrategy?: RedundancyStrategy\n\n /**\n * Specify if the retrieve strategies (chunk prefetching on redundant data) are used in a fallback cascade. The default is true.\n *\n * Only applicable for erasure coded data.\n */\n fallback?: boolean\n\n /**\n * Specify the timeout for chunk retrieval. The default is 30 seconds.\n *\n * This is not the timeout for the whole download operation, but rather for each chunk retrieval.\n */\n timeoutMs?: number\n\n actPublisher?: PublicKey | Uint8Array | string\n\n actHistoryAddress?: Reference | Uint8Array | string\n\n actTimestamp?: string | number\n}\n\nexport interface FileUploadOptions extends UploadOptions {\n /**\n * Specifies Content-Length for the given data. It is required when uploading with Readable.\n *\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n */\n size?: number\n\n /**\n * Specifies given Content-Type so when loaded in browser the file is correctly represented.\n *\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n */\n contentType?: string\n\n redundancyLevel?: RedundancyLevel\n}\n\nexport interface CollectionUploadOptions extends UploadOptions {\n /**\n * Default file to be returned when the root hash of collection is accessed.\n *\n * @see [Bee docs - Upload a directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory)\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n */\n indexDocument?: string\n\n /**\n * Configure custom error document to be returned when a specified path can not be found in collection.\n *\n * @see [Bee docs - Upload a directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory)\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n */\n errorDocument?: string\n\n redundancyLevel?: RedundancyLevel\n}\n\nexport interface UploadHeaders {\n 'swarm-act'?: string\n 'swarm-pin'?: string\n 'swarm-encrypt'?: string\n 'swarm-tag'?: string\n 'swarm-postage-batch-id'?: string\n}\n\n/**\n * Object that contains information about upload progress of data to network.\n *\n * The total amount of chunks is represented by `split` property.\n *\n * The actual progress of the upload can be tracked by the `seen + synced` properties.\n *\n * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)\n */\nexport interface Tag {\n split: number\n seen: number\n stored: number\n sent: number\n synced: number\n uid: number\n address: string\n startedAt: string\n}\n\nexport interface AllTagsOptions {\n limit?: number\n offset?: number\n}\n\nexport interface FileHeaders {\n name?: string\n tagUid?: number\n contentType?: string\n}\n\nexport interface FileData<T> extends FileHeaders {\n data: T\n}\n\nexport interface Pin {\n reference: Reference\n}\n\nexport interface ReferenceInformation {\n contentLength: number\n}\n\n/**\n * Helper interface that adds utility functions\n * to work more conveniently with bytes in normal\n * user scenarios.\n *\n * Concretely: text(), hex(), json()\n */\nexport interface Data extends Uint8Array {\n /**\n * Converts the binary data using UTF-8 decoding into string.\n */\n text(): string\n\n /**\n * Converts the binary data into hex-string.\n */\n hex(): string\n\n /**\n * Converts the binary data into string which is then parsed into JSON.\n */\n json(): Record<string, unknown>\n}\n\n/**\n * Object represents a file and some of its metadata in [[Directory]] object.\n */\nexport interface CollectionEntry {\n path: string\n size: number\n file?: File\n fsPath?: string\n}\n\n/**\n * Represents Collections\n */\nexport type Collection = Array<CollectionEntry>\n\nexport interface PssSubscription {\n readonly topic: Topic\n cancel: () => void\n}\n\nexport interface PssMessageHandler {\n onMessage: (message: Bytes, subscription: PssSubscription) => void\n onError: (error: BeeError, subscription: PssSubscription) => void\n onClose: (subscription: PssSubscription) => void\n}\n\nexport interface GsocSubscription {\n readonly address: EthAddress\n cancel: () => void\n}\n\nexport interface GsocMessageHandler {\n onMessage: (message: Bytes, subscription: GsocSubscription) => void\n onError: (error: BeeError, subscription: GsocSubscription) => void\n onClose: (subscription: GsocSubscription) => void\n}\n\nexport interface ReferenceResponse {\n reference: Reference\n}\n\nexport type HttpMethod = 'GET' | 'DELETE' | 'POST' | 'PATCH' | 'PUT'\n\nexport type HookCallback<V> = (value: V) => void | Promise<void>\n\nexport interface BeeRequest {\n url: string\n method: string\n headers?: Record<string, string>\n params?: Record<string, unknown>\n}\n\nexport interface BeeResponse {\n headers: Record<string, string>\n status: number\n statusText?: string\n request: BeeRequest\n}\n\n/**\n * FeedReader is an interface for downloading feed updates\n */\nexport interface FeedReader {\n readonly owner: EthAddress\n readonly topic: Topic\n\n /**\n * @deprecated Use `downloadReference` or `downloadPayload` instead to disambiguate how the data should be interpreted.\n */\n download(options?: FeedUpdateOptions): Promise<FeedPayloadResult>\n\n /**\n * Downloads the feed update (latest if no index is specified) and returns it as a reference.\n */\n downloadReference(options?: FeedUpdateOptions): Promise<FeedReferenceResult>\n\n /**\n * Downloads the feed update (latest if no index is specified) and returns it as a payload.\n */\n downloadPayload(options?: FeedUpdateOptions): Promise<FeedPayloadResult>\n}\n\n/**\n * FeedWriter is an interface for updating feeds\n */\nexport interface FeedWriter extends FeedReader {\n /**\n * Upload a new feed update\n *\n * @deprecated Use `uploadReference` or `uploadPayload` instead to disambiguate how the data should be interpreted.\n *\n * @param postageBatchId Postage BatchId to be used to upload the data with\n * @param reference The reference to be stored in the new update\n * @param options Additional options like `at`\n *\n * @returns UpdateResult that points at Single Owner Chunk that contains the new update and pointer to the updated chunk reference.\n */\n upload(\n postageBatchId: string | BatchId,\n reference: Reference | string | Uint8Array,\n options?: FeedUploadOptions,\n ): Promise<UploadResult>\n\n uploadReference(\n postageBatchId: string | BatchId,\n reference: Reference | string | Uint8Array,\n options?: FeedUploadOptions,\n ): Promise<UploadResult>\n\n uploadPayload(\n postageBatchId: string | BatchId,\n payload: Uint8Array | string,\n options?: FeedUploadOptions,\n ): Promise<UploadResult>\n}\n\n/**\n * Interface for downloading single owner chunks\n */\nexport interface SOCReader {\n readonly owner: EthAddress\n /**\n * Downloads a single owner chunk\n *\n * @param identifier The identifier of the chunk\n */\n download: (identifier: Identifier | Uint8Array | string) => Promise<SingleOwnerChunk>\n}\n\n/**\n * Interface for downloading and uploading single owner chunks\n */\nexport interface SOCWriter extends SOCReader {\n /**\n * Uploads a single owner chunk\n *\n * @param identifier The identifier of the chunk\n * @param data The chunk payload data\n * @param options Upload options\n */\n upload: (\n stamp: BatchId | Uint8Array | string,\n identifier: Identifier | Uint8Array | string,\n data: Uint8Array,\n options?: UploadOptions,\n ) => Promise<UploadResult>\n}\n\nexport interface GlobalPostageBatch {\n batchID: BatchId\n value: NumberString\n start: number\n owner: EthAddress\n depth: number\n bucketDepth: number\n immutable: boolean\n batchTTL: number\n}\n\nexport interface PostageBatch {\n batchID: BatchId\n /**\n * Represents how much of the batch is used up.\n *\n * Max utilization = `2 ** (depth - bucketDepth)`\n *\n * Since the smallest depth is 17, and one batch has 65,536 buckets, and one chunk is 4,096 bytes,\n * the 512MB theoretical max size for the smallest stamp comes from `2 * 65536 * 4096 = 512MB`\n */\n utilization: number\n usable: boolean\n label: string\n depth: number\n amount: NumberString\n bucketDepth: number\n blockNumber: number\n immutableFlag: boolean\n /**\n * Estimated time until the batch expires\n */\n duration: Duration\n /**\n * A floating point number from 0 to 1, where 0 is no usage, 1 is full usage.\n */\n usage: number\n /**\n * Human readable usage text, like \"50%\" or \"100%\", no fractions\n */\n usageText: string\n /**\n * Effective size\n */\n size: Size\n /**\n * Estimated remaining size\n */\n remainingSize: Size\n /**\n * Theoretical size in bytes\n */\n theoreticalSize: Size\n /**\n * Calculates the effective size of data that can be uploaded with this postage batch\n * based on whether encryption is used and the desired redundancy level.\n */\n calculateSize(encryption: boolean, redundancyLevel: RedundancyLevel): Size\n /**\n * Calculates the remaining size of data that can be uploaded with this postage batch\n * based on whether encryption is used and the desired redundancy level.\n */\n calculateRemainingSize(encryption: boolean, redundancyLevel: RedundancyLevel): Size\n}\n\nexport interface BatchBucket {\n bucketID: number\n collisions: number\n}\n\nexport interface PostageBatchBuckets {\n depth: number\n bucketDepth: number\n bucketUpperBound: number\n buckets: BatchBucket[]\n}\n\nexport interface TransactionInfo {\n transactionHash: TransactionId\n to: string\n nonce: number\n gasPrice: NumberString\n gasLimit: number\n data: string\n created: string\n description: string\n value: string\n}\n\n/**\n * Options for creation of postage batch\n */\nexport interface PostageBatchOptions {\n /**\n * Sets label for the postage batch\n */\n label?: string\n\n /**\n * Sets gas price in Wei for the transaction that creates the postage batch\n */\n gasPrice?: NumberString | string | bigint\n\n /**\n * Controls whether data can be overwritten that was uploaded with this postage batch.\n */\n immutableFlag?: boolean\n\n /**\n * The returned Promise will await until the purchased Postage Batch is usable.\n * In other word, it has to have enough block confirmations that Bee pronounce it usable.\n * When turned on, this significantly prolongs the creation of postage batch!\n *\n * If you plan to use the stamp right away for some action with Bee (like uploading using this stamp) it is\n * highly recommended to use this option, otherwise you might get errors \"stamp not usable\" from Bee.\n *\n * @default true\n */\n waitForUsable?: boolean\n\n /**\n * When waiting for the postage stamp to become usable, this specify the timeout for the waiting.\n * Default: 120s\n */\n waitForUsableTimeout?: number\n}\n\nexport interface Envelope {\n issuer: Uint8Array\n index: Uint8Array\n timestamp: Uint8Array\n signature: Uint8Array\n}\n\nexport interface EnvelopeWithBatchId extends Envelope {\n batchId: BatchId\n}\n\n/**\n * With this type a number should be represented in a string\n */\nexport type NumberString = string & { __numberString: never }\n\nexport const capacityBreakpoints = {\n ENCRYPTION_OFF: {\n [RedundancyLevel.OFF]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '44.70 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '6.66 MB', batchDepth: 18, utilizationRate: '0.61%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '112.06 MB', batchDepth: 19, utilizationRate: '5.09%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '687.62 MB', batchDepth: 20, utilizationRate: '15.65%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '2.60 GB', batchDepth: 21, utilizationRate: '30.27%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '7.73 GB', batchDepth: 22, utilizationRate: '44.99%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '19.94 GB', batchDepth: 23, utilizationRate: '58.03%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '47.06 GB', batchDepth: 24, utilizationRate: '68.48%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '105.51 GB', batchDepth: 25, utilizationRate: '76.77%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '227.98 GB', batchDepth: 26, utilizationRate: '82.94%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '476.68 GB', batchDepth: 27, utilizationRate: '86.71%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '993.65 GB', batchDepth: 28, utilizationRate: '88.37%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '2.04 TB', batchDepth: 29, utilizationRate: '92.88%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '4.17 TB', batchDepth: 30, utilizationRate: '94.81%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '8.45 TB', batchDepth: 31, utilizationRate: '96.06%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '17.07 TB', batchDepth: 32, utilizationRate: '97.01%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '34.36 TB', batchDepth: 33, utilizationRate: '97.65%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '69.04 TB', batchDepth: 34, utilizationRate: '98.11%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '138.54 TB', batchDepth: 35, utilizationRate: '98.44%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '277.72 TB', batchDepth: 36, utilizationRate: '98.67%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '556.35 TB', batchDepth: 37, utilizationRate: '98.83%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '1.11 PB', batchDepth: 38, utilizationRate: '98.91%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '2.23 PB', batchDepth: 39, utilizationRate: '98.96%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '4.46 PB', batchDepth: 40, utilizationRate: '98.98%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '8.93 PB', batchDepth: 41, utilizationRate: '99.11%' },\n ],\n [RedundancyLevel.MEDIUM]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '41.56 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '6.19 MB', batchDepth: 18, utilizationRate: '0.57%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '104.18 MB', batchDepth: 19, utilizationRate: '4.73%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '639.27 MB', batchDepth: 20, utilizationRate: '14.54%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '2.41 GB', batchDepth: 21, utilizationRate: '28.11%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '7.18 GB', batchDepth: 22, utilizationRate: '41.79%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '18.54 GB', batchDepth: 23, utilizationRate: '53.95%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '43.75 GB', batchDepth: 24, utilizationRate: '63.66%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '98.09 GB', batchDepth: 25, utilizationRate: '71.37%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '211.95 GB', batchDepth: 26, utilizationRate: '77.11%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '443.16 GB', batchDepth: 27, utilizationRate: '80.61%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '923.78 GB', batchDepth: 28, utilizationRate: '82.16%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '1.90 TB', batchDepth: 29, utilizationRate: '86.30%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '3.88 TB', batchDepth: 30, utilizationRate: '88.14%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '7.86 TB', batchDepth: 31, utilizationRate: '89.26%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '15.87 TB', batchDepth: 32, utilizationRate: '90.21%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '31.94 TB', batchDepth: 33, utilizationRate: '90.77%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '64.19 TB', batchDepth: 34, utilizationRate: '91.22%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '128.80 TB', batchDepth: 35, utilizationRate: '91.52%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '258.19 TB', batchDepth: 36, utilizationRate: '91.73%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '517.23 TB', batchDepth: 37, utilizationRate: '91.88%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '1.04 PB', batchDepth: 38, utilizationRate: '91.95%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '2.07 PB', batchDepth: 39, utilizationRate: '92.00%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '4.15 PB', batchDepth: 40, utilizationRate: '92.15%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '8.30 PB', batchDepth: 41, utilizationRate: '92.14%' },\n ],\n [RedundancyLevel.STRONG]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '37.37 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '5.57 MB', batchDepth: 18, utilizationRate: '0.51%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '93.68 MB', batchDepth: 19, utilizationRate: '4.25%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '574.81 MB', batchDepth: 20, utilizationRate: '13.07%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '2.17 GB', batchDepth: 21, utilizationRate: '25.26%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '6.46 GB', batchDepth: 22, utilizationRate: '37.58%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '16.67 GB', batchDepth: 23, utilizationRate: '48.50%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '39.34 GB', batchDepth: 24, utilizationRate: '57.24%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '88.20 GB', batchDepth: 25, utilizationRate: '64.17%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '190.58 GB', batchDepth: 26, utilizationRate: '69.33%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '398.47 GB', batchDepth: 27, utilizationRate: '72.48%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '830.63 GB', batchDepth: 28, utilizationRate: '73.85%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '1.71 TB', batchDepth: 29, utilizationRate: '77.59%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '3.49 TB', batchDepth: 30, utilizationRate: '79.27%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '7.07 TB', batchDepth: 31, utilizationRate: '80.34%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '14.27 TB', batchDepth: 32, utilizationRate: '81.12%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '28.72 TB', batchDepth: 33, utilizationRate: '81.63%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '57.71 TB', batchDepth: 34, utilizationRate: '82.01%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '115.81 TB', batchDepth: 35, utilizationRate: '82.29%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '232.16 TB', batchDepth: 36, utilizationRate: '82.48%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '465.07 TB', batchDepth: 37, utilizationRate: '82.61%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '931.23 TB', batchDepth: 38, utilizationRate: '82.67%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '1.86 PB', batchDepth: 39, utilizationRate: '82.71%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '3.73 PB', batchDepth: 40, utilizationRate: '82.78%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '7.46 PB', batchDepth: 41, utilizationRate: '82.79%' },\n ],\n [RedundancyLevel.INSANE]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '33.88 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '5.05 MB', batchDepth: 18, utilizationRate: '0.46%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '84.92 MB', batchDepth: 19, utilizationRate: '3.86%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '521.09 MB', batchDepth: 20, utilizationRate: '11.85%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '1.97 GB', batchDepth: 21, utilizationRate: '22.90%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '5.86 GB', batchDepth: 22, utilizationRate: '34.09%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '15.11 GB', batchDepth: 23, utilizationRate: '43.97%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '35.66 GB', batchDepth: 24, utilizationRate: '51.90%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '79.96 GB', batchDepth: 25, utilizationRate: '58.18%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '172.77 GB', batchDepth: 26, utilizationRate: '62.85%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '361.23 GB', batchDepth: 27, utilizationRate: '65.70%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '753.00 GB', batchDepth: 28, utilizationRate: '66.95%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '1.55 TB', batchDepth: 29, utilizationRate: '70.38%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '3.16 TB', batchDepth: 30, utilizationRate: '71.92%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '6.41 TB', batchDepth: 31, utilizationRate: '72.85%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '12.93 TB', batchDepth: 32, utilizationRate: '73.53%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '26.04 TB', batchDepth: 33, utilizationRate: '74.01%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '52.32 TB', batchDepth: 34, utilizationRate: '74.35%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '104.99 TB', batchDepth: 35, utilizationRate: '74.60%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '210.46 TB', batchDepth: 36, utilizationRate: '74.77%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '421.61 TB', batchDepth: 37, utilizationRate: '74.89%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '844.20 TB', batchDepth: 38, utilizationRate: '74.94%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '1.69 PB', batchDepth: 39, utilizationRate: '74.98%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '3.38 PB', batchDepth: 40, utilizationRate: '75.03%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '6.77 PB', batchDepth: 41, utilizationRate: '75.10%' },\n ],\n [RedundancyLevel.PARANOID]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '13.27 kB', batchDepth: 17, utilizationRate: '0.00%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '1.98 MB', batchDepth: 18, utilizationRate: '0.18%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '33.27 MB', batchDepth: 19, utilizationRate: '1.51%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '204.14 MB', batchDepth: 20, utilizationRate: '4.64%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '771.13 MB', batchDepth: 21, utilizationRate: '8.75%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '2.29 GB', batchDepth: 22, utilizationRate: '13.34%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '5.92 GB', batchDepth: 23, utilizationRate: '17.22%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '13.97 GB', batchDepth: 24, utilizationRate: '20.33%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '31.32 GB', batchDepth: 25, utilizationRate: '22.79%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '67.68 GB', batchDepth: 26, utilizationRate: '24.62%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '141.51 GB', batchDepth: 27, utilizationRate: '25.74%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '294.99 GB', batchDepth: 28, utilizationRate: '26.23%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '606.90 GB', batchDepth: 29, utilizationRate: '27.56%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '1.24 TB', batchDepth: 30, utilizationRate: '28.15%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '2.51 TB', batchDepth: 31, utilizationRate: '28.54%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '5.07 TB', batchDepth: 32, utilizationRate: '28.82%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '10.20 TB', batchDepth: 33, utilizationRate: '28.99%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '20.50 TB', batchDepth: 34, utilizationRate: '29.13%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '41.13 TB', batchDepth: 35, utilizationRate: '29.22%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '82.45 TB', batchDepth: 36, utilizationRate: '29.29%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '165.17 TB', batchDepth: 37, utilizationRate: '29.34%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '330.72 TB', batchDepth: 38, utilizationRate: '29.37%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '661.97 TB', batchDepth: 39, utilizationRate: '29.39%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '1.32 PB', batchDepth: 40, utilizationRate: '29.41%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '2.65 PB', batchDepth: 41, utilizationRate: '29.43%' },\n ],\n },\n\n ENCRYPTION_ON: {\n [RedundancyLevel.OFF]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '44.35 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '6.61 MB', batchDepth: 18, utilizationRate: '0.60%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '111.18 MB', batchDepth: 19, utilizationRate: '5.05%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '682.21 MB', batchDepth: 20, utilizationRate: '15.52%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '2.58 GB', batchDepth: 21, utilizationRate: '30.04%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '7.67 GB', batchDepth: 22, utilizationRate: '44.62%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '19.78 GB', batchDepth: 23, utilizationRate: '57.56%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '46.69 GB', batchDepth: 24, utilizationRate: '67.93%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '104.68 GB', batchDepth: 25, utilizationRate: '76.16%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '226.19 GB', batchDepth: 26, utilizationRate: '82.29%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '472.93 GB', batchDepth: 27, utilizationRate: '86.02%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '985.83 GB', batchDepth: 28, utilizationRate: '87.66%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '2.03 TB', batchDepth: 29, utilizationRate: '92.25%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '4.14 TB', batchDepth: 30, utilizationRate: '94.21%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '8.39 TB', batchDepth: 31, utilizationRate: '95.37%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '16.93 TB', batchDepth: 32, utilizationRate: '96.22%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '34.09 TB', batchDepth: 33, utilizationRate: '96.88%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '68.50 TB', batchDepth: 34, utilizationRate: '97.34%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '137.45 TB', batchDepth: 35, utilizationRate: '97.67%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '275.53 TB', batchDepth: 36, utilizationRate: '97.89%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '551.97 TB', batchDepth: 37, utilizationRate: '98.05%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '1.11 PB', batchDepth: 38, utilizationRate: '98.13%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '2.21 PB', batchDepth: 39, utilizationRate: '98.18%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '4.43 PB', batchDepth: 40, utilizationRate: '98.36%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '8.86 PB', batchDepth: 41, utilizationRate: '98.37%' },\n ],\n [RedundancyLevel.MEDIUM]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '40.89 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '6.09 MB', batchDepth: 18, utilizationRate: '0.56%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '102.49 MB', batchDepth: 19, utilizationRate: '4.65%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '628.91 MB', batchDepth: 20, utilizationRate: '14.30%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '2.38 GB', batchDepth: 21, utilizationRate: '27.68%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '7.07 GB', batchDepth: 22, utilizationRate: '41.15%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '18.24 GB', batchDepth: 23, utilizationRate: '53.09%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '43.04 GB', batchDepth: 24, utilizationRate: '62.63%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '96.50 GB', batchDepth: 25, utilizationRate: '70.21%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '208.52 GB', batchDepth: 26, utilizationRate: '75.86%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '435.98 GB', batchDepth: 27, utilizationRate: '79.30%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '908.81 GB', batchDepth: 28, utilizationRate: '80.82%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '1.87 TB', batchDepth: 29, utilizationRate: '84.98%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '3.81 TB', batchDepth: 30, utilizationRate: '86.67%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '7.73 TB', batchDepth: 31, utilizationRate: '87.84%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '15.61 TB', batchDepth: 32, utilizationRate: '88.74%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '31.43 TB', batchDepth: 33, utilizationRate: '89.34%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '63.15 TB', batchDepth: 34, utilizationRate: '89.74%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '126.71 TB', batchDepth: 35, utilizationRate: '90.03%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '254.01 TB', batchDepth: 36, utilizationRate: '90.24%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '508.85 TB', batchDepth: 37, utilizationRate: '90.39%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '1.02 PB', batchDepth: 38, utilizationRate: '90.47%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '2.04 PB', batchDepth: 39, utilizationRate: '90.51%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '4.08 PB', batchDepth: 40, utilizationRate: '90.64%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '8.17 PB', batchDepth: 41, utilizationRate: '90.65%' },\n ],\n [RedundancyLevel.STRONG]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '36.73 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '5.47 MB', batchDepth: 18, utilizationRate: '0.50%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '92.07 MB', batchDepth: 19, utilizationRate: '4.18%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '564.95 MB', batchDepth: 20, utilizationRate: '12.85%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '2.13 GB', batchDepth: 21, utilizationRate: '24.86%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '6.35 GB', batchDepth: 22, utilizationRate: '36.97%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '16.38 GB', batchDepth: 23, utilizationRate: '47.67%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '38.66 GB', batchDepth: 24, utilizationRate: '56.26%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '86.69 GB', batchDepth: 25, utilizationRate: '63.07%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '187.31 GB', batchDepth: 26, utilizationRate: '68.14%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '391.64 GB', batchDepth: 27, utilizationRate: '71.24%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '816.39 GB', batchDepth: 28, utilizationRate: '72.59%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '1.68 TB', batchDepth: 29, utilizationRate: '76.34%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '3.43 TB', batchDepth: 30, utilizationRate: '77.89%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '6.94 TB', batchDepth: 31, utilizationRate: '78.86%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '14.02 TB', batchDepth: 32, utilizationRate: '79.71%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '28.23 TB', batchDepth: 33, utilizationRate: '80.23%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '56.72 TB', batchDepth: 34, utilizationRate: '80.60%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '113.82 TB', batchDepth: 35, utilizationRate: '80.88%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '228.18 TB', batchDepth: 36, utilizationRate: '81.06%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '457.10 TB', batchDepth: 37, utilizationRate: '81.20%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '915.26 TB', batchDepth: 38, utilizationRate: '81.26%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '1.83 PB', batchDepth: 39, utilizationRate: '81.30%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '3.67 PB', batchDepth: 40, utilizationRate: '81.43%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '7.34 PB', batchDepth: 41, utilizationRate: '81.45%' },\n ],\n [RedundancyLevel.INSANE]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '33.26 kB', batchDepth: 17, utilizationRate: '0.01%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '4.96 MB', batchDepth: 18, utilizationRate: '0.45%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '83.38 MB', batchDepth: 19, utilizationRate: '3.79%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '511.65 MB', batchDepth: 20, utilizationRate: '11.64%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '1.93 GB', batchDepth: 21, utilizationRate: '22.52%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '5.75 GB', batchDepth: 22, utilizationRate: '33.50%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '14.84 GB', batchDepth: 23, utilizationRate: '43.19%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '35.02 GB', batchDepth: 24, utilizationRate: '50.96%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '78.51 GB', batchDepth: 25, utilizationRate: '57.12%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '169.64 GB', batchDepth: 26, utilizationRate: '61.71%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '354.69 GB', batchDepth: 27, utilizationRate: '64.52%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '739.37 GB', batchDepth: 28, utilizationRate: '65.74%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '1.52 TB', batchDepth: 29, utilizationRate: '69.15%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '3.10 TB', batchDepth: 30, utilizationRate: '70.56%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '6.29 TB', batchDepth: 31, utilizationRate: '71.48%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '12.70 TB', batchDepth: 32, utilizationRate: '72.18%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '25.57 TB', batchDepth: 33, utilizationRate: '72.67%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '51.37 TB', batchDepth: 34, utilizationRate: '73.00%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '103.08 TB', batchDepth: 35, utilizationRate: '73.24%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '206.65 TB', batchDepth: 36, utilizationRate: '73.42%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '413.98 TB', batchDepth: 37, utilizationRate: '73.54%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '828.91 TB', batchDepth: 38, utilizationRate: '73.59%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '1.66 PB', batchDepth: 39, utilizationRate: '73.62%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '3.32 PB', batchDepth: 40, utilizationRate: '73.72%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '6.64 PB', batchDepth: 41, utilizationRate: '73.74%' },\n ],\n [RedundancyLevel.PARANOID]: [\n { theoreticalVolume: '536.87 MB', effectiveVolume: '13.17 kB', batchDepth: 17, utilizationRate: '0.00%' },\n { theoreticalVolume: '1.07 GB', effectiveVolume: '1.96 MB', batchDepth: 18, utilizationRate: '0.18%' },\n { theoreticalVolume: '2.15 GB', effectiveVolume: '33.01 MB', batchDepth: 19, utilizationRate: '1.50%' },\n { theoreticalVolume: '4.29 GB', effectiveVolume: '202.53 MB', batchDepth: 20, utilizationRate: '4.61%' },\n { theoreticalVolume: '8.59 GB', effectiveVolume: '765.05 MB', batchDepth: 21, utilizationRate: '8.68%' },\n { theoreticalVolume: '17.18 GB', effectiveVolume: '2.28 GB', batchDepth: 22, utilizationRate: '13.27%' },\n { theoreticalVolume: '34.36 GB', effectiveVolume: '5.87 GB', batchDepth: 23, utilizationRate: '17.08%' },\n { theoreticalVolume: '68.72 GB', effectiveVolume: '13.86 GB', batchDepth: 24, utilizationRate: '20.17%' },\n { theoreticalVolume: '137.44 GB', effectiveVolume: '31.08 GB', batchDepth: 25, utilizationRate: '22.61%' },\n { theoreticalVolume: '274.88 GB', effectiveVolume: '67.15 GB', batchDepth: 26, utilizationRate: '24.43%' },\n { theoreticalVolume: '549.76 GB', effectiveVolume: '140.40 GB', batchDepth: 27, utilizationRate: '25.54%' },\n { theoreticalVolume: '1.10 TB', effectiveVolume: '292.67 GB', batchDepth: 28, utilizationRate: '26.03%' },\n { theoreticalVolume: '2.20 TB', effectiveVolume: '602.12 GB', batchDepth: 29, utilizationRate: '27.35%' },\n { theoreticalVolume: '4.40 TB', effectiveVolume: '1.23 TB', batchDepth: 30, utilizationRate: '27.94%' },\n { theoreticalVolume: '8.80 TB', effectiveVolume: '2.49 TB', batchDepth: 31, utilizationRate: '28.32%' },\n { theoreticalVolume: '17.59 TB', effectiveVolume: '5.03 TB', batchDepth: 32, utilizationRate: '28.60%' },\n { theoreticalVolume: '35.18 TB', effectiveVolume: '10.12 TB', batchDepth: 33, utilizationRate: '28.77%' },\n { theoreticalVolume: '70.37 TB', effectiveVolume: '20.34 TB', batchDepth: 34, utilizationRate: '28.91%' },\n { theoreticalVolume: '140.74 TB', effectiveVolume: '40.80 TB', batchDepth: 35, utilizationRate: '29.00%' },\n { theoreticalVolume: '281.47 TB', effectiveVolume: '81.80 TB', batchDepth: 36, utilizationRate: '29.06%' },\n { theoreticalVolume: '562.95 TB', effectiveVolume: '163.87 TB', batchDepth: 37, utilizationRate: '29.11%' },\n { theoreticalVolume: '1.13 PB', effectiveVolume: '328.11 TB', batchDepth: 38, utilizationRate: '29.14%' },\n { theoreticalVolume: '2.25 PB', effectiveVolume: '656.76 TB', batchDepth: 39, utilizationRate: '29.16%' },\n { theoreticalVolume: '4.50 PB', effectiveVolume: '1.31 PB', batchDepth: 40, utilizationRate: '29.18%' },\n { theoreticalVolume: '9.01 PB', effectiveVolume: '2.63 PB', batchDepth: 41, utilizationRate: '29.19%' },\n ],\n },\n}\n","import { Dates } from 'cafe-utility'\n\nexport class Duration {\n private seconds: number\n static ZERO: Duration = new Duration(0)\n\n private constructor(seconds: number) {\n this.seconds = Math.ceil(seconds)\n\n if (seconds < 0) {\n this.seconds = 0\n }\n }\n\n static fromMilliseconds(milliseconds: number): Duration {\n return new Duration(milliseconds / 1000)\n }\n\n static fromSeconds(seconds: number): Duration {\n return new Duration(seconds)\n }\n\n static fromHours(hours: number): Duration {\n return new Duration(hours * 60 * 60)\n }\n\n static fromDays(days: number): Duration {\n return new Duration(days * 24 * 60 * 60)\n }\n\n static fromWeeks(weeks: number): Duration {\n return new Duration(weeks * 7 * 24 * 60 * 60)\n }\n\n static fromYears(years: number): Duration {\n return new Duration(years * 365 * 24 * 60 * 60)\n }\n\n static fromEndDate(endDate: Date, startDate?: Date): Duration {\n return new Duration((endDate.getTime() - (startDate ?? new Date()).getTime()) / 1000)\n }\n\n /**\n * Parses a duration string and returns a `Duration` instance.\n *\n * Case insensitive. E.g. both `\"28h\"` and `\"1D\"` are valid.\n *\n * Whitespaces are ignored. E.g. both `\"5 d\"` and `\"2weeks\"` are valid.\n *\n * Decimal numbers are supported. E.g. `\"1.5h\"` is valid.\n *\n * Supported units:\n *\n * - ms, milli, millis, millisecond, milliseconds\n * - s, sec, second, seconds\n * - m, min, minute, minutes\n * - h, hour, hours\n * - d, day, days\n * - w, week, weeks\n * - month, months\n * - y, year, years\n *\n * @param duration - A string representing a duration\n * @returns a `Duration` instance\n */\n static parseFromString(duration: string): Duration {\n return Duration.fromSeconds(Dates.make(duration) / 1000)\n }\n\n toSeconds(): number {\n return this.seconds\n }\n\n toHours(): number {\n return this.seconds / 60 / 60\n }\n\n toDays(): number {\n return this.seconds / 24 / 60 / 60\n }\n\n toWeeks(): number {\n return this.seconds / 7 / 24 / 60 / 60\n }\n\n toYears(): number {\n return this.seconds / 365 / 24 / 60 / 60\n }\n\n toEndDate(startDate?: Date): Date {\n return new Date((startDate ?? new Date()).getTime() + this.seconds * 1000)\n }\n\n represent(): string {\n return Dates.secondsToHumanTime(this.seconds)\n }\n\n isZero(): boolean {\n return this.seconds === 0\n }\n}\n","import { FixedPointNumber } from 'cafe-utility'\nimport { NumberString } from '..'\n\nexport class BZZ {\n public static readonly DIGITS = 16\n\n private state: FixedPointNumber\n\n private constructor(state: FixedPointNumber) {\n this.state = state\n }\n\n public static fromDecimalString(string: string) {\n return new BZZ(FixedPointNumber.fromDecimalString(string, BZZ.DIGITS))\n }\n\n public static fromPLUR(plur: NumberString | string | bigint) {\n return new BZZ(new FixedPointNumber(plur, BZZ.DIGITS))\n }\n\n public toPLURString() {\n return this.state.toString()\n }\n\n public toPLURBigInt() {\n return this.state.value\n }\n\n public toDecimalString() {\n return this.state.toDecimalString()\n }\n\n public toSignificantDigits(digits: number) {\n return this.toDecimalString().slice(0, this.toDecimalString().indexOf('.') + digits + 1)\n }\n\n /**\n * Does not mutate the current BZZ instance.\n *\n * @param other BZZ instance, or amount in PLUR\n * @returns New BZZ instance\n */\n public plus(other: BZZ | NumberString | string | bigint) {\n return new BZZ(this.state.add(other instanceof BZZ ? other.state : new FixedPointNumber(other, BZZ.DIGITS)))\n }\n\n /**\n * Does not mutate the current BZZ instance.\n *\n * @param other BZZ instance, or amount in PLUR\n * @returns New BZZ instance\n */\n public minus(other: BZZ | NumberString | string | bigint) {\n return new BZZ(this.state.subtract(other instanceof BZZ ? other.state : new FixedPointNumber(other, BZZ.DIGITS)))\n }\n\n /**\n * Does not mutate the current BZZ instance.\n *\n * @param other Divisor\n * @returns New BZZ instance\n */\n public divide(other: bigint) {\n return new BZZ(this.state.divmod(other)[0])\n }\n\n public gt(other: BZZ) {\n return this.state.compare(other.state) === 1\n }\n\n public gte(other: BZZ) {\n return this.state.compare(other.state) !== -1\n }\n\n public lt(other: BZZ) {\n return this.state.compare(other.state) === -1\n }\n\n public lte(other: BZZ) {\n return this.state.compare(other.state) !== 1\n }\n\n public eq(other: BZZ) {\n return this.state.compare(other.state) === 0\n }\n\n public exchangeToDAI(daiPerBzz: DAI): DAI {\n return DAI.fromWei(\n this.state.exchange('*', new FixedPointNumber(daiPerBzz.toWeiBigInt(), DAI.DIGITS), DAI.DIGITS).value,\n )\n }\n}\n\nexport class DAI {\n public static readonly DIGITS = 18\n\n private state: FixedPointNumber\n\n private constructor(state: FixedPointNumber) {\n this.state = state\n }\n\n public static fromDecimalString(string: string) {\n return new DAI(FixedPointNumber.fromDecimalString(string, DAI.DIGITS))\n }\n\n public static fromWei(wei: NumberString | string | bigint) {\n return new DAI(new FixedPointNumber(wei, DAI.DIGITS))\n }\n\n public toWeiString() {\n return this.state.toString()\n }\n\n public toWeiBigInt() {\n return this.state.value\n }\n\n public toDecimalString() {\n return this.state.toDecimalString()\n }\n\n public toSignificantDigits(digits: number) {\n return this.toDecimalString().slice(0, this.toDecimalString().indexOf('.') + digits + 1)\n }\n\n /**\n * Does not mutate the current DAI instance.\n *\n * @param other DAI instance, or amount in PLUR\n * @returns New DAI instance\n */\n public plus(other: DAI | NumberString | string | bigint) {\n return new DAI(this.state.add(other instanceof DAI ? other.state : new FixedPointNumber(other, DAI.DIGITS)))\n }\n\n /**\n * Does not mutate the current DAI instance.\n *\n * @param other DAI instance, or amount in PLUR\n * @returns New DAI instance\n */\n public minus(other: DAI | NumberString | string | bigint) {\n return new DAI(this.state.subtract(other instanceof DAI ? other.state : new FixedPointNumber(other, DAI.DIGITS)))\n }\n\n /**\n * Does not mutate the current DAI instance.\n *\n * @param other Divisor\n * @returns New DAI instance\n */\n public divide(other: bigint) {\n return new DAI(this.state.divmod(other)[0])\n }\n\n public gt(other: DAI) {\n return this.state.compare(other.state) === 1\n }\n\n public gte(other: DAI) {\n return this.state.compare(other.state) !== -1\n }\n\n public lt(other: DAI) {\n return this.state.compare(other.state) === -1\n }\n\n public lte(other: DAI) {\n return this.state.compare(other.state) !== 1\n }\n\n public eq(other: DAI) {\n return this.state.compare(other.state) === 0\n }\n\n public exchangeToBZZ(daiPerBzz: DAI): BZZ {\n return BZZ.fromPLUR(\n this.state.exchange('/', new FixedPointNumber(daiPerBzz.toWeiBigInt(), DAI.DIGITS), BZZ.DIGITS).value,\n )\n }\n}\n","/**\n * Compatibility functions for working with File API objects\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/File\n */\nexport function isFile(file: unknown): file is File {\n // browser\n if (typeof File === 'function' && file instanceof File) {\n return true\n }\n\n // node.js\n const f = file as File\n\n return (\n typeof f === 'object' &&\n typeof (f as File).name === 'string' &&\n (typeof (f as File).stream === 'function' || typeof (f as File).arrayBuffer === 'function')\n )\n}\n\n/**\n * Compatibility helper for browsers where the `arrayBuffer function is\n * missing from `File` objects.\n *\n * @param file A File object\n */\nexport async function fileArrayBuffer(file: File): Promise<ArrayBuffer> {\n if (file.arrayBuffer) {\n return file.arrayBuffer()\n }\n\n // workaround for Safari where arrayBuffer is not supported on Files\n return new Promise(resolve => {\n const fr = new FileReader()\n fr.onload = () => resolve(fr.result as ArrayBuffer)\n fr.readAsArrayBuffer(file)\n })\n}\n","import { Types } from 'cafe-utility'\nimport * as stream from 'stream'\nimport {\n AllTagsOptions,\n BeeRequestOptions,\n CollectionUploadOptions,\n DownloadOptions,\n FileUploadOptions,\n GsocMessageHandler,\n NumberString,\n PostageBatchOptions,\n PssMessageHandler,\n RedundantUploadOptions,\n Tag,\n TAGS_LIMIT_MAX,\n TAGS_LIMIT_MIN,\n TransactionOptions,\n UploadOptions,\n} from '../types'\nimport { isFile } from './file'\nimport { PublicKey, Reference } from './typed-bytes'\n\nexport function isReadable(value: unknown): value is stream.Readable {\n return typeof stream.Readable !== 'undefined' && value instanceof stream.Readable\n}\n\nexport function asNumberString(value: unknown, options?: { name?: string; min?: bigint; max?: bigint }): NumberString {\n if (typeof value === 'bigint') {\n value = value.toString()\n }\n\n return Types.asIntegerString(value, options) as NumberString\n}\n\nexport function prepareBeeRequestOptions(value: unknown): BeeRequestOptions {\n const object = Types.asObject(value, { name: 'BeeRequestOptions' })\n\n return {\n baseURL: Types.asOptional(x => Types.asString(x, { name: 'baseURL' }), object.baseURL),\n timeout: Types.asOptional(x => Types.asInteger(x, { name: 'timeout', min: 0 }), object.timeout),\n headers: Types.asOptional(x => Types.asStringMap(x, { name: 'headers' }), object.headers),\n onRequest: Types.asOptional(x => Types.asFunction(x, { name: 'onRequest' }), object.onRequest) as\n | BeeRequestOptions['onRequest']\n | undefined,\n httpAgent: object.httpAgent,\n httpsAgent: object.httpsAgent,\n endlesslyRetry: Types.asOptional(x => Types.asBoolean(x, { name: 'endlesslyRetry' }), object.endlesslyRetry),\n }\n}\n\nexport function prepareDownloadOptions(value: unknown): DownloadOptions {\n const object = Types.asObject(value, { name: 'DownloadOptions' })\n\n return {\n redundancyStrategy: Types.asOptional(\n x => Types.asInteger(x, { name: 'redundancyStrategy' }),\n object.redundancyStrategy,\n ),\n fallback: Types.asOptional(x => Types.asBoolean(x, { name: 'fallback' }), object.fallback),\n timeoutMs: Types.asOptional(x => Types.asInteger(x, { name: 'timeoutMs', min: 0 }), object.timeoutMs),\n actPublisher: Types.asOptional(x => new PublicKey(x), object.actPublisher),\n actHistoryAddress: Types.asOptional(x => new Reference(x), object.actHistoryAddress),\n actTimestamp: Types.asOptional(x => Types.asNumber(x, { name: 'actTimestamp' }), object.actTimestamp),\n }\n}\n\nexport function prepareUploadOptions(value: unknown, name = 'UploadOptions'): UploadOptions {\n const object = Types.asObject(value, { name })\n\n return {\n act: Types.asOptional(x => Types.asBoolean(x, { name: 'act' }), object.act),\n actHistoryAddress: Types.asOptional(x => new Reference(x), object.actHistoryAddress),\n deferred: Types.asOptional(x => Types.asBoolean(x, { name: 'deferred' }), object.deferred),\n encrypt: Types.asOptional(x => Types.asBoolean(x, { name: 'encrypt' }), object.encrypt),\n pin: Types.asOptional(x => Types.asBoolean(x, { name: 'pin' }), object.pin),\n tag: Types.asOptional(x => Types.asInteger(x, { name: 'tag', min: 0 }), object.tag),\n }\n}\n\nexport function prepareRedundantUploadOptions(value: unknown, name = 'UploadOptions'): RedundantUploadOptions {\n const uploadOptions = prepareUploadOptions(value, name)\n\n const object = Types.asObject(value, { name })\n\n return {\n ...uploadOptions,\n redundancyLevel: Types.asOptional(\n x => Types.asInteger(x, { name: 'redundancyLevel', min: 0 }),\n object.redundancyLevel,\n ),\n }\n}\n\nexport function prepareFileUploadOptions(value: unknown): FileUploadOptions {\n const uploadOptions = prepareUploadOptions(value, 'FileUploadOptions')\n\n const object = Types.asObject(value, { name: 'FileUploadOptions' })\n\n return {\n ...uploadOptions,\n size: Types.asOptional(x => Types.asInteger(x, { name: 'size', min: 0 }), object.size),\n contentType: Types.asOptional(x => Types.asString(x, { name: 'contentType' }), object.contentType),\n redundancyLevel: Types.asOptional(\n x => Types.asInteger(x, { name: 'redundancyLevel', min: 0 }),\n object.redundancyLevel,\n ),\n }\n}\n\nexport function prepareCollectionUploadOptions(value: unknown): CollectionUploadOptions {\n const uploadOptions = prepareUploadOptions(value, 'CollectionUploadOptions')\n\n const object = Types.asObject(value, { name: 'CollectionUploadOptions' })\n\n return {\n ...uploadOptions,\n errorDocument: Types.asOptional(x => Types.asString(x, { name: 'errorDocument' }), object.errorDocument),\n indexDocument: Types.asOptional(x => Types.asString(x, { name: 'indexDocument' }), object.indexDocument),\n redundancyLevel: Types.asOptional(\n x => Types.asInteger(x, { name: 'redundancyLevel', min: 0 }),\n object.redundancyLevel,\n ),\n }\n}\n\nexport function isTag(value: unknown): value is Tag {\n try {\n const object = Types.asObject(value, { name: 'Tag' })\n Types.asInteger(object.uid, { name: 'Tag.uid' })\n\n return true\n } catch {\n return false\n }\n}\n\nexport function preparePssMessageHandler(value: unknown): PssMessageHandler {\n const object = Types.asObject(value, { name: 'PssMessageHandler' })\n\n return {\n onMessage: Types.asFunction(object.onMessage, { name: 'onMessage' }) as PssMessageHandler['onMessage'],\n onError: Types.asFunction(object.onError, { name: 'onError' }) as PssMessageHandler['onError'],\n onClose: Types.asFunction(object.onClose, { name: 'onClose' }) as PssMessageHandler['onClose'],\n }\n}\n\nexport function prepareGsocMessageHandler(value: unknown): GsocMessageHandler {\n const object = Types.asObject(value, { name: 'GsocMessageHandler' })\n\n return {\n onMessage: Types.asFunction(object.onMessage, { name: 'onMessage' }) as GsocMessageHandler['onMessage'],\n onError: Types.asFunction(object.onError, { name: 'onError' }) as GsocMessageHandler['onError'],\n onClose: Types.asFunction(object.onClose, { name: 'onClose' }) as GsocMessageHandler['onClose'],\n }\n}\n\nexport function preparePostageBatchOptions(value: unknown): PostageBatchOptions {\n const object = Types.asObject(value, { name: 'PostageBatchOptions' })\n\n return {\n gasPrice: Types.asOptional(x => asNumberString(x, { name: 'gasPrice' }), object.gasPrice),\n immutableFlag: Types.asOptional(x => Types.asBoolean(x, { name: 'immutableFlag' }), object.immutableFlag),\n label: Types.asOptional(x => Types.asString(x, { name: 'label' }), object.label),\n waitForUsable: Types.asOptional(x => Types.asBoolean(x, { name: 'waitForUsable' }), object.waitForUsable),\n waitForUsableTimeout: Types.asOptional(\n x => Types.asInteger(x, { name: 'waitForUsableTimeout', min: 0 }),\n object.waitForUsableTimeout,\n ),\n }\n}\n\nexport function prepareTransactionOptions(value: unknown, name = 'TransactionOptions'): TransactionOptions {\n const object = Types.asObject(value, { name })\n\n return {\n gasLimit: Types.asOptional(x => asNumberString(x, { name: 'gasLimit', min: 0n }), object.gasLimit),\n gasPrice: Types.asOptional(x => asNumberString(x, { name: 'gasPrice', min: 0n }), object.gasPrice),\n }\n}\n\n/**\n * Check whether the given parameter is valid data to upload\n * @param value\n * @throws TypeError if not valid\n */\nexport function assertData(value: unknown): asserts value is string | Uint8Array {\n if (typeof value !== 'string' && !(value instanceof Uint8Array)) {\n throw new TypeError('Data must be either string or Uint8Array!')\n }\n}\n\n/**\n * Check whether the given parameter is a correct file representation to file upload.\n * @param value\n * @throws TypeError if not valid\n */\nexport function assertFileData(value: unknown): asserts value is string | Uint8Array | stream.Readable | File {\n if (typeof value !== 'string' && !(value instanceof Uint8Array) && !isFile(value) && !isReadable(value)) {\n throw new TypeError('Data must be either string, Readable, Uint8Array or File!')\n }\n}\n\n/**\n * Checks whether optional options for AllTags query are valid\n * @param options\n */\nexport function prepareAllTagsOptions(value: unknown): AllTagsOptions {\n const object = Types.asObject(value, { name: 'AllTagsOptions' })\n\n return {\n limit: Types.asOptional(\n x => Types.asInteger(x, { name: 'limit', min: TAGS_LIMIT_MIN, max: TAGS_LIMIT_MAX }),\n object.limit,\n ),\n offset: Types.asOptional(x => Types.asInteger(x, { name: 'offset', min: 0 }), object.offset),\n }\n}\n\n/**\n * Utility functions that return Tag UID\n * @param tagUid\n */\nexport function makeTagUid(tagUid: number | Tag | string | null | undefined): number {\n if (tagUid === undefined || tagUid === null) {\n throw new TypeError(`Expected number | Tag | string from tagUid, got: ${tagUid}`)\n }\n\n if (isTag(tagUid)) {\n return tagUid.uid\n } else if (typeof tagUid === 'number' || typeof tagUid === 'string') {\n return Types.asNumber(tagUid, { name: 'tagUid', min: 0 })\n }\n\n throw new TypeError(`Expected number | Tag | string from tagUid, got: ${tagUid}`)\n}\n","import { Binary } from 'cafe-utility'\nimport { capacityBreakpoints, EnvelopeWithBatchId, NumberString, RedundancyLevel } from '../types'\nimport { Bytes, parseSizeToBytes } from './bytes'\nimport { Duration } from './duration'\nimport { Size } from './size'\nimport { BZZ } from './tokens'\nimport { asNumberString } from './type'\n\nconst MAX_UTILIZATION = 0.9\n\n/**\n * Utility function that calculates usage of postage batch based on its utilization, depth and bucket depth.\n *\n * For smaller depths (up to 20), this may provide less accurate results.\n *\n * @returns {number} A number between 0 and 1 representing the usage of the postage batch.\n */\nexport function getStampUsage(utilization: number, depth: number, bucketDepth: number): number {\n return utilization / Math.pow(2, depth - bucketDepth)\n}\n\n/**\n * Utility function that calculates the theoritical maximum size of a postage batch based on its depth.\n *\n * For smaller depths (up to 22), this may provide less accurate results.\n *\n * @returns {number} The maximum theoretical size of the postage batch in bytes.\n */\nexport function getStampTheoreticalBytes(depth: number): number {\n return 4096 * 2 ** depth\n}\n\n/**\n * Based on https://docs.ethswarm.org/docs/learn/technology/contracts/postage-stamp/#effective-utilisation-table\n * Optimised for encrypted, medium erasure coding\n */\nconst effectiveSizeBreakpoints = [\n [17, 0.00004089],\n [18, 0.00609],\n [19, 0.10249],\n [20, 0.62891],\n [21, 2.38],\n [22, 7.07],\n [23, 18.24],\n [24, 43.04],\n [25, 96.5],\n [26, 208.52],\n [27, 435.98],\n [28, 908.81],\n [29, 1870],\n [30, 3810],\n [31, 7730],\n [32, 15610],\n [33, 31430],\n [34, 63150],\n]\n\n/**\n * Utility function that calculates the effective size of a postage batch based on its depth.\n *\n * Below 22 depth the effective size is 0\n * Above 34 it's always > 99%\n *\n * @returns {number} The effective size of the postage batch in bytes.\n */\nexport function getStampEffectiveBytes(\n depth: number,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n): number {\n if (depth < 17) {\n return 0\n }\n\n if (encryption !== undefined && erasureCodeLevel !== undefined) {\n const encryptionKey = encryption ? 'ENCRYPTION_ON' : 'ENCRYPTION_OFF'\n const breakpoints = capacityBreakpoints[encryptionKey][erasureCodeLevel]\n const entry = breakpoints.find(item => item.batchDepth === depth)\n\n if (entry?.effectiveVolume) {\n return parseSizeToBytes(entry.effectiveVolume)\n }\n } else {\n const breakpoint = effectiveSizeBreakpoints.find(([d, size]) => {\n if (depth === d) {\n return size\n }\n })\n\n if (breakpoint) {\n return breakpoint[1] * 1000 * 1000 * 1000\n }\n }\n\n return Math.ceil(getStampTheoreticalBytes(depth) * MAX_UTILIZATION)\n}\n\nexport function getStampEffectiveBytesBreakpoints(\n encryption: boolean,\n erasureCodeLevel?: RedundancyLevel,\n): Map<number, number> {\n const map = new Map<number, number>()\n\n for (let i = 17; i < 35; i++) {\n map.set(i, getStampEffectiveBytes(i, encryption, erasureCodeLevel))\n }\n\n return map\n}\n\n/**\n * Utility function that calculates the cost of a postage batch based on its depth and amount.\n */\nexport function getStampCost(depth: number, amount: NumberString | string | bigint): BZZ {\n return BZZ.fromPLUR(2n ** BigInt(depth) * BigInt(amount))\n}\n\n/**\n * Utility function that calculates the TTL of a postage batch based on its amount, price per block and block time.\n *\n * For more accurate results, get the price per block and block time from the Bee node or the blockchain.\n *\n * @returns {number} The TTL of the postage batch.\n */\nexport function getStampDuration(\n amount: NumberString | string | bigint,\n pricePerBlock: number,\n blockTime: number,\n): Duration {\n const amountBigInt = BigInt(asNumberString(amount))\n\n return Duration.fromSeconds(Number((amountBigInt * BigInt(blockTime)) / BigInt(pricePerBlock)))\n}\n\n/**\n * Get the postage batch `amount` required for a given `duration`.\n *\n * @param duration A duration object representing the duration of the storage.\n * @param pricePerBlock The price per block in PLUR.\n * @param blockTime The block time in seconds.\n */\nexport function getAmountForDuration(duration: Duration, pricePerBlock: number, blockTime: number): bigint {\n return (BigInt(duration.toSeconds()) / BigInt(blockTime)) * BigInt(pricePerBlock) + 1n\n}\n\n/**\n * Utility function that calculates the depth required for a postage batch to achieve the specified effective size\n *\n * @param size The effective size of the postage batch\n * @returns\n */\nexport function getDepthForSize(size: Size, encryption?: boolean, erasureCodeLevel?: RedundancyLevel): number {\n if (encryption !== undefined && erasureCodeLevel !== undefined) {\n const encryptionKey = encryption ? 'ENCRYPTION_ON' : 'ENCRYPTION_OFF'\n const breakpoints = capacityBreakpoints[encryptionKey][erasureCodeLevel]\n\n const entry = breakpoints.find(item => {\n return size.toBytes() <= parseSizeToBytes(item.effectiveVolume)\n })\n\n if (entry?.effectiveVolume) {\n return entry.batchDepth\n }\n } else {\n for (const [depth, sizeBreakpoint] of effectiveSizeBreakpoints) {\n if (size.toBytes() <= sizeBreakpoint * 1000 * 1000 * 1000) {\n return depth\n }\n }\n }\n\n return 35\n}\n\nexport function convertEnvelopeToMarshaledStamp(envelope: EnvelopeWithBatchId): Bytes {\n return marshalStamp(envelope.signature, envelope.batchId.toUint8Array(), envelope.timestamp, envelope.index)\n}\n\nexport function marshalStamp(\n signature: Uint8Array,\n batchId: Uint8Array,\n timestamp: Uint8Array,\n index: Uint8Array,\n): Bytes {\n if (signature.length !== 65) {\n throw Error('invalid signature length')\n }\n\n if (batchId.length !== 32) {\n throw Error('invalid batch ID length')\n }\n\n if (timestamp.length !== 8) {\n throw Error('invalid timestamp length')\n }\n\n if (index.length !== 8) {\n throw Error('invalid index length')\n }\n\n return new Bytes(Binary.concatBytes(batchId, index, timestamp, signature))\n}\n","import { Types } from 'cafe-utility'\nimport { EnvelopeWithBatchId, FileHeaders } from '../types'\nimport { BeeError } from './error'\nimport { convertEnvelopeToMarshaledStamp } from './stamps'\nimport { BatchId, PublicKey, Reference } from './typed-bytes'\n\nexport function readFileHeaders(headers: Record<string, string>): FileHeaders {\n const name = readContentDispositionFilename(headers['content-disposition'])\n const tagUid = readTagUid(headers['swarm-tag-uid'])\n const contentType = headers['content-type'] || undefined\n\n return {\n name,\n tagUid,\n contentType,\n }\n}\n\nfunction readContentDispositionFilename(header: string | null): string {\n if (!header) {\n throw new BeeError('missing content-disposition header')\n }\n\n // Regex was found here\n // https://stackoverflow.com/questions/23054475/javascript-regex-for-extracting-filename-from-content-disposition-header\n const dispositionMatch = header.match(/filename\\*?=['\"]?(?:UTF-\\d['\"]*)?([^;\\r\\n\"']*)['\"]?;?/i)\n\n if (dispositionMatch && dispositionMatch.length > 0) {\n return dispositionMatch[1]\n }\n throw new BeeError('invalid content-disposition header')\n}\n\nfunction readTagUid(header: string | null): number | undefined {\n if (!header) {\n return undefined\n }\n\n return parseInt(header, 10)\n}\n\nexport function prepareRequestHeaders(\n stamp: BatchId | Uint8Array | string | EnvelopeWithBatchId | null,\n nullableOptions?: unknown,\n): Record<string, string> {\n const headers: Record<string, string> = {}\n\n if (isEnvelopeWithBatchId(stamp)) {\n headers['swarm-postage-stamp'] = convertEnvelopeToMarshaledStamp(stamp).toHex()\n } else if (stamp) {\n stamp = new BatchId(stamp)\n headers['swarm-postage-batch-id'] = stamp.toHex()\n }\n\n if (!nullableOptions) {\n return headers\n }\n\n const options = Types.asObject(nullableOptions)\n\n if (options.size) {\n headers['content-length'] = String(options.size)\n }\n\n if (options.contentType) {\n headers['content-type'] = String(options.contentType)\n }\n\n if (options.redundancyLevel) {\n headers['swarm-redundancy-level'] = String(options.redundancyLevel)\n }\n\n if (Types.isBoolean(options.act)) {\n headers['swarm-act'] = String(options.act)\n }\n\n if (Types.isBoolean(options.pin)) {\n headers['swarm-pin'] = String(options.pin)\n }\n\n if (Types.isBoolean(options.encrypt)) {\n headers['swarm-encrypt'] = options.encrypt.toString()\n }\n\n if (options.tag) {\n headers['swarm-tag'] = String(options.tag)\n }\n\n if (Types.isBoolean(options.deferred)) {\n headers['swarm-deferred-upload'] = options.deferred.toString()\n }\n\n if (options.redundancyStrategy) {\n headers['swarm-redundancy-strategy'] = String(options.redundancyStrategy)\n }\n\n if (Types.isBoolean(options.fallback)) {\n headers['swarm-redundancy-fallback-mode'] = options.fallback.toString()\n }\n\n if (options.timeoutMs) {\n headers['swarm-chunk-retrieval-timeout'] = String(options.timeoutMs)\n }\n\n if (options.indexDocument) {\n headers['swarm-index-document'] = String(options.indexDocument)\n }\n\n if (options.errorDocument) {\n headers['swarm-error-document'] = String(options.errorDocument)\n }\n\n if (options.actPublisher) {\n headers['swarm-act-publisher'] = new PublicKey(options.actPublisher as any).toCompressedHex()\n }\n\n if (options.actHistoryAddress) {\n headers['swarm-act-history-address'] = new Reference(options.actHistoryAddress as any).toHex()\n }\n\n if (options.actTimestamp) {\n headers['swarm-act-timestamp'] = String(options.actTimestamp)\n }\n\n if (options.actPublisher || options.actHistoryAddress || options.actTimestamp) {\n headers['swarm-act'] = 'true'\n }\n\n if (options.gasPrice) {\n headers['gas-price'] = String(options.gasPrice)\n }\n\n if (options.gasLimit) {\n headers['gas-limit'] = String(options.gasLimit)\n }\n\n return headers\n}\n\nfunction isEnvelopeWithBatchId(value: unknown): value is EnvelopeWithBatchId {\n if (!Types.isObject(value)) {\n return false\n }\n\n const envelope = value as EnvelopeWithBatchId\n\n return (\n envelope.issuer !== undefined &&\n envelope.index !== undefined &&\n envelope.signature !== undefined &&\n envelope.timestamp !== undefined &&\n envelope.batchId !== undefined\n )\n}\n","import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'\nimport { Dates, Objects, Strings, System } from 'cafe-utility'\nimport _debug from 'debug'\nimport { BeeRequestOptions, BeeResponseError } from '../index'\n\nconst debug = _debug('bee-js:http')\n\nconst { AxiosError } = axios\n\nconst MAX_FAILED_ATTEMPTS = 100_000\nconst DELAY_FAST = 200\nconst DELAY_SLOW = 1000\nconst DELAY_THRESHOLD = Dates.minutes(1) / DELAY_FAST\n\nexport const DEFAULT_HTTP_CONFIG: AxiosRequestConfig = {\n headers: {\n accept: 'application/json, text/plain, */*',\n },\n maxBodyLength: Infinity,\n maxContentLength: Infinity,\n}\n\n/**\n * Main function to make HTTP requests.\n * @param options User defined settings\n * @param config Internal settings and/or Bee settings\n */\nexport async function http<T>(options: BeeRequestOptions, config: AxiosRequestConfig): Promise<AxiosResponse<T>> {\n const requestConfig: AxiosRequestConfig = Objects.deepMerge3(DEFAULT_HTTP_CONFIG, config, options)\n\n if (requestConfig.data && typeof Buffer !== 'undefined' && Buffer.isBuffer(requestConfig.data)) {\n requestConfig.data = requestConfig.data.buffer.slice(\n requestConfig.data.byteOffset,\n requestConfig.data.byteOffset + requestConfig.data.byteLength,\n )\n }\n\n if (requestConfig.params) {\n const keys = Object.keys(requestConfig.params)\n for (const key of keys) {\n const value = requestConfig.params[key]\n\n if (value === undefined) {\n delete requestConfig.params[key]\n }\n }\n }\n\n let failedAttempts = 0\n while (failedAttempts < MAX_FAILED_ATTEMPTS) {\n try {\n debug(\n `${requestConfig.method || 'get'} ${Strings.joinUrl([\n requestConfig.baseURL as string,\n requestConfig.url as string,\n ])}`,\n { headers: { ...requestConfig.headers } as Record<string, string>, params: requestConfig.params },\n )\n maybeRunOnRequestHook(options, requestConfig)\n const response = await axios(requestConfig)\n\n return response as AxiosResponse<T>\n } catch (e: unknown) {\n if (e instanceof AxiosError) {\n if (e.code === 'ECONNABORTED' && options.endlesslyRetry) {\n failedAttempts++\n await System.sleepMillis(failedAttempts < DELAY_THRESHOLD ? DELAY_FAST : DELAY_SLOW)\n } else {\n throw new BeeResponseError(\n config.method || 'get',\n config.url || '<unknown>',\n e.message,\n e.response?.data,\n e.response?.status,\n e.code,\n )\n }\n } else {\n throw e\n }\n }\n }\n throw Error('Max number of failed attempts reached')\n}\n\nfunction maybeRunOnRequestHook(options: BeeRequestOptions, requestConfig: AxiosRequestConfig) {\n if (options.onRequest) {\n options.onRequest({\n method: requestConfig.method || 'GET',\n url: Strings.joinUrl([requestConfig.baseURL as string, requestConfig.url as string]),\n headers: { ...requestConfig.headers } as Record<string, string>,\n params: requestConfig.params,\n })\n }\n}\n","import { Optional, Types } from 'cafe-utility'\nimport type { BeeRequestOptions, DownloadOptions, EnvelopeWithBatchId, UploadOptions, UploadResult } from '../types'\nimport { prepareRequestHeaders } from '../utils/headers'\nimport { http } from '../utils/http'\nimport { makeTagUid } from '../utils/type'\nimport { BatchId, Reference } from '../utils/typed-bytes'\n\nconst endpoint = 'chunks'\n\n/**\n * Upload chunk to a Bee node\n *\n * The chunk data consists of 8 byte span and up to 4096 bytes of payload data.\n * The span stores the length of the payload in uint64 little endian encoding.\n * Upload expects the chuck data to be set accordingly.\n *\n * @param requestOptions Options for making requests\n * @param data Chunk data to be uploaded\n * @param stamp BatchId or marshaled stamp to be used for the upload\n * @param options Additional options like tag, encryption, pinning\n */\nexport async function upload(\n requestOptions: BeeRequestOptions,\n data: Uint8Array,\n stamp: EnvelopeWithBatchId | BatchId | Uint8Array | string,\n options?: UploadOptions,\n): Promise<UploadResult> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: `${endpoint}`,\n data,\n headers: {\n 'content-type': 'application/octet-stream',\n ...prepareRequestHeaders(stamp, options),\n },\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n reference: new Reference(Types.asString(body.reference, { name: 'reference' })),\n tagUid: response.headers['swarm-tag'] ? makeTagUid(response.headers['swarm-tag']) : undefined,\n historyAddress: response.headers['swarm-act-history-address']\n ? Optional.of(new Reference(response.headers['swarm-act-history-address']))\n : Optional.empty(),\n }\n}\n\n/**\n * Download chunk data as a byte array\n *\n * @param requestOptions Options for making requests\n * @param hash Bee content reference\n *\n */\nexport async function download(\n requestOptions: BeeRequestOptions,\n reference: Reference | string | Uint8Array,\n options?: DownloadOptions,\n): Promise<Uint8Array> {\n reference = new Reference(reference)\n\n const response = await http<ArrayBuffer>(requestOptions, {\n responseType: 'arraybuffer',\n url: `${endpoint}/${reference}`,\n headers: prepareRequestHeaders(null, options),\n })\n\n return new Uint8Array(response.data)\n}\n","import { Optional, Types } from 'cafe-utility'\nimport { BeeRequestOptions, UploadOptions, UploadResult } from '../types'\nimport { prepareRequestHeaders } from '../utils/headers'\nimport { http } from '../utils/http'\nimport { makeTagUid } from '../utils/type'\nimport { BatchId, EthAddress, Identifier, Reference, Signature } from '../utils/typed-bytes'\n\nconst socEndpoint = 'soc'\n\n/**\n * Upload single owner chunk (SOC) to a Bee node\n *\n * @param requestOptions Options for making requests\n * @param owner Owner's ethereum address in hex\n * @param identifier Arbitrary identifier in hex\n * @param signature Signature in hex\n * @param data Content addressed chunk data to be uploaded\n * @param postageBatchId Postage BatchId that will be assigned to uploaded data\n * @param options Additional options like tag, encryption, pinning\n */\nexport async function upload(\n requestOptions: BeeRequestOptions,\n owner: EthAddress,\n identifier: Identifier,\n signature: Signature,\n data: Uint8Array,\n stamp: BatchId | Uint8Array | string,\n options?: UploadOptions,\n): Promise<UploadResult> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: `${socEndpoint}/${owner}/${identifier}`,\n data,\n headers: {\n 'content-type': 'application/octet-stream',\n ...prepareRequestHeaders(stamp, options),\n },\n responseType: 'json',\n params: { sig: signature.toHex() },\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n reference: new Reference(Types.asHexString(body.reference)),\n tagUid: response.headers['swarm-tag'] ? makeTagUid(response.headers['swarm-tag']) : undefined,\n historyAddress: response.headers['swarm-act-history-address']\n ? Optional.of(new Reference(response.headers['swarm-act-history-address']))\n : Optional.empty(),\n }\n}\n","import { Binary } from 'cafe-utility'\nimport * as chunkAPI from '../modules/chunk'\nimport * as socAPI from '../modules/soc'\nimport { BeeRequestOptions, UploadOptions, UploadResult } from '../types'\nimport { Bytes } from '../utils/bytes'\nimport { BeeError } from '../utils/error'\nimport { BatchId, EthAddress, Identifier, PrivateKey, Reference, Signature, Span } from '../utils/typed-bytes'\nimport { calculateChunkAddress } from './bmt'\nimport { Chunk, makeContentAddressedChunk } from './cac'\n\nconst SOC_SIGNATURE_OFFSET = Identifier.LENGTH\nconst SOC_SPAN_OFFSET = Identifier.LENGTH + Signature.LENGTH\nconst SOC_PAYLOAD_OFFSET = Identifier.LENGTH + Signature.LENGTH + Span.LENGTH\n\n/**\n * Single Owner Chunk (SOC) is a chunk type where the address is determined by the owner and an arbitrary identifier.\n * Its integrity is attested by the owner's digital signature.\n *\n * Similar to Content Addressed Chunks (CAC), SOCs have a maximum payload size of 4096 bytes.\n *\n * - `span` indicates the size of the `payload` in bytes.\n * - `payload` contains the actual data or the body of the chunk.\n * - `data` contains the full chunk data - `span` and `payload`.\n * - `address` is the Swarm hash (or reference) of the chunk.\n * - `identifier` is an arbitrary identifier selected by the uploader.\n * - `signature` is the digital signature of the owner over the identifier and the underlying CAC address.\n * - `owner` is the Ethereum address of the chunk owner.\n */\nexport interface SingleOwnerChunk {\n /**\n * Contains the full chunk data - `span` + `payload`.\n */\n readonly data: Uint8Array\n /**\n * Indicates the size of the `payload` in bytes.\n */\n span: Span\n /**\n * Contains the actual data or the body of the chunk.\n */\n payload: Bytes\n /**\n * The Swarm hash (or reference) of the chunk.\n */\n address: Reference\n /**\n * An arbitrary identifier selected by the uploader.\n */\n identifier: Identifier\n /**\n * The digital signature of the owner over the identifier and the underlying CAC address.\n */\n signature: Signature\n /**\n * The Ethereum address of the chunk owner.\n */\n owner: EthAddress\n}\n\nfunction recoverChunkOwner(data: Uint8Array): EthAddress {\n const cacData = data.slice(SOC_SPAN_OFFSET)\n const chunkAddress = calculateChunkAddress(cacData)\n const signature = Signature.fromSlice(data, SOC_SIGNATURE_OFFSET)\n const identifier = Bytes.fromSlice(data, 0, Identifier.LENGTH)\n const digest = Binary.concatBytes(identifier.toUint8Array(), chunkAddress.toUint8Array())\n const ownerAddress = signature.recoverPublicKey(digest).address()\n\n return ownerAddress\n}\n\n/**\n * Unmarshals arbitrary data into a Single Owner Chunk.\n * Throws an error if the data is not a valid SOC.\n *\n * @param data The chunk data\n * @param address The address of the single owner chunk\n *\n * @returns a single owner chunk or throws error\n */\nexport function unmarshalSingleOwnerChunk(\n data: Bytes | Uint8Array,\n address: Reference | Uint8Array | string,\n): SingleOwnerChunk {\n data = data instanceof Bytes ? data.toUint8Array() : data\n address = new Reference(address)\n const ownerAddress = recoverChunkOwner(data)\n const identifier = Bytes.fromSlice(data, 0, Identifier.LENGTH)\n const socAddress = new Reference(\n Binary.keccak256(Binary.concatBytes(identifier.toUint8Array(), ownerAddress.toUint8Array())),\n )\n\n if (!Binary.equals(address.toUint8Array(), socAddress.toUint8Array())) {\n throw new BeeError('SOC data does not match given address!')\n }\n\n const signature = Signature.fromSlice(data, SOC_SIGNATURE_OFFSET)\n const span = Span.fromSlice(data, SOC_SPAN_OFFSET)\n const payload = Bytes.fromSlice(data, SOC_PAYLOAD_OFFSET)\n\n return {\n data,\n identifier,\n signature,\n span,\n payload,\n address: socAddress,\n owner: ownerAddress,\n }\n}\n\nexport function makeSOCAddress(identifier: Identifier, address: EthAddress): Reference {\n return new Reference(Binary.keccak256(Binary.concatBytes(identifier.toUint8Array(), address.toUint8Array())))\n}\n\n/**\n * Creates a single owner chunk object\n *\n * @param chunk A chunk object used for the span and payload\n * @param identifier The identifier of the chunk\n * @param signer The signer interface for signing the chunk\n */\nexport function makeSingleOwnerChunk(\n address: Reference,\n span: Span,\n payload: Bytes,\n identifier: Identifier | Uint8Array | string,\n signer: PrivateKey | Uint8Array | string,\n): SingleOwnerChunk {\n identifier = new Identifier(identifier)\n signer = new PrivateKey(signer)\n const socAddress = makeSOCAddress(identifier, signer.publicKey().address())\n const signature = signer.sign(Binary.concatBytes(identifier.toUint8Array(), address.toUint8Array()))\n const data = Binary.concatBytes(\n identifier.toUint8Array(),\n signature.toUint8Array(),\n span.toUint8Array(),\n payload.toUint8Array(),\n )\n\n return {\n data,\n identifier,\n signature,\n span,\n payload,\n address: socAddress,\n owner: signer.publicKey().address(),\n }\n}\n\n/**\n * Helper function to upload a chunk.\n *\n * It uses the Chunk API and calculates the address before uploading.\n *\n * @param requestOptions Options for making requests\n * @param chunk A chunk object\n * @param stamp Postage BatchId that will be assigned to uploaded data\n * @param options Upload options\n */\nexport async function uploadSingleOwnerChunk(\n requestOptions: BeeRequestOptions,\n chunk: SingleOwnerChunk,\n stamp: BatchId | Uint8Array | string,\n options?: UploadOptions,\n): Promise<UploadResult> {\n const data = Binary.concatBytes(chunk.span.toUint8Array(), chunk.payload.toUint8Array())\n\n return socAPI.upload(requestOptions, chunk.owner, chunk.identifier, chunk.signature, data, stamp, options)\n}\n\n/**\n * Helper function to create and upload SOC.\n *\n * @param requestOptions Options for making requests\n * @param signer The signer interface for signing the chunk\n * @param postageBatchId\n * @param identifier The identifier of the chunk\n * @param data The chunk data\n * @param options\n */\nexport async function uploadSingleOwnerChunkData(\n requestOptions: BeeRequestOptions,\n signer: PrivateKey | Uint8Array | string,\n stamp: BatchId | Uint8Array | string,\n identifier: Identifier | Uint8Array | string,\n data: Uint8Array,\n options?: UploadOptions,\n): Promise<UploadResult> {\n signer = new PrivateKey(signer)\n identifier = new Identifier(identifier)\n const cac = makeContentAddressedChunk(data)\n const soc = cac.toSingleOwnerChunk(identifier, signer)\n\n return uploadSingleOwnerChunk(requestOptions, soc, stamp, options)\n}\n\nexport async function uploadSingleOwnerChunkWithWrappedChunk(\n requestOptions: BeeRequestOptions,\n signer: PrivateKey | Uint8Array | string,\n stamp: BatchId | Uint8Array | string,\n identifier: Identifier | Uint8Array | string,\n wrappedChunk: Chunk,\n options?: UploadOptions,\n): Promise<UploadResult> {\n signer = new PrivateKey(signer)\n identifier = new Identifier(identifier)\n const soc = wrappedChunk.toSingleOwnerChunk(identifier, signer)\n\n return uploadSingleOwnerChunk(requestOptions, soc, stamp, options)\n}\n\n/**\n * Helper function to download SOC.\n *\n * @param url The url of the Bee service\n * @param ownerAddress The signer interface for signing the chunk\n * @param identifier The identifier of the chunk\n */\nexport async function downloadSingleOwnerChunk(\n requestOptions: BeeRequestOptions,\n ownerAddress: EthAddress | Uint8Array | string,\n identifier: Identifier | Uint8Array | string,\n): Promise<SingleOwnerChunk> {\n identifier = new Identifier(identifier)\n ownerAddress = new EthAddress(ownerAddress)\n const address = makeSOCAddress(identifier, ownerAddress)\n const cac = await chunkAPI.download(requestOptions, address.toHex())\n\n return unmarshalSingleOwnerChunk(cac, address)\n}\n","import { Binary, Types } from 'cafe-utility'\nimport { Bytes } from '../utils/bytes'\nimport { Identifier, PrivateKey, Reference, Span } from '../utils/typed-bytes'\nimport { calculateChunkAddress } from './bmt'\nimport { makeSingleOwnerChunk, SingleOwnerChunk } from './soc'\n\nexport const MIN_PAYLOAD_SIZE = 1\nexport const MAX_PAYLOAD_SIZE = 4096\n\n/**\n * Content Addressed Chunk (CAC) is the immutable building block of Swarm,\n * holding at most 4096 bytes of payload.\n *\n * - `span` indicates the size of the `payload` in bytes.\n * - `payload` contains the actual data or the body of the chunk.\n * - `data` contains the full chunk data - `span` and `payload`.\n * - `address` is the Swarm hash (or reference) of the chunk.\n *\n * The `toSingleOwnerChunk` method allows converting the CAC into a Single Owner Chunk (SOC).\n */\nexport interface Chunk {\n /**\n * Contains the full chunk data - `span` + `payload`.\n */\n readonly data: Uint8Array\n /**\n * Indicates the size of the `payload` in bytes.\n */\n span: Span\n /**\n * Contains the actual data or the body of the chunk.\n */\n payload: Bytes\n /**\n * The Swarm hash (or reference) of the chunk.\n */\n address: Reference\n /**\n * Converts the CAC into a Single Owner Chunk (SOC).\n */\n toSingleOwnerChunk: (\n identifier: Identifier | Uint8Array | string,\n signer: PrivateKey | Uint8Array | string,\n ) => SingleOwnerChunk\n}\n\nexport function unmarshalContentAddressedChunk(data: Bytes | Uint8Array): Chunk {\n data = new Bytes(data)\n\n return makeContentAddressedChunk(data.toUint8Array().slice(Span.LENGTH), Span.fromSlice(data.toUint8Array(), 0))\n}\n\nexport function makeContentAddressedChunk(rawPayload: Bytes | Uint8Array | string, span?: Span | bigint): Chunk {\n if (Types.isString(rawPayload)) {\n rawPayload = Bytes.fromUtf8(rawPayload)\n }\n\n if (rawPayload.length < MIN_PAYLOAD_SIZE || rawPayload.length > MAX_PAYLOAD_SIZE) {\n throw new RangeError(`payload size ${rawPayload.length} exceeds limits [${MIN_PAYLOAD_SIZE}, ${MAX_PAYLOAD_SIZE}]`)\n }\n\n const typedSpan: Span = span\n ? typeof span === 'bigint'\n ? Span.fromBigInt(span)\n : span\n : Span.fromBigInt(BigInt(rawPayload.length))\n const payload = new Bytes(rawPayload)\n const data = Binary.concatBytes(typedSpan.toUint8Array(), payload.toUint8Array())\n const address = calculateChunkAddress(data)\n\n return {\n data,\n span: typedSpan,\n payload,\n address,\n toSingleOwnerChunk: (identifier: Identifier | Uint8Array | string, signer: PrivateKey | Uint8Array | string) => {\n return makeSingleOwnerChunk(address, typedSpan, payload, identifier, signer)\n },\n }\n}\n","import { Optional, Types } from 'cafe-utility'\nimport type { BeeRequestOptions, DownloadOptions, RedundantUploadOptions, ReferenceInformation } from '../types'\nimport { UploadResult } from '../types'\nimport { Bytes } from '../utils/bytes'\nimport { prepareRequestHeaders } from '../utils/headers'\nimport { http } from '../utils/http'\nimport { ResourceLocator } from '../utils/resource-locator'\nimport { makeTagUid, prepareDownloadOptions } from '../utils/type'\nimport { BatchId, Reference } from '../utils/typed-bytes'\n\nconst endpoint = 'bytes'\n\n/**\n * Upload data to a Bee node\n *\n * @param requestOptions Options for making requests\n * @param data Data to be uploaded\n * @param postageBatchId Postage BatchId that will be assigned to uploaded data\n * @param options Additional options like tag, encryption, pinning\n */\nexport async function upload(\n requestOptions: BeeRequestOptions,\n data: string | Uint8Array,\n postageBatchId: BatchId,\n options?: RedundantUploadOptions,\n): Promise<UploadResult> {\n const response = await http<unknown>(requestOptions, {\n url: endpoint,\n method: 'post',\n responseType: 'json',\n data,\n headers: {\n 'content-type': 'application/octet-stream',\n ...prepareRequestHeaders(postageBatchId, options),\n },\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n reference: new Reference(Types.asHexString(body.reference)),\n tagUid: response.headers['swarm-tag'] ? makeTagUid(response.headers['swarm-tag']) : undefined,\n historyAddress: response.headers['swarm-act-history-address']\n ? Optional.of(new Reference(response.headers['swarm-act-history-address']))\n : Optional.empty(),\n }\n}\n\n/**\n * Requests content length for a reference\n *\n * @param requestOptions Options for making requests\n * @param hash Bee content reference\n */\nexport async function head(\n requestOptions: BeeRequestOptions,\n reference: Reference | Uint8Array | string,\n): Promise<ReferenceInformation> {\n reference = new Reference(reference)\n\n const response = await http<void>(requestOptions, {\n url: `${endpoint}/${reference}`,\n method: 'head',\n responseType: 'json',\n })\n\n return {\n contentLength: parseInt(response.headers['content-length'] as string),\n }\n}\n\n/**\n * Download data as a byte array\n *\n * @param requestOptions Options for making requests\n * @param hash Bee content reference\n */\nexport async function download(\n requestOptions: BeeRequestOptions,\n resource: ResourceLocator,\n options?: DownloadOptions,\n): Promise<Bytes> {\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n const response = await http<unknown>(requestOptions, {\n responseType: 'arraybuffer',\n url: `${endpoint}/${resource}`,\n headers: prepareRequestHeaders(null, options),\n })\n\n return new Bytes(response.data as ArrayBuffer)\n}\n\n/**\n * Download data as a readable stream\n *\n * @param requestOptions Options for making requests\n * @param hash Bee content reference\n */\nexport async function downloadReadable(\n requestOptions: BeeRequestOptions,\n resource: ResourceLocator,\n options?: DownloadOptions,\n): Promise<ReadableStream<Uint8Array>> {\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n const response = await http<ReadableStream<Uint8Array>>(requestOptions, {\n responseType: 'stream',\n url: `${endpoint}/${resource}`,\n headers: prepareRequestHeaders(null, options),\n })\n\n return response.data\n}\n","import { Types } from 'cafe-utility'\nimport { BeeRequestOptions, UploadOptions } from '../types'\nimport { Bytes } from '../utils/bytes'\nimport { BeeError } from '../utils/error'\nimport { prepareRequestHeaders } from '../utils/headers'\nimport { http } from '../utils/http'\nimport { BatchId, EthAddress, FeedIndex, Reference, Topic } from '../utils/typed-bytes'\n\nconst feedEndpoint = 'feeds'\n\nexport interface FeedUpdateOptions {\n /**\n * Specifies the start date as unix time stamp\n */\n at?: number\n\n /**\n * Fetch specific previous Feed's update (default fetches latest update)\n */\n index?: FeedIndex | number\n\n /**\n * Whether the first 8 bytes of the payload are a timestamp\n */\n hasTimestamp?: boolean\n}\n\ninterface FeedUpdateHeaders {\n /**\n * The current feed's index\n */\n feedIndex: FeedIndex\n\n /**\n * The feed's index for next update.\n * Only set for the latest update. If update is fetched using previous index, then this is an empty string.\n */\n feedIndexNext?: FeedIndex\n}\n\nexport interface FeedPayloadResult extends FeedUpdateHeaders {\n payload: Bytes\n}\n\nexport interface FeedReferenceResult extends FeedUpdateHeaders {\n reference: Reference\n}\n\n/**\n * Create an initial feed root manifest\n *\n * @param requestOptions Options for making requests\n * @param owner Owner's ethereum address in hex\n * @param topic Topic in hex\n * @param postageBatchId Postage BatchId to be used to create the Feed Manifest\n * @param options Additional options, like type (default: 'sequence')\n */\nexport async function createFeedManifest(\n requestOptions: BeeRequestOptions,\n owner: EthAddress,\n topic: Topic,\n stamp: BatchId | Uint8Array | string,\n options?: UploadOptions,\n): Promise<Reference> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n responseType: 'json',\n url: `${feedEndpoint}/${owner}/${topic}`,\n headers: prepareRequestHeaders(stamp, options),\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new Reference(Types.asHexString(body.reference))\n}\n\nfunction readFeedUpdateHeaders(headers: Record<string, string>): FeedUpdateHeaders {\n const feedIndex = headers['swarm-feed-index']\n const feedIndexNext = headers['swarm-feed-index-next']\n\n if (!feedIndex) {\n throw new BeeError('Response did not contain expected swarm-feed-index!')\n }\n\n if (!feedIndexNext) {\n throw new BeeError('Response did not contain expected swarm-feed-index-next!')\n }\n\n return {\n feedIndex: new FeedIndex(feedIndex),\n feedIndexNext: new FeedIndex(feedIndexNext),\n }\n}\n\n/**\n * Find and retrieve feed update\n *\n * The feed consists of updates. This endpoint looks up an\n * update that matches the provided parameters and returns\n * the reference it contains along with its index and the\n * index of the subsequent update.\n *\n * @param requestOptions Options for making requests\n * @param owner Owner's ethereum address\n * @param topic Topic\n * @param options Additional options, like index, at, type\n */\nexport async function fetchLatestFeedUpdate(\n requestOptions: BeeRequestOptions,\n owner: EthAddress,\n topic: Topic,\n options?: FeedUpdateOptions,\n): Promise<FeedPayloadResult> {\n const response = await http<ArrayBuffer>(requestOptions, {\n responseType: 'arraybuffer',\n url: `${feedEndpoint}/${owner}/${topic}`,\n params: options,\n })\n\n return {\n payload: new Bytes(response.data),\n ...readFeedUpdateHeaders(response.headers as Record<string, string>),\n }\n}\n\nexport async function probeFeed(\n requestOptions: BeeRequestOptions,\n owner: EthAddress,\n topic: Topic,\n): Promise<FeedUpdateHeaders> {\n const response = await http<ArrayBuffer>(requestOptions, {\n responseType: 'arraybuffer',\n url: `${feedEndpoint}/${owner}/${topic}`,\n params: {\n 'Swarm-Only-Root-Chunk': true,\n },\n })\n\n return readFeedUpdateHeaders(response.headers as Record<string, string>)\n}\n","import { Types } from 'cafe-utility'\nimport { Reference } from './typed-bytes'\n\nexport class ResourceLocator {\n constructor(private raw: Reference | Uint8Array | string) {}\n\n toString() {\n if (Types.isString(this.raw) && this.raw.includes('.eth')) {\n return this.raw\n }\n\n return new Reference(this.raw).toHex()\n }\n}\n","import { Binary } from 'cafe-utility'\nimport { FeedIndex, Identifier, Topic } from '../utils/typed-bytes'\n\nexport function makeFeedIdentifier(topic: Topic, index: FeedIndex | number): Identifier {\n index = typeof index === 'number' ? FeedIndex.fromBigInt(BigInt(index)) : index\n\n return new Identifier(Binary.keccak256(Binary.concatBytes(topic.toUint8Array(), index.toUint8Array())))\n}\n","import { Binary, Optional, Types } from 'cafe-utility'\nimport { Chunk, makeContentAddressedChunk, unmarshalContentAddressedChunk } from '../chunk/cac'\nimport {\n unmarshalSingleOwnerChunk,\n uploadSingleOwnerChunkData,\n uploadSingleOwnerChunkWithWrappedChunk,\n} from '../chunk/soc'\nimport * as bytes from '../modules/bytes'\nimport * as chunkAPI from '../modules/chunk'\nimport {\n FeedPayloadResult,\n FeedReferenceResult,\n FeedUpdateOptions,\n fetchLatestFeedUpdate,\n probeFeed,\n} from '../modules/feed'\nimport { BeeRequestOptions, FeedReader, FeedWriter, UploadOptions, UploadResult } from '../types'\nimport { Bytes } from '../utils/bytes'\nimport { BeeResponseError } from '../utils/error'\nimport { ResourceLocator } from '../utils/resource-locator'\nimport { BatchId, EthAddress, FeedIndex, PrivateKey, Reference, Topic } from '../utils/typed-bytes'\nimport { makeFeedIdentifier } from './identifier'\n\nconst TIMESTAMP_PAYLOAD_OFFSET = 0\nconst TIMESTAMP_PAYLOAD_SIZE = 8\nconst REFERENCE_PAYLOAD_OFFSET = TIMESTAMP_PAYLOAD_SIZE\n\nexport interface Epoch {\n time: number\n level: number\n}\n\nexport interface FeedUploadOptions extends UploadOptions, FeedUpdateOptions {}\n\nexport interface FeedUpdate {\n timestamp: Optional<number>\n payload: Bytes\n}\n\nexport async function findNextIndex(\n requestOptions: BeeRequestOptions,\n owner: EthAddress,\n topic: Topic,\n): Promise<FeedIndex> {\n try {\n const feedUpdate = await fetchLatestFeedUpdate(requestOptions, owner, topic)\n\n if (!feedUpdate.feedIndexNext) {\n throw Error('Feed index next is not defined. This should happen when fetching an exact index.')\n }\n\n return feedUpdate.feedIndexNext\n } catch (e) {\n if (e instanceof BeeResponseError) {\n return FeedIndex.fromBigInt(0n)\n }\n throw e\n }\n}\n\nexport async function updateFeedWithReference(\n requestOptions: BeeRequestOptions,\n signer: PrivateKey,\n topic: Topic,\n reference: Reference | string | Uint8Array,\n postageBatchId: BatchId,\n options?: FeedUploadOptions,\n): Promise<UploadResult> {\n reference = new Reference(reference)\n const nextIndex = options?.index ?? (await findNextIndex(requestOptions, signer.publicKey().address(), topic))\n\n const identifier = makeFeedIdentifier(topic, nextIndex)\n const at = options?.at ?? Date.now() / 1000.0\n const timestamp = Binary.numberToUint64(BigInt(Math.floor(at)), 'BE')\n const payloadBytes = Binary.concatBytes(timestamp, reference.toUint8Array())\n\n return uploadSingleOwnerChunkData(requestOptions, signer, postageBatchId, identifier, payloadBytes, options)\n}\n\nexport async function updateFeedWithPayload(\n requestOptions: BeeRequestOptions,\n signer: PrivateKey,\n topic: Topic,\n data: Uint8Array | string,\n postageBatchId: BatchId,\n options?: FeedUploadOptions,\n): Promise<UploadResult> {\n const nextIndex = options?.index ?? (await findNextIndex(requestOptions, signer.publicKey().address(), topic))\n\n const identifier = makeFeedIdentifier(topic, nextIndex)\n\n if (data.length > 4096) {\n const uploadResult = await bytes.upload(requestOptions, data, postageBatchId, options)\n const rootChunk = unmarshalContentAddressedChunk(await chunkAPI.download(requestOptions, uploadResult.reference))\n\n return uploadSingleOwnerChunkWithWrappedChunk(\n requestOptions,\n signer,\n postageBatchId,\n identifier,\n rootChunk,\n options,\n )\n }\n\n return uploadSingleOwnerChunkData(\n requestOptions,\n signer,\n postageBatchId,\n identifier,\n Types.isString(data) ? Bytes.fromUtf8(data).toUint8Array() : data,\n options,\n )\n}\n\nexport function getFeedUpdateChunkReference(owner: EthAddress, topic: Topic, index: FeedIndex): Reference {\n const identifier = makeFeedIdentifier(topic, index)\n\n return new Reference(Binary.keccak256(Binary.concatBytes(identifier.toUint8Array(), owner.toUint8Array())))\n}\n\nexport async function downloadFeedUpdate(\n requestOptions: BeeRequestOptions,\n owner: EthAddress,\n topic: Topic,\n index: FeedIndex | number,\n hasTimestamp = false,\n): Promise<FeedUpdate> {\n index = typeof index === 'number' ? FeedIndex.fromBigInt(BigInt(index)) : index\n const address = getFeedUpdateChunkReference(owner, topic, index)\n const data = await chunkAPI.download(requestOptions, address.toHex())\n const soc = unmarshalSingleOwnerChunk(data, address)\n let timestamp: Optional<number> = Optional.empty()\n\n if (hasTimestamp) {\n const timestampBytes = Bytes.fromSlice(soc.payload.toUint8Array(), TIMESTAMP_PAYLOAD_OFFSET, TIMESTAMP_PAYLOAD_SIZE)\n timestamp = Optional.of(Number(Binary.uint64ToNumber(timestampBytes.toUint8Array(), 'BE')))\n }\n\n return {\n timestamp,\n payload: new Bytes(soc.payload.offset(hasTimestamp ? REFERENCE_PAYLOAD_OFFSET : 0)),\n }\n}\n\nexport async function downloadFeedUpdateAsCAC(\n requestOptions: BeeRequestOptions,\n owner: EthAddress,\n topic: Topic,\n index: FeedIndex | number,\n): Promise<Chunk> {\n index = typeof index === 'number' ? FeedIndex.fromBigInt(BigInt(index)) : index\n const address = getFeedUpdateChunkReference(owner, topic, index)\n const data = await chunkAPI.download(requestOptions, address)\n const soc = unmarshalSingleOwnerChunk(data, address)\n\n return makeContentAddressedChunk(soc.payload, soc.span)\n}\n\nexport function makeFeedReader(requestOptions: BeeRequestOptions, topic: Topic, owner: EthAddress): FeedReader {\n // TODO: remove after enough time has passed in deprecated version\n const download = async (options?: FeedUpdateOptions): Promise<FeedPayloadResult> => {\n if (options?.index === undefined) {\n return fetchLatestFeedUpdate(requestOptions, owner, topic)\n }\n\n const update = await downloadFeedUpdate(requestOptions, owner, topic, options.index, options.hasTimestamp ?? true)\n\n const feedIndex = typeof options.index === 'number' ? FeedIndex.fromBigInt(BigInt(options.index)) : options.index\n\n return {\n payload: update.payload,\n feedIndex,\n feedIndexNext: feedIndex.next(),\n }\n }\n\n const downloadPayload = async (options?: FeedUpdateOptions): Promise<FeedPayloadResult> => {\n if (options?.index === undefined) {\n return fetchLatestFeedUpdate(requestOptions, owner, topic)\n }\n\n const cac = await downloadFeedUpdateAsCAC(requestOptions, owner, topic, options.index)\n\n const payload =\n cac.span.toBigInt() <= 4096n\n ? cac.payload\n : await bytes.download(requestOptions, new ResourceLocator(cac.address))\n\n const feedIndex = typeof options.index === 'number' ? FeedIndex.fromBigInt(BigInt(options.index)) : options.index\n\n return {\n payload,\n feedIndex,\n feedIndexNext: feedIndex.next(),\n }\n }\n\n const downloadReference = async (options?: FeedUpdateOptions): Promise<FeedReferenceResult> => {\n let index = options?.index\n\n if (index === undefined) {\n index = (await probeFeed(requestOptions, owner, topic)).feedIndex\n }\n\n const payload = await download({ ...options, index: index })\n\n return {\n reference: new Reference(payload.payload.toUint8Array()),\n feedIndex: payload.feedIndex,\n feedIndexNext: payload.feedIndexNext ?? payload.feedIndex.next(),\n }\n }\n\n return {\n download,\n downloadPayload,\n downloadReference,\n owner,\n topic,\n }\n}\n\nexport function makeFeedWriter(requestOptions: BeeRequestOptions, topic: Topic, signer: PrivateKey): FeedWriter {\n const upload = async (\n postageBatchId: BatchId,\n reference: Reference | string | Uint8Array,\n options?: FeedUploadOptions,\n ) => {\n return updateFeedWithReference(requestOptions, signer, topic, reference, postageBatchId, options)\n }\n\n const uploadPayload = async (postageBatchId: BatchId, data: Uint8Array | string, options?: FeedUploadOptions) => {\n return updateFeedWithPayload(requestOptions, signer, topic, data, postageBatchId, options)\n }\n\n return {\n ...makeFeedReader(requestOptions, topic, signer.publicKey().address()),\n upload,\n uploadReference: upload,\n uploadPayload,\n }\n}\n","import { Objects } from 'cafe-utility'\nimport { Bee } from '../bee'\nimport { BeeRequestOptions, DownloadOptions } from '../types'\nimport { EthAddress, FeedIndex, Reference, Topic } from '../utils/typed-bytes'\nimport { getFeedUpdateChunkReference } from './index'\n\n/**\n * Function that checks if a chunk is retrievable by actually downloading it.\n * The /stewardship/{reference} endpoint does not support verification of chunks, but only manifest's references.\n *\n * @param bee\n * @param ref\n * @param options\n */\nasync function isChunkRetrievable(\n bee: Bee,\n reference: Reference,\n options: DownloadOptions | undefined,\n requestOptions: BeeRequestOptions,\n): Promise<boolean> {\n try {\n await bee.downloadChunk(reference, options, requestOptions)\n\n return true\n } catch (e: unknown) {\n const status = Objects.getDeep(e, 'status')\n\n if (status === 404 || status === 500) {\n return false\n }\n\n throw e\n }\n}\n\n/**\n * Creates array of references for all sequence updates chunk up to the given index.\n *\n * @param owner\n * @param topic\n * @param index\n */\nfunction getAllSequenceUpdateReferences(owner: EthAddress, topic: Topic, index: FeedIndex): Reference[] {\n const count = index.toBigInt()\n const updateReferences: Reference[] = []\n\n for (let i = 0n; i <= count; i++) {\n updateReferences.push(getFeedUpdateChunkReference(owner, topic, FeedIndex.fromBigInt(i)))\n }\n\n return updateReferences\n}\n\nexport async function areAllSequentialFeedsUpdateRetrievable(\n bee: Bee,\n owner: EthAddress,\n topic: Topic,\n index: FeedIndex,\n options: DownloadOptions | undefined,\n requestOptions: BeeRequestOptions,\n): Promise<boolean> {\n const chunkRetrievablePromises = getAllSequenceUpdateReferences(owner, topic, index).map(async reference =>\n isChunkRetrievable(bee, reference, options, requestOptions),\n )\n\n return (await Promise.all(chunkRetrievablePromises)).every(result => result)\n}\n","import { Collection } from '../types'\nimport { BeeArgumentError } from './error'\n\nexport function isCollection(data: unknown): data is Collection {\n if (!Array.isArray(data)) {\n return false\n }\n\n return data.every(entry => typeof entry === 'object' && entry.path && entry.size !== undefined)\n}\n\nexport function assertCollection(data: unknown): asserts data is Collection {\n if (!isCollection(data)) {\n throw new BeeArgumentError('invalid collection', data)\n }\n}\n\nexport function makeFilePath(file: File) {\n if (file.webkitRelativePath && file.webkitRelativePath !== '') {\n return file.webkitRelativePath.replace(/.*?\\//i, '')\n }\n\n if (file.name) {\n return file.name\n }\n\n throw new TypeError('file is not valid File object')\n}\n\nexport function makeCollectionFromFileList(fileList: FileList | File[]): Collection {\n return Array.from(fileList).map(file => ({\n path: makeFilePath(file),\n size: file.size,\n file,\n }))\n}\n\n/**\n * Calculate cumulative size of files\n *\n * @param fileList list of files to check\n * @returns size in bytes\n */\nexport function getCollectionSize(fileList: FileList | File[]): number {\n return Array.from(fileList).reduce((sum, file) => sum + file.size, 0)\n}\n","import { PassThrough } from 'stream'\n\nexport class TarStream {\n output = new PassThrough()\n currentFileSize = 0\n\n beginFile(path: string, size: number) {\n if (path.length > 100) {\n throw new Error(`File name too long: ${path}`)\n }\n const header = createHeader(path, size)\n this.output.write(header)\n this.currentFileSize = 0\n }\n\n async appendFile(data: Uint8Array) {\n return new Promise<void>(resolve => {\n if (!this.output.write(data)) {\n this.output.once('drain', () => {\n resolve()\n })\n } else {\n resolve()\n }\n this.currentFileSize += data.length\n })\n }\n\n async endFile() {\n const padding = this.currentFileSize % 512 === 0 ? 0 : 512 - (this.currentFileSize % 512)\n\n if (padding > 0) {\n this.output.write(Buffer.alloc(padding, 0))\n }\n }\n\n async end() {\n return new Promise<void>(resolve => {\n this.output.write(createEndOfArchive())\n this.output.end(() => {\n resolve()\n })\n })\n }\n}\n\nfunction createHeader(path: string, size: number): Uint8Array {\n // Initialize header with zeros\n const header = Buffer.alloc(512, 0)\n\n // File name, truncated to 100 characters if necessary\n header.write(path.slice(0, 100).padEnd(100, '\\0'), 0, 100)\n\n // File mode (octal) and null-terminated\n header.write('0000777\\0', 100, 8)\n\n // UID and GID (octal) and null-terminated\n header.write('0001750\\0', 108, 8) // UID\n header.write('0001750\\0', 116, 8) // GID\n\n // File size in octal (11 chars) and null-terminated\n header.write(size.toString(8).padStart(11, '0') + '\\0', 124, 12)\n\n // Modification time in octal and null-terminated\n const modTime = Math.floor(new Date().getTime() / 1000)\n header.write(modTime.toString(8).padStart(11, '0') + '\\0', 136, 12)\n\n // Checksum placeholder (8 spaces)\n header.write(' ', 148, 8)\n\n // Typeflag (normal file)\n header.write('0', 156, 1)\n\n // USTAR magic and version\n header.write('ustar\\0\\0', 257, 8)\n\n // Calculate checksum\n let checksum = 0\n for (let i = 0; i < 512; i++) {\n checksum += header[i]\n }\n\n header.write(checksum.toString(8).padStart(6, '0') + '\\0 ', 148, 8)\n\n return header\n}\n\nfunction createEndOfArchive(): Uint8Array {\n return Buffer.alloc(1024, 0)\n}\n","import { BeeRequestOptions, Collection, CollectionUploadOptions } from '..'\nimport { prepareRequestHeaders } from './headers'\nimport { http } from './http'\nimport { TarStream } from './tar'\nimport { writeTar } from './tar-writer'\nimport { BatchId } from './typed-bytes'\n\nconst bzzEndpoint = 'bzz'\n\nexport async function uploadTar(\n requestOptions: BeeRequestOptions,\n collection: Collection,\n postageBatchId: BatchId,\n options?: CollectionUploadOptions,\n) {\n const tarStream = new TarStream()\n const responsePromise = http<unknown>(requestOptions, {\n method: 'post',\n url: bzzEndpoint,\n data: tarStream.output,\n responseType: 'json',\n headers: {\n 'content-type': 'application/x-tar',\n 'swarm-collection': 'true',\n ...prepareRequestHeaders(postageBatchId, options),\n },\n })\n\n await writeTar(collection, tarStream)\n await tarStream.end()\n const response = await responsePromise\n\n return response\n}\n","import { createReadStream } from 'fs'\nimport { Collection } from '..'\nimport { TarStream } from './tar'\n\nexport async function writeTar(collection: Collection, tarStream: TarStream) {\n for (const item of collection) {\n tarStream.beginFile(item.path, item.size)\n\n if (item.fsPath) {\n const stream = createReadStream(item.fsPath)\n\n for await (const chunk of stream) {\n await tarStream.appendFile(chunk)\n }\n await tarStream.endFile()\n stream.close()\n } else if (item.file) {\n await tarStream.appendFile(new Uint8Array(await item.file.arrayBuffer()))\n await tarStream.endFile()\n } else {\n throw new Error('Invalid collection item')\n }\n }\n}\n","import { Optional, Types } from 'cafe-utility'\nimport { Readable } from 'stream'\nimport {\n BeeRequestOptions,\n Collection,\n CollectionUploadOptions,\n DownloadOptions,\n FileData,\n FileUploadOptions,\n UploadResult,\n} from '../types'\nimport { Bytes } from '../utils/bytes'\nimport { assertCollection } from '../utils/collection'\nimport { prepareRequestHeaders, readFileHeaders } from '../utils/headers'\nimport { http } from '../utils/http'\nimport { ResourceLocator } from '../utils/resource-locator'\nimport { uploadTar } from '../utils/tar-uploader'\nimport { isReadable, makeTagUid } from '../utils/type'\nimport { BatchId, Reference } from '../utils/typed-bytes'\n\nconst bzzEndpoint = 'bzz'\n\n/**\n * Upload single file\n *\n * @param requestOptions Options for making requests\n * @param data Files data\n * @param postageBatchId Postage BatchId that will be assigned to uploaded data\n * @param name Name that will be attached to the uploaded file. Wraps the data into manifest with set index document.\n * @param options\n */\nexport async function uploadFile(\n requestOptions: BeeRequestOptions,\n data: string | Uint8Array | Readable | ArrayBuffer,\n postageBatchId: BatchId,\n name?: string,\n options?: FileUploadOptions,\n): Promise<UploadResult> {\n if (isReadable(data) && !options?.contentType) {\n if (!options) {\n options = {}\n }\n options.contentType = 'application/octet-stream'\n }\n\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: bzzEndpoint,\n data,\n headers: prepareRequestHeaders(postageBatchId, options),\n params: { name },\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n reference: new Reference(Types.asHexString(body.reference)),\n tagUid: response.headers['swarm-tag'] ? makeTagUid(response.headers['swarm-tag']) : undefined,\n historyAddress: response.headers['swarm-act-history-address']\n ? Optional.of(new Reference(response.headers['swarm-act-history-address']))\n : Optional.empty(),\n }\n}\n\n/**\n * Download single file as a buffer\n *\n * @param requestOptions Options for making requests\n * @param hash Bee file or collection hash\n * @param path If hash is collection then this defines path to a single file in the collection\n */\nexport async function downloadFile(\n requestOptions: BeeRequestOptions,\n resource: ResourceLocator,\n path = '',\n options?: DownloadOptions,\n): Promise<FileData<Bytes>> {\n const response = await http<ArrayBuffer>(requestOptions, {\n method: 'GET',\n responseType: 'arraybuffer',\n url: `${bzzEndpoint}/${resource}/${path}`,\n headers: prepareRequestHeaders(null, options),\n })\n const file = {\n ...readFileHeaders(response.headers as Record<string, string>),\n data: new Bytes(response.data),\n }\n\n return file\n}\n\n/**\n * Download single file as a readable stream\n *\n * @param requestOptions Options for making requests\n * @param hash Bee file or collection hash\n * @param path If hash is collection then this defines path to a single file in the collection\n */\nexport async function downloadFileReadable(\n requestOptions: BeeRequestOptions,\n reference: Reference,\n path = '',\n options?: DownloadOptions,\n): Promise<FileData<ReadableStream<Uint8Array>>> {\n reference = new Reference(reference)\n\n const response = await http<ReadableStream<Uint8Array>>(requestOptions, {\n method: 'GET',\n responseType: 'stream',\n url: `${bzzEndpoint}/${reference}/${path}`,\n headers: prepareRequestHeaders(null, options),\n })\n const file = {\n ...readFileHeaders(response.headers as Record<string, string>),\n data: response.data,\n }\n\n return file\n}\n\n/*******************************************************************************************************************/\n\n// Collections\n\n/**\n * Upload collection\n * @param requestOptions Options for making requests\n * @param collection Collection of Uint8Array buffers to upload\n * @param postageBatchId Postage BatchId that will be assigned to uploaded data\n * @param options\n */\nexport async function uploadCollection(\n requestOptions: BeeRequestOptions,\n collection: Collection,\n postageBatchId: BatchId,\n options?: CollectionUploadOptions,\n): Promise<UploadResult> {\n assertCollection(collection)\n const response = await uploadTar(requestOptions, collection, postageBatchId, options)\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n reference: new Reference(Types.asHexString(body.reference)),\n tagUid: response.headers['swarm-tag'] ? makeTagUid(response.headers['swarm-tag']) : undefined,\n historyAddress: response.headers['swarm-act-history-address']\n ? Optional.of(new Reference(response.headers['swarm-act-history-address']))\n : Optional.empty(),\n }\n}\n","import { Types } from 'cafe-utility'\nimport type { BalanceResponse, BeeRequestOptions, PeerBalance } from '../../types'\nimport { http } from '../../utils/http'\nimport { BZZ } from '../../utils/tokens'\nimport { asNumberString } from '../../utils/type'\nimport { PeerAddress } from '../../utils/typed-bytes'\n\nconst balancesEndpoint = 'balances'\nconst consumedEndpoint = 'consumed'\n\n/**\n * Get the balances with all known peers including prepaid services\n *\n * @param requestOptions Options for making requests\n */\nexport async function getAllBalances(requestOptions: BeeRequestOptions): Promise<BalanceResponse> {\n const response = await http<unknown>(requestOptions, {\n url: balancesEndpoint,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const balances = Types.asArray(body.balances, { name: 'balances' }).map(x => Types.asObject(x, { name: 'balance' }))\n\n return {\n balances: balances.map(x => ({\n peer: Types.asString(x.peer, { name: 'peer' }),\n balance: BZZ.fromPLUR(asNumberString(x.balance, { name: 'balance' })),\n })),\n }\n}\n\n/**\n * Get the balances with a specific peer including prepaid services\n *\n * @param requestOptions Options for making requests\n * @param address Swarm address of peer\n */\nexport async function getPeerBalance(requestOptions: BeeRequestOptions, address: PeerAddress): Promise<PeerBalance> {\n const response = await http<unknown>(requestOptions, {\n url: `${balancesEndpoint}/${address}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n peer: Types.asString(body.peer, { name: 'peer' }),\n balance: BZZ.fromPLUR(asNumberString(body.balance, { name: 'balance' })),\n }\n}\n\n/**\n * Get the past due consumption balances with all known peers\n *\n * @param requestOptions Options for making requests\n */\nexport async function getPastDueConsumptionBalances(requestOptions: BeeRequestOptions): Promise<BalanceResponse> {\n const response = await http<unknown>(requestOptions, {\n url: consumedEndpoint,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const balances = Types.asArray(body.balances, { name: 'balances' }).map(x => Types.asObject(x, { name: 'balance' }))\n\n return {\n balances: balances.map(x => ({\n peer: Types.asString(x.peer, { name: 'peer' }),\n balance: BZZ.fromPLUR(asNumberString(x.balance, { name: 'balance' })),\n })),\n }\n}\n\n/**\n * Get the past due consumption balance with a specific peer\n *\n * @param requestOptions Options for making requests\n * @param address Swarm address of peer\n */\nexport async function getPastDueConsumptionPeerBalance(\n requestOptions: BeeRequestOptions,\n address: PeerAddress,\n): Promise<PeerBalance> {\n const response = await http<unknown>(requestOptions, {\n url: `${consumedEndpoint}/${address}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n peer: Types.asString(body.peer, { name: 'peer' }),\n balance: BZZ.fromPLUR(asNumberString(body.balance, { name: 'balance' })),\n }\n}\n","import { Types } from 'cafe-utility'\nimport type {\n BeeRequestOptions,\n CashoutResult,\n Cheque,\n ChequebookAddressResponse,\n ChequebookBalanceResponse,\n LastCashoutActionResponse,\n LastChequesForPeerResponse,\n LastChequesResponse,\n NumberString,\n TransactionOptions,\n} from '../../types'\nimport { prepareRequestHeaders } from '../../utils/headers'\nimport { http } from '../../utils/http'\nimport { BZZ } from '../../utils/tokens'\nimport { asNumberString } from '../../utils/type'\nimport { EthAddress, PeerAddress, TransactionId } from '../../utils/typed-bytes'\n\nconst chequebookEndpoint = 'chequebook'\n\n/**\n * Get the address of the chequebook contract used\n *\n * @param requestOptions Options for making requests\n */\nexport async function getChequebookAddress(requestOptions: BeeRequestOptions): Promise<ChequebookAddressResponse> {\n const response = await http<unknown>(requestOptions, {\n url: chequebookEndpoint + '/address',\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n chequebookAddress: new EthAddress(Types.asString(body.chequebookAddress, { name: 'chequebookAddress' })),\n }\n}\n\n/**\n * Get the balance of the chequebook\n *\n * @param requestOptions Options for making requests\n */\nexport async function getChequebookBalance(requestOptions: BeeRequestOptions): Promise<ChequebookBalanceResponse> {\n const response = await http<unknown>(requestOptions, {\n url: chequebookEndpoint + '/balance',\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n availableBalance: BZZ.fromPLUR(asNumberString(body.availableBalance, { name: 'availableBalance' })),\n totalBalance: BZZ.fromPLUR(asNumberString(body.totalBalance, { name: 'totalBalance' })),\n }\n}\n\n/**\n * Get last cashout action for the peer\n *\n * @param requestOptions Options for making requests\n * @param peer Swarm address of peer\n */\nexport async function getLastCashoutAction(\n requestOptions: BeeRequestOptions,\n peer: PeerAddress,\n): Promise<LastCashoutActionResponse> {\n const response = await http<unknown>(requestOptions, {\n url: chequebookEndpoint + `/cashout/${peer}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n peer: Types.asString(body.peer, { name: 'peer' }),\n uncashedAmount: BZZ.fromPLUR(asNumberString(body.uncashedAmount, { name: 'uncashedAmount' })),\n transactionHash: Types.asNullableString(body.transactionHash),\n lastCashedCheque: Types.asNullable(x => asCheque(x), body.lastCashedCheque),\n result: Types.asNullable(x => asCashoutResult(x), body.result),\n }\n}\n\n/**\n * Cashout the last cheque for the peer\n *\n * @param requestOptions Options for making requests\n * @param peer Swarm address of peer\n * @param options\n */\nexport async function cashoutLastCheque(\n requestOptions: BeeRequestOptions,\n peer: PeerAddress,\n options?: TransactionOptions,\n): Promise<TransactionId> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: chequebookEndpoint + `/cashout/${peer}`,\n responseType: 'json',\n headers: prepareRequestHeaders(null, options),\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asString(body.transactionHash, { name: 'transactionHash' }))\n}\n\n/**\n * Get last cheques for the peer\n *\n * @param requestOptions Options for making requests\n * @param peer Swarm address of peer\n */\nexport async function getLastChequesForPeer(\n requestOptions: BeeRequestOptions,\n peer: PeerAddress,\n): Promise<LastChequesForPeerResponse> {\n const response = await http<unknown>(requestOptions, {\n url: chequebookEndpoint + `/cheque/${peer}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n peer: Types.asString(body.peer, { name: 'peer' }),\n lastreceived: Types.asNullable(x => asCheque(x), body.lastreceived),\n lastsent: Types.asNullable(x => asCheque(x), body.lastsent),\n }\n}\n\n/**\n * Get last cheques for all peers\n *\n * @param requestOptions Options for making requests\n */\nexport async function getLastCheques(requestOptions: BeeRequestOptions): Promise<LastChequesResponse> {\n const response = await http<unknown>(requestOptions, {\n url: chequebookEndpoint + '/cheque',\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const lastcheques = Types.asArray(body.lastcheques, { name: 'lastcheques' }).map(x =>\n Types.asObject(x, { name: 'lastcheque' }),\n )\n\n return {\n lastcheques: lastcheques.map(x => ({\n peer: Types.asString(x.peer, { name: 'peer' }),\n lastreceived: Types.asNullable(y => asCheque(y), x.lastreceived),\n lastsent: Types.asNullable(y => asCheque(y), x.lastsent),\n })),\n }\n}\n\nfunction asCheque(x: unknown): Cheque {\n const object = Types.asObject(x, { name: 'cheque' })\n\n return {\n beneficiary: new EthAddress(Types.asString(object.beneficiary, { name: 'beneficiary' })),\n chequebook: new EthAddress(Types.asString(object.chequebook, { name: 'chequebook' })),\n payout: BZZ.fromPLUR(asNumberString(object.payout, { name: 'payout' })),\n }\n}\n\nfunction asCashoutResult(x: unknown): CashoutResult {\n const object = Types.asObject(x, { name: 'cashout result' })\n\n return {\n recipient: Types.asString(object.recipient, { name: 'recipient' }),\n lastPayout: BZZ.fromPLUR(asNumberString(object.lastPayout, { name: 'lastPayout' })),\n bounced: Types.asBoolean(object.bounced, { name: 'bounced' }),\n }\n}\n\n/**\n * Deposit tokens from overlay address into chequebook\n *\n * @param requestOptions Options for making requests\n * @param amount Amount of tokens to deposit\n * @param gasPrice Gas Price in WEI for the transaction call\n * @return string Hash of the transaction\n */\nexport async function depositTokens(\n requestOptions: BeeRequestOptions,\n amount: NumberString | string | bigint,\n gasPrice?: NumberString | string | bigint,\n): Promise<TransactionId> {\n const headers: Record<string, string> = {}\n\n if (gasPrice) {\n headers['gas-price'] = gasPrice.toString()\n }\n\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: chequebookEndpoint + '/deposit',\n responseType: 'json',\n params: { amount: amount.toString(10) },\n headers,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asString(body.transactionHash, { name: 'transactionHash' }))\n}\n\n/**\n * Withdraw tokens from the chequebook to the overlay address\n *\n * @param requestOptions Options for making requests\n * @param amount Amount of tokens to withdraw\n * @param gasPrice Gas Price in WEI for the transaction call\n * @return string Hash of the transaction\n */\nexport async function withdrawTokens(\n requestOptions: BeeRequestOptions,\n amount: NumberString | string | bigint,\n gasPrice?: NumberString | string | bigint,\n): Promise<TransactionId> {\n const headers: Record<string, string> = {}\n\n if (gasPrice) {\n headers['gas-price'] = gasPrice.toString()\n }\n\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: chequebookEndpoint + '/withdraw',\n responseType: 'json',\n params: { amount: amount.toString(10) },\n headers,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asString(body.transactionHash, { name: 'transactionHash' }))\n}\n","import { Types } from 'cafe-utility'\nimport type {\n BeeRequestOptions,\n Bin,\n NodeAddresses,\n Peer,\n PingResponse,\n RemovePeerResponse,\n Topology,\n} from '../../types'\nimport { http } from '../../utils/http'\nimport { EthAddress, PeerAddress, PublicKey } from '../../utils/typed-bytes'\n\nexport async function getNodeAddresses(requestOptions: BeeRequestOptions): Promise<NodeAddresses> {\n const response = await http<unknown>(requestOptions, {\n url: 'addresses',\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n overlay: new PeerAddress(Types.asString(body.overlay, { name: 'overlay' })),\n underlay: Types.asArray(body.underlay, { name: 'underlay' }).map(x => Types.asString(x, { name: 'underlay' })),\n ethereum: new EthAddress(Types.asString(body.ethereum, { name: 'ethereum' })),\n publicKey: new PublicKey(Types.asString(body.publicKey, { name: 'publicKey' })),\n pssPublicKey: new PublicKey(Types.asString(body.pssPublicKey, { name: 'pssPublicKey' })),\n }\n}\n\ninterface Peers {\n peers: Peer[]\n}\n\nexport async function getPeers(requestOptions: BeeRequestOptions): Promise<Peer[]> {\n const response = await http<unknown>(requestOptions, {\n url: 'peers',\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return Types.asArray(body.peers, { name: 'peers' }).map(x => ({\n address: Types.asString(Types.asObject(x, { name: 'peer' }).address, { name: 'address' }),\n fullNode: Types.asBoolean(Types.asObject(x, { name: 'peer' }).fullNode, { name: 'fullNode' }),\n }))\n}\n\nexport async function getBlocklist(requestOptions: BeeRequestOptions): Promise<Peer[]> {\n const response = await http<Peers>(requestOptions, {\n url: 'blocklist',\n responseType: 'json',\n })\n\n return response.data.peers\n}\n\nexport async function removePeer(requestOptions: BeeRequestOptions, peer: PeerAddress): Promise<RemovePeerResponse> {\n const response = await http<RemovePeerResponse>(requestOptions, {\n url: `peers/${peer}`,\n responseType: 'json',\n method: 'DELETE',\n })\n\n return response.data\n}\n\nexport async function getTopology(requestOptions: BeeRequestOptions): Promise<Topology> {\n const response = await http<unknown>(requestOptions, {\n url: `topology`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const bins = Types.asObject(body.bins, { name: 'bins' })\n\n return {\n baseAddr: Types.asString(body.baseAddr, { name: 'baseAddr' }),\n population: Types.asNumber(body.population, { name: 'population' }),\n connected: Types.asNumber(body.connected, { name: 'connected' }),\n timestamp: Types.asString(body.timestamp, { name: 'timestamp' }),\n nnLowWatermark: Types.asNumber(body.nnLowWatermark, { name: 'nnLowWatermark' }),\n depth: Types.asNumber(body.depth, { name: 'depth' }),\n reachability: Types.asString(body.reachability, { name: 'reachability' }),\n networkAvailability: Types.asString(body.networkAvailability, { name: 'networkAvailability' }),\n bins: {\n bin_0: asBin(bins.bin_0, 'bin_0'),\n bin_1: asBin(bins.bin_1, 'bin_1'),\n bin_2: asBin(bins.bin_2, 'bin_2'),\n bin_3: asBin(bins.bin_3, 'bin_3'),\n bin_4: asBin(bins.bin_4, 'bin_4'),\n bin_5: asBin(bins.bin_5, 'bin_5'),\n bin_6: asBin(bins.bin_6, 'bin_6'),\n bin_7: asBin(bins.bin_7, 'bin_7'),\n bin_8: asBin(bins.bin_8, 'bin_8'),\n bin_9: asBin(bins.bin_9, 'bin_9'),\n bin_10: asBin(bins.bin_10, 'bin_10'),\n bin_11: asBin(bins.bin_11, 'bin_11'),\n bin_12: asBin(bins.bin_12, 'bin_12'),\n bin_13: asBin(bins.bin_13, 'bin_13'),\n bin_14: asBin(bins.bin_14, 'bin_14'),\n bin_15: asBin(bins.bin_15, 'bin_15'),\n bin_16: asBin(bins.bin_16, 'bin_16'),\n bin_17: asBin(bins.bin_17, 'bin_17'),\n bin_18: asBin(bins.bin_18, 'bin_18'),\n bin_19: asBin(bins.bin_19, 'bin_19'),\n bin_20: asBin(bins.bin_20, 'bin_20'),\n bin_21: asBin(bins.bin_21, 'bin_21'),\n bin_22: asBin(bins.bin_22, 'bin_22'),\n bin_23: asBin(bins.bin_23, 'bin_23'),\n bin_24: asBin(bins.bin_24, 'bin_24'),\n bin_25: asBin(bins.bin_25, 'bin_25'),\n bin_26: asBin(bins.bin_26, 'bin_26'),\n bin_27: asBin(bins.bin_27, 'bin_27'),\n bin_28: asBin(bins.bin_28, 'bin_28'),\n bin_29: asBin(bins.bin_29, 'bin_29'),\n bin_30: asBin(bins.bin_30, 'bin_30'),\n bin_31: asBin(bins.bin_31, 'bin_31'),\n },\n }\n}\n\nexport async function pingPeer(requestOptions: BeeRequestOptions, peer: PeerAddress): Promise<PingResponse> {\n const response = await http<PingResponse>(requestOptions, {\n url: `pingpong/${peer}`,\n responseType: 'json',\n method: 'POST',\n })\n\n return response.data\n}\n\nexport function asBin(value: unknown, name: string): Bin {\n const bin = Types.asObject(value, { name })\n\n if (!bin.disconnectedPeers) {\n bin.disconnectedPeers = []\n }\n\n if (!bin.connectedPeers) {\n bin.connectedPeers = []\n }\n\n return {\n population: Types.asNumber(bin.population, { name: 'population' }),\n connected: Types.asNumber(bin.connected, { name: 'connected' }),\n connectedPeers: Types.asArray(bin.connectedPeers, { name: 'connectedPeers' }).map(x => ({\n address: Types.asString(Types.asObject(x, { name: 'connectedPeer' }).address, { name: 'address' }),\n })),\n disconnectedPeers: Types.asArray(bin.disconnectedPeers, { name: 'disconnectedPeers' }).map(x => ({\n address: Types.asString(Types.asObject(x, { name: 'disconnectedPeer' }).address, { name: 'address' }),\n })),\n }\n}\n","import { Types } from 'cafe-utility'\nimport type { AllSettlements, BeeRequestOptions, Settlements } from '../../types'\nimport { http } from '../../utils/http'\nimport { BZZ } from '../../utils/tokens'\nimport { asNumberString } from '../../utils/type'\nimport { PeerAddress } from '../../utils/typed-bytes'\n\nconst settlementsEndpoint = 'settlements'\n\n/**\n * Get amount of sent and received from settlements with a peer\n *\n * @param requestOptions Options for making requests\n * @param peer Swarm address of peer\n */\nexport async function getSettlements(requestOptions: BeeRequestOptions, peer: PeerAddress): Promise<Settlements> {\n const response = await http<unknown>(requestOptions, {\n url: `${settlementsEndpoint}/${peer}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n peer: Types.asString(body.peer, { name: 'peer' }),\n sent: BZZ.fromPLUR(asNumberString(body.sent, { name: 'sent' })),\n received: BZZ.fromPLUR(asNumberString(body.received, { name: 'received' })),\n }\n}\n\n/**\n * Get settlements with all known peers and total amount sent or received\n *\n * @param requestOptions Options for making requests\n */\nexport async function getAllSettlements(requestOptions: BeeRequestOptions): Promise<AllSettlements> {\n const response = await http<unknown>(requestOptions, {\n url: settlementsEndpoint,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n const totalSent = BZZ.fromPLUR(asNumberString(body.totalSent, { name: 'totalSent' }))\n const totalReceived = BZZ.fromPLUR(asNumberString(body.totalReceived, { name: 'totalReceived' }))\n const settlements = Types.asArray(body.settlements, { name: 'settlements' }).map(x =>\n Types.asObject(x, { name: 'settlement' }),\n )\n\n return {\n totalSent,\n totalReceived,\n settlements: settlements.map(x => ({\n peer: Types.asString(x.peer, { name: 'peer' }),\n sent: BZZ.fromPLUR(asNumberString(x.sent, { name: 'sent' })),\n received: BZZ.fromPLUR(asNumberString(x.received, { name: 'received' })),\n })),\n }\n}\n","import { Types } from 'cafe-utility'\nimport { BeeRequestOptions, NumberString, RedistributionState, TransactionOptions } from '../../types'\nimport { prepareRequestHeaders } from '../../utils/headers'\nimport { http } from '../../utils/http'\nimport { BZZ, DAI } from '../../utils/tokens'\nimport { asNumberString } from '../../utils/type'\nimport { TransactionId } from '../../utils/typed-bytes'\n\nconst STAKE_ENDPOINT = 'stake'\nconst REDISTRIBUTION_ENDPOINT = 'redistributionstate'\n\n/**\n * Gets the amount of staked BZZ\n *\n * @param requestOptions Options for making requests\n */\nexport async function getStake(requestOptions: BeeRequestOptions): Promise<BZZ> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n responseType: 'json',\n url: `${STAKE_ENDPOINT}`,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return BZZ.fromPLUR(asNumberString(body.stakedAmount, { name: 'stakedAmount' }))\n}\n\n/**\n * Gets the amount of withdrawable staked BZZ\n *\n * @param requestOptions Options for making requests\n */\nexport async function getWithdrawableStake(requestOptions: BeeRequestOptions): Promise<BZZ> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n responseType: 'json',\n url: `${STAKE_ENDPOINT}/withdrawable`,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return BZZ.fromPLUR(asNumberString(body.withdrawableAmount, { name: 'withdrawableAmount' }))\n}\n\nexport async function withdrawSurplusStake(requestOptions: BeeRequestOptions): Promise<TransactionId> {\n const response = await http<unknown>(requestOptions, {\n method: 'delete',\n responseType: 'json',\n url: `${STAKE_ENDPOINT}/withdrawable`,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asHexString(body.txHash, { name: 'txHash' }))\n}\n\nexport async function migrateStake(requestOptions: BeeRequestOptions): Promise<TransactionId> {\n const response = await http<unknown>(requestOptions, {\n method: 'delete',\n responseType: 'json',\n url: STAKE_ENDPOINT,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asHexString(body.txHash, { name: 'txHash' }))\n}\n\n/**\n * Stake given amount of tokens.\n *\n * @param requestOptions Options for making requests\n * @param amount\n */\nexport async function stake(\n requestOptions: BeeRequestOptions,\n amount: NumberString | string | bigint,\n options?: TransactionOptions,\n): Promise<TransactionId> {\n const repsonse = await http<unknown>(requestOptions, {\n method: 'post',\n responseType: 'json',\n url: `${STAKE_ENDPOINT}/${amount}`,\n headers: prepareRequestHeaders(null, options),\n })\n\n const body = Types.asObject(repsonse.data, { name: 'response.data' })\n\n return new TransactionId(Types.asHexString(body.txHash, { name: 'txHash' }))\n}\n\n/**\n * Get current status of node in redistribution game\n *\n * @param requestOptions Options for making requests\n */\nexport async function getRedistributionState(requestOptions: BeeRequestOptions): Promise<RedistributionState> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n responseType: 'json',\n url: REDISTRIBUTION_ENDPOINT,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n minimumGasFunds: DAI.fromWei(asNumberString(body.minimumGasFunds, { name: 'minimumGasFunds' })),\n hasSufficientFunds: Types.asBoolean(body.hasSufficientFunds, { name: 'hasSufficientFunds' }),\n isFrozen: Types.asBoolean(body.isFrozen, { name: 'isFrozen' }),\n isFullySynced: Types.asBoolean(body.isFullySynced, { name: 'isFullySynced' }),\n phase: Types.asString(body.phase, { name: 'phase' }),\n round: Types.asNumber(body.round, { name: 'round' }),\n lastWonRound: Types.asNumber(body.lastWonRound, { name: 'lastWonRound' }),\n lastPlayedRound: Types.asNumber(body.lastPlayedRound, { name: 'lastPlayedRound' }),\n lastFrozenRound: Types.asNumber(body.lastFrozenRound, { name: 'lastFrozenRound' }),\n lastSelectedRound: Types.asNumber(body.lastSelectedRound, { name: 'lastSelectedRound' }),\n lastSampleDurationSeconds: Types.asNumber(body.lastSampleDurationSeconds, { name: 'lastSampleDurationSeconds' }),\n block: Types.asNumber(body.block, { name: 'block' }),\n reward: BZZ.fromPLUR(asNumberString(body.reward, { name: 'reward' })),\n fees: DAI.fromWei(asNumberString(body.fees, { name: 'fees' })),\n isHealthy: Types.asBoolean(body.isHealthy, { name: 'isHealthy' }),\n }\n}\n","import { Numbers } from 'cafe-utility'\n\n/**\n * Represents a size in bytes.\n *\n * Uses 1000 instead of 1024 for converting between units.\n * This is to stay consistent with the Swarm papers\n * on theoretical and effective storage capacity.\n */\nexport class Size {\n private bytes: number\n\n private constructor(bytes: number) {\n this.bytes = Math.ceil(bytes)\n\n if (bytes < 0) {\n throw Error('Size must be at least 0')\n }\n }\n\n static fromBytes(bytes: number): Size {\n return new Size(bytes)\n }\n\n static fromKilobytes(kilobytes: number): Size {\n return new Size(kilobytes * 1000)\n }\n\n static fromMegabytes(megabytes: number): Size {\n return new Size(megabytes * 1000 * 1000)\n }\n\n static fromGigabytes(gigabytes: number): Size {\n return new Size(gigabytes * 1000 * 1000 * 1000)\n }\n\n /**\n * Parses a size string and returns a `Size` instance.\n *\n * Case insensitive. E.g. both `\"28MB\"` and `\"1gb\"` are valid.\n *\n * Whitespaces are ignored. E.g. both `\"512 kb\"` and `\"2megabytes\"` are valid.\n *\n * Decimal numbers are supported. E.g. `\"1.5gb\"` is valid.\n *\n * Uses 1000 as the base for conversions. E.g. 1kb = 1000 bytes.\n * This is consistent with the effective stamp utilization table.\n *\n * Supported units:\n * - b, byte, bytes\n * - kb, kilobyte, kilobytes\n * - mb, megabyte, megabytes\n * - gb, gigabyte, gigabytes\n * - tb, terabyte, terabytes\n *\n * @param size - A string representing a size\n * @returns a `Size` instance\n */\n static parseFromString(size: string): Size {\n return Size.fromBytes(Numbers.makeStorage(size, 1000))\n }\n\n toBytes(): number {\n return this.bytes\n }\n\n toGigabytes(): number {\n return this.bytes / 1000 / 1000 / 1000\n }\n\n toFormattedString(): string {\n return Numbers.convertBytes(this.bytes, 1000)\n }\n\n represent(): string {\n return this.toFormattedString()\n }\n}\n","// TODO: Remove this file after the issue is fixed\n\nexport function normalizeBatchTTL(batchTTL: number) {\n if (!Number.isInteger(batchTTL)) {\n return 1\n }\n\n if (batchTTL < 1) {\n return 1\n }\n\n if (batchTTL > 315569260) {\n return 315569260\n }\n\n return batchTTL\n}\n\nexport function normalizeCurrentPrice(currentPrice: number) {\n if (!Number.isInteger(currentPrice)) {\n return 24000\n }\n\n if (currentPrice < 24000) {\n return 24000\n }\n\n return currentPrice\n}\n","import { Types } from 'cafe-utility'\nimport type {\n BeeRequestOptions,\n GlobalPostageBatch,\n NumberString,\n PostageBatch,\n PostageBatchBuckets,\n PostageBatchOptions,\n RedundancyLevel,\n} from '../../types'\nimport { Duration } from '../../utils/duration'\nimport { http } from '../../utils/http'\nimport { Size } from '../../utils/size'\nimport { getStampEffectiveBytes, getStampTheoreticalBytes, getStampUsage } from '../../utils/stamps'\nimport { asNumberString } from '../../utils/type'\nimport { BatchId, EthAddress } from '../../utils/typed-bytes'\nimport { normalizeBatchTTL } from '../../utils/workaround'\n\nconst STAMPS_ENDPOINT = 'stamps'\nconst BATCHES_ENDPOINT = 'batches'\n\nexport async function getGlobalPostageBatches(requestOptions: BeeRequestOptions): Promise<GlobalPostageBatch[]> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${BATCHES_ENDPOINT}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const batches = Types.asArray(body.batches, { name: 'batches' }).map(x => Types.asObject(x, { name: 'batch' }))\n\n return batches.map(x => ({\n batchID: new BatchId(Types.asString(x.batchID, { name: 'batchID' })),\n batchTTL: Types.asNumber(x.batchTTL, { name: 'batchTTL' }),\n bucketDepth: Types.asNumber(x.bucketDepth, { name: 'bucketDepth' }),\n depth: Types.asNumber(x.depth, { name: 'depth' }),\n immutable: Types.asBoolean(x.immutable, { name: 'immutable' }),\n owner: new EthAddress(Types.asString(x.owner, { name: 'owner' })),\n start: Types.asNumber(x.start, { name: 'start' }),\n value: asNumberString(x.value, { name: 'value' }),\n }))\n}\n\nexport async function getAllPostageBatches(requestOptions: BeeRequestOptions): Promise<PostageBatch[]> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${STAMPS_ENDPOINT}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const stamps = Types.asArray(body.stamps, { name: 'stamps' }).map(x => Types.asObject(x, { name: 'stamp' }))\n\n return stamps.map(x => {\n const utilization = Types.asNumber(x.utilization, { name: 'utilization' })\n const depth = Types.asNumber(x.depth, { name: 'depth' })\n const bucketDepth = Types.asNumber(x.bucketDepth, { name: 'bucketDepth' })\n const usage = getStampUsage(utilization, depth, bucketDepth)\n const batchTTL = normalizeBatchTTL(Types.asNumber(x.batchTTL, { name: 'batchTTL' }))\n const duration = Duration.fromSeconds(batchTTL)\n\n const effectiveBytes = getStampEffectiveBytes(depth)\n\n return {\n batchID: new BatchId(Types.asString(x.batchID, { name: 'batchID' })),\n utilization,\n usable: Types.asBoolean(x.usable, { name: 'usable' }),\n label: Types.asEmptiableString(x.label, { name: 'label' }),\n depth,\n amount: asNumberString(x.amount, { name: 'amount' }),\n bucketDepth,\n blockNumber: Types.asNumber(x.blockNumber, { name: 'blockNumber' }),\n immutableFlag: Types.asBoolean(x.immutableFlag, { name: 'immutableFlag' }),\n usage,\n usageText: `${Math.round(usage * 100)}%`,\n size: Size.fromBytes(effectiveBytes),\n remainingSize: Size.fromBytes(Math.ceil(effectiveBytes * (1 - usage))),\n theoreticalSize: Size.fromBytes(getStampTheoreticalBytes(depth)),\n duration,\n calculateSize(encryption, redundancyLevel) {\n const effectiveBytes = getStampEffectiveBytes(this.depth, encryption, redundancyLevel)\n\n return Size.fromBytes(effectiveBytes)\n },\n calculateRemainingSize(encryption, redundancyLevel) {\n const effectiveBytes = getStampEffectiveBytes(this.depth, encryption, redundancyLevel)\n\n return Size.fromBytes(Math.ceil(effectiveBytes * (1 - this.usage)))\n },\n }\n })\n}\n\nexport async function getPostageBatch(\n requestOptions: BeeRequestOptions,\n postageBatchId: BatchId,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n): Promise<PostageBatch> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${STAMPS_ENDPOINT}/${postageBatchId}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n const utilization = Types.asNumber(body.utilization, { name: 'utilization' })\n const depth = Types.asNumber(body.depth, { name: 'depth' })\n const bucketDepth = Types.asNumber(body.bucketDepth, { name: 'bucketDepth' })\n const usage = getStampUsage(utilization, depth, bucketDepth)\n const batchTTL = normalizeBatchTTL(Types.asNumber(body.batchTTL, { name: 'batchTTL' }))\n const duration = Duration.fromSeconds(batchTTL)\n\n const effectiveBytes = getStampEffectiveBytes(depth, encryption, erasureCodeLevel)\n\n return {\n batchID: new BatchId(Types.asString(body.batchID, { name: 'batchID' })),\n utilization,\n usable: Types.asBoolean(body.usable, { name: 'usable' }),\n label: Types.asEmptiableString(body.label, { name: 'label' }),\n depth,\n amount: asNumberString(body.amount, { name: 'amount' }),\n bucketDepth,\n blockNumber: Types.asNumber(body.blockNumber, { name: 'blockNumber' }),\n immutableFlag: Types.asBoolean(body.immutableFlag, { name: 'immutableFlag' }),\n usage,\n usageText: `${Math.round(usage * 100)}%`,\n size: Size.fromBytes(effectiveBytes),\n remainingSize: Size.fromBytes(Math.ceil(effectiveBytes * (1 - usage))),\n theoreticalSize: Size.fromBytes(getStampTheoreticalBytes(depth)),\n duration,\n calculateSize(encryption, redundancyLevel) {\n const effectiveBytes = getStampEffectiveBytes(depth, encryption, redundancyLevel)\n\n return Size.fromBytes(effectiveBytes)\n },\n calculateRemainingSize(encryption, redundancyLevel) {\n const effectiveBytes = getStampEffectiveBytes(depth, encryption, redundancyLevel)\n\n return Size.fromBytes(Math.ceil(effectiveBytes * (1 - usage)))\n },\n }\n}\n\nexport async function getPostageBatchBuckets(\n requestOptions: BeeRequestOptions,\n postageBatchId: BatchId,\n): Promise<PostageBatchBuckets> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${STAMPS_ENDPOINT}/${postageBatchId}/buckets`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n depth: Types.asNumber(body.depth, { name: 'depth' }),\n bucketDepth: Types.asNumber(body.bucketDepth, { name: 'bucketDepth' }),\n bucketUpperBound: Types.asNumber(body.bucketUpperBound, { name: 'bucketUpperBound' }),\n buckets: Types.asArray(body.buckets, { name: 'buckets' })\n .map(x => Types.asObject(x, { name: 'bucket' }))\n .map(x => ({\n bucketID: Types.asNumber(x.bucketID, { name: 'bucketID' }),\n collisions: Types.asNumber(x.collisions, { name: 'collisions' }),\n })),\n }\n}\n\nexport async function createPostageBatch(\n requestOptions: BeeRequestOptions,\n amount: NumberString,\n depth: number,\n options?: PostageBatchOptions,\n): Promise<BatchId> {\n const headers: Record<string, string> = {}\n\n if (options?.gasPrice) {\n headers['gas-price'] = options.gasPrice.toString()\n }\n\n if (options?.immutableFlag !== undefined) {\n headers.immutable = String(options.immutableFlag)\n }\n\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: `${STAMPS_ENDPOINT}/${amount}/${depth}`,\n responseType: 'json',\n params: { label: options?.label },\n headers,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new BatchId(Types.asString(body.batchID, { name: 'batchID' }))\n}\n\nexport async function topUpBatch(\n requestOptions: BeeRequestOptions,\n id: BatchId,\n amount: NumberString,\n): Promise<BatchId> {\n const response = await http<unknown>(requestOptions, {\n method: 'patch',\n url: `${STAMPS_ENDPOINT}/topup/${id}/${amount}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new BatchId(Types.asString(body.batchID, { name: 'batchID' }))\n}\n\nexport async function diluteBatch(requestOptions: BeeRequestOptions, id: BatchId, depth: number): Promise<BatchId> {\n const response = await http<unknown>(requestOptions, {\n method: 'patch',\n url: `${STAMPS_ENDPOINT}/dilute/${id}/${depth}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new BatchId(Types.asString(body.batchID, { name: 'batchID' }))\n}\n","import { Types } from 'cafe-utility'\nimport { BeeRequestOptions, ChainState, ReserveState, WalletBalance } from '../../types'\nimport { http } from '../../utils/http'\nimport { BZZ, DAI } from '../../utils/tokens'\nimport { asNumberString } from '../../utils/type'\nimport { EthAddress, TransactionId } from '../../utils/typed-bytes'\nimport { normalizeCurrentPrice } from '../../utils/workaround'\n\nconst RESERVE_STATE_ENDPOINT = 'reservestate'\nconst WALLET_ENDPOINT = 'wallet'\nconst CHAIN_STATE_ENDPOINT = 'chainstate'\n\n/**\n * Get state of reserve\n *\n * @param requestOptions Options for making requests\n */\nexport async function getReserveState(requestOptions: BeeRequestOptions): Promise<ReserveState> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${RESERVE_STATE_ENDPOINT}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n commitment: Types.asNumber(body.commitment, { name: 'commitment' }),\n radius: Types.asNumber(body.radius, { name: 'radius' }),\n storageRadius: Types.asNumber(body.storageRadius, { name: 'storageRadius' }),\n }\n}\n\n/**\n * Get state of reserve\n *\n * @param requestOptions Options for making requests\n */\nexport async function getChainState(requestOptions: BeeRequestOptions): Promise<ChainState> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${CHAIN_STATE_ENDPOINT}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n block: Types.asNumber(body.block, { name: 'block' }),\n chainTip: Types.asNumber(body.chainTip, { name: 'chainTip' }),\n totalAmount: asNumberString(body.totalAmount, { name: 'totalAmount' }),\n currentPrice: normalizeCurrentPrice(Types.asNumber(body.currentPrice, { name: 'currentPrice' })),\n }\n}\n\n/**\n * Get wallet balances for xDai and BZZ of the node\n *\n * @param requestOptions Options for making requests\n */\nexport async function getWalletBalance(requestOptions: BeeRequestOptions): Promise<WalletBalance> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${WALLET_ENDPOINT}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n bzzBalance: BZZ.fromPLUR(asNumberString(body.bzzBalance, { name: 'bzzBalance' })),\n nativeTokenBalance: DAI.fromWei(asNumberString(body.nativeTokenBalance, { name: 'nativeTokenBalance' })),\n chainID: Types.asNumber(body.chainID, { name: 'chainID' }),\n chequebookContractAddress: Types.asString(body.chequebookContractAddress, { name: 'chequebookContractAddress' }),\n walletAddress: Types.asString(body.walletAddress, { name: 'walletAddress' }),\n }\n}\n\nexport async function withdrawBZZ(\n requestOptions: BeeRequestOptions,\n amount: BZZ,\n address: EthAddress,\n): Promise<TransactionId> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: `${WALLET_ENDPOINT}/withdraw/bzz`,\n responseType: 'json',\n params: { amount: amount.toPLURString(), address: address.toHex() },\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asString(body.transactionHash, { name: 'transactionHash' }))\n}\n\nexport async function withdrawDAI(\n requestOptions: BeeRequestOptions,\n amount: DAI,\n address: EthAddress,\n): Promise<TransactionId> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: `${WALLET_ENDPOINT}/withdraw/nativetoken`,\n responseType: 'json',\n params: { amount: amount.toWeiString(), address: address.toHex() },\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asString(body.transactionHash, { name: 'transactionHash' }))\n}\n","import { Types } from 'cafe-utility'\nimport getMajorSemver from 'semver/functions/major.js'\nimport { BeeRequestOptions } from '../../index'\nimport type { DebugStatus, Health, NodeInfo, Readiness } from '../../types/debug'\nimport { BeeVersions, toBeeMode } from '../../types/debug'\nimport { http } from '../../utils/http'\n\nexport const SUPPORTED_BEE_VERSION_EXACT = '2.6.0-d0aa8b93'\nexport const SUPPORTED_BEE_VERSION = SUPPORTED_BEE_VERSION_EXACT.split('-')[0]\nexport const SUPPORTED_API_VERSION = '7.3.0'\n\nconst NODE_INFO_URL = 'node'\nconst STATUS_URL = 'status'\nconst HEALTH_URL = 'health'\nconst READINESS_URL = 'readiness'\n\nexport async function getDebugStatus(requestOptions: BeeRequestOptions): Promise<DebugStatus> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: STATUS_URL,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n overlay: Types.asString(body.overlay, { name: 'overlay' }),\n proximity: Types.asNumber(body.proximity, { name: 'proximity' }),\n beeMode: toBeeMode(Types.asString(body.beeMode, { name: 'beeMode' })),\n reserveSize: Types.asNumber(body.reserveSize, { name: 'reserveSize' }),\n reserveSizeWithinRadius: Types.asNumber(body.reserveSizeWithinRadius, { name: 'reserveSizeWithinRadius' }),\n pullsyncRate: Types.asNumber(body.pullsyncRate, { name: 'pullsyncRate' }),\n storageRadius: Types.asNumber(body.storageRadius, { name: 'storageRadius' }),\n connectedPeers: Types.asNumber(body.connectedPeers, { name: 'connectedPeers' }),\n neighborhoodSize: Types.asNumber(body.neighborhoodSize, { name: 'neighborhoodSize' }),\n batchCommitment: Types.asNumber(body.batchCommitment, { name: 'batchCommitment' }),\n isReachable: Types.asBoolean(body.isReachable, { name: 'isReachable' }),\n lastSyncedBlock: Types.asNumber(body.lastSyncedBlock, { name: 'lastSyncedBlock' }),\n committedDepth: Types.asNumber(body.committedDepth, { name: 'committedDepth' }),\n isWarmingUp: Types.asBoolean(body.isWarmingUp, { name: 'isWarmingUp' }),\n }\n}\n\n/**\n * Get health of node\n *\n * @param requestOptions Options for making requests\n */\nexport async function getHealth(requestOptions: BeeRequestOptions): Promise<Health> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: HEALTH_URL,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n apiVersion: Types.asString(body.apiVersion, { name: 'apiVersion' }),\n version: Types.asString(body.version, { name: 'version' }),\n status: Types.asString(body.status, { name: 'status' }) as 'ok',\n }\n}\n\n/**\n * Get readiness of node\n *\n * @param requestOptions Options for making requests\n */\nexport async function getReadiness(requestOptions: BeeRequestOptions): Promise<Readiness> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: READINESS_URL,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n apiVersion: Types.asString(body.apiVersion, { name: 'apiVersion' }),\n version: Types.asString(body.version, { name: 'version' }),\n status: Types.asString(body.status, { name: 'status' }),\n }\n}\n\n/**\n * Get information about Bee node\n *\n * @param requestOptions Options for making requests\n */\nexport async function getNodeInfo(requestOptions: BeeRequestOptions): Promise<NodeInfo> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: NODE_INFO_URL,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n beeMode: toBeeMode(Types.asString(body.beeMode, { name: 'beeMode' })),\n chequebookEnabled: Types.asBoolean(body.chequebookEnabled, { name: 'chequebookEnabled' }),\n swapEnabled: Types.asBoolean(body.swapEnabled, { name: 'swapEnabled' }),\n }\n}\n\n/**\n * Connects to a node and checks if its version matches with the one that bee-js supports.\n *\n * This is the most strict version check and most probably you will\n * want to use the relaxed API-versions check `isSupportedApiVersion`.\n *\n * @param requestOptions Options for making requests\n */\nexport async function isSupportedExactVersion(requestOptions: BeeRequestOptions): Promise<boolean> {\n const { version } = await getHealth(requestOptions)\n\n return version === SUPPORTED_BEE_VERSION_EXACT\n}\n\n/**\n * Connects to a node and checks if its Main API versions matches with the one that bee-js supports.\n *\n * This should be the main way how to check compatibility for your app and Bee node.\n *\n * @param requestOptions Options for making requests\n */\nexport async function isSupportedApiVersion(requestOptions: BeeRequestOptions): Promise<boolean> {\n const { apiVersion } = await getHealth(requestOptions)\n\n return getMajorSemver(apiVersion) === getMajorSemver(SUPPORTED_API_VERSION)\n}\n\n/**\n * Returns object with all versions specified by the connected Bee node (properties prefixed with `bee*`)\n * and versions that bee-js supports (properties prefixed with `supported*`).\n *\n * @param requestOptions Options for making requests\n */\nexport async function getVersions(requestOptions: BeeRequestOptions): Promise<BeeVersions> {\n const { version, apiVersion } = await getHealth(requestOptions)\n\n return {\n supportedBeeVersion: SUPPORTED_BEE_VERSION_EXACT,\n supportedBeeApiVersion: SUPPORTED_API_VERSION,\n beeVersion: version,\n beeApiVersion: apiVersion,\n }\n}\n","import { Types } from 'cafe-utility'\nimport { BeeRequestOptions, NumberString, TransactionInfo } from '../../types'\nimport { http } from '../../utils/http'\nimport { asNumberString } from '../../utils/type'\nimport { TransactionId } from '../../utils/typed-bytes'\n\nconst transactionsEndpoint = 'transactions'\n\n/**\n * Get list of all pending transactions\n *\n * @param requestOptions Options for making requests\n */\nexport async function getAllTransactions(requestOptions: BeeRequestOptions): Promise<TransactionInfo[]> {\n const response = await http<unknown>(requestOptions, {\n url: transactionsEndpoint,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const pendingTransactions = Types.asArray(body.pendingTransactions, { name: 'pendingTransactions' })\n\n return pendingTransactions.map(toTransaction)\n}\n\n/**\n * Get information for specific pending transactions\n *\n * @param requestOptions Options for making requests\n * @param transactionHash Hash of the transaction\n */\nexport async function getTransaction(\n requestOptions: BeeRequestOptions,\n transactionHash: TransactionId,\n): Promise<TransactionInfo> {\n const response = await http<unknown>(requestOptions, {\n url: `${transactionsEndpoint}/${transactionHash}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return toTransaction(body)\n}\n\nfunction toTransaction(value: unknown) {\n const object = Types.asObject(value, { name: 'transaction' })\n\n return {\n transactionHash: new TransactionId(Types.asString(object.transactionHash, { name: 'transactionHash' })),\n to: Types.asString(object.to, { name: 'to' }),\n nonce: Types.asNumber(object.nonce, { name: 'nonce' }),\n gasPrice: asNumberString(object.gasPrice, { name: 'gasPrice' }),\n gasLimit: Types.asNumber(object.gasLimit, { name: 'gasLimit' }),\n data: Types.asString(object.data, { name: 'data' }),\n created: Types.asString(object.created, { name: 'created' }),\n description: Types.asString(object.description, { name: 'description' }),\n value: asNumberString(object.value, { name: 'value' }),\n }\n}\n\n/**\n * Rebroadcast existing transaction\n *\n * @param requestOptions Options for making requests\n * @param transactionHash Hash of the transaction\n */\nexport async function rebroadcastTransaction(\n requestOptions: BeeRequestOptions,\n transactionHash: TransactionId,\n): Promise<TransactionId> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: `${transactionsEndpoint}/${transactionHash}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asString(body.transactionHash, { name: 'transactionHash' }))\n}\n\n/**\n * Cancel existing transaction\n *\n * @param requestOptions Options for making requests\n * @param transactionHash Hash of the transaction\n * @param gasPrice Optional gas price\n */\nexport async function cancelTransaction(\n requestOptions: BeeRequestOptions,\n transactionHash: TransactionId,\n gasPrice?: NumberString | string | bigint,\n): Promise<TransactionId> {\n const headers: Record<string, string | number> = {}\n\n if (gasPrice) {\n headers['gas-price'] = gasPrice.toString()\n }\n const response = await http<unknown>(requestOptions, {\n method: 'delete',\n headers,\n url: `${transactionsEndpoint}/${transactionHash}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return new TransactionId(Types.asString(body.transactionHash, { name: 'transactionHash' }))\n}\n","import { Types } from 'cafe-utility'\nimport { BeeRequestOptions, GetGranteesResult, GranteesResult } from '../types'\nimport { prepareRequestHeaders } from '../utils/headers'\nimport { http } from '../utils/http'\nimport { BatchId, PublicKey, Reference } from '../utils/typed-bytes'\n\nconst granteeEndpoint = 'grantee'\n\nexport async function getGrantees(reference: Reference, requestOptions: BeeRequestOptions): Promise<GetGranteesResult> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n url: `${granteeEndpoint}/${reference}`,\n responseType: 'json',\n })\n\n const body = Types.asArray(response.data, { name: 'response.data' }).map(\n x => new PublicKey(Types.asString(x, { name: 'grantee' })),\n )\n\n return {\n status: response.status,\n statusText: response.statusText,\n grantees: body,\n }\n}\n\nexport async function createGrantees(\n requestOptions: BeeRequestOptions,\n postageBatchId: BatchId,\n grantees: PublicKey[],\n): Promise<GranteesResult> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: granteeEndpoint,\n data: { grantees: grantees.map(x => x.toCompressedHex()) },\n headers: prepareRequestHeaders(postageBatchId),\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n status: response.status,\n statusText: response.statusText,\n ref: new Reference(Types.asString(body.ref, { name: 'ref' })),\n historyref: new Reference(Types.asString(body.historyref, { name: 'historyref' })),\n }\n}\n\nexport async function patchGrantees(\n postageBatchId: BatchId,\n reference: Reference,\n historyRef: Reference,\n grantees: { add?: PublicKey[]; revoke?: PublicKey[] },\n requestOptions: BeeRequestOptions,\n): Promise<GranteesResult> {\n const response = await http<unknown>(requestOptions, {\n method: 'patch',\n url: `${granteeEndpoint}/${reference}`,\n data: {\n add: grantees.add?.map(x => x.toCompressedHex()),\n revoke: grantees.revoke?.map(x => x.toCompressedHex()),\n },\n headers: {\n ...prepareRequestHeaders(postageBatchId),\n 'swarm-act-history-address': historyRef.toHex(),\n },\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n status: response.status,\n statusText: response.statusText,\n ref: new Reference(Types.asString(body.ref, { name: 'ref' })),\n historyref: new Reference(Types.asString(body.historyref, { name: 'historyref' })),\n }\n}\n","import { System } from 'cafe-utility'\nimport WebSocket from 'isomorphic-ws'\nimport { BeeRequestOptions, UploadOptions } from '..'\nimport { SingleOwnerChunk, uploadSingleOwnerChunk } from '../chunk/soc'\nimport { BatchId, Reference } from '../utils/typed-bytes'\n\nconst endpoint = 'gsoc'\n\nexport async function send(\n requestOptions: BeeRequestOptions,\n soc: SingleOwnerChunk,\n stamp: BatchId,\n options?: UploadOptions,\n) {\n return uploadSingleOwnerChunk(requestOptions, soc, stamp, options)\n}\n\nexport function subscribe(url: string, reference: Reference, headers?: Record<string, string>) {\n const wsUrl = url.replace(/^http/i, 'ws')\n\n if (System.whereAmI() === 'browser') {\n return new WebSocket(`${wsUrl}/${endpoint}/subscribe/${reference.toHex()}`)\n }\n\n return new WebSocket(`${wsUrl}/${endpoint}/subscribe/${reference.toHex()}`, {\n headers,\n })\n}\n","import { Types } from 'cafe-utility'\nimport type { BeeRequestOptions, Pin } from '../types'\nimport { http } from '../utils/http'\nimport { Reference } from '../utils/typed-bytes'\n\nconst PINNING_ENDPOINT = 'pins'\n\n/**\n * Pin data with given reference\n *\n * @param requestOptions Options for making requests\n * @param reference Bee data reference\n */\nexport async function pin(requestOptions: BeeRequestOptions, reference: Reference): Promise<void> {\n await http<unknown>(requestOptions, {\n method: 'post',\n responseType: 'json',\n url: `${PINNING_ENDPOINT}/${reference}`,\n })\n}\n\n/**\n * Unpin data with given reference\n *\n * @param requestOptions Options for making requests\n * @param reference Bee data reference\n */\nexport async function unpin(requestOptions: BeeRequestOptions, reference: Reference): Promise<void> {\n await http<unknown>(requestOptions, {\n method: 'delete',\n responseType: 'json',\n url: `${PINNING_ENDPOINT}/${reference}`,\n })\n}\n\n/**\n * Get pin status for specific address.\n *\n * @param requestOptions Options for making requests\n * @param reference\n * @throws Error if given address is not pinned\n */\nexport async function getPin(requestOptions: BeeRequestOptions, reference: Reference): Promise<Pin> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n responseType: 'json',\n url: `${PINNING_ENDPOINT}/${reference}`,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n reference: new Reference(Types.asString(body.reference, { name: 'reference' })),\n }\n}\n\n/**\n * Get list of all pins\n *\n * @param requestOptions Options for making requests\n */\nexport async function getAllPins(requestOptions: BeeRequestOptions): Promise<Reference[]> {\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n responseType: 'json',\n url: `${PINNING_ENDPOINT}`,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n // TODO: https://github.com/ethersphere/bee/issues/4964\n if (body.references === null) {\n return []\n }\n\n const references = Types.asArray(body.references, { name: 'references' }).map(x =>\n Types.asString(x, { name: 'reference' }),\n )\n\n return references.map(x => new Reference(x))\n}\n","import { System } from 'cafe-utility'\nimport WebSocket from 'isomorphic-ws'\nimport type { BeeRequestOptions } from '../types'\nimport { prepareRequestHeaders } from '../utils/headers'\nimport { http } from '../utils/http'\nimport { BatchId, PublicKey, Topic } from '../utils/typed-bytes'\n\nconst endpoint = 'pss'\n\n/**\n * Send to recipient or target with Postal Service for Swarm\n *\n * @param requestOptions Options for making requests\n * @param topic Topic name\n * @param target Target message address prefix\n * @param data\n * @param postageBatchId Postage BatchId that will be assigned to sent message\n * @param recipient Recipient public key\n *\n */\nexport async function send(\n requestOptions: BeeRequestOptions,\n topic: Topic,\n target: string,\n data: string | Uint8Array,\n postageBatchId: BatchId,\n recipient?: PublicKey,\n): Promise<void> {\n await http<unknown>(requestOptions, {\n method: 'post',\n url: `${endpoint}/send/${topic}/${target}`,\n data,\n responseType: 'json',\n params: { recipient },\n headers: prepareRequestHeaders(postageBatchId),\n })\n}\n\n/**\n * Subscribe for messages on the given topic\n *\n * @param url Bee node URL\n * @param topic Topic name\n */\nexport function subscribe(url: string, topic: Topic, headers?: Record<string, string>): WebSocket {\n const wsUrl = url.replace(/^http/i, 'ws')\n\n if (System.whereAmI() === 'browser') {\n return new WebSocket(`${wsUrl}/${endpoint}/subscribe/${topic.toHex()}`)\n }\n\n return new WebSocket(`${wsUrl}/${endpoint}/subscribe/${topic.toHex()}`, {\n headers,\n })\n}\n","import { Types } from 'cafe-utility'\nimport { BeeRequestOptions } from '../index'\nimport { http } from '../utils/http'\n\n/**\n * Ping the base bee URL. If connection was not successful throw error\n *\n * @param requestOptions Options for making requests\n */\nexport async function checkConnection(requestOptions: BeeRequestOptions): Promise<void> | never {\n await http<unknown>(requestOptions, {\n url: '',\n })\n}\n\nexport async function isGateway(requestOptions: BeeRequestOptions): Promise<boolean> {\n try {\n const response = await http<unknown>(requestOptions, {\n url: '/gateway',\n })\n const data = Types.asObject(response.data)\n\n return Types.asBoolean(data.gateway)\n } catch (error) {\n return false\n }\n}\n","import { Types } from 'cafe-utility'\nimport type { BeeRequestOptions } from '../types'\nimport { http } from '../utils/http'\nimport { BatchId, Reference } from '../utils/typed-bytes'\n\nconst stewardshipEndpoint = 'stewardship'\n\n/**\n * Reupload locally pinned data\n * @param requestOptions Options for making requests\n * @param reference\n * @throws BeeResponseError if not locally pinned or invalid data\n */\nexport async function reupload(requestOptions: BeeRequestOptions, stamp: BatchId, reference: Reference): Promise<void> {\n await http(requestOptions, {\n method: 'put',\n url: `${stewardshipEndpoint}/${reference}`,\n headers: { 'swarm-postage-batch-id': stamp.toHex() },\n })\n}\n\nexport async function isRetrievable(\n requestOptions: BeeRequestOptions,\n reference: Reference | Uint8Array | string,\n): Promise<boolean> {\n reference = new Reference(reference)\n\n const response = await http<unknown>(requestOptions, {\n method: 'get',\n responseType: 'json',\n url: `${stewardshipEndpoint}/${reference}`,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return Types.asBoolean(body.isRetrievable, { name: 'isRetrievable' })\n}\n","import { Types } from 'cafe-utility'\nimport { BeeRequestOptions, Tag } from '../types'\nimport { http } from '../utils/http'\nimport { Reference } from '../utils/typed-bytes'\n\nconst endpoint = 'tags'\n\n/**\n * Create new tag on the Bee node\n *\n * @param url Bee tag URL\n */\nexport async function createTag(requestOptions: BeeRequestOptions): Promise<Tag> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n url: endpoint,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n address: Types.asEmptiableString(body.address, { name: 'address' }),\n seen: Types.asNumber(body.seen, { name: 'seen' }),\n sent: Types.asNumber(body.sent, { name: 'sent' }),\n split: Types.asNumber(body.split, { name: 'split' }),\n startedAt: Types.asString(body.startedAt, { name: 'startedAt' }),\n stored: Types.asNumber(body.stored, { name: 'stored' }),\n synced: Types.asNumber(body.synced, { name: 'synced' }),\n uid: Types.asNumber(body.uid, { name: 'uid' }),\n }\n}\n\n/**\n * Retrieve tag information from Bee node\n *\n * @param url Bee tag URL\n * @param uid UID of tag to be retrieved\n */\nexport async function retrieveTag(requestOptions: BeeRequestOptions, uid: number): Promise<Tag> {\n const response = await http<unknown>(requestOptions, {\n url: `${endpoint}/${uid}`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n address: Types.asEmptiableString(body.address, { name: 'address' }),\n seen: Types.asNumber(body.seen, { name: 'seen' }),\n sent: Types.asNumber(body.sent, { name: 'sent' }),\n split: Types.asNumber(body.split, { name: 'split' }),\n startedAt: Types.asString(body.startedAt, { name: 'startedAt' }),\n stored: Types.asNumber(body.stored, { name: 'stored' }),\n synced: Types.asNumber(body.synced, { name: 'synced' }),\n uid: Types.asNumber(body.uid, { name: 'uid' }),\n }\n}\n\n/**\n * Get limited listing of all tags.\n *\n * @param url\n * @param offset\n * @param limit\n */\nexport async function getAllTags(requestOptions: BeeRequestOptions, offset?: number, limit?: number): Promise<Tag[]> {\n const response = await http<unknown>(requestOptions, {\n url: endpoint,\n params: { offset, limit },\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const tags = Types.asArray(body.tags, { name: 'tags' }).map(x => Types.asObject(x, { name: 'tag' }))\n\n return tags.map(x => ({\n address: Types.asEmptiableString(x.address, { name: 'address' }),\n seen: Types.asNumber(x.seen, { name: 'seen' }),\n sent: Types.asNumber(x.sent, { name: 'sent' }),\n split: Types.asNumber(x.split, { name: 'split' }),\n startedAt: Types.asString(x.startedAt, { name: 'startedAt' }),\n stored: Types.asNumber(x.stored, { name: 'stored' }),\n synced: Types.asNumber(x.synced, { name: 'synced' }),\n uid: Types.asNumber(x.uid, { name: 'uid' }),\n }))\n}\n\n/**\n * Removes tag from the Bee node.\n * @param url\n * @param uid\n */\nexport async function deleteTag(requestOptions: BeeRequestOptions, uid: number): Promise<void> {\n await http<void>(requestOptions, {\n method: 'delete',\n url: `${endpoint}/${uid}`,\n })\n}\n\n/**\n * Updates tag\n * @param url\n * @param uid\n * @param reference\n */\nexport async function updateTag(requestOptions: BeeRequestOptions, uid: number, reference: Reference): Promise<void> {\n await http<void>(requestOptions, {\n method: 'patch',\n url: `${endpoint}/${uid}`,\n data: {\n reference,\n },\n })\n}\n","import { Binary, MerkleTree, Optional, Uint8ArrayReader } from 'cafe-utility'\nimport _debug from 'debug'\nimport { Bee, BeeRequestOptions, DownloadOptions, NULL_ADDRESS, UploadOptions, UploadResult } from '..'\nimport { FeedPayloadResult } from '../modules/feed'\nimport { Bytes } from '../utils/bytes'\nimport { BatchId, Reference } from '../utils/typed-bytes'\n\nconst debug = _debug('bee-js:manifest')\n\nconst ENCODER = new TextEncoder()\nconst DECODER = new TextDecoder()\n\nconst TYPE_VALUE = 2\nconst TYPE_EDGE = 4\nconst TYPE_WITH_PATH_SEPARATOR = 8\nconst TYPE_WITH_METADATA = 16\nconst PATH_SEPARATOR = new Uint8Array([47])\nconst VERSION_02_HASH_HEX = '5768b3b6a7db56d21d1abff40d41cebfc83448fed8d7e9b06ec0d3b073f28f7b'\nconst VERSION_02_HASH = Binary.hexToUint8Array(VERSION_02_HASH_HEX)\n\nexport class Fork {\n prefix: Uint8Array\n node: MantarayNode\n\n constructor(prefix: Uint8Array, node: MantarayNode) {\n this.prefix = prefix\n this.node = node\n }\n\n static split(a: Fork, b: Fork): Fork {\n const commonPart = Binary.commonPrefix(a.prefix, b.prefix)\n\n if (commonPart.length === a.prefix.length) {\n const remainingB = b.prefix.slice(commonPart.length)\n b.node.path = b.prefix.slice(commonPart.length)\n b.prefix = b.prefix.slice(commonPart.length)\n b.node.parent = a.node\n a.node.forks.set(remainingB[0], b)\n\n return a\n }\n\n if (commonPart.length === b.prefix.length) {\n const remainingA = a.prefix.slice(commonPart.length)\n a.node.path = a.prefix.slice(commonPart.length)\n a.prefix = a.prefix.slice(commonPart.length)\n a.node.parent = b.node\n b.node.forks.set(remainingA[0], a)\n\n return b\n }\n\n const node = new MantarayNode({ path: commonPart })\n\n const newAFork = new Fork(a.prefix.slice(commonPart.length), a.node)\n const newBFork = new Fork(b.prefix.slice(commonPart.length), b.node)\n\n a.node.path = a.prefix.slice(commonPart.length)\n b.node.path = b.prefix.slice(commonPart.length)\n a.prefix = a.prefix.slice(commonPart.length)\n b.prefix = b.prefix.slice(commonPart.length)\n\n node.forks.set(newAFork.prefix[0], newAFork)\n node.forks.set(newBFork.prefix[0], newBFork)\n\n newAFork.node.parent = node\n newBFork.node.parent = node\n\n return new Fork(commonPart, node)\n }\n\n marshal(): Uint8Array {\n if (!this.node.selfAddress) {\n throw Error('Fork#marshal node.selfAddress is not set')\n }\n const data: Uint8Array[] = []\n data.push(new Uint8Array([this.node.determineType()]))\n data.push(Binary.numberToUint8(this.prefix.length))\n data.push(this.prefix)\n\n if (this.prefix.length < 30) {\n data.push(new Uint8Array(30 - this.prefix.length))\n }\n data.push(this.node.selfAddress)\n\n debug('marshalling fork', {\n prefixLength: this.prefix.length,\n prefix: DECODER.decode(this.prefix),\n address: Binary.uint8ArrayToHex(this.node.selfAddress),\n })\n\n if (this.node.metadata) {\n const metadataBytes = Binary.padEndToMultiple(\n new Uint8Array([0x00, 0x00, ...ENCODER.encode(JSON.stringify(this.node.metadata))]),\n 32,\n 0x0a,\n )\n const metadataLengthBytes = Binary.numberToUint16(metadataBytes.length - 2, 'BE')\n metadataBytes.set(metadataLengthBytes, 0)\n data.push(metadataBytes)\n }\n\n return Binary.concatBytes(...data)\n }\n\n static unmarshal(reader: Uint8ArrayReader, addressLength: number): Fork {\n const type = Binary.uint8ToNumber(reader.read(1))\n const prefixLength = Binary.uint8ToNumber(reader.read(1))\n const prefix = reader.read(prefixLength)\n\n if (prefixLength < 30) {\n reader.read(30 - prefixLength)\n }\n const selfAddress = reader.read(addressLength)\n debug('unmarshalling fork', {\n type,\n prefixLength,\n prefix: DECODER.decode(prefix),\n addressLength,\n address: Binary.uint8ArrayToHex(selfAddress),\n })\n let metadata: Record<string, string> | undefined = undefined\n\n if (isType(type, TYPE_WITH_METADATA)) {\n const metadataLength = Binary.uint16ToNumber(reader.read(2), 'BE')\n metadata = JSON.parse(DECODER.decode(reader.read(metadataLength)))\n }\n\n return new Fork(prefix, new MantarayNode({ selfAddress, metadata, path: prefix }))\n }\n}\n\ninterface MantarayNodeOptions {\n selfAddress?: Uint8Array\n targetAddress?: Uint8Array\n obfuscationKey?: Uint8Array\n metadata?: Record<string, string> | null\n path?: Uint8Array | null\n parent?: MantarayNode | null\n}\n\nexport class MantarayNode {\n public obfuscationKey: Uint8Array = new Uint8Array(32)\n public selfAddress: Uint8Array | null = null\n public targetAddress: Uint8Array = new Uint8Array(32)\n public metadata: Record<string, string> | undefined | null = null\n public path: Uint8Array = new Uint8Array(0)\n public forks: Map<number, Fork> = new Map()\n public parent: MantarayNode | null = null\n\n constructor(options?: MantarayNodeOptions) {\n if (options?.targetAddress) {\n this.targetAddress = options.targetAddress\n }\n\n if (options?.selfAddress) {\n this.selfAddress = options.selfAddress\n }\n\n if (options?.metadata) {\n this.metadata = options.metadata\n }\n\n if (options?.obfuscationKey) {\n this.obfuscationKey = options.obfuscationKey\n }\n\n if (options?.path) {\n this.path = options.path\n }\n\n if (options?.parent) {\n this.parent = options.parent\n }\n }\n\n get fullPath(): Uint8Array {\n return Binary.concatBytes(this.parent?.fullPath ?? new Uint8Array(0), this.path)\n }\n\n get fullPathString(): string {\n return DECODER.decode(this.fullPath)\n }\n\n /**\n * Returns the metadata at the `/` path to access idiomatic properties.\n */\n getRootMetadata(): Optional<Record<string, string>> {\n const node = this.find('/')\n\n if (node && node.metadata) {\n return Optional.of(node.metadata)\n }\n\n return Optional.empty()\n }\n\n /**\n * Returns the `swarm-index-document` and `swarm-error-document` metadata values.\n */\n getDocsMetadata(): {\n indexDocument: string | null\n errorDocument: string | null\n } {\n const node = this.find('/')\n\n if (!node || !node.metadata) {\n return { indexDocument: null, errorDocument: null }\n }\n\n return {\n indexDocument: node.metadata['website-index-document'] ?? null,\n errorDocument: node.metadata['website-error-document'] ?? null,\n }\n }\n\n /**\n * Attempts to resolve the manifest as a feed, returning the latest update.\n */\n async resolveFeed(bee: Bee, requestOptions?: BeeRequestOptions): Promise<Optional<FeedPayloadResult>> {\n const node = this.find('/')\n\n if (!node || !node.metadata) {\n return Optional.empty()\n }\n\n const owner = node.metadata['swarm-feed-owner']\n const topic = node.metadata['swarm-feed-topic']\n\n if (!owner || !topic) {\n return Optional.empty()\n }\n\n return Optional.of(await bee.fetchLatestFeedUpdate(topic, owner, requestOptions))\n }\n\n /**\n * Gets the binary representation of the node.\n */\n async marshal(): Promise<Uint8Array> {\n for (const fork of this.forks.values()) {\n if (!fork.node.selfAddress) {\n fork.node.selfAddress = (await fork.node.calculateSelfAddress()).toUint8Array()\n }\n }\n const header = new Uint8Array(32)\n header.set(VERSION_02_HASH, 0)\n header.set(\n Binary.equals(this.targetAddress, NULL_ADDRESS) && Binary.equals(this.path, new Uint8Array([47]))\n ? Binary.numberToUint8(0)\n : Binary.numberToUint8(this.targetAddress.length),\n 31,\n )\n const forkBitmap = new Uint8Array(32)\n for (const fork of this.forks.keys()) {\n Binary.setBit(forkBitmap, fork, 1, 'LE')\n }\n const forks: Uint8Array[] = []\n for (let i = 0; i < 256; i++) {\n if (Binary.getBit(forkBitmap, i, 'LE')) {\n forks.push(this.forks.get(i)!.marshal())\n }\n }\n const data = Binary.xorCypher(\n Binary.concatBytes(\n header,\n Binary.equals(this.targetAddress, NULL_ADDRESS) && Binary.equals(this.path, new Uint8Array([47]))\n ? new Uint8Array(0)\n : this.targetAddress,\n forkBitmap,\n ...forks,\n ),\n this.obfuscationKey,\n )\n\n return Binary.concatBytes(this.obfuscationKey, data)\n }\n\n /**\n * Downloads and unmarshals a MantarayNode from the given reference.\n *\n * Do not forget calling `loadRecursively` on the returned node to load the entire tree.\n */\n static async unmarshal(\n bee: Bee,\n reference: Reference | Uint8Array | string,\n options?: DownloadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<MantarayNode> {\n reference = new Reference(reference)\n const data = (await bee.downloadData(reference, options, requestOptions)).toUint8Array()\n\n return this.unmarshalFromData(data, reference.toUint8Array())\n }\n\n /**\n * Unmarshals a MantarayNode from the given data.\n *\n * Do not forget calling `loadRecursively` on the returned node to load the entire tree.\n */\n static unmarshalFromData(data: Uint8Array, selfAddress: Uint8Array): MantarayNode {\n const obfuscationKey = data.subarray(0, 32)\n const decrypted = Binary.xorCypher(data.subarray(32), obfuscationKey)\n const reader = new Uint8ArrayReader(decrypted)\n const versionHash = reader.read(31)\n\n if (!Binary.equals(versionHash, VERSION_02_HASH.slice(0, 31))) {\n throw new Error('MantarayNode#unmarshal invalid version hash')\n }\n const targetAddressLength = Binary.uint8ToNumber(reader.read(1))\n const targetAddress = targetAddressLength ? reader.read(targetAddressLength) : NULL_ADDRESS\n const node = new MantarayNode({ selfAddress, targetAddress, obfuscationKey })\n const forkBitmap = reader.read(32)\n for (let i = 0; i < 256; i++) {\n if (Binary.getBit(forkBitmap, i, 'LE')) {\n const newFork = Fork.unmarshal(reader, selfAddress.length)\n node.forks.set(i, newFork)\n newFork.node.parent = node\n }\n }\n\n return node\n }\n\n /**\n * Adds a fork to the node.\n */\n addFork(\n path: string | Uint8Array,\n reference: string | Uint8Array | Bytes | Reference,\n metadata?: Record<string, string> | null,\n ) {\n this.selfAddress = null\n path = path instanceof Uint8Array ? path : ENCODER.encode(path)\n debug('adding fork', { path: DECODER.decode(path), reference: new Reference(reference).represent() })\n // TODO: this should not be ignored\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let tip: MantarayNode = this\n while (path.length) {\n const prefix = path.slice(0, 30)\n path = path.slice(30)\n const isLast = path.length === 0\n\n const [bestMatch, matchedPath] = tip.findClosest(prefix)\n const remainingPath = prefix.slice(matchedPath.length)\n\n if (matchedPath.length) {\n tip = bestMatch\n }\n\n if (!remainingPath.length) {\n continue\n }\n\n const newFork = new Fork(\n remainingPath,\n new MantarayNode({\n targetAddress: isLast ? new Reference(reference).toUint8Array() : undefined,\n metadata: isLast ? metadata : undefined,\n path: remainingPath,\n }),\n )\n\n const existing = bestMatch.forks.get(remainingPath[0])\n\n if (existing) {\n const fork = Fork.split(newFork, existing)\n tip.forks.set(remainingPath[0], fork)\n fork.node.parent = tip\n tip.selfAddress = null\n tip = newFork.node\n } else {\n tip.forks.set(remainingPath[0], newFork)\n newFork.node.parent = tip\n tip.selfAddress = null\n tip = newFork.node\n }\n }\n }\n\n /**\n * Removes a fork from the node.\n */\n removeFork(path: string | Uint8Array) {\n this.selfAddress = null\n path = path instanceof Uint8Array ? path : ENCODER.encode(path)\n\n if (path.length === 0) {\n throw Error('MantarayNode#removeFork [path] parameter cannot be empty')\n }\n\n const match = this.find(path)\n\n if (!match) {\n throw Error('MantarayNode#removeFork fork not found')\n }\n\n const [parent, matchedPath] = this.findClosest(path.slice(0, path.length - 1))\n\n parent.forks.delete(path.slice(matchedPath.length)[0])\n for (const fork of match.forks.values()) {\n parent.addFork(Binary.concatBytes(match.path, fork.prefix), fork.node.targetAddress, fork.node.metadata)\n }\n }\n\n /**\n * Calculates the self address of the node.\n */\n async calculateSelfAddress(): Promise<Reference> {\n if (this.selfAddress) {\n return new Reference(this.selfAddress)\n }\n\n return new Reference((await MerkleTree.root(await this.marshal())).hash())\n }\n\n /**\n * Saves the node and its children recursively.\n */\n async saveRecursively(\n bee: Bee,\n postageBatchId: string | BatchId,\n options?: UploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<UploadResult> {\n for (const fork of this.forks.values()) {\n const uploadResult = await fork.node.saveRecursively(bee, postageBatchId, options, requestOptions)\n\n if (options?.act) {\n let historyAddress: Reference | undefined\n uploadResult.historyAddress.ifPresent(ref => (historyAddress = ref))\n\n if (historyAddress) {\n if (!fork.node.metadata) {\n fork.node.metadata = {}\n }\n fork.node.metadata['swarm-act-history-address'] = historyAddress.toHex()\n }\n }\n }\n const result = await bee.uploadData(postageBatchId, await this.marshal(), options, requestOptions)\n this.selfAddress = result.reference.toUint8Array()\n\n return result\n }\n\n /**\n * Loads the node and its children recursively.\n */\n async loadRecursively(bee: Bee, options?: DownloadOptions, requestOptions?: BeeRequestOptions): Promise<void> {\n for (const fork of this.forks.values()) {\n if (!fork.node.selfAddress) {\n throw Error('MantarayNode#loadRecursively fork.node.selfAddress is not set')\n }\n\n let downloadOptions = options\n\n if (fork.node.metadata && fork.node.metadata['swarm-act-history-address']) {\n downloadOptions = {\n ...options,\n actHistoryAddress: fork.node.metadata['swarm-act-history-address'],\n }\n }\n\n const node = await MantarayNode.unmarshal(bee, fork.node.selfAddress, downloadOptions, requestOptions)\n fork.node.targetAddress = node.targetAddress\n fork.node.forks = node.forks\n fork.node.path = fork.prefix\n fork.node.parent = this\n await fork.node.loadRecursively(bee, options, requestOptions)\n }\n }\n\n /**\n * Finds a node in the tree by its path.\n */\n find(path: string | Uint8Array): MantarayNode | null {\n const [closest, match] = this.findClosest(path)\n\n return match.length === path.length ? closest : null\n }\n\n /**\n * Finds the closest node in the tree to the given path.\n */\n findClosest(path: string | Uint8Array, current: Uint8Array = new Uint8Array()): [MantarayNode, Uint8Array] {\n path = path instanceof Uint8Array ? path : ENCODER.encode(path)\n\n if (path.length === 0) {\n return [this, current]\n }\n\n const fork = this.forks.get(path[0])\n\n if (fork && Binary.commonPrefix(fork.prefix, path).length === fork.prefix.length) {\n return fork.node.findClosest(path.slice(fork.prefix.length), Binary.concatBytes(current, fork.prefix))\n }\n\n return [this, current]\n }\n\n /**\n * Returns an array of all nodes in the tree which have a target address set.\n *\n * Must be called after `loadRecursively`.\n */\n collect(nodes: MantarayNode[] = []): MantarayNode[] {\n for (const fork of this.forks.values()) {\n if (!Binary.equals(fork.node.targetAddress, NULL_ADDRESS)) {\n nodes.push(fork.node)\n }\n fork.node.collect(nodes)\n }\n\n return nodes\n }\n\n /**\n * Returns a path:reference map of all nodes in the tree which have a target address set.\n *\n * Must be called after `loadRecursively`.\n */\n collectAndMap(): Record<string, string> {\n const nodes = this.collect()\n const result: Record<string, string> = {}\n\n for (const node of nodes) {\n result[node.fullPathString] = new Reference(node.targetAddress).toHex()\n }\n\n return result\n }\n\n determineType() {\n let type = 0\n\n if (!Binary.equals(this.targetAddress, NULL_ADDRESS) || Binary.equals(this.path, PATH_SEPARATOR)) {\n type |= TYPE_VALUE\n }\n\n if (this.forks.size > 0) {\n type |= TYPE_EDGE\n }\n\n if (Binary.indexOf(this.path, PATH_SEPARATOR) !== -1 && !Binary.equals(this.path, PATH_SEPARATOR)) {\n type |= TYPE_WITH_PATH_SEPARATOR\n }\n\n if (this.metadata) {\n type |= TYPE_WITH_METADATA\n }\n\n return type\n }\n}\n\nfunction isType(value: number, type: number): boolean {\n return (value & type) === type\n}\n","import fs from 'fs'\nimport path from 'path'\nimport { Collection } from '../types'\n\n/**\n * Creates array in the format of Collection with data loaded from directory on filesystem.\n *\n * @param dir path to the directory\n */\nexport async function makeCollectionFromFS(dir: string): Promise<Collection> {\n if (typeof dir !== 'string') {\n throw new TypeError('dir has to be string!')\n }\n\n if (dir === '') {\n throw new TypeError('dir must not be empty string!')\n }\n\n return buildCollectionRelative(dir, '')\n}\n\nasync function buildCollectionRelative(dir: string, relativePath: string): Promise<Collection> {\n const dirname = path.join(dir, relativePath)\n const entries = await fs.promises.opendir(dirname)\n let collection: Collection = []\n\n for await (const entry of entries) {\n const fullPath = path.join(dir, relativePath, entry.name)\n const entryPath = path.join(relativePath, entry.name)\n\n if (entry.isFile()) {\n collection.push({\n path: entryPath,\n size: (await fs.promises.stat(fullPath)).size,\n fsPath: fullPath,\n })\n } else if (entry.isDirectory()) {\n collection = [...(await buildCollectionRelative(dir, entryPath)), ...collection]\n }\n }\n\n return collection\n}\n\n/**\n * Calculate folder size recursively\n *\n * @param dir the path to the folder to check\n * @returns size in bytes\n */\nexport async function getFolderSize(dir: string): Promise<number> {\n if (typeof dir !== 'string') {\n throw new TypeError('dir has to be string!')\n }\n\n if (dir === '') {\n throw new TypeError('dir must not be empty string!')\n }\n\n const entries = await fs.promises.opendir(dir)\n let size = 0\n\n for await (const entry of entries) {\n if (entry.isFile()) {\n const stats = await fs.promises.stat(path.join(dir, entry.name))\n size += stats.size\n } else if (entry.isDirectory()) {\n size += await getFolderSize(path.join(dir, entry.name))\n }\n }\n\n return size\n}\n","export const mimes: Record<string, string> = {\n aac: 'audio/aac',\n abw: 'application/x-abiword',\n ai: 'application/postscript',\n arc: 'application/octet-stream',\n avi: 'video/x-msvideo',\n azw: 'application/vnd.amazon.ebook',\n bin: 'application/octet-stream',\n bz: 'application/x-bzip',\n bz2: 'application/x-bzip2',\n csh: 'application/x-csh',\n css: 'text/css',\n csv: 'text/csv',\n doc: 'application/msword',\n dll: 'application/octet-stream',\n dmg: 'application/x-apple-diskimage',\n eot: 'application/vnd.ms-fontobject',\n epub: 'application/epub+zip',\n gif: 'image/gif',\n htm: 'text/html',\n html: 'text/html',\n ico: 'image/x-icon',\n ics: 'text/calendar',\n jar: 'application/java-archive',\n jpeg: 'image/jpeg',\n jpg: 'image/jpeg',\n js: 'application/javascript',\n json: 'application/json',\n mid: 'audio/midi',\n midi: 'audio/midi',\n mp2: 'audio/mpeg',\n mp3: 'audio/mpeg',\n mp4: 'video/mp4',\n mpa: 'video/mpeg',\n mpe: 'video/mpeg',\n mpeg: 'video/mpeg',\n mpkg: 'application/vnd.apple.installer+xml',\n odp: 'application/vnd.oasis.opendocument.presentation',\n ods: 'application/vnd.oasis.opendocument.spreadsheet',\n odt: 'application/vnd.oasis.opendocument.text',\n oga: 'audio/ogg',\n ogv: 'video/ogg',\n ogx: 'application/ogg',\n otf: 'font/otf',\n png: 'image/png',\n pdf: 'application/pdf',\n ppt: 'application/vnd.ms-powerpoint',\n rar: 'application/x-rar-compressed',\n rtf: 'application/rtf',\n sh: 'application/x-sh',\n svg: 'image/svg+xml',\n swf: 'application/x-shockwave-flash',\n tar: 'application/x-tar',\n tif: 'image/tiff',\n tiff: 'image/tiff',\n ts: 'application/typescript',\n ttf: 'font/ttf',\n txt: 'text/plain',\n vsd: 'application/vnd.visio',\n wav: 'audio/x-wav',\n weba: 'audio/webm',\n webm: 'video/webm',\n webp: 'image/webp',\n woff: 'font/woff',\n woff2: 'font/woff2',\n xhtml: 'application/xhtml+xml',\n xls: 'application/vnd.ms-excel',\n xlsx: 'application/vnd.ms-excel',\n xml: 'application/xml',\n xul: 'application/vnd.mozilla.xul+xml',\n zip: 'application/zip',\n '3gp': 'video/3gpp',\n '3gp2': 'video/3gpp2',\n '7z': 'application/x-7z-compressed',\n}\n","import { AsyncQueue, Chunk, MerkleTree, Strings } from 'cafe-utility'\nimport { createReadStream } from 'fs'\nimport { Bee, BeeRequestOptions, CollectionUploadOptions, NULL_ADDRESS, UploadOptions, UploadResult } from '..'\nimport { MantarayNode } from '../manifest/manifest'\nimport { totalChunks } from './chunk-size'\nimport { makeCollectionFromFS } from './collection.node'\nimport { mimes } from './mime'\nimport { BatchId } from './typed-bytes'\nimport { UploadProgress } from './upload-progress'\n\nexport async function hashDirectory(dir: string) {\n const files = await makeCollectionFromFS(dir)\n const mantaray = new MantarayNode()\n for (const file of files) {\n const tree = new MerkleTree(MerkleTree.NOOP)\n\n if (!file.fsPath) {\n throw Error('File does not have fsPath, which should never happen in node. Please report this issue.')\n }\n const readStream = createReadStream(file.fsPath)\n for await (const data of readStream) {\n await tree.append(data)\n }\n const rootChunk = await tree.finalize()\n const { filename, extension } = Strings.parseFilename(file.path)\n mantaray.addFork(file.path, rootChunk.hash(), {\n 'Content-Type': maybeEnrichMime(mimes[extension.toLowerCase()] || 'application/octet-stream'),\n Filename: filename,\n })\n }\n\n return mantaray.calculateSelfAddress()\n}\n\nexport async function streamDirectory(\n bee: Bee,\n dir: string,\n postageBatchId: BatchId | string | Uint8Array,\n onUploadProgress?: (progress: UploadProgress) => void,\n options?: CollectionUploadOptions,\n requestOptions?: BeeRequestOptions,\n) {\n const queue = new AsyncQueue(64, 64)\n let total = 0\n let processed = 0\n postageBatchId = new BatchId(postageBatchId)\n const files = await makeCollectionFromFS(dir)\n for (const file of files) {\n total += totalChunks(file.size)\n }\n\n let hasIndexHtml = false\n\n async function onChunk(chunk: Chunk) {\n await queue.enqueue(async () => {\n await bee.uploadChunk(postageBatchId, chunk.build(), options, requestOptions)\n onUploadProgress?.({ total, processed: ++processed })\n })\n }\n const mantaray = new MantarayNode()\n for (const file of files) {\n if (!file.fsPath) {\n throw Error('File does not have fsPath, which should never happen in node. Please report this issue.')\n }\n const readStream = createReadStream(file.fsPath)\n\n const tree = new MerkleTree(onChunk)\n for await (const data of readStream) {\n await tree.append(data)\n }\n const rootChunk = await tree.finalize()\n await queue.drain()\n const { filename, extension } = Strings.parseFilename(file.path)\n mantaray.addFork(file.path, rootChunk.hash(), {\n 'Content-Type': maybeEnrichMime(mimes[extension.toLowerCase()] || 'application/octet-stream'),\n Filename: filename,\n })\n\n if (file.path === 'index.html') {\n hasIndexHtml = true\n }\n }\n\n if (hasIndexHtml || options?.indexDocument || options?.errorDocument) {\n const metadata: Record<string, string> = {}\n\n if (options?.indexDocument) {\n metadata['website-index-document'] = options.indexDocument\n } else if (hasIndexHtml) {\n metadata['website-index-document'] = 'index.html'\n }\n\n if (options?.errorDocument) {\n metadata['website-error-document'] = options.errorDocument\n }\n mantaray.addFork('/', NULL_ADDRESS, metadata)\n }\n\n return mantaray.saveRecursively(bee, postageBatchId, options, requestOptions)\n}\n\nfunction maybeEnrichMime(mime: string) {\n if (['text/html', 'text/css'].includes(mime)) {\n return `${mime}; charset=utf-8`\n }\n\n return mime\n}\n\nexport async function streamFiles(\n _bee: Bee,\n _files: File[] | FileList,\n _postageBatchId: BatchId,\n _onUploadProgress?: (progress: UploadProgress) => void,\n _options?: UploadOptions,\n _requestOptions?: BeeRequestOptions,\n): Promise<UploadResult> {\n throw new Error('Streaming files is not supported in Node.js')\n}\n","import type { Data } from 'ws'\n\nfunction isBufferArray(buffer: unknown): buffer is Buffer[] {\n return Array.isArray(buffer) && buffer.length > 0 && buffer.every(data => data instanceof Buffer)\n}\n\nexport async function prepareWebsocketData(data: Data | Blob): Promise<Uint8Array> | never {\n if (typeof data === 'string') {\n return new TextEncoder().encode(data)\n }\n\n if (data instanceof Buffer) {\n return new Uint8Array(data)\n }\n\n if (data instanceof ArrayBuffer) {\n return new Uint8Array(data)\n }\n\n if (isBufferArray(data)) {\n return new Uint8Array(Buffer.concat(data))\n }\n\n throw new TypeError('unknown websocket data type')\n}\n","import { BeeArgumentError } from './error'\n\n/**\n * Validates that passed string is valid URL of Bee.\n * We support only HTTP and HTTPS protocols.\n *\n * @param url\n */\nexport function isValidBeeUrl(url: unknown): url is URL {\n try {\n if (typeof url !== 'string') {\n return false\n }\n\n const urlObject = new URL(url)\n\n // There can be wide range of protocols passed.\n return urlObject.protocol === 'http:' || urlObject.protocol === 'https:'\n } catch (e) {\n return false\n }\n}\n\n/**\n * Validates that passed string is valid URL of Bee, if not it throws BeeArgumentError.\n * We support only HTTP and HTTPS protocols.\n * @param url\n * @throws BeeArgumentError if non valid URL\n */\nexport function assertBeeUrl(url: unknown): asserts url is URL {\n if (!isValidBeeUrl(url)) {\n throw new BeeArgumentError('URL is not valid!', url)\n }\n}\n\n/**\n * Removes trailing slash out of the given string.\n * @param url\n */\nexport function stripLastSlash(url: string): string {\n if (url.endsWith('/')) {\n return url.slice(0, -1)\n }\n\n return url\n}\n","import { Binary, Objects, System, Types } from 'cafe-utility'\nimport { Readable } from 'stream'\nimport { Chunk, makeContentAddressedChunk, unmarshalContentAddressedChunk } from './chunk/cac'\nimport {\n SingleOwnerChunk,\n downloadSingleOwnerChunk,\n makeSOCAddress,\n makeSingleOwnerChunk,\n unmarshalSingleOwnerChunk,\n uploadSingleOwnerChunkData,\n} from './chunk/soc'\nimport { makeFeedReader, makeFeedWriter } from './feed'\nimport { areAllSequentialFeedsUpdateRetrievable } from './feed/retrievable'\nimport * as bytes from './modules/bytes'\nimport * as bzz from './modules/bzz'\nimport * as chunk from './modules/chunk'\nimport * as balance from './modules/debug/balance'\nimport * as chequebook from './modules/debug/chequebook'\nimport * as connectivity from './modules/debug/connectivity'\nimport * as settlements from './modules/debug/settlements'\nimport * as stake from './modules/debug/stake'\nimport * as stamps from './modules/debug/stamps'\nimport * as states from './modules/debug/states'\nimport * as debugStatus from './modules/debug/status'\nimport * as transactions from './modules/debug/transactions'\nimport { postEnvelope } from './modules/envelope'\nimport { FeedPayloadResult, createFeedManifest, fetchLatestFeedUpdate } from './modules/feed'\nimport * as grantee from './modules/grantee'\nimport * as gsoc from './modules/gsoc'\nimport * as pinning from './modules/pinning'\nimport * as pss from './modules/pss'\nimport { rchash } from './modules/rchash'\nimport * as status from './modules/status'\nimport * as stewardship from './modules/stewardship'\nimport * as tag from './modules/tag'\nimport type {\n AllSettlements,\n BalanceResponse,\n BeeOptions,\n BeeRequestOptions,\n BeeVersions,\n ChainState,\n ChequebookAddressResponse,\n ChequebookBalanceResponse,\n CollectionUploadOptions,\n DebugStatus,\n DownloadOptions,\n EnvelopeWithBatchId,\n FeedReader,\n FeedWriter,\n FileData,\n FileUploadOptions,\n GetGranteesResult,\n GlobalPostageBatch,\n GranteesResult,\n GsocMessageHandler,\n GsocSubscription,\n Health,\n LastCashoutActionResponse,\n LastChequesForPeerResponse,\n LastChequesResponse,\n NodeAddresses,\n NodeInfo,\n NumberString,\n Peer,\n PeerBalance,\n Pin,\n PingResponse,\n PostageBatch,\n PostageBatchBuckets,\n PssMessageHandler,\n PssSubscription,\n Readiness,\n RedistributionState,\n RedundancyLevel,\n RedundantUploadOptions,\n ReferenceInformation,\n RemovePeerResponse,\n ReserveState,\n SOCReader,\n SOCWriter,\n Settlements,\n Tag,\n Topology,\n TransactionInfo,\n UploadOptions,\n WalletBalance,\n} from './types'\nimport {\n AllTagsOptions,\n CHUNK_SIZE,\n Collection,\n PostageBatchOptions,\n STAMPS_DEPTH_MAX,\n STAMPS_DEPTH_MIN,\n TransactionOptions,\n UploadResult,\n} from './types'\nimport { Bytes } from './utils/bytes'\nimport { hashDirectory, streamDirectory, streamFiles } from './utils/chunk-stream'\nimport { assertCollection, makeCollectionFromFileList } from './utils/collection'\nimport { makeCollectionFromFS } from './utils/collection.node'\nimport { prepareWebsocketData } from './utils/data'\nimport { Duration } from './utils/duration'\nimport { BeeArgumentError, BeeError } from './utils/error'\nimport { fileArrayBuffer, isFile } from './utils/file'\nimport { ResourceLocator } from './utils/resource-locator'\nimport { Size } from './utils/size'\nimport { getAmountForDuration, getDepthForSize, getStampCost } from './utils/stamps'\nimport { BZZ, DAI } from './utils/tokens'\nimport {\n asNumberString,\n assertData,\n assertFileData,\n makeTagUid,\n prepareAllTagsOptions,\n prepareBeeRequestOptions,\n prepareCollectionUploadOptions,\n prepareDownloadOptions,\n prepareFileUploadOptions,\n prepareGsocMessageHandler,\n preparePostageBatchOptions,\n preparePssMessageHandler,\n prepareRedundantUploadOptions,\n prepareTransactionOptions,\n prepareUploadOptions,\n} from './utils/type'\nimport {\n BatchId,\n EthAddress,\n FeedIndex,\n Identifier,\n PeerAddress,\n PrivateKey,\n PublicKey,\n Reference,\n Signature,\n Span,\n Topic,\n TransactionId,\n} from './utils/typed-bytes'\nimport { UploadProgress } from './utils/upload-progress'\nimport { assertBeeUrl, stripLastSlash } from './utils/url'\n\n/**\n * The main component that abstracts operations available on the Bee API.\n *\n * Instantiate with `new Bee(url, options)` where `url` is the Bee node URL and `options` are optional parameters.\n *\n * @example\n * const bee = new Bee('http://localhost:1633')\n */\nexport class Bee {\n /**\n * Bee node API URL.\n *\n * @example\n * `http://localhost:1633`\n */\n public readonly url: string\n\n /**\n * Default signer (a private key) used for signing.\n *\n * Mainly used in single-owner chunk (SOC) related operations, and consequently in feeds.\n *\n * If not provided, methods such as `makeFeedWriter` and `makeSOCWriter`\n * must be provided with a private key in their respective function calls.\n */\n public readonly signer?: PrivateKey\n\n /**\n * Network on which the Bee node is running.\n *\n * This is currently used to determine block time for postage batch time-to-live (TTL) calculations.\n * The block time for `gnosis` is `5` seconds, and for `sepolia` it is `15` seconds.\n *\n * @default 'gnosis'\n */\n public readonly network: 'gnosis' | 'sepolia'\n\n /**\n * Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n private readonly requestOptions: BeeRequestOptions\n\n /**\n * @param url URL on which is the main API of Bee node exposed\n * @param options\n *\n * @example\n * const bee = new Bee('http://localhost:1633')\n */\n constructor(url: string, options?: BeeOptions) {\n assertBeeUrl(url)\n\n this.url = stripLastSlash(url)\n\n if (options?.signer) {\n this.signer = new PrivateKey(options.signer)\n }\n\n this.network = options?.network ?? 'gnosis'\n\n this.requestOptions = {\n baseURL: this.url,\n timeout: options?.timeout ?? 0,\n headers: options?.headers,\n onRequest: options?.onRequest,\n httpAgent: options?.httpAgent,\n httpsAgent: options?.httpsAgent,\n }\n }\n\n /**\n * Uploads raw data to the network (as opposed to uploading chunks or files).\n *\n * Data uploaded with this method should be retrieved with the {@link downloadData} method.\n *\n * @param postageBatchId Usable Postage Batch ID with sufficient capacity to upload the data.\n * @param data A `string` (text data) or `Uint8Array` (raw data) to be uploaded.\n * @param options Additional options like tag, encryption, pinning, content-type and request options.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @returns reference is a content hash of the data\n *\n * @see [Bee API reference - `POST /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes/post)\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n */\n async uploadData(\n postageBatchId: BatchId | Uint8Array | string,\n data: string | Uint8Array,\n options?: RedundantUploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<UploadResult> {\n postageBatchId = new BatchId(postageBatchId)\n assertData(data)\n\n if (options) {\n options = prepareRedundantUploadOptions(options)\n }\n\n return bytes.upload(this.getRequestOptionsForCall(requestOptions), data, postageBatchId, options)\n }\n\n /**\n * Fetches content length for a `/bytes` reference.\n *\n * @param reference\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee API reference - `HEAD /bytes/{reference}`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1%7Breference%7D/head)\n */\n async probeData(\n reference: Reference | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<ReferenceInformation> {\n reference = new Reference(reference)\n\n return bytes.head(this.getRequestOptionsForCall(requestOptions), reference)\n }\n\n /**\n * Downloads raw data through the `GET /bytes/{reference}` endpoint.\n *\n * This method may be used to download data that was uploaded with the {@link uploadData} method.\n *\n * For downloading files or using the `GET /bzz/{reference}/` endpoint, use the {@link downloadFile} method instead.\n * For downloading chunks or using the `GET /chunks/{reference} endpoint, use the `downloadChunk` method instead.\n *\n * @param resource Swarm reference, Swarm CID, or ENS domain.\n * @param options Options that affects the request behavior\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @throws TypeError if some of the input parameters is not expected type\n * @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters\n *\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n * @see [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get)\n */\n async downloadData(\n resource: Reference | string | Uint8Array,\n options?: DownloadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<Bytes> {\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n return bytes.download(this.getRequestOptionsForCall(requestOptions), new ResourceLocator(resource), options)\n }\n\n /**\n * Download raw data through the `GET /bytes/{reference}` endpoint.\n *\n * This method may be used to download data that was uploaded with the {@link uploadData} method.\n *\n * Only tested in Node.js environment.\n *\n * @param resource Swarm reference, Swarm CID, or ENS domain.\n * @param options Options that affects the request behavior.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @returns ReadableStream of Uint8Array\n *\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n * @see [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get)\n */\n async downloadReadableData(\n resource: Reference | Uint8Array | string,\n options?: DownloadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<ReadableStream<Uint8Array>> {\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n return bytes.downloadReadable(this.getRequestOptionsForCall(requestOptions), new ResourceLocator(resource), options)\n }\n\n /**\n * Uploads a chunk to the network.\n *\n * Chunks uploaded with this method should be retrieved with the {@link downloadChunk} method.\n *\n * @param stamp Postage Batch ID or an Envelope created with the {@link createEnvelope} method.\n * @param data Raw chunk to be uploaded (Content Addressed Chunk or Single Owner Chunk)\n * @param options Additional options like tag, encryption, pinning, content-type and request options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @returns reference is a content hash of the data\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n * @see [Bee API reference - `POST /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post)\n */\n async uploadChunk(\n stamp: EnvelopeWithBatchId | BatchId | Uint8Array | string,\n data: Uint8Array | Chunk | SingleOwnerChunk,\n options?: UploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<UploadResult> {\n const isSOC = 'identifier' in data && 'signature' in data && 'owner' in data\n\n data = data instanceof Uint8Array ? data : data.data\n\n if (options) {\n options = prepareUploadOptions(options)\n }\n\n if (data.length < Span.LENGTH) {\n throw new BeeArgumentError(`Chunk has to have size of at least ${Span.LENGTH}.`, data)\n }\n\n if (!isSOC && data.length > CHUNK_SIZE + Span.LENGTH) {\n throw new BeeArgumentError(`Content Addressed Chunk must not exceed ${CHUNK_SIZE + Span.LENGTH} bytes.`, data)\n }\n\n if (isSOC && data.length > CHUNK_SIZE + Span.LENGTH + Signature.LENGTH + Identifier.LENGTH) {\n throw new BeeArgumentError(\n `Single Owner Chunk must not exceed ${CHUNK_SIZE + Span.LENGTH + Signature.LENGTH + Identifier.LENGTH} bytes.`,\n data,\n )\n }\n\n return chunk.upload(this.getRequestOptionsForCall(requestOptions), data, stamp, options)\n }\n\n /**\n * Downloads a chunk as a `Uint8Array`.\n *\n * May be used to download chunks uploaded with the {@link uploadChunk} method.\n *\n * Use {@link downloadData} method to download raw data uploaded with the {@link uploadData} method.\n * Use {@link downloadFile} method to download files uploaded with the {@link uploadFile} method.\n *\n * @param reference Bee chunk reference in hex string (either 64 or 128 chars long) or ENS domain.\n * @param options Options that affects the request behavior\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n * @see [Bee API reference - `GET /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks~1{address}/get)\n */\n async downloadChunk(\n reference: Reference | Uint8Array | string,\n options?: DownloadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<Uint8Array> {\n reference = new Reference(reference)\n\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n return chunk.download(this.getRequestOptionsForCall(requestOptions), reference, options)\n }\n\n /**\n * Create a grantees list from the given array of public keys.\n *\n * The grantees list can be obtained with the {@link getGrantees} method.\n *\n * @param postageBatchId - The ID of the postage batch.\n * @param grantees - An array of public keys representing the grantees.\n * @param requestOptions - Optional request options.\n * @returns A promise that resolves to a `GranteesResult` object.\n */\n async createGrantees(\n postageBatchId: BatchId | Uint8Array | string,\n grantees: PublicKey[] | Uint8Array[] | string[],\n requestOptions?: BeeRequestOptions,\n ): Promise<GranteesResult> {\n postageBatchId = new BatchId(postageBatchId)\n grantees = grantees.map(x => new PublicKey(x))\n\n return grantee.createGrantees(this.getRequestOptionsForCall(requestOptions), postageBatchId, grantees)\n }\n\n /**\n * Retrieves the grantees for a given reference.\n *\n * @param reference - The reference.\n * @param requestOptions - Optional request options.\n * @returns A promise that resolves to a `GetGranteesResult` object.\n */\n async getGrantees(\n reference: Reference | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<GetGranteesResult> {\n reference = new Reference(reference)\n\n return grantee.getGrantees(reference, this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Updates the grantees of a specific reference and history.\n *\n * @param reference - The reference.\n * @param history - The history.\n * @param postageBatchId - The ID of the postage batch.\n * @param grantees - The grantees.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns A Promise that resolves to to a `GranteesResult` object.\n */\n async patchGrantees(\n postageBatchId: BatchId | Uint8Array | string,\n reference: Reference | Uint8Array | string,\n history: Reference | Uint8Array | string,\n grantees: { add?: PublicKey[] | Uint8Array[] | string[]; revoke?: PublicKey[] | Uint8Array[] | string[] },\n requestOptions?: BeeRequestOptions,\n ): Promise<GranteesResult> {\n postageBatchId = new BatchId(postageBatchId)\n reference = new Reference(reference)\n history = new Reference(history)\n\n const publicKeys = {\n add: grantees.add?.map(x => new PublicKey(x)) ?? [],\n revoke: grantees.revoke?.map(x => new PublicKey(x)) ?? [],\n }\n\n return grantee.patchGrantees(\n postageBatchId,\n reference,\n history,\n publicKeys,\n this.getRequestOptionsForCall(requestOptions),\n )\n }\n\n /**\n * Uploads a single file to a Bee node.\n *\n * To download the file, use the {@link downloadFile} method.\n *\n * Use {@link uploadData} method to upload raw data that can be downloaded with the {@link downloadData} method.\n * Use {@link uploadChunk} method to upload chunks that can be downloaded with the {@link downloadChunk} method.\n *\n * @param postageBatchId Postage BatchId to be used to upload the data with\n * @param data Data or file to be uploaded\n * @param name Optional name of the uploaded file\n * @param options Additional options like tag, encryption, pinning, content-type and request options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n * @returns reference is a content hash of the file\n */\n async uploadFile(\n postageBatchId: BatchId | Uint8Array | string,\n data: string | Uint8Array | Readable | File,\n name?: string,\n options?: FileUploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<UploadResult> {\n postageBatchId = new BatchId(postageBatchId)\n assertFileData(data)\n\n if (options) {\n options = prepareFileUploadOptions(options)\n }\n\n if (name && typeof name !== 'string') {\n throw new TypeError('name has to be string or undefined!')\n }\n\n if (isFile(data)) {\n const fileData = await fileArrayBuffer(data)\n const fileName = name ?? data.name\n const contentType = data.type\n const fileOptions = { contentType, ...options }\n\n return bzz.uploadFile(\n this.getRequestOptionsForCall(requestOptions),\n fileData,\n postageBatchId,\n fileName,\n fileOptions,\n )\n } else {\n return bzz.uploadFile(this.getRequestOptionsForCall(requestOptions), data, postageBatchId, name, options)\n }\n }\n\n /**\n * Downloads a single file.\n *\n * @param resource Swarm reference, Swarm CID, or ENS domain.\n * @param path If reference points to manifest, then this parameter defines path to the file\n * @param options Options that affects the request behavior\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n * @see [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get)\n */\n async downloadFile(\n resource: Reference | Uint8Array | string,\n path = '',\n options?: DownloadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<FileData<Bytes>> {\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n return bzz.downloadFile(this.getRequestOptionsForCall(requestOptions), new ResourceLocator(resource), path, options)\n }\n\n /**\n * Download single file as a readable stream\n *\n * @param reference Bee file reference in hex string (either 64 or 128 chars long), ENS domain or Swarm CID.\n * @param path If reference points to manifest / collections, then this parameter defines path to the file\n * @param options Options that affects the request behavior\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)\n * @see [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get)\n */\n async downloadReadableFile(\n reference: Reference | Uint8Array | string,\n path = '',\n options?: DownloadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<FileData<ReadableStream<Uint8Array>>> {\n reference = new Reference(reference)\n\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n return bzz.downloadFileReadable(this.getRequestOptionsForCall(requestOptions), reference, path, options)\n }\n\n /**\n * Upload collection of files to a Bee node\n *\n * Uses the FileList API from the browser.\n *\n * The returned `UploadResult.tag` might be undefined if called in CORS-enabled environment.\n * This will be fixed upon next Bee release. https://github.com/ethersphere/bee-js/issues/406\n *\n * @param postageBatchId Postage BatchId to be used to upload the data with\n * @param fileList list of files to be uploaded\n * @param options Additional options like tag, encryption, pinning and request options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee docs - Upload directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory)\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n */\n async uploadFiles(\n postageBatchId: BatchId | Uint8Array | string,\n fileList: FileList | File[],\n options?: CollectionUploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<UploadResult> {\n postageBatchId = new BatchId(postageBatchId)\n\n if (options) {\n options = prepareCollectionUploadOptions(options)\n }\n\n const data = makeCollectionFromFileList(fileList)\n\n return bzz.uploadCollection(this.getRequestOptionsForCall(requestOptions), data, postageBatchId, options)\n }\n\n /**\n * Hashes a directory locally and returns the root hash (Swarm reference).\n *\n * The actual Swarm reference may be different as there is no canonical hashing of directories.\n * For example, metadata may have different casing, or the order of metadata may differ.\n * Such small differences will result in different Swarm references.\n *\n * Different implementations of the Mantaray structure may also result in different Swarm references.\n *\n * @param dir\n * @returns\n */\n async hashDirectory(dir: string) {\n return hashDirectory(dir)\n }\n\n /**\n * Uploads a directory to the network. The difference between this method and {@link uploadFilesFromDirectory} is that\n * this method streams the directory contents directly to the Bee node, which supports arbitrary directory sizes,\n * but may be slower due to uploading chunks one by one.\n *\n * Options such as encryption, erasure coding and ACT are not yet available for this method.\n *\n * Only intended for the Node.js environment.\n *\n * @param postageBatchId\n * @param dir\n * @param onUploadProgress\n * @param options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async streamDirectory(\n postageBatchId: BatchId | Uint8Array | string,\n dir: string,\n onUploadProgress?: (progress: UploadProgress) => void,\n options?: CollectionUploadOptions,\n requestOptions?: BeeRequestOptions,\n ) {\n postageBatchId = new BatchId(postageBatchId)\n\n return streamDirectory(\n this,\n dir,\n postageBatchId,\n onUploadProgress,\n options,\n this.getRequestOptionsForCall(requestOptions),\n )\n }\n\n /**\n * Uploads a collection of files to the network. The difference between this method and {@link uploadFiles} is that\n * this method streams the files to the Bee node, which supports arbitrary sizes,\n * but may be slower due to uploading chunks one by one.\n *\n * Options such as encryption, erasure coding and ACT are not yet available for this method.\n *\n * Only intended for the browser environment.\n *\n * @param postageBatchId\n * @param files\n * @param onUploadProgress\n * @param options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async streamFiles(\n postageBatchId: BatchId | Uint8Array | string,\n files: File[] | FileList,\n onUploadProgress?: (progress: UploadProgress) => void,\n options?: UploadOptions,\n requestOptions?: BeeRequestOptions,\n ) {\n postageBatchId = new BatchId(postageBatchId)\n\n return streamFiles(\n this,\n files,\n postageBatchId,\n onUploadProgress,\n options,\n this.getRequestOptionsForCall(requestOptions),\n )\n }\n\n /**\n * Upload Collection that you can assembly yourself.\n *\n * The returned `UploadResult.tag` might be undefined if called in CORS-enabled environment.\n * This will be fixed upon next Bee release. https://github.com/ethersphere/bee-js/issues/406\n *\n * @param postageBatchId\n * @param collection\n * @param options Collections and request options\n */\n async uploadCollection(\n postageBatchId: BatchId | Uint8Array | string,\n collection: Collection,\n options?: CollectionUploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<UploadResult> {\n postageBatchId = new BatchId(postageBatchId)\n assertCollection(collection)\n\n if (options) {\n options = prepareCollectionUploadOptions(options)\n }\n\n return bzz.uploadCollection(this.getRequestOptionsForCall(requestOptions), collection, postageBatchId, options)\n }\n\n /**\n * Upload collection of files.\n *\n * Available only in Node.js as it uses the `fs` module.\n *\n * The returned `UploadResult.tag` might be undefined if called in CORS-enabled environment.\n * This will be fixed upon next Bee release. https://github.com/ethersphere/bee-js/issues/406\n *\n * @param postageBatchId Postage BatchId to be used to upload the data with\n * @param dir the path of the files to be uploaded\n * @param options Additional options like tag, encryption, pinning and request options\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee docs - Upload directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory)\n * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)\n */\n async uploadFilesFromDirectory(\n postageBatchId: BatchId | Uint8Array | string,\n dir: string,\n options?: CollectionUploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<UploadResult> {\n postageBatchId = new BatchId(postageBatchId)\n\n if (options) {\n options = prepareCollectionUploadOptions(options)\n }\n\n const data = await makeCollectionFromFS(dir)\n\n return bzz.uploadCollection(this.getRequestOptionsForCall(requestOptions), data, postageBatchId, options)\n }\n\n /**\n * Creates a new Tag which is meant for tracking upload and synchronization progress.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)\n * @see [Bee API reference - `POST /tags`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/post)\n */\n async createTag(requestOptions?: BeeRequestOptions): Promise<Tag> {\n return tag.createTag(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Fetches all tags in a paginated manner.\n *\n * The listing is limited by options.limit. So you have to iterate using options.offset to get all tags.\n *\n * @param options Specify `limit` and `offset` to paginate through the tags.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)\n * @see [Bee API reference - `GET /tags`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/get)\n */\n async getAllTags(options?: AllTagsOptions, requestOptions?: BeeRequestOptions): Promise<Tag[]> {\n if (options) {\n options = prepareAllTagsOptions(options)\n }\n\n return tag.getAllTags(this.getRequestOptionsForCall(requestOptions), options?.offset, options?.limit)\n }\n\n /**\n * Retrieves tag information from Bee node.\n *\n * @param tagUid UID or tag object to be retrieved\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)\n * @see [Bee API reference - `GET /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/get)\n *\n */\n async retrieveTag(tagUid: number | Tag, requestOptions?: BeeRequestOptions): Promise<Tag> {\n tagUid = makeTagUid(tagUid)\n\n return tag.retrieveTag(this.getRequestOptionsForCall(requestOptions), tagUid)\n }\n\n /**\n * Deletes Tag.\n *\n * @param tagUid UID or tag object to be retrieved\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)\n * @see [Bee API reference - `DELETE /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/delete)\n */\n async deleteTag(tagUid: number | Tag, requestOptions?: BeeRequestOptions): Promise<void> {\n tagUid = makeTagUid(tagUid)\n\n return tag.deleteTag(this.getRequestOptionsForCall(requestOptions), tagUid)\n }\n\n /**\n * Update tag's total chunks count.\n *\n * This is important if you are uploading individual chunks with a tag. Then upon finishing the final root chunk,\n * you can use this method to update the total chunks count for the tag.\n *\n * @param tagUid UID or tag object to be retrieved\n * @param reference The root reference that contains all the chunks to be counted\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)\n * @see [Bee API reference - `PATCH /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/patch)\n */\n async updateTag(\n tagUid: number | Tag,\n reference: Reference | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<void> {\n reference = new Reference(reference)\n\n tagUid = makeTagUid(tagUid)\n\n return tag.updateTag(this.getRequestOptionsForCall(requestOptions), tagUid, reference)\n }\n\n /**\n * Pins local data with given reference.\n *\n * @param reference Data reference\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)\n */\n async pin(reference: Reference | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<void> {\n reference = new Reference(reference)\n\n return pinning.pin(this.getRequestOptionsForCall(requestOptions), reference)\n }\n\n /**\n * Unpins local data with given reference.\n *\n * @param reference Data reference\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)\n */\n async unpin(reference: Reference | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<void> {\n reference = new Reference(reference)\n\n return pinning.unpin(this.getRequestOptionsForCall(requestOptions), reference)\n }\n\n /**\n * Gets list of all locally pinned references.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)\n */\n async getAllPins(requestOptions?: BeeRequestOptions): Promise<Reference[]> {\n return pinning.getAllPins(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Get pinning status of chunk with given reference\n *\n * @param reference Bee data reference in hex string (either 64 or 128 chars long) or ENS domain.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)\n */\n async getPin(reference: Reference | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<Pin> {\n reference = new Reference(reference)\n\n return pinning.getPin(this.getRequestOptionsForCall(requestOptions), reference)\n }\n\n /**\n * Instructs the Bee node to reupload a locally pinned data into the network.\n *\n * @param postageBatchId Postage Batch ID that will be used to re-upload the data.\n * @param reference Bee data reference to be re-uploaded in hex string (either 64 or 128 chars long) or ENS domain.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee API reference - `PUT /stewardship`](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1{reference}/put)\n */\n async reuploadPinnedData(\n postageBatchId: BatchId | Uint8Array | string,\n reference: Reference | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<void> {\n postageBatchId = new BatchId(postageBatchId)\n reference = new Reference(reference)\n\n await stewardship.reupload(this.getRequestOptionsForCall(requestOptions), postageBatchId, reference)\n }\n\n /**\n * Checks if content specified by reference is retrievable from the network.\n *\n * @param reference Bee data reference to be checked in hex string (either 64 or 128 chars long) or ENS domain.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee API reference - `GET /stewardship`](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1{reference}/get)\n */\n async isReferenceRetrievable(\n reference: Reference | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<boolean> {\n reference = new Reference(reference)\n\n return stewardship.isRetrievable(this.getRequestOptionsForCall(requestOptions), reference)\n }\n\n /**\n * Functions that validate if feed is retrievable in the network.\n *\n * If no index is passed then it check for \"latest\" update, which is a weaker guarantee as nobody can be really\n * sure what is the \"latest\" update.\n *\n * If index is passed then it validates all previous sequence index chunks if they are available as they are required\n * to correctly resolve the feed upto the given index update.\n *\n * @param type\n * @param owner\n * @param topic\n * @param index\n * @param options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async isFeedRetrievable(\n owner: EthAddress | Uint8Array | string,\n topic: Topic | Uint8Array | string,\n index?: FeedIndex,\n options?: DownloadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<boolean> {\n owner = new EthAddress(owner)\n topic = new Topic(topic)\n\n if (options) {\n options = prepareDownloadOptions(options)\n }\n\n if (!index) {\n try {\n await this.makeFeedReader(topic, owner, requestOptions).download()\n\n return true\n } catch (e: unknown) {\n const status = Objects.getDeep(e, 'status')\n\n if (status === 404 || status === 500) {\n return false\n }\n\n throw e\n }\n }\n\n return areAllSequentialFeedsUpdateRetrievable(\n this,\n owner,\n topic,\n index,\n options,\n this.getRequestOptionsForCall(requestOptions),\n )\n }\n\n /**\n * Send data to recipient or target with Postal Service for Swarm.\n *\n * Because sending a PSS message is slow and CPU intensive,\n * it is not supposed to be used for general messaging but\n * most likely for setting up an encrypted communication\n * channel by sending an one-off message.\n *\n * **Warning! Only full nodes can accept PSS messages.**\n *\n * @param postageBatchId Postage BatchId that will be assigned to sent message\n * @param topic Topic name\n * @param target Target message address prefix. Has a limit on length. Recommend to use `Utils.Pss.makeMaxTarget()` to get the most specific target that Bee node will accept.\n * @param data Message to be sent\n * @param recipient Recipient public key\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)\n * @see [Bee API reference - `POST /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1send~1{topic}~1{targets}/post)\n */\n async pssSend(\n postageBatchId: BatchId | Uint8Array | string,\n topic: Topic,\n target: string,\n data: string | Uint8Array,\n recipient?: string | PublicKey,\n requestOptions?: BeeRequestOptions,\n ): Promise<void> {\n postageBatchId = new BatchId(postageBatchId)\n assertData(data)\n\n if (recipient) {\n recipient = new PublicKey(recipient)\n\n return pss.send(this.getRequestOptionsForCall(requestOptions), topic, target, data, postageBatchId, recipient)\n } else {\n return pss.send(this.getRequestOptionsForCall(requestOptions), topic, target, data, postageBatchId)\n }\n }\n\n /**\n * Subscribes to messages for given topic with the Postal Service for Swarm.\n *\n * **Warning! Only full nodes can accept PSS messages.**\n *\n * @param topic Topic name\n * @param handler Message handler interface\n *\n * @returns Subscription to a given topic\n *\n * @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)\n * @see [Bee API reference - `GET /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1{topic}/get)\n */\n pssSubscribe(topic: Topic, handler: PssMessageHandler): PssSubscription {\n handler = preparePssMessageHandler(handler)\n\n const ws = pss.subscribe(this.url, topic, this.requestOptions.headers)\n\n let cancelled = false\n const cancel = () => {\n if (!cancelled) {\n cancelled = true\n\n if (ws.terminate) {\n ws.terminate()\n } else {\n ws.close()\n }\n }\n }\n\n const subscription = {\n topic,\n cancel,\n }\n\n ws.onmessage = async event => {\n const data = await prepareWebsocketData(event.data)\n\n if (data.length) {\n handler.onMessage(new Bytes(data), subscription)\n }\n }\n ws.onerror = event => {\n if (!cancelled) {\n handler.onError(new BeeError(event.message), subscription)\n }\n }\n ws.onclose = () => {\n handler.onClose(subscription)\n }\n\n return subscription\n }\n\n /**\n * Receives message using the Postal Service for Swarm.\n *\n * This is a helper function to wait for exactly one message to\n * arrive and then cancel the subscription. Additionally a\n * timeout can be provided for the message to arrive or else\n * an error will be thrown.\n *\n * **Warning! Only full nodes can accept PSS messages.**\n *\n * @param topic Topic name\n * @param timeoutMsec Timeout in milliseconds\n *\n * @returns Message in byte array\n *\n * @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)\n * @see [Bee API reference - `GET /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1{topic}/get)\n */\n async pssReceive(topic: Topic, timeoutMsec = 0): Promise<Bytes> {\n if (typeof timeoutMsec !== 'number') {\n throw new TypeError('timeoutMsc parameter has to be a number!')\n }\n\n return new Promise((resolve, reject) => {\n let timeout: ReturnType<typeof setTimeout> | undefined\n const subscription = this.pssSubscribe(topic, {\n onError: error => {\n clearTimeout(timeout)\n subscription.cancel()\n reject(error.message)\n },\n onMessage: message => {\n clearTimeout(timeout)\n subscription.cancel()\n resolve(message)\n },\n onClose: () => {\n clearTimeout(timeout)\n subscription.cancel()\n },\n })\n\n if (timeoutMsec > 0) {\n timeout = setTimeout(() => {\n subscription.cancel()\n reject(new BeeError('pssReceive timeout'))\n }, timeoutMsec)\n }\n })\n }\n\n /**\n * Mines the signer (a private key) to be used to send GSOC messages to the specific target overlay address.\n *\n * Use {@link gsocSend} to send GSOC messages with the mined signer.\n *\n * Use {@link gsocSubscribe} to subscribe to GSOC messages for the specified owner (of the signer) and identifier.\n *\n * See {@link gsocSend} or {@link gsocSubscribe} for concrete examples of usage.\n *\n * **Warning! Only full nodes can accept GSOC messages.**\n *\n * @param targetOverlay\n * @param identifier\n * @param proximity\n * @returns\n */\n gsocMine(\n targetOverlay: PeerAddress | Uint8Array | string,\n identifier: Identifier | Uint8Array | string,\n proximity = 12,\n ): PrivateKey {\n targetOverlay = new PeerAddress(targetOverlay)\n identifier = new Identifier(identifier)\n const start = 0xb33n\n for (let i = 0n; i < 0xffffn; i++) {\n const signer = new PrivateKey(Binary.numberToUint256(start + i, 'BE'))\n const socAddress = makeSOCAddress(identifier, signer.publicKey().address())\n // TODO: test the significance of the hardcoded 256\n const actualProximity = 256 - Binary.proximity(socAddress.toUint8Array(), targetOverlay.toUint8Array())\n\n if (actualProximity <= 256 - proximity) {\n return signer\n }\n }\n throw Error('Could not mine a valid signer')\n }\n\n /**\n * Sends a GSOC message with the specified signer and identifier.\n *\n * Use {@link gsocMine} to mine a signer for the target overlay address.\n *\n * Use {@link gsocSubscribe} to subscribe to GSOC messages for the specified owner (of the signer) and identifier.\n *\n * **Warning! Only full nodes can accept GSOC messages.**\n *\n * @param postageBatchId\n * @param signer\n * @param identifier\n * @param data\n * @param options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n *\n * @example\n * const identifier = NULL_IDENTIFIER\n * const overlay = '0x1234567890123456789012345678901234567890'\n * const signer = bee.gsocMine(overlay, identifier)\n * await bee.gsocSend(postageBatchId, signer, identifier, 'GSOC!')\n */\n async gsocSend(\n postageBatchId: BatchId | Uint8Array | string,\n signer: PrivateKey | Uint8Array | string,\n identifier: Identifier | Uint8Array | string,\n data: string | Uint8Array,\n options?: UploadOptions,\n requestOptions?: BeeRequestOptions,\n ) {\n postageBatchId = new BatchId(postageBatchId)\n signer = new PrivateKey(signer)\n identifier = new Identifier(identifier)\n\n const cac = makeContentAddressedChunk(data)\n const soc = cac.toSingleOwnerChunk(identifier, signer)\n\n return gsoc.send(this.getRequestOptionsForCall(requestOptions), soc, postageBatchId, options)\n }\n\n /**\n * Subscribes to GSOC messages for the specified owner (of the signer) and identifier.\n *\n * Use {@link gsocMine} to mine a signer for the target overlay address.\n *\n * Use {@link gsocSend} to send GSOC messages with the mined signer.\n *\n * **Warning! Only full nodes can accept GSOC messages.**\n *\n * @param address\n * @param identifier\n * @param handler\n * @returns\n *\n * @example\n * const identifier = NULL_IDENTIFIER\n * const { overlay } = await bee.getNodeAddresses()\n * const signer = bee.gsocMine(overlay, identifier)\n *\n * const subscription = bee.gsocSubscribe(signer.publicKey().address(), identifier, {\n * onMessage(message) {\n * // handle\n * },\n * onError(error) {\n * // handle\n * },\n * onClose() {\n * // handle\n * }\n * })\n */\n gsocSubscribe(\n address: EthAddress | Uint8Array | string,\n identifier: Identifier | Uint8Array | string,\n handler: GsocMessageHandler,\n ): GsocSubscription {\n address = new EthAddress(address)\n identifier = new Identifier(identifier)\n handler = prepareGsocMessageHandler(handler)\n\n const socAddress = makeSOCAddress(identifier, address)\n\n const ws = gsoc.subscribe(this.url, socAddress, this.requestOptions.headers)\n\n let cancelled = false\n const cancel = () => {\n if (!cancelled) {\n cancelled = true\n\n if (ws.terminate) {\n ws.terminate()\n } else {\n ws.close()\n }\n }\n }\n\n const subscription = {\n address,\n cancel,\n }\n\n ws.onmessage = async event => {\n const data = await prepareWebsocketData(event.data)\n\n if (data.length) {\n handler.onMessage(new Bytes(data), subscription)\n }\n }\n ws.onerror = event => {\n if (!cancelled) {\n handler.onError(new BeeError(event.message), subscription)\n }\n }\n ws.onclose = () => {\n handler.onClose(subscription)\n }\n\n return subscription\n }\n\n /**\n * Creates a feed manifest chunk and returns the reference to it.\n *\n * Feed manifest chunks allow for a feed to be able to be resolved through `/bzz` endpoint.\n *\n * @param postageBatchId Postage BatchId to be used to create the Feed Manifest\n * @param topic Topic in hex or bytes\n * @param owner Owner's ethereum address in hex or bytes\n * @param options Options that affects the request behavior\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)\n * @see [Bee API reference - `POST /feeds`](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post)\n */\n async createFeedManifest(\n postageBatchId: BatchId | Uint8Array | string,\n topic: Topic | Uint8Array | string,\n owner: EthAddress | Uint8Array | string,\n options?: UploadOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<Reference> {\n postageBatchId = new BatchId(postageBatchId)\n topic = new Topic(topic)\n owner = new EthAddress(owner)\n\n if (options) {\n options = prepareUploadOptions(options)\n }\n\n return createFeedManifest(this.getRequestOptionsForCall(requestOptions), owner, topic, postageBatchId, options)\n }\n\n /**\n * Makes a new feed reader for downloading feed updates.\n *\n * @param topic Topic in hex or bytes\n * @param owner Owner's ethereum address in hex or bytes\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)\n */\n makeFeedReader(\n topic: Topic | Uint8Array | string,\n owner: EthAddress | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): FeedReader {\n topic = new Topic(topic)\n owner = new EthAddress(owner)\n\n return makeFeedReader(this.getRequestOptionsForCall(requestOptions), topic, owner)\n }\n\n /**\n * Makes a new feed writer for updating feeds\n *\n * @param topic Topic in hex or bytes\n * @param signer The signer's private key or a Signer instance that can sign data\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)\n */\n makeFeedWriter(\n topic: Topic | Uint8Array | string,\n signer?: PrivateKey | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): FeedWriter {\n topic = new Topic(topic)\n signer = signer ? new PrivateKey(signer) : this.signer\n\n if (!signer) {\n throw Error('No signer provided')\n }\n\n return makeFeedWriter(this.getRequestOptionsForCall(requestOptions), topic, signer)\n }\n\n async fetchLatestFeedUpdate(\n topic: Topic | Uint8Array | string,\n owner: EthAddress | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<FeedPayloadResult> {\n topic = new Topic(topic)\n owner = new EthAddress(owner)\n\n return fetchLatestFeedUpdate(this.getRequestOptionsForCall(requestOptions), owner, topic)\n }\n\n /**\n * Creates a Content Addressed Chunk.\n *\n * To be uploaded with the {@link uploadChunk} method.\n *\n * Payload size must be between 1 and 4096 bytes.\n *\n * @param rawPayload Data to be stored in the chunk. If the data is a string, it will be converted to UTF-8 bytes.\n * @param span Optional span for the chunk. If not provided, it will be set to the length of the payload.\n *\n * @example\n *\n */\n makeContentAddressedChunk(rawPayload: Bytes | Uint8Array | string, span?: Span | bigint): Chunk {\n return makeContentAddressedChunk(rawPayload, span)\n }\n\n /**\n * Attempts to unmarshal arbitrary data into a Content Addressed Chunk.\n * Throws an error if the data is not a valid CAC.\n *\n * @param data The chunk data (`span` and `payload`)\n */\n unmarshalContentAddressedChunk(data: Bytes | Uint8Array): Chunk {\n return unmarshalContentAddressedChunk(data)\n }\n\n /**\n * Creates a Single Owner Chunk.\n *\n * To be uploaded with the {@link uploadChunk} method.\n *\n * Identical to chaining `makeContentAddressedChunk` and `toSingleOwnerChunk`.\n *\n * Payload size must be between 1 and 4096 bytes.\n *\n * @param address Address of the Content Addressed Chunk\n * @param span Span of the Content Addressed Chunk\n * @param payload Payload of the Content Addressed Chunk\n * @param identifier The identifier of the chunk\n * @param signer The signer interface for signing the chunk\n */\n makeSingleOwnerChunk(\n address: Reference,\n span: Span,\n payload: Bytes,\n identifier: Identifier | Uint8Array | string,\n signer: PrivateKey | Uint8Array | string,\n ): SingleOwnerChunk {\n return makeSingleOwnerChunk(address, span, payload, identifier, signer)\n }\n\n /**\n * Calculates the address of a Single Owner Chunk based on its identifier and owner address.\n *\n * @param identifier\n * @param address\n */\n calculateSingleOwnerChunkAddress(identifier: Identifier, address: EthAddress): Reference {\n return makeSOCAddress(identifier, address)\n }\n\n /**\n * Attempts to unmarshal arbitrary data into a Single Owner Chunk.\n * Throws an error if the data is not a valid SOC.\n *\n * @param data The chunk data\n * @param address The address of the single owner chunk\n *\n * @returns a single owner chunk or throws error\n */\n unmarshalSingleOwnerChunk(data: Bytes | Uint8Array, address: Reference | Uint8Array | string): SingleOwnerChunk {\n return unmarshalSingleOwnerChunk(data, address)\n }\n\n /**\n * Returns an object for reading single owner chunks\n *\n * @param ownerAddress The ethereum address of the owner\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @see [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/develop/tools-and-features/chunk-types#single-owner-chunks)\n */\n makeSOCReader(ownerAddress: EthAddress | Uint8Array | string, requestOptions?: BeeRequestOptions): SOCReader {\n ownerAddress = new EthAddress(ownerAddress)\n\n return {\n owner: ownerAddress,\n download: downloadSingleOwnerChunk.bind(null, this.getRequestOptionsForCall(requestOptions), ownerAddress),\n }\n }\n\n /**\n * Returns an object for reading and writing single owner chunks\n *\n * @param signer The signer's private key or a Signer instance that can sign data\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @see [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/develop/tools-and-features/chunk-types#single-owner-chunks)\n */\n makeSOCWriter(signer?: PrivateKey | Uint8Array | string, requestOptions?: BeeRequestOptions): SOCWriter {\n signer = signer ? new PrivateKey(signer) : this.signer\n\n if (!signer) {\n throw Error('No signer provided')\n }\n\n return {\n ...this.makeSOCReader((signer as PrivateKey).publicKey().address(), requestOptions),\n upload: uploadSingleOwnerChunkData.bind(null, this.getRequestOptionsForCall(requestOptions), signer),\n }\n }\n\n /**\n * Creates the postage batch signature for a specific chunk address.\n *\n * This is for advanced usage, where a pre-signed chunk can be uploaded\n * through a different Bee node.\n *\n * @param postageBatchId\n * @param reference\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @example\n * const envelope = await bee.createEnvelope(batchId, chunk.address)\n * await bee.uploadChunk(envelope, chunk)\n *\n * @returns\n */\n async createEnvelope(\n postageBatchId: BatchId | Uint8Array | string,\n reference: Reference | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<EnvelopeWithBatchId> {\n postageBatchId = new BatchId(postageBatchId)\n reference = new Reference(reference)\n\n return postEnvelope(this.getRequestOptionsForCall(requestOptions), postageBatchId, reference)\n }\n\n /**\n * Gets reserve commitment hash duration seconds.\n *\n * To be able to participe in the storage incentives and not get frozen, this should\n * ideally run under 5 minutes.\n *\n * This is a CPU intensice operation, as roughly 2^22 chunks are hashed in the process.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @example\n * const addresses = await bee.getNodeAddresses()\n * const topology = await bee.getTopology()\n * const result = await bee.rchash(topology.depth, addresses.overlay.toHex(), addresses.overlay.toHex())\n * // result is a number of seconds\n */\n async rchash(depth: number, anchor1: string, anchor2: string, requestOptions?: BeeRequestOptions): Promise<number> {\n return rchash(this.getRequestOptionsForCall(requestOptions), depth, anchor1, anchor2)\n }\n\n /**\n * Pings the Bee node to see if there is a live Bee node on the given URL.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @throws If connection was not successful throw error\n */\n async checkConnection(requestOptions?: BeeRequestOptions): Promise<void> | never {\n return status.checkConnection(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Pings the Bee node to see if there is a live Bee node on the given URL.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns true if successful, false on error\n */\n async isConnected(requestOptions?: BeeRequestOptions): Promise<boolean> {\n try {\n await status.checkConnection(this.getRequestOptionsForCall(requestOptions))\n } catch (e) {\n return false\n }\n\n return true\n }\n\n /**\n * Checks the `/gateway` endpoint to see if the remote API is a gateway.\n *\n * Do note that this is not a standard way to check for gateway nodes,\n * but some of the gateway tooling expose this endpoint.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async isGateway(requestOptions?: BeeRequestOptions): Promise<boolean> {\n return status.isGateway(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Fetches the overlay, underlay, Ethereum, and other addresses of the Bee node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async getNodeAddresses(requestOptions?: BeeRequestOptions): Promise<NodeAddresses> {\n return connectivity.getNodeAddresses(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Fetches the list of blocked peers for this node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async getBlocklist(requestOptions?: BeeRequestOptions): Promise<Peer[]> {\n return connectivity.getBlocklist(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets list of peers for this node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getPeers(requestOptions?: BeeRequestOptions): Promise<Peer[]> {\n return connectivity.getPeers(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Disconnects from a specific peer.\n *\n * @param peer Overlay address of the peer to be removed.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async removePeer(peer: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<RemovePeerResponse> {\n peer = new PeerAddress(peer)\n\n return connectivity.removePeer(this.getRequestOptionsForCall(requestOptions), peer)\n }\n\n /**\n * Fetches topology and connectivity information of the Bee node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async getTopology(requestOptions?: BeeRequestOptions): Promise<Topology> {\n return connectivity.getTopology(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Pings a specific peer to check its availability.\n *\n * @param peer Overlay address of the peer to be pinged.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async pingPeer(peer: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<PingResponse> {\n peer = new PeerAddress(peer)\n\n return connectivity.pingPeer(this.getRequestOptionsForCall(requestOptions), peer)\n }\n\n /**\n * Gets the SWAP balances with all known peers including prepaid services.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getAllBalances(requestOptions?: BeeRequestOptions): Promise<BalanceResponse> {\n return balance.getAllBalances(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the SWAP balances for a specific peer including prepaid services.\n *\n * @param address Swarm address of peer\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getPeerBalance(address: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<PeerBalance> {\n address = new PeerAddress(address)\n\n return balance.getPeerBalance(this.getRequestOptionsForCall(requestOptions), address)\n }\n\n /**\n * Gets the past due consumption balances for all known peers.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getPastDueConsumptionBalances(requestOptions?: BeeRequestOptions): Promise<BalanceResponse> {\n return balance.getPastDueConsumptionBalances(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the past due consumption balance for a specific peer.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param address Swarm address of peer\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getPastDueConsumptionPeerBalance(\n address: PeerAddress | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<PeerBalance> {\n address = new PeerAddress(address)\n\n return balance.getPastDueConsumptionPeerBalance(this.getRequestOptionsForCall(requestOptions), address)\n }\n\n /**\n * Gets the address of the deloyed chequebook.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getChequebookAddress(requestOptions?: BeeRequestOptions): Promise<ChequebookAddressResponse> {\n return chequebook.getChequebookAddress(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the balance of the chequebook.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getChequebookBalance(requestOptions?: BeeRequestOptions): Promise<ChequebookBalanceResponse> {\n return chequebook.getChequebookBalance(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the last cheques for all peers.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getLastCheques(requestOptions?: BeeRequestOptions): Promise<LastChequesResponse> {\n return chequebook.getLastCheques(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the last cheques for a specific peer.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param address Overlay address of peer.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getLastChequesForPeer(\n address: PeerAddress | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<LastChequesForPeerResponse> {\n address = new PeerAddress(address)\n\n return chequebook.getLastChequesForPeer(this.getRequestOptionsForCall(requestOptions), address)\n }\n\n /**\n * Gets the last cashout action for a specific peer.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param address Overlay address of peer.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getLastCashoutAction(\n address: PeerAddress | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<LastCashoutActionResponse> {\n address = new PeerAddress(address)\n\n return chequebook.getLastCashoutAction(this.getRequestOptionsForCall(requestOptions), address)\n }\n\n /**\n * Cashes out the last cheque for a specific peer.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param address Swarm address of peer\n * @param options\n * @param options.gasPrice Gas price for the cashout transaction in WEI\n * @param options.gasLimit Gas limit for the cashout transaction in WEI\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async cashoutLastCheque(\n address: PeerAddress | string,\n options?: TransactionOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n address = new PeerAddress(address)\n\n if (options) {\n prepareTransactionOptions(options)\n }\n\n return chequebook.cashoutLastCheque(this.getRequestOptionsForCall(requestOptions), address, options)\n }\n\n /**\n * Deposits tokens from the node wallet into the chequebook.\n *\n * @param amount Amount of tokens to deposit (must be positive integer)\n * @param gasPrice Gas Price in WEI for the transaction call\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @return string Hash of the transaction\n * @deprecated Use `depositBZZToChequebook` instead.\n */\n async depositTokens(\n amount: BZZ | NumberString | string | bigint,\n gasPrice?: NumberString | string | bigint,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n return this.depositBZZToChequebook(amount, gasPrice, requestOptions)\n }\n\n /**\n * Deposits tokens from the node wallet into the chequebook.\n *\n * @param amount Amount of tokens to deposit (must be positive integer)\n * @param gasPrice Gas Price in WEI for the transaction call\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @return string Hash of the transaction\n */\n async depositBZZToChequebook(\n amount: BZZ | NumberString | string | bigint,\n gasPrice?: NumberString | string | bigint,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n const amountString =\n amount instanceof BZZ ? amount.toPLURString() : asNumberString(amount, { min: 1n, name: 'amount' })\n\n let gasPriceString\n\n if (gasPrice) {\n gasPriceString = asNumberString(amount, { min: 0n, name: 'gasPrice' })\n }\n\n return chequebook.depositTokens(this.getRequestOptionsForCall(requestOptions), amountString, gasPriceString)\n }\n\n /**\n * Withdraws tokens from the chequebook to the node wallet.\n *\n * @param amount Amount of tokens to withdraw (must be positive integer)\n * @param gasPrice Gas Price in WEI for the transaction call\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @return string Hash of the transaction\n * @deprecated Use `withdrawBZZFromChequebook` instead.\n */\n async withdrawTokens(\n amount: BZZ | NumberString | string | bigint,\n gasPrice?: NumberString | string | bigint,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n return this.withdrawBZZFromChequebook(amount, gasPrice, requestOptions)\n }\n\n /**\n * Withdraws tokens from the chequebook to the node wallet.\n *\n * @param amount Amount of BZZ tokens to withdraw. If not providing a `BZZ` instance, the amount is denoted in PLUR.\n * @param gasPrice Gas Price in WEI for the transaction call.\n * @return Transaction ID\n */\n async withdrawBZZFromChequebook(\n amount: BZZ | NumberString | string | bigint,\n gasPrice?: NumberString | string | bigint,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n // TODO: check BZZ in tests\n const amountString =\n amount instanceof BZZ ? amount.toPLURString() : asNumberString(amount, { min: 1n, name: 'amount' })\n\n let gasPriceString\n\n if (gasPrice) {\n gasPriceString = asNumberString(amount, { min: 0n, name: 'gasPrice' })\n }\n\n return chequebook.withdrawTokens(this.getRequestOptionsForCall(requestOptions), amountString, gasPriceString)\n }\n\n /**\n * Withdraws BZZ from the node wallet (not chequebook) to a whitelisted external wallet address.\n *\n * @param amount Amount of BZZ tokens to withdraw. If not providing a `BZZ` instance, the amount is denoted in PLUR.\n * @param address\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @return Transaction ID\n */\n async withdrawBZZToExternalWallet(\n amount: BZZ | NumberString | string | bigint,\n address: EthAddress | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n amount = amount instanceof BZZ ? amount : BZZ.fromPLUR(amount)\n address = new EthAddress(address)\n\n return states.withdrawBZZ(this.getRequestOptionsForCall(requestOptions), amount, address)\n }\n\n /**\n * Withdraws DAI from the node wallet (not chequebook) to a whitelisted external wallet address.\n *\n * @param amount Amount of DAI tokens to withdraw. If not providing a `DAI` instance, the amount is denoted in wei.\n * @param address\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @return Transaction ID\n */\n async withdrawDAIToExternalWallet(\n amount: DAI | NumberString | string | bigint,\n address: EthAddress | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n amount = amount instanceof DAI ? amount : DAI.fromWei(amount)\n address = new EthAddress(address)\n\n return states.withdrawDAI(this.getRequestOptionsForCall(requestOptions), amount, address)\n }\n\n /**\n * Gets the amount of sent and received micropayments from settlements with a peer.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param address Swarm address of peer\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getSettlements(address: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<Settlements> {\n address = new PeerAddress(address)\n\n return settlements.getSettlements(this.getRequestOptionsForCall(requestOptions), address)\n }\n\n /**\n * Gets settlements with all known peers and total amount sent or received.\n *\n * This is related to the bandwidth incentives and the chequebook.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getAllSettlements(requestOptions?: BeeRequestOptions): Promise<AllSettlements> {\n return settlements.getAllSettlements(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the general status of the node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getStatus(requestOptions?: BeeRequestOptions): Promise<DebugStatus> {\n return debugStatus.getDebugStatus(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the health of the node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getHealth(requestOptions?: BeeRequestOptions): Promise<Health> {\n return debugStatus.getHealth(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the readiness status of the node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getReadiness(requestOptions?: BeeRequestOptions): Promise<Readiness> {\n return debugStatus.getReadiness(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Get mode information of node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getNodeInfo(requestOptions?: BeeRequestOptions): Promise<NodeInfo> {\n return debugStatus.getNodeInfo(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Connects to a node and checks if its version matches with the one that bee-js supports.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async isSupportedExactVersion(requestOptions?: BeeRequestOptions): Promise<boolean> | never {\n return debugStatus.isSupportedExactVersion(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n *\n * Connects to a node and checks if its Main API version matches with the one that bee-js supports.\n *\n * This should be the main way how to check compatibility for your app and Bee node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async isSupportedApiVersion(requestOptions?: BeeRequestOptions): Promise<boolean> | never {\n return debugStatus.isSupportedApiVersion(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Returns object with all versions specified by the connected Bee node (properties prefixed with `bee*`)\n * and versions that bee-js supports (properties prefixed with `supported*`).\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getVersions(requestOptions?: BeeRequestOptions): Promise<BeeVersions> | never {\n return debugStatus.getVersions(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Get reserve state.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getReserveState(requestOptions?: BeeRequestOptions): Promise<ReserveState> {\n return states.getReserveState(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets chain state.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getChainState(requestOptions?: BeeRequestOptions): Promise<ChainState> {\n return states.getChainState(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets DAI and BZZ balances of the Bee node wallet.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getWalletBalance(requestOptions?: BeeRequestOptions): Promise<WalletBalance> {\n return states.getWalletBalance(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Creates a new postage batch, spending BZZ tokens from the node wallet.\n *\n * Use {@link buyStorage} for a more convenient way to create postage batch.\n *\n * For better understanding what each parameter means and what the optimal values are, see\n * [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction#keep-your-data-alive).\n *\n * @param amount TTL parameter - 1 day at the minimum of 24,000 storage price requires an amount of 414,720,000.\n * @param depth Capacity parameter - 17..255 - depth 17 provides 512MB of theoretical capacity, 18 provides 1GB, 19 provides 2GB, etc.\n * @param options Options for creation of postage batch\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee Debug API reference - `POST /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1{amount}~1{depth}/post)\n */\n async createPostageBatch(\n amount: NumberString | string | bigint,\n depth: number,\n options?: PostageBatchOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<BatchId> {\n const amountString = asNumberString(amount, { min: 0n, name: 'amount' })\n\n if (options) {\n options = preparePostageBatchOptions(options)\n }\n\n if (depth < STAMPS_DEPTH_MIN || depth > STAMPS_DEPTH_MAX) {\n throw new BeeArgumentError(`Depth has to be between ${STAMPS_DEPTH_MIN}..${STAMPS_DEPTH_MAX}`, depth)\n }\n\n const chainState = await this.getChainState()\n const minimumAmount = BigInt(chainState.currentPrice) * 17280n + 1n\n\n if (BigInt(amountString) < minimumAmount) {\n throw new BeeArgumentError(\n `Amount has to be at least ${minimumAmount} (1 day at current price ${chainState.currentPrice})`,\n amountString,\n )\n }\n\n const stamp = await stamps.createPostageBatch(\n this.getRequestOptionsForCall(requestOptions),\n amountString,\n depth,\n options,\n )\n\n if (options?.waitForUsable !== false) {\n await this.waitForUsablePostageStamp(stamp, options?.waitForUsableTimeout)\n }\n\n return stamp\n }\n\n /**\n * A more convenient method to create a postage batch, which is analogous\n * to buying storage for a certain size and duration on the Swarm network.\n *\n * Use {@link getStorageCost} to calculate the cost of creating a postage batch.\n * \n * For the low level API, use {@link createPostageBatch}.\n * \n * @example const batchId = await bee.buyStorage(Size.fromGigabytes(8), Duration.fromDays(31))\n\n * @param size\n * @param duration\n * @param options\n * @param requestOptions\n * @param encryption\n * @param erasureCodeLevel\n * @returns\n */\n async buyStorage(\n size: Size,\n duration: Duration,\n options?: PostageBatchOptions,\n requestOptions?: BeeRequestOptions,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n ): Promise<BatchId> {\n const chainState = await this.getChainState(requestOptions)\n const amount = getAmountForDuration(duration, chainState.currentPrice, this.network === 'gnosis' ? 5 : 15)\n const depth = getDepthForSize(size, encryption, erasureCodeLevel)\n\n if (options) {\n options = preparePostageBatchOptions(options)\n }\n\n return this.createPostageBatch(amount, depth, options, requestOptions)\n }\n\n /**\n * Calculates the estimated BZZ cost for creating a postage batch for the given size and duration.\n *\n * Use {@link buyStorage} to create a postage batch with the calculated cost.\n *\n * @example const bzz = await bee.getStorageCost(Size.fromGigabytes(1), Duration.fromDays(30))\n *\n * @param size Size of the data to be stored.\n * @param duration Duration for which the data should be stored.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.\n * @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.\n * @returns\n */\n async getStorageCost(\n size: Size,\n duration: Duration,\n requestOptions?: BeeRequestOptions,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n ): Promise<BZZ> {\n const chainState = await this.getChainState(requestOptions)\n const amount = getAmountForDuration(duration, chainState.currentPrice, this.network === 'gnosis' ? 5 : 15)\n const depth = getDepthForSize(size, encryption, erasureCodeLevel)\n\n return getStampCost(depth, amount)\n }\n\n /**\n * Extends the storage of a postage batch by either increasing its size, duration or both.\n *\n * The size is ABSOLUTE, while the duration is RELATIVE to the current duration of the postage batch.\n *\n * Use {@link getExtensionCost} to calculate the cost of extending the storage.\n *\n * @example\n * // Increases the size to 8GB (unless it is already at 8GB or higher)\n * // and extends the duration by 30 days (regardless of the current duration).\n * await bee.extendStorage(batchId, Size.fromGigabytes(8), Duration.fromDays(30))\n *\n * @example\n * // To increase the duration to a desired date, pass a second parameter to `Duration.fromEndDate`.\n * // With the second parameter, the duration is set to the difference between the current end date and the desired end date.\n * const oneMonth = new Date(Date.now() + Dates.days(31))\n * const batch = await bee.getPostageBatch(batchId)\n * await bee.extendStorage(batchId, Size.fromGigabytes(8), Duration.fromEndDate(oneMonth, batch.duration.toEndDate()))\n *\n * @param postageBatchId Batch ID of the postage batch to extend.\n * @param size Absolute size to extend the postage batch to.\n * @param duration Relative duration to extend the postage batch by.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.\n * @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.\n * @returns\n */\n async extendStorage(\n postageBatchId: BatchId | Uint8Array | string,\n size: Size,\n duration: Duration,\n requestOptions?: BeeRequestOptions,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n ) {\n const batch = await this.getPostageBatch(postageBatchId, requestOptions)\n const depth = getDepthForSize(size, encryption, erasureCodeLevel)\n const chainState = await this.getChainState(requestOptions)\n const depthDelta = depth - batch.depth\n const multiplier = depthDelta <= 0 ? 1n : 2n ** BigInt(depthDelta)\n const blockTime = this.network === 'gnosis' ? 5 : 15\n const additionalAmount = getAmountForDuration(duration, chainState.currentPrice, blockTime)\n const currentAmount = getAmountForDuration(batch.duration, chainState.currentPrice, blockTime)\n const targetAmount = duration.isZero()\n ? currentAmount * multiplier\n : (currentAmount + additionalAmount) * multiplier\n\n const amountDelta = targetAmount - currentAmount\n\n const transactionId = await this.topUpBatch(batch.batchID, amountDelta, requestOptions)\n\n if (depthDelta > 0) {\n return this.diluteBatch(batch.batchID, depth, requestOptions)\n }\n\n return transactionId\n }\n\n /**\n * Extends the storage size of a postage batch by increasing its depth.\n *\n * Use {@link getSizeExtensionCost} to calculate the cost of extending the size.\n * Use {@link extendStorage} to extend both size and duration.\n *\n * @param postageBatchId\n * @param size Absolute size to extend the postage batch to.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.\n * @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.\n * @returns\n */\n async extendStorageSize(\n postageBatchId: BatchId | Uint8Array | string,\n size: Size,\n requestOptions?: BeeRequestOptions,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n ) {\n const chainState = await this.getChainState(requestOptions)\n const batch = await this.getPostageBatch(postageBatchId, requestOptions)\n const depth = getDepthForSize(size, encryption, erasureCodeLevel)\n const delta = depth - batch.depth\n\n if (delta <= 0) {\n throw new BeeArgumentError('New depth has to be greater than the original depth', depth)\n }\n\n const currentAmount = getAmountForDuration(\n batch.duration,\n chainState.currentPrice,\n this.network === 'gnosis' ? 5 : 15,\n )\n await this.topUpBatch(batch.batchID, currentAmount * (2n ** BigInt(delta) - 1n) + 1n, requestOptions)\n\n return this.diluteBatch(batch.batchID, depth, requestOptions)\n }\n\n /**\n * Extends the duration of a postage batch.\n *\n * Use {@link getDurationExtensionCost} to calculate the cost of extending the duration.\n * Use {@link extendStorage} to extend both size and duration.\n *\n * @param postageBatchId\n * @param duration Relative duration to extend the postage batch by.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async extendStorageDuration(\n postageBatchId: BatchId | Uint8Array | string,\n duration: Duration,\n requestOptions?: BeeRequestOptions,\n ) {\n const batch = await this.getPostageBatch(postageBatchId, requestOptions)\n const chainState = await this.getChainState(requestOptions)\n const amount = getAmountForDuration(duration, chainState.currentPrice, this.network === 'gnosis' ? 5 : 15)\n\n return this.topUpBatch(batch.batchID, amount, requestOptions)\n }\n\n /**\n * Calculates the cost of extending both the duration and the capacity of a postage batch.\n *\n * The size is ABSOLUTE, while the duration is RELATIVE to the current duration of the postage batch.\n *\n * Use {@link extendStorage} to extend the the duration and capacity of a postage batch.\n *\n * @param postageBatchId\n * @param size Absolute size to extend the postage batch to.\n * @param duration Relative duration to extend the postage batch by.\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.\n * @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.\n * @returns\n */\n async getExtensionCost(\n postageBatchId: BatchId | Uint8Array | string,\n size: Size,\n duration: Duration,\n requestOptions?: BeeRequestOptions,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n ): Promise<BZZ> {\n const batch = await this.getPostageBatch(postageBatchId, requestOptions)\n const chainState = await this.getChainState(requestOptions)\n const blockTime = this.network === 'gnosis' ? 5 : 15\n const amount = duration.isZero() ? 0n : getAmountForDuration(duration, chainState.currentPrice, blockTime)\n const depth = getDepthForSize(size, encryption, erasureCodeLevel)\n\n const currentAmount = getAmountForDuration(batch.duration, chainState.currentPrice, blockTime)\n const currentCost = getStampCost(batch.depth, currentAmount)\n const newCost = getStampCost(Math.max(batch.depth, depth), currentAmount + amount)\n\n return newCost.minus(currentCost)\n }\n\n /**\n * Calculates the cost of extending the size of a postage batch.\n *\n * The size is ABSOLUTE, so if the postage batch already equals or is greater than the given size,\n * the cost will be zero.\n *\n * Use {@link extendStorageSize} to extend the size of a postage batch.\n *\n * Use {@link getExtensionCost} to get the cost of extending both size and duration.\n * Use {@link getDurationExtensionCost} to get the cost of extending only the duration.\n *\n * @param postageBatchId\n * @param size\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.\n * @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.\n * @returns\n */\n async getSizeExtensionCost(\n postageBatchId: BatchId | Uint8Array | string,\n size: Size,\n requestOptions?: BeeRequestOptions,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n ): Promise<BZZ> {\n const batch = await this.getPostageBatch(postageBatchId, requestOptions)\n const chainState = await this.getChainState(requestOptions)\n const depth = getDepthForSize(size, encryption, erasureCodeLevel)\n const delta = depth - batch.depth\n\n if (delta <= 0) {\n throw new BeeArgumentError('New depth has to be greater than the original depth', depth)\n }\n\n const currentAmount = getAmountForDuration(\n batch.duration,\n chainState.currentPrice,\n this.network === 'gnosis' ? 5 : 15,\n )\n const currentCost = getStampCost(batch.depth, currentAmount)\n const newCost = getStampCost(depth, currentAmount)\n\n return newCost.minus(currentCost)\n }\n\n /**\n * Calculates the cost of extending the duration of a postage batch.\n *\n * The duration is RELATIVE to the current duration of the postage batch,\n * e.g. specifying `Duration.fromDays(30)` will extend the current duration by 30 days,\n * regardless of the current duration.\n *\n * Use {@link extendStorageDuration} to extend the duration of a postage batch.\n *\n * Use {@link getExtensionCost} to get the cost of extending both size and duration.\n * Use {@link getSizeExtensionCost} to get the cost of extending only the size.\n *\n * @param postageBatchId\n * @param duration\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @returns\n */\n async getDurationExtensionCost(\n postageBatchId: BatchId | Uint8Array | string,\n duration: Duration,\n requestOptions?: BeeRequestOptions,\n ): Promise<BZZ> {\n const batch = await this.getPostageBatch(postageBatchId, requestOptions)\n const chainState = await this.getChainState(requestOptions)\n const amount = getAmountForDuration(duration, chainState.currentPrice, this.network === 'gnosis' ? 5 : 15)\n\n return getStampCost(batch.depth, amount)\n }\n\n /**\n * Increases the duration of a postage batch by increasing its amount.\n *\n * For a more convenient way to extend the postage batch, refer to the methods below.\n *\n * Use {@link getDurationExtensionCost}, {@link getSizeExtensionCost} or {@link getExtensionCost}\n * to calculate the costs of extending the postage batch properties.\n *\n * Use {@link extendStorageDuration}, {@link extendStorageSize} or {@link extendStorage}\n * to extend the postage batch properties.\n *\n * For better understanding what each parameter means and what are the optimal values please see\n * [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive).\n *\n * @param postageBatchId Batch ID\n * @param amount Amount to be added to the batch\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee Debug API reference - `PATCH /stamps/topup/${id}/${amount}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1topup~1{batch_id}~1{amount}/patch)\n */\n async topUpBatch(\n postageBatchId: BatchId | Uint8Array | string,\n amount: NumberString | string | bigint,\n requestOptions?: BeeRequestOptions,\n ): Promise<BatchId> {\n postageBatchId = new BatchId(postageBatchId)\n const amountString = asNumberString(amount, { min: 1n, name: 'amount' })\n\n return stamps.topUpBatch(this.getRequestOptionsForCall(requestOptions), postageBatchId, amountString)\n }\n\n /**\n * Dilutes a postage batch to extend its capacity by increasing its depth.\n *\n * This is a free operation, as for every depth increase, the capacity is doubled,\n * but the amount (duration) is halved.\n *\n * To increase the capacity of the postage batch while retaining the same amount (duration),\n * you need to top up the postage batch first using {@link topUpBatch}.\n *\n * For a more convenient way to extend the postage batch, refer to the methods below.\n *\n * Use {@link getDurationExtensionCost}, {@link getSizeExtensionCost} or {@link getExtensionCost}\n * to calculate the costs of extending the postage batch properties.\n *\n * Use {@link extendStorageDuration}, {@link extendStorageSize} or {@link extendStorage}\n * to extend the postage batch properties.\n *\n * For better understanding what each parameter means and what are the optimal values please see\n * [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive).\n *\n * @param postageBatchId Batch ID\n * @param depth Amount to be added to the batch\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee Debug API reference - `PATCH /stamps/topup/${id}/${amount}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1dilute~1%7Bbatch_id%7D~1%7Bdepth%7D/patch)\n */\n async diluteBatch(\n postageBatchId: BatchId | Uint8Array | string,\n depth: number,\n requestOptions?: BeeRequestOptions,\n ): Promise<BatchId> {\n postageBatchId = new BatchId(postageBatchId)\n depth = Types.asNumber(depth, { name: 'depth', min: 18, max: 255 })\n\n return stamps.diluteBatch(this.getRequestOptionsForCall(requestOptions), postageBatchId, depth)\n }\n\n /**\n * Returns details for specific postage batch.\n *\n * @param postageBatchId Batch ID\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n * @param encryption Assume that uploads with this postage batch are encrypted, which skews the capacity.\n * @param erasureCodeLevel Assume that uploads with this postage batch are erasure coded, which skews the capacity.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee Debug API reference - `GET /stamps/${id}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D/get)\n */\n async getPostageBatch(\n postageBatchId: BatchId | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n encryption?: boolean,\n erasureCodeLevel?: RedundancyLevel,\n ): Promise<PostageBatch> {\n postageBatchId = new BatchId(postageBatchId)\n\n return stamps.getPostageBatch(\n this.getRequestOptionsForCall(requestOptions),\n postageBatchId,\n encryption,\n erasureCodeLevel,\n )\n }\n\n /**\n * Return detailed information related to buckets for specific postage batch.\n *\n * @param postageBatchId Batch ID\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee Debug API reference - `GET /stamps/${id}/buckets`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D~1buckets/get)\n */\n async getPostageBatchBuckets(\n postageBatchId: BatchId | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<PostageBatchBuckets> {\n postageBatchId = new BatchId(postageBatchId)\n\n return stamps.getPostageBatchBuckets(this.getRequestOptionsForCall(requestOptions), postageBatchId)\n }\n\n /**\n * Returns all postage batches that belongs to the node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps/get)\n * @deprecated Use `getPostageBatches` instead\n */\n async getAllPostageBatch(requestOptions?: BeeRequestOptions): Promise<PostageBatch[]> {\n return stamps.getAllPostageBatches(this.getRequestOptionsForCall(requestOptions)) // TODO: remove in June 2025\n }\n\n /**\n * Returns all postage batches that are globally available on the Swarm network.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @deprecated Use `getGlobalPostageBatches` instead\n */\n async getAllGlobalPostageBatch(requestOptions?: BeeRequestOptions): Promise<GlobalPostageBatch[]> {\n return stamps.getGlobalPostageBatches(this.getRequestOptionsForCall(requestOptions)) // TODO: remove in June 2025\n }\n\n /**\n * Returns all postage batches that belong to the node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)\n * @see [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps/get)\n */\n async getPostageBatches(requestOptions?: BeeRequestOptions): Promise<PostageBatch[]> {\n return stamps.getAllPostageBatches(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Returns all globally available postage batches.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getGlobalPostageBatches(requestOptions?: BeeRequestOptions): Promise<GlobalPostageBatch[]> {\n return stamps.getGlobalPostageBatches(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Fetches the list of all current pending transactions for the Bee node.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getAllPendingTransactions(requestOptions?: BeeRequestOptions): Promise<TransactionInfo[]> {\n return transactions.getAllTransactions(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Fetches the transaction information for a specific transaction.\n *\n * @param transactionHash\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getPendingTransaction(\n transactionHash: TransactionId | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionInfo> {\n transactionHash = new TransactionId(transactionHash)\n\n return transactions.getTransaction(this.getRequestOptionsForCall(requestOptions), transactionHash)\n }\n\n /**\n * Rebroadcasts already created transaction.\n *\n * This is mainly needed when the transaction falls off mempool or is not incorporated into any block.\n *\n * @param transactionHash\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async rebroadcastPendingTransaction(\n transactionHash: TransactionId | Uint8Array | string,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n transactionHash = new TransactionId(transactionHash)\n\n return transactions.rebroadcastTransaction(this.getRequestOptionsForCall(requestOptions), transactionHash)\n }\n\n /**\n * Cancels a currently pending transaction.\n *\n * @param transactionHash\n * @param gasPrice\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async cancelPendingTransaction(\n transactionHash: TransactionId | Uint8Array | string,\n gasPrice?: NumberString | string | bigint,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n transactionHash = new TransactionId(transactionHash)\n\n let gasPriceString\n\n if (gasPrice) {\n gasPriceString = asNumberString(gasPrice, { min: 0n, name: 'gasPrice' })\n }\n\n return transactions.cancelTransaction(\n this.getRequestOptionsForCall(requestOptions),\n transactionHash,\n gasPriceString,\n )\n }\n\n /**\n * Gets the amount of staked BZZ.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getStake(requestOptions?: BeeRequestOptions): Promise<BZZ> {\n return stake.getStake(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Gets the amount of withdrawable staked BZZ.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async getWithdrawableStake(requestOptions?: BeeRequestOptions): Promise<BZZ> {\n return stake.getWithdrawableStake(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Withdraws all surplus staked BZZ to the node wallet.\n *\n * Use the {@link getWithdrawableStake} method to check how much surplus stake is available.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async withdrawSurplusStake(requestOptions?: BeeRequestOptions): Promise<TransactionId> {\n return stake.withdrawSurplusStake(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Withdraws all staked BZZ to the node wallet.\n *\n * **Only available when the staking contract is paused and is in the process of being migrated to a new contract!**\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async migrateStake(requestOptions?: BeeRequestOptions): Promise<TransactionId> {\n return stake.migrateStake(this.getRequestOptionsForCall(requestOptions))\n }\n\n /**\n * Stakes the given amount of BZZ. Initial deposit must be at least 10 BZZ.\n *\n * Be aware that staked BZZ tokens can **not** be withdrawn.\n *\n * @param amount Amount of BZZ tokens to be staked. If not providing a `BZZ` instance, the amount is denoted in PLUR.\n * @param options\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n */\n async depositStake(\n amount: BZZ | NumberString | string | bigint,\n options?: TransactionOptions,\n requestOptions?: BeeRequestOptions,\n ): Promise<TransactionId> {\n const amountString =\n amount instanceof BZZ ? amount.toPLURString() : asNumberString(amount, { min: 1n, name: 'amount' })\n\n if (options) {\n options = prepareTransactionOptions(options)\n }\n\n return stake.stake(this.getRequestOptionsForCall(requestOptions), amountString, options)\n }\n\n /**\n * Gets current status of node in redistribution game.\n *\n * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.\n *\n * @see [Bee API reference - `GET /redistributionstate`](https://docs.ethswarm.org/api/#tag/RedistributionState/paths/~1redistributionstate/get)\n */\n async getRedistributionState(requestOptions?: BeeRequestOptions): Promise<RedistributionState> {\n return stake.getRedistributionState(this.getRequestOptionsForCall(requestOptions))\n }\n\n private async waitForUsablePostageStamp(id: BatchId, timeout = 240_000): Promise<void> {\n const TIME_STEP = 3_000\n for (let time = 0; time < timeout; time += TIME_STEP) {\n try {\n const stamp = await this.getPostageBatch(id)\n\n if (stamp.usable) {\n return\n }\n } catch (error) {\n // ignore error\n }\n\n await System.sleepMillis(TIME_STEP)\n }\n\n throw new BeeError('Timeout on waiting for postage stamp to become usable')\n }\n\n protected getRequestOptionsForCall(requestOptions?: BeeRequestOptions): BeeRequestOptions {\n if (requestOptions) {\n requestOptions = prepareBeeRequestOptions(requestOptions)\n }\n\n return requestOptions ? Objects.deepMerge2(this.requestOptions, requestOptions) : this.requestOptions\n }\n}\n","export function totalChunks(fileSize: number) {\n const chunkSize = 4096\n const hashesPerChunk = 128\n\n function chunksAtLevel(chunkCount: number): number {\n if (chunkCount <= 1) {\n return chunkCount\n }\n const upperLevelChunks = Math.ceil(chunkCount / hashesPerChunk)\n\n return chunkCount + chunksAtLevel(upperLevelChunks)\n }\n\n const baseLevelChunks = Math.ceil(fileSize / chunkSize)\n\n return chunksAtLevel(baseLevelChunks)\n}\n","import { Binary, Types } from 'cafe-utility'\nimport type { BeeRequestOptions, EnvelopeWithBatchId } from '../types'\nimport { http } from '../utils/http'\nimport { BatchId, Reference } from '../utils/typed-bytes'\n\nconst ENVELOPE_ENDPOINT = 'envelope'\n\nexport async function postEnvelope(\n requestOptions: BeeRequestOptions,\n postageBatchId: BatchId,\n reference: Reference,\n): Promise<EnvelopeWithBatchId> {\n const response = await http<unknown>(requestOptions, {\n method: 'post',\n responseType: 'json',\n url: `${ENVELOPE_ENDPOINT}/${reference}`,\n headers: {\n 'swarm-postage-batch-id': postageBatchId.toHex(),\n },\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n issuer: Binary.hexToUint8Array(Types.asHexString(body.issuer, { name: 'issuer', byteLength: 20 })),\n index: Binary.hexToUint8Array(Types.asHexString(body.index, { name: 'index', byteLength: 8 })),\n timestamp: Binary.hexToUint8Array(Types.asHexString(body.timestamp, { name: 'timestamp', byteLength: 8 })),\n signature: Binary.hexToUint8Array(Types.asHexString(body.signature, { name: 'signature', byteLength: 65 })),\n batchId: postageBatchId,\n }\n}\n","import { Types } from 'cafe-utility'\nimport type { BeeRequestOptions } from '../types'\nimport { http } from '../utils/http'\n\nconst RCHASH_ENDPOINT = 'rchash'\n\nexport async function rchash(\n requestOptions: BeeRequestOptions,\n depth: number,\n anchor1: string,\n anchor2: string,\n): Promise<number> {\n const response = await http<unknown>(requestOptions, {\n responseType: 'json',\n url: `${RCHASH_ENDPOINT}/${depth}/${anchor1}/${anchor2}`,\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return Types.asNumber(body.durationSeconds, { name: 'durationSeconds' })\n}\n","import { Types } from 'cafe-utility'\nimport { Bee, BeeRequestOptions, EthAddress, NodeAddresses, PeerAddress, PublicKey, Topology } from '.'\nimport { asBin } from './modules/debug/connectivity'\nimport { http } from './utils/http'\n\nexport class BeeDev extends Bee {\n async getNodeAddresses(options?: BeeRequestOptions): Promise<NodeAddresses> {\n const requestOptions = super.getRequestOptionsForCall(options)\n\n const response = await http<unknown>(requestOptions, {\n url: 'addresses',\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n\n return {\n overlay: new PeerAddress(Types.asString(body.overlay, { name: 'overlay' })),\n underlay: [],\n ethereum: new EthAddress(Types.asString(body.ethereum, { name: 'ethereum' })),\n publicKey: new PublicKey(Types.asString(body.publicKey, { name: 'publicKey' })),\n pssPublicKey: new PublicKey(Types.asString(body.pssPublicKey, { name: 'pssPublicKey' })),\n }\n }\n\n async getTopology(options?: BeeRequestOptions): Promise<Topology> {\n const requestOptions = super.getRequestOptionsForCall(options)\n\n const response = await http<unknown>(requestOptions, {\n url: `topology`,\n responseType: 'json',\n })\n\n const body = Types.asObject(response.data, { name: 'response.data' })\n const bins = Types.asObject(body.bins, { name: 'bins' })\n\n return {\n baseAddr: '0bab5ca208a980950604f900f2791613fc980676c2dee7dd92a4fdda5a54bf26',\n population: Types.asNumber(body.population, { name: 'population' }),\n connected: Types.asNumber(body.connected, { name: 'connected' }),\n timestamp: Types.asString(body.timestamp, { name: 'timestamp' }),\n nnLowWatermark: Types.asNumber(body.nnLowWatermark, { name: 'nnLowWatermark' }),\n depth: Types.asNumber(body.depth, { name: 'depth' }),\n reachability: 'Public',\n networkAvailability: 'Available',\n bins: {\n bin_0: asBin(bins.bin_0, 'bin_0'),\n bin_1: asBin(bins.bin_1, 'bin_1'),\n bin_2: asBin(bins.bin_2, 'bin_2'),\n bin_3: asBin(bins.bin_3, 'bin_3'),\n bin_4: asBin(bins.bin_4, 'bin_4'),\n bin_5: asBin(bins.bin_5, 'bin_5'),\n bin_6: asBin(bins.bin_6, 'bin_6'),\n bin_7: asBin(bins.bin_7, 'bin_7'),\n bin_8: asBin(bins.bin_8, 'bin_8'),\n bin_9: asBin(bins.bin_9, 'bin_9'),\n bin_10: asBin(bins.bin_10, 'bin_10'),\n bin_11: asBin(bins.bin_11, 'bin_11'),\n bin_12: asBin(bins.bin_12, 'bin_12'),\n bin_13: asBin(bins.bin_13, 'bin_13'),\n bin_14: asBin(bins.bin_14, 'bin_14'),\n bin_15: asBin(bins.bin_15, 'bin_15'),\n bin_16: asBin(bins.bin_16, 'bin_16'),\n bin_17: asBin(bins.bin_17, 'bin_17'),\n bin_18: asBin(bins.bin_18, 'bin_18'),\n bin_19: asBin(bins.bin_19, 'bin_19'),\n bin_20: asBin(bins.bin_20, 'bin_20'),\n bin_21: asBin(bins.bin_21, 'bin_21'),\n bin_22: asBin(bins.bin_22, 'bin_22'),\n bin_23: asBin(bins.bin_23, 'bin_23'),\n bin_24: asBin(bins.bin_24, 'bin_24'),\n bin_25: asBin(bins.bin_25, 'bin_25'),\n bin_26: asBin(bins.bin_26, 'bin_26'),\n bin_27: asBin(bins.bin_27, 'bin_27'),\n bin_28: asBin(bins.bin_28, 'bin_28'),\n bin_29: asBin(bins.bin_29, 'bin_29'),\n bin_30: asBin(bins.bin_30, 'bin_30'),\n bin_31: asBin(bins.bin_31, 'bin_31'),\n },\n }\n }\n}\n","import { Binary, Chunk } from 'cafe-utility'\nimport { EnvelopeWithBatchId } from '../types'\nimport { BatchId, PrivateKey } from '../utils/typed-bytes'\n\nexport class Stamper {\n signer: PrivateKey\n batchId: BatchId\n buckets: Uint32Array\n depth: number\n maxSlot: number\n\n private constructor(\n signer: PrivateKey | Uint8Array | string,\n batchId: BatchId | Uint8Array | string,\n buckets: Uint32Array,\n depth: number,\n ) {\n this.signer = new PrivateKey(signer)\n this.batchId = new BatchId(batchId)\n this.buckets = buckets\n this.depth = depth\n this.maxSlot = 2 ** (this.depth - 16)\n }\n\n static fromBlank(signer: PrivateKey | Uint8Array | string, batchId: BatchId | Uint8Array | string, depth: number) {\n return new Stamper(signer, batchId, new Uint32Array(65536), depth)\n }\n\n static fromState(\n signer: PrivateKey | Uint8Array | string,\n batchId: BatchId | Uint8Array | string,\n buckets: Uint32Array,\n depth: number,\n ) {\n return new Stamper(signer, batchId, buckets, depth)\n }\n\n stamp(chunk: Chunk): EnvelopeWithBatchId {\n const address = chunk.hash()\n const bucket = Binary.uint16ToNumber(address, 'BE')\n const height = this.buckets[bucket]\n\n if (height >= this.maxSlot) {\n throw Error('Bucket is full')\n }\n this.buckets[bucket]++\n const index = Binary.concatBytes(Binary.numberToUint32(bucket, 'BE'), Binary.numberToUint32(height, 'BE'))\n const timestamp = Binary.numberToUint64(BigInt(Date.now()), 'BE')\n const signature = this.signer.sign(Binary.concatBytes(address, this.batchId.toUint8Array(), index, timestamp))\n\n return {\n batchId: this.batchId,\n index,\n issuer: this.signer.publicKey().address().toUint8Array(),\n signature: signature.toUint8Array(),\n timestamp,\n }\n }\n\n getState(): Uint32Array {\n return this.buckets\n }\n}\n","import { BatchId, Topic } from './typed-bytes'\n\nexport const SWARM_GATEWAY_URL = 'https://api.gateway.ethswarm.org'\nexport const NULL_STAMP = new BatchId('0000000000000000000000000000000000000000000000000000000000000000')\nexport const NULL_TOPIC = new Topic('0000000000000000000000000000000000000000000000000000000000000000')\nexport const NULL_ADDRESS = new Uint8Array(32)\nexport const NULL_IDENTIFIER = new Uint8Array(32)\nexport const NULL_OWNER = new Uint8Array(20)\n","import { PSS_TARGET_HEX_LENGTH_MAX } from '../types'\nimport { PeerAddress } from './typed-bytes'\n\n/**\n * Utility function that for given strings/reference takes the most specific\n * target that Bee node will except.\n *\n * @param target is a non-prefixed hex string Bee address\n * @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)\n */\nexport function makeMaxTarget(target: PeerAddress | Uint8Array | string): string {\n target = new PeerAddress(target)\n\n return target.toHex().slice(0, PSS_TARGET_HEX_LENGTH_MAX)\n}\n","import { RedundancyLevel } from '..'\n\nconst mediumTable = [\n [94, 68, 46, 28, 14, 5, 1],\n [9, 8, 7, 6, 5, 4, 3],\n]\nconst encMediumTable = [\n [47, 34, 23, 14, 7, 2],\n [9, 8, 7, 6, 5, 4],\n]\nconst strongTable = [\n [104, 95, 86, 77, 69, 61, 53, 46, 39, 32, 26, 20, 15, 10, 6, 3, 1],\n [21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5],\n]\nconst encStrongTable = [\n [52, 47, 43, 38, 34, 30, 26, 23, 19, 16, 13, 10, 7, 5, 3, 1],\n [21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6],\n]\nconst insaneTable = [\n [92, 87, 82, 77, 73, 68, 63, 59, 54, 50, 45, 41, 37, 33, 29, 26, 22, 19, 16, 13, 10, 8, 5, 3, 2, 1],\n [31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6],\n]\nconst encInsaneTable = [\n [46, 43, 41, 38, 36, 34, 31, 29, 27, 25, 22, 20, 18, 16, 14, 13, 11, 9, 8, 6, 5, 4, 2, 1],\n [31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 7],\n]\nconst paranoidTable = [\n [\n 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9,\n 8, 7, 6, 5, 4, 3, 2, 1,\n ],\n [\n 90, 88, 87, 85, 84, 82, 81, 79, 77, 76, 74, 72, 71, 69, 67, 66, 64, 62, 60, 59, 57, 55, 53, 51, 49, 48, 46, 44, 41,\n 39, 37, 35, 32, 30, 27, 24, 20,\n ],\n]\nconst encParanoidTable = [\n [18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],\n [88, 85, 82, 79, 76, 72, 69, 66, 62, 59, 55, 51, 48, 44, 39, 35, 30, 24],\n]\n\n/**\n * Returns an approximate multiplier for the overhead of a given redundancy level.\n * Redundancy level is a tradeoff between storage overhead and fault tolerance.\n * Use this number to estimate the amount of chunks that will be stored for a given\n * redundancy level.\n */\nexport function approximateOverheadForRedundancyLevel(chunks: number, level: RedundancyLevel, encrypted: boolean) {\n if (level === RedundancyLevel.OFF) {\n return 0\n }\n\n const table = selectTable(level, encrypted)\n const [supportedChunks, parities] = table\n\n for (let i = 0; i < supportedChunks.length; i++) {\n if (chunks >= supportedChunks[i]) {\n return parities[i] / supportedChunks[i]\n }\n }\n\n return parities[parities.length - 1] / supportedChunks[supportedChunks.length - 1]\n}\n\nfunction selectTable(level: RedundancyLevel, encrypted: boolean) {\n switch (level) {\n case RedundancyLevel.MEDIUM:\n return encrypted ? encMediumTable : mediumTable\n case RedundancyLevel.STRONG:\n return encrypted ? encStrongTable : strongTable\n case RedundancyLevel.INSANE:\n return encrypted ? encInsaneTable : insaneTable\n case RedundancyLevel.PARANOID:\n return encrypted ? encParanoidTable : paranoidTable\n default:\n throw new Error(`Unknown redundancy level ${level}`)\n }\n}\n\ninterface RedundancyStats {\n label: string\n value: RedundancyLevel\n errorTolerance: number\n}\n\nconst medium = {\n label: 'medium',\n value: RedundancyLevel.MEDIUM,\n errorTolerance: 0.01,\n}\nconst strong = {\n label: 'strong',\n value: RedundancyLevel.STRONG,\n errorTolerance: 0.05,\n}\nconst insane = {\n label: 'insane',\n value: RedundancyLevel.INSANE,\n errorTolerance: 0.1,\n}\nconst paranoid = {\n label: 'paranoid',\n value: RedundancyLevel.PARANOID,\n errorTolerance: 0.5,\n}\n\nexport function getRedundancyStats(): {\n medium: RedundancyStats\n strong: RedundancyStats\n insane: RedundancyStats\n paranoid: RedundancyStats\n} {\n return {\n medium,\n strong,\n insane,\n paranoid,\n }\n}\n\nexport function getRedundancyStat(level?: string | RedundancyLevel): RedundancyStats {\n if (typeof level === 'string') {\n switch (level.toLowerCase()) {\n case 'medium':\n return medium\n case 'strong':\n return strong\n case 'insane':\n return insane\n case 'paranoid':\n return paranoid\n default:\n throw new Error(`Unknown redundancy level '${level}'`)\n }\n }\n\n switch (level) {\n case RedundancyLevel.MEDIUM:\n return medium\n case RedundancyLevel.STRONG:\n return strong\n case RedundancyLevel.INSANE:\n return insane\n case RedundancyLevel.PARANOID:\n return paranoid\n default:\n throw new Error(`Unknown redundancy level '${level}'`)\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","utils","require","settle","cookies","buildURL","buildFullPath","parseHeaders","isURLSameOrigin","transitionalDefaults","AxiosError","CanceledError","parseProtocol","platform","config","Promise","resolve","reject","onCanceled","requestData","data","requestHeaders","headers","responseType","withXSRFToken","done","cancelToken","unsubscribe","signal","removeEventListener","isFormData","isStandardBrowserEnv","request","XMLHttpRequest","auth","username","password","unescape","encodeURIComponent","Authorization","btoa","fullPath","baseURL","url","allowAbsoluteUrls","onloadend","responseHeaders","getAllResponseHeaders","response","responseText","status","statusText","value","err","open","method","toUpperCase","params","paramsSerializer","timeout","onreadystatechange","readyState","responseURL","indexOf","setTimeout","onabort","ECONNABORTED","onerror","ERR_NETWORK","ontimeout","timeoutErrorMessage","transitional","clarifyTimeoutError","ETIMEDOUT","isFunction","xsrfValue","xsrfHeaderName","xsrfCookieName","read","forEach","val","key","toLowerCase","setRequestHeader","isUndefined","withCredentials","onDownloadProgress","addEventListener","onUploadProgress","upload","cancel","type","abort","subscribe","aborted","protocol","protocols","ERR_BAD_REQUEST","send","bind","Axios","mergeConfig","defaults","formDataToJSON","axios","createInstance","defaultConfig","context","instance","prototype","extend","create","instanceConfig","CancelToken","isCancel","VERSION","toFormData","Cancel","all","promises","spread","isAxiosError","formToJSON","thing","isHTMLForm","FormData","executor","TypeError","resolvePromise","promise","token","then","_listeners","i","length","onfulfilled","_resolve","message","reason","throwIfRequested","listener","push","index","splice","source","c","call","ERR_CANCELED","name","inherits","__CANCEL__","InterceptorManager","dispatchRequest","validator","validators","interceptors","configOrUrl","undefined","assertOptions","silentJSONParsing","boolean","forcedJSONParsing","serialize","encode","function","requestInterceptorChain","synchronousRequestInterceptors","interceptor","runWhen","synchronous","unshift","fulfilled","rejected","responseInterceptorChain","chain","Array","apply","concat","shift","newConfig","onFulfilled","onRejected","error","getUri","generateHTTPMethod","isForm","code","Error","captureStackTrace","constructor","stack","toJSON","description","number","fileName","lineNumber","columnNumber","descriptors","Object","defineProperties","defineProperty","from","customProps","axiosError","toFlatObject","obj","cause","assign","handlers","use","options","eject","id","clear","fn","h","isAbsoluteURL","combineURLs","requestedURL","isRelativeURL","transformData","normalizeHeaderName","throwIfCancellationRequested","transformRequest","merge","common","adapter","transformResponse","config1","config2","getMergedValue","target","isPlainObject","isEmptyObject","isArray","slice","mergeDeepProperties","prop","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","keys","configValue","validateStatus","ERR_BAD_RESPONSE","Math","floor","fns","toURLEncodedForm","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","process","toString","isFileList","contentType","hasJSONContentType","isObjectPayload","isObject","JSON","stringify","isArrayBuffer","isBuffer","isStream","isFile","isBlob","isArrayBufferView","buffer","isURLSearchParams","formSerializer","_FormData","env","rawValue","parser","encoder","isString","parse","trim","e","stringifySafely","JSONRequested","strictJSONParsing","maxContentLength","maxBodyLength","classes","Blob","str","charMap","replace","match","AxiosURLSearchParams","_pairs","append","_encode","map","pair","join","thisArg","arguments","hashmarkIndex","serializedParams","serializeFn","relativeURL","write","expires","path","domain","secure","cookie","isNumber","Date","toGMTString","document","RegExp","decodeURIComponent","remove","now","formData","buildPath","isNumericKey","Number","isFinite","isLast","hasOwnProperty","arr","len","arrayToObject","entries","forEachEntry","matchAll","parsePropPath","test","payload","originURL","msie","navigator","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","host","search","hash","hostname","port","pathname","charAt","window","location","requestURL","parsed","normalizedName","ignoreDuplicateOf","split","line","exec","callback","envFormData","isVisitable","removeBrackets","endsWith","renderKey","dots","predicates","metaTokens","indexes","option","visitor","defaultVisitor","useBlob","Symbol","toStringTag","iterator","convertValue","isDate","toISOString","isTypedArray","Buffer","some","isFlatArray","toArray","el","exposedHelpers","build","pop","URLSearchParams","helpers","isNode","deprecatedWarnings","version","formatMessage","opt","desc","opts","ERR_DEPRECATED","console","warn","schema","allowUnknown","ERR_BAD_OPTION_VALUE","result","ERR_BAD_OPTION","isBrowser","cache","kindOf","kindOfTest","getPrototypeOf","l","TypedArray","Uint8Array","_hasOwnProperty","pattern","ArrayBuffer","isView","pipe","product","assignValue","a","b","stripBOM","content","charCodeAt","superConstructor","props","sourceObj","destObj","filter","propFilter","merged","getOwnPropertyNames","searchString","position","String","lastIndex","next","regExp","matches","_a","async","invertPromise","n","t","sleepMillis","shuffle","random","r","o","pickRandomIndices","range","intBetween","containsPoint","x","width","y","height","chance","pick","last","reduce","getDeep","setDeep","u","s","includes","f","roundToNearest","round","_readableState","isStrictlyObject","isEmptyArray","isBoolean","isBlank","isId","isInteger","isIntegerString","isHexString","symbolsArray","lowercaseAlphabet","alphanumericAlphabet","richAsciiAlphabet","unicodeTestingAlphabet","hexAlphabet","asString","min","max","RangeError","checkLimits","asNumber","parseFloat","asInteger","trunc","asObject","isUrl","enforceObjectShape","deepMergeInPlace","zip","pushAll","slugify","normalize","getFuzzyMatchScore","startsWith","htmlEntityMap","before","after","beforeLast","lastIndexOf","afterLast","splitOnce","splitAll","flatMap","getExtension","getBasename","shrinkTrim","capitalize","decapitalize","isLetter","isDigit","isLetterOrDigit","wordBreakCharacters","isWordBreakCharacter","indexOfRegex","lineMatches","every","allIndexOf","indexOfEarliest","indexOfWordBreak","indexOfHashtag","lastIndexOfBefore","findWeightedPair","extractBlock","wordBoundary","opening","start","closing","exclusive","BASE64_CHARS","BASE32_CHARS","baseToUint8Array","log2","uint8ArrayToBase","repeat","explodeReplace","breakLine","rest","findCommonPrefix","containsWord","readNextWord","resolveVariableWithDefaultSyntax","resolveRemainingVariablesWithDefaults","toQueryString","createTimeDigits","padStart","humanizeTime","absoluteDays","getTime","DefaultTimestampLabels","today","yesterday","monday","tuesday","wednesday","thursday","friday","saturday","sunday","weeks","DefaultTimeDeltaLabels","seconds","minutes","hours","days","getTimeDelta","labels","throttleTimers","timeUnits","m","d","dayNumberIndex","mapDayNumber","zeroBasedIndex","day","getDayInfoFromDate","getDay","dateUnits","ms","milli","millis","millisecond","milliseconds","sec","second","minute","hour","w","week","month","months","year","years","storageUnitExponents","byte","bytes","kb","kilobyte","kilobytes","mb","megabyte","megabytes","gb","gigabyte","gigabytes","tb","terabyte","terabytes","tinyCache","Map","joinUrl","replaceAll","sortObject","sort","localeCompare","sortAny","sortArray","deepEquals","pickRandomKey","thresholds","longNumberUnits","shortNumberUnits","makeNumber","isNaN","findIndex","clamp","getFlatNotation","flattenInner","indexArray","splitByCount","ceil","tokenizeByLength","sortObjectValues","fromEntries","group","pushToBidirectionalMap","has","set","delete","Optional","of","empty","mapAsync","ifPresent","ifPresentAsync","ifAbsent","ifAbsentAsync","getOrFallback","getOrFallbackAsync","getOrThrow","supplier","get","Node","children","log2Reduce","concatBytes","isPng","isJpg","isWebp","numberToUint64","DataView","setBigUint64","BigInt","numberToUint256","uint256ToNumber","partition","subarray","IOTA_CONSTANTS","keccakPermutate","p","g","$","A","E","M","O","k","T","S","R","I","C","P","D","B","v","U","L","N","j","z","F","W","q","H","V","J","K","Z","Q","G","Y","_","X","nn","en","tn","rn","on","un","cn","sn","ln","an","hn","dn","pn","mn","gn","wn","xn","yn","bytesToNumbers","divideToBlocks","absorb","squeeze","keccak256","fill","binaryPadStart","binaryPadEnd","mod","modInverse","modSqrt","modPow","SECP256K1_P","SECP256K1_N","SECP256K1_X","SECP256K1_Y","ellipticDouble","ellipticAdd","doubleAndAdd","signHash","Uint8ArrayReader","cursor","Uint8ArrayWriter","Chunk","span","writer","hashFunction","MerkleTree","counters","capacity","chunks","onChunk","NOOP","finalize","elevate","FixedPointNumber","scale","fromDecimalString","padEnd","add","assertSameScale","subtract","multiply","divmod","exchange","compare","toDecimalString","getArgument","requireStringArgument","bringToFrontInPlace","addPoint","multiplyPoint","pushPoint","cos","sin","getDistanceBetweenPoints","sqrt","filterCoordinates","isLeftmost","isRightmost","isTopmost","isBottommost","getCorners","isHorizontalLine","isVerticalLine","getSortedRayAngles","atan2","getAngleInRadians","getLineIntersectionPoint","raycast","end","PubSubChannel","subscribers","publish","getSubscriberCount","queue","running","onProcessed","onDrained","concurrency","finally","enqueue","drain","TrieRouter","forks","insert","handler","variableName","handle","values","current","hexToUint8Array","parseInt","uint8ArrayToHex","binaryToUint8Array","uint8ArrayToBinary","base64ToUint8Array","uint8ArrayToBase64","base32ToUint8Array","uint8ArrayToBase32","numberToUint8","uint8ToNumber","numberToUint16","setUint16","uint16ToNumber","getUint16","byteOffset","numberToUint32","setUint32","uint32ToNumber","getUint32","uint64ToNumber","getBigUint64","sliceBytes","sha3_256","proximity","commonPrefix","setBit","getBit","equals","padStartToMultiple","padEndToMultiple","xorCypher","isUtf8","privateKeyToPublicKey","compressPublicKey","publicKeyFromCompressed","publicKeyToAddress","signMessage","verifySignature","recoverPublicKey","checksumEncode","floatBetween","signed","makeSeededRng","point","procs","countUnique","makeUnique","splitBySize","indexCollection","onlyOrThrow","onlyOrNull","firstOrThrow","firstOrNull","initialize","initialize2D","rotate2D","containsShape","glue","pluck","pickMany","pickManyUnique","pickWeighted","pickGuaranteed","indexOfGuaranteed","makePipe","sortWeighted","unshiftAll","filterAndRemove","pushToBucket","unshiftAndLimit","atRolling","createOscillator","organiseWithLimits","tickPlaybook","ttlMax","ttl","progress","getBooleanArgument","getNumberArgument","requireNumberArgument","bringToFront","findInstance","find","filterInstances","interleave","toggle","createHierarchy","multicall","maxBy","forever","scheduleMany","waitFor","requiredConsecutivePasses","attempts","waitMillis","expandError","runAndSetInterval","setInterval","clearInterval","whereAmI","globalThis","browser","withRetries","attempt","allowedFailures","delayMillis","make","sum","average","median","getDistanceFromMidpoint","interpolate","createSequence","increment","decrement","format","longForm","unit","precision","toFixed","fromDecimals","substring","makeStorage","asMegabytes","convertBytes","hexToRgb","rgbToHex","haversineDistanceToMeters","PI","formatDistance","triangularNumber","searchFloat","binomialSample","SQRT2","toSignificantDigits","raceFulfilled","invert","runInParallelBatches","getTimestamp","getUTCHours","getUTCMinutes","secondsToHumanTime","countCycles","cycles","remaining","isoDate","throttle","timeSince","dateTimeSlug","unixTimestamp","fromUtcString","getTimezoneOffset","fromMillis","getProgress","deltaMs","baseTimeMs","totalTimeMs","remainingTimeMs","humanizeProgress","getDayInfoFromDateTimeString","normalizeTime","safeParse","deleteDeep","incrementDeep","ensureDeep","replaceDeep","getFirstDeep","deepMerge2","deepMerge3","mapAllAsync","cloneWithJson","deepEqualsEvery","runOn","zipSum","removeEmptyArrays","removeEmptyValues","flatten","unflatten","mapIterable","filterKeys","filterValues","rethrow","setSomeOnObject","setSomeDeep","flip","getAllPermutations","countTruthyValues","transformToArray","setMulti","incrementMulti","createBidirectionalMap","createTemporalBidirectionalMap","unshiftToBidirectionalMap","addToTemporalBidirectionalMap","validUntil","getFromTemporalBidirectionalMap","createStatefulToggle","diffKeys","uniqueToA","uniqueToB","mapRandomKey","fromObjectString","parseQueryString","hasKey","selectMax","reposition","unwrapSingleKey","parseKeyValues","errorMatches","isNullable","asHexString","strictPrefix","uneven","byteLength","asSafeString","asIntegerString","asFunction","asBoolean","asDate","asNullableString","asEmptiableString","asId","asTime","asArray","asNullableObject","asStringMap","asNumericDictionary","asUrl","asEmptiable","asNullable","asOptional","enforceArrayShape","isImage","tokenizeByCount","searchHex","searchSubstring","randomHex","randomLetter","randomAlphanumeric","randomRichAscii","randomUnicode","includesAny","normalForm","enumify","escapeHtml","decodeHtmlEntities","fromCharCode","betweenWide","betweenNarrow","getPreLine","containsWords","sortByFuzzyScore","randomize","expand","csvEscape","parseCsv","surroundInOut","normalizeEmail","normalizeFilename","parseFilename","basename","extension","filename","camelToTitle","slugToTitle","slugToCamel","joinHumanly","extractAllBlocks","replaceBlocks","parseHtmlAttributes","readWordsAfterAll","resolveVariables","isValidObjectPathCharacter","linesMatchInOrder","represent","resolveMarkdownLinks","buildUrl","isChinese","replaceBetweenStrings","describeMarkdown","isCapitalized","hasPunctuation","endsWithColon","isBalanced","textToFormat","splitFormatting","string","symbol","splitHashtags","splitUrls","route","generateVariants","variants","avoid","replaceWord","replacePascalCaseWords","stripHtml","measureTextWidth","toLines","levenshteinDistance","findCommonDirectory","asEqual","asTrue","asTruthy","asFalse","asFalsy","asEither","deleteExpired","size","subtractPoint","normalizePoint","findCorners","findLines","dx","dy","raycastCircle","formatArgs","args","useColors","namespace","humanize","diff","color","lastC","save","namespaces","storage","setItem","removeItem","load","getItem","DEBUG","__nwjs","documentElement","style","WebkitAppearance","firebug","exception","table","localStorage","localstorage","destroy","warned","colors","log","debug","formatters","createDebug","prevTime","namespacesCache","enabledCache","enableOverride","enabled","self","curr","prev","coerce","formatter","selectColor","enumerable","configurable","init","delimiter","newDebug","matchesTemplate","template","searchIndex","templateIndex","starIndex","matchIndex","default","disable","names","skips","enable","Boolean","ns","skip","abs","ws","WebSocket","MozWebSocket","global","plural","msAbs","isPlural","long","fmtLong","fmtShort","MAX_LENGTH","MAX_SAFE_INTEGER","safeRe","re","parseOptions","compareIdentifiers","SemVer","loose","includePrerelease","LOOSE","FULL","raw","major","minor","patch","prerelease","num","other","compareMain","comparePre","compareBuild","inc","release","identifier","identifierBase","base","MAX_SAFE_COMPONENT_LENGTH","MAX_SAFE_BUILD_LENGTH","RELEASE_TYPES","SEMVER_SPEC_VERSION","FLAG_INCLUDE_PRERELEASE","FLAG_LOOSE","NODE_DEBUG","numeric","anum","bnum","rcompareIdentifiers","looseOption","freeze","emptyOpts","src","LETTERDASHNUMBER","safeRegexReplacements","createToken","isGlobal","safe","makeSafeRegex","NUMERICIDENTIFIER","NUMERICIDENTIFIERLOOSE","NONNUMERICIDENTIFIER","PRERELEASEIDENTIFIER","PRERELEASEIDENTIFIERLOOSE","BUILDIDENTIFIER","MAINVERSION","PRERELEASE","BUILD","FULLPLAIN","MAINVERSIONLOOSE","PRERELEASELOOSE","LOOSEPLAIN","XRANGEIDENTIFIER","XRANGEIDENTIFIERLOOSE","GTLT","XRANGEPLAIN","XRANGEPLAINLOOSE","COERCEPLAIN","COERCE","COERCEFULL","LONETILDE","tildeTrimReplace","LONECARET","caretTrimReplace","comparatorTrimReplace","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","Function","Binary","Dates","Elliptic","Numbers","Objects","Strings","Pagination","System","Types","AsyncQueue","_debug","DECODER","TextDecoder","ENCODER","TextEncoder","Bytes","unknownInput","toHex","hex","toUint8Array","fromUtf8","utf8","fromSlice","offset","toBase64","toBase32","toUtf8","decode","parseSizeToBytes","sizeStr","kB","MB","GB","TB","PB","SWARM_MANIFEST_CODEC","SWARM_FEED_CODEC","CODEC_TABLE","PrivateKey","static","super","publicKey","PublicKey","sign","digest","Signature","address","EthAddress","toCompressedUint8Array","toCompressedHex","toChecksum","Identifier","fromString","Reference","decoded","cid","codec","reference","convertCidToReference","toCid","unknown","sha256","convertReferenceToCid","isValid","TransactionId","Span","fromBigInt","toBigInt","LENGTH","PeerAddress","BatchId","expectedAddress","Topic","MAX_UINT64","FeedIndex","BeeError","BeeArgumentError","BeeResponseError","responseBody","MAX_CHUNK_PAYLOAD_SIZE","SEGMENT_SIZE","calculateChunkAddress","chunkContent","rootHash","input","calculateBmtRootHash","chunkHash","BeeModes","toBeeMode","LIGHT","ULTRA_LIGHT","DEV","SECTION_SIZE","BRANCHES","CHUNK_SIZE","PSS_TARGET_HEX_LENGTH_MAX","STAMPS_DEPTH_MIN","STAMPS_DEPTH_MAX","TAGS_LIMIT_MIN","TAGS_LIMIT_MAX","RedundancyLevel","RedundancyStrategy","capacityBreakpoints","ENCRYPTION_OFF","OFF","theoreticalVolume","effectiveVolume","batchDepth","utilizationRate","MEDIUM","STRONG","INSANE","PARANOID","ENCRYPTION_ON","Duration","fromMilliseconds","fromSeconds","fromHours","fromDays","fromWeeks","fromYears","fromEndDate","endDate","startDate","parseFromString","duration","toSeconds","toHours","toDays","toWeeks","toYears","toEndDate","isZero","BZZ","state","DIGITS","fromPLUR","plur","toPLURString","toPLURBigInt","digits","plus","minus","divide","gt","gte","lt","lte","eq","exchangeToDAI","daiPerBzz","DAI","fromWei","toWeiBigInt","wei","toWeiString","exchangeToBZZ","file","File","stream","arrayBuffer","isReadable","asNumberString","prepareDownloadOptions","object","redundancyStrategy","fallback","timeoutMs","actPublisher","actHistoryAddress","actTimestamp","prepareUploadOptions","act","deferred","encrypt","pin","tag","prepareCollectionUploadOptions","uploadOptions","errorDocument","indexDocument","redundancyLevel","preparePostageBatchOptions","gasPrice","immutableFlag","label","waitForUsable","waitForUsableTimeout","prepareTransactionOptions","gasLimit","assertData","makeTagUid","tagUid","uid","isTag","MAX_UTILIZATION","getStampUsage","utilization","depth","bucketDepth","pow","getStampTheoreticalBytes","effectiveSizeBreakpoints","getStampEffectiveBytes","encryption","erasureCodeLevel","entry","item","breakpoint","getStampEffectiveBytesBreakpoints","getStampCost","amount","getStampDuration","pricePerBlock","blockTime","amountBigInt","getAmountForDuration","getDepthForSize","toBytes","sizeBreakpoint","convertEnvelopeToMarshaledStamp","envelope","signature","batchId","timestamp","marshalStamp","readFileHeaders","header","dispositionMatch","readContentDispositionFilename","readTagUid","prepareRequestHeaders","stamp","nullableOptions","issuer","isEnvelopeWithBatchId","MAX_FAILED_ATTEMPTS","DELAY_FAST","DELAY_SLOW","DELAY_THRESHOLD","DEFAULT_HTTP_CONFIG","accept","Infinity","http","requestConfig","failedAttempts","maybeRunOnRequestHook","endlesslyRetry","onRequest","endpoint","download","requestOptions","socEndpoint","SOC_SIGNATURE_OFFSET","SOC_SPAN_OFFSET","SOC_PAYLOAD_OFFSET","unmarshalSingleOwnerChunk","ownerAddress","chunkAddress","recoverChunkOwner","socAddress","owner","makeSOCAddress","makeSingleOwnerChunk","signer","uploadSingleOwnerChunk","chunk","sig","body","historyAddress","socAPI","uploadSingleOwnerChunkData","makeContentAddressedChunk","toSingleOwnerChunk","uploadSingleOwnerChunkWithWrappedChunk","wrappedChunk","downloadSingleOwnerChunk","chunkAPI","MIN_PAYLOAD_SIZE","MAX_PAYLOAD_SIZE","unmarshalContentAddressedChunk","rawPayload","typedSpan","postageBatchId","resource","feedEndpoint","readFeedUpdateHeaders","feedIndex","feedIndexNext","fetchLatestFeedUpdate","topic","ResourceLocator","makeFeedIdentifier","findNextIndex","feedUpdate","getFeedUpdateChunkReference","downloadFeedUpdate","hasTimestamp","soc","timestampBytes","downloadFeedUpdateAsCAC","makeFeedReader","update","downloadPayload","cac","downloadReference","probeFeed","makeFeedWriter","at","updateFeedWithReference","uploadReference","uploadPayload","uploadResult","updateFeedWithPayload","areAllSequentialFeedsUpdateRetrievable","bee","chunkRetrievablePromises","count","updateReferences","getAllSequenceUpdateReferences","downloadChunk","isChunkRetrievable","assertCollection","isCollection","makeFilePath","webkitRelativePath","makeCollectionFromFileList","fileList","getCollectionSize","TarStream","output","PassThrough","currentFileSize","beginFile","alloc","modTime","checksum","createHeader","appendFile","once","endFile","padding","uploadTar","collection","tarStream","responsePromise","fsPath","createReadStream","close","writeTar","bzzEndpoint","uploadFile","uploadCollection","balancesEndpoint","consumedEndpoint","chequebookEndpoint","getLastCashoutAction","peer","uncashedAmount","transactionHash","lastCashedCheque","asCheque","recipient","lastPayout","bounced","asCashoutResult","beneficiary","chequebook","payout","asBin","bin","disconnectedPeers","connectedPeers","population","connected","settlementsEndpoint","STAKE_ENDPOINT","Size","fromBytes","fromKilobytes","fromMegabytes","fromGigabytes","toGigabytes","toFormattedString","normalizeBatchTTL","batchTTL","STAMPS_ENDPOINT","getGlobalPostageBatches","batches","batchID","immutable","getAllPostageBatches","stamps","usage","effectiveBytes","usable","blockNumber","usageText","remainingSize","theoreticalSize","calculateSize","calculateRemainingSize","WALLET_ENDPOINT","SUPPORTED_BEE_VERSION_EXACT","SUPPORTED_BEE_VERSION","SUPPORTED_API_VERSION","getHealth","apiVersion","transactionsEndpoint","toTransaction","to","nonce","created","granteeEndpoint","PINNING_ENDPOINT","checkConnection","stewardshipEndpoint","PATH_SEPARATOR","VERSION_02_HASH","Fork","prefix","node","commonPart","remainingB","parent","remainingA","MantarayNode","newAFork","newBFork","marshal","selfAddress","determineType","prefixLength","metadata","metadataBytes","metadataLengthBytes","unmarshal","reader","addressLength","isType","metadataLength","obfuscationKey","targetAddress","fullPathString","getRootMetadata","getDocsMetadata","resolveFeed","fork","calculateSelfAddress","NULL_ADDRESS","forkBitmap","downloadData","unmarshalFromData","decrypted","versionHash","targetAddressLength","newFork","addFork","tip","bestMatch","matchedPath","findClosest","remainingPath","existing","removeFork","saveRecursively","ref","uploadData","loadRecursively","downloadOptions","closest","collect","nodes","collectAndMap","makeCollectionFromFS","dir","buildCollectionRelative","relativePath","dirname","fs","opendir","entryPath","stat","isDirectory","getFolderSize","mimes","aac","abw","ai","arc","avi","azw","bz","bz2","csh","css","csv","doc","dll","dmg","eot","epub","gif","htm","html","ico","ics","jar","jpeg","jpg","js","json","mid","midi","mp2","mp3","mp4","mpa","mpe","mpeg","mpkg","odp","ods","odt","oga","ogv","ogx","otf","png","pdf","ppt","rar","rtf","sh","svg","swf","tar","tif","tiff","ts","ttf","txt","vsd","wav","weba","webm","webp","woff","woff2","xhtml","xls","xlsx","xml","xul","maybeEnrichMime","mime","prepareWebsocketData","assertBeeUrl","urlObject","URL","isValidBeeUrl","Bee","stripLastSlash","network","httpAgent","httpsAgent","prepareRedundantUploadOptions","getRequestOptionsForCall","probeData","contentLength","downloadReadableData","uploadChunk","isSOC","createGrantees","grantees","historyref","grantee","getGrantees","patchGrantees","history","historyRef","revoke","assertFileData","prepareFileUploadOptions","fileData","fr","FileReader","onload","readAsArrayBuffer","fileArrayBuffer","fileOptions","bzz","downloadFile","downloadReadableFile","uploadFiles","hashDirectory","files","mantaray","tree","readStream","rootChunk","Filename","streamDirectory","total","processed","fileSize","chunksAtLevel","chunkCount","hasIndexHtml","streamFiles","uploadFilesFromDirectory","createTag","seen","sent","startedAt","stored","synced","getAllTags","limit","prepareAllTagsOptions","tags","retrieveTag","deleteTag","updateTag","pinning","unpin","getAllPins","references","getPin","reuploadPinnedData","stewardship","isReferenceRetrievable","isRetrievable","isFeedRetrievable","pssSend","pss","pssSubscribe","onMessage","onError","onClose","preparePssMessageHandler","wsUrl","cancelled","subscription","terminate","onmessage","event","onclose","pssReceive","timeoutMsec","clearTimeout","gsocMine","targetOverlay","gsocSend","gsoc","gsocSubscribe","prepareGsocMessageHandler","createFeedManifest","calculateSingleOwnerChunkAddress","makeSOCReader","makeSOCWriter","createEnvelope","postEnvelope","rchash","anchor1","anchor2","durationSeconds","isConnected","isGateway","gateway","getNodeAddresses","overlay","underlay","ethereum","pssPublicKey","connectivity","getBlocklist","peers","getPeers","fullNode","removePeer","getTopology","bins","baseAddr","nnLowWatermark","reachability","networkAvailability","bin_0","bin_1","bin_2","bin_3","bin_4","bin_5","bin_6","bin_7","bin_8","bin_9","bin_10","bin_11","bin_12","bin_13","bin_14","bin_15","bin_16","bin_17","bin_18","bin_19","bin_20","bin_21","bin_22","bin_23","bin_24","bin_25","bin_26","bin_27","bin_28","bin_29","bin_30","bin_31","pingPeer","getAllBalances","balances","balance","getPeerBalance","getPastDueConsumptionBalances","getPastDueConsumptionPeerBalance","getChequebookAddress","chequebookAddress","getChequebookBalance","availableBalance","totalBalance","getLastCheques","lastcheques","lastreceived","lastsent","getLastChequesForPeer","cashoutLastCheque","depositTokens","depositBZZToChequebook","amountString","gasPriceString","withdrawTokens","withdrawBZZFromChequebook","withdrawBZZToExternalWallet","states","withdrawDAIToExternalWallet","getSettlements","received","settlements","getAllSettlements","totalSent","totalReceived","getStatus","beeMode","reserveSize","reserveSizeWithinRadius","pullsyncRate","storageRadius","neighborhoodSize","batchCommitment","isReachable","lastSyncedBlock","committedDepth","isWarmingUp","debugStatus","getReadiness","getNodeInfo","chequebookEnabled","swapEnabled","isSupportedExactVersion","isSupportedApiVersion","getMajorSemver","getVersions","supportedBeeVersion","supportedBeeApiVersion","beeVersion","beeApiVersion","getReserveState","commitment","radius","getChainState","block","chainTip","totalAmount","currentPrice","getWalletBalance","bzzBalance","nativeTokenBalance","chainID","chequebookContractAddress","walletAddress","createPostageBatch","chainState","minimumAmount","waitForUsablePostageStamp","buyStorage","getStorageCost","extendStorage","batch","getPostageBatch","depthDelta","multiplier","additionalAmount","currentAmount","amountDelta","transactionId","topUpBatch","diluteBatch","extendStorageSize","delta","extendStorageDuration","getExtensionCost","currentCost","getSizeExtensionCost","getDurationExtensionCost","getPostageBatchBuckets","bucketUpperBound","buckets","bucketID","collisions","getAllPostageBatch","getAllGlobalPostageBatch","getPostageBatches","getAllPendingTransactions","pendingTransactions","transactions","getPendingTransaction","rebroadcastPendingTransaction","cancelPendingTransaction","getStake","stakedAmount","stake","getWithdrawableStake","withdrawableAmount","withdrawSurplusStake","txHash","migrateStake","depositStake","repsonse","getRedistributionState","minimumGasFunds","hasSufficientFunds","isFrozen","isFullySynced","phase","lastWonRound","lastPlayedRound","lastFrozenRound","lastSelectedRound","lastSampleDurationSeconds","reward","fees","isHealthy","time","prepareBeeRequestOptions","BeeDev","Stamper","maxSlot","fromBlank","Uint32Array","fromState","bucket","getState","SWARM_GATEWAY_URL","NULL_STAMP","NULL_TOPIC","NULL_IDENTIFIER","NULL_OWNER","makeMaxTarget","mediumTable","encMediumTable","strongTable","encStrongTable","insaneTable","encInsaneTable","paranoidTable","encParanoidTable","approximateOverheadForRedundancyLevel","level","encrypted","selectTable","supportedChunks","parities","medium","errorTolerance","strong","insane","paranoid","getRedundancyStats","getRedundancyStat"],"sourceRoot":""}
|