@stytch/vanilla-js 4.4.2 → 4.4.4

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.
@@ -15,16 +15,16 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
15
15
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
16
16
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
17
17
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
18
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
19
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
19
+ 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); }
20
20
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
22
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
21
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
23
22
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
24
23
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
24
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
25
25
  function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
26
- function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
27
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
26
+ function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }
27
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
28
28
  function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
29
29
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
30
30
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
@@ -36,31 +36,45 @@ function e(t) {
36
36
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
37
37
  }, e(t);
38
38
  }
39
- function t(t, r) {
40
- for (var n = 0; n < r.length; n++) {
41
- var i = r[n];
42
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, (o = i.key, s = void 0, s = function (t, r) {
43
- if ("object" !== e(t) || null === t) return t;
44
- var n = t[Symbol.toPrimitive];
45
- if (void 0 !== n) {
46
- var i = n.call(t, r || "default");
47
- if ("object" !== e(i)) return i;
48
- throw new TypeError("@@toPrimitive must return a primitive value.");
49
- }
50
- return ("string" === r ? String : Number)(t);
51
- }(o, "string"), "symbol" === e(s) ? s : String(s)), i);
39
+ function t(e, t) {
40
+ for (var r = 0; r < t.length; r++) {
41
+ var i = t[r];
42
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, n(i.key), i);
52
43
  }
53
- var o, s;
54
44
  }
55
45
  function r(e, r, n) {
56
46
  return r && t(e.prototype, r), n && t(e, n), Object.defineProperty(e, "prototype", {
57
47
  writable: !1
58
48
  }), e;
59
49
  }
