@opencampus/ocid-connect-js 2.0.5 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -111,7 +111,7 @@ __webpack_require__.r(__webpack_exports__);
111
111
 
112
112
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useOCAuth", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["useOCAuth"]; });
113
113
 
114
- /* harmony import */ var _sdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34);
114
+ /* harmony import */ var _sdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36);
115
115
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TokenManager", function() { return _sdk__WEBPACK_IMPORTED_MODULE_1__["TokenManager"]; });
116
116
 
117
117
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TransactionManager", function() { return _sdk__WEBPACK_IMPORTED_MODULE_1__["TransactionManager"]; });
@@ -175,8 +175,8 @@ __webpack_require__.r(__webpack_exports__);
175
175
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
176
176
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
177
177
  /* harmony import */ var _OCContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
178
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
179
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
178
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
179
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
180
180
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
181
181
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
182
182
  /*!
@@ -257,22 +257,23 @@ function LoginButton(_ref) {
257
257
  var pill = _ref.pill,
258
258
  disabled = _ref.disabled,
259
259
  theme = _ref.theme,
260
- state = _ref.state;
260
+ state = _ref.state,
261
+ emailPlaceholder = _ref.emailPlaceholder;
261
262
  var _useOCAuth = Object(_OCContext__WEBPACK_IMPORTED_MODULE_1__["useOCAuth"])(),
262
263
  ocAuth = _useOCAuth.ocAuth;
263
264
  var customTheme = themes[theme] || themes['ocBlue'];
264
265
  var loginWithRedirect = /*#__PURE__*/function () {
265
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
266
- return _regeneratorRuntime().wrap(function _callee$(_context) {
267
- while (1) switch (_context.prev = _context.next) {
266
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
267
+ return _regenerator().w(function (_context) {
268
+ while (1) switch (_context.n) {
268
269
  case 0:
269
- _context.next = 2;
270
+ _context.n = 1;
270
271
  return ocAuth.signInWithRedirect({
271
- state: state
272
+ state: state,
273
+ emailPlaceholder: emailPlaceholder
272
274
  });
273
- case 2:
274
- case "end":
275
- return _context.stop();
275
+ case 1:
276
+ return _context.a(2);
276
277
  }
277
278
  }, _callee);
278
279
  }));
@@ -338,8 +339,8 @@ __webpack_require__.r(__webpack_exports__);
338
339
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
339
340
  /* harmony import */ var _OCSpinner__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
340
341
  /* harmony import */ var _OCContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
341
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
342
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
342
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
343
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
343
344
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
344
345
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
345
346
  /*!
@@ -367,33 +368,33 @@ var LoginCallBack = function LoginCallBack(_ref) {
367
368
  setAuthError = _useOCAuth.setAuthError;
368
369
  Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
369
370
  var handleLogin = /*#__PURE__*/function () {
370
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
371
- return _regeneratorRuntime().wrap(function _callee$(_context) {
372
- while (1) switch (_context.prev = _context.next) {
371
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
372
+ var _t;
373
+ return _regenerator().w(function (_context) {
374
+ while (1) switch (_context.p = _context.n) {
373
375
  case 0:
374
376
  if (!ocAuth) {
375
- _context.next = 11;
377
+ _context.n = 4;
376
378
  break;
377
379
  }
378
- _context.prev = 1;
379
- _context.next = 4;
380
+ _context.p = 1;
381
+ _context.n = 2;
380
382
  return ocAuth.handleLoginRedirect();
381
- case 4:
383
+ case 2:
382
384
  successCallback();
383
- _context.next = 11;
385
+ _context.n = 4;
384
386
  break;
385
- case 7:
386
- _context.prev = 7;
387
- _context.t0 = _context["catch"](1);
388
- setAuthError(_context.t0);
387
+ case 3:
388
+ _context.p = 3;
389
+ _t = _context.v;
390
+ setAuthError(_t);
389
391
  if (errorCallback) {
390
392
  errorCallback();
391
393
  }
392
- case 11:
393
- case "end":
394
- return _context.stop();
394
+ case 4:
395
+ return _context.a(2);
395
396
  }
396
- }, _callee, null, [[1, 7]]);
397
+ }, _callee, null, [[1, 3]]);
397
398
  }));
398
399
  return function handleLogin() {
399
400
  return _ref2.apply(this, arguments);
@@ -1021,13 +1022,13 @@ var OCConnect = function OCConnect(_ref) {
1021
1022
  authState = _useState8[0],
1022
1023
  setAuthState = _useState8[1];
1023
1024
  var _useState9 = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(false),
1024
- _useState10 = _slicedToArray(_useState9, 2),
1025
- isInitialized = _useState10[0],
1026
- setIsInitialized = _useState10[1];
1027
- var _useState11 = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(null),
1028
- _useState12 = _slicedToArray(_useState11, 2),
1029
- authError = _useState12[0],
1030
- setAuthError = _useState12[1];
1025
+ _useState0 = _slicedToArray(_useState9, 2),
1026
+ isInitialized = _useState0[0],
1027
+ setIsInitialized = _useState0[1];
1028
+ var _useState1 = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(null),
1029
+ _useState10 = _slicedToArray(_useState1, 2),
1030
+ authError = _useState10[0],
1031
+ setAuthError = _useState10[1];
1031
1032
  var updateAuthState = function updateAuthState(authState) {
1032
1033
  setAuthState(authState);
1033
1034
  setOCId(authState.OCId);
@@ -1073,13 +1074,16 @@ __webpack_require__.r(__webpack_exports__);
1073
1074
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OCAuthCore", function() { return OCAuthCore; });
1074
1075
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OCAuthLive", function() { return OCAuthLive; });
1075
1076
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OCAuthSandbox", function() { return OCAuthSandbox; });
1076
- /* harmony import */ var _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
1077
- /* harmony import */ var _lib_TokenManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
1078
- /* harmony import */ var _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28);
1079
- /* harmony import */ var _lib_StorageManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29);
1080
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17);
1081
- /* harmony import */ var _endpoints__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(32);
1082
- /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(25);
1077
+ /* harmony import */ var _mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
1078
+ /* harmony import */ var _mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0__);
1079
+ /* harmony import */ var _lib_WalletServiceManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
1080
+ /* harmony import */ var _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
1081
+ /* harmony import */ var _lib_TokenManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(18);
1082
+ /* harmony import */ var _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30);
1083
+ /* harmony import */ var _lib_StorageManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(31);
1084
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(19);
1085
+ /* harmony import */ var _endpoints__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(34);
1086
+ /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(27);
1083
1087
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1084
1088
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
1085
1089
  function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
@@ -1088,7 +1092,8 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
1088
1092
  function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
1089
1093
  function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
1090
1094
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
1091
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
1095
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
1096
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
1092
1097
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
1093
1098
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
1094
1099
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -1113,8 +1118,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
1113
1118
 
1114
1119
 
1115
1120
 
