@stytch/vanilla-js 3.0.3 → 3.1.1

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.
@@ -191,17 +191,17 @@ function s() {
191
191
  return this;
192
192
  });
193
193
  var S = Object.getPrototypeOf,
194
- T = S && S(S(B([])));
195
- T && T !== r && n.call(T, c) && (w = T);
196
- var O = k.prototype = g.prototype = Object.create(w);
197
- function C(e) {
194
+ A = S && S(S(I([])));
195
+ A && A !== r && n.call(A, c) && (w = A);
196
+ var T = k.prototype = g.prototype = Object.create(w);
197
+ function O(e) {
198
198
  ["next", "throw", "return"].forEach(function (t) {
199
199
  d(e, t, function (e) {
200
200
  return this._invoke(t, e);
201
201
  });
202
202
  });
203
203
  }
204
- function A(e, t) {
204
+ function C(e, t) {
205
205
  function r(s, o, a, c) {
206
206
  var u = p(e[s], e, o);
207
207
  if ("throw" !== u.type) {
@@ -292,7 +292,7 @@ function s() {
292
292
  tryLoc: "root"
293
293
  }], e.forEach(x, this), this.reset(!0);
294
294
  }
295
- function B(t) {
295
+ function I(t) {
296
296
  if (t || "" === t) {
297
297
  var r = t[c];
298
298
  if (r) return r.call(t);
@@ -308,7 +308,7 @@ function s() {
308
308
  }
309
309
  throw new TypeError(i(t) + " is not iterable");
310
310
  }
311
- return b.prototype = k, o(O, "constructor", {
311
+ return b.prototype = k, o(T, "constructor", {
312
312
  value: k,
313
313
  configurable: !0
314
314
  }), o(k, "constructor", {
@@ -318,22 +318,22 @@ function s() {
318
318
  var t = "function" == typeof e && e.constructor;
319
319
  return !!t && (t === b || "GeneratorFunction" === (t.displayName || t.name));
320
320
  }, t.mark = function (e) {
321
- return Object.setPrototypeOf ? Object.setPrototypeOf(e, k) : (e.__proto__ = k, d(e, l, "GeneratorFunction")), e.prototype = Object.create(O), e;
321
+ return Object.setPrototypeOf ? Object.setPrototypeOf(e, k) : (e.__proto__ = k, d(e, l, "GeneratorFunction")), e.prototype = Object.create(T), e;
322
322
  }, t.awrap = function (e) {
323
323
  return {
324
324
  __await: e
325
325
  };
326
- }, C(A.prototype), d(A.prototype, u, function () {
326
+ }, O(C.prototype), d(C.prototype, u, function () {
327
327
  return this;
328
- }), t.AsyncIterator = A, t.async = function (e, r, n, i, s) {
328
+ }), t.AsyncIterator = C, t.async = function (e, r, n, i, s) {
329
329
  void 0 === s && (s = Promise);
330
- var o = new A(h(e, r, n, i), s);
330
+ var o = new C(h(e, r, n, i), s);
331
331
  return t.isGeneratorFunction(r) ? o : o.next().then(function (e) {
332
332
  return e.done ? e.value : o.next();
333
333
  });
334
- }, C(O), d(O, l, "Generator"), d(O, c, function () {
334
+ }, O(T), d(T, l, "Generator"), d(T, c, function () {
335
335
  return this;
336
- }), d(O, "toString", function () {
336
+ }), d(T, "toString", function () {
337
337
  return "[object Generator]";
338
338
  }), t.keys = function (e) {
339
339
  var t = Object(e),
@@ -346,7 +346,7 @@ function s() {
346
346
  }
347
347
  return e.done = !0, e;
348
348
  };
349
- }, t.values = B, D.prototype = {
349
+ }, t.values = I, D.prototype = {
350
350
  constructor: D,
351
351
  reset: function reset(t) {
352
352
  if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, this.method = "next", this.arg = e, this.tryEntries.forEach(R), !t) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = e);
@@ -420,7 +420,7 @@ function s() {
420
420
  },
421
421
  delegateYield: function delegateYield(t, r, n) {
422
422
  return this.delegate = {
423
- iterator: B(t),
423
+ iterator: I(t),
424
424
  resultName: r,
425
425
  nextLoc: n
426
426
  }, "next" === this.method && (this.arg = e), y;
@@ -544,8 +544,8 @@ var v,
544
544
  k,
545
545
  w,
546
546
  S = "https://accounts.google.com/gsi",
547
- T = "".concat(S, "/client");
548
- function O(e, t) {
547
+ A = "".concat(S, "/client");
548
+ function T(e, t) {
549
549
  var r = {};
550
550
  for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
551
551
  if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
@@ -554,7 +554,7 @@ function O(e, t) {
554
554
  }
555
555
  return r;
556
556
  }
557
- function C(e, t, r, n) {
557
+ function O(e, t, r, n) {
558
558
  return new (r || (r = Promise))(function (i, s) {
559
559
  function o(e) {
560
560
  try {
@@ -580,7 +580,7 @@ function C(e, t, r, n) {
580
580
  });
581
581
  }
582
582
  "function" == typeof SuppressedError && SuppressedError, function (e) {
583
- e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords";
583
+ e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords", e.passkeys = "passkeys";
584
584
  }(v || (v = {})), function (e) {
585
585
  e.Google = "google", e.Microsoft = "microsoft", e.Apple = "apple", e.Github = "github", e.GitLab = "gitlab", e.Facebook = "facebook", e.Discord = "discord", e.Salesforce = "salesforce", e.Slack = "slack", e.Amazon = "amazon", e.Bitbucket = "bitbucket", e.LinkedIn = "linkedin", e.Coinbase = "coinbase", e.Twitch = "twitch", e.Twitter = "twitter", e.TikTok = "tiktok", e.Snapchat = "snapchat", e.Figma = "figma", e.Yahoo = "yahoo";
586
586
  }(y || (y = {})), function (e) {
@@ -590,9 +590,9 @@ function C(e, t, r, n) {
590
590
  }(b || (b = {})), function (e) {
591
591
  e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
592
592
  }(k || (k = {})), function (e) {
593
- 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.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_SSO_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";
593
+ 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_SSO_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";
594
594
  }(w || (w = {}));
595
- var A,
595
+ var C,
596
596
  E,
597
597
  P,
598
598
  x,
@@ -606,7 +606,7 @@ var A,
606
606
  }
607
607
  return a(r);
608
608
  }(),
609
- B = function (e) {
609
+ I = function (e) {
610
610
  u(r, h(Error));
611
611
  var t = l(r);
612
612
  function r(e, n) {
@@ -615,7 +615,7 @@ var A,
615
615
  }
616
616
  return a(r);
617
617
  }(),
618
- I = function (e) {
618
+ B = function (e) {
619
619
  u(r, h(Error));
620
620
  var t = l(r);
621
621
  function r(e) {
@@ -646,7 +646,7 @@ var A,
646
646
  F = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"];
647
647
  !function (e) {
648
648
  e.BiometricsSensorError = "biometrics_sensor_error", e.DeviceCredentialsNotAllowed = "device_credentials_not_allowed", e.DeviceHardwareError = "device_hardware_error", e.InternalError = "internal_error", e.KeyInvalidated = "key_invalidated", e.KeystoreUnavailable = "keystore_unavailable", e.NoBiometricsEnrolled = "no_biometrics_enrolled", e.NoBiometricsRegistration = "no_biometrics_registration", e.SessionExpired = "session_expired", e.UserCancellation = "user_cancellation", e.UserLockedOut = "user_locked_out", e.BiometricsNotAvailable = "biometrics_not_available";
649
- }(A || (A = {})), function (e) {
649
+ }(C || (C = {})), function (e) {
650
650
  e.emailMagicLinks = "emailMagicLinks", e.sso = "sso", e.passwords = "passwords", e.oauth = "oauth";
651
651
  }(E || (E = {})), function (e) {
652
652
  e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
@@ -673,7 +673,7 @@ function N(e) {
673
673
  o = e.xSDKClientHeader,
674
674
  a = e.xSDKParentHostHeader,
675
675
  c = e.body;
676
- return C(this, void 0, void 0, s().mark(function e() {
676
+ return O(this, void 0, void 0, s().mark(function e() {
677
677
  var u, l, d, h, p, f;
678
678
  return s().wrap(function (e) {
679
679
  for (;;) switch (e.prev = e.next) {
@@ -733,7 +733,7 @@ function N(e) {
733
733
  e.next = 39;
734
734
  break;
735
735
  }
736
- throw new I(p);
736
+ throw new B(p);
737
737
  case 39:
738
738
  throw new L(p);
739
739
  case 40:
@@ -749,10 +749,10 @@ function N(e) {
749
749
  }, e, null, [[3, 9], [15, 21], [28, 34], [40, 47]]);
750
750
  }));
751
751
  }
752
- var U = new Uint8Array(16);
753
- function K() {
752
+ var K = new Uint8Array(16);
753
+ function U() {
754
754
  if (!j && !(j = "undefined" != typeof crypto && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || "undefined" != typeof msCrypto && "function" == typeof msCrypto.getRandomValues && msCrypto.getRandomValues.bind(msCrypto))) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
755
- return j(U);
755
+ return j(K);
756
756
  }
757
757
  var W = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
758
758
  for (var q = [], G = 0; G < 256; ++G) q.push((G + 256).toString(16).substr(1));
@@ -764,8 +764,8 @@ function H(e) {
764
764
  }(r)) throw TypeError("Stringified UUID is invalid");
765
765
  return r;
766
766
  }
767
- function z(e, t, r) {
768
- var n = (e = e || {}).random || (e.rng || K)();
767
+ function Y(e, t, r) {
768
+ var n = (e = e || {}).random || (e.rng || U)();
769
769
  if (n[6] = 15 & n[6] | 64, n[8] = 63 & n[8] | 128, t) {
770
770
  r = r || 0;
771
771
  for (var i = 0; i < 16; ++i) t[r + i] = n[i];
@@ -773,19 +773,19 @@ function z(e, t, r) {
773
773
  }
774
774
  return H(n);
775
775
  }
776
- var Y = {};
776
+ var z = {};
777
777
  function V(e, t) {
778
- return C(this, void 0, void 0, s().mark(function r() {
778
+ return O(this, void 0, void 0, s().mark(function r() {
779
779
  return s().wrap(function (r) {
780
780
  for (;;) switch (r.prev = r.next) {
781
781
  case 0:
782
- if (void 0 === Y[e]) {
782
+ if (void 0 === z[e]) {
783
783
  r.next = 2;
784
784
  break;
785
785
  }
786
- return r.abrupt("return", Y[e]);
786
+ return r.abrupt("return", z[e]);
787
787
  case 2:
788
- return Y[e] = J(e, t), r.abrupt("return", Y[e]);
788
+ return z[e] = J(e, t), r.abrupt("return", z[e]);
789
789
  case 4:
790
790
  case "end":
791
791
  return r.stop();
@@ -838,26 +838,26 @@ var X,
838
838
  var r = {
839
839
  isObject: function isObject(e, n) {
840
840
  var s = "object" === i(n) && !Array.isArray(n) && null !== n;
841
- if (!s) throw new B(t, e + " must be an object.");
841
+ if (!s) throw new I(t, e + " must be an object.");
842
842
  return r;
843
843
  },
844
844
  isOptionalObject: function isOptionalObject(e, t) {
845
845
  return void 0 === t ? r : r.isObject(e, t);
846
846
  },
847
847
  isString: function isString(e, n) {
848
- if ("string" != typeof n) throw new B(t, e + " must be a string.");
848
+ if ("string" != typeof n) throw new I(t, e + " must be a string.");
849
849
  return r;
850
850
  },
851
851
  isOptionalString: function isOptionalString(e, t) {
852
852
  return void 0 === t ? r : r.isString(e, t);
853
853
  },
854
854
  isStringArray: function isStringArray(n, i) {
855
- if (!Array.isArray(i)) throw new B(t, n + " must be an array of strings.");
855
+ if (!Array.isArray(i)) throw new I(t, n + " must be an array of strings.");
856
856
  var s,
857
857
  o = e(i);
858
858
  try {
859
859
  for (o.s(); !(s = o.n()).done;) {
860
- if ("string" != typeof s.value) throw new B(t, n + " must be an array of strings.");
860
+ if ("string" != typeof s.value) throw new I(t, n + " must be an array of strings.");
861
861
  }
862
862
  } catch (e) {
863
863
  o.e(e);
@@ -870,14 +870,14 @@ var X,
870
870
  return void 0 === t ? r : r.isStringArray(e, t);
871
871
  },
872
872
  isNumber: function isNumber(e, n) {
873
- if ("number" != typeof n) throw new B(t, e + " must be a number.");
873
+ if ("number" != typeof n) throw new I(t, e + " must be a number.");
874
874
  return r;
875
875
  },
876
876
  isOptionalNumber: function isOptionalNumber(e, t) {
877
877
  return void 0 === t ? r : r.isNumber(e, t);
878
878
  },
879
879
  isBoolean: function isBoolean(e, n) {
880
- if ("boolean" != typeof n) throw new B(t, e + " must be a boolean.");
880
+ if ("boolean" != typeof n) throw new I(t, e + " must be a boolean.");
881
881
  return r;
882
882
  },
883
883
  isOptionalBoolean: function isOptionalBoolean(e, t) {
@@ -887,10 +887,10 @@ var X,
887
887
  return r;
888
888
  },
889
889
  ne = function ne(e) {
890
- return O(e, ["request_id", "status_code"]);
890
+ return T(e, ["request_id", "status_code"]);
891
891
  },
892
892
  ie = function ie(e) {
893
- return O(e, ["__user"]);
893
+ return T(e, ["__user"]);
894
894
  },
895
895
  se = a(function e(t, r, n) {
896
896
  var i = this,
@@ -898,7 +898,7 @@ var X,
898
898
  return Promise.resolve(void 0);
899
899
  };
900
900
  c(this, e), this.bootstrapPromise = n, this.isEnabled = function () {
901
- return C(i, void 0, void 0, s().mark(function e() {
901
+ return O(i, void 0, void 0, s().mark(function e() {
902
902
  return s().wrap(function (e) {
903
903
  for (;;) switch (e.prev = e.next) {
904
904
  case 0:
@@ -912,7 +912,7 @@ var X,
912
912
  }, e, this);
913
913
  }));
914
914
  }, this.getTelemetryID = function () {
915
- return C(i, void 0, void 0, s().mark(function e() {
915
+ return O(i, void 0, void 0, s().mark(function e() {
916
916
  var t, r, n, i;
917
917
  return s().wrap(function (e) {
918
918
  for (;;) switch (e.prev = e.next) {
@@ -935,7 +935,7 @@ var X,
935
935
  }, e, this);
936
936
  }));
937
937
  }, this.getDFPTelemetryIDAndCaptcha = function () {
938
- return C(i, void 0, void 0, s().mark(function e() {
938
+ return O(i, void 0, void 0, s().mark(function e() {
939
939
  var t, r, n, i, o, a;
940
940
  return s().wrap(function (e) {
941
941
  for (;;) switch (e.prev = e.next) {
@@ -980,7 +980,7 @@ var X,
980
980
  }, e, this);
981
981
  }));
982
982
  }, this.retryWithCaptchaAndDFP = function (e, t) {
983
- return C(i, void 0, void 0, s().mark(function r() {
983
+ return O(i, void 0, void 0, s().mark(function r() {
984
984
  var n, i, o;
985
985
  return s().wrap(function (r) {
986
986
  for (;;) switch (r.prev = r.next) {
@@ -1011,7 +1011,7 @@ var X,
1011
1011
  }, r, this);
1012
1012
  }));
1013
1013
  }, this.state = n.then(function (e) {
1014
- return C(i, void 0, void 0, s().mark(function n() {
1014
+ return O(i, void 0, void 0, s().mark(function n() {
1015
1015
  return s().wrap(function (n) {
1016
1016
  for (;;) switch (n.prev = n.next) {
1017
1017
  case 0:
@@ -1050,7 +1050,7 @@ var X,
1050
1050
  oe = function oe() {
1051
1051
  return {
1052
1052
  isEnabled: function isEnabled() {
1053
- return C(void 0, void 0, void 0, s().mark(function e() {
1053
+ return O(void 0, void 0, void 0, s().mark(function e() {
1054
1054
  return s().wrap(function (e) {
1055
1055
  for (;;) switch (e.prev = e.next) {
1056
1056
  case 0:
@@ -1063,7 +1063,7 @@ var X,
1063
1063
  }));
1064
1064
  },
1065
1065
  getTelemetryID: function getTelemetryID() {
1066
- return C(void 0, void 0, void 0, s().mark(function e() {
1066
+ return O(void 0, void 0, void 0, s().mark(function e() {
1067
1067
  return s().wrap(function (e) {
1068
1068
  for (;;) switch (e.prev = e.next) {
1069
1069
  case 0:
@@ -1076,7 +1076,7 @@ var X,
1076
1076
  }));
1077
1077
  },
1078
1078
  getDFPTelemetryIDAndCaptcha: function getDFPTelemetryIDAndCaptcha() {
1079
- return C(void 0, void 0, void 0, s().mark(function e() {
1079
+ return O(void 0, void 0, void 0, s().mark(function e() {
1080
1080
  return s().wrap(function (e) {
1081
1081
  for (;;) switch (e.prev = e.next) {
1082
1082
  case 0:
@@ -1092,7 +1092,7 @@ var X,
1092
1092
  }));
1093
1093
  },
1094
1094
  retryWithCaptchaAndDFP: function retryWithCaptchaAndDFP() {
1095
- return C(void 0, void 0, void 0, s().mark(function e() {
1095
+ return O(void 0, void 0, void 0, s().mark(function e() {
1096
1096
  return s().wrap(function (e) {
1097
1097
  for (;;) switch (e.prev = e.next) {
1098
1098
  case 0:
@@ -1132,7 +1132,7 @@ var X,
1132
1132
  case "SDKAPIUnreachableError":
1133
1133
  return e.inflate(D, t);
1134
1134
  case "StytchSDKSchemaError":
1135
- return e.inflate(I, t);
1135
+ return e.inflate(B, t);
1136
1136
  case "StytchSDKAPIError":
1137
1137
  return e.inflate(L, t);
1138
1138
  case "TypeError":
@@ -1167,7 +1167,7 @@ var X,
1167
1167
  }, {
1168
1168
  key: "flush",
1169
1169
  value: function value() {
1170
- return C(this, void 0, void 0, s().mark(function e() {
1170
+ return O(this, void 0, void 0, s().mark(function e() {
1171
1171
  var t;
1172
1172
  return s().wrap(function (e) {
1173
1173
  for (;;) switch (e.prev = e.next) {
@@ -1205,7 +1205,7 @@ var X,
1205
1205
  var ue = a(function e(t, r) {
1206
1206
  var n = this;
1207
1207
  c(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
1208
- return C(n, void 0, void 0, s().mark(function e() {
1208
+ return O(n, void 0, void 0, s().mark(function e() {
1209
1209
  var t, r;
1210
1210
  return s().wrap(function (e) {
1211
1211
  for (;;) switch (e.prev = e.next) {
@@ -1226,7 +1226,7 @@ var ue = a(function e(t, r) {
1226
1226
  }, this.getSync = function () {
1227
1227
  return n._subscriptionService.getUser();
1228
1228
  }, this.update = function (e) {
1229
- return C(n, void 0, void 0, s().mark(function t() {
1229
+ return O(n, void 0, void 0, s().mark(function t() {
1230
1230
  var r, n;
1231
1231
  return s().wrap(function (t) {
1232
1232
  for (;;) switch (t.prev = t.next) {
@@ -1246,7 +1246,7 @@ var ue = a(function e(t, r) {
1246
1246
  }, t, this);
1247
1247
  }));
1248
1248
  }, this.deleteEmail = function (e) {
1249
- return C(n, void 0, void 0, s().mark(function t() {
1249
+ return O(n, void 0, void 0, s().mark(function t() {
1250
1250
  var r, n;
1251
1251
  return s().wrap(function (t) {
1252
1252
  for (;;) switch (t.prev = t.next) {
@@ -1265,7 +1265,7 @@ var ue = a(function e(t, r) {
1265
1265
  }, t, this);
1266
1266
  }));
1267
1267
  }, this.deletePhoneNumber = function (e) {
1268
- return C(n, void 0, void 0, s().mark(function t() {
1268
+ return O(n, void 0, void 0, s().mark(function t() {
1269
1269
  var r, n;
1270
1270
  return s().wrap(function (t) {
1271
1271
  for (;;) switch (t.prev = t.next) {
@@ -1284,7 +1284,7 @@ var ue = a(function e(t, r) {
1284
1284
  }, t, this);
1285
1285
  }));
1286
1286
  }, this.deleteTOTP = function (e) {
1287
- return C(n, void 0, void 0, s().mark(function t() {
1287
+ return O(n, void 0, void 0, s().mark(function t() {
1288
1288
  var r, n;
1289
1289
  return s().wrap(function (t) {
1290
1290
  for (;;) switch (t.prev = t.next) {
@@ -1303,7 +1303,7 @@ var ue = a(function e(t, r) {
1303
1303
  }, t, this);
1304
1304
  }));
1305
1305
  }, this.deleteOAuthRegistration = function (e) {
1306
- return C(n, void 0, void 0, s().mark(function t() {
1306
+ return O(n, void 0, void 0, s().mark(function t() {
1307
1307
  var r, n;
1308
1308
  return s().wrap(function (t) {
1309
1309
  for (;;) switch (t.prev = t.next) {
@@ -1322,7 +1322,7 @@ var ue = a(function e(t, r) {
1322
1322
  }, t, this);
1323
1323
  }));
1324
1324
  }, this.deleteWebauthnRegistration = function (e) {
1325
- return C(n, void 0, void 0, s().mark(function t() {
1325
+ return O(n, void 0, void 0, s().mark(function t() {
1326
1326
  var r, n;
1327
1327
  return s().wrap(function (t) {
1328
1328
  for (;;) switch (t.prev = t.next) {
@@ -1341,7 +1341,7 @@ var ue = a(function e(t, r) {
1341
1341
  }, t, this);
1342
1342
  }));
1343
1343
  }, this.deleteBiometricRegistration = function (e) {
1344
- return C(n, void 0, void 0, s().mark(function t() {
1344
+ return O(n, void 0, void 0, s().mark(function t() {
1345
1345
  var r, n;
1346
1346
  return s().wrap(function (t) {
1347
1347
  for (;;) switch (t.prev = t.next) {
@@ -1379,7 +1379,7 @@ var ue = a(function e(t, r) {
1379
1379
  (null == r ? void 0 : r.session) !== t && (t = null !== (n = null == r ? void 0 : r.session) && void 0 !== n ? n : null, e(t));
1380
1380
  });
1381
1381
  }, this.revoke = function (e) {
1382
- return C(n, void 0, void 0, s().mark(function t() {
1382
+ return O(n, void 0, void 0, s().mark(function t() {
1383
1383
  var r;
1384
1384
  return s().wrap(function (t) {
1385
1385
  for (;;) switch (t.prev = t.next) {
@@ -1400,7 +1400,7 @@ var ue = a(function e(t, r) {
1400
1400
  }, t, this, [[0, 8]]);
1401
1401
  }));
1402
1402
  }, this.authenticate = function (e) {
1403
- return C(n, void 0, void 0, s().mark(function t() {
1403
+ return O(n, void 0, void 0, s().mark(function t() {
1404
1404
  var r, n;
1405
1405
  return s().wrap(function (t) {
1406
1406
  for (;;) switch (t.prev = t.next) {
@@ -1456,7 +1456,7 @@ var ue = a(function e(t, r) {
1456
1456
  c(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._passwordResetPKCEManager = i, this._config = a, this.dfpProtectedAuth = u, this.email = {
1457
1457
  loginOrCreate: function loginOrCreate(e) {
1458
1458
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
1459
- return C(o, void 0, void 0, s().mark(function r() {
1459
+ return O(o, void 0, void 0, s().mark(function r() {
1460
1460
  var n, i, o, a, c, u, l;
1461
1461
  return s().wrap(function (r) {
1462
1462
  for (;;) switch (r.prev = r.next) {
@@ -1494,7 +1494,7 @@ var ue = a(function e(t, r) {
1494
1494
  },
1495
1495
  send: function send(e) {
1496
1496
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
1497
- return C(o, void 0, void 0, s().mark(function r() {
1497
+ return O(o, void 0, void 0, s().mark(function r() {
1498
1498
  var n, i, o, a, c, u, l, d, h;
1499
1499
  return s().wrap(function (r) {
1500
1500
  for (;;) switch (r.prev = r.next) {
@@ -1531,7 +1531,7 @@ var ue = a(function e(t, r) {
1531
1531
  }));
1532
1532
  }
1533
1533
  }, this.authenticate = function (e, t) {
1534
- return C(o, void 0, void 0, s().mark(function r() {
1534
+ return O(o, void 0, void 0, s().mark(function r() {
1535
1535
  var n, i;
1536
1536
  return s().wrap(function (r) {
1537
1537
  for (;;) switch (r.prev = r.next) {
@@ -1588,7 +1588,7 @@ var ue = a(function e(t, r) {
1588
1588
  return a(e, [{
1589
1589
  key: "getCodeChallenge",
1590
1590
  value: function value() {
1591
- return C(this, void 0, void 0, s().mark(function e() {
1591
+ return O(this, void 0, void 0, s().mark(function e() {
1592
1592
  var t;
1593
1593
  return s().wrap(function (e) {
1594
1594
  for (;;) switch (e.prev = e.next) {
@@ -1614,7 +1614,7 @@ var ue = a(function e(t, r) {
1614
1614
  }, {
1615
1615
  key: "handlePKCEForAuthenticate",
1616
1616
  value: function value(e, t) {
1617
- return C(this, void 0, void 0, s().mark(function r() {
1617
+ return O(this, void 0, void 0, s().mark(function r() {
1618
1618
  var n, i, o;
1619
1619
  return s().wrap(function (r) {
1620
1620
  for (;;) switch (r.prev = r.next) {
@@ -1648,7 +1648,7 @@ var ue = a(function e(t, r) {
1648
1648
  o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : oe();
1649
1649
  c(this, e), this._networkClient = t, this._subscriptionService = r, this.executeRecaptcha = i, this.dfpProtectedAuth = o, this.sms = {
1650
1650
  loginOrCreate: function loginOrCreate(e, t) {
1651
- return C(n, void 0, void 0, s().mark(function r() {
1651
+ return O(n, void 0, void 0, s().mark(function r() {
1652
1652
  var n, i, o, a;
1653
1653
  return s().wrap(function (r) {
1654
1654
  for (;;) switch (r.prev = r.next) {
@@ -1674,7 +1674,7 @@ var ue = a(function e(t, r) {
1674
1674
  }));
1675
1675
  },
1676
1676
  send: function send(e, t) {
1677
- return C(n, void 0, void 0, s().mark(function r() {
1677
+ return O(n, void 0, void 0, s().mark(function r() {
1678
1678
  var n, i, o, a, c, u;
1679
1679
  return s().wrap(function (r) {
1680
1680
  for (;;) switch (r.prev = r.next) {
@@ -1701,7 +1701,7 @@ var ue = a(function e(t, r) {
1701
1701
  }
1702
1702
  }, this.whatsapp = {
1703
1703
  loginOrCreate: function loginOrCreate(e, t) {
1704
- return C(n, void 0, void 0, s().mark(function r() {
1704
+ return O(n, void 0, void 0, s().mark(function r() {
1705
1705
  var n, i, o, a;
1706
1706
  return s().wrap(function (r) {
1707
1707
  for (;;) switch (r.prev = r.next) {
@@ -1727,7 +1727,7 @@ var ue = a(function e(t, r) {
1727
1727
  }));
1728
1728
  },
1729
1729
  send: function send(e, t) {
1730
- return C(n, void 0, void 0, s().mark(function r() {
1730
+ return O(n, void 0, void 0, s().mark(function r() {
1731
1731
  var n, i, o, a, c, u;
1732
1732
  return s().wrap(function (r) {
1733
1733
  for (;;) switch (r.prev = r.next) {
@@ -1754,7 +1754,7 @@ var ue = a(function e(t, r) {
1754
1754
  }
1755
1755
  }, this.email = {
1756
1756
  loginOrCreate: function loginOrCreate(e, t) {
1757
- return C(n, void 0, void 0, s().mark(function r() {
1757
+ return O(n, void 0, void 0, s().mark(function r() {
1758
1758
  var n, i;
1759
1759
  return s().wrap(function (r) {
1760
1760
  for (;;) switch (r.prev = r.next) {
@@ -1778,7 +1778,7 @@ var ue = a(function e(t, r) {
1778
1778
  }));
1779
1779
  },
1780
1780
  send: function send(e, t) {
1781
- return C(n, void 0, void 0, s().mark(function r() {
1781
+ return O(n, void 0, void 0, s().mark(function r() {
1782
1782
  var n, i, o, a;
1783
1783
  return s().wrap(function (r) {
1784
1784
  for (;;) switch (r.prev = r.next) {
@@ -1802,7 +1802,7 @@ var ue = a(function e(t, r) {
1802
1802
  }));
1803
1803
  }
1804
1804
  }, this.authenticate = function (e, t, r) {
1805
- return C(n, void 0, void 0, s().mark(function n() {
1805
+ return O(n, void 0, void 0, s().mark(function n() {
1806
1806
  var i, o, a, c, u;
1807
1807
  return s().wrap(function (n) {
1808
1808
  for (;;) switch (n.prev = n.next) {
@@ -1884,7 +1884,7 @@ var ue = a(function e(t, r) {
1884
1884
  return a(e, [{
1885
1885
  key: "authenticate",
1886
1886
  value: function value(e, t) {
1887
- return C(this, void 0, void 0, s().mark(function r() {
1887
+ return O(this, void 0, void 0, s().mark(function r() {
1888
1888
  var n, i;
1889
1889
  return s().wrap(function (r) {
1890
1890
  for (;;) switch (r.prev = r.next) {
@@ -1920,7 +1920,7 @@ var ue = a(function e(t, r) {
1920
1920
  }, {
1921
1921
  key: "getBaseApiUrl",
1922
1922
  value: function value() {
1923
- return C(this, void 0, void 0, s().mark(function e() {
1923
+ return O(this, void 0, void 0, s().mark(function e() {
1924
1924
  var t, r;
1925
1925
  return s().wrap(function (e) {
1926
1926
  for (;;) switch (e.prev = e.next) {
@@ -1957,7 +1957,7 @@ var ue = a(function e(t, r) {
1957
1957
  i = r.signup_redirect_url,
1958
1958
  o = r.custom_scopes,
1959
1959
  a = r.provider_params;
1960
- return C(t, void 0, void 0, s().mark(function t() {
1960
+ return O(t, void 0, void 0, s().mark(function t() {
1961
1961
  var r, c, u, l, d, h, p;
1962
1962
  return s().wrap(function (t) {
1963
1963
  for (;;) switch (t.prev = t.next) {
@@ -2009,7 +2009,7 @@ var ue = a(function e(t, r) {
2009
2009
  return a(e, [{
2010
2010
  key: "authenticateStart",
2011
2011
  value: function value(e) {
2012
- return C(this, void 0, void 0, s().mark(function t() {
2012
+ return O(this, void 0, void 0, s().mark(function t() {
2013
2013
  var r, n, i;
2014
2014
  return s().wrap(function (t) {
2015
2015
  for (;;) switch (t.prev = t.next) {
@@ -2036,7 +2036,7 @@ var ue = a(function e(t, r) {
2036
2036
  }, {
2037
2037
  key: "authenticate",
2038
2038
  value: function value(e) {
2039
- return C(this, void 0, void 0, s().mark(function t() {
2039
+ return O(this, void 0, void 0, s().mark(function t() {
2040
2040
  var r, n, i, o;
2041
2041
  return s().wrap(function (t) {
2042
2042
  for (;;) switch (t.prev = t.next) {
@@ -2083,7 +2083,7 @@ var ue = a(function e(t, r) {
2083
2083
  return a(e, [{
2084
2084
  key: "create",
2085
2085
  value: function value(e) {
2086
- return C(this, void 0, void 0, s().mark(function t() {
2086
+ return O(this, void 0, void 0, s().mark(function t() {
2087
2087
  var r;
2088
2088
  return s().wrap(function (t) {
2089
2089
  for (;;) switch (t.prev = t.next) {
@@ -2108,7 +2108,7 @@ var ue = a(function e(t, r) {
2108
2108
  }, {
2109
2109
  key: "authenticate",
2110
2110
  value: function value(e) {
2111
- return C(this, void 0, void 0, s().mark(function t() {
2111
+ return O(this, void 0, void 0, s().mark(function t() {
2112
2112
  var r, n, i, o;
2113
2113
  return s().wrap(function (t) {
2114
2114
  for (;;) switch (t.prev = t.next) {
@@ -2147,7 +2147,7 @@ var ue = a(function e(t, r) {
2147
2147
  }, {
2148
2148
  key: "recoveryCodes",
2149
2149
  value: function value() {
2150
- return C(this, void 0, void 0, s().mark(function e() {
2150
+ return O(this, void 0, void 0, s().mark(function e() {
2151
2151
  return s().wrap(function (e) {
2152
2152
  for (;;) switch (e.prev = e.next) {
2153
2153
  case 0:
@@ -2166,7 +2166,7 @@ var ue = a(function e(t, r) {
2166
2166
  }, {
2167
2167
  key: "recover",
2168
2168
  value: function value(e) {
2169
- return C(this, void 0, void 0, s().mark(function t() {
2169
+ return O(this, void 0, void 0, s().mark(function t() {
2170
2170
  var r, n, i, o;
2171
2171
  return s().wrap(function (t) {
2172
2172
  for (;;) switch (t.prev = t.next) {
@@ -2259,26 +2259,26 @@ function Se(e) {
2259
2259
  schema: e
2260
2260
  };
2261
2261
  }
2262
- function Te(e) {
2262
+ function Ae(e) {
2263
2263
  return {
2264
2264
  required: !1,
2265
2265
  schema: e
2266
2266
  };
2267
2267
  }
2268
- var Oe = {
2268
+ var Te = {
2269
2269
  type: Se(ge),
2270
2270
  id: Se(be),
2271
- transports: Te(ge)
2271
+ transports: Ae(ge)
2272
2272
  },
2273
- Ce = {
2274
- appid: Te(ge),
2275
- appidExclude: Te(ge),
2276
- credProps: Te(ge)
2273
+ Oe = {
2274
+ appid: Ae(ge),
2275
+ appidExclude: Ae(ge),
2276
+ credProps: Ae(ge)
2277
2277
  },
2278
- Ae = {
2279
- appid: Te(ge),
2280
- appidExclude: Te(ge),
2281
- credProps: Te(ge)
2278
+ Ce = {
2279
+ appid: Ae(ge),
2280
+ appidExclude: Ae(ge),
2281
+ credProps: Ae(ge)
2282
2282
  },
2283
2283
  Ee = {
2284
2284
  publicKey: Se({
@@ -2290,19 +2290,19 @@ var Oe = {
2290
2290
  }),
2291
2291
  challenge: Se(be),
2292
2292
  pubKeyCredParams: Se(ge),
2293
- timeout: Te(ge),
2294
- excludeCredentials: Te([Oe]),
2295
- authenticatorSelection: Te(ge),
2296
- attestation: Te(ge),
2297
- extensions: Te(Ce)
2293
+ timeout: Ae(ge),
2294
+ excludeCredentials: Ae([Te]),
2295
+ authenticatorSelection: Ae(ge),
2296
+ attestation: Ae(ge),
2297
+ extensions: Ae(Oe)
2298
2298
  }),
2299
- signal: Te(ge)
2299
+ signal: Ae(ge)
2300
2300
  },
2301
2301
  Pe = {
2302
2302
  type: Se(ge),
2303
2303
  id: Se(ge),
2304
2304
  rawId: Se(be),
2305
- authenticatorAttachment: Te(ge),
2305
+ authenticatorAttachment: Ae(ge),
2306
2306
  response: Se({
2307
2307
  clientDataJSON: Se(be),
2308
2308
  attestationObject: Se(be),
@@ -2311,52 +2311,52 @@ var Oe = {
2311
2311
  return (null == (t = e.getTransports) ? void 0 : t.call(e)) || [];
2312
2312
  })
2313
2313
  }),
2314
- clientExtensionResults: we(Ae, function (e) {
2314
+ clientExtensionResults: we(Ce, function (e) {
2315
2315
  return e.getClientExtensionResults();
2316
2316
  })
2317
2317
  },
2318
2318
  xe = {
2319
- mediation: Te(ge),
2319
+ mediation: Ae(ge),
2320
2320
  publicKey: Se({
2321
2321
  challenge: Se(be),
2322
- timeout: Te(ge),
2323
- rpId: Te(ge),
2324
- allowCredentials: Te([Oe]),
2325
- userVerification: Te(ge),
2326
- extensions: Te(Ce)
2322
+ timeout: Ae(ge),
2323
+ rpId: Ae(ge),
2324
+ allowCredentials: Ae([Te]),
2325
+ userVerification: Ae(ge),
2326
+ extensions: Ae(Oe)
2327
2327
  }),
2328
- signal: Te(ge)
2328
+ signal: Ae(ge)
2329
2329
  },
2330
2330
  Re = {
2331
2331
  type: Se(ge),
2332
2332
  id: Se(ge),
2333
2333
  rawId: Se(be),
2334
- authenticatorAttachment: Te(ge),
2334
+ authenticatorAttachment: Ae(ge),
2335
2335
  response: Se({
2336
2336
  clientDataJSON: Se(be),
2337
2337
  authenticatorData: Se(be),
2338
2338
  signature: Se(be),
2339
2339
  userHandle: Se(be)
2340
2340
  }),
2341
- clientExtensionResults: we(Ae, function (e) {
2341
+ clientExtensionResults: we(Ce, function (e) {
2342
2342
  return e.getClientExtensionResults();
2343
2343
  })
2344
2344
  };
2345
2345
  function De(e) {
2346
2346
  return ke(ve, Ee, e);
2347
2347
  }
2348
- function Be(e) {
2348
+ function Ie(e) {
2349
2349
  return ke(ye, Pe, e);
2350
2350
  }
2351
- function Ie(e) {
2352
- return C(this, void 0, void 0, s().mark(function t() {
2351
+ function Be(e) {
2352
+ return O(this, void 0, void 0, s().mark(function t() {
2353
2353
  var r;
2354
2354
  return s().wrap(function (t) {
2355
2355
  for (;;) switch (t.prev = t.next) {
2356
2356
  case 0:
2357
2357
  return t.next = 2, navigator.credentials.create(De(e));
2358
2358
  case 2:
2359
- return r = t.sent, t.abrupt("return", Be(r));
2359
+ return r = t.sent, t.abrupt("return", Ie(r));
2360
2360
  case 4:
2361
2361
  case "end":
2362
2362
  return t.stop();
@@ -2371,7 +2371,7 @@ function Fe(e) {
2371
2371
  return ke(ye, Re, e);
2372
2372
  }
2373
2373
  function je(e) {
2374
- return C(this, void 0, void 0, s().mark(function t() {
2374
+ return O(this, void 0, void 0, s().mark(function t() {
2375
2375
  var r;
2376
2376
  return s().wrap(function (t) {
2377
2377
  for (;;) switch (t.prev = t.next) {
@@ -2388,99 +2388,183 @@ function je(e) {
2388
2388
  }
2389
2389
  var Me = function () {
2390
2390
  function e(t, r, n) {
2391
- c(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n;
2391
+ c(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n, this.checkEligibleInputs = function () {
2392
+ return !(document.querySelectorAll("input[autocomplete*='webauthn']").length < 1) || (console.error('No <input> with `"webauthn"` in its `autocomplete` attribute was detected'), !1);
2393
+ };
2392
2394
  }
2393
2395
  return a(e, [{
2394
2396
  key: "register",
2395
2397
  value: function value(e) {
2396
- var t;
2397
- return C(this, void 0, void 0, s().mark(function r() {
2398
- var n, i, o, a;
2399
- return s().wrap(function (r) {
2400
- for (;;) switch (r.prev = r.next) {
2398
+ var t, r;
2399
+ return O(this, void 0, void 0, s().mark(function n() {
2400
+ var i, o, a, c, u;
2401
+ return s().wrap(function (n) {
2402
+ for (;;) switch (n.prev = n.next) {
2401
2403
  case 0:
2402
- return re("stytch.webauthn.register").isOptionalString("domain", null == e ? void 0 : e.domain).isOptionalString("authenticator_type", null == e ? void 0 : e.authenticator_type), r.next = 3, this._networkClient.fetchSDK({
2404
+ return re("stytch.webauthn.register").isOptionalString("domain", null == e ? void 0 : e.domain).isOptionalString("authenticator_type", null == e ? void 0 : e.authenticator_type).isOptionalBoolean("is_passkey", null == e ? void 0 : e.is_passkey).isOptionalNumber("session_duration_minutes", null == e ? void 0 : e.session_duration_minutes), n.next = 3, this._networkClient.fetchSDK({
2403
2405
  url: "/webauthn/register/start",
2404
2406
  method: "POST",
2405
2407
  errorMessage: "Failed to start WebAuthn registration",
2406
2408
  body: {
2407
2409
  domain: null !== (t = null == e ? void 0 : e.domain) && void 0 !== t ? t : window.location.hostname,
2408
- authenticator_type: null == e ? void 0 : e.authenticator_type
2410
+ authenticator_type: null !== (r = null == e ? void 0 : e.authenticator_type) && void 0 !== r ? r : void 0,
2411
+ return_passkey_credential_options: null == e ? void 0 : e.is_passkey,
2412
+ user_agent: navigator.userAgent
2409
2413
  }
2410
2414
  });
2411
2415
  case 3:
2412
- return n = r.sent, i = n.public_key_credential_creation_options, r.next = 7, Ie({
2413
- publicKey: JSON.parse(i)
2416
+ return i = n.sent, o = i.public_key_credential_creation_options, a = JSON.parse(o), n.next = 8, Be({
2417
+ publicKey: a
2414
2418
  });
2415
- case 7:
2416
- return o = r.sent, r.next = 10, this._networkClient.fetchSDK({
2419
+ case 8:
2420
+ return c = n.sent, n.next = 11, this._networkClient.fetchSDK({
2417
2421
  url: "/webauthn/register",
2418
2422
  method: "POST",
2419
2423
  errorMessage: "Failed to register WebAuthn device",
2420
2424
  body: {
2421
- public_key_credential: JSON.stringify(o)
2425
+ public_key_credential: JSON.stringify(c),
2426
+ session_duration_minutes: null == e ? void 0 : e.session_duration_minutes
2422
2427
  }
2423
2428
  });
2424
- case 10:
2425
- return a = r.sent, this._subscriptionService.updateUser(a.__user), r.abrupt("return", ie(a));
2426
- case 13:
2429
+ case 11:
2430
+ return u = n.sent, this._subscriptionService.updateStateAndTokens({
2431
+ state: {
2432
+ session: u.session,
2433
+ user: u.__user
2434
+ },
2435
+ session_token: u.session_token,
2436
+ session_jwt: u.session_jwt,
2437
+ intermediate_session_token: null
2438
+ }), n.abrupt("return", ie(u));
2439
+ case 14:
2427
2440
  case "end":
2428
- return r.stop();
2441
+ return n.stop();
2429
2442
  }
2430
- }, r, this);
2443
+ }, n, this);
2431
2444
  }));
2432
2445
  }
2433
2446
  }, {
2434
2447
  key: "authenticate",
2435
2448
  value: function value(e) {
2436
- var t;
2437
- return C(this, void 0, void 0, s().mark(function r() {
2438
- var n, i, o, a, c, u, l;
2439
- return s().wrap(function (r) {
2440
- for (;;) switch (r.prev = r.next) {
2449
+ var t, r;
2450
+ return O(this, void 0, void 0, s().mark(function n() {
2451
+ var i, o, a, c, u, l, d, h, p, f, _, m;
2452
+ return s().wrap(function (n) {
2453
+ for (;;) switch (n.prev = n.next) {
2441
2454
  case 0:
2442
- return re("stytch.webauthn.register").isOptionalString("domain", e.domain).isNumber("session_duration_minutes", e.session_duration_minutes), r.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
2455
+ return re("stytch.webauthn.authenticate").isOptionalString("domain", e.domain).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalBoolean("is_passkey", e.is_passkey).isOptionalObject("signal", e.signal), n.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
2443
2456
  case 3:
2444
- return n = r.sent, i = n.dfp_telemetry_id, o = n.captcha_token, r.next = 8, this._networkClient.fetchSDK({
2445
- url: "/webauthn/authenticate/start",
2457
+ if (i = n.sent, o = i.dfp_telemetry_id, a = i.captcha_token, !e.conditional_mediation) {
2458
+ n.next = 14;
2459
+ break;
2460
+ }
2461
+ return n.next = 9, this.browserSupportsAutofill();
2462
+ case 9:
2463
+ if (n.sent) {
2464
+ n.next = 12;
2465
+ break;
2466
+ }
2467
+ return console.error("Browser does not support WebAuthn autofill"), n.abrupt("return", null);
2468
+ case 12:
2469
+ if (this.checkEligibleInputs()) {
2470
+ n.next = 14;
2471
+ break;
2472
+ }
2473
+ return n.abrupt("return", null);
2474
+ case 14:
2475
+ return c = !!this._subscriptionService.getSession(), u = c ? "/webauthn/authenticate/start/secondary" : "/webauthn/authenticate/start/primary", n.next = 18, this._networkClient.fetchSDK({
2476
+ url: u,
2446
2477
  method: "POST",
2447
2478
  errorMessage: "Failed to start WebAuthn authentication",
2448
2479
  body: {
2449
- domain: null !== (t = e.domain) && void 0 !== t ? t : window.location.hostname
2480
+ domain: null !== (t = e.domain) && void 0 !== t ? t : window.location.hostname,
2481
+ return_passkey_credential_options: null == e ? void 0 : e.is_passkey
2450
2482
  }
2451
2483
  });
2452
- case 8:
2453
- return a = r.sent, c = a.public_key_credential_request_options, r.next = 12, je({
2454
- publicKey: JSON.parse(c)
2455
- });
2456
- case 12:
2457
- return u = r.sent, r.next = 15, this._networkClient.retriableFetchSDK({
2484
+ case 18:
2485
+ return l = n.sent, d = l.public_key_credential_request_options, h = new AbortController(), p = {
2486
+ publicKey: JSON.parse(d),
2487
+ signal: null !== (r = e.signal) && void 0 !== r ? r : h.signal
2488
+ }, f = Object.assign(Object.assign({}, p), {
2489
+ mediation: "conditional"
2490
+ }), n.next = 25, je(e.conditional_mediation ? f : p);
2491
+ case 25:
2492
+ return _ = n.sent, n.next = 28, this._networkClient.retriableFetchSDK({
2458
2493
  url: "/webauthn/authenticate",
2459
2494
  method: "POST",
2460
2495
  errorMessage: "Failed to authenticate WebAuthn device",
2461
2496
  body: {
2462
- public_key_credential: JSON.stringify(u),
2497
+ public_key_credential: JSON.stringify(_),
2463
2498
  session_duration_minutes: e.session_duration_minutes,
2464
- dfp_telemetry_id: i,
2465
- captcha_token: o
2499
+ dfp_telemetry_id: o,
2500
+ captcha_token: a
2466
2501
  },
2467
2502
  retryCallback: this.dfpProtectedAuth.retryWithCaptchaAndDFP
2468
2503
  });
2469
- case 15:
2470
- return l = r.sent, this._subscriptionService.updateStateAndTokens({
2504
+ case 28:
2505
+ return m = n.sent, this._subscriptionService.updateStateAndTokens({
2471
2506
  state: {
2472
- session: l.session,
2473
- user: l.__user
2507
+ session: m.session,
2508
+ user: m.__user
2474
2509
  },
2475
- session_token: l.session_token,
2476
- session_jwt: l.session_jwt,
2510
+ session_token: m.session_token,
2511
+ session_jwt: m.session_jwt,
2477
2512
  intermediate_session_token: null
2478
- }), r.abrupt("return", ie(l));
2479
- case 18:
2513
+ }), n.abrupt("return", ie(m));
2514
+ case 31:
2480
2515
  case "end":
2481
- return r.stop();
2516
+ return n.stop();
2482
2517
  }
2483
- }, r, this);
2518
+ }, n, this);
2519
+ }));
2520
+ }
2521
+ }, {
2522
+ key: "update",
2523
+ value: function value(e) {
2524
+ return O(this, void 0, void 0, s().mark(function t() {
2525
+ var r;
2526
+ return s().wrap(function (t) {
2527
+ for (;;) switch (t.prev = t.next) {
2528
+ case 0:
2529
+ return r = "/webauthn/update/" + e.webauthn_registration_id, t.next = 3, this._networkClient.fetchSDK({
2530
+ url: r,
2531
+ method: "PUT",
2532
+ errorMessage: "Failed to update WebAuthn Registration",
2533
+ body: {
2534
+ name: e.name
2535
+ }
2536
+ });
2537
+ case 3:
2538
+ return t.abrupt("return", t.sent);
2539
+ case 4:
2540
+ case "end":
2541
+ return t.stop();
2542
+ }
2543
+ }, t, this);
2544
+ }));
2545
+ }
2546
+ }, {
2547
+ key: "browserSupportsAutofill",
2548
+ value: function value() {
2549
+ return O(this, void 0, void 0, s().mark(function e() {
2550
+ var t;
2551
+ return s().wrap(function (e) {
2552
+ for (;;) switch (e.prev = e.next) {
2553
+ case 0:
2554
+ if (void 0 !== (t = window.PublicKeyCredential) && void 0 !== t.isConditionalMediationAvailable) {
2555
+ e.next = 3;
2556
+ break;
2557
+ }
2558
+ return e.abrupt("return", new Promise(function (e) {
2559
+ return e(!1);
2560
+ }));
2561
+ case 3:
2562
+ return e.abrupt("return", t.isConditionalMediationAvailable());
2563
+ case 4:
2564
+ case "end":
2565
+ return e.stop();
2566
+ }
2567
+ }, e);
2484
2568
  }));
2485
2569
  }
2486
2570
  }]), e;
@@ -2488,7 +2572,7 @@ var Me = function () {
2488
2572
  Ne = Promise.resolve({
2489
2573
  pkceRequiredForPasswordResets: !1
2490
2574
  }),
2491
- Ue = function () {
2575
+ Ke = function () {
2492
2576
  function e(t, r, n) {
2493
2577
  var i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : Ne,
2494
2578
  s = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : oe();
@@ -2497,7 +2581,7 @@ var Me = function () {
2497
2581
  return a(e, [{
2498
2582
  key: "getCodeChallenge",
2499
2583
  value: function value() {
2500
- return C(this, void 0, void 0, s().mark(function e() {
2584
+ return O(this, void 0, void 0, s().mark(function e() {
2501
2585
  var t, r;
2502
2586
  return s().wrap(function (e) {
2503
2587
  for (;;) switch (e.prev = e.next) {
@@ -2531,7 +2615,7 @@ var Me = function () {
2531
2615
  }, {
2532
2616
  key: "create",
2533
2617
  value: function value(e) {
2534
- return C(this, void 0, void 0, s().mark(function t() {
2618
+ return O(this, void 0, void 0, s().mark(function t() {
2535
2619
  var r, n, i, o;
2536
2620
  return s().wrap(function (t) {
2537
2621
  for (;;) switch (t.prev = t.next) {
@@ -2571,7 +2655,7 @@ var Me = function () {
2571
2655
  }, {
2572
2656
  key: "authenticate",
2573
2657
  value: function value(e) {
2574
- return C(this, void 0, void 0, s().mark(function t() {
2658
+ return O(this, void 0, void 0, s().mark(function t() {
2575
2659
  var r, n, i, o;
2576
2660
  return s().wrap(function (t) {
2577
2661
  for (;;) switch (t.prev = t.next) {
@@ -2611,7 +2695,7 @@ var Me = function () {
2611
2695
  }, {
2612
2696
  key: "resetByEmailStart",
2613
2697
  value: function value(e) {
2614
- return C(this, void 0, void 0, s().mark(function t() {
2698
+ return O(this, void 0, void 0, s().mark(function t() {
2615
2699
  var r, n, i, o;
2616
2700
  return s().wrap(function (t) {
2617
2701
  for (;;) switch (t.prev = t.next) {
@@ -2646,7 +2730,7 @@ var Me = function () {
2646
2730
  }, {
2647
2731
  key: "resetByEmail",
2648
2732
  value: function value(e) {
2649
- return C(this, void 0, void 0, s().mark(function t() {
2733
+ return O(this, void 0, void 0, s().mark(function t() {
2650
2734
  var r, n, i, o, a, c;
2651
2735
  return s().wrap(function (t) {
2652
2736
  for (;;) switch (t.prev = t.next) {
@@ -2689,7 +2773,7 @@ var Me = function () {
2689
2773
  }, {
2690
2774
  key: "resetByExistingPassword",
2691
2775
  value: function value(e) {
2692
- return C(this, void 0, void 0, s().mark(function t() {
2776
+ return O(this, void 0, void 0, s().mark(function t() {
2693
2777
  var r, n, i, o;
2694
2778
  return s().wrap(function (t) {
2695
2779
  for (;;) switch (t.prev = t.next) {
@@ -2730,7 +2814,7 @@ var Me = function () {
2730
2814
  }, {
2731
2815
  key: "resetBySession",
2732
2816
  value: function value(e) {
2733
- return C(this, void 0, void 0, s().mark(function t() {
2817
+ return O(this, void 0, void 0, s().mark(function t() {
2734
2818
  var r, n, i, o;
2735
2819
  return s().wrap(function (t) {
2736
2820
  for (;;) switch (t.prev = t.next) {
@@ -2769,7 +2853,7 @@ var Me = function () {
2769
2853
  }, {
2770
2854
  key: "strengthCheck",
2771
2855
  value: function value(e) {
2772
- return C(this, void 0, void 0, s().mark(function t() {
2856
+ return O(this, void 0, void 0, s().mark(function t() {
2773
2857
  return s().wrap(function (t) {
2774
2858
  for (;;) switch (t.prev = t.next) {
2775
2859
  case 0:
@@ -2796,7 +2880,7 @@ Promise.resolve({
2796
2880
  }), Promise.resolve({
2797
2881
  pkceRequiredForPasswordResets: !1
2798
2882
  });
2799
- var Ke = function () {
2883
+ var Ue = function () {
2800
2884
  function e(t) {
2801
2885
  c(this, e), this.iframeURL = t, this.createIframe();
2802
2886
  }
@@ -2815,7 +2899,7 @@ var Ke = function () {
2815
2899
  }, {
2816
2900
  key: "call",
2817
2901
  value: function value(e, t) {
2818
- return C(this, void 0, void 0, s().mark(function r() {
2902
+ return O(this, void 0, void 0, s().mark(function r() {
2819
2903
  var n,
2820
2904
  i,
2821
2905
  o = this;
@@ -2851,7 +2935,7 @@ var Ke = function () {
2851
2935
  c(this, e), this._subscriptionService = t, this._headlessSessionClient = r, this._onDataChange = function (e) {
2852
2936
  (null == e ? void 0 : e.session) ? n.scheduleBackgroundRefresh() : n.cancelBackgroundRefresh();
2853
2937
  }, this._reauthenticateWithBackoff = function () {
2854
- return C(n, void 0, void 0, s().mark(function t() {
2938
+ return O(n, void 0, void 0, s().mark(function t() {
2855
2939
  var r;
2856
2940
  return s().wrap(function (t) {
2857
2941
  for (;;) switch (t.prev = t.next) {
@@ -3049,9 +3133,9 @@ function He(e, t, r, n) {
3049
3133
  });
3050
3134
  }
3051
3135
  "function" == typeof SuppressedError && SuppressedError;
3052
- var ze = /*#__PURE__*/_createClass(function ze(e) {
3136
+ var Ye = /*#__PURE__*/_createClass(function Ye(e) {
3053
3137
  var _this2 = this;
3054
- _classCallCheck(this, ze);
3138
+ _classCallCheck(this, Ye);
3055
3139
  this.bootstrapPromise = e, this.executeRecaptcha = function () {
3056
3140
  return He(_this2, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3057
3141
  var _yield$this$state, e, t, r;
@@ -3122,21 +3206,21 @@ var ze = /*#__PURE__*/_createClass(function ze(e) {
3122
3206
  }));
3123
3207
  });
3124
3208
  });
3125
- var Ye = /*#__PURE__*/function () {
3126
- function Ye(e) {
3209
+ var ze = /*#__PURE__*/function () {
3210
+ function ze(e) {
3127
3211
  var _this3 = this;
3128
- _classCallCheck(this, Ye);
3212
+ _classCallCheck(this, ze);
3129
3213
  this.iframeURL = e, this.oneTapStart = function (e) {
3130
3214
  return _this3.call("oneTapStart", e);
3131
3215
  }, this.oneTapSubmit = function (e) {
3132
3216
  return _this3.call("oneTapSubmit", e);
3133
3217
  };
3134
3218
  }
3135
- _createClass(Ye, [{
3219
+ _createClass(ze, [{
3136
3220
  key: "frameClient",
3137
3221
  get: function get() {
3138
3222
  var e;
3139
- return this._frameClient = null !== (e = this._frameClient) && void 0 !== e ? e : new Ke(this.iframeURL), this._frameClient;
3223
+ return this._frameClient = null !== (e = this._frameClient) && void 0 !== e ? e : new Ue(this.iframeURL), this._frameClient;
3140
3224
  }
3141
3225
  }, {
3142
3226
  key: "call",
@@ -3144,7 +3228,7 @@ var Ye = /*#__PURE__*/function () {
3144
3228
  return this.frameClient.call(e, [t]);
3145
3229
  }
3146
3230
  }]);
3147
- return Ye;
3231
+ return ze;
3148
3232
  }();
3149
3233
  function Ve(e) {
3150
3234
  return Ve = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
@@ -3261,7 +3345,7 @@ function st(e) {
3261
3345
  }, st(e);
3262
3346
  }
3263
3347
  exports.Products = void 0, function (e) {
3264
- e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords";
3348
+ e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords", e.passkeys = "passkeys";
3265
3349
  }(exports.Products || (exports.Products = {})), exports.OAuthProviders = void 0, function (e) {
3266
3350
  e.Google = "google", e.Microsoft = "microsoft", e.Apple = "apple", e.Github = "github", e.GitLab = "gitlab", e.Facebook = "facebook", e.Discord = "discord", e.Salesforce = "salesforce", e.Slack = "slack", e.Amazon = "amazon", e.Bitbucket = "bitbucket", e.LinkedIn = "linkedin", e.Coinbase = "coinbase", e.Twitch = "twitch", e.Twitter = "twitter", e.TikTok = "tiktok", e.Snapchat = "snapchat", e.Figma = "figma", e.Yahoo = "yahoo";
3267
3351
  }(exports.OAuthProviders || (exports.OAuthProviders = {})), exports.Wallets = void 0, function (e) {
@@ -3271,7 +3355,7 @@ exports.Products = void 0, function (e) {
3271
3355
  }(exports.OneTapPositions || (exports.OneTapPositions = {})), exports.OTPMethods = void 0, function (e) {
3272
3356
  e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
3273
3357
  }(exports.OTPMethods || (exports.OTPMethods = {})), exports.StytchEventType = void 0, function (e) {
3274
- 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.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_SSO_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";
3358
+ 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_SSO_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";
3275
3359
  }(exports.StytchEventType || (exports.StytchEventType = {}));
3276
3360
  var ot = function (e) {
3277
3361
  Ze(r, tt(Error));
@@ -3415,9 +3499,9 @@ var ht = /*#__PURE__*/function () {
3415
3499
  key: "createTelemetryBlob",
3416
3500
  value: function createTelemetryBlob() {
3417
3501
  return Object.assign(Object.assign({
3418
- event_id: "event-id-".concat(z()),
3419
- app_session_id: "app-session-id-".concat(z()),
3420
- persistent_id: "persistent-id-".concat(z()),
3502
+ event_id: "event-id-".concat(Y()),
3503
+ app_session_id: "app-session-id-".concat(Y()),
3504
+ persistent_id: "persistent-id-".concat(Y()),
3421
3505
  client_sent_at: new Date().toISOString(),
3422
3506
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
3423
3507
  }, this.additionalTelemetryDataFn()), {
@@ -3426,7 +3510,7 @@ var ht = /*#__PURE__*/function () {
3426
3510
  },
3427
3511
  sdk: {
3428
3512
  identifier: "Stytch.js Javascript SDK",
3429
- version: "3.0.3"
3513
+ version: "3.1.1"
3430
3514
  }
3431
3515
  });
3432
3516
  }
@@ -3482,7 +3566,7 @@ var ht = /*#__PURE__*/function () {
3482
3566
  a = e.xSDKParentHostHeader,
3483
3567
  c = e.body,
3484
3568
  u = e.retryCallback;
3485
- return C(this, void 0, void 0, s().mark(function e() {
3569
+ return O(this, void 0, void 0, s().mark(function e() {
3486
3570
  var l;
3487
3571
  return s().wrap(function (e) {
3488
3572
  for (;;) switch (e.prev = e.next) {
@@ -3671,7 +3755,7 @@ var ft = /*#__PURE__*/function () {
3671
3755
  _context8.t1 = !0;
3672
3756
  _context8.t2 = pt;
3673
3757
  _context8.next = 16;
3674
- return V(T, function () {
3758
+ return V(A, function () {
3675
3759
  return window.google.accounts.id;
3676
3760
  });
3677
3761
  case 16:
@@ -4107,20 +4191,20 @@ var St = /*#__PURE__*/function (_wt) {
4107
4191
  }
4108
4192
  return _createClass(St);
4109
4193
  }(wt);
4110
- var Tt = Symbol["for"]("__stytch_DataLayer"),
4111
- Ot = function Ot(e, t) {
4194
+ var At = Symbol["for"]("__stytch_DataLayer"),
4195
+ Tt = function Tt(e, t) {
4112
4196
  var r = function () {
4113
4197
  var e = window;
4114
- return e[Tt] || (e[Tt] = {}), e[Tt];
4198
+ return e[At] || (e[At] = {}), e[At];
4115
4199
  }();
4116
4200
  return r[e] || (r[e] = new St(e, t)), r[e];
4117
4201
  },
4118
- Ct = function Ct(e, t) {
4202
+ Ot = function Ot(e, t) {
4119
4203
  Object.values(e).forEach(function (e) {
4120
4204
  return e(t);
4121
4205
  });
4122
4206
  },
4123
- At = function () {
4207
+ Ct = function () {
4124
4208
  var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).KEYS_TO_EXCLUDE,
4125
4209
  r = void 0 === e ? [] : e;
4126
4210
  return function e(n, s) {
@@ -4184,7 +4268,7 @@ var Et = /*#__PURE__*/function () {
4184
4268
  value: function _updateStateAndTokensInternal(e) {
4185
4269
  var t = this._datalayer.state,
4186
4270
  r = null === e.state ? null : Object.assign(Object.assign({}, this._datalayer.state), e.state);
4187
- this._datalayer.state = r, At(t, r) || Ct(this._datalayer.subscriptions, r);
4271
+ this._datalayer.state = r, Ct(t, r) || Ot(this._datalayer.subscriptions, r);
4188
4272
  }
4189
4273
  }, {
4190
4274
  key: "updateStateAndTokens",
@@ -4196,7 +4280,7 @@ var Et = /*#__PURE__*/function () {
4196
4280
  value: function updateState(e) {
4197
4281
  var t = this._datalayer.state,
4198
4282
  r = null === e ? null : Object.assign(Object.assign({}, this._datalayer.state), e);
4199
- this._datalayer.state = r, At(t, r) || (Ct(this._datalayer.subscriptions, r), this._datalayer.syncToLocalStorage());
4283
+ this._datalayer.state = r, Ct(t, r) || (Ot(this._datalayer.subscriptions, r), this._datalayer.syncToLocalStorage());
4200
4284
  }
4201
4285
  }, {
4202
4286
  key: "updateTokens",
@@ -4281,7 +4365,7 @@ exports.SDKAPIUnreachableError = ot, exports.StytchHeadlessClient = /*#__PURE__*
4281
4365
  }
4282
4366
  };
4283
4367
  var o, a, c, u, l, d, h, p, f, _, m;
4284
- this._dataLayer = Ot(e, n), this._subscriptionService = new Pt(e, this._dataLayer);
4368
+ this._dataLayer = Tt(e, n), this._subscriptionService = new Pt(e, this._dataLayer);
4285
4369
  var v = new mt(this._dataLayer, "passwords");
4286
4370
  this._networkClient = new ht(e, this._dataLayer, s.endpoints.sdkBackendURL, function () {
4287
4371
  var e, t, r, n;
@@ -4291,24 +4375,24 @@ exports.SDKAPIUnreachableError = ot, exports.StytchHeadlessClient = /*#__PURE__*
4291
4375
  };
4292
4376
  });
4293
4377
  var y = new Ge(e, this._networkClient, this._dataLayer),
4294
- g = new ze(y.getAsync()),
4378
+ g = new Ye(y.getAsync()),
4295
4379
  b = new se(e, s.endpoints.dfpBackendURL, y.getAsync(), g.executeRecaptcha),
4296
- k = new Ye(s.endpoints.clientsideServicesIframeURL),
4380
+ k = new ze(s.endpoints.clientsideServicesIframeURL),
4297
4381
  w = new ft(e, k),
4298
4382
  S = new vt(this._networkClient);
4299
- var T, O;
4383
+ var A, T;
4300
4384
  this.user = new ue(this._networkClient, this._subscriptionService), this.session = new le(this._networkClient, this._subscriptionService), this.magicLinks = new he(this._networkClient, this._subscriptionService, new mt(this._dataLayer, "magic_links"), v, y.getAsync(), b), this.otps = new pe(this._networkClient, this._subscriptionService, g.executeRecaptcha, b), this.oauth = new dt(this._networkClient, this._subscriptionService, new mt(this._dataLayer, "oauth"), y.getAsync(), {
4301
4385
  publicToken: e,
4302
4386
  testAPIURL: s.endpoints.testAPIURL,
4303
4387
  liveAPIURL: s.endpoints.liveAPIURL
4304
- }, w), this.cryptoWallets = new _e(this._networkClient, this._subscriptionService, g.executeRecaptcha, b), this.totps = new me(this._networkClient, this._subscriptionService, b), this.webauthn = new Me(this._networkClient, this._subscriptionService, b), this.passwords = new Ue(this._networkClient, this._subscriptionService, v, y.getAsync(), b), this._sessionManager = new We(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
4388
+ }, w), this.cryptoWallets = new _e(this._networkClient, this._subscriptionService, g.executeRecaptcha, b), this.totps = new me(this._networkClient, this._subscriptionService, b), this.webauthn = new Me(this._networkClient, this._subscriptionService, b), this.passwords = new Ke(this._networkClient, this._subscriptionService, v, y.getAsync(), b), this._sessionManager = new We(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
4305
4389
  name: "sdk_instance_instantiated",
4306
4390
  details: {
4307
4391
  event_callback_registered: !1,
4308
4392
  error_callback_registered: !1,
4309
4393
  success_callback_registered: !1
4310
4394
  }
4311
- }), T = this, O = {
4395
+ }), A = this, T = {
4312
4396
  bootstrap: y,
4313
4397
  clientsideServices: k,
4314
4398
  captcha: g,
@@ -4317,7 +4401,7 @@ exports.SDKAPIUnreachableError = ot, exports.StytchHeadlessClient = /*#__PURE__*
4317
4401
  publicToken: e,
4318
4402
  dataLayer: this._dataLayer,
4319
4403
  networkClient: this._networkClient
4320
- }, Object.assign(T, _defineProperty({}, xt, O));
4404
+ }, Object.assign(A, _defineProperty({}, xt, T));
4321
4405
  }
4322
4406
  return _createClass(_class);
4323
4407
  }(), exports.StytchSDKAPIError = ut, exports.StytchSDKNativeError = lt, exports.StytchSDKSchemaError = ct, exports.StytchSDKUsageError = at, exports.UNRECOVERABLE_ERROR_TYPES = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"];