text: /*
   * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
   * This devtool is neither made for production nor for readable output files.
   * It uses "eval()" calls to create a separate source file in the browser devtools.
   * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
   * or disable the default devtool with "devtool: false".
   * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
   */
  var Nakama;
  /******/ (() => { // webpackBootstrap
  /******/ 	var __webpack_modules__ = ({
  
  /***/ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js":
  /*!*****************************************************************!*\
    !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
    \*****************************************************************/
  /***/ ((module) => {
  
  eval("function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n  try {\n    var info = gen[key](arg);\n    var value = info.value;\n  } catch (error) {\n    reject(error);\n    return;\n  }\n\n  if (info.done) {\n    resolve(value);\n  } else {\n    Promise.resolve(value).then(_next, _throw);\n  }\n}\n\nfunction _asyncToGenerator(fn) {\n  return function () {\n    var self = this,\n        args = arguments;\n    return new Promise(function (resolve, reject) {\n      var gen = fn.apply(self, args);\n\n      function _next(value) {\n        asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n      }\n\n      function _throw(err) {\n        asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n      }\n\n      _next(undefined);\n    });\n  };\n}\n\nmodule.exports = _asyncToGenerator;\n\n//# sourceURL=webpack://Nakama/./node_modules/@babel/runtime/helpers/asyncToGenerator.js?");
  
  /***/ }),
  
  /***/ "./node_modules/@babel/runtime/helpers/classCallCheck.js":
  /*!***************************************************************!*\
    !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
    \***************************************************************/
  /***/ ((module) => {
  
  eval("function _classCallCheck(instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n}\n\nmodule.exports = _classCallCheck;\n\n//# sourceURL=webpack://Nakama/./node_modules/@babel/runtime/helpers/classCallCheck.js?");
  
  /***/ }),
  
  /***/ "./node_modules/@babel/runtime/helpers/createClass.js":
  /*!************************************************************!*\
    !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
    \************************************************************/
  /***/ ((module) => {
  
  eval("function _defineProperties(target, props) {\n  for (var i = 0; i < props.length; i++) {\n    var descriptor = props[i];\n    descriptor.enumerable = descriptor.enumerable || false;\n    descriptor.configurable = true;\n    if (\"value\" in descriptor) descriptor.writable = true;\n    Object.defineProperty(target, descriptor.key, descriptor);\n  }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n  if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n  if (staticProps) _defineProperties(Constructor, staticProps);\n  return Constructor;\n}\n\nmodule.exports = _createClass;\n\n//# sourceURL=webpack://Nakama/./node_modules/@babel/runtime/helpers/createClass.js?");
  
  /***/ }),
  
  /***/ "./node_modules/@babel/runtime/helpers/defineProperty.js":
  /*!***************************************************************!*\
    !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
    \***************************************************************/
  /***/ ((module) => {
  
  eval("function _defineProperty(obj, key, value) {\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n\n  return obj;\n}\n\nmodule.exports = _defineProperty;\n\n//# sourceURL=webpack://Nakama/./node_modules/@babel/runtime/helpers/defineProperty.js?");
  
  /***/ }),
  
  /***/ "./node_modules/@babel/runtime/regenerator/index.js":
  /*!**********************************************************!*\
    !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
    \**********************************************************/
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  
  eval("module.exports = __webpack_require__(/*! regenerator-runtime */ \"./node_modules/regenerator-runtime/runtime.js\");\n\n\n//# sourceURL=webpack://Nakama/./node_modules/@babel/runtime/regenerator/index.js?");
  
  /***/ }),
  
  /***/ "./node_modules/@heroiclabs/nakama-js/dist/nakama-js.esm.js":
  /*!******************************************************************!*\
    !*** ./node_modules/@heroiclabs/nakama-js/dist/nakama-js.esm.js ***!
    \******************************************************************/
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  
  "use strict";
  eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"Client\": () => (/* binding */ Client),\n/* harmony export */   \"DefaultSocket\": () => (/* binding */ DefaultSocket),\n/* harmony export */   \"Session\": () => (/* binding */ Session),\n/* harmony export */   \"WebSocketAdapterText\": () => (/* binding */ WebSocketAdapterText)\n/* harmony export */ });\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __assign = Object.assign;\nvar __markAsModule = (target) => __defProp(target, \"__esModule\", {value: true});\nvar __commonJS = (callback, module) => () => {\n  if (!module) {\n    module = {exports: {}};\n    callback(module.exports, module);\n  }\n  return module.exports;\n};\nvar __exportStar = (target, module, desc) => {\n  __markAsModule(target);\n  if (module && typeof module === \"object\" || typeof module === \"function\") {\n    for (let key of __getOwnPropNames(module))\n      if (!__hasOwnProp.call(target, key) && key !== \"default\")\n        __defProp(target, key, {get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable});\n  }\n  return target;\n};\nvar __toModule = (module) => {\n  if (module && module.__esModule)\n    return module;\n  return __exportStar(__defProp(module != null ? __create(__getProtoOf(module)) : {}, \"default\", {value: module, enumerable: true}), module);\n};\nvar __async = (__this, __arguments, generator) => {\n  return new Promise((resolve, reject) => {\n    var fulfilled = (value) => {\n      try {\n        step(generator.next(value));\n      } catch (e) {\n        reject(e);\n      }\n    };\n    var rejected = (value) => {\n      try {\n        step(generator.throw(value));\n      } catch (e) {\n        reject(e);\n      }\n    };\n    var step = (result) => {\n      return result.done ? resolve(result.value) : Promise.resolve(result.value).then(fulfilled, rejected);\n    };\n    step((generator = generator.apply(__this, __arguments)).next());\n  });\n};\n\n// node_modules/whatwg-fetch/fetch.js\nvar require_fetch = __commonJS((exports) => {\n  (function(self2) {\n    \"use strict\";\n    if (self2.fetch) {\n      return;\n    }\n    var support = {\n      searchParams: \"URLSearchParams\" in self2,\n      iterable: \"Symbol\" in self2 && \"iterator\" in Symbol,\n      blob: \"FileReader\" in self2 && \"Blob\" in self2 && function() {\n        try {\n          new Blob();\n          return true;\n        } catch (e) {\n          return false;\n        }\n      }(),\n      formData: \"FormData\" in self2,\n      arrayBuffer: \"ArrayBuffer\" in self2\n    };\n    if (support.arrayBuffer) {\n      var viewClasses = [\n        \"[object Int8Array]\",\n        \"[object Uint8Array]\",\n        \"[object Uint8ClampedArray]\",\n        \"[object Int16Array]\",\n        \"[object Uint16Array]\",\n        \"[object Int32Array]\",\n        \"[object Uint32Array]\",\n        \"[object Float32Array]\",\n        \"[object Float64Array]\"\n      ];\n      var isDataView = function(obj) {\n        return obj && DataView.prototype.isPrototypeOf(obj);\n      };\n      var isArrayBufferView = ArrayBuffer.isView || function(obj) {\n        return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;\n      };\n    }\n    function normalizeName(name) {\n      if (typeof name !== \"string\") {\n        name = String(name);\n      }\n      if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n        throw new TypeError(\"Invalid character in header field name\");\n      }\n      return name.toLowerCase();\n    }\n    function normalizeValue(value) {\n      if (typeof value !== \"string\") {\n        value = String(value);\n      }\n      return value;\n    }\n    function iteratorFor(items) {\n      var iterator = {\n        next: function() {\n          var value = items.shift();\n          return {done: value === void 0, value};\n        }\n      };\n      if (support.iterable) {\n        iterator[Symbol.iterator] = function() {\n          return iterator;\n        };\n      }\n      return iterator;\n    }\n    function Headers(headers) {\n      this.map = {};\n      if (headers instanceof Headers) {\n        headers.forEach(function(value, name) {\n          this.append(name, value);\n        }, this);\n      } else if (Array.isArray(headers)) {\n        headers.forEach(function(header) {\n          this.append(header[0], header[1]);\n        }, this);\n      } else if (headers) {\n        Object.getOwnPropertyNames(headers).forEach(function(name) {\n          this.append(name, headers[name]);\n        }, this);\n      }\n    }\n    Headers.prototype.append = function(name, value) {\n      name = normalizeName(name);\n      value = normalizeValue(value);\n      var oldValue = this.map[name];\n      this.map[name] = oldValue ? oldValue + \",\" + value : value;\n    };\n    Headers.prototype[\"delete\"] = function(name) {\n      delete this.map[normalizeName(name)];\n    };\n    Headers.prototype.get = function(name) {\n      name = normalizeName(name);\n      return this.has(name) ? this.map[name] : null;\n    };\n    Headers.prototype.has = function(name) {\n      return this.map.hasOwnProperty(normalizeName(name));\n    };\n    Headers.prototype.set = function(name, value) {\n      this.map[normalizeName(name)] = normalizeValue(value);\n    };\n    Headers.prototype.forEach = function(callback, thisArg) {\n      for (var name in this.map) {\n        if (this.map.hasOwnProperty(name)) {\n          callback.call(thisArg, this.map[name], name, this);\n        }\n      }\n    };\n    Headers.prototype.keys = function() {\n      var items = [];\n      this.forEach(function(value, name) {\n        items.push(name);\n      });\n      return iteratorFor(items);\n    };\n    Headers.prototype.values = function() {\n      var items = [];\n      this.forEach(function(value) {\n        items.push(value);\n      });\n      return iteratorFor(items);\n    };\n    Headers.prototype.entries = function() {\n      var items = [];\n      this.forEach(function(value, name) {\n        items.push([name, value]);\n      });\n      return iteratorFor(items);\n    };\n    if (support.iterable) {\n      Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n    }\n    function consumed(body) {\n      if (body.bodyUsed) {\n        return Promise.reject(new TypeError(\"Already read\"));\n      }\n      body.bodyUsed = true;\n    }\n    function fileReaderReady(reader) {\n      return new Promise(function(resolve, reject) {\n        reader.onload = function() {\n          resolve(reader.result);\n        };\n        reader.onerror = function() {\n          reject(reader.error);\n        };\n      });\n    }\n    function readBlobAsArrayBuffer(blob) {\n      var reader = new FileReader();\n      var promise = fileReaderReady(reader);\n      reader.readAsArrayBuffer(blob);\n      return promise;\n    }\n    function readBlobAsText(blob) {\n      var reader = new FileReader();\n      var promise = fileReaderReady(reader);\n      reader.readAsText(blob);\n      return promise;\n    }\n    function readArrayBufferAsText(buf) {\n      var view = new Uint8Array(buf);\n      var chars = new Array(view.length);\n      for (var i = 0; i < view.length; i++) {\n        chars[i] = String.fromCharCode(view[i]);\n      }\n      return chars.join(\"\");\n    }\n    function bufferClone(buf) {\n      if (buf.slice) {\n        return buf.slice(0);\n      } else {\n        var view = new Uint8Array(buf.byteLength);\n        view.set(new Uint8Array(buf));\n        return view.buffer;\n      }\n    }\n    function Body() {\n      this.bodyUsed = false;\n      this._initBody = function(body) {\n        this._bodyInit = body;\n        if (!body) {\n          this._bodyText = \"\";\n        } else if (typeof body === \"string\") {\n          this._bodyText = body;\n        } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n          this._bodyBlob = body;\n        } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n          this._bodyFormData = body;\n        } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n          this._bodyText = body.toString();\n        } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n          this._bodyArrayBuffer = bufferClone(body.buffer);\n          this._bodyInit = new Blob([this._bodyArrayBuffer]);\n        } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n          this._bodyArrayBuffer = bufferClone(body);\n        } else {\n          throw new Error(\"unsupported BodyInit type\");\n        }\n        if (!this.headers.get(\"content-type\")) {\n          if (typeof body === \"string\") {\n            this.headers.set(\"content-type\", \"text/plain;charset=UTF-8\");\n          } else if (this._bodyBlob && this._bodyBlob.type) {\n            this.headers.set(\"content-type\", this._bodyBlob.type);\n          } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n            this.headers.set(\"content-type\", \"application/x-www-form-urlencoded;charset=UTF-8\");\n          }\n        }\n      };\n      if (support.blob) {\n        this.blob = function() {\n          var rejected = consumed(this);\n          if (rejected) {\n            return rejected;\n          }\n          if (this._bodyBlob) {\n            return Promise.resolve(this._bodyBlob);\n          } else if (this._bodyArrayBuffer) {\n            return Promise.resolve(new Blob([this._bodyArrayBuffer]));\n          } else if (this._bodyFormData) {\n            throw new Error(\"could not read FormData body as blob\");\n          } else {\n            return Promise.resolve(new Blob([this._bodyText]));\n          }\n        };\n        this.arrayBuffer = function() {\n          if (this._bodyArrayBuffer) {\n            return consumed(this) || Promise.resolve(this._bodyArrayBuffer);\n          } else {\n            return this.blob().then(readBlobAsArrayBuffer);\n          }\n        };\n      }\n      this.text = function() {\n        var rejected = consumed(this);\n        if (rejected) {\n          return rejected;\n        }\n        if (this._bodyBlob) {\n          return readBlobAsText(this._bodyBlob);\n        } else if (this._bodyArrayBuffer) {\n          return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));\n        } else if (this._bodyFormData) {\n          throw new Error(\"could not read FormData body as text\");\n        } else {\n          return Promise.resolve(this._bodyText);\n        }\n      };\n      if (support.formData) {\n        this.formData = function() {\n          return this.text().then(decode2);\n        };\n      }\n      this.json = function() {\n        return this.text().then(JSON.parse);\n      };\n      return this;\n    }\n    var methods = [\"DELETE\", \"GET\", \"HEAD\", \"OPTIONS\", \"POST\", \"PUT\"];\n    function normalizeMethod(method) {\n      var upcased = method.toUpperCase();\n      return methods.indexOf(upcased) > -1 ? upcased : method;\n    }\n    function Request(input, options) {\n      options = options || {};\n      var body = options.body;\n      if (input instanceof Request) {\n        if (input.bodyUsed) {\n          throw new TypeError(\"Already read\");\n        }\n        this.url = input.url;\n        this.credentials = input.credentials;\n        if (!options.headers) {\n          this.headers = new Headers(input.headers);\n        }\n        this.method = input.method;\n        this.mode = input.mode;\n        if (!body && input._bodyInit != null) {\n          body = input._bodyInit;\n          input.bodyUsed = true;\n        }\n      } else {\n        this.url = String(input);\n      }\n      this.credentials = options.credentials || this.credentials || \"omit\";\n      if (options.headers || !this.headers) {\n        this.headers = new Headers(options.headers);\n      }\n      this.method = normalizeMethod(options.method || this.method || \"GET\");\n      this.mode = options.mode || this.mode || null;\n      this.referrer = null;\n      if ((this.method === \"GET\" || this.method === \"HEAD\") && body) {\n        throw new TypeError(\"Body not allowed for GET or HEAD requests\");\n      }\n      this._initBody(body);\n    }\n    Request.prototype.clone = function() {\n      return new Request(this, {body: this._bodyInit});\n    };\n    function decode2(body) {\n      var form = new FormData();\n      body.trim().split(\"&\").forEach(function(bytes) {\n        if (bytes) {\n          var split = bytes.split(\"=\");\n          var name = split.shift().replace(/\\+/g, \" \");\n          var value = split.join(\"=\").replace(/\\+/g, \" \");\n          form.append(decodeURIComponent(name), decodeURIComponent(value));\n        }\n      });\n      return form;\n    }\n    function parseHeaders(rawHeaders) {\n      var headers = new Headers();\n      var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, \" \");\n      preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n        var parts = line.split(\":\");\n        var key = parts.shift().trim();\n        if (key) {\n          var value = parts.join(\":\").trim();\n          headers.append(key, value);\n        }\n      });\n      return headers;\n    }\n    Body.call(Request.prototype);\n    function Response(bodyInit, options) {\n      if (!options) {\n        options = {};\n      }\n      this.type = \"default\";\n      this.status = options.status === void 0 ? 200 : options.status;\n      this.ok = this.status >= 200 && this.status < 300;\n      this.statusText = \"statusText\" in options ? options.statusText : \"OK\";\n      this.headers = new Headers(options.headers);\n      this.url = options.url || \"\";\n      this._initBody(bodyInit);\n    }\n    Body.call(Response.prototype);\n    Response.prototype.clone = function() {\n      return new Response(this._bodyInit, {\n        status: this.status,\n        statusText: this.statusText,\n        headers: new Headers(this.headers),\n        url: this.url\n      });\n    };\n    Response.error = function() {\n      var response = new Response(null, {status: 0, statusText: \"\"});\n      response.type = \"error\";\n      return response;\n    };\n    var redirectStatuses = [301, 302, 303, 307, 308];\n    Response.redirect = function(url, status) {\n      if (redirectStatuses.indexOf(status) === -1) {\n        throw new RangeError(\"Invalid status code\");\n      }\n      return new Response(null, {status, headers: {location: url}});\n    };\n    self2.Headers = Headers;\n    self2.Request = Request;\n    self2.Response = Response;\n    self2.fetch = function(input, init) {\n      return new Promise(function(resolve, reject) {\n        var request = new Request(input, init);\n        var xhr = new XMLHttpRequest();\n        xhr.onload = function() {\n          var options = {\n            status: xhr.status,\n            statusText: xhr.statusText,\n            headers: parseHeaders(xhr.getAllResponseHeaders() || \"\")\n          };\n          options.url = \"responseURL\" in xhr ? xhr.responseURL : options.headers.get(\"X-Request-URL\");\n          var body = \"response\" in xhr ? xhr.response : xhr.responseText;\n          resolve(new Response(body, options));\n        };\n        xhr.onerror = function() {\n          reject(new TypeError(\"Network request failed\"));\n        };\n        xhr.ontimeout = function() {\n          reject(new TypeError(\"Network request failed\"));\n        };\n        xhr.open(request.method, request.url, true);\n        if (request.credentials === \"include\") {\n          xhr.withCredentials = true;\n        } else if (request.credentials === \"omit\") {\n          xhr.withCredentials = false;\n        }\n        if (\"responseType\" in xhr && support.blob) {\n          xhr.responseType = \"blob\";\n        }\n        request.headers.forEach(function(value, name) {\n          xhr.setRequestHeader(name, value);\n        });\n        xhr.send(typeof request._bodyInit === \"undefined\" ? null : request._bodyInit);\n      });\n    };\n    self2.fetch.polyfill = true;\n  })(typeof self !== \"undefined\" ? self : exports);\n});\n\n// index.ts\nvar import_whatwg_fetch = __toModule(require_fetch());\n\n// node_modules/js-base64/base64.mjs\nvar _hasatob = typeof atob === \"function\";\nvar _hasbtoa = typeof btoa === \"function\";\nvar _hasBuffer = typeof Buffer === \"function\";\nvar _TD = typeof TextDecoder === \"function\" ? new TextDecoder() : void 0;\nvar _TE = typeof TextEncoder === \"function\" ? new TextEncoder() : void 0;\nvar b64ch = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\nvar b64chs = [...b64ch];\nvar b64tab = ((a) => {\n  let tab = {};\n  a.forEach((c, i) => tab[c] = i);\n  return tab;\n})(b64chs);\nvar b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nvar _fromCC = String.fromCharCode.bind(String);\nvar _U8Afrom = typeof Uint8Array.from === \"function\" ? Uint8Array.from.bind(Uint8Array) : (it, fn = (x) => x) => new Uint8Array(Array.prototype.slice.call(it, 0).map(fn));\nvar _mkUriSafe = (src) => src.replace(/[+\\/]/g, (m0) => m0 == \"+\" ? \"-\" : \"_\").replace(/=+$/m, \"\");\nvar _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, \"\");\nvar btoaPolyfill = (bin) => {\n  let u32, c0, c1, c2, asc = \"\";\n  const pad = bin.length % 3;\n  for (let i = 0; i < bin.length; ) {\n    if ((c0 = bin.charCodeAt(i++)) > 255 || (c1 = bin.charCodeAt(i++)) > 255 || (c2 = bin.charCodeAt(i++)) > 255)\n      throw new TypeError(\"invalid character found\");\n    u32 = c0 << 16 | c1 << 8 | c2;\n    asc += b64chs[u32 >> 18 & 63] + b64chs[u32 >> 12 & 63] + b64chs[u32 >> 6 & 63] + b64chs[u32 & 63];\n  }\n  return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\nvar _btoa = _hasbtoa ? (bin) => btoa(bin) : _hasBuffer ? (bin) => Buffer.from(bin, \"binary\").toString(\"base64\") : btoaPolyfill;\nvar _fromUint8Array = _hasBuffer ? (u8a) => Buffer.from(u8a).toString(\"base64\") : (u8a) => {\n  const maxargs = 4096;\n  let strs = [];\n  for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n    strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n  }\n  return _btoa(strs.join(\"\"));\n};\nvar cb_utob = (c) => {\n  if (c.length < 2) {\n    var cc = c.charCodeAt(0);\n    return cc < 128 ? c : cc < 2048 ? _fromCC(192 | cc >>> 6) + _fromCC(128 | cc & 63) : _fromCC(224 | cc >>> 12 & 15) + _fromCC(128 | cc >>> 6 & 63) + _fromCC(128 | cc & 63);\n  } else {\n    var cc = 65536 + (c.charCodeAt(0) - 55296) * 1024 + (c.charCodeAt(1) - 56320);\n    return _fromCC(240 | cc >>> 18 & 7) + _fromCC(128 | cc >>> 12 & 63) + _fromCC(128 | cc >>> 6 & 63) + _fromCC(128 | cc & 63);\n  }\n};\nvar re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\nvar utob = (u) => u.replace(re_utob, cb_utob);\nvar _encode = _hasBuffer ? (s) => Buffer.from(s, \"utf8\").toString(\"base64\") : _TE ? (s) => _fromUint8Array(_TE.encode(s)) : (s) => _btoa(utob(s));\nvar encode = (src, urlsafe = false) => urlsafe ? _mkUriSafe(_encode(src)) : _encode(src);\nvar re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nvar cb_btou = (cccc) => {\n  switch (cccc.length) {\n    case 4:\n      var cp = (7 & cccc.charCodeAt(0)) << 18 | (63 & cccc.charCodeAt(1)) << 12 | (63 & cccc.charCodeAt(2)) << 6 | 63 & cccc.charCodeAt(3), offset = cp - 65536;\n      return _fromCC((offset >>> 10) + 55296) + _fromCC((offset & 1023) + 56320);\n    case 3:\n      return _fromCC((15 & cccc.charCodeAt(0)) << 12 | (63 & cccc.charCodeAt(1)) << 6 | 63 & cccc.charCodeAt(2));\n    default:\n      return _fromCC((31 & cccc.charCodeAt(0)) << 6 | 63 & cccc.charCodeAt(1));\n  }\n};\nvar btou = (b) => b.replace(re_btou, cb_btou);\nvar atobPolyfill = (asc) => {\n  asc = asc.replace(/\\s+/g, \"\");\n  if (!b64re.test(asc))\n    throw new TypeError(\"malformed base64.\");\n  asc += \"==\".slice(2 - (asc.length & 3));\n  let u24, bin = \"\", r1, r2;\n  for (let i = 0; i < asc.length; ) {\n    u24 = b64tab[asc.charAt(i++)] << 18 | b64tab[asc.charAt(i++)] << 12 | (r1 = b64tab[asc.charAt(i++)]) << 6 | (r2 = b64tab[asc.charAt(i++)]);\n    bin += r1 === 64 ? _fromCC(u24 >> 16 & 255) : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255) : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);\n  }\n  return bin;\n};\nvar _atob = _hasatob ? (asc) => atob(_tidyB64(asc)) : _hasBuffer ? (asc) => Buffer.from(asc, \"base64\").toString(\"binary\") : atobPolyfill;\nvar _toUint8Array = _hasBuffer ? (a) => _U8Afrom(Buffer.from(a, \"base64\")) : (a) => _U8Afrom(_atob(a), (c) => c.charCodeAt(0));\nvar _decode = _hasBuffer ? (a) => Buffer.from(a, \"base64\").toString(\"utf8\") : _TD ? (a) => _TD.decode(_toUint8Array(a)) : (a) => btou(_atob(a));\nvar _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == \"-\" ? \"+\" : \"/\"));\nvar decode = (src) => _decode(_unURI(src));\n\n// api.gen.ts\nvar NakamaApi = class {\n  constructor(configuration) {\n    this.configuration = configuration;\n  }\n  doFetch(urlPath, method, queryParams, body, options) {\n    const urlQuery = \"?\" + Object.keys(queryParams).map((k) => {\n      if (queryParams[k] instanceof Array) {\n        return queryParams[k].reduce((prev, curr) => {\n          return prev + encodeURIComponent(k) + \"=\" + encodeURIComponent(curr) + \"&\";\n        }, \"\");\n      } else {\n        if (queryParams[k] != null) {\n          return encodeURIComponent(k) + \"=\" + encodeURIComponent(queryParams[k]) + \"&\";\n        }\n      }\n    }).join(\"\");\n    const fetchOptions = __assign(__assign({}, {method}), options);\n    fetchOptions.headers = __assign({}, options.headers);\n    const descriptor = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, \"withCredentials\");\n    if (!(descriptor == null ? void 0 : descriptor.set)) {\n      fetchOptions.credentials = \"cocos-ignore\";\n    }\n    if (this.configuration.bearerToken) {\n      fetchOptions.headers[\"Authorization\"] = \"Bearer \" + this.configuration.bearerToken;\n    } else if (this.configuration.username) {\n      fetchOptions.headers[\"Authorization\"] = \"Basic \" + encode(this.configuration.username + \":\" + this.configuration.password);\n    }\n    if (!Object.keys(fetchOptions.headers).includes(\"Accept\")) {\n      fetchOptions.headers[\"Accept\"] = \"application/json\";\n    }\n    if (!Object.keys(fetchOptions.headers).includes(\"Content-Type\")) {\n      fetchOptions.headers[\"Content-Type\"] = \"application/json\";\n    }\n    Object.keys(fetchOptions.headers).forEach((key) => {\n      if (!fetchOptions.headers[key]) {\n        delete fetchOptions.headers[key];\n      }\n    });\n    fetchOptions.body = body;\n    return Promise.race([\n      fetch(this.configuration.basePath + urlPath + urlQuery, fetchOptions).then((response) => {\n        if (response.status == 204) {\n          return response;\n        } else if (response.status >= 200 && response.status < 300) {\n          return response.json();\n        } else {\n          throw response;\n        }\n      }),\n      new Promise((_, reject) => setTimeout(reject, this.configuration.timeoutMs, \"Request timed out.\"))\n    ]);\n  }\n  healthcheck(options = {}) {\n    const urlPath = \"/healthcheck\";\n    const queryParams = {};\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  getAccount(options = {}) {\n    const urlPath = \"/v2/account\";\n    const queryParams = {};\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  updateAccount(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"PUT\", queryParams, _body, options);\n  }\n  authenticateApple(body, create, username, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/authenticate/apple\";\n    const queryParams = {\n      create,\n      username\n    };\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  authenticateCustom(body, create, username, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/authenticate/custom\";\n    const queryParams = {\n      create,\n      username\n    };\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  authenticateDevice(body, create, username, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/authenticate/device\";\n    const queryParams = {\n      create,\n      username\n    };\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  authenticateEmail(body, create, username, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/authenticate/email\";\n    const queryParams = {\n      create,\n      username\n    };\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  authenticateFacebook(body, create, username, sync, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/authenticate/facebook\";\n    const queryParams = {\n      create,\n      username,\n      sync\n    };\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  authenticateFacebookInstantGame(body, create, username, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/authenticate/facebookinstantgame\";\n    const queryParams = {\n      create,\n      username\n    };\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  authenticateGameCenter(body, create, username, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/authenticate/gamecenter\";\n    const queryParams = {\n      create,\n      username\n    };\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  authenticateGoogle(body, create, username, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/authenticate/google\";\n    const queryParams = {\n      create,\n      username\n    };\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  authenticateSteam(body, create, username, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/authenticate/steam\";\n    const queryParams = {\n      create,\n      username\n    };\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  linkApple(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/link/apple\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  linkCustom(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/link/custom\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  linkDevice(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/link/device\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  linkEmail(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/link/email\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  linkFacebook(body, sync, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/link/facebook\";\n    const queryParams = {\n      sync\n    };\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  linkFacebookInstantGame(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/link/facebookinstantgame\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  linkGameCenter(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/link/gamecenter\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  linkGoogle(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/link/google\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  linkSteam(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/link/steam\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  sessionRefresh(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/session/refresh\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  unlinkApple(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/unlink/apple\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  unlinkCustom(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/unlink/custom\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  unlinkDevice(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/unlink/device\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  unlinkEmail(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/unlink/email\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  unlinkFacebook(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/unlink/facebook\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  unlinkFacebookInstantGame(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/unlink/facebookinstantgame\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  unlinkGameCenter(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/unlink/gamecenter\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  unlinkGoogle(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/unlink/google\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  unlinkSteam(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/account/unlink/steam\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  listChannelMessages(channelId, limit, forward, cursor, options = {}) {\n    if (channelId === null || channelId === void 0) {\n      throw new Error(\"'channelId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/channel/{channelId}\".replace(\"{channelId}\", encodeURIComponent(String(channelId)));\n    const queryParams = {\n      limit,\n      forward,\n      cursor\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  event(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/event\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  deleteFriends(ids, usernames, options = {}) {\n    const urlPath = \"/v2/friend\";\n    const queryParams = {\n      ids,\n      usernames\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"DELETE\", queryParams, _body, options);\n  }\n  listFriends(limit, state, cursor, options = {}) {\n    const urlPath = \"/v2/friend\";\n    const queryParams = {\n      limit,\n      state,\n      cursor\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  addFriends(ids, usernames, options = {}) {\n    const urlPath = \"/v2/friend\";\n    const queryParams = {\n      ids,\n      usernames\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  blockFriends(ids, usernames, options = {}) {\n    const urlPath = \"/v2/friend/block\";\n    const queryParams = {\n      ids,\n      usernames\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  importFacebookFriends(body, reset, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/friend/facebook\";\n    const queryParams = {\n      reset\n    };\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  listGroups(name, cursor, limit, options = {}) {\n    const urlPath = \"/v2/group\";\n    const queryParams = {\n      name,\n      cursor,\n      limit\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  createGroup(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/group\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  deleteGroup(groupId, options = {}) {\n    if (groupId === null || groupId === void 0) {\n      throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/group/{groupId}\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n    const queryParams = {};\n    let _body = null;\n    return this.doFetch(urlPath, \"DELETE\", queryParams, _body, options);\n  }\n  updateGroup(groupId, body, options = {}) {\n    if (groupId === null || groupId === void 0) {\n      throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n    }\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/group/{groupId}\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"PUT\", queryParams, _body, options);\n  }\n  addGroupUsers(groupId, userIds, options = {}) {\n    if (groupId === null || groupId === void 0) {\n      throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/group/{groupId}/add\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n    const queryParams = {\n      user_ids: userIds\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  banGroupUsers(groupId, userIds, options = {}) {\n    if (groupId === null || groupId === void 0) {\n      throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/group/{groupId}/ban\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n    const queryParams = {\n      user_ids: userIds\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  demoteGroupUsers(groupId, userIds, options = {}) {\n    if (groupId === null || groupId === void 0) {\n      throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n    }\n    if (userIds === null || userIds === void 0) {\n      throw new Error(\"'userIds' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/group/{groupId}/demote\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n    const queryParams = {\n      user_ids: userIds\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  joinGroup(groupId, options = {}) {\n    if (groupId === null || groupId === void 0) {\n      throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/group/{groupId}/join\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n    const queryParams = {};\n    let _body = null;\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  kickGroupUsers(groupId, userIds, options = {}) {\n    if (groupId === null || groupId === void 0) {\n      throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/group/{groupId}/kick\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n    const queryParams = {\n      user_ids: userIds\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  leaveGroup(groupId, options = {}) {\n    if (groupId === null || groupId === void 0) {\n      throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/group/{groupId}/leave\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n    const queryParams = {};\n    let _body = null;\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  promoteGroupUsers(groupId, userIds, options = {}) {\n    if (groupId === null || groupId === void 0) {\n      throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/group/{groupId}/promote\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n    const queryParams = {\n      user_ids: userIds\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  listGroupUsers(groupId, limit, state, cursor, options = {}) {\n    if (groupId === null || groupId === void 0) {\n      throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/group/{groupId}/user\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n    const queryParams = {\n      limit,\n      state,\n      cursor\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  deleteLeaderboardRecord(leaderboardId, options = {}) {\n    if (leaderboardId === null || leaderboardId === void 0) {\n      throw new Error(\"'leaderboardId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/leaderboard/{leaderboardId}\".replace(\"{leaderboardId}\", encodeURIComponent(String(leaderboardId)));\n    const queryParams = {};\n    let _body = null;\n    return this.doFetch(urlPath, \"DELETE\", queryParams, _body, options);\n  }\n  listLeaderboardRecords(leaderboardId, ownerIds, limit, cursor, expiry, options = {}) {\n    if (leaderboardId === null || leaderboardId === void 0) {\n      throw new Error(\"'leaderboardId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/leaderboard/{leaderboardId}\".replace(\"{leaderboardId}\", encodeURIComponent(String(leaderboardId)));\n    const queryParams = {\n      ownerIds,\n      limit,\n      cursor,\n      expiry\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  writeLeaderboardRecord(leaderboardId, body, options = {}) {\n    if (leaderboardId === null || leaderboardId === void 0) {\n      throw new Error(\"'leaderboardId' is a required parameter but is null or undefined.\");\n    }\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/leaderboard/{leaderboardId}\".replace(\"{leaderboardId}\", encodeURIComponent(String(leaderboardId)));\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  listLeaderboardRecordsAroundOwner(leaderboardId, ownerId, limit, expiry, options = {}) {\n    if (leaderboardId === null || leaderboardId === void 0) {\n      throw new Error(\"'leaderboardId' is a required parameter but is null or undefined.\");\n    }\n    if (ownerId === null || ownerId === void 0) {\n      throw new Error(\"'ownerId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/leaderboard/{leaderboardId}/owner/{ownerId}\".replace(\"{leaderboardId}\", encodeURIComponent(String(leaderboardId))).replace(\"{ownerId}\", encodeURIComponent(String(ownerId)));\n    const queryParams = {\n      limit,\n      expiry\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  listMatches(limit, authoritative, label, minSize, maxSize, query, options = {}) {\n    const urlPath = \"/v2/match\";\n    const queryParams = {\n      limit,\n      authoritative,\n      label,\n      minSize,\n      maxSize,\n      query\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  deleteNotifications(ids, options = {}) {\n    const urlPath = \"/v2/notification\";\n    const queryParams = {\n      ids\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"DELETE\", queryParams, _body, options);\n  }\n  listNotifications(limit, cacheableCursor, options = {}) {\n    const urlPath = \"/v2/notification\";\n    const queryParams = {\n      limit,\n      cacheableCursor\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  rpcFunc2(id, payload, httpKey, options = {}) {\n    if (id === null || id === void 0) {\n      throw new Error(\"'id' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/rpc/{id}\".replace(\"{id}\", encodeURIComponent(String(id)));\n    const queryParams = {\n      payload,\n      httpKey\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  rpcFunc(id, body, httpKey, options = {}) {\n    if (id === null || id === void 0) {\n      throw new Error(\"'id' is a required parameter but is null or undefined.\");\n    }\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/rpc/{id}\".replace(\"{id}\", encodeURIComponent(String(id)));\n    const queryParams = {\n      httpKey\n    };\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  readStorageObjects(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/storage\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  writeStorageObjects(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/storage\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"PUT\", queryParams, _body, options);\n  }\n  deleteStorageObjects(body, options = {}) {\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/storage/delete\";\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"PUT\", queryParams, _body, options);\n  }\n  listStorageObjects(collection, userId, limit, cursor, options = {}) {\n    if (collection === null || collection === void 0) {\n      throw new Error(\"'collection' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/storage/{collection}\".replace(\"{collection}\", encodeURIComponent(String(collection)));\n    const queryParams = {\n      userId,\n      limit,\n      cursor\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  listStorageObjects2(collection, userId, limit, cursor, options = {}) {\n    if (collection === null || collection === void 0) {\n      throw new Error(\"'collection' is a required parameter but is null or undefined.\");\n    }\n    if (userId === null || userId === void 0) {\n      throw new Error(\"'userId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/storage/{collection}/{userId}\".replace(\"{collection}\", encodeURIComponent(String(collection))).replace(\"{userId}\", encodeURIComponent(String(userId)));\n    const queryParams = {\n      limit,\n      cursor\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  listTournaments(categoryStart, categoryEnd, startTime, endTime, limit, cursor, options = {}) {\n    const urlPath = \"/v2/tournament\";\n    const queryParams = {\n      categoryStart,\n      categoryEnd,\n      startTime,\n      endTime,\n      limit,\n      cursor\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  listTournamentRecords(tournamentId, ownerIds, limit, cursor, expiry, options = {}) {\n    if (tournamentId === null || tournamentId === void 0) {\n      throw new Error(\"'tournamentId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/tournament/{tournamentId}\".replace(\"{tournamentId}\", encodeURIComponent(String(tournamentId)));\n    const queryParams = {\n      ownerIds,\n      limit,\n      cursor,\n      expiry\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  writeTournamentRecord(tournamentId, body, options = {}) {\n    if (tournamentId === null || tournamentId === void 0) {\n      throw new Error(\"'tournamentId' is a required parameter but is null or undefined.\");\n    }\n    if (body === null || body === void 0) {\n      throw new Error(\"'body' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/tournament/{tournamentId}\".replace(\"{tournamentId}\", encodeURIComponent(String(tournamentId)));\n    const queryParams = {};\n    let _body = null;\n    _body = JSON.stringify(body || {});\n    return this.doFetch(urlPath, \"PUT\", queryParams, _body, options);\n  }\n  joinTournament(tournamentId, options = {}) {\n    if (tournamentId === null || tournamentId === void 0) {\n      throw new Error(\"'tournamentId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/tournament/{tournamentId}/join\".replace(\"{tournamentId}\", encodeURIComponent(String(tournamentId)));\n    const queryParams = {};\n    let _body = null;\n    return this.doFetch(urlPath, \"POST\", queryParams, _body, options);\n  }\n  listTournamentRecordsAroundOwner(tournamentId, ownerId, limit, expiry, options = {}) {\n    if (tournamentId === null || tournamentId === void 0) {\n      throw new Error(\"'tournamentId' is a required parameter but is null or undefined.\");\n    }\n    if (ownerId === null || ownerId === void 0) {\n      throw new Error(\"'ownerId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/tournament/{tournamentId}/owner/{ownerId}\".replace(\"{tournamentId}\", encodeURIComponent(String(tournamentId))).replace(\"{ownerId}\", encodeURIComponent(String(ownerId)));\n    const queryParams = {\n      limit,\n      expiry\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  getUsers(ids, usernames, facebookIds, options = {}) {\n    const urlPath = \"/v2/user\";\n    const queryParams = {\n      ids,\n      usernames,\n      facebookIds\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n  listUserGroups(userId, limit, state, cursor, options = {}) {\n    if (userId === null || userId === void 0) {\n      throw new Error(\"'userId' is a required parameter but is null or undefined.\");\n    }\n    const urlPath = \"/v2/user/{userId}/group\".replace(\"{userId}\", encodeURIComponent(String(userId)));\n    const queryParams = {\n      limit,\n      state,\n      cursor\n    };\n    let _body = null;\n    return this.doFetch(urlPath, \"GET\", queryParams, _body, options);\n  }\n};\n\n// session.ts\nvar Session = class {\n  constructor(token, created_at, expires_at, username, user_id, vars) {\n    this.token = token;\n    this.created_at = created_at;\n    this.expires_at = expires_at;\n    this.username = username;\n    this.user_id = user_id;\n    this.vars = vars;\n  }\n  isexpired(currenttime) {\n    return this.expires_at - currenttime < 0;\n  }\n  static restore(jwt) {\n    const createdAt = Math.floor(new Date().getTime() / 1e3);\n    const parts = jwt.split(\".\");\n    if (parts.length != 3) {\n      throw \"jwt is not valid.\";\n    }\n    const decoded = JSON.parse(atob(parts[1]));\n    const expiresAt = Math.floor(parseInt(decoded[\"exp\"]));\n    return new Session(jwt, createdAt, expiresAt, decoded[\"usn\"], decoded[\"uid\"], decoded[\"vrs\"]);\n  }\n};\n\n// web_socket_adapter.ts\nvar WebSocketAdapterText = class {\n  constructor() {\n    this._isConnected = false;\n  }\n  get onClose() {\n    return this._socket.onclose;\n  }\n  set onClose(value) {\n    this._socket.onclose = value;\n  }\n  get onError() {\n    return this._socket.onerror;\n  }\n  set onError(value) {\n    this._socket.onerror = value;\n  }\n  get onMessage() {\n    return this._socket.onmessage;\n  }\n  set onMessage(value) {\n    if (value) {\n      this._socket.onmessage = (evt) => {\n        const message = JSON.parse(evt.data);\n        value(message);\n      };\n    } else {\n      value = null;\n    }\n  }\n  get onOpen() {\n    return this._socket.onopen;\n  }\n  set onOpen(value) {\n    this._socket.onopen = value;\n  }\n  get isConnected() {\n    return this._isConnected;\n  }\n  connect(scheme, host, port, createStatus, token) {\n    const url = `${scheme}${host}:${port}/ws?lang=en&status=${encodeURIComponent(createStatus.toString())}&token=${encodeURIComponent(token)}`;\n    this._socket = new WebSocket(url);\n    this._isConnected = true;\n  }\n  close() {\n    this._isConnected = false;\n    this._socket.close();\n    this._socket = void 0;\n  }\n  send(msg) {\n    if (msg.match_data_send) {\n      msg.match_data_send.op_code = msg.match_data_send.op_code.toString();\n    }\n    this._socket.send(JSON.stringify(msg));\n  }\n};\n\n// utils.ts\nfunction b64EncodeUnicode(str) {\n  return encode(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function toSolidBytes(_match, p1) {\n    return String.fromCharCode(Number(\"0x\" + p1));\n  }));\n}\nfunction b64DecodeUnicode(str) {\n  return decodeURIComponent(decode(str).split(\"\").map(function(c) {\n    return \"%\" + (\"00\" + c.charCodeAt(0).toString(16)).slice(-2);\n  }).join(\"\"));\n}\n\n// socket.ts\nvar DefaultSocket = class {\n  constructor(host, port, useSSL = false, verbose = false, adapter = new WebSocketAdapterText()) {\n    this.host = host;\n    this.port = port;\n    this.useSSL = useSSL;\n    this.verbose = verbose;\n    this.adapter = adapter;\n    this.cIds = {};\n    this.nextCid = 1;\n  }\n  generatecid() {\n    const cid = this.nextCid.toString();\n    ++this.nextCid;\n    return cid;\n  }\n  connect(session, createStatus = false) {\n    if (this.adapter.isConnected) {\n      return Promise.resolve(session);\n    }\n    const scheme = this.useSSL ? \"wss://\" : \"ws://\";\n    this.adapter.connect(scheme, this.host, this.port, createStatus, session.token);\n    this.adapter.onClose = (evt) => {\n      this.ondisconnect(evt);\n    };\n    this.adapter.onError = (evt) => {\n      this.onerror(evt);\n    };\n    this.adapter.onMessage = (message) => {\n      if (this.verbose && window && window.console) {\n        console.log(\"Response: %o\", message);\n      }\n      if (message.cid == void 0) {\n        if (message.notifications) {\n          message.notifications.notifications.forEach((n) => {\n            n.content = n.content ? JSON.parse(n.content) : void 0;\n            this.onnotification(n);\n          });\n        } else if (message.match_data) {\n          message.match_data.data = message.match_data.data != null ? JSON.parse(b64DecodeUnicode(message.match_data.data)) : null;\n          message.match_data.op_code = parseInt(message.match_data.op_code);\n          this.onmatchdata(message.match_data);\n        } else if (message.match_presence_event) {\n          this.onmatchpresence(message.match_presence_event);\n        } else if (message.matchmaker_matched) {\n          this.onmatchmakermatched(message.matchmaker_matched);\n        } else if (message.status_presence_event) {\n          this.onstatuspresence(message.status_presence_event);\n        } else if (message.stream_presence_event) {\n          this.onstreampresence(message.stream_presence_event);\n        } else if (message.stream_data) {\n          this.onstreamdata(message.stream_data);\n        } else if (message.channel_message) {\n          message.channel_message.content = JSON.parse(message.channel_message.content);\n          this.onchannelmessage(message.channel_message);\n        } else if (message.channel_presence_event) {\n          this.onchannelpresence(message.channel_presence_event);\n        } else {\n          if (this.verbose && window && window.console) {\n            console.log(\"Unrecognized message received: %o\", message);\n          }\n        }\n      } else {\n        const executor = this.cIds[message.cid];\n        if (!executor) {\n          if (this.verbose && window && window.console) {\n            console.error(\"No promise executor for message: %o\", message);\n          }\n          return;\n        }\n        delete this.cIds[message.cid];\n        if (message.error) {\n          executor.reject(message.error);\n        } else {\n          executor.resolve(message);\n        }\n      }\n    };\n    return new Promise((resolve, reject) => {\n      this.adapter.onOpen = (evt) => {\n        if (this.verbose && window && window.console) {\n          console.log(evt);\n        }\n        resolve(session);\n      };\n      this.adapter.onError = (evt) => {\n        reject(evt);\n        this.adapter.close();\n      };\n    });\n  }\n  disconnect(fireDisconnectEvent = true) {\n    if (this.adapter.isConnected) {\n      this.adapter.close();\n    }\n    if (fireDisconnectEvent) {\n      this.ondisconnect({});\n    }\n  }\n  ondisconnect(evt) {\n    if (this.verbose && window && window.console) {\n      console.log(evt);\n    }\n  }\n  onerror(evt) {\n    if (this.verbose && window && window.console) {\n      console.log(evt);\n    }\n  }\n  onchannelmessage(channelMessage) {\n    if (this.verbose && window && window.console) {\n      console.log(channelMessage);\n    }\n  }\n  onchannelpresence(channelPresence) {\n    if (this.verbose && window && window.console) {\n      console.log(channelPresence);\n    }\n  }\n  onnotification(notification) {\n    if (this.verbose && window && window.console) {\n      console.log(notification);\n    }\n  }\n  onmatchdata(matchData) {\n    if (this.verbose && window && window.console) {\n      console.log(matchData);\n    }\n  }\n  onmatchpresence(matchPresence) {\n    if (this.verbose && window && window.console) {\n      console.log(matchPresence);\n    }\n  }\n  onmatchmakermatched(matchmakerMatched) {\n    if (this.verbose && window && window.console) {\n      console.log(matchmakerMatched);\n    }\n  }\n  onstatuspresence(statusPresence) {\n    if (this.verbose && window && window.console) {\n      console.log(statusPresence);\n    }\n  }\n  onstreampresence(streamPresence) {\n    if (this.verbose && window && window.console) {\n      console.log(streamPresence);\n    }\n  }\n  onstreamdata(streamData) {\n    if (this.verbose && window && window.console) {\n      console.log(streamData);\n    }\n  }\n  send(message) {\n    const untypedMessage = message;\n    return new Promise((resolve, reject) => {\n      if (!this.adapter.isConnected) {\n        reject(\"Socket connection has not been established yet.\");\n      } else {\n        if (untypedMessage.match_data_send) {\n          untypedMessage.match_data_send.data = b64EncodeUnicode(JSON.stringify(untypedMessage.match_data_send.data));\n          this.adapter.send(untypedMessage);\n          resolve();\n        } else {\n          if (untypedMessage.channel_message_send) {\n            untypedMessage.channel_message_send.content = JSON.stringify(untypedMessage.channel_message_send.content);\n          } else if (untypedMessage.channel_message_update) {\n            untypedMessage.channel_message_update.content = JSON.stringify(untypedMessage.channel_message_update.content);\n          }\n          const cid = this.generatecid();\n          this.cIds[cid] = {resolve, reject};\n          untypedMessage.cid = cid;\n          this.adapter.send(untypedMessage);\n        }\n      }\n      if (this.verbose && window && window.console) {\n        console.log(\"Sent message: %o\", untypedMessage);\n      }\n    });\n  }\n  addMatchmaker(query, minCount, maxCount, stringProperties, numericProperties) {\n    return __async(this, null, function* () {\n      const matchMakerAdd = {\n        matchmaker_add: {\n          min_count: minCount,\n          max_count: maxCount,\n          query,\n          string_properties: stringProperties,\n          numeric_properties: numericProperties\n        }\n      };\n      const response = yield this.send(matchMakerAdd);\n      return response.matchmaker_ticket;\n    });\n  }\n  createMatch() {\n    return __async(this, null, function* () {\n      const response = yield this.send({match_create: {}});\n      return response.match;\n    });\n  }\n  followUsers(userIds) {\n    return __async(this, null, function* () {\n      const response = yield this.send({status_follow: {user_ids: userIds}});\n      return response.status;\n    });\n  }\n  joinChat(target, type, persistence, hidden) {\n    return __async(this, null, function* () {\n      const response = yield this.send({\n        channel_join: {\n          target,\n          type,\n          persistence,\n          hidden\n        }\n      });\n      return response.channel;\n    });\n  }\n  joinMatch(match_id, token, metadata) {\n    return __async(this, null, function* () {\n      const join = {match_join: {metadata}};\n      if (token) {\n        join.match_join.token = token;\n      } else {\n        join.match_join.match_id = match_id;\n      }\n      const response = yield this.send(join);\n      return response.match;\n    });\n  }\n  leaveChat(channel_id) {\n    return this.send({channel_leave: {channel_id}});\n  }\n  leaveMatch(matchId) {\n    return this.send({match_leave: {match_id: matchId}});\n  }\n  removeChatMessage(channel_id, message_id) {\n    return __async(this, null, function* () {\n      const response = yield this.send({\n        channel_message_remove: {\n          channel_id,\n          message_id\n        }\n      });\n      return response.channel_message_ack;\n    });\n  }\n  removeMatchmaker(ticket) {\n    return this.send({matchmaker_remove: {ticket}});\n  }\n  rpc(id, payload, http_key) {\n    return __async(this, null, function* () {\n      const response = yield this.send({\n        rpc: {\n          id,\n          payload,\n          http_key\n        }\n      });\n      return response.rpc;\n    });\n  }\n  sendMatchState(matchId, opCode, data, presences) {\n    return __async(this, null, function* () {\n      return this.send({\n        match_data_send: {\n          match_id: matchId,\n          op_code: opCode,\n          data,\n          presences: presences != null ? presences : []\n        }\n      });\n    });\n  }\n  unfollowUsers(user_ids) {\n    return this.send({status_unfollow: {user_ids}});\n  }\n  updateChatMessage(channel_id, message_id, content) {\n    return __async(this, null, function* () {\n      const response = yield this.send({channel_message_update: {channel_id, message_id, content}});\n      return response.channel_message_ack;\n    });\n  }\n  updateStatus(status) {\n    return this.send({status_update: {status}});\n  }\n  writeChatMessage(channel_id, content) {\n    return __async(this, null, function* () {\n      const response = yield this.send({channel_message_send: {channel_id, content}});\n      return response.channel_message_ack;\n    });\n  }\n};\n\n// client.ts\nvar DEFAULT_HOST = \"127.0.0.1\";\nvar DEFAULT_PORT = \"7350\";\nvar DEFAULT_SERVER_KEY = \"defaultkey\";\nvar DEFAULT_TIMEOUT_MS = 7e3;\nvar Client = class {\n  constructor(serverkey = DEFAULT_SERVER_KEY, host = DEFAULT_HOST, port = DEFAULT_PORT, useSSL = false, timeout = DEFAULT_TIMEOUT_MS) {\n    this.serverkey = serverkey;\n    this.host = host;\n    this.port = port;\n    this.useSSL = useSSL;\n    this.timeout = timeout;\n    const scheme = useSSL ? \"https://\" : \"http://\";\n    const basePath = `${scheme}${host}:${port}`;\n    this.configuration = {\n      basePath,\n      username: serverkey,\n      password: \"\",\n      timeoutMs: timeout\n    };\n    this.apiClient = new NakamaApi(this.configuration);\n  }\n  addGroupUsers(session, groupId, ids) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.addGroupUsers(groupId, ids).then((response) => {\n      return response !== void 0;\n    });\n  }\n  addFriends(session, ids, usernames) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.addFriends(ids, usernames).then((response) => {\n      return response !== void 0;\n    });\n  }\n  authenticateApple(token, create, username, vars = new Map(), options = {}) {\n    const request = {\n      token,\n      vars\n    };\n    return this.apiClient.authenticateApple(request, create, username, options).then((apiSession) => {\n      return Session.restore(apiSession.token || \"\");\n    });\n  }\n  authenticateCustom(id, create, username, vars = new Map(), options = {}) {\n    const request = {\n      id,\n      vars\n    };\n    return this.apiClient.authenticateCustom(request, create, username, options).then((apiSession) => {\n      return Session.restore(apiSession.token || \"\");\n    });\n  }\n  authenticateDevice(id, create, username, vars) {\n    const request = {\n      id,\n      vars\n    };\n    return this.apiClient.authenticateDevice(request, create, username).then((apiSession) => {\n      return Session.restore(apiSession.token || \"\");\n    });\n  }\n  authenticateEmail(email, password, create, username, vars) {\n    const request = {\n      email,\n      password,\n      vars\n    };\n    return this.apiClient.authenticateEmail(request, create, username).then((apiSession) => {\n      return Session.restore(apiSession.token || \"\");\n    });\n  }\n  authenticateFacebookInstantGame(signedPlayerInfo, create, username, vars, options = {}) {\n    const request = {\n      signed_player_info: signedPlayerInfo,\n      vars\n    };\n    return this.apiClient.authenticateFacebookInstantGame({signed_player_info: request.signed_player_info, vars: request.vars}, create, username, options).then((apiSession) => {\n      return Session.restore(apiSession.token || \"\");\n    });\n  }\n  authenticateFacebook(token, create, username, sync, vars, options = {}) {\n    const request = {\n      token,\n      vars\n    };\n    return this.apiClient.authenticateFacebook(request, create, username, sync, options).then((apiSession) => {\n      return Session.restore(apiSession.token || \"\");\n    });\n  }\n  authenticateGoogle(token, create, username, vars, options = {}) {\n    const request = {\n      token,\n      vars\n    };\n    return this.apiClient.authenticateGoogle(request, create, username, options).then((apiSession) => {\n      return Session.restore(apiSession.token || \"\");\n    });\n  }\n  authenticateGameCenter(token, create, username, vars) {\n    const request = {\n      token,\n      vars\n    };\n    return this.apiClient.authenticateGameCenter(request, create, username).then((apiSession) => {\n      return Session.restore(apiSession.token || \"\");\n    });\n  }\n  authenticateSteam(token, create, username, vars) {\n    const request = {\n      token,\n      vars\n    };\n    return this.apiClient.authenticateSteam(request, create, username).then((apiSession) => {\n      return Session.restore(apiSession.token || \"\");\n    });\n  }\n  banGroupUsers(session, groupId, ids) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.banGroupUsers(groupId, ids).then((response) => {\n      return response !== void 0;\n    });\n  }\n  blockFriends(session, ids, usernames) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.blockFriends(ids, usernames).then((response) => {\n      return Promise.resolve(response != void 0);\n    });\n  }\n  createGroup(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.createGroup(request).then((response) => {\n      return Promise.resolve({\n        avatar_url: response.avatar_url,\n        create_time: response.create_time,\n        creator_id: response.creator_id,\n        description: response.description,\n        edge_count: response.edge_count ? Number(response.edge_count) : 0,\n        id: response.id,\n        lang_tag: response.lang_tag,\n        max_count: response.max_count ? Number(response.max_count) : 0,\n        metadata: response.metadata ? JSON.parse(response.metadata) : void 0,\n        name: response.name,\n        open: response.open,\n        update_time: response.update_time\n      });\n    });\n  }\n  createSocket(useSSL = false, verbose = false, adapter = new WebSocketAdapterText()) {\n    return new DefaultSocket(this.host, this.port, useSSL, verbose, adapter);\n  }\n  deleteFriends(session, ids, usernames) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.deleteFriends(ids, usernames).then((response) => {\n      return response !== void 0;\n    });\n  }\n  deleteGroup(session, groupId) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.deleteGroup(groupId).then((response) => {\n      return response !== void 0;\n    });\n  }\n  deleteNotifications(session, ids) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.deleteNotifications(ids).then((response) => {\n      return Promise.resolve(response != void 0);\n    });\n  }\n  deleteStorageObjects(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.deleteStorageObjects(request).then((response) => {\n      return Promise.resolve(response != void 0);\n    });\n  }\n  demoteGroupUsers(session, groupId, ids) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.demoteGroupUsers(groupId, ids);\n  }\n  emitEvent(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.event(request).then((response) => {\n      return Promise.resolve(response != void 0);\n    });\n  }\n  getAccount(session) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.getAccount();\n  }\n  importFacebookFriends(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.importFacebookFriends(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  getUsers(session, ids, usernames, facebookIds) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.getUsers(ids, usernames, facebookIds).then((response) => {\n      var result = {\n        users: []\n      };\n      if (response.users == null) {\n        return Promise.resolve(result);\n      }\n      response.users.forEach((u) => {\n        result.users.push({\n          avatar_url: u.avatar_url,\n          create_time: u.create_time,\n          display_name: u.display_name,\n          edge_count: u.edge_count ? Number(u.edge_count) : 0,\n          facebook_id: u.facebook_id,\n          gamecenter_id: u.gamecenter_id,\n          google_id: u.google_id,\n          id: u.id,\n          lang_tag: u.lang_tag,\n          location: u.location,\n          online: u.online,\n          steam_id: u.steam_id,\n          timezone: u.timezone,\n          update_time: u.update_time,\n          username: u.username,\n          metadata: u.metadata ? JSON.parse(u.metadata) : void 0\n        });\n      });\n      return Promise.resolve(result);\n    });\n  }\n  joinGroup(session, groupId) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.joinGroup(groupId, {}).then((response) => {\n      return response !== void 0;\n    });\n  }\n  joinTournament(session, tournamentId) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.joinTournament(tournamentId, {}).then((response) => {\n      return response !== void 0;\n    });\n  }\n  kickGroupUsers(session, groupId, ids) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.kickGroupUsers(groupId, ids).then((response) => {\n      return Promise.resolve(response != void 0);\n    });\n  }\n  leaveGroup(session, groupId) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.leaveGroup(groupId, {}).then((response) => {\n      return response !== void 0;\n    });\n  }\n  listChannelMessages(session, channelId, limit, forward, cursor) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.listChannelMessages(channelId, limit, forward, cursor).then((response) => {\n      var result = {\n        messages: [],\n        next_cursor: response.next_cursor,\n        prev_cursor: response.prev_cursor\n      };\n      if (response.messages == null) {\n        return Promise.resolve(result);\n      }\n      response.messages.forEach((m) => {\n        result.messages.push({\n          channel_id: m.channel_id,\n          code: m.code ? Number(m.code) : 0,\n          create_time: m.create_time,\n          message_id: m.message_id,\n          persistent: m.persistent,\n          sender_id: m.sender_id,\n          update_time: m.update_time,\n          username: m.username,\n          content: m.content ? JSON.parse(m.content) : void 0,\n          group_id: m.group_id,\n          room_name: m.room_name,\n          user_id_one: m.user_id_one,\n          user_id_two: m.user_id_two\n        });\n      });\n      return Promise.resolve(result);\n    });\n  }\n  listGroupUsers(session, groupId, state, limit, cursor) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.listGroupUsers(groupId, limit, state, cursor).then((response) => {\n      var result = {\n        group_users: [],\n        cursor: response.cursor\n      };\n      if (response.group_users == null) {\n        return Promise.resolve(result);\n      }\n      response.group_users.forEach((gu) => {\n        result.group_users.push({\n          user: {\n            avatar_url: gu.user.avatar_url,\n            create_time: gu.user.create_time,\n            display_name: gu.user.display_name,\n            edge_count: gu.user.edge_count ? Number(gu.user.edge_count) : 0,\n            facebook_id: gu.user.facebook_id,\n            gamecenter_id: gu.user.gamecenter_id,\n            google_id: gu.user.google_id,\n            id: gu.user.id,\n            lang_tag: gu.user.lang_tag,\n            location: gu.user.location,\n            online: gu.user.online,\n            steam_id: gu.user.steam_id,\n            timezone: gu.user.timezone,\n            update_time: gu.user.update_time,\n            username: gu.user.username,\n            metadata: gu.user.metadata ? JSON.parse(gu.user.metadata) : void 0\n          },\n          state: gu.state ? Number(gu.state) : 0\n        });\n      });\n      return Promise.resolve(result);\n    });\n  }\n  listUserGroups(session, userId, state, limit, cursor) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.listUserGroups(userId, state, limit, cursor).then((response) => {\n      var result = {\n        user_groups: [],\n        cursor: response.cursor\n      };\n      if (response.user_groups == null) {\n        return Promise.resolve(result);\n      }\n      response.user_groups.forEach((ug) => {\n        result.user_groups.push({\n          group: {\n            avatar_url: ug.group.avatar_url,\n            create_time: ug.group.create_time,\n            creator_id: ug.group.creator_id,\n            description: ug.group.description,\n            edge_count: ug.group.edge_count ? Number(ug.group.edge_count) : 0,\n            id: ug.group.id,\n            lang_tag: ug.group.lang_tag,\n            max_count: ug.group.max_count,\n            metadata: ug.group.metadata ? JSON.parse(ug.group.metadata) : void 0,\n            name: ug.group.name,\n            open: ug.group.open,\n            update_time: ug.group.update_time\n          },\n          state: ug.state ? Number(ug.state) : 0\n        });\n      });\n      return Promise.resolve(result);\n    });\n  }\n  listGroups(session, name, cursor, limit) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.listGroups(name, cursor, limit).then((response) => {\n      var result = {\n        groups: []\n      };\n      if (response.groups == null) {\n        return Promise.resolve(result);\n      }\n      result.cursor = response.cursor;\n      response.groups.forEach((ug) => {\n        result.groups.push({\n          avatar_url: ug.avatar_url,\n          create_time: ug.create_time,\n          creator_id: ug.creator_id,\n          description: ug.description,\n          edge_count: ug.edge_count ? Number(ug.edge_count) : 0,\n          id: ug.id,\n          lang_tag: ug.lang_tag,\n          max_count: ug.max_count,\n          metadata: ug.metadata ? JSON.parse(ug.metadata) : void 0,\n          name: ug.name,\n          open: ug.open,\n          update_time: ug.update_time\n        });\n      });\n      return Promise.resolve(result);\n    });\n  }\n  linkApple(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.linkApple(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  linkCustom(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.linkCustom(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  linkDevice(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.linkDevice(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  linkEmail(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.linkEmail(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  linkFacebook(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.linkFacebook(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  linkFacebookInstantGame(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.linkFacebookInstantGame(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  linkGoogle(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.linkGoogle(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  linkGameCenter(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.linkGameCenter(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  linkSteam(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.linkSteam(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  listFriends(session, state, limit, cursor) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.listFriends(limit, state, cursor).then((response) => {\n      var result = {\n        friends: [],\n        cursor: response.cursor\n      };\n      if (response.friends == null) {\n        return Promise.resolve(result);\n      }\n      response.friends.forEach((f) => {\n        result.friends.push({\n          user: {\n            avatar_url: f.user.avatar_url,\n            create_time: f.user.create_time,\n            display_name: f.user.display_name,\n            edge_count: f.user.edge_count ? Number(f.user.edge_count) : 0,\n            facebook_id: f.user.facebook_id,\n            gamecenter_id: f.user.gamecenter_id,\n            google_id: f.user.google_id,\n            id: f.user.id,\n            lang_tag: f.user.lang_tag,\n            location: f.user.location,\n            online: f.user.online,\n            steam_id: f.user.steam_id,\n            timezone: f.user.timezone,\n            update_time: f.user.update_time,\n            username: f.user.username,\n            metadata: f.user.metadata ? JSON.parse(f.user.metadata) : void 0,\n            facebook_instant_game_id: f.user.facebook_instant_game_id\n          },\n          state: f.state\n        });\n      });\n      return Promise.resolve(result);\n    });\n  }\n  listLeaderboardRecords(session, leaderboardId, ownerIds, limit, cursor, expiry) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.listLeaderboardRecords(leaderboardId, ownerIds, limit, cursor, expiry).then((response) => {\n      var list = {\n        next_cursor: response.next_cursor,\n        prev_cursor: response.prev_cursor,\n        owner_records: [],\n        records: []\n      };\n      if (response.owner_records != null) {\n        response.owner_records.forEach((o) => {\n          list.owner_records.push({\n            expiry_time: o.expiry_time,\n            leaderboard_id: o.leaderboard_id,\n            metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n            num_score: o.num_score ? Number(o.num_score) : 0,\n            owner_id: o.owner_id,\n            rank: o.rank ? Number(o.rank) : 0,\n            score: o.score ? Number(o.score) : 0,\n            subscore: o.subscore ? Number(o.subscore) : 0,\n            update_time: o.update_time,\n            username: o.username,\n            max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n          });\n        });\n      }\n      if (response.records != null) {\n        response.records.forEach((o) => {\n          list.records.push({\n            expiry_time: o.expiry_time,\n            leaderboard_id: o.leaderboard_id,\n            metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n            num_score: o.num_score ? Number(o.num_score) : 0,\n            owner_id: o.owner_id,\n            rank: o.rank ? Number(o.rank) : 0,\n            score: o.score ? Number(o.score) : 0,\n            subscore: o.subscore ? Number(o.subscore) : 0,\n            update_time: o.update_time,\n            username: o.username,\n            max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n          });\n        });\n      }\n      return Promise.resolve(list);\n    });\n  }\n  listLeaderboardRecordsAroundOwner(session, leaderboardId, ownerId, limit, expiry) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.listLeaderboardRecordsAroundOwner(leaderboardId, ownerId, limit, expiry).then((response) => {\n      var list = {\n        next_cursor: response.next_cursor,\n        prev_cursor: response.prev_cursor,\n        owner_records: [],\n        records: []\n      };\n      if (response.owner_records != null) {\n        response.owner_records.forEach((o) => {\n          list.owner_records.push({\n            expiry_time: o.expiry_time,\n            leaderboard_id: o.leaderboard_id,\n            metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n            num_score: o.num_score ? Number(o.num_score) : 0,\n            owner_id: o.owner_id,\n            rank: o.rank ? Number(o.rank) : 0,\n            score: o.score ? Number(o.score) : 0,\n            subscore: o.subscore ? Number(o.subscore) : 0,\n            update_time: o.update_time,\n            username: o.username,\n            max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n          });\n        });\n      }\n      if (response.records != null) {\n        response.records.forEach((o) => {\n          list.records.push({\n            expiry_time: o.expiry_time,\n            leaderboard_id: o.leaderboard_id,\n            metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n            num_score: o.num_score ? Number(o.num_score) : 0,\n            owner_id: o.owner_id,\n            rank: o.rank ? Number(o.rank) : 0,\n            score: o.score ? Number(o.score) : 0,\n            subscore: o.subscore ? Number(o.subscore) : 0,\n            update_time: o.update_time,\n            username: o.username,\n            max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n          });\n        });\n      }\n      return Promise.resolve(list);\n    });\n  }\n  listMatches(session, limit, authoritative, label, minSize, maxSize, query) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.listMatches(limit, authoritative, label, minSize, maxSize, query);\n  }\n  listNotifications(session, limit, cacheableCursor) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.listNotifications(limit, cacheableCursor).then((response) => {\n      var result = {\n        cacheable_cursor: response.cacheable_cursor,\n        notifications: []\n      };\n      if (response.notifications == null) {\n        return Promise.resolve(result);\n      }\n      response.notifications.forEach((n) => {\n        result.notifications.push({\n          code: n.code ? Number(n.code) : 0,\n          create_time: n.create_time,\n          id: n.id,\n          persistent: n.persistent,\n          sender_id: n.sender_id,\n          subject: n.subject,\n          content: n.content ? JSON.parse(n.content) : void 0\n        });\n      });\n      return Promise.resolve(result);\n    });\n  }\n  listStorageObjects(session, collection, userId, limit, cursor) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.listStorageObjects(collection, userId, limit, cursor).then((response) => {\n      var result = {\n        objects: [],\n        cursor: response.cursor\n      };\n      if (response.objects == null) {\n        return Promise.resolve(result);\n      }\n      response.objects.forEach((o) => {\n        result.objects.push({\n          collection: o.collection,\n          key: o.key,\n          permission_read: o.permission_read ? Number(o.permission_read) : 0,\n          permission_write: o.permission_write ? Number(o.permission_write) : 0,\n          value: o.value ? JSON.parse(o.value) : void 0,\n          version: o.version,\n          user_id: o.user_id,\n          create_time: o.create_time,\n          update_time: o.update_time\n        });\n      });\n      return Promise.resolve(result);\n    });\n  }\n  listTournaments(session, categoryStart, categoryEnd, startTime, endTime, limit, cursor) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.listTournaments(categoryStart, categoryEnd, startTime, endTime, limit, cursor).then((response) => {\n      var list = {\n        cursor: response.cursor,\n        tournaments: []\n      };\n      if (response.tournaments != null) {\n        response.tournaments.forEach((o) => {\n          list.tournaments.push({\n            id: o.id,\n            title: o.title,\n            description: o.description,\n            duration: o.duration ? Number(o.duration) : 0,\n            category: o.category ? Number(o.category) : 0,\n            sort_order: o.sort_order ? Number(o.sort_order) : 0,\n            size: o.size ? Number(o.size) : 0,\n            max_size: o.max_size ? Number(o.max_size) : 0,\n            max_num_score: o.max_num_score ? Number(o.max_num_score) : 0,\n            can_enter: o.can_enter,\n            end_active: o.end_active ? Number(o.end_active) : 0,\n            next_reset: o.next_reset ? Number(o.next_reset) : 0,\n            metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n            create_time: o.create_time,\n            start_time: o.start_time,\n            end_time: o.end_time,\n            start_active: o.start_active\n          });\n        });\n      }\n      return Promise.resolve(list);\n    });\n  }\n  listTournamentRecords(session, tournamentId, ownerIds, limit, cursor, expiry) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.listTournamentRecords(tournamentId, ownerIds, limit, cursor, expiry).then((response) => {\n      var list = {\n        next_cursor: response.next_cursor,\n        prev_cursor: response.prev_cursor,\n        owner_records: [],\n        records: []\n      };\n      if (response.owner_records != null) {\n        response.owner_records.forEach((o) => {\n          list.owner_records.push({\n            expiry_time: o.expiry_time,\n            leaderboard_id: o.leaderboard_id,\n            metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n            num_score: o.num_score ? Number(o.num_score) : 0,\n            owner_id: o.owner_id,\n            rank: o.rank ? Number(o.rank) : 0,\n            score: o.score ? Number(o.score) : 0,\n            subscore: o.subscore ? Number(o.subscore) : 0,\n            update_time: o.update_time,\n            username: o.username,\n            max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n          });\n        });\n      }\n      if (response.records != null) {\n        response.records.forEach((o) => {\n          list.records.push({\n            expiry_time: o.expiry_time,\n            leaderboard_id: o.leaderboard_id,\n            metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n            num_score: o.num_score ? Number(o.num_score) : 0,\n            owner_id: o.owner_id,\n            rank: o.rank ? Number(o.rank) : 0,\n            score: o.score ? Number(o.score) : 0,\n            subscore: o.subscore ? Number(o.subscore) : 0,\n            update_time: o.update_time,\n            username: o.username,\n            max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n          });\n        });\n      }\n      return Promise.resolve(list);\n    });\n  }\n  listTournamentRecordsAroundOwner(session, tournamentId, ownerId, limit, expiry) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.listTournamentRecordsAroundOwner(tournamentId, ownerId, limit, expiry).then((response) => {\n      var list = {\n        next_cursor: response.next_cursor,\n        prev_cursor: response.prev_cursor,\n        owner_records: [],\n        records: []\n      };\n      if (response.owner_records != null) {\n        response.owner_records.forEach((o) => {\n          list.owner_records.push({\n            expiry_time: o.expiry_time,\n            leaderboard_id: o.leaderboard_id,\n            metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n            num_score: o.num_score ? Number(o.num_score) : 0,\n            owner_id: o.owner_id,\n            rank: o.rank ? Number(o.rank) : 0,\n            score: o.score ? Number(o.score) : 0,\n            subscore: o.subscore ? Number(o.subscore) : 0,\n            update_time: o.update_time,\n            username: o.username,\n            max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n          });\n        });\n      }\n      if (response.records != null) {\n        response.records.forEach((o) => {\n          list.records.push({\n            expiry_time: o.expiry_time,\n            leaderboard_id: o.leaderboard_id,\n            metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n            num_score: o.num_score ? Number(o.num_score) : 0,\n            owner_id: o.owner_id,\n            rank: o.rank ? Number(o.rank) : 0,\n            score: o.score ? Number(o.score) : 0,\n            subscore: o.subscore ? Number(o.subscore) : 0,\n            update_time: o.update_time,\n            username: o.username,\n            max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n          });\n        });\n      }\n      return Promise.resolve(list);\n    });\n  }\n  promoteGroupUsers(session, groupId, ids) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.promoteGroupUsers(groupId, ids);\n  }\n  readStorageObjects(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.readStorageObjects(request).then((response) => {\n      var result = {objects: []};\n      if (response.objects == null) {\n        return Promise.resolve(result);\n      }\n      response.objects.forEach((o) => {\n        result.objects.push({\n          collection: o.collection,\n          key: o.key,\n          permission_read: o.permission_read ? Number(o.permission_read) : 0,\n          permission_write: o.permission_write ? Number(o.permission_write) : 0,\n          value: o.value ? JSON.parse(o.value) : void 0,\n          version: o.version,\n          user_id: o.user_id,\n          create_time: o.create_time,\n          update_time: o.update_time\n        });\n      });\n      return Promise.resolve(result);\n    });\n  }\n  rpc(session, id, input) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.rpcFunc(id, JSON.stringify(input)).then((response) => {\n      return Promise.resolve({\n        id: response.id,\n        payload: !response.payload ? void 0 : JSON.parse(response.payload)\n      });\n    });\n  }\n  rpcGet(id, session, httpKey, input) {\n    if (!httpKey || httpKey == \"\") {\n      this.configuration.bearerToken = session && session.token;\n    } else {\n      this.configuration.username = void 0;\n      this.configuration.bearerToken = void 0;\n    }\n    return this.apiClient.rpcFunc2(id, input && JSON.stringify(input) || \"\", httpKey).then((response) => {\n      this.configuration.username = this.serverkey;\n      return Promise.resolve({\n        id: response.id,\n        payload: !response.payload ? void 0 : JSON.parse(response.payload)\n      });\n    }).catch((err) => {\n      this.configuration.username = this.serverkey;\n      throw err;\n    });\n  }\n  unlinkApple(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.unlinkApple(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  unlinkCustom(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.unlinkCustom(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  unlinkDevice(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.unlinkDevice(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  unlinkEmail(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.unlinkEmail(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  unlinkFacebook(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.unlinkFacebook(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  unlinkFacebookInstantGame(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.unlinkFacebookInstantGame(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  unlinkGoogle(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.unlinkGoogle(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  unlinkGameCenter(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.unlinkGameCenter(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  unlinkSteam(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.unlinkSteam(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  updateAccount(session, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.updateAccount(request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  updateGroup(session, groupId, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.updateGroup(groupId, request).then((response) => {\n      return response !== void 0;\n    });\n  }\n  writeLeaderboardRecord(session, leaderboardId, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.writeLeaderboardRecord(leaderboardId, {\n      metadata: request.metadata ? JSON.stringify(request.metadata) : void 0,\n      score: request.score,\n      subscore: request.subscore\n    }).then((response) => {\n      return Promise.resolve({\n        expiry_time: response.expiry_time,\n        leaderboard_id: response.leaderboard_id,\n        metadata: response.metadata ? JSON.parse(response.metadata) : void 0,\n        num_score: response.num_score ? Number(response.num_score) : 0,\n        owner_id: response.owner_id,\n        score: response.score ? Number(response.score) : 0,\n        subscore: response.subscore ? Number(response.subscore) : 0,\n        update_time: response.update_time,\n        username: response.username,\n        max_num_score: response.max_num_score ? Number(response.max_num_score) : 0,\n        rank: response.rank ? Number(response.rank) : 0\n      });\n    });\n  }\n  writeStorageObjects(session, objects) {\n    this.configuration.bearerToken = session && session.token;\n    var request = {objects: []};\n    objects.forEach((o) => {\n      request.objects.push({\n        collection: o.collection,\n        key: o.key,\n        permission_read: o.permission_read,\n        permission_write: o.permission_write,\n        value: JSON.stringify(o.value),\n        version: o.version\n      });\n    });\n    return this.apiClient.writeStorageObjects(request);\n  }\n  writeTournamentRecord(session, tournamentId, request) {\n    this.configuration.bearerToken = session && session.token;\n    return this.apiClient.writeTournamentRecord(tournamentId, {\n      metadata: request.metadata ? JSON.stringify(request.metadata) : void 0,\n      score: request.score,\n      subscore: request.subscore\n    }).then((response) => {\n      return Promise.resolve({\n        expiry_time: response.expiry_time,\n        leaderboard_id: response.leaderboard_id,\n        metadata: response.metadata ? JSON.parse(response.metadata) : void 0,\n        num_score: response.num_score ? Number(response.num_score) : 0,\n        owner_id: response.owner_id,\n        score: response.score ? Number(response.score) : 0,\n        subscore: response.subscore ? Number(response.subscore) : 0,\n        update_time: response.update_time,\n        username: response.username,\n        max_num_score: response.max_num_score ? Number(response.max_num_score) : 0,\n        rank: response.rank ? Number(response.rank) : 0\n      });\n    });\n  }\n};\n\n\n\n//# sourceURL=webpack://Nakama/./node_modules/@heroiclabs/nakama-js/dist/nakama-js.esm.js?");
  
  /***/ }),
  
  /***/ "./src/index.js":
  /*!**********************!*\
    !*** ./src/index.js ***!
    \**********************/
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  
  eval("var NakamaWrapper = __webpack_require__(/*! ./nakama */ \"./src/nakama.js\").default;\n\nvar Nakama = new NakamaWrapper(\"/*%clientHost%*/\", \"/*%clientPort%*/\", [\n  /*%useSSL%*/\n][0]);\nNakama.initiate();\nmodule.exports = Nakama;\n\n//# sourceURL=webpack://Nakama/./src/index.js?");
  
  /***/ }),
  
  /***/ "./src/logger.js":
  /*!***********************!*\
    !*** ./src/logger.js ***!
    \***********************/
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  
  "use strict";
  eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ _default)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n\n\n\nvar _default = /*#__PURE__*/function () {\n  function _default() {\n    _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, _default);\n  }\n\n  _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(_default, null, [{\n    key: \"log\",\n    value: function log(msg) {\n      var emoji = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n      var colour = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'black';\n\n      if ([\n        /*%debugMode%*/\n      ][0]) {\n        console.log(\"%s %c\".concat(msg), emoji, \"color: \".concat(colour));\n      }\n    }\n  }, {\n    key: \"success\",\n    value: function success(msg) {\n      if ([\n        /*%debugMode%*/\n      ][0]) {\n        console.log(\"%s \".concat(msg), '✔️');\n      }\n    }\n  }, {\n    key: \"warn\",\n    value: function warn(msg) {\n      if ([\n        /*%debugMode%*/\n      ][0]) {\n        console.log(\"%s \".concat(msg), '⚠️');\n      }\n    }\n  }]);\n\n  return _default;\n}();\n\n\n\n//# sourceURL=webpack://Nakama/./src/logger.js?");
  
  /***/ }),
  
  /***/ "./src/nakama.js":
  /*!***********************!*\
    !*** ./src/nakama.js ***!
    \***********************/
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  
  "use strict";
  eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Nakama)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _heroiclabs_nakama_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @heroiclabs/nakama-js */ \"./node_modules/@heroiclabs/nakama-js/dist/nakama-js.esm.js\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! uuid */ \"./node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./logger */ \"./src/logger.js\");\n\n\n\n\n\n\n\n\nvar Nakama = function Nakama(clientHost, clientPort, useSSL) {\n  var _this = this;\n\n  _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Nakama);\n\n  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default()(this, \"initiate\", /*#__PURE__*/_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {\n    return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {\n      while (1) {\n        switch (_context.prev = _context.next) {\n          case 0:\n            _context.next = 2;\n            return _this.checkSessionAndAuthenticate();\n\n          case 2:\n            _context.next = 4;\n            return _this.establishSocketConnection();\n\n          case 4:\n            _logger__WEBPACK_IMPORTED_MODULE_5__.default.log(\"ct.nakama has loaded!\", \"✨\");\n\n          case 5:\n          case \"end\":\n            return _context.stop();\n        }\n      }\n    }, _callee);\n  })));\n\n  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default()(this, \"checkSessionAndAuthenticate\", /*#__PURE__*/_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee2() {\n    var nakamaAuthToken, session, currentTimeInSec;\n    return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee2$(_context2) {\n      while (1) {\n        switch (_context2.prev = _context2.next) {\n          case 0:\n            // Checks browser for session and authenticates with server\n            nakamaAuthToken = localStorage.getItem(\"nakamaAuthToken\");\n\n            if (!(nakamaAuthToken && nakamaAuthToken != \"\")) {\n              _context2.next = 15;\n              break;\n            }\n\n            _logger__WEBPACK_IMPORTED_MODULE_5__.default.log(\"Session Found\");\n            session = _heroiclabs_nakama_js__WEBPACK_IMPORTED_MODULE_4__.Session.restore(nakamaAuthToken);\n            currentTimeInSec = new Date() / 1000;\n\n            if (session.isexpired(currentTimeInSec)) {\n              _context2.next = 10;\n              break;\n            }\n\n            // Session valid so restore it\n            _this.session = session;\n            _logger__WEBPACK_IMPORTED_MODULE_5__.default.log(\"Session Restored\");\n            _context2.next = 13;\n            break;\n\n          case 10:\n            _logger__WEBPACK_IMPORTED_MODULE_5__.default.log(\"Session Expired\");\n            _context2.next = 13;\n            return _this.createSession();\n\n          case 13:\n            _context2.next = 17;\n            break;\n\n          case 15:\n            _context2.next = 17;\n            return _this.createSession();\n\n          case 17:\n            _logger__WEBPACK_IMPORTED_MODULE_5__.default.success(\"Authenticated Session\");\n\n          case 18:\n          case \"end\":\n            return _context2.stop();\n        }\n      }\n    }, _callee2);\n  })));\n\n  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default()(this, \"establishSocketConnection\", /*#__PURE__*/_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee3() {\n    var trace;\n    return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee3$(_context3) {\n      while (1) {\n        switch (_context3.prev = _context3.next) {\n          case 0:\n            // Create connection to the server via websockets\n            trace = false; // TODO: understand what this does\n\n            _this.socket = _this.client.createSocket(_this.useSSL, trace);\n            _context3.next = 4;\n            return _this.socket.connect(_this.session);\n\n          case 4:\n            _logger__WEBPACK_IMPORTED_MODULE_5__.default.success(\"Established Websocket Connection\");\n\n          case 5:\n          case \"end\":\n            return _context3.stop();\n        }\n      }\n    }, _callee3);\n  })));\n\n  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default()(this, \"createSession\", /*#__PURE__*/_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee4() {\n    var newUserId, nakamaSession;\n    return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee4$(_context4) {\n      while (1) {\n        switch (_context4.prev = _context4.next) {\n          case 0:\n            _logger__WEBPACK_IMPORTED_MODULE_5__.default.log(\"Creating New Session\");\n            newUserId = (0,uuid__WEBPACK_IMPORTED_MODULE_6__.default)();\n            _context4.next = 4;\n            return _this.client.authenticateCustom(newUserId, true, newUserId);\n\n          case 4:\n            nakamaSession = _context4.sent;\n            localStorage.setItem(\"nakamaAuthToken\", nakamaSession.token);\n            _this.session = nakamaSession;\n            return _context4.abrupt(\"return\", _this.session);\n\n          case 8:\n          case \"end\":\n            return _context4.stop();\n        }\n      }\n    }, _callee4);\n  })));\n\n  this.useSSL = useSSL;\n  this.client = new _heroiclabs_nakama_js__WEBPACK_IMPORTED_MODULE_4__.Client(\"defaultkey\", clientHost, clientPort, this.useSSL);\n  this.session;\n  this.socket;\n  this.state = {};\n};\n\n\n\n//# sourceURL=webpack://Nakama/./src/nakama.js?");
  
  /***/ }),
  
  /***/ "./node_modules/regenerator-runtime/runtime.js":
  /*!*****************************************************!*\
    !*** ./node_modules/regenerator-runtime/runtime.js ***!
    \*****************************************************/
  /***/ ((module) => {
  
  eval("/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n  \"use strict\";\n\n  var Op = Object.prototype;\n  var hasOwn = Op.hasOwnProperty;\n  var undefined; // More compressible than void 0.\n  var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n  var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n  var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n  var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n  function define(obj, key, value) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n    return obj[key];\n  }\n  try {\n    // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n    define({}, \"\");\n  } catch (err) {\n    define = function(obj, key, value) {\n      return obj[key] = value;\n    };\n  }\n\n  function wrap(innerFn, outerFn, self, tryLocsList) {\n    // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n    var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n    var generator = Object.create(protoGenerator.prototype);\n    var context = new Context(tryLocsList || []);\n\n    // The ._invoke method unifies the implementations of the .next,\n    // .throw, and .return methods.\n    generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n    return generator;\n  }\n  exports.wrap = wrap;\n\n  // Try/catch helper to minimize deoptimizations. Returns a completion\n  // record like context.tryEntries[i].completion. This interface could\n  // have been (and was previously) designed to take a closure to be\n  // invoked without arguments, but in all the cases we care about we\n  // already have an existing method we want to call, so there's no need\n  // to create a new function object. We can even get away with assuming\n  // the method takes exactly one argument, since that happens to be true\n  // in every case, so we don't have to touch the arguments object. The\n  // only additional allocation required is the completion record, which\n  // has a stable shape and so hopefully should be cheap to allocate.\n  function tryCatch(fn, obj, arg) {\n    try {\n      return { type: \"normal\", arg: fn.call(obj, arg) };\n    } catch (err) {\n      return { type: \"throw\", arg: err };\n    }\n  }\n\n  var GenStateSuspendedStart = \"suspendedStart\";\n  var GenStateSuspendedYield = \"suspendedYield\";\n  var GenStateExecuting = \"executing\";\n  var GenStateCompleted = \"completed\";\n\n  // Returning this object from the innerFn has the same effect as\n  // breaking out of the dispatch switch statement.\n  var ContinueSentinel = {};\n\n  // Dummy constructor functions that we use as the .constructor and\n  // .constructor.prototype properties for functions that return Generator\n  // objects. For full spec compliance, you may wish to configure your\n  // minifier not to mangle the names of these two functions.\n  function Generator() {}\n  function GeneratorFunction() {}\n  function GeneratorFunctionPrototype() {}\n\n  // This is a polyfill for %IteratorPrototype% for environments that\n  // don't natively support it.\n  var IteratorPrototype = {};\n  IteratorPrototype[iteratorSymbol] = function () {\n    return this;\n  };\n\n  var getProto = Object.getPrototypeOf;\n  var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n  if (NativeIteratorPrototype &&\n      NativeIteratorPrototype !== Op &&\n      hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n    // This environment has a native %IteratorPrototype%; use it instead\n    // of the polyfill.\n    IteratorPrototype = NativeIteratorPrototype;\n  }\n\n  var Gp = GeneratorFunctionPrototype.prototype =\n    Generator.prototype = Object.create(IteratorPrototype);\n  GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n  GeneratorFunctionPrototype.constructor = GeneratorFunction;\n  GeneratorFunction.displayName = define(\n    GeneratorFunctionPrototype,\n    toStringTagSymbol,\n    \"GeneratorFunction\"\n  );\n\n  // Helper for defining the .next, .throw, and .return methods of the\n  // Iterator interface in terms of a single ._invoke method.\n  function defineIteratorMethods(prototype) {\n    [\"next\", \"throw\", \"return\"].forEach(function(method) {\n      define(prototype, method, function(arg) {\n        return this._invoke(method, arg);\n      });\n    });\n  }\n\n  exports.isGeneratorFunction = function(genFun) {\n    var ctor = typeof genFun === \"function\" && genFun.constructor;\n    return ctor\n      ? ctor === GeneratorFunction ||\n        // For the native GeneratorFunction constructor, the best we can\n        // do is to check its .name property.\n        (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n      : false;\n  };\n\n  exports.mark = function(genFun) {\n    if (Object.setPrototypeOf) {\n      Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n    } else {\n      genFun.__proto__ = GeneratorFunctionPrototype;\n      define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n    }\n    genFun.prototype = Object.create(Gp);\n    return genFun;\n  };\n\n  // Within the body of any async function, `await x` is transformed to\n  // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n  // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n  // meant to be awaited.\n  exports.awrap = function(arg) {\n    return { __await: arg };\n  };\n\n  function AsyncIterator(generator, PromiseImpl) {\n    function invoke(method, arg, resolve, reject) {\n      var record = tryCatch(generator[method], generator, arg);\n      if (record.type === \"throw\") {\n        reject(record.arg);\n      } else {\n        var result = record.arg;\n        var value = result.value;\n        if (value &&\n            typeof value === \"object\" &&\n            hasOwn.call(value, \"__await\")) {\n          return PromiseImpl.resolve(value.__await).then(function(value) {\n            invoke(\"next\", value, resolve, reject);\n          }, function(err) {\n            invoke(\"throw\", err, resolve, reject);\n          });\n        }\n\n        return PromiseImpl.resolve(value).then(function(unwrapped) {\n          // When a yielded Promise is resolved, its final value becomes\n          // the .value of the Promise<{value,done}> result for the\n          // current iteration.\n          result.value = unwrapped;\n          resolve(result);\n        }, function(error) {\n          // If a rejected Promise was yielded, throw the rejection back\n          // into the async generator function so it can be handled there.\n          return invoke(\"throw\", error, resolve, reject);\n        });\n      }\n    }\n\n    var previousPromise;\n\n    function enqueue(method, arg) {\n      function callInvokeWithMethodAndArg() {\n        return new PromiseImpl(function(resolve, reject) {\n          invoke(method, arg, resolve, reject);\n        });\n      }\n\n      return previousPromise =\n        // If enqueue has been called before, then we want to wait until\n        // all previous Promises have been resolved before calling invoke,\n        // so that results are always delivered in the correct order. If\n        // enqueue has not been called before, then it is important to\n        // call invoke immediately, without waiting on a callback to fire,\n        // so that the async generator function has the opportunity to do\n        // any necessary setup in a predictable way. This predictability\n        // is why the Promise constructor synchronously invokes its\n        // executor callback, and why async functions synchronously\n        // execute code before the first await. Since we implement simple\n        // async functions in terms of async generators, it is especially\n        // important to get this right, even though it requires care.\n        previousPromise ? previousPromise.then(\n          callInvokeWithMethodAndArg,\n          // Avoid propagating failures to Promises returned by later\n          // invocations of the iterator.\n          callInvokeWithMethodAndArg\n        ) : callInvokeWithMethodAndArg();\n    }\n\n    // Define the unified helper method that is used to implement .next,\n    // .throw, and .return (see defineIteratorMethods).\n    this._invoke = enqueue;\n  }\n\n  defineIteratorMethods(AsyncIterator.prototype);\n  AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n    return this;\n  };\n  exports.AsyncIterator = AsyncIterator;\n\n  // Note that simple async functions are implemented on top of\n  // AsyncIterator objects; they just return a Promise for the value of\n  // the final result produced by the iterator.\n  exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n    if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n    var iter = new AsyncIterator(\n      wrap(innerFn, outerFn, self, tryLocsList),\n      PromiseImpl\n    );\n\n    return exports.isGeneratorFunction(outerFn)\n      ? iter // If outerFn is a generator, return the full iterator.\n      : iter.next().then(function(result) {\n          return result.done ? result.value : iter.next();\n        });\n  };\n\n  function makeInvokeMethod(innerFn, self, context) {\n    var state = GenStateSuspendedStart;\n\n    return function invoke(method, arg) {\n      if (state === GenStateExecuting) {\n        throw new Error(\"Generator is already running\");\n      }\n\n      if (state === GenStateCompleted) {\n        if (method === \"throw\") {\n          throw arg;\n        }\n\n        // Be forgiving, per 25.3.3.3.3 of the spec:\n        // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n        return doneResult();\n      }\n\n      context.method = method;\n      context.arg = arg;\n\n      while (true) {\n        var delegate = context.delegate;\n        if (delegate) {\n          var delegateResult = maybeInvokeDelegate(delegate, context);\n          if (delegateResult) {\n            if (delegateResult === ContinueSentinel) continue;\n            return delegateResult;\n          }\n        }\n\n        if (context.method === \"next\") {\n          // Setting context._sent for legacy support of Babel's\n          // function.sent implementation.\n          context.sent = context._sent = context.arg;\n\n        } else if (context.method === \"throw\") {\n          if (state === GenStateSuspendedStart) {\n            state = GenStateCompleted;\n            throw context.arg;\n          }\n\n          context.dispatchException(context.arg);\n\n        } else if (context.method === \"return\") {\n          context.abrupt(\"return\", context.arg);\n        }\n\n        state = GenStateExecuting;\n\n        var record = tryCatch(innerFn, self, context);\n        if (record.type === \"normal\") {\n          // If an exception is thrown from innerFn, we leave state ===\n          // GenStateExecuting and loop back for another invocation.\n          state = context.done\n            ? GenStateCompleted\n            : GenStateSuspendedYield;\n\n          if (record.arg === ContinueSentinel) {\n            continue;\n          }\n\n          return {\n            value: record.arg,\n            done: context.done\n          };\n\n        } else if (record.type === \"throw\") {\n          state = GenStateCompleted;\n          // Dispatch the exception by looping back around to the\n          // context.dispatchException(context.arg) call above.\n          context.method = \"throw\";\n          context.arg = record.arg;\n        }\n      }\n    };\n  }\n\n  // Call delegate.iterator[context.method](context.arg) and handle the\n  // result, either by returning a { value, done } result from the\n  // delegate iterator, or by modifying context.method and context.arg,\n  // setting context.delegate to null, and returning the ContinueSentinel.\n  function maybeInvokeDelegate(delegate, context) {\n    var method = delegate.iterator[context.method];\n    if (method === undefined) {\n      // A .throw or .return when the delegate iterator has no .throw\n      // method always terminates the yield* loop.\n      context.delegate = null;\n\n      if (context.method === \"throw\") {\n        // Note: [\"return\"] must be used for ES3 parsing compatibility.\n        if (delegate.iterator[\"return\"]) {\n          // If the delegate iterator has a return method, give it a\n          // chance to clean up.\n          context.method = \"return\";\n          context.arg = undefined;\n          maybeInvokeDelegate(delegate, context);\n\n          if (context.method === \"throw\") {\n            // If maybeInvokeDelegate(context) changed context.method from\n            // \"return\" to \"throw\", let that override the TypeError below.\n            return ContinueSentinel;\n          }\n        }\n\n        context.method = \"throw\";\n        context.arg = new TypeError(\n          \"The iterator does not provide a 'throw' method\");\n      }\n\n      return ContinueSentinel;\n    }\n\n    var record = tryCatch(method, delegate.iterator, context.arg);\n\n    if (record.type === \"throw\") {\n      context.method = \"throw\";\n      context.arg = record.arg;\n      context.delegate = null;\n      return ContinueSentinel;\n    }\n\n    var info = record.arg;\n\n    if (! info) {\n      context.method = \"throw\";\n      context.arg = new TypeError(\"iterator result is not an object\");\n      context.delegate = null;\n      return ContinueSentinel;\n    }\n\n    if (info.done) {\n      // Assign the result of the finished delegate to the temporary\n      // variable specified by delegate.resultName (see delegateYield).\n      context[delegate.resultName] = info.value;\n\n      // Resume execution at the desired location (see delegateYield).\n      context.next = delegate.nextLoc;\n\n      // If context.method was \"throw\" but the delegate handled the\n      // exception, let the outer generator proceed normally. If\n      // context.method was \"next\", forget context.arg since it has been\n      // \"consumed\" by the delegate iterator. If context.method was\n      // \"return\", allow the original .return call to continue in the\n      // outer generator.\n      if (context.method !== \"return\") {\n        context.method = \"next\";\n        context.arg = undefined;\n      }\n\n    } else {\n      // Re-yield the result returned by the delegate method.\n      return info;\n    }\n\n    // The delegate iterator is finished, so forget it and continue with\n    // the outer generator.\n    context.delegate = null;\n    return ContinueSentinel;\n  }\n\n  // Define Generator.prototype.{next,throw,return} in terms of the\n  // unified ._invoke helper method.\n  defineIteratorMethods(Gp);\n\n  define(Gp, toStringTagSymbol, \"Generator\");\n\n  // A Generator should always return itself as the iterator object when the\n  // @@iterator function is called on it. Some browsers' implementations of the\n  // iterator prototype chain incorrectly implement this, causing the Generator\n  // object to not be returned from this call. This ensures that doesn't happen.\n  // See https://github.com/facebook/regenerator/issues/274 for more details.\n  Gp[iteratorSymbol] = function() {\n    return this;\n  };\n\n  Gp.toString = function() {\n    return \"[object Generator]\";\n  };\n\n  function pushTryEntry(locs) {\n    var entry = { tryLoc: locs[0] };\n\n    if (1 in locs) {\n      entry.catchLoc = locs[1];\n    }\n\n    if (2 in locs) {\n      entry.finallyLoc = locs[2];\n      entry.afterLoc = locs[3];\n    }\n\n    this.tryEntries.push(entry);\n  }\n\n  function resetTryEntry(entry) {\n    var record = entry.completion || {};\n    record.type = \"normal\";\n    delete record.arg;\n    entry.completion = record;\n  }\n\n  function Context(tryLocsList) {\n    // The root entry object (effectively a try statement without a catch\n    // or a finally block) gives us a place to store values thrown from\n    // locations where there is no enclosing try statement.\n    this.tryEntries = [{ tryLoc: \"root\" }];\n    tryLocsList.forEach(pushTryEntry, this);\n    this.reset(true);\n  }\n\n  exports.keys = function(object) {\n    var keys = [];\n    for (var key in object) {\n      keys.push(key);\n    }\n    keys.reverse();\n\n    // Rather than returning an object with a next method, we keep\n    // things simple and return the next function itself.\n    return function next() {\n      while (keys.length) {\n        var key = keys.pop();\n        if (key in object) {\n          next.value = key;\n          next.done = false;\n          return next;\n        }\n      }\n\n      // To avoid creating an additional object, we just hang the .value\n      // and .done properties off the next function object itself. This\n      // also ensures that the minifier will not anonymize the function.\n      next.done = true;\n      return next;\n    };\n  };\n\n  function values(iterable) {\n    if (iterable) {\n      var iteratorMethod = iterable[iteratorSymbol];\n      if (iteratorMethod) {\n        return iteratorMethod.call(iterable);\n      }\n\n      if (typeof iterable.next === \"function\") {\n        return iterable;\n      }\n\n      if (!isNaN(iterable.length)) {\n        var i = -1, next = function next() {\n          while (++i < iterable.length) {\n            if (hasOwn.call(iterable, i)) {\n              next.value = iterable[i];\n              next.done = false;\n              return next;\n            }\n          }\n\n          next.value = undefined;\n          next.done = true;\n\n          return next;\n        };\n\n        return next.next = next;\n      }\n    }\n\n    // Return an iterator with no values.\n    return { next: doneResult };\n  }\n  exports.values = values;\n\n  function doneResult() {\n    return { value: undefined, done: true };\n  }\n\n  Context.prototype = {\n    constructor: Context,\n\n    reset: function(skipTempReset) {\n      this.prev = 0;\n      this.next = 0;\n      // Resetting context._sent for legacy support of Babel's\n      // function.sent implementation.\n      this.sent = this._sent = undefined;\n      this.done = false;\n      this.delegate = null;\n\n      this.method = \"next\";\n      this.arg = undefined;\n\n      this.tryEntries.forEach(resetTryEntry);\n\n      if (!skipTempReset) {\n        for (var name in this) {\n          // Not sure about the optimal order of these conditions:\n          if (name.charAt(0) === \"t\" &&\n              hasOwn.call(this, name) &&\n              !isNaN(+name.slice(1))) {\n            this[name] = undefined;\n          }\n        }\n      }\n    },\n\n    stop: function() {\n      this.done = true;\n\n      var rootEntry = this.tryEntries[0];\n      var rootRecord = rootEntry.completion;\n      if (rootRecord.type === \"throw\") {\n        throw rootRecord.arg;\n      }\n\n      return this.rval;\n    },\n\n    dispatchException: function(exception) {\n      if (this.done) {\n        throw exception;\n      }\n\n      var context = this;\n      function handle(loc, caught) {\n        record.type = \"throw\";\n        record.arg = exception;\n        context.next = loc;\n\n        if (caught) {\n          // If the dispatched exception was caught by a catch block,\n          // then let that catch block handle the exception normally.\n          context.method = \"next\";\n          context.arg = undefined;\n        }\n\n        return !! caught;\n      }\n\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        var record = entry.completion;\n\n        if (entry.tryLoc === \"root\") {\n          // Exception thrown outside of any try block that could handle\n          // it, so set the completion value of the entire function to\n          // throw the exception.\n          return handle(\"end\");\n        }\n\n        if (entry.tryLoc <= this.prev) {\n          var hasCatch = hasOwn.call(entry, \"catchLoc\");\n          var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n          if (hasCatch && hasFinally) {\n            if (this.prev < entry.catchLoc) {\n              return handle(entry.catchLoc, true);\n            } else if (this.prev < entry.finallyLoc) {\n              return handle(entry.finallyLoc);\n            }\n\n          } else if (hasCatch) {\n            if (this.prev < entry.catchLoc) {\n              return handle(entry.catchLoc, true);\n            }\n\n          } else if (hasFinally) {\n            if (this.prev < entry.finallyLoc) {\n              return handle(entry.finallyLoc);\n            }\n\n          } else {\n            throw new Error(\"try statement without catch or finally\");\n          }\n        }\n      }\n    },\n\n    abrupt: function(type, arg) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.tryLoc <= this.prev &&\n            hasOwn.call(entry, \"finallyLoc\") &&\n            this.prev < entry.finallyLoc) {\n          var finallyEntry = entry;\n          break;\n        }\n      }\n\n      if (finallyEntry &&\n          (type === \"break\" ||\n           type === \"continue\") &&\n          finallyEntry.tryLoc <= arg &&\n          arg <= finallyEntry.finallyLoc) {\n        // Ignore the finally entry if control is not jumping to a\n        // location outside the try/catch block.\n        finallyEntry = null;\n      }\n\n      var record = finallyEntry ? finallyEntry.completion : {};\n      record.type = type;\n      record.arg = arg;\n\n      if (finallyEntry) {\n        this.method = \"next\";\n        this.next = finallyEntry.finallyLoc;\n        return ContinueSentinel;\n      }\n\n      return this.complete(record);\n    },\n\n    complete: function(record, afterLoc) {\n      if (record.type === \"throw\") {\n        throw record.arg;\n      }\n\n      if (record.type === \"break\" ||\n          record.type === \"continue\") {\n        this.next = record.arg;\n      } else if (record.type === \"return\") {\n        this.rval = this.arg = record.arg;\n        this.method = \"return\";\n        this.next = \"end\";\n      } else if (record.type === \"normal\" && afterLoc) {\n        this.next = afterLoc;\n      }\n\n      return ContinueSentinel;\n    },\n\n    finish: function(finallyLoc) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.finallyLoc === finallyLoc) {\n          this.complete(entry.completion, entry.afterLoc);\n          resetTryEntry(entry);\n          return ContinueSentinel;\n        }\n      }\n    },\n\n    \"catch\": function(tryLoc) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.tryLoc === tryLoc) {\n          var record = entry.completion;\n          if (record.type === \"throw\") {\n            var thrown = record.arg;\n            resetTryEntry(entry);\n          }\n          return thrown;\n        }\n      }\n\n      // The context.catch method must only be called with a location\n      // argument that corresponds to a known catch block.\n      throw new Error(\"illegal catch attempt\");\n    },\n\n    delegateYield: function(iterable, resultName, nextLoc) {\n      this.delegate = {\n        iterator: values(iterable),\n        resultName: resultName,\n        nextLoc: nextLoc\n      };\n\n      if (this.method === \"next\") {\n        // Deliberately forget the last sent value so that we don't\n        // accidentally pass it on to the delegate.\n        this.arg = undefined;\n      }\n\n      return ContinueSentinel;\n    }\n  };\n\n  // Regardless of whether this script is executing as a CommonJS module\n  // or not, return the runtime object so that we can declare the variable\n  // regeneratorRuntime in the outer scope, which allows this module to be\n  // injected easily by `bin/regenerator --include-runtime script.js`.\n  return exports;\n\n}(\n  // If this script is executing as a CommonJS module, use module.exports\n  // as the regeneratorRuntime namespace. Otherwise create a new empty\n  // object. Either way, the resulting object will be used to initialize\n  // the regeneratorRuntime variable at the top of this file.\n   true ? module.exports : 0\n));\n\ntry {\n  regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n  // This module should not be running in strict mode, so the above\n  // assignment should always work unless something is misconfigured. Just\n  // in case runtime.js accidentally runs in strict mode, we can escape\n  // strict mode using a global Function call. This could conceivably fail\n  // if a Content Security Policy forbids using Function, but in that case\n  // the proper solution is to fix the accidental strict mode problem. If\n  // you've misconfigured your bundler to force strict mode and applied a\n  // CSP to forbid Function, and you're not willing to fix either of those\n  // problems, please detail your unique predicament in a GitHub issue.\n  Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n\n\n//# sourceURL=webpack://Nakama/./node_modules/regenerator-runtime/runtime.js?");
  
  /***/ }),
  
  /***/ "./node_modules/uuid/dist/esm-browser/regex.js":
  /*!*****************************************************!*\
    !*** ./node_modules/uuid/dist/esm-browser/regex.js ***!
    \*****************************************************/
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  
  "use strict";
  eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);\n\n//# sourceURL=webpack://Nakama/./node_modules/uuid/dist/esm-browser/regex.js?");
  
  /***/ }),
  
  /***/ "./node_modules/uuid/dist/esm-browser/rng.js":
  /*!***************************************************!*\
    !*** ./node_modules/uuid/dist/esm-browser/rng.js ***!
    \***************************************************/
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  
  "use strict";
  eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ rng)\n/* harmony export */ });\n// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nfunction rng() {\n  // lazy load so that environments that need to polyfill have a chance to do so\n  if (!getRandomValues) {\n    // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n    // find the complete implementation of crypto (msCrypto) on IE11.\n    getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n    if (!getRandomValues) {\n      throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n    }\n  }\n\n  return getRandomValues(rnds8);\n}\n\n//# sourceURL=webpack://Nakama/./node_modules/uuid/dist/esm-browser/rng.js?");
  
  /***/ }),
  
  /***/ "./node_modules/uuid/dist/esm-browser/stringify.js":
  /*!*********************************************************!*\
    !*** ./node_modules/uuid/dist/esm-browser/stringify.js ***!
    \*********************************************************/
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  
  "use strict";
  eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validate.js */ \"./node_modules/uuid/dist/esm-browser/validate.js\");\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n  byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n  var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n  // Note: Be careful editing this code!  It's been tuned for performance\n  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n  var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID.  If this throws, it's likely due to one\n  // of the following:\n  // - One or more input array values don't map to a hex octet (leading to\n  // \"undefined\" in the uuid)\n  // - Invalid input values for the RFC `version` or `variant` fields\n\n  if (!(0,_validate_js__WEBPACK_IMPORTED_MODULE_0__.default)(uuid)) {\n    throw TypeError('Stringified UUID is invalid');\n  }\n\n  return uuid;\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stringify);\n\n//# sourceURL=webpack://Nakama/./node_modules/uuid/dist/esm-browser/stringify.js?");
  
  /***/ }),
  
  /***/ "./node_modules/uuid/dist/esm-browser/v4.js":
  /*!**************************************************!*\
    !*** ./node_modules/uuid/dist/esm-browser/v4.js ***!
    \**************************************************/
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  
  "use strict";
  eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _rng_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rng.js */ \"./node_modules/uuid/dist/esm-browser/rng.js\");\n/* harmony import */ var _stringify_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stringify.js */ \"./node_modules/uuid/dist/esm-browser/stringify.js\");\n\n\n\nfunction v4(options, buf, offset) {\n  options = options || {};\n  var rnds = options.random || (options.rng || _rng_js__WEBPACK_IMPORTED_MODULE_0__.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n  rnds[6] = rnds[6] & 0x0f | 0x40;\n  rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n  if (buf) {\n    offset = offset || 0;\n\n    for (var i = 0; i < 16; ++i) {\n      buf[offset + i] = rnds[i];\n    }\n\n    return buf;\n  }\n\n  return (0,_stringify_js__WEBPACK_IMPORTED_MODULE_1__.default)(rnds);\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (v4);\n\n//# sourceURL=webpack://Nakama/./node_modules/uuid/dist/esm-browser/v4.js?");
  
  /***/ }),
  
  /***/ "./node_modules/uuid/dist/esm-browser/validate.js":
  /*!********************************************************!*\
    !*** ./node_modules/uuid/dist/esm-browser/validate.js ***!
    \********************************************************/
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  
  "use strict";
  eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _regex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./regex.js */ \"./node_modules/uuid/dist/esm-browser/regex.js\");\n\n\nfunction validate(uuid) {\n  return typeof uuid === 'string' && _regex_js__WEBPACK_IMPORTED_MODULE_0__.default.test(uuid);\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (validate);\n\n//# sourceURL=webpack://Nakama/./node_modules/uuid/dist/esm-browser/validate.js?");
  
  /***/ })
  
  /******/ 	});
  /************************************************************************/
  /******/ 	// The module cache
  /******/ 	var __webpack_module_cache__ = {};
  /******/ 	
  /******/ 	// The require function
  /******/ 	function __webpack_require__(moduleId) {
  /******/ 		// Check if module is in cache
  /******/ 		if(__webpack_module_cache__[moduleId]) {
  /******/ 			return __webpack_module_cache__[moduleId].exports;
  /******/ 		}
  /******/ 		// Create a new module (and put it into the cache)
  /******/ 		var module = __webpack_module_cache__[moduleId] = {
  /******/ 			// no module.id needed
  /******/ 			// no module.loaded needed
  /******/ 			exports: {}
  /******/ 		};
  /******/ 	
  /******/ 		// Execute the module function
  /******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  /******/ 	
  /******/ 		// Return the exports of the module
  /******/ 		return module.exports;
  /******/ 	}
  /******/ 	
  /************************************************************************/
  /******/ 	/* webpack/runtime/compat get default export */
  /******/ 	(() => {
  /******/ 		// getDefaultExport function for compatibility with non-harmony modules
  /******/ 		__webpack_require__.n = (module) => {
  /******/ 			var getter = module && module.__esModule ?
  /******/ 				() => (module['default']) :
  /******/ 				() => (module);
  /******/ 			__webpack_require__.d(getter, { a: getter });
  /******/ 			return getter;
  /******/ 		};
  /******/ 	})();
  /******/ 	
  /******/ 	/* webpack/runtime/define property getters */
  /******/ 	(() => {
  /******/ 		// define getter functions for harmony exports
  /******/ 		__webpack_require__.d = (exports, definition) => {
  /******/ 			for(var key in definition) {
  /******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  /******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  /******/ 				}
  /******/ 			}
  /******/ 		};
  /******/ 	})();
  /******/ 	
  /******/ 	/* webpack/runtime/hasOwnProperty shorthand */
  /******/ 	(() => {
  /******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  /******/ 	})();
  /******/ 	
  /******/ 	/* webpack/runtime/make namespace object */
  /******/ 	(() => {
  /******/ 		// define __esModule on exports
  /******/ 		__webpack_require__.r = (exports) => {
  /******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  /******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  /******/ 			}
  /******/ 			Object.defineProperty(exports, '__esModule', { value: true });
  /******/ 		};
  /******/ 	})();
  /******/ 	
  /************************************************************************/
  /******/ 	
  /******/ 	// startup
  /******/ 	// Load entry module and return exports
  /******/ 	// This entry module is referenced by other modules so it can't be inlined
  /******/ 	var __webpack_exports__ = __webpack_require__("./src/index.js");
  /******/ 	Nakama = __webpack_exports__;
  /******/ 	
  /******/ })()
  ;