1121
+
1122
+
1116
1123
  var OCAuthCore = /*#__PURE__*/function () {
1117
- function OCAuthCore(clientId, loginEndpoint, redirectUri, transactionManager, tokenManager, referralCode, logoutEndPoint, emailPlaceholder) {
1124
+ function OCAuthCore(clientId, loginEndpoint, redirectUri, transactionManager, tokenManager, referralCode, logoutEndPoint, walletServiceManager, authInfoManager) {
1118
1125
  _classCallCheck(this, OCAuthCore);
1119
1126
  _defineProperty(this, "clientId", void 0);
1120
1127
  _defineProperty(this, "tokenManager", void 0);
@@ -1124,19 +1131,19 @@ var OCAuthCore = /*#__PURE__*/function () {
1124
1131
  _defineProperty(this, "loginEndPoint", void 0);
1125
1132
  _defineProperty(this, "logoutEndPoint", void 0);
1126
1133
  _defineProperty(this, "referralCode", void 0);
1127
- _defineProperty(this, "emailPlaceholder", void 0);
1134
+ _defineProperty(this, "walletServiceManager", void 0);
1128
1135
  if (!clientId) {
1129
- throw new _utils_errors__WEBPACK_IMPORTED_MODULE_6__["InvalidParamsError"]('clientId is not defined');
1136
+ throw new _utils_errors__WEBPACK_IMPORTED_MODULE_8__["InvalidParamsError"]('clientId is not defined');
1130
1137
  }
1131
1138
  this.transactionManager = transactionManager;
1132
1139
  this.tokenManager = tokenManager;
1133
- this.authInfoManager = new _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_0__["default"]();
1140
+ this.authInfoManager = authInfoManager;
1134
1141
  this.loginEndPoint = loginEndpoint;
1135
1142
  this.logoutEndPoint = logoutEndPoint;
1136
1143
  this.redirectUri = redirectUri;
1137
1144
  this.referralCode = referralCode;
1138
- this.emailPlaceholder = emailPlaceholder;
1139
1145
  this.clientId = clientId;
1146
+ this.walletServiceManager = walletServiceManager;
1140
1147
  this.syncAuthInfo();
1141
1148
  }
1142
1149
  return _createClass(OCAuthCore, [{
@@ -1148,20 +1155,22 @@ var OCAuthCore = /*#__PURE__*/function () {
1148
1155
  }, {
1149
1156
  key: "logout",
1150
1157
  value: function () {
1151
- var _logout = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(logoutReturnTo) {
1158
+ var _logout = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(logoutReturnTo) {
1152
1159
  var url;
1153
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1154
- while (1) switch (_context.prev = _context.next) {
1160
+ return _regenerator().w(function (_context) {
1161
+ while (1) switch (_context.n) {
1155
1162
  case 0:
1156
1163
  this.clearStorage();
1164
+ _context.n = 1;
1165
+ return this.walletServiceManager.logout();
1166
+ case 1:
1157
1167
  url = new URL(this.logoutEndPoint);
1158
1168
  if (logoutReturnTo) {
1159
1169
  url.searchParams.append('returnTo', logoutReturnTo);
1160
1170
  }
1161
1171
  window.location.assign(url.toString());
1162
- case 4:
1163
- case "end":
1164
- return _context.stop();
1172
+ case 2:
1173
+ return _context.a(2);
1165
1174
  }
1166
1175
  }, _callee, this);
1167
1176
  }));
@@ -1173,29 +1182,28 @@ var OCAuthCore = /*#__PURE__*/function () {
1173
1182
  }, {
1174
1183
  key: "signInWithRedirect",
1175
1184
  value: function () {
1176
- var _signInWithRedirect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
1185
+ var _signInWithRedirect = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(params) {
1177
1186
  var paramsClone, signinParams, meta, requestUrl;
1178
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1179
- while (1) switch (_context2.prev = _context2.next) {
1187
+ return _regenerator().w(function (_context2) {
1188
+ while (1) switch (_context2.n) {
1180
1189
  case 0:
1181
1190
  // we use ONLY code flow with PKCE, so lacks a lot of options
1182
1191
  // available in other OAuth SDKs.
1183
1192
  paramsClone = Object.assign({}, params);
1184
1193
  paramsClone.redirectUri = this.redirectUri;
1185
1194
  paramsClone.clientId = this.clientId;
1186
- _context2.next = 5;
1187
- return Object(_utils__WEBPACK_IMPORTED_MODULE_4__["prepareTokenParams"])(paramsClone);
1188
- case 5:
1189
- signinParams = _context2.sent;
1190
- meta = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["createPkceMeta"])(signinParams);
1195
+ _context2.n = 1;
1196
+ return Object(_utils__WEBPACK_IMPORTED_MODULE_6__["prepareTokenParams"])(paramsClone);
1197
+ case 1:
1198
+ signinParams = _context2.v;
1199
+ meta = Object(_utils__WEBPACK_IMPORTED_MODULE_6__["createPkceMeta"])(signinParams);
1191
1200
  this.transactionManager.save(meta);
1192
1201
  signinParams.referralCode = this.referralCode;
1193
- signinParams.emailPlaceholder = this.emailPlaceholder;
1194
- requestUrl = Object(_endpoints__WEBPACK_IMPORTED_MODULE_5__["buildAuthEndpointUrl"])(signinParams, this.loginEndPoint);
1202
+ signinParams.emailPlaceholder = paramsClone.emailPlaceholder;
1203
+ requestUrl = Object(_endpoints__WEBPACK_IMPORTED_MODULE_7__["buildAuthEndpointUrl"])(signinParams, this.loginEndPoint);
1195
1204
  window.location.assign(requestUrl);
1196
- case 12:
1197
- case "end":
1198
- return _context2.stop();
1205
+ case 2:
1206
+ return _context2.a(2);
1199
1207
  }
1200
1208
  }, _callee2, this);
1201
1209
  }));
@@ -1207,36 +1215,35 @@ var OCAuthCore = /*#__PURE__*/function () {
1207
1215
  }, {
1208
1216
  key: "handleLoginRedirect",
1209
1217
  value: function () {
1210
- var _handleLoginRedirect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
1218
+ var _handleLoginRedirect = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
1211
1219
  var urlParams, meta, codeVerifier;
1212
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1213
- while (1) switch (_context3.prev = _context3.next) {
1220
+ return _regenerator().w(function (_context3) {
1221
+ while (1) switch (_context3.n) {
1214
1222
  case 0:
1215
- urlParams = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["parseUrl"])(); // Again we only handle PKCE code flow
1223
+ urlParams = Object(_utils__WEBPACK_IMPORTED_MODULE_6__["parseUrl"])(); // Again we only handle PKCE code flow
1216
1224
  if (!urlParams.code) {
1217
- _context3.next = 13;
1225
+ _context3.n = 4;
1218
1226
  break;
1219
1227
  }
1220
1228
  meta = this.transactionManager.getTransactionMeta();
1221
1229
  codeVerifier = meta.codeVerifier;
1222
1230
  if (!codeVerifier) {
1223
- _context3.next = 12;
1231
+ _context3.n = 3;
1224
1232
  break;
1225
1233
  }
1226
- _context3.next = 7;
1234
+ _context3.n = 1;
1227
1235
  return this.tokenManager.exchangeTokenFromCode(urlParams.code, codeVerifier, urlParams.state);
1228
- case 7:
1236
+ case 1:
1229
1237
  // clear transaction meta, coz it's completed
1230
1238
  this.transactionManager.clear();
1231
- this.syncAuthInfo();
1232
- return _context3.abrupt("return", this.getAuthState());
1233
- case 12:
1234
- throw new _utils_errors__WEBPACK_IMPORTED_MODULE_6__["AuthError"]('codeVerifier not found, cannot complete flow');
1235
- case 13:
1236
- return _context3.abrupt("return", {});
1237
- case 14:
1238
- case "end":
1239
- return _context3.stop();
1239
+ _context3.n = 2;
1240
+ return this.syncAuthInfo();
1241
+ case 2:
1242
+ return _context3.a(2, this.getAuthState());
1243
+ case 3:
1244
+ throw new _utils_errors__WEBPACK_IMPORTED_MODULE_8__["AuthError"]('codeVerifier not found, cannot complete flow');
1245
+ case 4:
1246
+ return _context3.a(2, {});
1240
1247
  }
1241
1248
  }, _callee3, this);
1242
1249
  }));
@@ -1253,16 +1260,34 @@ var OCAuthCore = /*#__PURE__*/function () {
1253
1260
  }
1254
1261
  }, {
1255
1262
  key: "syncAuthInfo",
1256
- value: function syncAuthInfo() {
1257
- if (this.tokenManager.hasExpired()) {
1258
- this.authInfoManager.clear();
1259
- } else {
1260
- var _this$getParsedIdToke = this.getParsedIdToken(),
1261
- edu_username = _this$getParsedIdToke.edu_username,
1262
- eth_address = _this$getParsedIdToke.eth_address;
1263
- this.authInfoManager.setAuthState(this.getAccessToken(), this.getIdToken(), edu_username, eth_address, true);
1263
+ value: function () {
1264
+ var _syncAuthInfo = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
1265
+ var _this$getParsedIdToke, edu_username, eth_address;
1266
+ return _regenerator().w(function (_context4) {
1267
+ while (1) switch (_context4.n) {
1268
+ case 0:
1269
+ if (!this.tokenManager.hasExpired()) {
1270
+ _context4.n = 1;
1271
+ break;
1272
+ }
1273
+ this.authInfoManager.clear();
1274
+ _context4.n = 2;
1275
+ break;
1276
+ case 1:
1277
+ _this$getParsedIdToke = this.getParsedIdToken(), edu_username = _this$getParsedIdToke.edu_username, eth_address = _this$getParsedIdToke.eth_address;
1278
+ this.authInfoManager.setAuthState(this.getAccessToken(), this.getIdToken(), edu_username, eth_address, true);
1279
+ _context4.n = 2;
1280
+ return this.walletServiceManager.login(this.getAccessToken());
1281
+ case 2:
1282
+ return _context4.a(2);
1283
+ }
1284
+ }, _callee4, this);
1285
+ }));
1286
+ function syncAuthInfo() {
1287
+ return _syncAuthInfo.apply(this, arguments);
1264
1288
  }
1265
- }
1289
+ return syncAuthInfo;
1290
+ }()
1266
1291
  }, {
1267
1292
  key: "getAuthState",
1268
1293
  value: function getAuthState() {
@@ -1289,7 +1314,7 @@ var OCAuthCore = /*#__PURE__*/function () {
1289
1314
  // return all info in id token
1290
1315
  var idToken = this.tokenManager.getIdToken();
1291
1316
  if (idToken) {
1292
- return Object(_utils__WEBPACK_IMPORTED_MODULE_4__["parseJwt"])(idToken);
1317
+ return Object(_utils__WEBPACK_IMPORTED_MODULE_6__["parseJwt"])(idToken);
1293
1318
  }
1294
1319
  return {};
1295
1320
  }
@@ -1299,7 +1324,7 @@ var OCAuthCore = /*#__PURE__*/function () {
1299
1324
  // return all info in access token
1300
1325
  var accessToken = this.tokenManager.getAccessToken();
1301
1326
  if (accessToken) {
1302
- return Object(_utils__WEBPACK_IMPORTED_MODULE_4__["parseJwt"])(accessToken);
1327
+ return Object(_utils__WEBPACK_IMPORTED_MODULE_6__["parseJwt"])(accessToken);
1303
1328
  }
1304
1329
  return {};
1305
1330
  }
@@ -1321,6 +1346,8 @@ var OCAuthCore = /*#__PURE__*/function () {
1321
1346
  }();
1322
1347
  var LIVE_PUBLIC_KEY = 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBIDHtLbgVM76SXZ4iuIjuO+ERQPnVpJzagOsZdYxFG3ZJmvfdpr/Z29SLUbdZWafrOlAVlKe1Ovf/tcH671tTw==';
1323
1348
  var SANDBOX_PUBLIC_KEY = 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/EymMLXd/MVYPK5r2xXQj91ZVvX3OQ+QagvR2N6lCvRVjnzmOtPRTf+u5g1RliWnmuxbV3gTm0/0VuV/40Salg==';
1349
+ var LIVE_PARTNER_ID = '2debfc3c-2205-4c67-b6f2-d015b286b318';
1350
+ var SANDBOX_PARTNER_ID = '3d54efbe-2666-45b7-bdf9-e843d69fd2f8';
1324
1351
  var OCAuthLive = /*#__PURE__*/function (_OCAuthCore2) {
1325
1352
  function OCAuthLive() {
1326
1353
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -1329,18 +1356,32 @@ var OCAuthLive = /*#__PURE__*/function (_OCAuthCore2) {
1329
1356
  overrideLoginEndpoint = opts.loginEndPoint,
1330
1357
  overrideLogoutEndpoint = opts.logoutEndPoint,
1331
1358
  overridePublicKey = opts.publicKey,
1359
+ overrideAirKitTokenEndpoint = opts.airKitTokenEndPoint,
1360
+ overrideAirKitPartnerId = opts.airKitPartnerId,
1361
+ overrideAirKitBuildEnv = opts.airKitBuildEnv,
1332
1362
  redirectUri = opts.redirectUri,
1333
1363
  referralCode = opts.referralCode,
1334
1364
  clientId = opts.clientId,
1335
- emailPlaceholder = opts.emailPlaceholder;
1365
+ useWalletService = opts.useWalletService;
1336
1366
  var tokenEndpoint = overrideTokenEndpoint || 'https://api.login.opencampus.xyz/auth/token';
1337
1367
  var loginEndpoint = overrideLoginEndpoint || 'https://api.login.opencampus.xyz/auth/login';
1338
1368
  var logoutEndpoint = overrideLogoutEndpoint || 'https://api.login.opencampus.xyz/auth/logout';
1369
+ var airKitTokenEndpoint = overrideAirKitTokenEndpoint || 'https://api.login.opencampus.xyz/auth/airkit/token';
1339
1370
  var publicKey = overridePublicKey || LIVE_PUBLIC_KEY;
1340
- var storageClass = Object(_lib_StorageManager__WEBPACK_IMPORTED_MODULE_3__["getStorageClass"])(opts);
1341
- var pkceTransactionManager = new _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_2__["default"](storageClass);
1342
- var tokenManager = new _lib_TokenManager__WEBPACK_IMPORTED_MODULE_1__["default"](storageClass, tokenEndpoint, publicKey);
1343
- return _callSuper(this, OCAuthLive, [clientId, loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint, emailPlaceholder]);
1371
+ var airKitPartnerId = overrideAirKitPartnerId || LIVE_PARTNER_ID;
1372
+ var airKitBuildEnv = overrideAirKitBuildEnv || _mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0__["BUILD_ENV"].PRODUCTION;
1373
+ var storageClass = Object(_lib_StorageManager__WEBPACK_IMPORTED_MODULE_5__["getStorageClass"])(opts);
1374
+ var authInfoManager = new _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_2__["default"]();
1375
+ var walletServiceManager = new _lib_WalletServiceManager__WEBPACK_IMPORTED_MODULE_1__["default"]({
1376
+ airKitPartnerId: airKitPartnerId,
1377
+ airKitEnv: airKitBuildEnv,
1378
+ airKitTokenEndpoint: airKitTokenEndpoint,
1379
+ authInfoManager: authInfoManager,
1380
+ useWalletService: useWalletService
1381
+ });
1382
+ var pkceTransactionManager = new _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_4__["default"](storageClass);
1383
+ var tokenManager = new _lib_TokenManager__WEBPACK_IMPORTED_MODULE_3__["default"](storageClass, tokenEndpoint, publicKey);
1384
+ return _callSuper(this, OCAuthLive, [clientId, loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint, walletServiceManager, authInfoManager]);
1344
1385
  }
1345
1386
  _inherits(OCAuthLive, _OCAuthCore2);
1346
1387
  return _createClass(OCAuthLive);
@@ -1353,18 +1394,32 @@ var OCAuthSandbox = /*#__PURE__*/function (_OCAuthCore3) {
1353
1394
  overrideLoginEndpoint = opts.loginEndPoint,
1354
1395
  overrideLogoutEndpoint = opts.logoutEndPoint,
1355
1396
  overridePublicKey = opts.publicKey,
1397
+ overrideAirKitTokenEndpoint = opts.airKitTokenEndPoint,
1398
+ overrideAirKitPartnerId = opts.airKitPartnerId,
1399
+ overrideAirKitBuildEnv = opts.airKitBuildEnv,
1356
1400
  redirectUri = opts.redirectUri,
1357
1401
  referralCode = opts.referralCode,
1358
- emailPlaceholder = opts.emailPlaceholder;
1402
+ useWalletService = opts.useWalletService;
1359
1403
  var clientId = opts.clientId || 'sandbox';
1360
1404
  var tokenEndpoint = overrideTokenEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/token';
1361
1405
  var loginEndpoint = overrideLoginEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/login';
1362
1406
  var logoutEndpoint = overrideLogoutEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/logout';
1407
+ var airKitTokenEndpoint = overrideAirKitTokenEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/airkit/token';
1363
1408
  var publicKey = overridePublicKey || SANDBOX_PUBLIC_KEY;
1364
- var storageClass = Object(_lib_StorageManager__WEBPACK_IMPORTED_MODULE_3__["getStorageClass"])(opts);
1365
- var pkceTransactionManager = new _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_2__["default"](storageClass);
1366
- var tokenManager = new _lib_TokenManager__WEBPACK_IMPORTED_MODULE_1__["default"](storageClass, tokenEndpoint, publicKey);
1367
- return _callSuper(this, OCAuthSandbox, [clientId, loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint, emailPlaceholder]);
1409
+ var airKitPartnerId = overrideAirKitPartnerId || SANDBOX_PARTNER_ID;
1410
+ var airKitBuildEnv = overrideAirKitBuildEnv || _mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0__["BUILD_ENV"].SANDBOX;
1411
+ var authInfoManager = new _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_2__["default"]();
1412
+ var storageClass = Object(_lib_StorageManager__WEBPACK_IMPORTED_MODULE_5__["getStorageClass"])(opts);
1413
+ var walletServiceManager = new _lib_WalletServiceManager__WEBPACK_IMPORTED_MODULE_1__["default"]({
1414
+ airKitPartnerId: airKitPartnerId,
1415
+ airKitEnv: airKitBuildEnv,
1416
+ airKitTokenEndpoint: airKitTokenEndpoint,
1417
+ authInfoManager: authInfoManager,
1418
+ useWalletService: useWalletService
1419
+ });
1420
+ var pkceTransactionManager = new _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_4__["default"](storageClass);
1421
+ var tokenManager = new _lib_TokenManager__WEBPACK_IMPORTED_MODULE_3__["default"](storageClass, tokenEndpoint, publicKey);
1422
+ return _callSuper(this, OCAuthSandbox, [clientId, loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint, walletServiceManager, authInfoManager]);
1368
1423
  }
1369
1424
  _inherits(OCAuthSandbox, _OCAuthCore3);
1370
1425
  return _createClass(OCAuthSandbox);
@@ -1372,11 +1427,166 @@ var OCAuthSandbox = /*#__PURE__*/function (_OCAuthCore3) {
1372
1427
 
1373
1428
  /***/ }),
1374
1429
  /* 14 */
1430
+ /***/ (function(module, exports) {
1431
+
1432
+ throw new Error("Module parse failed: Unexpected token (545:23)\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\n| super(message || name);\n| this.name = name;\n> this.stack = cause?.stack;\n| this.cause = cause;\n| this.context = context;");
1433
+
1434
+ /***/ }),
1435
+ /* 15 */
1375
1436
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1376
1437
 
1377
1438
  "use strict";
1378
1439
  __webpack_require__.r(__webpack_exports__);
1379
- /* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
1440
+ /* harmony import */ var _mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
1441
+ /* harmony import */ var _mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0__);
1442
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1443
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
1444
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
1445
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
1446
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
1447
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
1448
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
1449
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
1450
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1451
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1452
+
1453
+ var _airService = null;
1454
+ var _airServiceInitialized = false;
1455
+ var WalletServiceManager = /*#__PURE__*/function () {
1456
+ function WalletServiceManager(_ref) {
1457
+ var airKitPartnerId = _ref.airKitPartnerId,
1458
+ airKitEnv = _ref.airKitEnv,
1459
+ airKitTokenEndpoint = _ref.airKitTokenEndpoint,
1460
+ authInfoManager = _ref.authInfoManager,
1461
+ useWalletService = _ref.useWalletService;
1462
+ _classCallCheck(this, WalletServiceManager);
1463
+ this.airKitTokenEndpoint = airKitTokenEndpoint;
1464
+ this.airKitEnv = airKitEnv;
1465
+ this.authInfoManager = authInfoManager;
1466
+ if (useWalletService && !_airService) {
1467
+ _airService = new _mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0__["AirService"]({
1468
+ partnerId: airKitPartnerId,
1469
+ environment: airKitEnv
1470
+ });
1471
+ }
1472
+ }
1473
+ return _createClass(WalletServiceManager, [{
1474
+ key: "init",
1475
+ value: function () {
1476
+ var _init = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
1477
+ return _regenerator().w(function (_context) {
1478
+ while (1) switch (_context.n) {
1479
+ case 0:
1480
+ if (!(_airService && !_airServiceInitialized)) {
1481
+ _context.n = 2;
1482
+ break;
1483
+ }
1484
+ _context.n = 1;
1485
+ return _airService.init({
1486
+ buildEnv: this.airKitEnv
1487
+ });
1488
+ case 1:
1489
+ _airServiceInitialized = true;
1490
+ case 2:
1491
+ return _context.a(2);
1492
+ }
1493
+ }, _callee, this);
1494
+ }));
1495
+ function init() {
1496
+ return _init.apply(this, arguments);
1497
+ }
1498
+ return init;
1499
+ }()
1500
+ }, {
1501
+ key: "login",
1502
+ value: function () {
1503
+ var _login = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(accessToken) {
1504
+ var response, tokenResponse, airKitToken;
1505
+ return _regenerator().w(function (_context2) {
1506
+ while (1) switch (_context2.n) {
1507
+ case 0:
1508
+ if (!_airService) {
1509
+ _context2.n = 5;
1510
+ break;
1511
+ }
1512
+ _context2.n = 1;
1513
+ return this.init();
1514
+ case 1:
1515
+ _context2.n = 2;
1516
+ return fetch(this.airKitTokenEndpoint, {
1517
+ method: "GET",
1518
+ headers: {
1519
+ "Content-Type": "application/json",
1520
+ Authorization: "Bearer ".concat(accessToken)
1521
+ }
1522
+ });
1523
+ case 2:
1524
+ response = _context2.v;
1525
+ _context2.n = 3;
1526
+ return response.json();
1527
+ case 3:
1528
+ tokenResponse = _context2.v;
1529
+ airKitToken = tokenResponse.airKitToken;
1530
+ if (!airKitToken) {
1531
+ _context2.n = 5;
1532
+ break;
1533
+ }
1534
+ _context2.n = 4;
1535
+ return _airService.login({
1536
+ authToken: airKitToken
1537
+ });
1538
+ case 4:
1539
+ this.authInfoManager.updateAuthState({
1540
+ walletService: _airService
1541
+ });
1542
+ case 5:
1543
+ return _context2.a(2);
1544
+ }
1545
+ }, _callee2, this);
1546
+ }));
1547
+ function login(_x) {
1548
+ return _login.apply(this, arguments);
1549
+ }
1550
+ return login;
1551
+ }()
1552
+ }, {
1553
+ key: "logout",
1554
+ value: function () {
1555
+ var _logout = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
1556
+ return _regenerator().w(function (_context3) {
1557
+ while (1) switch (_context3.n) {
1558
+ case 0:
1559
+ if (!(_airService && _airService.isLoggedIn)) {
1560
+ _context3.n = 2;
1561
+ break;
1562
+ }
1563
+ _context3.n = 1;
1564
+ return _airService.logout();
1565
+ case 1:
1566
+ this.authInfoManager.updateAuthState({
1567
+ walletService: undefined
1568
+ });
1569
+ case 2:
1570
+ return _context3.a(2);
1571
+ }
1572
+ }, _callee3, this);
1573
+ }));
1574
+ function logout() {
1575
+ return _logout.apply(this, arguments);
1576
+ }
1577
+ return logout;
1578
+ }()
1579
+ }]);
1580
+ }();
1581
+ /* harmony default export */ __webpack_exports__["default"] = (WalletServiceManager);
1582
+
1583
+ /***/ }),
1584
+ /* 16 */
1585
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1586
+
1587
+ "use strict";
1588
+ __webpack_require__.r(__webpack_exports__);
1589
+ /* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
1380
1590
  /* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tiny_emitter__WEBPACK_IMPORTED_MODULE_0__);
1381
1591
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1382
1592
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -1422,6 +1632,12 @@ var AuthInfoManager = /*#__PURE__*/function () {
1422
1632
  value: function getAuthState() {
1423
1633
  return Object.assign({}, this._authState);
1424
1634
  }
1635
+ }, {
1636
+ key: "updateAuthState",
1637
+ value: function updateAuthState(partialAuthState) {
1638
+ this._authState = Object.assign({}, this._authState, partialAuthState);
1639
+ this._emitter.emit(EVENT_AUTH_STATE_CHANGE, this._authState);
1640
+ }
1425
1641
  }, {
1426
1642
  key: "clear",
1427
1643
  value: function clear() {
@@ -1445,7 +1661,7 @@ var AuthInfoManager = /*#__PURE__*/function () {
1445
1661
  /* harmony default export */ __webpack_exports__["default"] = (AuthInfoManager);
1446
1662
 
1447
1663
  /***/ }),
1448
- /* 15 */
1664
+ /* 17 */
1449
1665
  /***/ (function(module, exports) {
1450
1666
 
1451
1667
  function E () {
@@ -1518,16 +1734,17 @@ module.exports.TinyEmitter = E;
1518
1734
 
1519
1735
 
1520
1736
  /***/ }),
1521
- /* 16 */
1737
+ /* 18 */
1522
1738
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1523
1739
 
1524
1740
  "use strict";
1525
1741
  __webpack_require__.r(__webpack_exports__);
1526
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
1527
- /* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21);
1528
- /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
1742
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19);
1743
+ /* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
1744
+ /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27);
1529
1745
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1530
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
1746
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
1747
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
1531
1748
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
1532
1749
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
1533
1750
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -1569,7 +1786,7 @@ var TokenManager = /*#__PURE__*/function () {
1569
1786
  }, {
1570
1787
  key: "exchangeTokenFromCode",
1571
1788
  value: function () {
1572
- var _exchangeTokenFromCode = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessCode, codeVerifier) {
1789
+ var _exchangeTokenFromCode = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(accessCode, codeVerifier) {
1573
1790
  var state,
1574
1791
  body,
1575
1792
  response,
@@ -1580,17 +1797,18 @@ var TokenManager = /*#__PURE__*/function () {
1580
1797
  tokenVerified,
1581
1798
  parsedAccessToken,
1582
1799
  storageData,
1583
- _args = arguments;
1584
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1585
- while (1) switch (_context.prev = _context.next) {
1800
+ _args = arguments,
1801
+ _t;
1802
+ return _regenerator().w(function (_context) {
1803
+ while (1) switch (_context.p = _context.n) {
1586
1804
  case 0:
1587
1805
  state = _args.length > 2 && _args[2] !== undefined ? _args[2] : null;
1588
1806
  body = {
1589
1807
  accessCode: accessCode,
1590
1808
  codeVerifier: codeVerifier
1591
1809
  };
1592
- _context.prev = 2;
1593
- _context.next = 5;
1810
+ _context.p = 1;
1811
+ _context.n = 2;
1594
1812
  return fetch(this.tokenEndPoint, {
1595
1813
  method: 'POST',
1596
1814
  headers: {
@@ -1598,34 +1816,34 @@ var TokenManager = /*#__PURE__*/function () {
1598
1816
  },
1599
1817
  body: JSON.stringify(body)
1600
1818
  });
1601
- case 5:
1602
- response = _context.sent;
1603
- _context.next = 8;
1819
+ case 2:
1820
+ response = _context.v;
1821
+ _context.n = 3;
1604
1822
  return response.json();
1605
- case 8:
1606
- _yield$response$json = _context.sent;
1823
+ case 3:
1824
+ _yield$response$json = _context.v;
1607
1825
  access_token = _yield$response$json.access_token;
1608
1826
  id_token = _yield$response$json.id_token;
1609
1827
  if (!(!access_token || !id_token)) {
1610
- _context.next = 13;
1828
+ _context.n = 4;
1611
1829
  break;
1612
1830
  }
1613
1831
  throw new _utils_errors__WEBPACK_IMPORTED_MODULE_2__["AuthError"]('Fail to exchange token');
1614
- case 13:
1615
- _context.next = 15;
1832
+ case 4:
1833
+ _context.n = 5;
1616
1834
  return this.getPublicKey();
1617
- case 15:
1618
- pubKey = _context.sent;
1619
- _context.next = 18;
1835
+ case 5:
1836
+ pubKey = _context.v;
1837
+ _context.n = 6;
1620
1838
  return Object(_crypto__WEBPACK_IMPORTED_MODULE_1__["verifyToken"])(id_token, pubKey);
1621
- case 18:
1622
- tokenVerified = _context.sent;
1839
+ case 6:
1840
+ tokenVerified = _context.v;
1623
1841
  if (tokenVerified) {
1624
- _context.next = 21;
1842
+ _context.n = 7;
1625
1843
  break;
1626
1844
  }
1627
1845
  throw new _utils_errors__WEBPACK_IMPORTED_MODULE_2__["AuthError"]('Unable to verify token');
1628
- case 21:
1846
+ case 7:
1629
1847
  parsedAccessToken = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["parseJwt"])(access_token);
1630
1848
  storageData = Object.assign({
1631
1849
  access_token: access_token,
@@ -1635,18 +1853,17 @@ var TokenManager = /*#__PURE__*/function () {
1635
1853
  state: state
1636
1854
  });
1637
1855
  this.storageManager.getStorageObject().setStorage(storageData);
1638
- _context.next = 30;
1856
+ _context.n = 9;
1639
1857
  break;
1640
- case 26:
1641
- _context.prev = 26;
1642
- _context.t0 = _context["catch"](2);
1643
- console.log(_context.t0);
1858
+ case 8:
1859
+ _context.p = 8;
1860
+ _t = _context.v;
1861
+ console.log(_t);
1644
1862
  throw new _utils_errors__WEBPACK_IMPORTED_MODULE_2__["AuthError"]('Token acquisition failed');
1645
- case 30:
1646
- case "end":
1647
- return _context.stop();
1863
+ case 9:
1864
+ return _context.a(2);
1648
1865
  }
1649
- }, _callee, this, [[2, 26]]);
1866
+ }, _callee, this, [[1, 8]]);
1650
1867
  }));
1651
1868
  function exchangeTokenFromCode(_x, _x2) {
1652
1869
  return _exchangeTokenFromCode.apply(this, arguments);
@@ -1676,14 +1893,11 @@ var TokenManager = /*#__PURE__*/function () {
1676
1893
  }, {
1677
1894
  key: "getPublicKey",
1678
1895
  value: function () {
1679
- var _getPublicKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1680
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1681
- while (1) switch (_context2.prev = _context2.next) {
1896
+ var _getPublicKey = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
1897
+ return _regenerator().w(function (_context2) {
1898
+ while (1) switch (_context2.n) {
1682
1899
  case 0:
1683
- return _context2.abrupt("return", this.publicKey);
1684
- case 1:
1685
- case "end":
1686
- return _context2.stop();
1900
+ return _context2.a(2, this.publicKey);
1687
1901
  }
1688
1902
  }, _callee2, this);
1689
1903
  }));
@@ -1707,21 +1921,21 @@ var TokenManager = /*#__PURE__*/function () {
1707
1921
  /* harmony default export */ __webpack_exports__["default"] = (TokenManager);
1708
1922
 
1709
1923
  /***/ }),
1710
- /* 17 */
1924
+ /* 19 */
1711
1925
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1712
1926
 
1713
1927
  "use strict";
1714
1928
  __webpack_require__.r(__webpack_exports__);
1715
- /* harmony import */ var _urlParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);
1929
+ /* harmony import */ var _urlParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
1716
1930
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseUrl", function() { return _urlParser__WEBPACK_IMPORTED_MODULE_0__["parseUrl"]; });
1717
1931
 
1718
- /* harmony import */ var _prepareTokenParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19);
1932
+ /* harmony import */ var _prepareTokenParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21);
1719
1933
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareTokenParams", function() { return _prepareTokenParams__WEBPACK_IMPORTED_MODULE_1__["prepareTokenParams"]; });
1720
1934
 