60
- function n(e, t) {
61
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
50
+ function n(t) {
51
+ var r = function (t, r) {
52
+ if ("object" != e(t) || !t) return t;
53
+ var n = t[Symbol.toPrimitive];
54
+ if (void 0 !== n) {
55
+ var i = n.call(t, r || "default");
56
+ if ("object" != e(i)) return i;
57
+ throw new TypeError("@@toPrimitive must return a primitive value.");
58
+ }
59
+ return ("string" === r ? String : Number)(t);
60
+ }(t, "string");
61
+ return "symbol" == e(r) ? r : String(r);
62
62
  }
63
63
  function i(e, t) {
64
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
65
+ }
66
+ function o(t, r, n) {
67
+ return r = d(r), function (t, r) {
68
+ if (r && ("object" === e(r) || "function" == typeof r)) return r;
69
+ if (void 0 !== r) throw new TypeError("Derived constructors may only return object or undefined");
70
+ return s(t);
71
+ }(t, u() ? Reflect.construct(r, n || [], d(t).constructor) : r.apply(t, n));
72
+ }
73
+ function s(e) {
74
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
75
+ return e;
76
+ }
77
+ function a(e, t) {
64
78
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
65
79
  e.prototype = Object.create(t && t.prototype, {
66
80
  constructor: {
@@ -72,29 +86,9 @@ function i(e, t) {
72
86
  writable: !1
73
87
  }), t && l(e, t);
74
88
  }
75
- function o(t) {
76
- var r = u();
77
- return function () {
78
- var n,
79
- i = d(t);
80
- if (r) {
81
- var o = d(this).constructor;
82
- n = Reflect.construct(i, arguments, o);
83
- } else n = i.apply(this, arguments);
84
- return function (t, r) {
85
- if (r && ("object" === e(r) || "function" == typeof r)) return r;
86
- if (void 0 !== r) throw new TypeError("Derived constructors may only return object or undefined");
87
- return s(t);
88
- }(this, n);
89
- };
90
- }
91
- function s(e) {
92
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
93
- return e;
94
- }
95
- function a(e) {
89
+ function c(e) {
96
90
  var t = "function" == typeof Map ? new Map() : void 0;
97
- return a = function a(e) {
91
+ return c = function c(e) {
98
92
  if (null === e || !function (e) {
99
93
  try {
100
94
  return -1 !== Function.toString.call(e).indexOf("[native code]");
@@ -108,7 +102,13 @@ function a(e) {
108
102
  t.set(e, r);
109
103
  }
110
104
  function r() {
111
- return c(e, arguments, d(this).constructor);
105
+ return function (e, t, r) {
106
+ if (u()) return Reflect.construct.apply(null, arguments);
107
+ var n = [null];
108
+ n.push.apply(n, t);
109
+ var i = new (e.bind.apply(e, n))();
110
+ return r && l(i, r.prototype), i;
111
+ }(e, arguments, d(this).constructor);
112
112
  }
113
113
  return r.prototype = Object.create(e.prototype, {
114
114
  constructor: {
@@ -118,25 +118,15 @@ function a(e) {
118
118
  configurable: !0
119
119
  }
120
120
  }), l(r, e);
121
- }, a(e);
122
- }
123
- function c(e, t, r) {
124
- return c = u() ? Reflect.construct.bind() : function (e, t, r) {
125
- var n = [null];
126
- n.push.apply(n, t);
127
- var i = new (Function.bind.apply(e, n))();
128
- return r && l(i, r.prototype), i;
129
- }, c.apply(null, arguments);
121
+ }, c(e);
130
122
  }
131
123
  function u() {
132
- if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
133
- if (Reflect.construct.sham) return !1;
134
- if ("function" == typeof Proxy) return !0;
135
124
  try {
136
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
137
- } catch (e) {
138
- return !1;
139
- }
125
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
126
+ } catch (e) {}
127
+ return (u = function u() {
128
+ return !!e;
129
+ })();
140
130
  }
141
131
  function l(e, t) {
142
132
  return l = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
@@ -164,338 +154,262 @@ Object.defineProperty(exports, "__esModule", {
164
154
  e.MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", e.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", e.OTPsAuthenticate = "OTP_AUTHENTICATE", e.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", e.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", e.PasswordCreate = "PASSWORD_CREATE", e.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", e.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", e.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", e.PasskeyRegister = "PASSKEY_REGISTER", e.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", e.PasskeySkip = "PASSKEY_SKIP", e.PasskeyDone = "PASSKEY_DONE", e.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", e.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", e.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", e.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", e.B2BSSOStart = "B2B_SSO_START", e.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", e.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", e.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", e.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", e.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", e.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", e.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", e.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", e.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION";
165
155
  }(exports.StytchEventType || (exports.StytchEventType = {}));
166
156
  var h = function (e) {
167
- i(c, a(Error));
168
- var t = o(c);
169
- function c(e, r) {
170
- var i;
171
- return n(this, c), (i = t.call(this, e + "\n" + r)).message = e + "\n" + r, i.name = "SDKAPIUnreachableError", i.details = r, Object.setPrototypeOf(s(i), c.prototype), i;
157
+ function t(e, r) {
158
+ var n;
159
+ return i(this, t), (n = o(this, t, [e + "\n" + r])).message = e + "\n" + r, n.name = "SDKAPIUnreachableError", n.details = r, Object.setPrototypeOf(s(n), t.prototype), n;
172
160
  }
173
- return r(c);
161
+ return a(t, c(Error)), r(t);
174
162
  }(),
175
163
  p = function (e) {
176
- i(s, a(Error));
177
- var t = o(s);
178
- function s(e, r) {
179
- var i;
180
- return n(this, s), (i = t.call(this)).name = "StytchSDKUsageError", i.message = "Invalid call to ".concat(e, "\n") + r, i;
164
+ function t(e, r) {
165
+ var n;
166
+ return i(this, t), (n = o(this, t)).name = "StytchSDKUsageError", n.message = "Invalid call to ".concat(e, "\n") + r, n;
181
167
  }
182
- return r(s);
168
+ return a(t, c(Error)), r(t);
183
169
  }(),
184
170
  _ = function (e) {
185
- i(s, a(Error));
186
- var t = o(s);
187
- function s(e) {
188
- var r, i;
189
- n(this, s), (r = t.call(this)).name = "StytchSDKSchemaError";
190
- var o = null === (i = e.body) || void 0 === i ? void 0 : i.map(function (e) {
171
+ function t(e) {
172
+ var r, n;
173
+ i(this, t), (r = o(this, t)).name = "StytchSDKSchemaError";
174
+ var s = null === (n = e.body) || void 0 === n ? void 0 : n.map(function (e) {
191
175
  return "".concat(e.dataPath, ": ").concat(e.message);
192
176
  }).join("\n");
193
- return r.message = "[400] Request does not match expected schema\n".concat(o), r;
177
+ return r.message = "[400] Request does not match expected schema\n".concat(s), r;
194
178
  }
195
- return r(s);
179
+ return a(t, c(Error)), r(t);
196
180
  }(),
197
181
  f = function (e) {
198
- i(s, a(Error));
199
- var t = o(s);
200
- function s(e) {
182
+ function t(e) {
201
183
  var r;
202
- n(this, s), (r = t.call(this)).name = "StytchSDKAPIError";
203
- var i = e.status_code,
204
- o = e.error_type,
184
+ i(this, t), (r = o(this, t)).name = "StytchSDKAPIError";
185
+ var n = e.status_code,
186
+ s = e.error_type,
205
187
  a = e.error_message,
206
188
  c = e.error_url,
207
189
  u = e.request_id;
208
- return r.error_type = o, r.error_message = a, r.error_url = c, r.request_id = u, r.status_code = i, r.message = "[".concat(i, "] ").concat(o, "\n") + "".concat(a, "\n") + "See ".concat(c, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : ""), r;
190
+ return r.error_type = s, r.error_message = a, r.error_url = c, r.request_id = u, r.status_code = n, r.message = "[".concat(n, "] ").concat(s, "\n") + "".concat(a, "\n") + "See ".concat(c, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : ""), r;
209
191
  }
210
- return r(s);
192
+ return a(t, c(Error)), r(t);
211
193
  }(),
212
194
  m = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"],
213
195
  v = function (e) {
214
- i(s, a(Error));
215
- var t = o(s);
216
- function s(e, r) {
217
- var i;
218
- return n(this, s), (i = t.call(this, r)).name = e, i;
196
+ function t(e, r) {
197
+ var n;
198
+ return i(this, t), (n = o(this, t, [r])).name = e, n;
219
199
  }
220
- return r(s);
200
+ return a(t, c(Error)), r(t);
221
201
  }(),
222
202
  b = function (e) {
223
- i(a, v);
224
- var t = o(a);
225
- function a(e) {
203
+ function t(e) {
226
204
  var r;
227
- return n(this, a), r = t.call(this, "StytchAPIUnreachableError", e), Object.setPrototypeOf(s(r), a.prototype), r;
205
+ return i(this, t), r = o(this, t, ["StytchAPIUnreachableError", e]), Object.setPrototypeOf(s(r), t.prototype), r;
228
206
  }
229
- return r(a);
207
+ return a(t, v), r(t);
230
208
  }(),
231
209
  g = function (e) {
232
- i(s, v);
233
- var t = o(s);
234
- function s(e) {
210
+ function t(e) {
235
211
  var r;
236
- n(this, s);
237
- var i = null === (r = e.body) || void 0 === r ? void 0 : r.map(function (e) {
212
+ i(this, t);
213
+ var n = null === (r = e.body) || void 0 === r ? void 0 : r.map(function (e) {
238
214
  return "".concat(e.dataPath, ": ").concat(e.message);
239
215
  }).join("\n");
240
- return t.call(this, "StytchAPISchemaError", "Request does not match expected schema\n".concat(i));
216
+ return o(this, t, ["StytchAPISchemaError", "Request does not match expected schema\n".concat(n)]);
241
217
  }
242
- return r(s);
218
+ return a(t, v), r(t);
243
219
  }(),
244
220
  y = function (e) {
245
- i(s, v);
246
- var t = o(s);
247
- function s(e) {
221
+ function t(e) {
248
222
  var r;
249
- n(this, s);
250
- var i = e.status_code,
251
- o = e.error_type,
223
+ i(this, t);
224
+ var n = e.status_code,
225
+ s = e.error_type,
252
226
  a = e.error_message,
253
227
  c = e.error_url,
254
228
  u = e.request_id;
255
- return (r = t.call(this, "StytchAPIError", "[".concat(i, "] ").concat(o, "\n") + "".concat(a, "\n") + "See ".concat(c, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : ""))).error_type = o, r.error_message = a, r.error_url = c, r.request_id = u, r.status_code = i, r;
229
+ return (r = o(this, t, ["StytchAPIError", "[".concat(n, "] ").concat(s, "\n") + "".concat(a, "\n") + "See ".concat(c, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : "")])).error_type = s, r.error_message = a, r.error_url = c, r.request_id = u, r.status_code = n, r;
256
230
  }
257
- return r(s);
231
+ return a(t, v), r(t);
258
232
  }(),
259
233
  k = function (e) {
260
- i(s, v);
261
- var t = o(s);
262
- function s(e, r, i) {
263
- var o;
264
- return n(this, s), (o = t.call(this, e, r)).options = i, o;
234
+ function t(e, r, n) {
235
+ var s;
236
+ return i(this, t), (s = o(this, t, [e, r])).options = n, s;
265
237
  }
266
- return r(s);
238
+ return a(t, v), r(t);
267
239
  }(),
268
240
  w = function (e) {
269
- i(s, k);
270
- var t = o(s);
271
- function s() {
272
- return n(this, s), t.call(this, "NoCurrentSessionError", "There is no session currently available. Make sure the user is authenticated with a valid session.");
241
+ function t() {
242
+ return i(this, t), o(this, t, ["NoCurrentSessionError", "There is no session currently available. Make sure the user is authenticated with a valid session."]);
273
243
  }
274
- return r(s);
244
+ return a(t, k), r(t);
275
245
  }(),
276
246
  S = function (e) {
277
- i(s, k);
278
- var t = o(s);
279
- function s(e) {
280
- return n(this, s), t.call(this, "InternalError", e || "An internal error has occurred. Please contact Stytch if this occurs.");
247
+ function t(e) {
248
+ return i(this, t), o(this, t, ["InternalError", e || "An internal error has occurred. Please contact Stytch if this occurs."]);
281
249
  }
282
- return r(s);
250
+ return a(t, k), r(t);
283
251
  }(),
284
252
  P = function (e) {
285
- i(s, k);
286
- var t = o(s);
287
- function s() {
288
- return n(this, s), t.call(this, "NoBiometricsRegistrationError", "There is no biometric registration available. Authenticate with another method and add a new biometric registration first.");
253
+ function t() {
254
+ return i(this, t), o(this, t, ["NoBiometricsRegistrationError", "There is no biometric registration available. Authenticate with another method and add a new biometric registration first."]);
289
255
  }
290
- return r(s);
256
+ return a(t, k), r(t);
291
257
  }(),
292
258
  A = function (e) {
293
- i(s, k);
294
- var t = o(s);
295
- function s() {
296
- return n(this, s), t.call(this, "BiometricsUnavailableError", "Biometrics is not available on the device.");
259
+ function t() {
260
+ return i(this, t), o(this, t, ["BiometricsUnavailableError", "Biometrics is not available on the device."]);
297
261
  }
298
- return r(s);
262
+ return a(t, k), r(t);
299
263
  }(),
300
264
  C = function (e) {
301
- i(s, k);
302
- var t = o(s);
303
- function s() {
304
- return n(this, s), t.call(this, "KeyInvalidatedError", "The biometrics enrollment on the device has changed.");
265
+ function t() {
266
+ return i(this, t), o(this, t, ["KeyInvalidatedError", "The biometrics enrollment on the device has changed."]);
305
267
  }
306
- return r(s);
268
+ return a(t, k), r(t);
307
269
  }(),
308
270
  E = function (e) {
309
- i(s, k);
310
- var t = o(s);
311
- function s() {
312
- return n(this, s), t.call(this, "KeystoreUnavailableError", "The Android keystore is unavailable on the device. Consider setting allowFallbackToCleartext to true.");
271
+ function t() {
272
+ return i(this, t), o(this, t, ["KeystoreUnavailableError", "The Android keystore is unavailable on the device. Consider setting allowFallbackToCleartext to true."]);
313
273
  }
314
- return r(s);
274
+ return a(t, k), r(t);
315
275
  }(),
316
276
  T = function (e) {
317
- i(s, k);
318
- var t = o(s);
319
- function s() {
320
- return n(this, s), t.call(this, "NoBiometricsEnrolledError", "There is no biometric factor enrolled on the device. Add a biometric factor in the device settings.");
277
+ function t() {
278
+ return i(this, t), o(this, t, ["NoBiometricsEnrolledError", "There is no biometric factor enrolled on the device. Add a biometric factor in the device settings."]);
321
279
  }
322
- return r(s);
280
+ return a(t, k), r(t);
323
281
  }(),
324
282
  O = function (e) {
325
- i(s, k);
326
- var t = o(s);
327
- function s() {
328
- return n(this, s), t.call(this, "UserCancellationError", "The user canceled the prompt. Ask the user to try again.");
283
+ function t() {
284
+ return i(this, t), o(this, t, ["UserCancellationError", "The user canceled the prompt. Ask the user to try again."]);
329
285
  }
330
- return r(s);
286
+ return a(t, k), r(t);
331
287
  }(),
332
288
  x = function (e) {
333
- i(s, k);
334
- var t = o(s);
335
- function s() {
336
- return n(this, s), t.call(this, "UserLockedOutError", "The user has been locked out due to too many failed attempts. Ask the user to try again later.");
289
+ function t() {
290
+ return i(this, t), o(this, t, ["UserLockedOutError", "The user has been locked out due to too many failed attempts. Ask the user to try again later."]);
337
291
  }
338
- return r(s);
292
+ return a(t, k), r(t);
339
293
  }(),
340
294
  D = function (e) {
341
- i(s, k);
342
- var t = o(s);
343
- function s() {
344
- return n(this, s), t.call(this, "DeviceCredentialsNotAllowedError", "The device credentials allowment is mismatched. Change the allowDeviceCredentials parameter to be the same in both the register and authenticate methods.");
295
+ function t() {
296
+ return i(this, t), o(this, t, ["DeviceCredentialsNotAllowedError", "The device credentials allowment is mismatched. Change the allowDeviceCredentials parameter to be the same in both the register and authenticate methods."]);
345
297
  }
346
- return r(s);
298
+ return a(t, k), r(t);
347
299
  }(),
348
300
  I = function (e) {
349
- i(s, k);
350
- var t = o(s);
351
- function s() {
352
- return n(this, s), t.call(this, "MissingGoogleClientIDError", "No Google client ID was found in the project.");
301
+ function t() {
302
+ return i(this, t), o(this, t, ["MissingGoogleClientIDError", "No Google client ID was found in the project."]);
353
303
  }
354
- return r(s);
304
+ return a(t, k), r(t);
355
305
  }(),
356
306
  B = function (e) {
357
- i(s, k);
358
- var t = o(s);
359
- function s() {
360
- return n(this, s), t.call(this, "MissingPKCEError", "Make sure this flow is completed on the same device on which it was started.");
307
+ function t() {
308
+ return i(this, t), o(this, t, ["MissingPKCEError", "Make sure this flow is completed on the same device on which it was started."]);
361
309
  }
362
- return r(s);
310
+ return a(t, k), r(t);
363
311
  }(),
364
312
  R = function (e) {
365
- i(s, k);
366
- var t = o(s);
367
- function s() {
368
- return n(this, s), t.call(this, "MissingAuthorizationCredentialIDTokenError", "The authorization credential is missing an ID token.");
313
+ function t() {
314
+ return i(this, t), o(this, t, ["MissingAuthorizationCredentialIDTokenError", "The authorization credential is missing an ID token."]);
369
315
  }
370
- return r(s);
316
+ return a(t, k), r(t);
371
317
  }(),
372
318
  L = function (e) {
373
- i(s, k);
374
- var t = o(s);
375
- function s() {
376
- return n(this, s), t.call(this, "InvalidAuthorizationCredentialError", "The authorization credential is invalid. Verify that OAuth is set up correctly in the developer console, and call the start flow method.");
319
+ function t() {
320
+ return i(this, t), o(this, t, ["InvalidAuthorizationCredentialError", "The authorization credential is invalid. Verify that OAuth is set up correctly in the developer console, and call the start flow method."]);
377
321
  }
378
- return r(s);
322
+ return a(t, k), r(t);
379
323
  }(),
380
324
  M = function (e) {
381
- i(s, k);
382
- var t = o(s);
383
- function s() {
384
- return n(this, s), t.call(this, "MissingPublicKeyError", "Failed to retrieve the public key. Add a new biometric registration.");
325
+ function t() {
326
+ return i(this, t), o(this, t, ["MissingPublicKeyError", "Failed to retrieve the public key. Add a new biometric registration."]);
385
327
  }
386
- return r(s);
328
+ return a(t, k), r(t);
387
329
  }(),
388
330
  F = function (e) {
389
- i(s, k);
390
- var t = o(s);
391
- function s() {
392
- return n(this, s), t.call(this, "ChallengeSigningFailedError", "Failed to sign the challenge with the key.");
331
+ function t() {
332
+ return i(this, t), o(this, t, ["ChallengeSigningFailedError", "Failed to sign the challenge with the key."]);
393
333
  }
394
- return r(s);
334
+ return a(t, k), r(t);
395
335
  }(),
396
336
  j = function (e) {
397
- i(s, k);
398
- var t = o(s);
399
- function s() {
400
- return n(this, s), t.call(this, "SDKNotConfiguredError", "Stytch client is not confiured. You must call the configure method before using the SDK");
337
+ function t() {
338
+ return i(this, t), o(this, t, ["SDKNotConfiguredError", "Stytch client is not confiured. You must call the configure method before using the SDK"]);
401
339
  }
402
- return r(s);
340
+ return a(t, k), r(t);
403
341
  }(),
404
342
  K = function (e) {
405
- i(s, k);
406
- var t = o(s);
407
- function s() {
408
- return n(this, s), t.call(this, "FailedCodeChallengeError", "Failed to create a code challenge");
343
+ function t() {
344
+ return i(this, t), o(this, t, ["FailedCodeChallengeError", "Failed to create a code challenge"]);
409
345
  }
410
- return r(s);
346
+ return a(t, k), r(t);
411
347
  }(),
412
348
  N = function (e) {
413
- i(s, k);
414
- var t = o(s);
415
- function s() {
416
- return n(this, s), t.call(this, "PasskeysUnsupportedError", "Passkeys are not supported on this device");
349
+ function t() {
350
+ return i(this, t), o(this, t, ["PasskeysUnsupportedError", "Passkeys are not supported on this device"]);
417
351
  }
418
- return r(s);
352
+ return a(t, k), r(t);
419
353
  }(),
420
354
  z = function (e) {
421
- i(s, k);
422
- var t = o(s);
423
- function s() {
424
- return n(this, s), t.call(this, "FailedToDecryptDataError", "Failed to decrypt user data");
355
+ function t() {
356
+ return i(this, t), o(this, t, ["FailedToDecryptDataError", "Failed to decrypt user data"]);
425
357
  }
426
- return r(s);
358
+ return a(t, k), r(t);
427
359
  }(),
428
360
  U = function (e) {
429
- i(s, k);
430
- var t = o(s);
431
- function s() {
432
- return n(this, s), t.call(this, "BiometricsFailedError", "Biometric authentication failed");
361
+ function t() {
362
+ return i(this, t), o(this, t, ["BiometricsFailedError", "Biometric authentication failed"]);
433
363
  }
434
- return r(s);
364
+ return a(t, k), r(t);
435
365
  }(),
436
366
  q = function (e) {
437
- i(s, k);
438
- var t = o(s);
439
- function s() {
440
- return n(this, s), t.call(this, "InvalidStartUrlError", "The start URL was invalid or improperly formatted.");
367
+ function t() {
368
+ return i(this, t), o(this, t, ["InvalidStartUrlError", "The start URL was invalid or improperly formatted."]);
441
369
  }
442
- return r(s);
370
+ return a(t, k), r(t);
443
371
  }(),
444
372
  W = function (e) {
445
- i(s, k);
446
- var t = o(s);
447
- function s() {
448
- return n(this, s), t.call(this, "InvalidRedirectSchemeError", "The scheme from the given redirect urls was invalid. Possible reasons include: nil scheme, non-custom scheme (using http or https), or differing schemes for login/signup urls.");
373
+ function t() {
374
+ return i(this, t), o(this, t, ["InvalidRedirectSchemeError", "The scheme from the given redirect urls was invalid. Possible reasons include: nil scheme, non-custom scheme (using http or https), or differing schemes for login/signup urls."]);
449
375
  }
450
- return r(s);
376
+ return a(t, k), r(t);
451
377
  }(),
452
378
  G = function (e) {
453
- i(s, k);
454
- var t = o(s);
455
- function s() {
456
- return n(this, s), t.call(this, "MissingUrlError", "The underlying web authentication service failed to return a URL.");
379
+ function t() {
380
+ return i(this, t), o(this, t, ["MissingUrlError", "The underlying web authentication service failed to return a URL."]);
457
381
  }
458
- return r(s);
382
+ return a(t, k), r(t);
459
383
  }(),
460
384
  H = function (e) {
461
- i(s, k);
462
- var t = o(s);
463
- function s() {
464
- return n(this, s), t.call(this, "InvalidCredentialTypeError", "The public key credential type was not of the expected type.");
385
+ function t() {
386
+ return i(this, t), o(this, t, ["InvalidCredentialTypeError", "The public key credential type was not of the expected type."]);
465
387
  }
466
- return r(s);
388
+ return a(t, k), r(t);
467
389
  }(),
468
390
  Y = function (e) {
469
- i(s, k);
470
- var t = o(s);
471
- function s() {
472
- return n(this, s), t.call(this, "MissingAttestationObjectError", "The public key credential is missing the attestation object.");
391
+ function t() {
392
+ return i(this, t), o(this, t, ["MissingAttestationObjectError", "The public key credential is missing the attestation object."]);
473
393
  }
474
- return r(s);
394
+ return a(t, k), r(t);
475
395
  }(),
476
396
  V = function (e) {
477
- i(s, k);
478
- var t = o(s);
479
- function s() {
480
- return n(this, s), t.call(this, "JSONDataNotConvertibleToStringError", "JSON data unable to be converted to String type.");
397
+ function t() {
398
+ return i(this, t), o(this, t, ["JSONDataNotConvertibleToStringError", "JSON data unable to be converted to String type."]);
481
399
  }
482
- return r(s);
400
+ return a(t, k), r(t);
483
401
  }(),
484
402
  J = function (e) {
485
- i(s, k);
486
- var t = o(s);
487
- function s() {
488
- return n(this, s), t.call(this, "RandomNumberGenerationFailed", "Random number generation failed");
403
+ function t() {
404
+ return i(this, t), o(this, t, ["RandomNumberGenerationFailed", "Random number generation failed"]);
489
405
  }
490
- return r(s);
406
+ return a(t, k), r(t);
491
407
  }(),
492
408
  $ = function (e) {
493
- i(s, k);
494
- var t = o(s);
495
- function s() {
496
- return n(this, s), t.call(this, "PasskeysInvalidEncoding", "Invalid passkey encoding");
409
+ function t() {
410
+ return i(this, t), o(this, t, ["PasskeysInvalidEncoding", "Invalid passkey encoding"]);
497
411
  }
498
- return r(s);
412
+ return a(t, k), r(t);
499
413
  }();
500
414
  function X(e, t) {
501
415
  return function (e) {
@@ -854,49 +768,43 @@ function te() {
854
768
  function re(e, t) {
855
769
  for (var r = 0; r < t.length; r++) {
856
770
  var n = t[r];
857
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (i = n.key, o = void 0, o = function (e, t) {
858
- if ("object" !== ee(e) || null === e) return e;
859
- var r = e[Symbol.toPrimitive];
860
- if (void 0 !== r) {
861
- var n = r.call(e, t || "default");
862
- if ("object" !== ee(n)) return n;
863
- throw new TypeError("@@toPrimitive must return a primitive value.");
864
- }
865
- return ("string" === t ? String : Number)(e);
866
- }(i, "string"), "symbol" === ee(o) ? o : String(o)), n);
771
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, ie(n.key), n);
867
772
  }
868
- var i, o;
869
773
  }
870
774
  function ne(e, t, r) {
871
775
  return t && re(e.prototype, t), r && re(e, r), Object.defineProperty(e, "prototype", {
872
776
  writable: !1
873
777
  }), e;
874
778
  }
875
- function ie(e, t) {
779
+ function ie(e) {
780
+ var t = function (e, t) {
781
+ if ("object" != ee(e) || !e) return e;
782
+ var r = e[Symbol.toPrimitive];
783
+ if (void 0 !== r) {
784
+ var n = r.call(e, t || "default");
785
+ if ("object" != ee(n)) return n;
786
+ throw new TypeError("@@toPrimitive must return a primitive value.");
787
+ }
788
+ return ("string" === t ? String : Number)(e);
789
+ }(e, "string");
790
+ return "symbol" == ee(t) ? t : String(t);
791
+ }
792
+ function oe(e, t) {
876
793
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
877
794
  }
878
- function oe(e) {
879
- var t = ce();
880
- return function () {
881
- var r,
882
- n = le(e);
883
- if (t) {
884
- var i = le(this).constructor;
885
- r = Reflect.construct(n, arguments, i);
886
- } else r = n.apply(this, arguments);
887
- return function (e, t) {
888
- if (t && ("object" === ee(t) || "function" == typeof t)) return t;
889
- if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
890
- return function (e) {
891
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
892
- return e;
893
- }(e);
894
- }(this, r);
895
- };
795
+ function se(e, t, r) {
796
+ return t = le(t), function (e, t) {
797
+ if (t && ("object" === ee(t) || "function" == typeof t)) return t;
798
+ if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
799
+ return function (e) {
800
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
801
+ return e;
802
+ }(e);
803
+ }(e, ce() ? Reflect.construct(t, r || [], le(e).constructor) : t.apply(e, r));
896
804
  }
897
- function se(e) {
805
+ function ae(e) {
898
806
  var t = "function" == typeof Map ? new Map() : void 0;
899
- return se = function se(e) {
807
+ return ae = function ae(e) {
900
808
  if (null === e || !function (e) {
901
809
  try {
902
810
  return -1 !== Function.toString.call(e).indexOf("[native code]");
@@ -910,7 +818,13 @@ function se(e) {
910
818
  t.set(e, r);
911
819
  }
912
820
  function r() {
913
- return ae(e, arguments, le(this).constructor);
821
+ return function (e, t, r) {
822
+ if (ce()) return Reflect.construct.apply(null, arguments);
823
+ var n = [null];
824
+ n.push.apply(n, t);
825
+ var i = new (e.bind.apply(e, n))();
826
+ return r && ue(i, r.prototype), i;
827
+ }(e, arguments, le(this).constructor);
914
828
  }
915
829
  return r.prototype = Object.create(e.prototype, {
916
830
  constructor: {
@@ -920,25 +834,15 @@ function se(e) {
920
834
  configurable: !0
921
835
  }
922
836
  }), ue(r, e);
923
- }, se(e);
924
- }
925
- function ae(e, t, r) {
926
- return ae = ce() ? Reflect.construct.bind() : function (e, t, r) {
927
- var n = [null];
928
- n.push.apply(n, t);
929
- var i = new (Function.bind.apply(e, n))();
930
- return r && ue(i, r.prototype), i;
931
- }, ae.apply(null, arguments);
837
+ }, ae(e);
932
838
  }
933
839
  function ce() {
934
- if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
935
- if (Reflect.construct.sham) return !1;
936
- if ("function" == typeof Proxy) return !0;
937
840
  try {
938
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
939
- } catch (e) {
940
- return !1;
941
- }
841
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
842
+ } catch (e) {}
843
+ return (ce = function ce() {
844
+ return !!e;
845
+ })();
942
846
  }
943
847
  function ue(e, t) {
944
848
  return ue = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
@@ -986,7 +890,11 @@ function he(e, t, r, n) {
986
890
  "function" == typeof SuppressedError && SuppressedError, (de || (de = {})).RequiredCatcha = "Catcha Required";
987
891
  var pe,
988
892
  _e = function (e) {
989
- !function (e, t) {
893
+ function t(e) {
894
+ var r;
895
+ return oe(this, t), (r = se(this, t, [e])).type = e, r;
896
+ }
897
+ return function (e, t) {
990
898
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
991
899
  e.prototype = Object.create(t && t.prototype, {
992
900
  constructor: {
@@ -997,13 +905,7 @@ var pe,
997
905
  }), Object.defineProperty(e, "prototype", {
998
906
  writable: !1
999
907
  }), t && ue(e, t);
1000
- }(r, se(Error));
1001
- var t = oe(r);
1002
- function r(e) {
1003
- var n;
1004
- return ie(this, r), (n = t.call(this, e)).type = e, n;
1005
- }
1006
- return ne(r);
908
+ }(t, ae(Error)), ne(t);
1007
909
  }();
1008
910
  function fe(e) {
1009
911
  var t,
@@ -1281,7 +1183,7 @@ var Ee,
1281
1183
  o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : function () {
1282
1184
  return Promise.resolve(void 0);
1283
1185
  };
1284
- ie(this, e), this.bootstrapPromise = n, this.isEnabled = function () {
1186
+ oe(this, e), this.bootstrapPromise = n, this.isEnabled = function () {
1285
1187
  return he(i, void 0, void 0, te().mark(function e() {
1286
1188
  return te().wrap(function (e) {
1287
1189
  for (;;) switch (e.prev = e.next) {
@@ -1492,7 +1394,7 @@ var Ee,
1492
1394
  },
1493
1395
  Me = function () {
1494
1396
  function e(t) {
1495
- ie(this, e), this.maxBatchSize = t.maxBatchSize, this.logEventURL = t.logEventURL, setInterval(this.flush.bind(this), t.intervalDurationMs), this.batch = [];
1397
+ oe(this, e), this.maxBatchSize = t.maxBatchSize, this.logEventURL = t.logEventURL, setInterval(this.flush.bind(this), t.intervalDurationMs), this.batch = [];
1496
1398
  }
1497
1399
  return ne(e, [{
1498
1400
  key: "logEvent",
@@ -1552,7 +1454,7 @@ var Fe = Promise.resolve({
1552
1454
  var o = this,
1553
1455
  s = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : Fe,
1554
1456
  a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : Le();
1555
- ie(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._passwordResetPKCEManager = i, this._config = s, this.dfpProtectedAuth = a, this.email = {
1457
+ oe(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._passwordResetPKCEManager = i, this._config = s, this.dfpProtectedAuth = a, this.email = {
1556
1458
  invite: function invite(e) {
1557
1459
  return he(o, void 0, void 0, te().mark(function t() {
1558
1460
  return te().wrap(function (t) {
@@ -1782,7 +1684,7 @@ var Fe = Promise.resolve({
1782
1684
  }(),
1783
1685
  Ke = ne(function e(t, r) {
1784
1686
  var n = this;
1785
- ie(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
1687
+ oe(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
1786
1688
  return he(n, void 0, void 0, te().mark(function e() {
1787
1689
  var t;
1788
1690
  return te().wrap(function (e) {
@@ -1847,6 +1749,25 @@ var Fe = Promise.resolve({
1847
1749
  }
1848
1750
  }, e, this);
1849
1751
  }));
1752
+ }, this.deleteMFATOTP = function () {
1753
+ return he(n, void 0, void 0, te().mark(function e() {
1754
+ var t;
1755
+ return te().wrap(function (e) {
1756
+ for (;;) switch (e.prev = e.next) {
1757
+ case 0:
1758
+ return e.next = 2, this._networkClient.fetchSDK({
1759
+ url: "/b2b/organizations/members/deleteTOTP",
1760
+ errorMessage: "Failed to delete member totp.",
1761
+ method: "DELETE"
1762
+ });
1763
+ case 2:
1764
+ return t = e.sent, this._subscriptionService.updateMember(t.member), e.abrupt("return", t);
1765
+ case 5:
1766
+ case "end":
1767
+ return e.stop();
1768
+ }
1769
+ }, e, this);
1770
+ }));
1850
1771
  }, this.deletePassword = function (e) {
1851
1772
  return he(n, void 0, void 0, te().mark(function t() {
1852
1773
  var r;
@@ -1872,7 +1793,7 @@ var Fe = Promise.resolve({
1872
1793
  function e(t, r, n, i, o) {
1873
1794
  var s = this,
1874
1795
  a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : Le();
1875
- ie(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._dynamicConfig = i, this._config = o, this.dfpProtectedAuth = a, this.saml = {
1796
+ oe(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._dynamicConfig = i, this._config = o, this.dfpProtectedAuth = a, this.saml = {
1876
1797
  createConnection: function createConnection(e) {
1877
1798
  return he(s, void 0, void 0, te().mark(function t() {
1878
1799
  return te().wrap(function (t) {
@@ -2141,7 +2062,7 @@ var Fe = Promise.resolve({
2141
2062
  }(),
2142
2063
  ze = ne(function e(t, r) {
2143
2064
  var n = this;
2144
- ie(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
2065
+ oe(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
2145
2066
  return he(n, void 0, void 0, te().mark(function e() {
2146
2067
  var t;
2147
2068
  return te().wrap(function (e) {
@@ -2295,6 +2216,23 @@ var Fe = Promise.resolve({
2295
2216
  }, t, this);
2296
2217
  }));
2297
2218
  },
2219
+ deleteMFATOTP: function deleteMFATOTP(e) {
2220
+ return he(n, void 0, void 0, te().mark(function t() {
2221
+ return te().wrap(function (t) {
2222
+ for (;;) switch (t.prev = t.next) {
2223
+ case 0:
2224
+ return t.abrupt("return", this._networkClient.fetchSDK({
2225
+ url: "/b2b/organizations/members/totp/".concat(e),
2226
+ errorMessage: "Failed to delete member totp.",
2227
+ method: "DELETE"
2228
+ }));
2229
+ case 1:
2230
+ case "end":
2231
+ return t.stop();
2232
+ }
2233
+ }, t, this);
2234
+ }));
2235
+ },
2298
2236
  "delete": function _delete(e) {
2299
2237
  return he(n, void 0, void 0, te().mark(function t() {
2300
2238
  return te().wrap(function (t) {
@@ -2335,7 +2273,7 @@ var Fe = Promise.resolve({
2335
2273
  function e(t, r, n, i, o) {
2336
2274
  var s = this,
2337
2275
  a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : Le();
2338
- ie(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._dynamicConfig = i, this._config = o, this.dfpProtectedAuth = a, this.discovery = {
2276
+ oe(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._dynamicConfig = i, this._config = o, this.dfpProtectedAuth = a, this.discovery = {
2339
2277
  authenticate: function authenticate(e) {
2340
2278
  return he(s, void 0, void 0, te().mark(function t() {
2341
2279
  var r, n, i, o, s, a;
@@ -2543,7 +2481,7 @@ var Fe = Promise.resolve({
2543
2481
  qe = function () {
2544
2482
  function e(t, r) {
2545
2483
  var n = this;
2546
- ie(this, e), this._networkClient = t, this._subscriptionService = r, this.getSync = function () {
2484
+ oe(this, e), this._networkClient = t, this._subscriptionService = r, this.getSync = function () {
2547
2485
  return n._subscriptionService.getSession();
2548
2486
  }, this.onChange = function (e) {
2549
2487
  return n._subscriptionService.subscribeToState(function (t) {
@@ -2670,7 +2608,7 @@ var Fe = Promise.resolve({
2670
2608
  }(),
2671
2609
  We = ne(function e(t, r) {
2672
2610
  var n = this;
2673
- ie(this, e), this._networkClient = t, this._subscriptionService = r, this.organizations = {
2611
+ oe(this, e), this._networkClient = t, this._subscriptionService = r, this.organizations = {
2674
2612
  list: function list() {
2675
2613
  return he(n, void 0, void 0, te().mark(function e() {
2676
2614
  return te().wrap(function (e) {
@@ -2798,7 +2736,7 @@ Promise.resolve({
2798
2736
  var Ge = ne(function e(t, r) {
2799
2737
  var n = this,
2800
2738
  i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Le();
2801
- ie(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = i, this.sms = {
2739
+ oe(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = i, this.sms = {
2802
2740
  send: function send(e) {
2803
2741
  return he(n, void 0, void 0, te().mark(function t() {
2804
2742
  var r, n, i;
@@ -2883,7 +2821,7 @@ var Ge = ne(function e(t, r) {
2883
2821
  He = function () {
2884
2822
  function e(t, r) {
2885
2823
  var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Le();
2886
- ie(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n;
2824
+ oe(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n;
2887
2825
  }
2888
2826
  return ne(e, [{
2889
2827
  key: "create",
@@ -2973,7 +2911,7 @@ var Ge = ne(function e(t, r) {
2973
2911
  Ye = function () {
2974
2912
  function e(t, r) {
2975
2913
  var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Le();
2976
- ie(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n;
2914
+ oe(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n;
2977
2915
  }
2978
2916
  return ne(e, [{
2979
2917
  key: "recover",
@@ -3073,7 +3011,7 @@ var Ge = ne(function e(t, r) {
3073
3011
  Ve = function () {
3074
3012
  function e(t, r, n) {
3075
3013
  var i = this;
3076
- ie(this, e), this._subscriptionService = n, this.isAuthorizedSync = function (e, t) {
3014
+ oe(this, e), this._subscriptionService = n, this.isAuthorizedSync = function (e, t) {
3077
3015
  var r;
3078
3016
  return !!(null === (r = i.cachedPolicy) || void 0 === r ? void 0 : r.callerIsAuthorized(i.roleIds(), e, t));
3079
3017
  }, this.isAuthorized = function (e, t) {
@@ -3104,7 +3042,7 @@ var Ge = ne(function e(t, r) {
3104
3042
  Je = function () {
3105
3043
  function e(t, r) {
3106
3044
  var n = this;
3107
- ie(this, e), this._subscriptionService = t, this._headlessSessionClient = r, this._onDataChange = function (e) {
3045
+ oe(this, e), this._subscriptionService = t, this._headlessSessionClient = r, this._onDataChange = function (e) {
3108
3046
  (null == e ? void 0 : e.session) ? n.scheduleBackgroundRefresh() : n.cancelBackgroundRefresh();
3109
3047
  }, this._reauthenticateWithBackoff = function () {
3110
3048
  return he(n, void 0, void 0, te().mark(function t() {
@@ -3189,7 +3127,7 @@ var $e,
3189
3127
  st = function () {
3190
3128
  function e(t, r) {
3191
3129
  var n = this;
3192
- ie(this, e), this.roles = t, this.resources = r, this.rolesByID = {}, t.forEach(function (e) {
3130
+ oe(this, e), this.roles = t, this.resources = r, this.rolesByID = {}, t.forEach(function (e) {
3193
3131
  return n.rolesByID[e.role_id] = e;
3194
3132
  });
3195
3133
  }
@@ -3267,11 +3205,10 @@ function at(e, t, r, n) {
3267
3205
  }(tt || (tt = {}));
3268
3206
  var ct = /*#__PURE__*/function (_Error) {
3269
3207
  _inherits(ct, _Error);
3270
- var _super = _createSuper(ct);
3271
3208
  function ct(e, t) {
3272
3209
  var _this;
3273
3210
  _classCallCheck(this, ct);
3274
- _this = _super.call(this), _this.name = "StytchSDKUsageError", _this.message = "Invalid call to ".concat(e, "\n") + t;
3211
+ _this = _callSuper(this, ct), _this.name = "StytchSDKUsageError", _this.message = "Invalid call to ".concat(e, "\n") + t;
3275
3212
  return _this;
3276
3213
  }
3277
3214
  return _createClass(ct);
@@ -3994,7 +3931,7 @@ var vt = /*#__PURE__*/function () {
3994
3931
  },
3995
3932
  sdk: {
3996
3933
  identifier: "Stytch.js Javascript SDK",
3997
- version: "4.4.2"
3934
+ version: "4.4.4"
3998
3935
  }
3999
3936
  });
4000
3937
  }
@@ -4302,13 +4239,24 @@ var St = function e(t, r) {
4302
4239
  path: "/"
4303
4240
  });
4304
4241
  var Pt = function Pt(e) {
4305
- var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
4306
- return "stytch_sdk_state_".concat(e).concat(t ? "::".concat(t) : "");
4307
- };
4308
- var At = /*#__PURE__*/function () {
4309
- function At(e, t) {
4242
+ var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
4243
+ return "stytch_sdk_state_".concat(e).concat(t ? "::".concat(t) : "");
4244
+ },
4245
+ At = new Map(),
4246
+ Ct = function Ct(e) {
4247
+ clearTimeout(At.get(e));
4248
+ },
4249
+ Et = function Et(e, t, r) {
4250
+ Ct(e);
4251
+ var n = setTimeout(function () {
4252
+ void 0 === St.get(e) && St.set(e, t, r);
4253
+ }, 10);
4254
+ return At.set(e, n), St.set(e, t, r);
4255
+ };
4256
+ var Tt = /*#__PURE__*/function () {
4257
+ function Tt(e, t) {
4310
4258
  var _this4 = this;
4311
- _classCallCheck(this, At);
4259
+ _classCallCheck(this, Tt);
4312
4260
  this.browserSessionStorage = {
4313
4261
  getItem: function getItem(e) {
4314
4262
  return sessionStorage.getItem(Pt(_this4.publicToken, e));
@@ -4330,7 +4278,7 @@ var At = /*#__PURE__*/function () {
4330
4278
  }
4331
4279
  this.state = n;
4332
4280
  }
4333
- _createClass(At, [{
4281
+ _createClass(Tt, [{
4334
4282
  key: "opaqueTokenCookieName",
4335
4283
  get: function get() {
4336
4284
  var e;
@@ -4368,14 +4316,14 @@ var At = /*#__PURE__*/function () {
4368
4316
  var o = e.state,
4369
4317
  s = e.session_token,
4370
4318
  a = e.session_jwt,
4371
- c = At.generateCookieOpts({
4319
+ c = Tt.generateCookieOpts({
4372
4320
  expiresAt: null !== (r = null === (t = null == o ? void 0 : o.session) || void 0 === t ? void 0 : t.expires_at) && void 0 !== r ? r : "",
4373
4321
  availableToSubdomains: this._cookieAvailableToSubdomains,
4374
4322
  path: this._cookiePath,
4375
4323
  domain: this._domain
4376
4324
  });
4377
- St.set(this.opaqueTokenCookieName, s, c), St.set(this.jwtCookieName, a, c);
4378
- var u = At.generateCookieOpts({
4325
+ Et(this.opaqueTokenCookieName, s, c), Et(this.jwtCookieName, a, c);
4326
+ var u = Tt.generateCookieOpts({
4379
4327
  expiresAt: null !== (i = null === (n = null == o ? void 0 : o.session) || void 0 === n ? void 0 : n.expires_at) && void 0 !== i ? i : "",
4380
4328
  availableToSubdomains: !this._cookieAvailableToSubdomains,
4381
4329
  path: this._cookiePath,
@@ -4387,13 +4335,13 @@ var At = /*#__PURE__*/function () {
4387
4335
  key: "writeIntermediateSessionTokenCookie",
4388
4336
  value: function writeIntermediateSessionTokenCookie(e) {
4389
4337
  var t = new Date(Date.now() + 6e5),
4390
- r = At.generateCookieOpts({
4338
+ r = Tt.generateCookieOpts({
4391
4339
  expiresAt: t.toString(),
4392
4340
  availableToSubdomains: this._cookieAvailableToSubdomains,
4393
4341
  path: this._cookiePath,
4394
4342
  domain: this._domain
4395
4343
  });
4396
- St.set(this.istCookieName, e, r);
4344
+ Et(this.istCookieName, e, r);
4397
4345
  }
4398
4346
  }, {
4399
4347
  key: "removeSessionCookie",
@@ -4412,7 +4360,7 @@ var At = /*#__PURE__*/function () {
4412
4360
  [!0, !1].forEach(function (t) {
4413
4361
  [_this5._cookiePath, null].forEach(function (r) {
4414
4362
  [_this5._domain, null].forEach(function (n) {
4415
- var i = At.generateCookieOpts({
4363
+ var i = Tt.generateCookieOpts({
4416
4364
  expiresAt: new Date(0).toString(),
4417
4365
  availableToSubdomains: t,
4418
4366
  path: r,
@@ -4423,7 +4371,7 @@ var At = /*#__PURE__*/function () {
4423
4371
  });
4424
4372
  });
4425
4373
  });
4426
- });
4374
+ }), e.forEach(Ct);
4427
4375
  }
4428
4376
  }, {
4429
4377
  key: "syncToLocalStorage",
@@ -4468,31 +4416,30 @@ var At = /*#__PURE__*/function () {
4468
4416
  return e && (i.path = e), Boolean("localhost" === window.location.hostname || "[::1]" === window.location.hostname || window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)) ? i.secure = !1 : (r && (i.domain = t || window.location.host), i.secure = !0), i;
4469
4417
  }
4470
4418
  }]);
4471
- return At;
4419
+ return Tt;
4472
4420
  }();
4473
- var Ct = /*#__PURE__*/function (_At) {
4474
- _inherits(Ct, _At);
4475
- var _super2 = _createSuper(Ct);
4476
- function Ct() {
4477
- _classCallCheck(this, Ct);
4478
- return _super2.apply(this, arguments);
4421
+ var Ot = /*#__PURE__*/function (_Tt) {
4422
+ _inherits(Ot, _Tt);
4423
+ function Ot() {
4424
+ _classCallCheck(this, Ot);
4425
+ return _callSuper(this, Ot, arguments);
4479
4426
  }
4480
- return _createClass(Ct);
4481
- }(At);
4482
- var Et = Symbol["for"]("__stytch_b2b_DataLayer"),
4483
- Tt = function Tt(e, t) {
4427
+ return _createClass(Ot);
4428
+ }(Tt);
4429
+ var xt = Symbol["for"]("__stytch_b2b_DataLayer"),
4430
+ Dt = function Dt(e, t) {
4484
4431
  var r = function () {
4485
4432
  var e = window;
4486
- return e[Et] || (e[Et] = {}), e[Et];
4433
+ return e[xt] || (e[xt] = {}), e[xt];
4487
4434
  }();
4488
- return r[e] || (r[e] = new Ct(e, t)), r[e];
4435
+ return r[e] || (r[e] = new Ot(e, t)), r[e];
4489
4436
  },
4490
- Ot = function Ot(e, t) {
4437
+ It = function It(e, t) {
4491
4438
  Object.values(e).forEach(function (e) {
4492
4439
  return e(t);
4493
4440
  });
4494
4441
  },
4495
- xt = function () {
4442
+ Bt = function () {
4496
4443
  var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).KEYS_TO_EXCLUDE,
4497
4444
  t = void 0 === e ? [] : e;
4498
4445
  return function e(r, n) {
@@ -4511,10 +4458,10 @@ var Et = Symbol["for"]("__stytch_b2b_DataLayer"),
4511
4458
  }({
4512
4459
  KEYS_TO_EXCLUDE: ["last_accessed_at"]
4513
4460
  });
4514
- var Dt = /*#__PURE__*/function () {
4515
- function Dt(e, t) {
4461
+ var Rt = /*#__PURE__*/function () {
4462
+ function Rt(e, t) {
4516
4463
  var _this7 = this;
4517
- _classCallCheck(this, Dt);
4464
+ _classCallCheck(this, Rt);
4518
4465
  this._publicToken = e, this._datalayer = t, this._listen = function (e) {
4519
4466
  if (e.key !== Pt(_this7._publicToken)) return;
4520
4467
  var t = null === e.newValue || "null" === e.newValue ? null : JSON.parse(e.newValue);
@@ -4524,7 +4471,7 @@ var Dt = /*#__PURE__*/function () {
4524
4471
  r = _this$_datalayer$read.session_token;
4525
4472
  r || this.destroySession();
4526
4473
  }
4527
- _createClass(Dt, [{
4474
+ _createClass(Rt, [{
4528
4475
  key: "getTokens",
4529
4476
  value: function getTokens() {
4530
4477
  var _this$_datalayer$read2 = this._datalayer.readSessionCookie(),
@@ -4562,7 +4509,7 @@ var Dt = /*#__PURE__*/function () {
4562
4509
  r = null === e.state ? null : Object.assign(Object.assign({}, this._datalayer.state), e.state);
4563
4510
  this._datalayer.state = r;
4564
4511
  var n = e.state ? Object.keys(e.state) : [];
4565
- !this._datalayer.markStateKeysUpdated(n) && xt(t, r) || Ot(this._datalayer.subscriptions, r);
4512
+ !this._datalayer.markStateKeysUpdated(n) && Bt(t, r) || It(this._datalayer.subscriptions, r);
4566
4513
  }
4567
4514
  }, {
4568
4515
  key: "updateStateAndTokens",
@@ -4577,8 +4524,8 @@ var Dt = /*#__PURE__*/function () {
4577
4524
  this._datalayer.state = r;
4578
4525
  var n = e ? Object.keys(e) : [],
4579
4526
  i = this._datalayer.markStateKeysUpdated(n),
4580
- o = !xt(t, r);
4581
- (i || o) && (Ot(this._datalayer.subscriptions, r), o && this._datalayer.syncToLocalStorage());
4527
+ o = !Bt(t, r);
4528
+ (i || o) && (It(this._datalayer.subscriptions, r), o && this._datalayer.syncToLocalStorage());
4582
4529
  }
4583
4530
  }, {
4584
4531
  key: "updateTokens",
@@ -4618,15 +4565,14 @@ var Dt = /*#__PURE__*/function () {
4618
4565
  return null;
4619
4566
  }
4620
4567
  }]);
4621
- return Dt;
4568
+ return Rt;
4622
4569
  }();
4623
- var It = /*#__PURE__*/function (_Dt) {
4624
- _inherits(It, _Dt);
4625
- var _super3 = _createSuper(It);
4626
- function It() {
4570
+ var Lt = /*#__PURE__*/function (_Rt) {
4571
+ _inherits(Lt, _Rt);
4572
+ function Lt() {
4627
4573
  var _this8;
4628
- _classCallCheck(this, It);
4629
- _this8 = _super3.apply(this, arguments), _this8.updateMember = function (e) {
4574
+ _classCallCheck(this, Lt);
4575
+ _this8 = _callSuper(this, Lt, arguments), _this8.updateMember = function (e) {
4630
4576
  return _this8.updateState({
4631
4577
  member: e
4632
4578
  });
@@ -4646,9 +4592,9 @@ var It = /*#__PURE__*/function (_Dt) {
4646
4592
  };
4647
4593
  return _this8;
4648
4594
  }
4649
- return _createClass(It);
4650
- }(Dt);
4651
- var Bt = Symbol["for"]("stytch__internal_b2b");
4595
+ return _createClass(Lt);
4596
+ }(Rt);
4597
+ var Mt = Symbol["for"]("stytch__internal_b2b");
4652
4598
  exports.BiometricsFailedError = U, exports.BiometricsUnavailableError = A, exports.ChallengeSigningFailedError = F, exports.DeviceCredentialsNotAllowedError = D, exports.FailedCodeChallengeError = K, exports.FailedToDecryptDataError = z, exports.InternalError = S, exports.InvalidAuthorizationCredentialError = L, exports.InvalidCredentialTypeError = H, exports.InvalidRedirectSchemeError = W, exports.InvalidStartUrlError = q, exports.JSONDataNotConvertibleToStringError = V, exports.KeyInvalidatedError = C, exports.KeystoreUnavailableError = E, exports.MissingAttestationObjectError = Y, exports.MissingAuthorizationCredentialIDTokenError = R, exports.MissingGoogleClientIDError = I, exports.MissingPKCEError = B, exports.MissingPublicKeyError = M, exports.MissingUrlError = G, exports.NoBiometricsEnrolledError = T, exports.NoBiometricsRegistrationError = P, exports.NoCurrentSessionError = w, exports.PasskeysInvalidEncoding = $, exports.PasskeysUnsupportedError = N, exports.RandomNumberGenerationFailed = J, exports.SDKAPIUnreachableError = h, exports.SDKNotConfiguredError = j, exports.StytchAPIError = y, exports.StytchAPISchemaError = g, exports.StytchAPIUnreachableError = b, exports.StytchB2BHeadlessClient = /*#__PURE__*/function () {
4653
4599
  function _class(e, t) {
4654
4600
  var _this9 = this;
@@ -4669,7 +4615,7 @@ exports.BiometricsFailedError = U, exports.BiometricsUnavailableError = A, expor
4669
4615
  }
4670
4616
  };
4671
4617
  var o, s, a, c, u, l, d, h, p, _, f;
4672
- this._dataLayer = Tt(e, n), this._subscriptionService = new It(e, this._dataLayer);
4618
+ this._dataLayer = Dt(e, n), this._subscriptionService = new Lt(e, this._dataLayer);
4673
4619
  var m = new gt(this._dataLayer, "passwords");
4674
4620
  this._networkClient = new vt(e, this._dataLayer, i.endpoints.sdkBackendURL, function () {
4675
4621
  var e, t, r, n;
@@ -4700,7 +4646,7 @@ exports.BiometricsFailedError = U, exports.BiometricsUnavailableError = A, expor
4700
4646
  }
4701
4647
  });
4702
4648
  (function (e, t) {
4703
- Object.assign(e, _defineProperty({}, Bt, t));
4649
+ Object.assign(e, _defineProperty({}, Mt, t));
4704
4650
  })(this, {
4705
4651
  bootstrap: v,
4706
4652
  publicToken: e,