1721
- /* harmony import */ var _createPkceMeta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26);
1935
+ /* harmony import */ var _createPkceMeta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28);
1722
1936
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createPkceMeta", function() { return _createPkceMeta__WEBPACK_IMPORTED_MODULE_2__["createPkceMeta"]; });
1723
1937
 
1724
- /* harmony import */ var _jwtParser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27);
1938
+ /* harmony import */ var _jwtParser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29);
1725
1939
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseJwt", function() { return _jwtParser__WEBPACK_IMPORTED_MODULE_3__["parseJwt"]; });
1726
1940
 
1727
1941
  /*!
@@ -1739,7 +1953,7 @@ __webpack_require__.r(__webpack_exports__);
1739
1953
 
1740
1954
 
1741
1955
  /***/ }),
1742
- /* 18 */
1956
+ /* 20 */
1743
1957
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1744
1958
 
1745
1959
  "use strict";
@@ -1765,16 +1979,16 @@ var parseUrl = function parseUrl() {
1765
1979
  };
1766
1980
 
1767
1981
  /***/ }),
1768
- /* 19 */
1982
+ /* 21 */
1769
1983
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1770
1984
 
1771
1985
  "use strict";
1772
1986
  __webpack_require__.r(__webpack_exports__);
1773
1987
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareTokenParams", function() { return prepareTokenParams; });
1774
- /* harmony import */ var _lib_pkce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
1775
- /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
1776
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1777
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
1988
+ /* harmony import */ var _lib_pkce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
1989
+ /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27);
1990
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
1991
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
1778
1992
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
1779
1993
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
1780
1994
  /*!
@@ -1789,10 +2003,10 @@ function _asyncToGenerator(n) { return function () { var t = this, e = arguments
1789
2003
 
1790
2004
 
1791
2005
  var prepareTokenParams = /*#__PURE__*/function () {
1792
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
2006
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(params) {
1793
2007
  var clientId, redirectUri, state, codeVerifier, codeChallenge, tokenParams;
1794
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1795
- while (1) switch (_context.prev = _context.next) {
2008
+ return _regenerator().w(function (_context) {
2009
+ while (1) switch (_context.n) {
1796
2010
  case 0:
1797
2011
  // prepare all the params needed for building the signin flow
1798
2012
  // mandatory redirect_uri, for now, we only allow user to set redirect_uri and state
@@ -1800,17 +2014,17 @@ var prepareTokenParams = /*#__PURE__*/function () {
1800
2014
  // we prepare all the rest
1801
2015
  clientId = params.clientId, redirectUri = params.redirectUri, state = params.state;
1802
2016
  if (redirectUri) {
1803
- _context.next = 3;
2017
+ _context.n = 1;
1804
2018
  break;
1805
2019
  }
1806
2020
  throw new _errors__WEBPACK_IMPORTED_MODULE_1__["InvalidParamsError"](' No redirect uri params!');
1807
- case 3:
2021
+ case 1:
1808
2022
  // must be pkce
1809
2023
  codeVerifier = _lib_pkce__WEBPACK_IMPORTED_MODULE_0__["default"].generateVerifier();
1810
- _context.next = 6;
2024
+ _context.n = 2;
1811
2025
  return _lib_pkce__WEBPACK_IMPORTED_MODULE_0__["default"].computeChallenge(codeVerifier);
1812
- case 6:
1813
- codeChallenge = _context.sent;
2026
+ case 2:
2027
+ codeChallenge = _context.v;
1814
2028
  // pack up the full set of token params needed
1815
2029
  tokenParams = {
1816
2030
  clientId: clientId,
@@ -1824,10 +2038,7 @@ var prepareTokenParams = /*#__PURE__*/function () {
1824
2038
  if (state !== undefined && state !== null) {
1825
2039
  tokenParams.state = state;
1826
2040
  }
1827
- return _context.abrupt("return", tokenParams);
1828
- case 10:
1829
- case "end":
1830
- return _context.stop();
2041
+ return _context.a(2, tokenParams);
1831
2042
  }
1832
2043
  }, _callee);
1833
2044
  }));
@@ -1837,7 +2048,7 @@ var prepareTokenParams = /*#__PURE__*/function () {
1837
2048
  }();
1838
2049
 
1839
2050
  /***/ }),
1840
- /* 20 */
2051
+ /* 22 */
1841
2052
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1842
2053
 
1843
2054
  "use strict";
@@ -1845,7 +2056,7 @@ __webpack_require__.r(__webpack_exports__);
1845
2056
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MIN_VERIFIER_LENGTH", function() { return MIN_VERIFIER_LENGTH; });
1846
2057
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAX_VERIFIER_LENGTH", function() { return MAX_VERIFIER_LENGTH; });
1847
2058
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_CODE_CHALLENGE_METHOD", function() { return DEFAULT_CODE_CHALLENGE_METHOD; });
1848
- /* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21);
2059
+ /* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23);
1849
2060
  /*!
1850
2061
  * Copyright 2024-Present Animoca Brands Corporation Ltd.
1851
2062
  *
@@ -1893,19 +2104,19 @@ function computeChallenge(str) {
1893
2104
  });
1894
2105
 
1895
2106
  /***/ }),
1896
- /* 21 */
2107
+ /* 23 */
1897
2108
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1898
2109
 
1899
2110
  "use strict";
1900
2111
  __webpack_require__.r(__webpack_exports__);
1901
- /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
2112
+ /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
1902
2113
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "atob", function() { return _webcrypto__WEBPACK_IMPORTED_MODULE_0__["atob"]; });
1903
2114
 
1904
2115
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "btoa", function() { return _webcrypto__WEBPACK_IMPORTED_MODULE_0__["btoa"]; });
1905
2116
 
1906
2117
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "webcrypto", function() { return _webcrypto__WEBPACK_IMPORTED_MODULE_0__["webcrypto"]; });
1907
2118
 
1908
- /* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
2119
+ /* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
1909
2120
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "base64ToBase64Url", function() { return _base64__WEBPACK_IMPORTED_MODULE_1__["base64ToBase64Url"]; });
1910
2121
 
1911
2122
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "base64UrlToBase64", function() { return _base64__WEBPACK_IMPORTED_MODULE_1__["base64UrlToBase64"]; });
@@ -1916,7 +2127,7 @@ __webpack_require__.r(__webpack_exports__);
1916
2127
 
1917
2128
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "base64UrlDecode", function() { return _base64__WEBPACK_IMPORTED_MODULE_1__["base64UrlDecode"]; });
1918
2129
 
1919
- /* harmony import */ var _verifyToken__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(24);
2130
+ /* harmony import */ var _verifyToken__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26);
1920
2131
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "verifyToken", function() { return _verifyToken__WEBPACK_IMPORTED_MODULE_2__["verifyToken"]; });
1921
2132
 
1922
2133
  /*!
@@ -1933,7 +2144,7 @@ __webpack_require__.r(__webpack_exports__);
1933
2144
 
1934
2145
 
1935
2146
  /***/ }),
1936
- /* 22 */
2147
+ /* 24 */
1937
2148
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1938
2149
 
1939
2150
  "use strict";
@@ -1963,7 +2174,7 @@ var c = typeof crypto === 'undefined' ? null : crypto;
1963
2174
 
1964
2175
 
1965
2176
  /***/ }),
1966
- /* 23 */
2177
+ /* 25 */
1967
2178
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1968
2179
 
1969
2180
  "use strict";
@@ -1973,7 +2184,7 @@ __webpack_require__.r(__webpack_exports__);
1973
2184
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringToBase64Url", function() { return stringToBase64Url; });
1974
2185
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringToBuffer", function() { return stringToBuffer; });
1975
2186
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "base64UrlDecode", function() { return base64UrlDecode; });
1976
- /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
2187
+ /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
1977
2188
  /*!
1978
2189
  * Copyright 2024-Present Animoca Brands Corporation Ltd.
1979
2190
  *
@@ -2012,16 +2223,16 @@ function base64UrlDecode(str) {
2012
2223
  }
2013
2224
 
2014
2225
  /***/ }),
2015
- /* 24 */
2226
+ /* 26 */
2016
2227
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2017
2228
 
2018
2229
  "use strict";
2019
2230
  __webpack_require__.r(__webpack_exports__);
2020
2231
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "verifyToken", function() { return verifyToken; });
2021
- /* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23);
2022
- /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22);
2023
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2024
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
2232
+ /* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
2233
+ /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24);
2234
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
2235
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
2025
2236
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
2026
2237
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
2027
2238
  /*!
@@ -2041,10 +2252,10 @@ var prepareKey = function prepareKey(key) {
2041
2252
  return Object(_base64__WEBPACK_IMPORTED_MODULE_0__["stringToBuffer"])(binaryDerString);
2042
2253
  };
2043
2254
  var verifyToken = /*#__PURE__*/function () {
2044
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(idToken, key) {
2255
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(idToken, key) {
2045
2256
  var format, algo, extractable, usages, preparedKey, cryptoKey, jwt, payload, b64Signature, signature;
2046
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2047
- while (1) switch (_context.prev = _context.next) {
2257
+ return _regenerator().w(function (_context) {
2258
+ while (1) switch (_context.n) {
2048
2259
  case 0:
2049
2260
  format = 'spki';
2050
2261
  algo = {
@@ -2057,21 +2268,18 @@ var verifyToken = /*#__PURE__*/function () {
2057
2268
  extractable = true;
2058
2269
  usages = ['verify'];
2059
2270
  preparedKey = prepareKey(key);
2060
- _context.next = 7;
2271
+ _context.n = 1;
2061
2272
  return _webcrypto__WEBPACK_IMPORTED_MODULE_1__["webcrypto"].subtle.importKey(format, preparedKey, algo, extractable, usages);
2062
- case 7:
2063
- cryptoKey = _context.sent;
2273
+ case 1:
2274
+ cryptoKey = _context.v;
2064
2275
  jwt = idToken.split('.');
2065
2276
  payload = Object(_base64__WEBPACK_IMPORTED_MODULE_0__["stringToBuffer"])(jwt[0] + '.' + jwt[1]);
2066
2277
  b64Signature = Object(_base64__WEBPACK_IMPORTED_MODULE_0__["base64UrlDecode"])(jwt[2]);
2067
2278
  signature = Object(_base64__WEBPACK_IMPORTED_MODULE_0__["stringToBuffer"])(b64Signature);
2068
- _context.next = 14;
2279
+ _context.n = 2;
2069
2280
  return _webcrypto__WEBPACK_IMPORTED_MODULE_1__["webcrypto"].subtle.verify(algo, cryptoKey, signature, payload);
2070
- case 14:
2071
- return _context.abrupt("return", _context.sent);
2072
- case 15:
2073
- case "end":
2074
- return _context.stop();
2281
+ case 2:
2282
+ return _context.a(2, _context.v);
2075
2283
  }
2076
2284
  }, _callee);
2077
2285
  }));
@@ -2081,7 +2289,7 @@ var verifyToken = /*#__PURE__*/function () {
2081
2289
  }();
2082
2290
 
2083
2291
  /***/ }),
2084
- /* 25 */
2292
+ /* 27 */
2085
2293
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2086
2294
 
2087
2295
  "use strict";
@@ -2140,13 +2348,13 @@ var AuthError = /*#__PURE__*/function (_Error2) {
2140
2348
  }(/*#__PURE__*/_wrapNativeSuper(Error));
2141
2349
 
2142
2350
  /***/ }),
2143
- /* 26 */
2351
+ /* 28 */
2144
2352
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2145
2353
 
2146
2354
  "use strict";
2147
2355
  __webpack_require__.r(__webpack_exports__);
2148
2356
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPkceMeta", function() { return createPkceMeta; });
2149
- /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
2357
+ /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27);
2150
2358
  /*!
2151
2359
  * Copyright 2024-Present Animoca Brands Corporation Ltd.
2152
2360
  *
@@ -2174,7 +2382,7 @@ var createPkceMeta = function createPkceMeta(signinParams) {
2174
2382
  };
2175
2383
 
2176
2384
  /***/ }),
2177
- /* 27 */
2385
+ /* 29 */
2178
2386
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2179
2387
 
2180
2388
  "use strict";
@@ -2200,7 +2408,7 @@ var parseJwt = function parseJwt(token) {
2200
2408
  };
2201
2409
 
2202
2410
  /***/ }),
2203
- /* 28 */
2411
+ /* 30 */
2204
2412
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2205
2413
 
2206
2414
  "use strict";
@@ -2264,7 +2472,7 @@ var TransactionManager = /*#__PURE__*/function () {
2264
2472
  /* harmony default export */ __webpack_exports__["default"] = (TransactionManager);
2265
2473
 
2266
2474
  /***/ }),
2267
- /* 29 */
2475
+ /* 31 */
2268
2476
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2269
2477
 
2270
2478
  "use strict";
@@ -2272,8 +2480,8 @@ __webpack_require__.r(__webpack_exports__);
2272
2480
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseStorageManager", function() { return BaseStorageManager; });
2273
2481
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalStorageManager", function() { return LocalStorageManager; });
2274
2482
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStorageClass", function() { return getStorageClass; });
2275
- /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
2276
- /* harmony import */ var _CookieStorageProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30);
2483
+ /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27);
2484
+ /* harmony import */ var _CookieStorageProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32);
2277
2485
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2278
2486
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
2279
2487
  function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
@@ -2405,13 +2613,13 @@ var getStorageClass = function getStorageClass(opts) {
2405
2613
  };
2406
2614
 
2407
2615
  /***/ }),
2408
- /* 30 */
2616
+ /* 32 */
2409
2617
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2410
2618
 
2411
2619
  "use strict";
2412
2620
  __webpack_require__.r(__webpack_exports__);
2413
2621
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CookieStorageProvider", function() { return CookieStorageProvider; });
2414
- /* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
2622
+ /* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33);
2415
2623
  /* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(js_cookie__WEBPACK_IMPORTED_MODULE_0__);
2416
2624
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2417
2625
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -2481,7 +2689,7 @@ var CookieStorageProvider = /*#__PURE__*/function () {
2481
2689
  }();
2482
2690
 
2483
2691
  /***/ }),
2484
- /* 31 */
2692
+ /* 33 */
2485
2693
  /***/ (function(module, exports, __webpack_require__) {
2486
2694
 
2487
2695
  /*! js-cookie v3.0.5 | MIT */
@@ -2629,12 +2837,12 @@ var CookieStorageProvider = /*#__PURE__*/function () {
2629
2837
 
2630
2838
 
2631
2839
  /***/ }),
2632
- /* 32 */
2840
+ /* 34 */
2633
2841
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2634
2842
 
2635
2843
  "use strict";
2636
2844
  __webpack_require__.r(__webpack_exports__);
2637
- /* harmony import */ var _buildAuthEndpointUrl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33);
2845
+ /* harmony import */ var _buildAuthEndpointUrl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
2638
2846
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildAuthEndpointUrl", function() { return _buildAuthEndpointUrl__WEBPACK_IMPORTED_MODULE_0__["buildAuthEndpointUrl"]; });
2639
2847
 
2640
2848
  /*!
@@ -2649,7 +2857,7 @@ __webpack_require__.r(__webpack_exports__);
2649
2857
 
2650
2858
 
2651
2859
  /***/ }),
2652
- /* 33 */
2860
+ /* 35 */
2653
2861
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2654
2862
 
2655
2863
  "use strict";
@@ -2698,12 +2906,12 @@ var buildAuthEndpointUrl = function buildAuthEndpointUrl(signInParams, loginEndP
2698
2906
  };
2699
2907
 
2700
2908
  /***/ }),
2701
- /* 34 */
2909
+ /* 36 */
2702
2910
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2703
2911
 
2704
2912
  "use strict";
2705
2913
  __webpack_require__.r(__webpack_exports__);
2706
- /* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
2914
+ /* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
2707
2915
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TokenManager", function() { return _lib__WEBPACK_IMPORTED_MODULE_0__["TokenManager"]; });
2708
2916
 
2709
2917
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TransactionManager", function() { return _lib__WEBPACK_IMPORTED_MODULE_0__["TransactionManager"]; });
@@ -2725,18 +2933,18 @@ __webpack_require__.r(__webpack_exports__);
2725
2933
 
2726
2934
 
2727
2935
  /***/ }),
2728
- /* 35 */
2936
+ /* 37 */
2729
2937
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2730
2938
 
2731
2939
  "use strict";
2732
2940
  __webpack_require__.r(__webpack_exports__);
2733
- /* harmony import */ var _TokenManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16);
2941
+ /* harmony import */ var _TokenManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);
2734
2942
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TokenManager", function() { return _TokenManager__WEBPACK_IMPORTED_MODULE_0__["default"]; });
2735
2943
 
2736
- /* harmony import */ var _TransactionManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28);
2944
+ /* harmony import */ var _TransactionManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30);
2737
2945
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TransactionManager", function() { return _TransactionManager__WEBPACK_IMPORTED_MODULE_1__["default"]; });
2738
2946
 
2739
- /* harmony import */ var _StorageManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29);
2947
+ /* harmony import */ var _StorageManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31);
2740
2948
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseStorageManager", function() { return _StorageManager__WEBPACK_IMPORTED_MODULE_2__["BaseStorageManager"]; });
2741
2949
 
2742
2950
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LocalStorageManager", function() { return _StorageManager__WEBPACK_IMPORTED_MODULE_2__["LocalStorageManager"]; });