@stytch/vanilla-js 3.3.0 → 4.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.
- package/CHANGELOG.md +25 -2
- package/dist/b2b/index.d.ts +14 -13
- package/dist/b2b/index.esm.d.ts +14 -13
- package/dist/b2b/index.esm.js +4180 -3826
- package/dist/b2b/index.headless.d.ts +14 -13
- package/dist/b2b/index.headless.esm.d.ts +14 -13
- package/dist/b2b/index.headless.esm.js +1477 -1118
- package/dist/b2b/index.headless.js +1472 -1112
- package/dist/b2b/index.js +3733 -3374
- package/dist/index.esm.js +5388 -5107
- package/dist/index.headless.esm.js +1576 -1293
- package/dist/index.headless.js +1557 -1288
- package/dist/index.js +4599 -4318
- package/package.json +2 -2
|
@@ -29,7 +29,475 @@ function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf
|
|
|
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); }
|
|
31
31
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
32
|
-
function e(
|
|
32
|
+
function e(t) {
|
|
33
|
+
return e = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
|
|
34
|
+
return _typeof(e);
|
|
35
|
+
} : function (e) {
|
|
36
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
|
|
37
|
+
}, e(t);
|
|
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);
|
|
52
|
+
}
|
|
53
|
+
var o, s;
|
|
54
|
+
}
|
|
55
|
+
function r(e, r, n) {
|
|
56
|
+
return r && t(e.prototype, r), n && t(e, n), Object.defineProperty(e, "prototype", {
|
|
57
|
+
writable: !1
|
|
58
|
+
}), e;
|
|
59
|
+
}
|
|
60
|
+
function n(e, t) {
|
|
61
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
62
|
+
}
|
|
63
|
+
function i(e, t) {
|
|
64
|
+
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
65
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
66
|
+
constructor: {
|
|
67
|
+
value: e,
|
|
68
|
+
writable: !0,
|
|
69
|
+
configurable: !0
|
|
70
|
+
}
|
|
71
|
+
}), Object.defineProperty(e, "prototype", {
|
|
72
|
+
writable: !1
|
|
73
|
+
}), t && l(e, t);
|
|
74
|
+
}
|
|
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) {
|
|
96
|
+
var t = "function" == typeof Map ? new Map() : void 0;
|
|
97
|
+
return a = function a(e) {
|
|
98
|
+
if (null === e || !function (e) {
|
|
99
|
+
try {
|
|
100
|
+
return -1 !== Function.toString.call(e).indexOf("[native code]");
|
|
101
|
+
} catch (t) {
|
|
102
|
+
return "function" == typeof e;
|
|
103
|
+
}
|
|
104
|
+
}(e)) return e;
|
|
105
|
+
if ("function" != typeof e) throw new TypeError("Super expression must either be null or a function");
|
|
106
|
+
if (void 0 !== t) {
|
|
107
|
+
if (t.has(e)) return t.get(e);
|
|
108
|
+
t.set(e, r);
|
|
109
|
+
}
|
|
110
|
+
function r() {
|
|
111
|
+
return c(e, arguments, d(this).constructor);
|
|
112
|
+
}
|
|
113
|
+
return r.prototype = Object.create(e.prototype, {
|
|
114
|
+
constructor: {
|
|
115
|
+
value: r,
|
|
116
|
+
enumerable: !1,
|
|
117
|
+
writable: !0,
|
|
118
|
+
configurable: !0
|
|
119
|
+
}
|
|
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);
|
|
130
|
+
}
|
|
131
|
+
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
|
+
try {
|
|
136
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
|
|
137
|
+
} catch (e) {
|
|
138
|
+
return !1;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function l(e, t) {
|
|
142
|
+
return l = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
|
|
143
|
+
return e.__proto__ = t, e;
|
|
144
|
+
}, l(e, t);
|
|
145
|
+
}
|
|
146
|
+
function d(e) {
|
|
147
|
+
return d = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
|
|
148
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
149
|
+
}, d(e);
|
|
150
|
+
}
|
|
151
|
+
Object.defineProperty(exports, "__esModule", {
|
|
152
|
+
value: !0
|
|
153
|
+
}), exports.Products = void 0, function (e) {
|
|
154
|
+
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords", e.passkeys = "passkeys";
|
|
155
|
+
}(exports.Products || (exports.Products = {})), exports.OAuthProviders = void 0, function (e) {
|
|
156
|
+
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";
|
|
157
|
+
}(exports.OAuthProviders || (exports.OAuthProviders = {})), exports.Wallets = void 0, function (e) {
|
|
158
|
+
e.Vessel = "Vessel", e.Phantom = "Phantom", e.Metamask = "Metamask", e.Coinbase = "Coinbase", e.Binance = "Binance", e.GenericEthereumWallet = "Other Ethereum Wallet", e.GenericSolanaWallet = "Other Solana Wallet";
|
|
159
|
+
}(exports.Wallets || (exports.Wallets = {})), exports.OneTapPositions = void 0, function (e) {
|
|
160
|
+
e.embedded = "embedded", e.floating = "floating";
|
|
161
|
+
}(exports.OneTapPositions || (exports.OneTapPositions = {})), exports.OTPMethods = void 0, function (e) {
|
|
162
|
+
e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
|
|
163
|
+
}(exports.OTPMethods || (exports.OTPMethods = {})), exports.StytchEventType = void 0, function (e) {
|
|
164
|
+
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
|
+
}(exports.StytchEventType || (exports.StytchEventType = {}));
|
|
166
|
+
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;
|
|
172
|
+
}
|
|
173
|
+
return r(c);
|
|
174
|
+
}(),
|
|
175
|
+
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;
|
|
181
|
+
}
|
|
182
|
+
return r(s);
|
|
183
|
+
}(),
|
|
184
|
+
_ = 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) {
|
|
191
|
+
return "".concat(e.dataPath, ": ").concat(e.message);
|
|
192
|
+
}).join("\n");
|
|
193
|
+
return r.message = "[400] Request does not match expected schema\n".concat(o), r;
|
|
194
|
+
}
|
|
195
|
+
return r(s);
|
|
196
|
+
}(),
|
|
197
|
+
f = function (e) {
|
|
198
|
+
i(s, a(Error));
|
|
199
|
+
var t = o(s);
|
|
200
|
+
function s(e) {
|
|
201
|
+
var r;
|
|
202
|
+
n(this, s), (r = t.call(this)).name = "StytchSDKAPIError";
|
|
203
|
+
var i = e.status_code,
|
|
204
|
+
o = e.error_type,
|
|
205
|
+
a = e.error_message,
|
|
206
|
+
c = e.error_url,
|
|
207
|
+
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;
|
|
209
|
+
}
|
|
210
|
+
return r(s);
|
|
211
|
+
}(),
|
|
212
|
+
m = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"],
|
|
213
|
+
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;
|
|
219
|
+
}
|
|
220
|
+
return r(s);
|
|
221
|
+
}(),
|
|
222
|
+
b = function (e) {
|
|
223
|
+
i(a, v);
|
|
224
|
+
var t = o(a);
|
|
225
|
+
function a(e) {
|
|
226
|
+
var r;
|
|
227
|
+
return n(this, a), r = t.call(this, "StytchAPIUnreachableError", e), Object.setPrototypeOf(s(r), a.prototype), r;
|
|
228
|
+
}
|
|
229
|
+
return r(a);
|
|
230
|
+
}(),
|
|
231
|
+
g = function (e) {
|
|
232
|
+
i(s, v);
|
|
233
|
+
var t = o(s);
|
|
234
|
+
function s(e) {
|
|
235
|
+
var r;
|
|
236
|
+
n(this, s);
|
|
237
|
+
var i = null === (r = e.body) || void 0 === r ? void 0 : r.map(function (e) {
|
|
238
|
+
return "".concat(e.dataPath, ": ").concat(e.message);
|
|
239
|
+
}).join("\n");
|
|
240
|
+
return t.call(this, "StytchAPISchemaError", "Request does not match expected schema\n".concat(i));
|
|
241
|
+
}
|
|
242
|
+
return r(s);
|
|
243
|
+
}(),
|
|
244
|
+
y = function (e) {
|
|
245
|
+
i(s, v);
|
|
246
|
+
var t = o(s);
|
|
247
|
+
function s(e) {
|
|
248
|
+
var r;
|
|
249
|
+
n(this, s);
|
|
250
|
+
var i = e.status_code,
|
|
251
|
+
o = e.error_type,
|
|
252
|
+
a = e.error_message,
|
|
253
|
+
c = e.error_url,
|
|
254
|
+
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;
|
|
256
|
+
}
|
|
257
|
+
return r(s);
|
|
258
|
+
}(),
|
|
259
|
+
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;
|
|
265
|
+
}
|
|
266
|
+
return r(s);
|
|
267
|
+
}(),
|
|
268
|
+
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.");
|
|
273
|
+
}
|
|
274
|
+
return r(s);
|
|
275
|
+
}(),
|
|
276
|
+
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.");
|
|
281
|
+
}
|
|
282
|
+
return r(s);
|
|
283
|
+
}(),
|
|
284
|
+
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.");
|
|
289
|
+
}
|
|
290
|
+
return r(s);
|
|
291
|
+
}(),
|
|
292
|
+
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.");
|
|
297
|
+
}
|
|
298
|
+
return r(s);
|
|
299
|
+
}(),
|
|
300
|
+
E = 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.");
|
|
305
|
+
}
|
|
306
|
+
return r(s);
|
|
307
|
+
}(),
|
|
308
|
+
C = 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.");
|
|
313
|
+
}
|
|
314
|
+
return r(s);
|
|
315
|
+
}(),
|
|
316
|
+
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.");
|
|
321
|
+
}
|
|
322
|
+
return r(s);
|
|
323
|
+
}(),
|
|
324
|
+
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.");
|
|
329
|
+
}
|
|
330
|
+
return r(s);
|
|
331
|
+
}(),
|
|
332
|
+
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.");
|
|
337
|
+
}
|
|
338
|
+
return r(s);
|
|
339
|
+
}(),
|
|
340
|
+
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.");
|
|
345
|
+
}
|
|
346
|
+
return r(s);
|
|
347
|
+
}(),
|
|
348
|
+
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.");
|
|
353
|
+
}
|
|
354
|
+
return r(s);
|
|
355
|
+
}(),
|
|
356
|
+
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.");
|
|
361
|
+
}
|
|
362
|
+
return r(s);
|
|
363
|
+
}(),
|
|
364
|
+
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.");
|
|
369
|
+
}
|
|
370
|
+
return r(s);
|
|
371
|
+
}(),
|
|
372
|
+
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.");
|
|
377
|
+
}
|
|
378
|
+
return r(s);
|
|
379
|
+
}(),
|
|
380
|
+
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.");
|
|
385
|
+
}
|
|
386
|
+
return r(s);
|
|
387
|
+
}(),
|
|
388
|
+
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.");
|
|
393
|
+
}
|
|
394
|
+
return r(s);
|
|
395
|
+
}(),
|
|
396
|
+
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");
|
|
401
|
+
}
|
|
402
|
+
return r(s);
|
|
403
|
+
}(),
|
|
404
|
+
N = 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");
|
|
409
|
+
}
|
|
410
|
+
return r(s);
|
|
411
|
+
}(),
|
|
412
|
+
K = 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");
|
|
417
|
+
}
|
|
418
|
+
return r(s);
|
|
419
|
+
}(),
|
|
420
|
+
U = 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");
|
|
425
|
+
}
|
|
426
|
+
return r(s);
|
|
427
|
+
}(),
|
|
428
|
+
z = 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");
|
|
433
|
+
}
|
|
434
|
+
return r(s);
|
|
435
|
+
}(),
|
|
436
|
+
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.");
|
|
441
|
+
}
|
|
442
|
+
return r(s);
|
|
443
|
+
}(),
|
|
444
|
+
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.");
|
|
449
|
+
}
|
|
450
|
+
return r(s);
|
|
451
|
+
}(),
|
|
452
|
+
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.");
|
|
457
|
+
}
|
|
458
|
+
return r(s);
|
|
459
|
+
}(),
|
|
460
|
+
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.");
|
|
465
|
+
}
|
|
466
|
+
return r(s);
|
|
467
|
+
}(),
|
|
468
|
+
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.");
|
|
473
|
+
}
|
|
474
|
+
return r(s);
|
|
475
|
+
}(),
|
|
476
|
+
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.");
|
|
481
|
+
}
|
|
482
|
+
return r(s);
|
|
483
|
+
}(),
|
|
484
|
+
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");
|
|
489
|
+
}
|
|
490
|
+
return r(s);
|
|
491
|
+
}(),
|
|
492
|
+
$ = 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");
|
|
497
|
+
}
|
|
498
|
+
return r(s);
|
|
499
|
+
}();
|
|
500
|
+
function X(e, t) {
|
|
33
501
|
return function (e) {
|
|
34
502
|
if (Array.isArray(e)) return e;
|
|
35
503
|
}(e) || function (e, t) {
|
|
@@ -58,46 +526,46 @@ function e(e, r) {
|
|
|
58
526
|
}
|
|
59
527
|
return a;
|
|
60
528
|
}
|
|
61
|
-
}(e,
|
|
529
|
+
}(e, t) || Z(e, t) || function () {
|
|
62
530
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
63
531
|
}();
|
|
64
532
|
}
|
|
65
|
-
function
|
|
533
|
+
function Z(e, t) {
|
|
66
534
|
if (e) {
|
|
67
|
-
if ("string" == typeof e) return
|
|
68
|
-
var
|
|
69
|
-
return "Object" ===
|
|
535
|
+
if ("string" == typeof e) return Q(e, t);
|
|
536
|
+
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
537
|
+
return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Q(e, t) : void 0;
|
|
70
538
|
}
|
|
71
539
|
}
|
|
72
|
-
function
|
|
540
|
+
function Q(e, t) {
|
|
73
541
|
(null == t || t > e.length) && (t = e.length);
|
|
74
542
|
for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
|
|
75
543
|
return n;
|
|
76
544
|
}
|
|
77
|
-
function
|
|
78
|
-
return
|
|
545
|
+
function ee(e) {
|
|
546
|
+
return ee = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
|
|
79
547
|
return _typeof(e);
|
|
80
548
|
} : function (e) {
|
|
81
549
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
|
|
82
|
-
},
|
|
550
|
+
}, ee(e);
|
|
83
551
|
}
|
|
84
|
-
function
|
|
552
|
+
function te() {
|
|
85
553
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
86
|
-
|
|
554
|
+
te = function te() {
|
|
87
555
|
return t;
|
|
88
556
|
};
|
|
89
557
|
var e,
|
|
90
558
|
t = {},
|
|
91
559
|
r = Object.prototype,
|
|
92
|
-
|
|
93
|
-
|
|
560
|
+
n = r.hasOwnProperty,
|
|
561
|
+
i = Object.defineProperty || function (e, t, r) {
|
|
94
562
|
e[t] = r.value;
|
|
95
563
|
},
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
function
|
|
564
|
+
o = "function" == typeof Symbol ? Symbol : {},
|
|
565
|
+
s = o.iterator || "@@iterator",
|
|
566
|
+
a = o.asyncIterator || "@@asyncIterator",
|
|
567
|
+
c = o.toStringTag || "@@toStringTag";
|
|
568
|
+
function u(e, t, r) {
|
|
101
569
|
return Object.defineProperty(e, t, {
|
|
102
570
|
value: r,
|
|
103
571
|
enumerable: !0,
|
|
@@ -106,21 +574,21 @@ function i() {
|
|
|
106
574
|
}), e[t];
|
|
107
575
|
}
|
|
108
576
|
try {
|
|
109
|
-
|
|
577
|
+
u({}, "");
|
|
110
578
|
} catch (e) {
|
|
111
|
-
|
|
579
|
+
u = function u(e, t, r) {
|
|
112
580
|
return e[t] = r;
|
|
113
581
|
};
|
|
114
582
|
}
|
|
115
|
-
function
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
a = new
|
|
119
|
-
return s
|
|
120
|
-
value:
|
|
121
|
-
}),
|
|
583
|
+
function l(e, t, r, n) {
|
|
584
|
+
var o = t && t.prototype instanceof v ? t : v,
|
|
585
|
+
s = Object.create(o.prototype),
|
|
586
|
+
a = new x(n || []);
|
|
587
|
+
return i(s, "_invoke", {
|
|
588
|
+
value: E(e, r, a)
|
|
589
|
+
}), s;
|
|
122
590
|
}
|
|
123
|
-
function
|
|
591
|
+
function d(e, t, r) {
|
|
124
592
|
try {
|
|
125
593
|
return {
|
|
126
594
|
type: "normal",
|
|
@@ -133,65 +601,65 @@ function i() {
|
|
|
133
601
|
};
|
|
134
602
|
}
|
|
135
603
|
}
|
|
136
|
-
t.wrap =
|
|
137
|
-
var
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
604
|
+
t.wrap = l;
|
|
605
|
+
var h = "suspendedStart",
|
|
606
|
+
p = "suspendedYield",
|
|
607
|
+
_ = "executing",
|
|
608
|
+
f = "completed",
|
|
609
|
+
m = {};
|
|
610
|
+
function v() {}
|
|
611
|
+
function b() {}
|
|
142
612
|
function g() {}
|
|
143
|
-
|
|
144
|
-
function
|
|
145
|
-
var S = {};
|
|
146
|
-
d(S, c, function () {
|
|
613
|
+
var y = {};
|
|
614
|
+
u(y, s, function () {
|
|
147
615
|
return this;
|
|
148
616
|
});
|
|
149
|
-
var
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
var
|
|
617
|
+
var k = Object.getPrototypeOf,
|
|
618
|
+
w = k && k(k(D([])));
|
|
619
|
+
w && w !== r && n.call(w, s) && (y = w);
|
|
620
|
+
var S = g.prototype = v.prototype = Object.create(y);
|
|
153
621
|
function P(e) {
|
|
154
622
|
["next", "throw", "return"].forEach(function (t) {
|
|
155
|
-
|
|
623
|
+
u(e, t, function (e) {
|
|
156
624
|
return this._invoke(t, e);
|
|
157
625
|
});
|
|
158
626
|
});
|
|
159
627
|
}
|
|
160
|
-
function
|
|
161
|
-
function r(i, s, a
|
|
162
|
-
var
|
|
163
|
-
if ("throw" !==
|
|
164
|
-
var
|
|
165
|
-
|
|
166
|
-
return
|
|
167
|
-
r("next", e,
|
|
628
|
+
function A(e, t) {
|
|
629
|
+
function r(i, o, s, a) {
|
|
630
|
+
var c = d(e[i], e, o);
|
|
631
|
+
if ("throw" !== c.type) {
|
|
632
|
+
var u = c.arg,
|
|
633
|
+
l = u.value;
|
|
634
|
+
return l && "object" == ee(l) && n.call(l, "__await") ? t.resolve(l.__await).then(function (e) {
|
|
635
|
+
r("next", e, s, a);
|
|
168
636
|
}, function (e) {
|
|
169
|
-
r("throw", e,
|
|
170
|
-
}) : t.resolve(
|
|
171
|
-
|
|
637
|
+
r("throw", e, s, a);
|
|
638
|
+
}) : t.resolve(l).then(function (e) {
|
|
639
|
+
u.value = e, s(u);
|
|
172
640
|
}, function (e) {
|
|
173
|
-
return r("throw", e,
|
|
641
|
+
return r("throw", e, s, a);
|
|
174
642
|
});
|
|
175
643
|
}
|
|
176
|
-
c
|
|
644
|
+
a(c.arg);
|
|
177
645
|
}
|
|
178
|
-
var
|
|
179
|
-
|
|
646
|
+
var o;
|
|
647
|
+
i(this, "_invoke", {
|
|
180
648
|
value: function value(e, n) {
|
|
181
|
-
function
|
|
649
|
+
function i() {
|
|
182
650
|
return new t(function (t, i) {
|
|
183
651
|
r(e, n, t, i);
|
|
184
652
|
});
|
|
185
653
|
}
|
|
186
|
-
return
|
|
654
|
+
return o = o ? o.then(i, i) : i();
|
|
187
655
|
}
|
|
188
656
|
});
|
|
189
657
|
}
|
|
190
|
-
function
|
|
191
|
-
var i =
|
|
658
|
+
function E(t, r, n) {
|
|
659
|
+
var i = h;
|
|
192
660
|
return function (o, s) {
|
|
193
|
-
if (i ===
|
|
194
|
-
if (i ===
|
|
661
|
+
if (i === _) throw new Error("Generator is already running");
|
|
662
|
+
if (i === f) {
|
|
195
663
|
if ("throw" === o) throw s;
|
|
196
664
|
return {
|
|
197
665
|
value: e,
|
|
@@ -203,93 +671,93 @@ function i() {
|
|
|
203
671
|
if (a) {
|
|
204
672
|
var c = C(a, n);
|
|
205
673
|
if (c) {
|
|
206
|
-
if (c ===
|
|
674
|
+
if (c === m) continue;
|
|
207
675
|
return c;
|
|
208
676
|
}
|
|
209
677
|
}
|
|
210
678
|
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
211
|
-
if (i ===
|
|
679
|
+
if (i === h) throw i = f, n.arg;
|
|
212
680
|
n.dispatchException(n.arg);
|
|
213
681
|
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
214
|
-
i =
|
|
215
|
-
var u =
|
|
682
|
+
i = _;
|
|
683
|
+
var u = d(t, r, n);
|
|
216
684
|
if ("normal" === u.type) {
|
|
217
|
-
if (i = n.done ?
|
|
685
|
+
if (i = n.done ? f : p, u.arg === m) continue;
|
|
218
686
|
return {
|
|
219
687
|
value: u.arg,
|
|
220
688
|
done: n.done
|
|
221
689
|
};
|
|
222
690
|
}
|
|
223
|
-
"throw" === u.type && (i =
|
|
691
|
+
"throw" === u.type && (i = f, n.method = "throw", n.arg = u.arg);
|
|
224
692
|
}
|
|
225
693
|
};
|
|
226
694
|
}
|
|
227
695
|
function C(t, r) {
|
|
228
696
|
var n = r.method,
|
|
229
697
|
i = t.iterator[n];
|
|
230
|
-
if (i === e) return r.delegate = null, "throw" === n && t.iterator["return"] && (r.method = "return", r.arg = e, C(t, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")),
|
|
231
|
-
var o =
|
|
232
|
-
if ("throw" === o.type) return r.method = "throw", r.arg = o.arg, r.delegate = null,
|
|
698
|
+
if (i === e) return r.delegate = null, "throw" === n && t.iterator["return"] && (r.method = "return", r.arg = e, C(t, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), m;
|
|
699
|
+
var o = d(i, t.iterator, r.arg);
|
|
700
|
+
if ("throw" === o.type) return r.method = "throw", r.arg = o.arg, r.delegate = null, m;
|
|
233
701
|
var s = o.arg;
|
|
234
|
-
return s ? s.done ? (r[t.resultName] = s.value, r.next = t.nextLoc, "return" !== r.method && (r.method = "next", r.arg = e), r.delegate = null,
|
|
702
|
+
return s ? s.done ? (r[t.resultName] = s.value, r.next = t.nextLoc, "return" !== r.method && (r.method = "next", r.arg = e), r.delegate = null, m) : s : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, m);
|
|
235
703
|
}
|
|
236
|
-
function
|
|
704
|
+
function T(e) {
|
|
237
705
|
var t = {
|
|
238
706
|
tryLoc: e[0]
|
|
239
707
|
};
|
|
240
708
|
1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t);
|
|
241
709
|
}
|
|
242
|
-
function
|
|
710
|
+
function O(e) {
|
|
243
711
|
var t = e.completion || {};
|
|
244
712
|
t.type = "normal", delete t.arg, e.completion = t;
|
|
245
713
|
}
|
|
246
|
-
function
|
|
714
|
+
function x(e) {
|
|
247
715
|
this.tryEntries = [{
|
|
248
716
|
tryLoc: "root"
|
|
249
|
-
}], e.forEach(
|
|
717
|
+
}], e.forEach(T, this), this.reset(!0);
|
|
250
718
|
}
|
|
251
719
|
function D(t) {
|
|
252
720
|
if (t || "" === t) {
|
|
253
|
-
var r = t[
|
|
721
|
+
var r = t[s];
|
|
254
722
|
if (r) return r.call(t);
|
|
255
723
|
if ("function" == typeof t.next) return t;
|
|
256
724
|
if (!isNaN(t.length)) {
|
|
257
725
|
var i = -1,
|
|
258
|
-
|
|
259
|
-
for (; ++i < t.length;) if (
|
|
726
|
+
o = function r() {
|
|
727
|
+
for (; ++i < t.length;) if (n.call(t, i)) return r.value = t[i], r.done = !1, r;
|
|
260
728
|
return r.value = e, r.done = !0, r;
|
|
261
729
|
};
|
|
262
|
-
return
|
|
730
|
+
return o.next = o;
|
|
263
731
|
}
|
|
264
732
|
}
|
|
265
|
-
throw new TypeError(
|
|
733
|
+
throw new TypeError(ee(t) + " is not iterable");
|
|
266
734
|
}
|
|
267
|
-
return
|
|
268
|
-
value:
|
|
735
|
+
return b.prototype = g, i(S, "constructor", {
|
|
736
|
+
value: g,
|
|
269
737
|
configurable: !0
|
|
270
|
-
}),
|
|
271
|
-
value:
|
|
738
|
+
}), i(g, "constructor", {
|
|
739
|
+
value: b,
|
|
272
740
|
configurable: !0
|
|
273
|
-
}),
|
|
741
|
+
}), b.displayName = u(g, c, "GeneratorFunction"), t.isGeneratorFunction = function (e) {
|
|
274
742
|
var t = "function" == typeof e && e.constructor;
|
|
275
|
-
return !!t && (t ===
|
|
743
|
+
return !!t && (t === b || "GeneratorFunction" === (t.displayName || t.name));
|
|
276
744
|
}, t.mark = function (e) {
|
|
277
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(e,
|
|
745
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, g) : (e.__proto__ = g, u(e, c, "GeneratorFunction")), e.prototype = Object.create(S), e;
|
|
278
746
|
}, t.awrap = function (e) {
|
|
279
747
|
return {
|
|
280
748
|
__await: e
|
|
281
749
|
};
|
|
282
|
-
}, P(
|
|
750
|
+
}, P(A.prototype), u(A.prototype, a, function () {
|
|
283
751
|
return this;
|
|
284
|
-
}), t.AsyncIterator =
|
|
752
|
+
}), t.AsyncIterator = A, t.async = function (e, r, n, i, o) {
|
|
285
753
|
void 0 === o && (o = Promise);
|
|
286
|
-
var s = new
|
|
754
|
+
var s = new A(l(e, r, n, i), o);
|
|
287
755
|
return t.isGeneratorFunction(r) ? s : s.next().then(function (e) {
|
|
288
756
|
return e.done ? e.value : s.next();
|
|
289
757
|
});
|
|
290
|
-
}, P(
|
|
758
|
+
}, P(S), u(S, c, "Generator"), u(S, s, function () {
|
|
291
759
|
return this;
|
|
292
|
-
}),
|
|
760
|
+
}), u(S, "toString", function () {
|
|
293
761
|
return "[object Generator]";
|
|
294
762
|
}), t.keys = function (e) {
|
|
295
763
|
var t = Object(e),
|
|
@@ -302,10 +770,10 @@ function i() {
|
|
|
302
770
|
}
|
|
303
771
|
return e.done = !0, e;
|
|
304
772
|
};
|
|
305
|
-
}, t.values = D,
|
|
306
|
-
constructor:
|
|
773
|
+
}, t.values = D, x.prototype = {
|
|
774
|
+
constructor: x,
|
|
307
775
|
reset: function reset(t) {
|
|
308
|
-
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(
|
|
776
|
+
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(O), !t) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = e);
|
|
309
777
|
},
|
|
310
778
|
stop: function stop() {
|
|
311
779
|
this.done = !0;
|
|
@@ -316,48 +784,48 @@ function i() {
|
|
|
316
784
|
dispatchException: function dispatchException(t) {
|
|
317
785
|
if (this.done) throw t;
|
|
318
786
|
var r = this;
|
|
319
|
-
function
|
|
787
|
+
function i(n, i) {
|
|
320
788
|
return a.type = "throw", a.arg = t, r.next = n, i && (r.method = "next", r.arg = e), !!i;
|
|
321
789
|
}
|
|
322
|
-
for (var
|
|
323
|
-
var s = this.tryEntries[
|
|
790
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
791
|
+
var s = this.tryEntries[o],
|
|
324
792
|
a = s.completion;
|
|
325
|
-
if ("root" === s.tryLoc) return
|
|
793
|
+
if ("root" === s.tryLoc) return i("end");
|
|
326
794
|
if (s.tryLoc <= this.prev) {
|
|
327
|
-
var c =
|
|
328
|
-
u =
|
|
795
|
+
var c = n.call(s, "catchLoc"),
|
|
796
|
+
u = n.call(s, "finallyLoc");
|
|
329
797
|
if (c && u) {
|
|
330
|
-
if (this.prev < s.catchLoc) return
|
|
331
|
-
if (this.prev < s.finallyLoc) return
|
|
798
|
+
if (this.prev < s.catchLoc) return i(s.catchLoc, !0);
|
|
799
|
+
if (this.prev < s.finallyLoc) return i(s.finallyLoc);
|
|
332
800
|
} else if (c) {
|
|
333
|
-
if (this.prev < s.catchLoc) return
|
|
801
|
+
if (this.prev < s.catchLoc) return i(s.catchLoc, !0);
|
|
334
802
|
} else {
|
|
335
803
|
if (!u) throw new Error("try statement without catch or finally");
|
|
336
|
-
if (this.prev < s.finallyLoc) return
|
|
804
|
+
if (this.prev < s.finallyLoc) return i(s.finallyLoc);
|
|
337
805
|
}
|
|
338
806
|
}
|
|
339
807
|
}
|
|
340
808
|
},
|
|
341
809
|
abrupt: function abrupt(e, t) {
|
|
342
810
|
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
343
|
-
var
|
|
344
|
-
if (
|
|
345
|
-
var
|
|
811
|
+
var i = this.tryEntries[r];
|
|
812
|
+
if (i.tryLoc <= this.prev && n.call(i, "finallyLoc") && this.prev < i.finallyLoc) {
|
|
813
|
+
var o = i;
|
|
346
814
|
break;
|
|
347
815
|
}
|
|
348
816
|
}
|
|
349
|
-
|
|
350
|
-
var s =
|
|
351
|
-
return s.type = e, s.arg = t,
|
|
817
|
+
o && ("break" === e || "continue" === e) && o.tryLoc <= t && t <= o.finallyLoc && (o = null);
|
|
818
|
+
var s = o ? o.completion : {};
|
|
819
|
+
return s.type = e, s.arg = t, o ? (this.method = "next", this.next = o.finallyLoc, m) : this.complete(s);
|
|
352
820
|
},
|
|
353
821
|
complete: function complete(e, t) {
|
|
354
822
|
if ("throw" === e.type) throw e.arg;
|
|
355
|
-
return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : "normal" === e.type && t && (this.next = t),
|
|
823
|
+
return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : "normal" === e.type && t && (this.next = t), m;
|
|
356
824
|
},
|
|
357
825
|
finish: function finish(e) {
|
|
358
826
|
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
|
|
359
827
|
var r = this.tryEntries[t];
|
|
360
|
-
if (r.finallyLoc === e) return this.complete(r.completion, r.afterLoc),
|
|
828
|
+
if (r.finallyLoc === e) return this.complete(r.completion, r.afterLoc), O(r), m;
|
|
361
829
|
}
|
|
362
830
|
},
|
|
363
831
|
"catch": function _catch(e) {
|
|
@@ -367,7 +835,7 @@ function i() {
|
|
|
367
835
|
var n = r.completion;
|
|
368
836
|
if ("throw" === n.type) {
|
|
369
837
|
var i = n.arg;
|
|
370
|
-
|
|
838
|
+
O(r);
|
|
371
839
|
}
|
|
372
840
|
return i;
|
|
373
841
|
}
|
|
@@ -379,69 +847,56 @@ function i() {
|
|
|
379
847
|
iterator: D(t),
|
|
380
848
|
resultName: r,
|
|
381
849
|
nextLoc: n
|
|
382
|
-
}, "next" === this.method && (this.arg = e),
|
|
850
|
+
}, "next" === this.method && (this.arg = e), m;
|
|
383
851
|
}
|
|
384
852
|
}, t;
|
|
385
853
|
}
|
|
386
|
-
function
|
|
854
|
+
function re(e, t) {
|
|
387
855
|
for (var r = 0; r < t.length; r++) {
|
|
388
|
-
var
|
|
389
|
-
|
|
390
|
-
if ("object" !==
|
|
856
|
+
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;
|
|
391
859
|
var r = e[Symbol.toPrimitive];
|
|
392
860
|
if (void 0 !== r) {
|
|
393
|
-
var
|
|
394
|
-
if ("object" !== n
|
|
861
|
+
var n = r.call(e, t || "default");
|
|
862
|
+
if ("object" !== ee(n)) return n;
|
|
395
863
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
396
864
|
}
|
|
397
865
|
return ("string" === t ? String : Number)(e);
|
|
398
|
-
}(
|
|
866
|
+
}(i, "string"), "symbol" === ee(o) ? o : String(o)), n);
|
|
399
867
|
}
|
|
400
|
-
var
|
|
868
|
+
var i, o;
|
|
401
869
|
}
|
|
402
|
-
function
|
|
403
|
-
return t &&
|
|
870
|
+
function ne(e, t, r) {
|
|
871
|
+
return t && re(e.prototype, t), r && re(e, r), Object.defineProperty(e, "prototype", {
|
|
404
872
|
writable: !1
|
|
405
873
|
}), e;
|
|
406
874
|
}
|
|
407
|
-
function
|
|
875
|
+
function ie(e, t) {
|
|
408
876
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
409
877
|
}
|
|
410
|
-
function
|
|
411
|
-
|
|
412
|
-
e.prototype = Object.create(t && t.prototype, {
|
|
413
|
-
constructor: {
|
|
414
|
-
value: e,
|
|
415
|
-
writable: !0,
|
|
416
|
-
configurable: !0
|
|
417
|
-
}
|
|
418
|
-
}), Object.defineProperty(e, "prototype", {
|
|
419
|
-
writable: !1
|
|
420
|
-
}), t && _(e, t);
|
|
421
|
-
}
|
|
422
|
-
function u(e) {
|
|
423
|
-
var t = p();
|
|
878
|
+
function oe(e) {
|
|
879
|
+
var t = ce();
|
|
424
880
|
return function () {
|
|
425
881
|
var r,
|
|
426
|
-
|
|
882
|
+
n = le(e);
|
|
427
883
|
if (t) {
|
|
428
|
-
var
|
|
429
|
-
r = Reflect.construct(
|
|
430
|
-
} else r =
|
|
884
|
+
var i = le(this).constructor;
|
|
885
|
+
r = Reflect.construct(n, arguments, i);
|
|
886
|
+
} else r = n.apply(this, arguments);
|
|
431
887
|
return function (e, t) {
|
|
432
|
-
if (t && ("object" ===
|
|
888
|
+
if (t && ("object" === ee(t) || "function" == typeof t)) return t;
|
|
433
889
|
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
434
|
-
return
|
|
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);
|
|
435
894
|
}(this, r);
|
|
436
895
|
};
|
|
437
896
|
}
|
|
438
|
-
function
|
|
439
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
440
|
-
return e;
|
|
441
|
-
}
|
|
442
|
-
function d(e) {
|
|
897
|
+
function se(e) {
|
|
443
898
|
var t = "function" == typeof Map ? new Map() : void 0;
|
|
444
|
-
return
|
|
899
|
+
return se = function se(e) {
|
|
445
900
|
if (null === e || !function (e) {
|
|
446
901
|
try {
|
|
447
902
|
return -1 !== Function.toString.call(e).indexOf("[native code]");
|
|
@@ -455,7 +910,7 @@ function d(e) {
|
|
|
455
910
|
t.set(e, r);
|
|
456
911
|
}
|
|
457
912
|
function r() {
|
|
458
|
-
return
|
|
913
|
+
return ae(e, arguments, le(this).constructor);
|
|
459
914
|
}
|
|
460
915
|
return r.prototype = Object.create(e.prototype, {
|
|
461
916
|
constructor: {
|
|
@@ -464,18 +919,18 @@ function d(e) {
|
|
|
464
919
|
writable: !0,
|
|
465
920
|
configurable: !0
|
|
466
921
|
}
|
|
467
|
-
}),
|
|
468
|
-
},
|
|
922
|
+
}), ue(r, e);
|
|
923
|
+
}, se(e);
|
|
469
924
|
}
|
|
470
|
-
function
|
|
471
|
-
return
|
|
925
|
+
function ae(e, t, r) {
|
|
926
|
+
return ae = ce() ? Reflect.construct.bind() : function (e, t, r) {
|
|
472
927
|
var n = [null];
|
|
473
928
|
n.push.apply(n, t);
|
|
474
929
|
var i = new (Function.bind.apply(e, n))();
|
|
475
|
-
return r &&
|
|
476
|
-
},
|
|
930
|
+
return r && ue(i, r.prototype), i;
|
|
931
|
+
}, ae.apply(null, arguments);
|
|
477
932
|
}
|
|
478
|
-
function
|
|
933
|
+
function ce() {
|
|
479
934
|
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
|
|
480
935
|
if (Reflect.construct.sham) return !1;
|
|
481
936
|
if ("function" == typeof Proxy) return !0;
|
|
@@ -485,21 +940,25 @@ function p() {
|
|
|
485
940
|
return !1;
|
|
486
941
|
}
|
|
487
942
|
}
|
|
488
|
-
function
|
|
489
|
-
return
|
|
943
|
+
function ue(e, t) {
|
|
944
|
+
return ue = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
|
|
490
945
|
return e.__proto__ = t, e;
|
|
491
|
-
},
|
|
946
|
+
}, ue(e, t);
|
|
492
947
|
}
|
|
493
|
-
function
|
|
494
|
-
return
|
|
948
|
+
function le(e) {
|
|
949
|
+
return le = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
|
|
495
950
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
496
|
-
},
|
|
951
|
+
}, le(e);
|
|
497
952
|
}
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
})
|
|
501
|
-
|
|
502
|
-
|
|
953
|
+
exports.B2BProducts = void 0, function (e) {
|
|
954
|
+
e.emailMagicLinks = "emailMagicLinks", e.sso = "sso", e.passwords = "passwords", e.oauth = "oauth";
|
|
955
|
+
}(exports.B2BProducts || (exports.B2BProducts = {})), exports.AuthFlowType = void 0, function (e) {
|
|
956
|
+
e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
|
|
957
|
+
}(exports.AuthFlowType || (exports.AuthFlowType = {})), exports.B2BOAuthProviders = void 0, function (e) {
|
|
958
|
+
e.Google = "google", e.Microsoft = "microsoft";
|
|
959
|
+
}(exports.B2BOAuthProviders || (exports.B2BOAuthProviders = {}));
|
|
960
|
+
var de;
|
|
961
|
+
function he(e, t, r, n) {
|
|
503
962
|
return new (r || (r = Promise))(function (i, o) {
|
|
504
963
|
function s(e) {
|
|
505
964
|
try {
|
|
@@ -524,168 +983,105 @@ function S(e, t, r, n) {
|
|
|
524
983
|
c((n = n.apply(e, t || [])).next());
|
|
525
984
|
});
|
|
526
985
|
}
|
|
527
|
-
"function" == typeof SuppressedError && SuppressedError,
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
P,
|
|
544
|
-
T,
|
|
545
|
-
O = function (e) {
|
|
546
|
-
c(r, d(Error));
|
|
547
|
-
var t = u(r);
|
|
548
|
-
function r(e, n) {
|
|
549
|
-
var i;
|
|
550
|
-
return a(this, r), (i = t.call(this, e + "\n" + n)).message = e + "\n" + n, i.name = "SDKAPIUnreachableError", i.details = n, Object.setPrototypeOf(l(i), r.prototype), i;
|
|
551
|
-
}
|
|
552
|
-
return s(r);
|
|
553
|
-
}(),
|
|
554
|
-
C = function (e) {
|
|
555
|
-
c(r, d(Error));
|
|
556
|
-
var t = u(r);
|
|
557
|
-
function r(e, n) {
|
|
558
|
-
var i;
|
|
559
|
-
return a(this, r), (i = t.call(this)).name = "StytchSDKUsageError", i.message = "Invalid call to ".concat(e, "\n") + n, i;
|
|
560
|
-
}
|
|
561
|
-
return s(r);
|
|
562
|
-
}(),
|
|
563
|
-
x = function (e) {
|
|
564
|
-
c(r, d(Error));
|
|
565
|
-
var t = u(r);
|
|
566
|
-
function r(e) {
|
|
567
|
-
var n, i;
|
|
568
|
-
a(this, r), (n = t.call(this)).name = "StytchSDKSchemaError";
|
|
569
|
-
var o = null === (i = e.body) || void 0 === i ? void 0 : i.map(function (e) {
|
|
570
|
-
return "".concat(e.dataPath, ": ").concat(e.message);
|
|
571
|
-
}).join("\n");
|
|
572
|
-
return n.message = "[400] Request does not match expected schema\n".concat(o), n;
|
|
573
|
-
}
|
|
574
|
-
return s(r);
|
|
575
|
-
}(),
|
|
576
|
-
B = function (e) {
|
|
577
|
-
c(r, d(Error));
|
|
578
|
-
var t = u(r);
|
|
579
|
-
function r(e) {
|
|
580
|
-
var n;
|
|
581
|
-
a(this, r), (n = t.call(this)).name = "StytchSDKAPIError";
|
|
582
|
-
var i = e.status_code,
|
|
583
|
-
o = e.error_type,
|
|
584
|
-
s = e.error_message,
|
|
585
|
-
c = e.error_url,
|
|
586
|
-
u = e.request_id;
|
|
587
|
-
return n.error_type = o, n.error_message = s, n.error_url = c, n.request_id = u, n.status_code = i, n.message = "[".concat(i, "] ").concat(o, "\n") + "".concat(s, "\n") + "See ".concat(c, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : ""), n;
|
|
588
|
-
}
|
|
589
|
-
return s(r);
|
|
590
|
-
}(),
|
|
591
|
-
R = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"];
|
|
592
|
-
!function (e) {
|
|
593
|
-
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";
|
|
594
|
-
}(w || (w = {})), function (e) {
|
|
595
|
-
e.emailMagicLinks = "emailMagicLinks", e.sso = "sso", e.passwords = "passwords", e.oauth = "oauth";
|
|
596
|
-
}(A || (A = {})), function (e) {
|
|
597
|
-
e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
|
|
598
|
-
}(E || (E = {})), function (e) {
|
|
599
|
-
e.Google = "google", e.Microsoft = "microsoft";
|
|
600
|
-
}(P || (P = {})), (T || (T = {})).RequiredCatcha = "Catcha Required";
|
|
601
|
-
var D,
|
|
602
|
-
I = function (e) {
|
|
603
|
-
c(r, d(Error));
|
|
604
|
-
var t = u(r);
|
|
986
|
+
"function" == typeof SuppressedError && SuppressedError, (de || (de = {})).RequiredCatcha = "Catcha Required";
|
|
987
|
+
var pe,
|
|
988
|
+
_e = function (e) {
|
|
989
|
+
!function (e, t) {
|
|
990
|
+
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
991
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
992
|
+
constructor: {
|
|
993
|
+
value: e,
|
|
994
|
+
writable: !0,
|
|
995
|
+
configurable: !0
|
|
996
|
+
}
|
|
997
|
+
}), Object.defineProperty(e, "prototype", {
|
|
998
|
+
writable: !1
|
|
999
|
+
}), t && ue(e, t);
|
|
1000
|
+
}(r, se(Error));
|
|
1001
|
+
var t = oe(r);
|
|
605
1002
|
function r(e) {
|
|
606
1003
|
var n;
|
|
607
|
-
return
|
|
1004
|
+
return ie(this, r), (n = t.call(this, e)).type = e, n;
|
|
608
1005
|
}
|
|
609
|
-
return
|
|
1006
|
+
return ne(r);
|
|
610
1007
|
}();
|
|
611
|
-
function
|
|
1008
|
+
function fe(e) {
|
|
612
1009
|
var t,
|
|
613
1010
|
r = e.method,
|
|
614
|
-
n = e.
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
return i().wrap(function (e) {
|
|
1011
|
+
n = e.finalURL,
|
|
1012
|
+
i = e.basicAuthHeader,
|
|
1013
|
+
o = e.xSDKClientHeader,
|
|
1014
|
+
s = e.xSDKParentHostHeader,
|
|
1015
|
+
a = e.body;
|
|
1016
|
+
return he(this, void 0, void 0, te().mark(function e() {
|
|
1017
|
+
var c, u, l, d, h, p;
|
|
1018
|
+
return te().wrap(function (e) {
|
|
623
1019
|
for (;;) switch (e.prev = e.next) {
|
|
624
1020
|
case 0:
|
|
625
|
-
return
|
|
626
|
-
Authorization:
|
|
1021
|
+
return c = {
|
|
1022
|
+
Authorization: i,
|
|
627
1023
|
"Content-Type": "application/json",
|
|
628
|
-
"X-SDK-Client":
|
|
629
|
-
},
|
|
1024
|
+
"X-SDK-Client": o
|
|
1025
|
+
}, s && (c["X-SDK-Parent-Host"] = s), u = {
|
|
630
1026
|
method: r,
|
|
631
|
-
headers:
|
|
632
|
-
body:
|
|
633
|
-
}, e.prev = 3, e.next = 6, fetch(
|
|
1027
|
+
headers: c,
|
|
1028
|
+
body: a && JSON.stringify(a)
|
|
1029
|
+
}, e.prev = 3, e.next = 6, fetch(n, u);
|
|
634
1030
|
case 6:
|
|
635
|
-
|
|
1031
|
+
l = e.sent, e.next = 14;
|
|
636
1032
|
break;
|
|
637
1033
|
case 9:
|
|
638
1034
|
if (e.prev = 9, e.t0 = e["catch"](3), "Failed to fetch" !== e.t0.message) {
|
|
639
1035
|
e.next = 13;
|
|
640
1036
|
break;
|
|
641
1037
|
}
|
|
642
|
-
throw new
|
|
1038
|
+
throw new b("Unable to contact the Stytch servers. Are you online?");
|
|
643
1039
|
case 13:
|
|
644
1040
|
throw e.t0;
|
|
645
1041
|
case 14:
|
|
646
|
-
if (!(
|
|
1042
|
+
if (!(l.status <= 299)) {
|
|
647
1043
|
e.next = 25;
|
|
648
1044
|
break;
|
|
649
1045
|
}
|
|
650
|
-
return e.prev = 15, e.next = 18,
|
|
1046
|
+
return e.prev = 15, e.next = 18, l.json();
|
|
651
1047
|
case 18:
|
|
652
|
-
return
|
|
1048
|
+
return d = e.sent, e.abrupt("return", d.data);
|
|
653
1049
|
case 22:
|
|
654
|
-
throw e.prev = 22, e.t1 = e["catch"](15), new
|
|
1050
|
+
throw e.prev = 22, e.t1 = e["catch"](15), new b("Invalid JSON response from the Stytch servers.");
|
|
655
1051
|
case 25:
|
|
656
|
-
if (200 ===
|
|
1052
|
+
if (200 === l.status || !(null === (t = l.headers.get("content-type")) || void 0 === t ? void 0 : t.includes("application/json"))) {
|
|
657
1053
|
e.next = 38;
|
|
658
1054
|
break;
|
|
659
1055
|
}
|
|
660
|
-
return e.prev = 26, e.next = 29,
|
|
1056
|
+
return e.prev = 26, e.next = 29, l.json();
|
|
661
1057
|
case 29:
|
|
662
|
-
|
|
1058
|
+
h = e.sent, e.next = 35;
|
|
663
1059
|
break;
|
|
664
1060
|
case 32:
|
|
665
|
-
throw e.prev = 32, e.t2 = e["catch"](26), new
|
|
1061
|
+
throw e.prev = 32, e.t2 = e["catch"](26), new b("Invalid or no response from server");
|
|
666
1062
|
case 35:
|
|
667
|
-
if (!("body" in
|
|
1063
|
+
if (!("body" in h || "params" in h || "query" in h)) {
|
|
668
1064
|
e.next = 37;
|
|
669
1065
|
break;
|
|
670
1066
|
}
|
|
671
|
-
throw new
|
|
1067
|
+
throw new g(h);
|
|
672
1068
|
case 37:
|
|
673
|
-
throw new
|
|
1069
|
+
throw new y(h);
|
|
674
1070
|
case 38:
|
|
675
|
-
return e.prev = 38, e.next = 41,
|
|
1071
|
+
return e.prev = 38, e.next = 41, l.text();
|
|
676
1072
|
case 41:
|
|
677
|
-
|
|
1073
|
+
p = e.sent, e.next = 47;
|
|
678
1074
|
break;
|
|
679
1075
|
case 44:
|
|
680
|
-
throw e.prev = 44, e.t3 = e["catch"](38), new
|
|
1076
|
+
throw e.prev = 44, e.t3 = e["catch"](38), new b("Invalid response from the Stytch servers.");
|
|
681
1077
|
case 47:
|
|
682
|
-
if (!
|
|
1078
|
+
if (!p.includes("Captcha required")) {
|
|
683
1079
|
e.next = 49;
|
|
684
1080
|
break;
|
|
685
1081
|
}
|
|
686
|
-
throw new
|
|
1082
|
+
throw new _e(de.RequiredCatcha);
|
|
687
1083
|
case 49:
|
|
688
|
-
throw new
|
|
1084
|
+
throw new b("Invalid response from the Stytch servers.");
|
|
689
1085
|
case 50:
|
|
690
1086
|
case "end":
|
|
691
1087
|
return e.stop();
|
|
@@ -693,43 +1089,43 @@ function L(e) {
|
|
|
693
1089
|
}, e, null, [[3, 9], [15, 22], [26, 32], [38, 44]]);
|
|
694
1090
|
}));
|
|
695
1091
|
}
|
|
696
|
-
var
|
|
697
|
-
function
|
|
698
|
-
if (!
|
|
699
|
-
return
|
|
1092
|
+
var me = new Uint8Array(16);
|
|
1093
|
+
function ve() {
|
|
1094
|
+
if (!pe && !(pe = "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");
|
|
1095
|
+
return pe(me);
|
|
700
1096
|
}
|
|
701
|
-
var
|
|
702
|
-
for (var
|
|
703
|
-
function
|
|
1097
|
+
var be = /^(?:[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;
|
|
1098
|
+
for (var ge = [], ye = 0; ye < 256; ++ye) ge.push((ye + 256).toString(16).substr(1));
|
|
1099
|
+
function ke(e) {
|
|
704
1100
|
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
|
|
705
|
-
r = (
|
|
1101
|
+
r = (ge[e[t + 0]] + ge[e[t + 1]] + ge[e[t + 2]] + ge[e[t + 3]] + "-" + ge[e[t + 4]] + ge[e[t + 5]] + "-" + ge[e[t + 6]] + ge[e[t + 7]] + "-" + ge[e[t + 8]] + ge[e[t + 9]] + "-" + ge[e[t + 10]] + ge[e[t + 11]] + ge[e[t + 12]] + ge[e[t + 13]] + ge[e[t + 14]] + ge[e[t + 15]]).toLowerCase();
|
|
706
1102
|
if (!function (e) {
|
|
707
|
-
return "string" == typeof e &&
|
|
1103
|
+
return "string" == typeof e && be.test(e);
|
|
708
1104
|
}(r)) throw TypeError("Stringified UUID is invalid");
|
|
709
1105
|
return r;
|
|
710
1106
|
}
|
|
711
|
-
function
|
|
712
|
-
var n = (e = e || {}).random || (e.rng ||
|
|
1107
|
+
function we(e, t, r) {
|
|
1108
|
+
var n = (e = e || {}).random || (e.rng || ve)();
|
|
713
1109
|
if (n[6] = 15 & n[6] | 64, n[8] = 63 & n[8] | 128, t) {
|
|
714
1110
|
r = r || 0;
|
|
715
1111
|
for (var i = 0; i < 16; ++i) t[r + i] = n[i];
|
|
716
1112
|
return t;
|
|
717
1113
|
}
|
|
718
|
-
return
|
|
1114
|
+
return ke(n);
|
|
719
1115
|
}
|
|
720
|
-
var
|
|
721
|
-
function
|
|
722
|
-
return
|
|
723
|
-
return
|
|
1116
|
+
var Se = {};
|
|
1117
|
+
function Pe(e, t) {
|
|
1118
|
+
return he(this, void 0, void 0, te().mark(function r() {
|
|
1119
|
+
return te().wrap(function (r) {
|
|
724
1120
|
for (;;) switch (r.prev = r.next) {
|
|
725
1121
|
case 0:
|
|
726
|
-
if (void 0 ===
|
|
1122
|
+
if (void 0 === Se[e]) {
|
|
727
1123
|
r.next = 2;
|
|
728
1124
|
break;
|
|
729
1125
|
}
|
|
730
|
-
return r.abrupt("return",
|
|
1126
|
+
return r.abrupt("return", Se[e]);
|
|
731
1127
|
case 2:
|
|
732
|
-
return
|
|
1128
|
+
return Se[e] = Ae(e, t), r.abrupt("return", Se[e]);
|
|
733
1129
|
case 4:
|
|
734
1130
|
case "end":
|
|
735
1131
|
return r.stop();
|
|
@@ -737,10 +1133,10 @@ function H(e, t) {
|
|
|
737
1133
|
}, r);
|
|
738
1134
|
}));
|
|
739
1135
|
}
|
|
740
|
-
function
|
|
1136
|
+
function Ae(e, t) {
|
|
741
1137
|
return new Promise(function (r, n) {
|
|
742
1138
|
var i = function (e) {
|
|
743
|
-
var t =
|
|
1139
|
+
var t = Ee(e);
|
|
744
1140
|
if (t[0]) return t[0];
|
|
745
1141
|
}(e);
|
|
746
1142
|
if (i && "true" === i.dataset.loaded) try {
|
|
@@ -764,130 +1160,130 @@ function G(e, t) {
|
|
|
764
1160
|
});
|
|
765
1161
|
});
|
|
766
1162
|
}
|
|
767
|
-
var
|
|
1163
|
+
var Ee = function Ee(e) {
|
|
768
1164
|
return document.querySelectorAll('script[src="'.concat(e, '"]'));
|
|
769
1165
|
};
|
|
770
|
-
var
|
|
771
|
-
|
|
772
|
-
|
|
1166
|
+
var Ce,
|
|
1167
|
+
Te = ["[Stytch]"],
|
|
1168
|
+
Oe = function Oe() {
|
|
773
1169
|
for (var e, t = arguments.length, r = new Array(t), n = 0; n < t; n++) r[n] = arguments[n];
|
|
774
|
-
return (e = console).warn.apply(e,
|
|
1170
|
+
return (e = console).warn.apply(e, Te.concat(r));
|
|
775
1171
|
},
|
|
776
|
-
|
|
1172
|
+
xe = function xe() {
|
|
777
1173
|
for (var e, t = arguments.length, r = new Array(t), n = 0; n < t; n++) r[n] = arguments[n];
|
|
778
|
-
return (e = console).error.apply(e,
|
|
1174
|
+
return (e = console).error.apply(e, Te.concat(r));
|
|
779
1175
|
},
|
|
780
|
-
|
|
781
|
-
|
|
1176
|
+
De = "\nYou can find your public token at https://stytch.com/dashboard/api-keys.",
|
|
1177
|
+
Ie = function Ie(e) {
|
|
782
1178
|
return e.includes("public-token-test");
|
|
783
1179
|
},
|
|
784
|
-
|
|
785
|
-
var
|
|
786
|
-
isObject: function isObject(
|
|
787
|
-
var
|
|
788
|
-
if (!
|
|
789
|
-
return
|
|
1180
|
+
Be = function Be(e) {
|
|
1181
|
+
var t = {
|
|
1182
|
+
isObject: function isObject(r, n) {
|
|
1183
|
+
var i = "object" === ee(n) && !Array.isArray(n) && null !== n;
|
|
1184
|
+
if (!i) throw new p(e, r + " must be an object.");
|
|
1185
|
+
return t;
|
|
790
1186
|
},
|
|
791
|
-
isOptionalObject: function isOptionalObject(e,
|
|
792
|
-
return void 0 ===
|
|
1187
|
+
isOptionalObject: function isOptionalObject(e, r) {
|
|
1188
|
+
return void 0 === r ? t : t.isObject(e, r);
|
|
793
1189
|
},
|
|
794
|
-
isString: function isString(
|
|
795
|
-
if ("string" != typeof n) throw new
|
|
796
|
-
return
|
|
1190
|
+
isString: function isString(r, n) {
|
|
1191
|
+
if ("string" != typeof n) throw new p(e, r + " must be a string.");
|
|
1192
|
+
return t;
|
|
797
1193
|
},
|
|
798
|
-
isOptionalString: function isOptionalString(e,
|
|
799
|
-
return void 0 ===
|
|
1194
|
+
isOptionalString: function isOptionalString(e, r) {
|
|
1195
|
+
return void 0 === r ? t : t.isString(e, r);
|
|
800
1196
|
},
|
|
801
|
-
isStringArray: function isStringArray(
|
|
802
|
-
if (!Array.isArray(
|
|
803
|
-
var
|
|
804
|
-
|
|
805
|
-
var
|
|
806
|
-
if (!
|
|
807
|
-
if (Array.isArray(e) || (
|
|
808
|
-
|
|
809
|
-
var
|
|
810
|
-
|
|
1197
|
+
isStringArray: function isStringArray(r, n) {
|
|
1198
|
+
if (!Array.isArray(n)) throw new p(e, r + " must be an array of strings.");
|
|
1199
|
+
var i,
|
|
1200
|
+
o = function (e, t) {
|
|
1201
|
+
var r = "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
1202
|
+
if (!r) {
|
|
1203
|
+
if (Array.isArray(e) || (r = Z(e)) || t && e && "number" == typeof e.length) {
|
|
1204
|
+
r && (e = r);
|
|
1205
|
+
var _n = 0,
|
|
1206
|
+
i = function i() {};
|
|
811
1207
|
return {
|
|
812
|
-
s:
|
|
1208
|
+
s: i,
|
|
813
1209
|
n: function n() {
|
|
814
|
-
return
|
|
1210
|
+
return _n >= e.length ? {
|
|
815
1211
|
done: !0
|
|
816
1212
|
} : {
|
|
817
1213
|
done: !1,
|
|
818
|
-
value: e[
|
|
1214
|
+
value: e[_n++]
|
|
819
1215
|
};
|
|
820
1216
|
},
|
|
821
1217
|
e: function e(_e2) {
|
|
822
1218
|
throw _e2;
|
|
823
1219
|
},
|
|
824
|
-
f:
|
|
1220
|
+
f: i
|
|
825
1221
|
};
|
|
826
1222
|
}
|
|
827
1223
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
828
1224
|
}
|
|
829
|
-
var
|
|
830
|
-
|
|
831
|
-
|
|
1225
|
+
var o,
|
|
1226
|
+
s = !0,
|
|
1227
|
+
a = !1;
|
|
832
1228
|
return {
|
|
833
1229
|
s: function s() {
|
|
834
|
-
|
|
1230
|
+
r = r.call(e);
|
|
835
1231
|
},
|
|
836
1232
|
n: function n() {
|
|
837
|
-
var e =
|
|
838
|
-
return
|
|
1233
|
+
var e = r.next();
|
|
1234
|
+
return s = e.done, e;
|
|
839
1235
|
},
|
|
840
1236
|
e: function e(_e3) {
|
|
841
|
-
|
|
1237
|
+
a = !0, o = _e3;
|
|
842
1238
|
},
|
|
843
1239
|
f: function f() {
|
|
844
1240
|
try {
|
|
845
|
-
|
|
1241
|
+
s || null == r["return"] || r["return"]();
|
|
846
1242
|
} finally {
|
|
847
|
-
if (
|
|
1243
|
+
if (a) throw o;
|
|
848
1244
|
}
|
|
849
1245
|
}
|
|
850
1246
|
};
|
|
851
|
-
}(
|
|
1247
|
+
}(n);
|
|
852
1248
|
try {
|
|
853
|
-
for (
|
|
854
|
-
if ("string" != typeof
|
|
1249
|
+
for (o.s(); !(i = o.n()).done;) {
|
|
1250
|
+
if ("string" != typeof i.value) throw new p(e, r + " must be an array of strings.");
|
|
855
1251
|
}
|
|
856
1252
|
} catch (e) {
|
|
857
|
-
|
|
1253
|
+
o.e(e);
|
|
858
1254
|
} finally {
|
|
859
|
-
|
|
1255
|
+
o.f();
|
|
860
1256
|
}
|
|
861
|
-
return
|
|
1257
|
+
return t;
|
|
862
1258
|
},
|
|
863
|
-
isOptionalStringArray: function isOptionalStringArray(e,
|
|
864
|
-
return void 0 ===
|
|
1259
|
+
isOptionalStringArray: function isOptionalStringArray(e, r) {
|
|
1260
|
+
return void 0 === r ? t : t.isStringArray(e, r);
|
|
865
1261
|
},
|
|
866
|
-
isNumber: function isNumber(
|
|
867
|
-
if ("number" != typeof n) throw new
|
|
868
|
-
return
|
|
1262
|
+
isNumber: function isNumber(r, n) {
|
|
1263
|
+
if ("number" != typeof n) throw new p(e, r + " must be a number.");
|
|
1264
|
+
return t;
|
|
869
1265
|
},
|
|
870
|
-
isOptionalNumber: function isOptionalNumber(e,
|
|
871
|
-
return void 0 ===
|
|
1266
|
+
isOptionalNumber: function isOptionalNumber(e, r) {
|
|
1267
|
+
return void 0 === r ? t : t.isNumber(e, r);
|
|
872
1268
|
},
|
|
873
|
-
isBoolean: function isBoolean(
|
|
874
|
-
if ("boolean" != typeof n) throw new
|
|
875
|
-
return
|
|
1269
|
+
isBoolean: function isBoolean(r, n) {
|
|
1270
|
+
if ("boolean" != typeof n) throw new p(e, r + " must be a boolean.");
|
|
1271
|
+
return t;
|
|
876
1272
|
},
|
|
877
|
-
isOptionalBoolean: function isOptionalBoolean(e,
|
|
878
|
-
return void 0 ===
|
|
1273
|
+
isOptionalBoolean: function isOptionalBoolean(e, r) {
|
|
1274
|
+
return void 0 === r ? t : t.isBoolean(e, r);
|
|
879
1275
|
}
|
|
880
1276
|
};
|
|
881
|
-
return
|
|
1277
|
+
return t;
|
|
882
1278
|
},
|
|
883
|
-
|
|
884
|
-
var
|
|
885
|
-
|
|
1279
|
+
Re = ne(function e(t, r, n) {
|
|
1280
|
+
var i = this,
|
|
1281
|
+
o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : function () {
|
|
886
1282
|
return Promise.resolve(void 0);
|
|
887
1283
|
};
|
|
888
|
-
|
|
889
|
-
return
|
|
890
|
-
return
|
|
1284
|
+
ie(this, e), this.bootstrapPromise = n, this.isEnabled = function () {
|
|
1285
|
+
return he(i, void 0, void 0, te().mark(function e() {
|
|
1286
|
+
return te().wrap(function (e) {
|
|
891
1287
|
for (;;) switch (e.prev = e.next) {
|
|
892
1288
|
case 0:
|
|
893
1289
|
return e.abrupt("return", this.state.then(function (e) {
|
|
@@ -900,20 +1296,20 @@ var Y,
|
|
|
900
1296
|
}, e, this);
|
|
901
1297
|
}));
|
|
902
1298
|
}, this.getTelemetryID = function () {
|
|
903
|
-
return
|
|
904
|
-
var t, r, n,
|
|
905
|
-
return
|
|
1299
|
+
return he(i, void 0, void 0, te().mark(function e() {
|
|
1300
|
+
var t, r, n, i;
|
|
1301
|
+
return te().wrap(function (e) {
|
|
906
1302
|
for (;;) switch (e.prev = e.next) {
|
|
907
1303
|
case 0:
|
|
908
1304
|
return e.next = 2, this.state;
|
|
909
1305
|
case 2:
|
|
910
|
-
if (t = e.sent, r = t.publicToken, n = t.enabled,
|
|
1306
|
+
if (t = e.sent, r = t.publicToken, n = t.enabled, i = t.dfpBackendURL, n) {
|
|
911
1307
|
e.next = 8;
|
|
912
1308
|
break;
|
|
913
1309
|
}
|
|
914
1310
|
return e.abrupt("return", void 0);
|
|
915
1311
|
case 8:
|
|
916
|
-
return e.next = 10, window.GetTelemetryID(r, "".concat(
|
|
1312
|
+
return e.next = 10, window.GetTelemetryID(r, "".concat(i, "/submit"));
|
|
917
1313
|
case 10:
|
|
918
1314
|
return e.abrupt("return", e.sent);
|
|
919
1315
|
case 11:
|
|
@@ -923,43 +1319,43 @@ var Y,
|
|
|
923
1319
|
}, e, this);
|
|
924
1320
|
}));
|
|
925
1321
|
}, this.getDFPTelemetryIDAndCaptcha = function () {
|
|
926
|
-
return
|
|
927
|
-
var t, r, n, o, s
|
|
928
|
-
return
|
|
1322
|
+
return he(i, void 0, void 0, te().mark(function e() {
|
|
1323
|
+
var t, r, n, i, o, s;
|
|
1324
|
+
return te().wrap(function (e) {
|
|
929
1325
|
for (;;) switch (e.prev = e.next) {
|
|
930
1326
|
case 0:
|
|
931
1327
|
return e.next = 2, this.state;
|
|
932
1328
|
case 2:
|
|
933
|
-
if (t = e.sent, r = t.enabled, n = t.executeRecaptcha,
|
|
1329
|
+
if (t = e.sent, r = t.enabled, n = t.executeRecaptcha, i = t.mode, o = void 0, s = void 0, r) {
|
|
934
1330
|
e.next = 12;
|
|
935
1331
|
break;
|
|
936
1332
|
}
|
|
937
1333
|
return e.next = 11, n();
|
|
938
1334
|
case 11:
|
|
939
|
-
|
|
1335
|
+
s = e.sent;
|
|
940
1336
|
case 12:
|
|
941
|
-
if ("DECISIONING" !==
|
|
1337
|
+
if ("DECISIONING" !== i) {
|
|
942
1338
|
e.next = 18;
|
|
943
1339
|
break;
|
|
944
1340
|
}
|
|
945
1341
|
return e.next = 15, this.getTelemetryID();
|
|
946
1342
|
case 15:
|
|
947
|
-
|
|
1343
|
+
o = e.sent, e.next = 25;
|
|
948
1344
|
break;
|
|
949
1345
|
case 18:
|
|
950
|
-
if ("OBSERVATION" !==
|
|
1346
|
+
if ("OBSERVATION" !== i) {
|
|
951
1347
|
e.next = 25;
|
|
952
1348
|
break;
|
|
953
1349
|
}
|
|
954
1350
|
return e.next = 21, this.getTelemetryID();
|
|
955
1351
|
case 21:
|
|
956
|
-
return
|
|
1352
|
+
return o = e.sent, e.next = 24, n();
|
|
957
1353
|
case 24:
|
|
958
|
-
|
|
1354
|
+
s = e.sent;
|
|
959
1355
|
case 25:
|
|
960
1356
|
return e.abrupt("return", {
|
|
961
|
-
dfp_telemetry_id:
|
|
962
|
-
captcha_token:
|
|
1357
|
+
dfp_telemetry_id: o,
|
|
1358
|
+
captcha_token: s
|
|
963
1359
|
});
|
|
964
1360
|
case 26:
|
|
965
1361
|
case "end":
|
|
@@ -968,14 +1364,14 @@ var Y,
|
|
|
968
1364
|
}, e, this);
|
|
969
1365
|
}));
|
|
970
1366
|
}, this.retryWithCaptchaAndDFP = function (e, t) {
|
|
971
|
-
return
|
|
972
|
-
var n,
|
|
973
|
-
return
|
|
1367
|
+
return he(i, void 0, void 0, te().mark(function r() {
|
|
1368
|
+
var n, i, o;
|
|
1369
|
+
return te().wrap(function (r) {
|
|
974
1370
|
for (;;) switch (r.prev = r.next) {
|
|
975
1371
|
case 0:
|
|
976
1372
|
return r.next = 2, this.state;
|
|
977
1373
|
case 2:
|
|
978
|
-
if (n = r.sent,
|
|
1374
|
+
if (n = r.sent, i = n.enabled, o = n.executeRecaptcha, e.type !== de.RequiredCatcha || !i) {
|
|
979
1375
|
r.next = 14;
|
|
980
1376
|
break;
|
|
981
1377
|
}
|
|
@@ -985,7 +1381,7 @@ var Y,
|
|
|
985
1381
|
}
|
|
986
1382
|
return r.next = 9, this.getTelemetryID();
|
|
987
1383
|
case 9:
|
|
988
|
-
return t.body.dfp_telemetry_id = r.sent, r.next = 12,
|
|
1384
|
+
return t.body.dfp_telemetry_id = r.sent, r.next = 12, o();
|
|
989
1385
|
case 12:
|
|
990
1386
|
t.body.captcha_token = r.sent;
|
|
991
1387
|
case 13:
|
|
@@ -999,8 +1395,8 @@ var Y,
|
|
|
999
1395
|
}, r, this);
|
|
1000
1396
|
}));
|
|
1001
1397
|
}, this.state = n.then(function (e) {
|
|
1002
|
-
return
|
|
1003
|
-
return
|
|
1398
|
+
return he(i, void 0, void 0, te().mark(function n() {
|
|
1399
|
+
return te().wrap(function (n) {
|
|
1004
1400
|
for (;;) switch (n.prev = n.next) {
|
|
1005
1401
|
case 0:
|
|
1006
1402
|
if (e.runDFPProtectedAuth) {
|
|
@@ -1012,10 +1408,10 @@ var Y,
|
|
|
1012
1408
|
dfpBackendURL: r,
|
|
1013
1409
|
enabled: !1,
|
|
1014
1410
|
loaded: !1,
|
|
1015
|
-
executeRecaptcha:
|
|
1411
|
+
executeRecaptcha: o
|
|
1016
1412
|
});
|
|
1017
1413
|
case 2:
|
|
1018
|
-
return n.next = 4, void
|
|
1414
|
+
return n.next = 4, void Pe("".concat("https://elements.stytch.com", "/telemetry.js"), function () {
|
|
1019
1415
|
return window;
|
|
1020
1416
|
});
|
|
1021
1417
|
case 4:
|
|
@@ -1025,7 +1421,7 @@ var Y,
|
|
|
1025
1421
|
enabled: !0,
|
|
1026
1422
|
mode: e.dfpProtectedAuthMode || "OBSERVATION",
|
|
1027
1423
|
loaded: !0,
|
|
1028
|
-
executeRecaptcha:
|
|
1424
|
+
executeRecaptcha: o
|
|
1029
1425
|
});
|
|
1030
1426
|
case 5:
|
|
1031
1427
|
case "end":
|
|
@@ -1035,11 +1431,11 @@ var Y,
|
|
|
1035
1431
|
}));
|
|
1036
1432
|
});
|
|
1037
1433
|
}),
|
|
1038
|
-
|
|
1434
|
+
Le = function Le() {
|
|
1039
1435
|
return {
|
|
1040
1436
|
isEnabled: function isEnabled() {
|
|
1041
|
-
return
|
|
1042
|
-
return
|
|
1437
|
+
return he(void 0, void 0, void 0, te().mark(function e() {
|
|
1438
|
+
return te().wrap(function (e) {
|
|
1043
1439
|
for (;;) switch (e.prev = e.next) {
|
|
1044
1440
|
case 0:
|
|
1045
1441
|
return e.abrupt("return", !1);
|
|
@@ -1051,8 +1447,8 @@ var Y,
|
|
|
1051
1447
|
}));
|
|
1052
1448
|
},
|
|
1053
1449
|
getTelemetryID: function getTelemetryID() {
|
|
1054
|
-
return
|
|
1055
|
-
return
|
|
1450
|
+
return he(void 0, void 0, void 0, te().mark(function e() {
|
|
1451
|
+
return te().wrap(function (e) {
|
|
1056
1452
|
for (;;) switch (e.prev = e.next) {
|
|
1057
1453
|
case 0:
|
|
1058
1454
|
return e.abrupt("return", void 0);
|
|
@@ -1064,8 +1460,8 @@ var Y,
|
|
|
1064
1460
|
}));
|
|
1065
1461
|
},
|
|
1066
1462
|
getDFPTelemetryIDAndCaptcha: function getDFPTelemetryIDAndCaptcha() {
|
|
1067
|
-
return
|
|
1068
|
-
return
|
|
1463
|
+
return he(void 0, void 0, void 0, te().mark(function e() {
|
|
1464
|
+
return te().wrap(function (e) {
|
|
1069
1465
|
for (;;) switch (e.prev = e.next) {
|
|
1070
1466
|
case 0:
|
|
1071
1467
|
return e.abrupt("return", {
|
|
@@ -1080,8 +1476,8 @@ var Y,
|
|
|
1080
1476
|
}));
|
|
1081
1477
|
},
|
|
1082
1478
|
retryWithCaptchaAndDFP: function retryWithCaptchaAndDFP() {
|
|
1083
|
-
return
|
|
1084
|
-
return
|
|
1479
|
+
return he(void 0, void 0, void 0, te().mark(function e() {
|
|
1480
|
+
return te().wrap(function (e) {
|
|
1085
1481
|
for (;;) switch (e.prev = e.next) {
|
|
1086
1482
|
case 0:
|
|
1087
1483
|
throw new Error("DFP protected auth is disabled");
|
|
@@ -1094,11 +1490,11 @@ var Y,
|
|
|
1094
1490
|
}
|
|
1095
1491
|
};
|
|
1096
1492
|
},
|
|
1097
|
-
|
|
1493
|
+
Me = function () {
|
|
1098
1494
|
function e(t) {
|
|
1099
|
-
|
|
1495
|
+
ie(this, e), this.maxBatchSize = t.maxBatchSize, this.logEventURL = t.logEventURL, setInterval(this.flush.bind(this), t.intervalDurationMs), this.batch = [];
|
|
1100
1496
|
}
|
|
1101
|
-
return
|
|
1497
|
+
return ne(e, [{
|
|
1102
1498
|
key: "logEvent",
|
|
1103
1499
|
value: function value(e, t) {
|
|
1104
1500
|
this.batch.push({
|
|
@@ -1109,9 +1505,9 @@ var Y,
|
|
|
1109
1505
|
}, {
|
|
1110
1506
|
key: "flush",
|
|
1111
1507
|
value: function value() {
|
|
1112
|
-
return
|
|
1508
|
+
return he(this, void 0, void 0, te().mark(function e() {
|
|
1113
1509
|
var t;
|
|
1114
|
-
return
|
|
1510
|
+
return te().wrap(function (e) {
|
|
1115
1511
|
for (;;) switch (e.prev = e.next) {
|
|
1116
1512
|
case 0:
|
|
1117
1513
|
if (this.batch.length) {
|
|
@@ -1143,26 +1539,26 @@ var Y,
|
|
|
1143
1539
|
}();
|
|
1144
1540
|
!function (e) {
|
|
1145
1541
|
e.LoginOrCreateEML = "login_or_create_eml", e.LoginOrCreateOTP = "login_or_create_otp", e.ResetPassword = "reset_password";
|
|
1146
|
-
}(
|
|
1542
|
+
}(Ce || (Ce = {})), Promise.resolve({
|
|
1147
1543
|
pkceRequiredForEmailMagicLinks: !1
|
|
1148
1544
|
}), Promise.resolve({
|
|
1149
1545
|
pkceRequiredForPasswordResets: !1
|
|
1150
1546
|
});
|
|
1151
|
-
var
|
|
1547
|
+
var Fe = Promise.resolve({
|
|
1152
1548
|
pkceRequiredForEmailMagicLinks: !1
|
|
1153
1549
|
}),
|
|
1154
|
-
|
|
1155
|
-
function e(t, r, n,
|
|
1156
|
-
var
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1550
|
+
je = function () {
|
|
1551
|
+
function e(t, r, n, i) {
|
|
1552
|
+
var o = this,
|
|
1553
|
+
s = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : Fe,
|
|
1554
|
+
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 = {
|
|
1160
1556
|
invite: function invite(e) {
|
|
1161
|
-
return
|
|
1162
|
-
return
|
|
1557
|
+
return he(o, void 0, void 0, te().mark(function t() {
|
|
1558
|
+
return te().wrap(function (t) {
|
|
1163
1559
|
for (;;) switch (t.prev = t.next) {
|
|
1164
1560
|
case 0:
|
|
1165
|
-
return
|
|
1561
|
+
return Be("stytch.magicLinks.email.loginOrSignup").isString("email_address", e.email_address).isOptionalString("invite_redirect_url", e.invite_redirect_url).isOptionalString("invite_template_id", e.invite_template_id).isOptionalString("name", e.name).isOptionalString("locale", e.locale).isOptionalStringArray("roles", e.roles), t.abrupt("return", this._networkClient.fetchSDK({
|
|
1166
1562
|
url: "/b2b/magic_links/email/invite",
|
|
1167
1563
|
body: e,
|
|
1168
1564
|
errorMessage: "Failed to send invite.",
|
|
@@ -1176,12 +1572,12 @@ var ne = Promise.resolve({
|
|
|
1176
1572
|
}));
|
|
1177
1573
|
},
|
|
1178
1574
|
loginOrSignup: function loginOrSignup(e) {
|
|
1179
|
-
return
|
|
1575
|
+
return he(o, void 0, void 0, te().mark(function t() {
|
|
1180
1576
|
var r, n;
|
|
1181
|
-
return
|
|
1577
|
+
return te().wrap(function (t) {
|
|
1182
1578
|
for (;;) switch (t.prev = t.next) {
|
|
1183
1579
|
case 0:
|
|
1184
|
-
return
|
|
1580
|
+
return Be("stytch.magicLinks.email.loginOrSignup").isString("email_address", e.email_address).isString("organization_id", e.organization_id).isOptionalString("login_redirect_url", e.login_redirect_url).isOptionalString("login_template_id", e.login_template_id).isOptionalString("signup_redirect_url", e.signup_redirect_url).isOptionalString("signup_template_id", e.signup_template_id).isOptionalString("locale", e.locale), t.next = 3, this.getCodeChallenge();
|
|
1185
1581
|
case 3:
|
|
1186
1582
|
return r = t.sent, n = Object.assign(Object.assign({}, e), {
|
|
1187
1583
|
pkce_code_challenge: r
|
|
@@ -1200,12 +1596,12 @@ var ne = Promise.resolve({
|
|
|
1200
1596
|
},
|
|
1201
1597
|
discovery: {
|
|
1202
1598
|
send: function send(e) {
|
|
1203
|
-
return
|
|
1599
|
+
return he(o, void 0, void 0, te().mark(function t() {
|
|
1204
1600
|
var r, n;
|
|
1205
|
-
return
|
|
1601
|
+
return te().wrap(function (t) {
|
|
1206
1602
|
for (;;) switch (t.prev = t.next) {
|
|
1207
1603
|
case 0:
|
|
1208
|
-
return
|
|
1604
|
+
return Be("stytch.magicLinks.email.discovery.send").isString("email_address", e.email_address).isOptionalString("discovery_redirect_url", e.discovery_redirect_url).isOptionalString("login_template_id", e.login_template_id).isOptionalString("locale", e.locale), t.next = 3, this.getCodeChallenge();
|
|
1209
1605
|
case 3:
|
|
1210
1606
|
return r = t.sent, n = Object.assign(Object.assign({}, e), {
|
|
1211
1607
|
pkce_code_challenge: r
|
|
@@ -1224,12 +1620,12 @@ var ne = Promise.resolve({
|
|
|
1224
1620
|
}
|
|
1225
1621
|
}
|
|
1226
1622
|
}, this.authenticate = function (e) {
|
|
1227
|
-
return
|
|
1623
|
+
return he(o, void 0, void 0, te().mark(function t() {
|
|
1228
1624
|
var r, n;
|
|
1229
|
-
return
|
|
1625
|
+
return te().wrap(function (t) {
|
|
1230
1626
|
for (;;) switch (t.prev = t.next) {
|
|
1231
1627
|
case 0:
|
|
1232
|
-
return
|
|
1628
|
+
return Be("stytch.magicLinks.authenticate").isString("magic_links_token", e.magic_links_token).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalString("locale", e.locale), t.next = 3, this._passwordResetPKCEManager.getPKPair();
|
|
1233
1629
|
case 3:
|
|
1234
1630
|
if (r = t.sent, n = null, !(null == r ? void 0 : r.code_verifier)) {
|
|
1235
1631
|
t.next = 19;
|
|
@@ -1279,33 +1675,33 @@ var ne = Promise.resolve({
|
|
|
1279
1675
|
}));
|
|
1280
1676
|
}, this.discovery = {
|
|
1281
1677
|
authenticate: function authenticate(e) {
|
|
1282
|
-
return
|
|
1283
|
-
var r, n, o, s, a
|
|
1284
|
-
return
|
|
1678
|
+
return he(o, void 0, void 0, te().mark(function t() {
|
|
1679
|
+
var r, n, i, o, s, a;
|
|
1680
|
+
return te().wrap(function (t) {
|
|
1285
1681
|
for (;;) switch (t.prev = t.next) {
|
|
1286
1682
|
case 0:
|
|
1287
|
-
return
|
|
1683
|
+
return Be("stytch.magicLinks.discovery.authenticate").isString("discovery_magic_links_token", e.discovery_magic_links_token), t.next = 3, this._pkceManager.getPKPair();
|
|
1288
1684
|
case 3:
|
|
1289
1685
|
return r = t.sent, t.next = 6, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
1290
1686
|
case 6:
|
|
1291
|
-
return n = t.sent,
|
|
1687
|
+
return n = t.sent, i = n.dfp_telemetry_id, o = n.captcha_token, s = Object.assign({
|
|
1292
1688
|
pkce_code_verifier: null == r ? void 0 : r.code_verifier,
|
|
1293
|
-
dfp_telemetry_id:
|
|
1294
|
-
captcha_token:
|
|
1689
|
+
dfp_telemetry_id: i,
|
|
1690
|
+
captcha_token: o
|
|
1295
1691
|
}, e), t.next = 12, this._networkClient.retriableFetchSDK({
|
|
1296
1692
|
url: "/b2b/magic_links/discovery/authenticate",
|
|
1297
|
-
body:
|
|
1693
|
+
body: s,
|
|
1298
1694
|
errorMessage: "Failed to authenticate intermediate magic link token",
|
|
1299
1695
|
method: "POST",
|
|
1300
1696
|
retryCallback: this.dfpProtectedAuth.retryWithCaptchaAndDFP
|
|
1301
1697
|
});
|
|
1302
1698
|
case 12:
|
|
1303
|
-
return
|
|
1699
|
+
return a = t.sent, this._pkceManager.clearPKPair(), this._subscriptionService.updateStateAndTokens({
|
|
1304
1700
|
state: null,
|
|
1305
1701
|
session_token: null,
|
|
1306
1702
|
session_jwt: null,
|
|
1307
|
-
intermediate_session_token:
|
|
1308
|
-
}), t.abrupt("return",
|
|
1703
|
+
intermediate_session_token: a.intermediate_session_token
|
|
1704
|
+
}), t.abrupt("return", a);
|
|
1309
1705
|
case 16:
|
|
1310
1706
|
case "end":
|
|
1311
1707
|
return t.stop();
|
|
@@ -1315,12 +1711,12 @@ var ne = Promise.resolve({
|
|
|
1315
1711
|
}
|
|
1316
1712
|
};
|
|
1317
1713
|
}
|
|
1318
|
-
return
|
|
1714
|
+
return ne(e, [{
|
|
1319
1715
|
key: "getCodeChallenge",
|
|
1320
1716
|
value: function value() {
|
|
1321
|
-
return
|
|
1717
|
+
return he(this, void 0, void 0, te().mark(function e() {
|
|
1322
1718
|
var t, r;
|
|
1323
|
-
return
|
|
1719
|
+
return te().wrap(function (e) {
|
|
1324
1720
|
for (;;) switch (e.prev = e.next) {
|
|
1325
1721
|
case 0:
|
|
1326
1722
|
return e.next = 2, this._config;
|
|
@@ -1352,28 +1748,28 @@ var ne = Promise.resolve({
|
|
|
1352
1748
|
}, {
|
|
1353
1749
|
key: "handlePKCEForAuthenticate",
|
|
1354
1750
|
value: function value(e, t) {
|
|
1355
|
-
return
|
|
1356
|
-
var n, o, s, a, c
|
|
1357
|
-
return
|
|
1751
|
+
return he(this, void 0, void 0, te().mark(function r() {
|
|
1752
|
+
var n, i, o, s, a, c;
|
|
1753
|
+
return te().wrap(function (r) {
|
|
1358
1754
|
for (;;) switch (r.prev = r.next) {
|
|
1359
1755
|
case 0:
|
|
1360
1756
|
return r.next = 2, e.getPKPair();
|
|
1361
1757
|
case 2:
|
|
1362
1758
|
return n = r.sent, r.next = 5, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
1363
1759
|
case 5:
|
|
1364
|
-
return
|
|
1760
|
+
return i = r.sent, o = i.dfp_telemetry_id, s = i.captcha_token, a = Object.assign({
|
|
1365
1761
|
pkce_code_verifier: null == n ? void 0 : n.code_verifier,
|
|
1366
|
-
dfp_telemetry_id:
|
|
1367
|
-
captcha_token:
|
|
1762
|
+
dfp_telemetry_id: o,
|
|
1763
|
+
captcha_token: s
|
|
1368
1764
|
}, t), r.next = 11, this._networkClient.retriableFetchSDK({
|
|
1369
1765
|
url: "/b2b/magic_links/authenticate",
|
|
1370
|
-
body:
|
|
1766
|
+
body: a,
|
|
1371
1767
|
errorMessage: "Failed to authenticate token",
|
|
1372
1768
|
method: "POST",
|
|
1373
1769
|
retryCallback: this.dfpProtectedAuth.retryWithCaptchaAndDFP
|
|
1374
1770
|
});
|
|
1375
1771
|
case 11:
|
|
1376
|
-
return
|
|
1772
|
+
return c = r.sent, e.clearPKPair(), r.abrupt("return", c);
|
|
1377
1773
|
case 14:
|
|
1378
1774
|
case "end":
|
|
1379
1775
|
return r.stop();
|
|
@@ -1383,12 +1779,12 @@ var ne = Promise.resolve({
|
|
|
1383
1779
|
}
|
|
1384
1780
|
}]), e;
|
|
1385
1781
|
}(),
|
|
1386
|
-
|
|
1782
|
+
Ne = ne(function e(t, r) {
|
|
1387
1783
|
var n = this;
|
|
1388
|
-
|
|
1389
|
-
return
|
|
1784
|
+
ie(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
|
|
1785
|
+
return he(n, void 0, void 0, te().mark(function e() {
|
|
1390
1786
|
var t;
|
|
1391
|
-
return
|
|
1787
|
+
return te().wrap(function (e) {
|
|
1392
1788
|
for (;;) switch (e.prev = e.next) {
|
|
1393
1789
|
case 0:
|
|
1394
1790
|
return e.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1412,12 +1808,12 @@ var ne = Promise.resolve({
|
|
|
1412
1808
|
return e(null !== (r = null == t ? void 0 : t.member) && void 0 !== r ? r : null);
|
|
1413
1809
|
});
|
|
1414
1810
|
}, this.update = function (e) {
|
|
1415
|
-
return
|
|
1811
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
1416
1812
|
var r;
|
|
1417
|
-
return
|
|
1813
|
+
return te().wrap(function (t) {
|
|
1418
1814
|
for (;;) switch (t.prev = t.next) {
|
|
1419
1815
|
case 0:
|
|
1420
|
-
return
|
|
1816
|
+
return Be("stytch.self.update").isOptionalString("name", e.name).isOptionalObject("untrusted_metadata", e.untrusted_metadata).isOptionalBoolean("mfa_enrolled", e.mfa_enrolled).isOptionalString("mfa_phone_number", e.mfa_phone_number), t.next = 3, this._networkClient.fetchSDK({
|
|
1421
1817
|
url: "/b2b/organizations/members/update",
|
|
1422
1818
|
body: e,
|
|
1423
1819
|
errorMessage: "Failed to update member.",
|
|
@@ -1432,9 +1828,9 @@ var ne = Promise.resolve({
|
|
|
1432
1828
|
}, t, this);
|
|
1433
1829
|
}));
|
|
1434
1830
|
}, this.deleteMFAPhoneNumber = function () {
|
|
1435
|
-
return
|
|
1831
|
+
return he(n, void 0, void 0, te().mark(function e() {
|
|
1436
1832
|
var t;
|
|
1437
|
-
return
|
|
1833
|
+
return te().wrap(function (e) {
|
|
1438
1834
|
for (;;) switch (e.prev = e.next) {
|
|
1439
1835
|
case 0:
|
|
1440
1836
|
return e.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1451,9 +1847,9 @@ var ne = Promise.resolve({
|
|
|
1451
1847
|
}, e, this);
|
|
1452
1848
|
}));
|
|
1453
1849
|
}, this.deletePassword = function (e) {
|
|
1454
|
-
return
|
|
1850
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
1455
1851
|
var r;
|
|
1456
|
-
return
|
|
1852
|
+
return te().wrap(function (t) {
|
|
1457
1853
|
for (;;) switch (t.prev = t.next) {
|
|
1458
1854
|
case 0:
|
|
1459
1855
|
return t.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1471,14 +1867,14 @@ var ne = Promise.resolve({
|
|
|
1471
1867
|
}));
|
|
1472
1868
|
};
|
|
1473
1869
|
}),
|
|
1474
|
-
|
|
1475
|
-
function e(t, r, n,
|
|
1476
|
-
var
|
|
1477
|
-
|
|
1478
|
-
|
|
1870
|
+
Ke = function () {
|
|
1871
|
+
function e(t, r, n, i, o) {
|
|
1872
|
+
var s = this,
|
|
1873
|
+
a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : Le();
|
|
1874
|
+
ie(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._dynamicConfig = i, this._config = o, this.dfpProtectedAuth = a, this.saml = {
|
|
1479
1875
|
createConnection: function createConnection(e) {
|
|
1480
|
-
return
|
|
1481
|
-
return
|
|
1876
|
+
return he(s, void 0, void 0, te().mark(function t() {
|
|
1877
|
+
return te().wrap(function (t) {
|
|
1482
1878
|
for (;;) switch (t.prev = t.next) {
|
|
1483
1879
|
case 0:
|
|
1484
1880
|
return t.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1497,8 +1893,8 @@ var ne = Promise.resolve({
|
|
|
1497
1893
|
}));
|
|
1498
1894
|
},
|
|
1499
1895
|
updateConnection: function updateConnection(e) {
|
|
1500
|
-
return
|
|
1501
|
-
return
|
|
1896
|
+
return he(s, void 0, void 0, te().mark(function t() {
|
|
1897
|
+
return te().wrap(function (t) {
|
|
1502
1898
|
for (;;) switch (t.prev = t.next) {
|
|
1503
1899
|
case 0:
|
|
1504
1900
|
return t.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1517,8 +1913,8 @@ var ne = Promise.resolve({
|
|
|
1517
1913
|
}));
|
|
1518
1914
|
},
|
|
1519
1915
|
updateConnectionByURL: function updateConnectionByURL(e) {
|
|
1520
|
-
return
|
|
1521
|
-
return
|
|
1916
|
+
return he(s, void 0, void 0, te().mark(function t() {
|
|
1917
|
+
return te().wrap(function (t) {
|
|
1522
1918
|
for (;;) switch (t.prev = t.next) {
|
|
1523
1919
|
case 0:
|
|
1524
1920
|
return t.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1537,8 +1933,8 @@ var ne = Promise.resolve({
|
|
|
1537
1933
|
}));
|
|
1538
1934
|
},
|
|
1539
1935
|
deleteVerificationCertificate: function deleteVerificationCertificate(e) {
|
|
1540
|
-
return
|
|
1541
|
-
return
|
|
1936
|
+
return he(s, void 0, void 0, te().mark(function t() {
|
|
1937
|
+
return te().wrap(function (t) {
|
|
1542
1938
|
for (;;) switch (t.prev = t.next) {
|
|
1543
1939
|
case 0:
|
|
1544
1940
|
return t.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1557,8 +1953,8 @@ var ne = Promise.resolve({
|
|
|
1557
1953
|
}
|
|
1558
1954
|
}, this.oidc = {
|
|
1559
1955
|
createConnection: function createConnection(e) {
|
|
1560
|
-
return
|
|
1561
|
-
return
|
|
1956
|
+
return he(s, void 0, void 0, te().mark(function t() {
|
|
1957
|
+
return te().wrap(function (t) {
|
|
1562
1958
|
for (;;) switch (t.prev = t.next) {
|
|
1563
1959
|
case 0:
|
|
1564
1960
|
return t.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1577,8 +1973,8 @@ var ne = Promise.resolve({
|
|
|
1577
1973
|
}));
|
|
1578
1974
|
},
|
|
1579
1975
|
updateConnection: function updateConnection(e) {
|
|
1580
|
-
return
|
|
1581
|
-
return
|
|
1976
|
+
return he(s, void 0, void 0, te().mark(function t() {
|
|
1977
|
+
return te().wrap(function (t) {
|
|
1582
1978
|
for (;;) switch (t.prev = t.next) {
|
|
1583
1979
|
case 0:
|
|
1584
1980
|
return t.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1598,45 +1994,45 @@ var ne = Promise.resolve({
|
|
|
1598
1994
|
}
|
|
1599
1995
|
};
|
|
1600
1996
|
}
|
|
1601
|
-
return
|
|
1997
|
+
return ne(e, [{
|
|
1602
1998
|
key: "authenticate",
|
|
1603
1999
|
value: function value(e) {
|
|
1604
|
-
return
|
|
1605
|
-
var r, n, o, s
|
|
1606
|
-
return
|
|
2000
|
+
return he(this, void 0, void 0, te().mark(function t() {
|
|
2001
|
+
var r, n, i, o, s;
|
|
2002
|
+
return te().wrap(function (t) {
|
|
1607
2003
|
for (;;) switch (t.prev = t.next) {
|
|
1608
2004
|
case 0:
|
|
1609
|
-
return
|
|
2005
|
+
return Be("stytch.sso.authenticate").isString("sso_token", e.sso_token).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalString("locale", e.locale), t.next = 3, this._pkceManager.getPKPair();
|
|
1610
2006
|
case 3:
|
|
1611
|
-
return (r = t.sent) ||
|
|
2007
|
+
return (r = t.sent) || Oe("No code verifier found in local storage for SSO flow.\nConsider using stytch.sso.start() to add PKCE to your SSO flows for added security.\nSee https://stytch.com/docs/oauth#guides_pkce for more information."), t.next = 7, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
1612
2008
|
case 7:
|
|
1613
|
-
return n = t.sent,
|
|
2009
|
+
return n = t.sent, i = n.dfp_telemetry_id, o = n.captcha_token, t.next = 12, this._networkClient.retriableFetchSDK({
|
|
1614
2010
|
url: "/b2b/sso/authenticate",
|
|
1615
2011
|
method: "POST",
|
|
1616
2012
|
body: Object.assign(Object.assign({
|
|
1617
2013
|
pkce_code_verifier: null == r ? void 0 : r.code_verifier
|
|
1618
2014
|
}, e), {
|
|
1619
|
-
dfp_telemetry_id:
|
|
1620
|
-
captcha_token:
|
|
2015
|
+
dfp_telemetry_id: i,
|
|
2016
|
+
captcha_token: o
|
|
1621
2017
|
}),
|
|
1622
2018
|
errorMessage: "Failed to authenticate token",
|
|
1623
2019
|
retryCallback: this.dfpProtectedAuth.retryWithCaptchaAndDFP
|
|
1624
2020
|
});
|
|
1625
2021
|
case 12:
|
|
1626
|
-
return
|
|
2022
|
+
return s = t.sent, this._pkceManager.clearPKPair(), s.member_session ? this._subscriptionService.updateStateAndTokens({
|
|
1627
2023
|
state: {
|
|
1628
|
-
session:
|
|
1629
|
-
member:
|
|
2024
|
+
session: s.member_session,
|
|
2025
|
+
member: s.member
|
|
1630
2026
|
},
|
|
1631
|
-
session_token:
|
|
1632
|
-
session_jwt:
|
|
2027
|
+
session_token: s.session_token,
|
|
2028
|
+
session_jwt: s.session_jwt,
|
|
1633
2029
|
intermediate_session_token: null
|
|
1634
2030
|
}) : this._subscriptionService.updateStateAndTokens({
|
|
1635
2031
|
state: null,
|
|
1636
2032
|
session_token: null,
|
|
1637
2033
|
session_jwt: null,
|
|
1638
|
-
intermediate_session_token:
|
|
1639
|
-
}), t.abrupt("return",
|
|
2034
|
+
intermediate_session_token: s.intermediate_session_token
|
|
2035
|
+
}), t.abrupt("return", s);
|
|
1640
2036
|
case 16:
|
|
1641
2037
|
case "end":
|
|
1642
2038
|
return t.stop();
|
|
@@ -1647,11 +2043,11 @@ var ne = Promise.resolve({
|
|
|
1647
2043
|
}, {
|
|
1648
2044
|
key: "getBaseApiUrl",
|
|
1649
2045
|
value: function value() {
|
|
1650
|
-
return
|
|
1651
|
-
return
|
|
2046
|
+
return he(this, void 0, void 0, te().mark(function e() {
|
|
2047
|
+
return te().wrap(function (e) {
|
|
1652
2048
|
for (;;) switch (e.prev = e.next) {
|
|
1653
2049
|
case 0:
|
|
1654
|
-
if (!
|
|
2050
|
+
if (!Ie(this._config.publicToken)) {
|
|
1655
2051
|
e.next = 2;
|
|
1656
2052
|
break;
|
|
1657
2053
|
}
|
|
@@ -1671,27 +2067,27 @@ var ne = Promise.resolve({
|
|
|
1671
2067
|
var t = e.connection_id,
|
|
1672
2068
|
r = e.login_redirect_url,
|
|
1673
2069
|
n = e.signup_redirect_url;
|
|
1674
|
-
return
|
|
1675
|
-
var o, s, a, c
|
|
1676
|
-
return
|
|
2070
|
+
return he(this, void 0, void 0, te().mark(function e() {
|
|
2071
|
+
var i, o, s, a, c;
|
|
2072
|
+
return te().wrap(function (e) {
|
|
1677
2073
|
for (;;) switch (e.prev = e.next) {
|
|
1678
2074
|
case 0:
|
|
1679
2075
|
return e.next = 2, this._dynamicConfig;
|
|
1680
2076
|
case 2:
|
|
1681
|
-
return
|
|
2077
|
+
return i = e.sent, o = i.pkceRequiredForSso, e.next = 6, this.getBaseApiUrl();
|
|
1682
2078
|
case 6:
|
|
1683
|
-
if (
|
|
2079
|
+
if (s = e.sent, (a = new URL("".concat(s, "/v1/public/sso/start"))).searchParams.set("public_token", this._config.publicToken), a.searchParams.set("connection_id", t), !o) {
|
|
1684
2080
|
e.next = 17;
|
|
1685
2081
|
break;
|
|
1686
2082
|
}
|
|
1687
2083
|
return e.next = 13, this._pkceManager.startPKCETransaction();
|
|
1688
2084
|
case 13:
|
|
1689
|
-
|
|
2085
|
+
c = e.sent, a.searchParams.set("pkce_code_challenge", c.code_challenge), e.next = 18;
|
|
1690
2086
|
break;
|
|
1691
2087
|
case 17:
|
|
1692
2088
|
this._pkceManager.clearPKPair();
|
|
1693
2089
|
case 18:
|
|
1694
|
-
r &&
|
|
2090
|
+
r && a.searchParams.set("login_redirect_url", r), n && a.searchParams.set("signup_redirect_url", n), window.location.href = a.toString();
|
|
1695
2091
|
case 21:
|
|
1696
2092
|
case "end":
|
|
1697
2093
|
return e.stop();
|
|
@@ -1702,8 +2098,8 @@ var ne = Promise.resolve({
|
|
|
1702
2098
|
}, {
|
|
1703
2099
|
key: "getConnections",
|
|
1704
2100
|
value: function value() {
|
|
1705
|
-
return
|
|
1706
|
-
return
|
|
2101
|
+
return he(this, void 0, void 0, te().mark(function e() {
|
|
2102
|
+
return te().wrap(function (e) {
|
|
1707
2103
|
for (;;) switch (e.prev = e.next) {
|
|
1708
2104
|
case 0:
|
|
1709
2105
|
return e.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1723,8 +2119,8 @@ var ne = Promise.resolve({
|
|
|
1723
2119
|
}, {
|
|
1724
2120
|
key: "deleteConnection",
|
|
1725
2121
|
value: function value(e) {
|
|
1726
|
-
return
|
|
1727
|
-
return
|
|
2122
|
+
return he(this, void 0, void 0, te().mark(function t() {
|
|
2123
|
+
return te().wrap(function (t) {
|
|
1728
2124
|
for (;;) switch (t.prev = t.next) {
|
|
1729
2125
|
case 0:
|
|
1730
2126
|
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
@@ -1741,12 +2137,12 @@ var ne = Promise.resolve({
|
|
|
1741
2137
|
}
|
|
1742
2138
|
}]), e;
|
|
1743
2139
|
}(),
|
|
1744
|
-
|
|
2140
|
+
Ue = ne(function e(t, r) {
|
|
1745
2141
|
var n = this;
|
|
1746
|
-
|
|
1747
|
-
return
|
|
2142
|
+
ie(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
|
|
2143
|
+
return he(n, void 0, void 0, te().mark(function e() {
|
|
1748
2144
|
var t;
|
|
1749
|
-
return
|
|
2145
|
+
return te().wrap(function (e) {
|
|
1750
2146
|
for (;;) switch (e.prev = e.next) {
|
|
1751
2147
|
case 0:
|
|
1752
2148
|
return e.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1763,9 +2159,9 @@ var ne = Promise.resolve({
|
|
|
1763
2159
|
}, e, this);
|
|
1764
2160
|
}));
|
|
1765
2161
|
}, this.update = function (e) {
|
|
1766
|
-
return
|
|
2162
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
1767
2163
|
var r;
|
|
1768
|
-
return
|
|
2164
|
+
return te().wrap(function (t) {
|
|
1769
2165
|
for (;;) switch (t.prev = t.next) {
|
|
1770
2166
|
case 0:
|
|
1771
2167
|
return t.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1783,9 +2179,9 @@ var ne = Promise.resolve({
|
|
|
1783
2179
|
}, t, this);
|
|
1784
2180
|
}));
|
|
1785
2181
|
}, this["delete"] = function () {
|
|
1786
|
-
return
|
|
2182
|
+
return he(n, void 0, void 0, te().mark(function e() {
|
|
1787
2183
|
var t;
|
|
1788
|
-
return
|
|
2184
|
+
return te().wrap(function (e) {
|
|
1789
2185
|
for (;;) switch (e.prev = e.next) {
|
|
1790
2186
|
case 0:
|
|
1791
2187
|
return e.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1803,8 +2199,8 @@ var ne = Promise.resolve({
|
|
|
1803
2199
|
}));
|
|
1804
2200
|
}, this.members = {
|
|
1805
2201
|
create: function create(e) {
|
|
1806
|
-
return
|
|
1807
|
-
return
|
|
2202
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2203
|
+
return te().wrap(function (t) {
|
|
1808
2204
|
for (;;) switch (t.prev = t.next) {
|
|
1809
2205
|
case 0:
|
|
1810
2206
|
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
@@ -1821,8 +2217,8 @@ var ne = Promise.resolve({
|
|
|
1821
2217
|
}));
|
|
1822
2218
|
},
|
|
1823
2219
|
search: function search(e) {
|
|
1824
|
-
return
|
|
1825
|
-
return
|
|
2220
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2221
|
+
return te().wrap(function (t) {
|
|
1826
2222
|
for (;;) switch (t.prev = t.next) {
|
|
1827
2223
|
case 0:
|
|
1828
2224
|
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
@@ -1839,8 +2235,8 @@ var ne = Promise.resolve({
|
|
|
1839
2235
|
}));
|
|
1840
2236
|
},
|
|
1841
2237
|
update: function update(e) {
|
|
1842
|
-
return
|
|
1843
|
-
return
|
|
2238
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2239
|
+
return te().wrap(function (t) {
|
|
1844
2240
|
for (;;) switch (t.prev = t.next) {
|
|
1845
2241
|
case 0:
|
|
1846
2242
|
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
@@ -1857,8 +2253,8 @@ var ne = Promise.resolve({
|
|
|
1857
2253
|
}));
|
|
1858
2254
|
},
|
|
1859
2255
|
deletePassword: function deletePassword(e) {
|
|
1860
|
-
return
|
|
1861
|
-
return
|
|
2256
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2257
|
+
return te().wrap(function (t) {
|
|
1862
2258
|
for (;;) switch (t.prev = t.next) {
|
|
1863
2259
|
case 0:
|
|
1864
2260
|
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
@@ -1874,8 +2270,8 @@ var ne = Promise.resolve({
|
|
|
1874
2270
|
}));
|
|
1875
2271
|
},
|
|
1876
2272
|
deleteMFAPhoneNumber: function deleteMFAPhoneNumber(e) {
|
|
1877
|
-
return
|
|
1878
|
-
return
|
|
2273
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2274
|
+
return te().wrap(function (t) {
|
|
1879
2275
|
for (;;) switch (t.prev = t.next) {
|
|
1880
2276
|
case 0:
|
|
1881
2277
|
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
@@ -1891,8 +2287,8 @@ var ne = Promise.resolve({
|
|
|
1891
2287
|
}));
|
|
1892
2288
|
},
|
|
1893
2289
|
"delete": function _delete(e) {
|
|
1894
|
-
return
|
|
1895
|
-
return
|
|
2290
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2291
|
+
return te().wrap(function (t) {
|
|
1896
2292
|
for (;;) switch (t.prev = t.next) {
|
|
1897
2293
|
case 0:
|
|
1898
2294
|
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
@@ -1908,8 +2304,8 @@ var ne = Promise.resolve({
|
|
|
1908
2304
|
}));
|
|
1909
2305
|
},
|
|
1910
2306
|
reactivate: function reactivate(e) {
|
|
1911
|
-
return
|
|
1912
|
-
return
|
|
2307
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2308
|
+
return te().wrap(function (t) {
|
|
1913
2309
|
for (;;) switch (t.prev = t.next) {
|
|
1914
2310
|
case 0:
|
|
1915
2311
|
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
@@ -1926,39 +2322,39 @@ var ne = Promise.resolve({
|
|
|
1926
2322
|
}
|
|
1927
2323
|
};
|
|
1928
2324
|
}),
|
|
1929
|
-
|
|
1930
|
-
function e(t, r, n,
|
|
1931
|
-
var
|
|
1932
|
-
|
|
1933
|
-
|
|
2325
|
+
ze = function () {
|
|
2326
|
+
function e(t, r, n, i, o) {
|
|
2327
|
+
var s = this,
|
|
2328
|
+
a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : Le();
|
|
2329
|
+
ie(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._dynamicConfig = i, this._config = o, this.dfpProtectedAuth = a, this.discovery = {
|
|
1934
2330
|
authenticate: function authenticate(e) {
|
|
1935
|
-
return
|
|
1936
|
-
var r, n, o, s, a
|
|
1937
|
-
return
|
|
2331
|
+
return he(s, void 0, void 0, te().mark(function t() {
|
|
2332
|
+
var r, n, i, o, s, a;
|
|
2333
|
+
return te().wrap(function (t) {
|
|
1938
2334
|
for (;;) switch (t.prev = t.next) {
|
|
1939
2335
|
case 0:
|
|
1940
|
-
return
|
|
2336
|
+
return Be("stytch.oauth.discovery.authenticate").isString("discovery_oauth_token", e.discovery_oauth_token), t.next = 3, this._pkceManager.getPKPair();
|
|
1941
2337
|
case 3:
|
|
1942
2338
|
return r = t.sent, t.next = 6, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
1943
2339
|
case 6:
|
|
1944
|
-
return n = t.sent,
|
|
2340
|
+
return n = t.sent, i = n.dfp_telemetry_id, o = n.captcha_token, s = Object.assign({
|
|
1945
2341
|
pkce_code_verifier: null == r ? void 0 : r.code_verifier,
|
|
1946
|
-
dfp_telemetry_id:
|
|
1947
|
-
captcha_token:
|
|
2342
|
+
dfp_telemetry_id: i,
|
|
2343
|
+
captcha_token: o
|
|
1948
2344
|
}, e), t.next = 12, this._networkClient.retriableFetchSDK({
|
|
1949
2345
|
url: "/b2b/oauth/discovery/authenticate",
|
|
1950
|
-
body:
|
|
2346
|
+
body: s,
|
|
1951
2347
|
errorMessage: "Failed to authenticate discovery oauth token",
|
|
1952
2348
|
method: "POST",
|
|
1953
2349
|
retryCallback: this.dfpProtectedAuth.retryWithCaptchaAndDFP
|
|
1954
2350
|
});
|
|
1955
2351
|
case 12:
|
|
1956
|
-
return
|
|
2352
|
+
return a = t.sent, this._pkceManager.clearPKPair(), this._subscriptionService.updateStateAndTokens({
|
|
1957
2353
|
state: null,
|
|
1958
2354
|
session_token: null,
|
|
1959
2355
|
session_jwt: null,
|
|
1960
|
-
intermediate_session_token:
|
|
1961
|
-
}), t.abrupt("return",
|
|
2356
|
+
intermediate_session_token: a.intermediate_session_token
|
|
2357
|
+
}), t.abrupt("return", a);
|
|
1962
2358
|
case 16:
|
|
1963
2359
|
case "end":
|
|
1964
2360
|
return t.stop();
|
|
@@ -1967,55 +2363,55 @@ var ne = Promise.resolve({
|
|
|
1967
2363
|
}));
|
|
1968
2364
|
}
|
|
1969
2365
|
}, this.google = {
|
|
1970
|
-
start: this.startOAuthFlow(
|
|
2366
|
+
start: this.startOAuthFlow(exports.B2BOAuthProviders.Google),
|
|
1971
2367
|
discovery: {
|
|
1972
|
-
start: this.startDiscoveryOAuthFlow(
|
|
2368
|
+
start: this.startDiscoveryOAuthFlow(exports.B2BOAuthProviders.Google)
|
|
1973
2369
|
}
|
|
1974
2370
|
}, this.microsoft = {
|
|
1975
|
-
start: this.startOAuthFlow(
|
|
2371
|
+
start: this.startOAuthFlow(exports.B2BOAuthProviders.Microsoft),
|
|
1976
2372
|
discovery: {
|
|
1977
|
-
start: this.startDiscoveryOAuthFlow(
|
|
2373
|
+
start: this.startDiscoveryOAuthFlow(exports.B2BOAuthProviders.Microsoft)
|
|
1978
2374
|
}
|
|
1979
2375
|
};
|
|
1980
2376
|
}
|
|
1981
|
-
return
|
|
2377
|
+
return ne(e, [{
|
|
1982
2378
|
key: "authenticate",
|
|
1983
2379
|
value: function value(e) {
|
|
1984
|
-
return
|
|
1985
|
-
var r, n, o, s
|
|
1986
|
-
return
|
|
2380
|
+
return he(this, void 0, void 0, te().mark(function t() {
|
|
2381
|
+
var r, n, i, o, s;
|
|
2382
|
+
return te().wrap(function (t) {
|
|
1987
2383
|
for (;;) switch (t.prev = t.next) {
|
|
1988
2384
|
case 0:
|
|
1989
|
-
return
|
|
2385
|
+
return Be("stytch.oauth.authenticate").isString("oauth_token", e.oauth_token).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalString("locale", e.locale), t.next = 3, this._pkceManager.getPKPair();
|
|
1990
2386
|
case 3:
|
|
1991
|
-
return (r = t.sent) ||
|
|
2387
|
+
return (r = t.sent) || Oe("No code verifier found in local storage for OAuth flow.\nConsider using stytch.oauth.$provider.start() to add PKCE to your OAuth flows for added security.\nSee https://stytch.com/docs/oauth#guides_pkce for more information."), t.next = 7, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
1992
2388
|
case 7:
|
|
1993
|
-
return n = t.sent,
|
|
2389
|
+
return n = t.sent, i = n.dfp_telemetry_id, o = n.captcha_token, t.next = 12, this._networkClient.retriableFetchSDK({
|
|
1994
2390
|
url: "/b2b/oauth/authenticate",
|
|
1995
2391
|
method: "POST",
|
|
1996
2392
|
body: Object.assign({
|
|
1997
2393
|
pkce_code_verifier: null == r ? void 0 : r.code_verifier,
|
|
1998
|
-
dfp_telemetry_id:
|
|
1999
|
-
captcha_token:
|
|
2394
|
+
dfp_telemetry_id: i,
|
|
2395
|
+
captcha_token: o
|
|
2000
2396
|
}, e),
|
|
2001
2397
|
errorMessage: "Failed to authenticate token",
|
|
2002
2398
|
retryCallback: this.dfpProtectedAuth.retryWithCaptchaAndDFP
|
|
2003
2399
|
});
|
|
2004
2400
|
case 12:
|
|
2005
|
-
return
|
|
2401
|
+
return s = t.sent, this._pkceManager.clearPKPair(), s.member_session ? this._subscriptionService.updateStateAndTokens({
|
|
2006
2402
|
state: {
|
|
2007
|
-
session:
|
|
2008
|
-
member:
|
|
2403
|
+
session: s.member_session,
|
|
2404
|
+
member: s.member
|
|
2009
2405
|
},
|
|
2010
|
-
session_token:
|
|
2011
|
-
session_jwt:
|
|
2406
|
+
session_token: s.session_token,
|
|
2407
|
+
session_jwt: s.session_jwt,
|
|
2012
2408
|
intermediate_session_token: null
|
|
2013
2409
|
}) : this._subscriptionService.updateStateAndTokens({
|
|
2014
2410
|
state: null,
|
|
2015
2411
|
session_token: null,
|
|
2016
2412
|
session_jwt: null,
|
|
2017
|
-
intermediate_session_token:
|
|
2018
|
-
}), t.abrupt("return",
|
|
2413
|
+
intermediate_session_token: s.intermediate_session_token
|
|
2414
|
+
}), t.abrupt("return", s);
|
|
2019
2415
|
case 16:
|
|
2020
2416
|
case "end":
|
|
2021
2417
|
return t.stop();
|
|
@@ -2026,9 +2422,9 @@ var ne = Promise.resolve({
|
|
|
2026
2422
|
}, {
|
|
2027
2423
|
key: "getBaseApiUrl",
|
|
2028
2424
|
value: function value() {
|
|
2029
|
-
return
|
|
2425
|
+
return he(this, void 0, void 0, te().mark(function e() {
|
|
2030
2426
|
var t, r;
|
|
2031
|
-
return
|
|
2427
|
+
return te().wrap(function (e) {
|
|
2032
2428
|
for (;;) switch (e.prev = e.next) {
|
|
2033
2429
|
case 0:
|
|
2034
2430
|
return e.next = 2, this._dynamicConfig;
|
|
@@ -2039,7 +2435,7 @@ var ne = Promise.resolve({
|
|
|
2039
2435
|
}
|
|
2040
2436
|
return e.abrupt("return", "https://".concat(r));
|
|
2041
2437
|
case 6:
|
|
2042
|
-
if (!
|
|
2438
|
+
if (!Ie(this._config.publicToken)) {
|
|
2043
2439
|
e.next = 8;
|
|
2044
2440
|
break;
|
|
2045
2441
|
}
|
|
@@ -2059,33 +2455,33 @@ var ne = Promise.resolve({
|
|
|
2059
2455
|
var t = this;
|
|
2060
2456
|
return function (r) {
|
|
2061
2457
|
var n = r.organization_id,
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
return
|
|
2068
|
-
var r, l, d, h, p
|
|
2069
|
-
return
|
|
2458
|
+
i = r.organization_slug,
|
|
2459
|
+
o = r.login_redirect_url,
|
|
2460
|
+
s = r.signup_redirect_url,
|
|
2461
|
+
a = r.custom_scopes,
|
|
2462
|
+
c = r.provider_params;
|
|
2463
|
+
return he(t, void 0, void 0, te().mark(function t() {
|
|
2464
|
+
var r, u, l, d, h, p;
|
|
2465
|
+
return te().wrap(function (t) {
|
|
2070
2466
|
for (;;) switch (t.prev = t.next) {
|
|
2071
2467
|
case 0:
|
|
2072
2468
|
return t.next = 2, this._dynamicConfig;
|
|
2073
2469
|
case 2:
|
|
2074
|
-
return r = t.sent,
|
|
2470
|
+
return r = t.sent, u = r.pkceRequiredForOAuth, t.next = 6, this.getBaseApiUrl();
|
|
2075
2471
|
case 6:
|
|
2076
|
-
if (
|
|
2077
|
-
if (!
|
|
2472
|
+
if (l = t.sent, (d = new URL("".concat(l, "/v1/b2b/public/oauth/").concat(e, "/start"))).searchParams.set("public_token", this._config.publicToken), n && "" != n && d.searchParams.set("organization_id", n), i && "" != i && d.searchParams.set("slug", i), a && (Be("startOAuthFlow").isStringArray("custom_scopes", a), d.searchParams.set("custom_scopes", a.join(" "))), c) for (h in Be("startOAuthFlow").isOptionalObject("provider_params", c), c) d.searchParams.set("provider_" + h, c[h]);
|
|
2473
|
+
if (!u) {
|
|
2078
2474
|
t.next = 20;
|
|
2079
2475
|
break;
|
|
2080
2476
|
}
|
|
2081
2477
|
return t.next = 16, this._pkceManager.startPKCETransaction();
|
|
2082
2478
|
case 16:
|
|
2083
|
-
|
|
2479
|
+
p = t.sent, d.searchParams.set("pkce_code_challenge", p.code_challenge), t.next = 21;
|
|
2084
2480
|
break;
|
|
2085
2481
|
case 20:
|
|
2086
2482
|
this._pkceManager.clearPKPair();
|
|
2087
2483
|
case 21:
|
|
2088
|
-
|
|
2484
|
+
o && d.searchParams.set("login_redirect_url", o), s && d.searchParams.set("signup_redirect_url", s), window.location.href = d.toString();
|
|
2089
2485
|
case 24:
|
|
2090
2486
|
case "end":
|
|
2091
2487
|
return t.stop();
|
|
@@ -2100,30 +2496,30 @@ var ne = Promise.resolve({
|
|
|
2100
2496
|
var t = this;
|
|
2101
2497
|
return function (r) {
|
|
2102
2498
|
var n = r.discovery_redirect_url,
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
return
|
|
2106
|
-
var r, a, c, u, l
|
|
2107
|
-
return
|
|
2499
|
+
i = r.custom_scopes,
|
|
2500
|
+
o = r.provider_params;
|
|
2501
|
+
return he(t, void 0, void 0, te().mark(function t() {
|
|
2502
|
+
var r, s, a, c, u, l;
|
|
2503
|
+
return te().wrap(function (t) {
|
|
2108
2504
|
for (;;) switch (t.prev = t.next) {
|
|
2109
2505
|
case 0:
|
|
2110
2506
|
return t.next = 2, this._dynamicConfig;
|
|
2111
2507
|
case 2:
|
|
2112
|
-
return r = t.sent,
|
|
2508
|
+
return r = t.sent, s = r.pkceRequiredForOAuth, t.next = 6, this.getBaseApiUrl();
|
|
2113
2509
|
case 6:
|
|
2114
|
-
if (
|
|
2115
|
-
if (!
|
|
2510
|
+
if (a = t.sent, (c = new URL("".concat(a, "/v1/b2b/public/oauth/").concat(e, "/discovery/start"))).searchParams.set("public_token", this._config.publicToken), i && (Be("startOAuthFlow").isStringArray("custom_scopes", i), c.searchParams.set("custom_scopes", i.join(" "))), o) for (u in Be("startOAuthFlow").isOptionalObject("provider_params", o), o) c.searchParams.set("provider_" + u, o[u]);
|
|
2511
|
+
if (!s) {
|
|
2116
2512
|
t.next = 18;
|
|
2117
2513
|
break;
|
|
2118
2514
|
}
|
|
2119
2515
|
return t.next = 14, this._pkceManager.startPKCETransaction();
|
|
2120
2516
|
case 14:
|
|
2121
|
-
|
|
2517
|
+
l = t.sent, c.searchParams.set("pkce_code_challenge", l.code_challenge), t.next = 19;
|
|
2122
2518
|
break;
|
|
2123
2519
|
case 18:
|
|
2124
2520
|
this._pkceManager.clearPKPair();
|
|
2125
2521
|
case 19:
|
|
2126
|
-
n &&
|
|
2522
|
+
n && c.searchParams.set("discovery_redirect_url", n), window.location.href = c.toString();
|
|
2127
2523
|
case 21:
|
|
2128
2524
|
case "end":
|
|
2129
2525
|
return t.stop();
|
|
@@ -2134,10 +2530,10 @@ var ne = Promise.resolve({
|
|
|
2134
2530
|
}
|
|
2135
2531
|
}]), e;
|
|
2136
2532
|
}(),
|
|
2137
|
-
|
|
2533
|
+
qe = function () {
|
|
2138
2534
|
function e(t, r) {
|
|
2139
2535
|
var n = this;
|
|
2140
|
-
|
|
2536
|
+
ie(this, e), this._networkClient = t, this._subscriptionService = r, this.getSync = function () {
|
|
2141
2537
|
return n._subscriptionService.getSession();
|
|
2142
2538
|
}, this.onChange = function (e) {
|
|
2143
2539
|
return n._subscriptionService.subscribeToState(function (t) {
|
|
@@ -2145,9 +2541,9 @@ var ne = Promise.resolve({
|
|
|
2145
2541
|
return e(null !== (r = null == t ? void 0 : t.session) && void 0 !== r ? r : null);
|
|
2146
2542
|
});
|
|
2147
2543
|
}, this.revoke = function (e) {
|
|
2148
|
-
return
|
|
2544
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2149
2545
|
var r;
|
|
2150
|
-
return
|
|
2546
|
+
return te().wrap(function (t) {
|
|
2151
2547
|
for (;;) switch (t.prev = t.next) {
|
|
2152
2548
|
case 0:
|
|
2153
2549
|
return t.prev = 0, t.next = 3, this._networkClient.fetchSDK({
|
|
@@ -2158,7 +2554,7 @@ var ne = Promise.resolve({
|
|
|
2158
2554
|
case 3:
|
|
2159
2555
|
return r = t.sent, this._subscriptionService.destroyState(), t.abrupt("return", r);
|
|
2160
2556
|
case 8:
|
|
2161
|
-
throw t.prev = 8, t.t0 = t["catch"](0), ((null == e ? void 0 : e.forceClear) ||
|
|
2557
|
+
throw t.prev = 8, t.t0 = t["catch"](0), ((null == e ? void 0 : e.forceClear) || m.includes(t.t0.error_type)) && this._subscriptionService.destroyState(), t.t0;
|
|
2162
2558
|
case 12:
|
|
2163
2559
|
case "end":
|
|
2164
2560
|
return t.stop();
|
|
@@ -2166,9 +2562,9 @@ var ne = Promise.resolve({
|
|
|
2166
2562
|
}, t, this, [[0, 8]]);
|
|
2167
2563
|
}));
|
|
2168
2564
|
}, this.authenticate = function (e) {
|
|
2169
|
-
return
|
|
2565
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2170
2566
|
var r, n;
|
|
2171
|
-
return
|
|
2567
|
+
return te().wrap(function (t) {
|
|
2172
2568
|
for (;;) switch (t.prev = t.next) {
|
|
2173
2569
|
case 0:
|
|
2174
2570
|
return t.prev = 0, r = {
|
|
@@ -2190,7 +2586,7 @@ var ne = Promise.resolve({
|
|
|
2190
2586
|
intermediate_session_token: null
|
|
2191
2587
|
}), t.abrupt("return", n);
|
|
2192
2588
|
case 9:
|
|
2193
|
-
throw t.prev = 9, t.t0 = t["catch"](0),
|
|
2589
|
+
throw t.prev = 9, t.t0 = t["catch"](0), m.includes(t.t0.error_type) && this._subscriptionService.destroyState(), t.t0;
|
|
2194
2590
|
case 13:
|
|
2195
2591
|
case "end":
|
|
2196
2592
|
return t.stop();
|
|
@@ -2198,12 +2594,12 @@ var ne = Promise.resolve({
|
|
|
2198
2594
|
}, t, this, [[0, 9]]);
|
|
2199
2595
|
}));
|
|
2200
2596
|
}, this.exchange = function (e) {
|
|
2201
|
-
return
|
|
2597
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2202
2598
|
var r;
|
|
2203
|
-
return
|
|
2599
|
+
return te().wrap(function (t) {
|
|
2204
2600
|
for (;;) switch (t.prev = t.next) {
|
|
2205
2601
|
case 0:
|
|
2206
|
-
return
|
|
2602
|
+
return Be("stytch.sessions.exchange").isString("organization_id", e.organization_id).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalString("locale", e.locale), t.prev = 1, t.next = 4, this._networkClient.fetchSDK({
|
|
2207
2603
|
url: "/b2b/sessions/exchange",
|
|
2208
2604
|
body: e,
|
|
2209
2605
|
errorMessage: "Failed to exchange session",
|
|
@@ -2234,19 +2630,19 @@ var ne = Promise.resolve({
|
|
|
2234
2630
|
}));
|
|
2235
2631
|
};
|
|
2236
2632
|
}
|
|
2237
|
-
return
|
|
2633
|
+
return ne(e, [{
|
|
2238
2634
|
key: "getTokens",
|
|
2239
2635
|
value: function value() {
|
|
2240
2636
|
return this._subscriptionService.getTokens();
|
|
2241
2637
|
}
|
|
2242
2638
|
}]), e;
|
|
2243
2639
|
}(),
|
|
2244
|
-
|
|
2640
|
+
We = ne(function e(t, r) {
|
|
2245
2641
|
var n = this;
|
|
2246
|
-
|
|
2642
|
+
ie(this, e), this._networkClient = t, this._subscriptionService = r, this.organizations = {
|
|
2247
2643
|
list: function list() {
|
|
2248
|
-
return
|
|
2249
|
-
return
|
|
2644
|
+
return he(n, void 0, void 0, te().mark(function e() {
|
|
2645
|
+
return te().wrap(function (e) {
|
|
2250
2646
|
for (;;) switch (e.prev = e.next) {
|
|
2251
2647
|
case 0:
|
|
2252
2648
|
return e.t0 = this._networkClient, e.next = 3, this._subscriptionService.getIntermediateSessionToken();
|
|
@@ -2273,12 +2669,12 @@ var ne = Promise.resolve({
|
|
|
2273
2669
|
}));
|
|
2274
2670
|
},
|
|
2275
2671
|
create: function create(e) {
|
|
2276
|
-
return
|
|
2672
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2277
2673
|
var r, n;
|
|
2278
|
-
return
|
|
2674
|
+
return te().wrap(function (t) {
|
|
2279
2675
|
for (;;) switch (t.prev = t.next) {
|
|
2280
2676
|
case 0:
|
|
2281
|
-
return
|
|
2677
|
+
return Be("stytch.discovery.organizations.create").isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalString("organization_name", e.organization_name).isOptionalString("organization_slug", e.organization_slug).isOptionalString("organization_logo_url", e.organization_logo_url).isOptionalString("sso_jit_provisioning", e.sso_jit_provisioning).isOptionalStringArray("email_allowed_domains", e.email_allowed_domains).isOptionalString("email_invites", e.email_invites).isOptionalString("auth_methods", e.auth_methods).isOptionalStringArray("allowed_auth_methods", e.allowed_auth_methods).isOptionalString("mfa_policy", e.mfa_policy), t.t0 = Object, t.t1 = Object.assign({}, e), t.next = 5, this._subscriptionService.getIntermediateSessionToken();
|
|
2282
2678
|
case 5:
|
|
2283
2679
|
if (t.t2 = t.sent, t.t2) {
|
|
2284
2680
|
t.next = 8;
|
|
@@ -2318,12 +2714,12 @@ var ne = Promise.resolve({
|
|
|
2318
2714
|
}
|
|
2319
2715
|
}, this.intermediateSessions = {
|
|
2320
2716
|
exchange: function exchange(e) {
|
|
2321
|
-
return
|
|
2717
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2322
2718
|
var r, n;
|
|
2323
|
-
return
|
|
2719
|
+
return te().wrap(function (t) {
|
|
2324
2720
|
for (;;) switch (t.prev = t.next) {
|
|
2325
2721
|
case 0:
|
|
2326
|
-
return
|
|
2722
|
+
return Be("stytch.discovery.intermediateSessions.exchange").isString("organization_id", e.organization_id).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalString("locale", e.locale), t.t0 = Object, t.t1 = Object.assign({}, e), t.next = 5, this._subscriptionService.getIntermediateSessionToken();
|
|
2327
2723
|
case 5:
|
|
2328
2724
|
if (t.t2 = t.sent, t.t2) {
|
|
2329
2725
|
t.next = 8;
|
|
@@ -2366,23 +2762,23 @@ var ne = Promise.resolve({
|
|
|
2366
2762
|
Promise.resolve({
|
|
2367
2763
|
pkceRequiredForPasswordResets: !1
|
|
2368
2764
|
});
|
|
2369
|
-
var
|
|
2765
|
+
var Ge = ne(function e(t, r) {
|
|
2370
2766
|
var n = this,
|
|
2371
|
-
|
|
2372
|
-
|
|
2767
|
+
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Le();
|
|
2768
|
+
ie(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = i, this.sms = {
|
|
2373
2769
|
send: function send(e) {
|
|
2374
|
-
return
|
|
2375
|
-
var r, n,
|
|
2376
|
-
return
|
|
2770
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2771
|
+
var r, n, i;
|
|
2772
|
+
return te().wrap(function (t) {
|
|
2377
2773
|
for (;;) switch (t.prev = t.next) {
|
|
2378
2774
|
case 0:
|
|
2379
|
-
return
|
|
2775
|
+
return Be("stytch.otps.sms.send").isString("organization_id", e.organization_id).isString("member_id", e.member_id).isOptionalString("mfa_phone_number", e.mfa_phone_number).isOptionalString("locale", e.locale), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2380
2776
|
case 3:
|
|
2381
|
-
return r = t.sent, n = r.dfp_telemetry_id,
|
|
2777
|
+
return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.abrupt("return", this._networkClient.retriableFetchSDK({
|
|
2382
2778
|
url: "/b2b/otps/sms/send",
|
|
2383
2779
|
body: Object.assign(Object.assign({}, e), {
|
|
2384
2780
|
dfp_telemetry_id: n,
|
|
2385
|
-
captcha_token:
|
|
2781
|
+
captcha_token: i
|
|
2386
2782
|
}),
|
|
2387
2783
|
errorMessage: "Failed to send one time passcode",
|
|
2388
2784
|
method: "POST",
|
|
@@ -2396,14 +2792,14 @@ var de = s(function e(t, r) {
|
|
|
2396
2792
|
}));
|
|
2397
2793
|
},
|
|
2398
2794
|
authenticate: function authenticate(e) {
|
|
2399
|
-
return
|
|
2400
|
-
var r, n, o, s
|
|
2401
|
-
return
|
|
2795
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2796
|
+
var r, n, i, o, s;
|
|
2797
|
+
return te().wrap(function (t) {
|
|
2402
2798
|
for (;;) switch (t.prev = t.next) {
|
|
2403
2799
|
case 0:
|
|
2404
|
-
return
|
|
2800
|
+
return Be("stytch.otps.sms.authenticate").isString("organization_id", e.organization_id).isString("member_id", e.member_id).isString("code", e.code).isOptionalString("set_mfa_enrollment", e.set_mfa_enrollment), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2405
2801
|
case 3:
|
|
2406
|
-
return r = t.sent, n = r.dfp_telemetry_id,
|
|
2802
|
+
return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.t0 = Object, t.t1 = Object.assign({}, e), t.t2 = n, t.t3 = i, t.next = 12, this._subscriptionService.getIntermediateSessionToken();
|
|
2407
2803
|
case 12:
|
|
2408
2804
|
if (t.t4 = t.sent, t.t4) {
|
|
2409
2805
|
t.next = 15;
|
|
@@ -2415,23 +2811,23 @@ var de = s(function e(t, r) {
|
|
|
2415
2811
|
dfp_telemetry_id: t.t2,
|
|
2416
2812
|
captcha_token: t.t3,
|
|
2417
2813
|
intermediate_session_token: t.t5
|
|
2418
|
-
},
|
|
2814
|
+
}, o = t.t0.assign.call(t.t0, t.t1, t.t6), t.next = 20, this._networkClient.retriableFetchSDK({
|
|
2419
2815
|
url: "/b2b/otps/sms/authenticate",
|
|
2420
|
-
body:
|
|
2816
|
+
body: o,
|
|
2421
2817
|
errorMessage: "Failed to authenticate one time passcode",
|
|
2422
2818
|
method: "POST",
|
|
2423
2819
|
retryCallback: this.dfpProtectedAuth.retryWithCaptchaAndDFP
|
|
2424
2820
|
});
|
|
2425
2821
|
case 20:
|
|
2426
|
-
return
|
|
2822
|
+
return s = t.sent, this._subscriptionService.updateStateAndTokens({
|
|
2427
2823
|
state: {
|
|
2428
|
-
session:
|
|
2429
|
-
member:
|
|
2824
|
+
session: s.member_session,
|
|
2825
|
+
member: s.member
|
|
2430
2826
|
},
|
|
2431
|
-
session_token:
|
|
2432
|
-
session_jwt:
|
|
2827
|
+
session_token: s.session_token,
|
|
2828
|
+
session_jwt: s.session_jwt,
|
|
2433
2829
|
intermediate_session_token: null
|
|
2434
|
-
}), t.abrupt("return",
|
|
2830
|
+
}), t.abrupt("return", s);
|
|
2435
2831
|
case 23:
|
|
2436
2832
|
case "end":
|
|
2437
2833
|
return t.stop();
|
|
@@ -2441,21 +2837,101 @@ var de = s(function e(t, r) {
|
|
|
2441
2837
|
}
|
|
2442
2838
|
};
|
|
2443
2839
|
}),
|
|
2444
|
-
|
|
2840
|
+
He = function () {
|
|
2841
|
+
function e(t, r) {
|
|
2842
|
+
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Le();
|
|
2843
|
+
ie(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n;
|
|
2844
|
+
}
|
|
2845
|
+
return ne(e, [{
|
|
2846
|
+
key: "create",
|
|
2847
|
+
value: function value(e) {
|
|
2848
|
+
return he(this, void 0, void 0, te().mark(function t() {
|
|
2849
|
+
var r, n, i;
|
|
2850
|
+
return te().wrap(function (t) {
|
|
2851
|
+
for (;;) switch (t.prev = t.next) {
|
|
2852
|
+
case 0:
|
|
2853
|
+
return Be("stytch.totp.create").isString("organization_id", e.organization_id).isString("member_id", e.member_id).isOptionalNumber("expiration_minutes", e.expiration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2854
|
+
case 3:
|
|
2855
|
+
return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.abrupt("return", this._networkClient.retriableFetchSDK({
|
|
2856
|
+
url: "/b2b/totp",
|
|
2857
|
+
body: Object.assign(Object.assign({}, e), {
|
|
2858
|
+
dfp_telemetry_id: n,
|
|
2859
|
+
captcha_token: i
|
|
2860
|
+
}),
|
|
2861
|
+
errorMessage: "Failed to create TOTP",
|
|
2862
|
+
method: "POST",
|
|
2863
|
+
retryCallback: this.dfpProtectedAuth.retryWithCaptchaAndDFP
|
|
2864
|
+
}));
|
|
2865
|
+
case 7:
|
|
2866
|
+
case "end":
|
|
2867
|
+
return t.stop();
|
|
2868
|
+
}
|
|
2869
|
+
}, t, this);
|
|
2870
|
+
}));
|
|
2871
|
+
}
|
|
2872
|
+
}, {
|
|
2873
|
+
key: "authenticate",
|
|
2874
|
+
value: function value(e) {
|
|
2875
|
+
return he(this, void 0, void 0, te().mark(function t() {
|
|
2876
|
+
var r, n, i, o, s;
|
|
2877
|
+
return te().wrap(function (t) {
|
|
2878
|
+
for (;;) switch (t.prev = t.next) {
|
|
2879
|
+
case 0:
|
|
2880
|
+
return Be("stytch.totp.authenticate").isString("organization_id", e.organization_id).isString("member_id", e.member_id).isString("code", e.code).isOptionalString("set_mfa_enrollment", e.set_mfa_enrollment).isOptionalBoolean("set_default_mfa", e.set_default_mfa), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2881
|
+
case 3:
|
|
2882
|
+
return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.t0 = Object, t.t1 = Object.assign({}, e), t.t2 = n, t.t3 = i, t.next = 12, this._subscriptionService.getIntermediateSessionToken();
|
|
2883
|
+
case 12:
|
|
2884
|
+
if (t.t4 = t.sent, t.t4) {
|
|
2885
|
+
t.next = 15;
|
|
2886
|
+
break;
|
|
2887
|
+
}
|
|
2888
|
+
t.t4 = void 0;
|
|
2889
|
+
case 15:
|
|
2890
|
+
return t.t5 = t.t4, t.t6 = {
|
|
2891
|
+
dfp_telemetry_id: t.t2,
|
|
2892
|
+
captcha_token: t.t3,
|
|
2893
|
+
intermediate_session_token: t.t5
|
|
2894
|
+
}, o = t.t0.assign.call(t.t0, t.t1, t.t6), t.next = 20, this._networkClient.retriableFetchSDK({
|
|
2895
|
+
url: "/b2b/totp/authenticate",
|
|
2896
|
+
body: o,
|
|
2897
|
+
errorMessage: "Failed to authenticate TOTP",
|
|
2898
|
+
method: "POST",
|
|
2899
|
+
retryCallback: this.dfpProtectedAuth.retryWithCaptchaAndDFP
|
|
2900
|
+
});
|
|
2901
|
+
case 20:
|
|
2902
|
+
return s = t.sent, this._subscriptionService.updateStateAndTokens({
|
|
2903
|
+
state: {
|
|
2904
|
+
session: s.member_session,
|
|
2905
|
+
member: s.member
|
|
2906
|
+
},
|
|
2907
|
+
session_token: s.session_token,
|
|
2908
|
+
session_jwt: s.session_jwt,
|
|
2909
|
+
intermediate_session_token: null
|
|
2910
|
+
}), t.abrupt("return", s);
|
|
2911
|
+
case 23:
|
|
2912
|
+
case "end":
|
|
2913
|
+
return t.stop();
|
|
2914
|
+
}
|
|
2915
|
+
}, t, this);
|
|
2916
|
+
}));
|
|
2917
|
+
}
|
|
2918
|
+
}]), e;
|
|
2919
|
+
}(),
|
|
2920
|
+
Ye = function () {
|
|
2445
2921
|
function e(t, r, n) {
|
|
2446
2922
|
var i = this;
|
|
2447
|
-
|
|
2923
|
+
ie(this, e), this._subscriptionService = n, this.isAuthorizedSync = function (e, t) {
|
|
2448
2924
|
var r;
|
|
2449
2925
|
return !!(null === (r = i.cachedPolicy) || void 0 === r ? void 0 : r.callerIsAuthorized(i.roleIds(), e, t));
|
|
2450
2926
|
}, this.isAuthorized = function (e, t) {
|
|
2451
2927
|
return i.policyPromise.then(function (r) {
|
|
2452
2928
|
return r.callerIsAuthorized(i.roleIds(), e, t);
|
|
2453
2929
|
});
|
|
2454
|
-
}, this.cachedPolicy = t.rbacPolicy ?
|
|
2455
|
-
return e.rbacPolicy ? (i.cachedPolicy =
|
|
2930
|
+
}, this.cachedPolicy = t.rbacPolicy ? ot.fromJSON(t.rbacPolicy) : null, this.policyPromise = r.then(function (e) {
|
|
2931
|
+
return e.rbacPolicy ? (i.cachedPolicy = ot.fromJSON(e.rbacPolicy), i.cachedPolicy) : (xe("Unable to retrieve RBAC policy from servers. Assuming caller has no permissions."), new ot([], []));
|
|
2456
2932
|
});
|
|
2457
2933
|
}
|
|
2458
|
-
return
|
|
2934
|
+
return ne(e, [{
|
|
2459
2935
|
key: "allPermissions",
|
|
2460
2936
|
value: function value() {
|
|
2461
2937
|
var e = this;
|
|
@@ -2472,15 +2948,15 @@ var de = s(function e(t, r) {
|
|
|
2472
2948
|
}
|
|
2473
2949
|
}]), e;
|
|
2474
2950
|
}(),
|
|
2475
|
-
|
|
2951
|
+
Ve = function () {
|
|
2476
2952
|
function e(t, r) {
|
|
2477
2953
|
var n = this;
|
|
2478
|
-
|
|
2954
|
+
ie(this, e), this._subscriptionService = t, this._headlessSessionClient = r, this._onDataChange = function (e) {
|
|
2479
2955
|
(null == e ? void 0 : e.session) ? n.scheduleBackgroundRefresh() : n.cancelBackgroundRefresh();
|
|
2480
2956
|
}, this._reauthenticateWithBackoff = function () {
|
|
2481
|
-
return
|
|
2957
|
+
return he(n, void 0, void 0, te().mark(function t() {
|
|
2482
2958
|
var r;
|
|
2483
|
-
return
|
|
2959
|
+
return te().wrap(function (t) {
|
|
2484
2960
|
for (;;) switch (t.prev = t.next) {
|
|
2485
2961
|
case 0:
|
|
2486
2962
|
r = 0;
|
|
@@ -2509,14 +2985,14 @@ var de = s(function e(t, r) {
|
|
|
2509
2985
|
}));
|
|
2510
2986
|
}, this.timeout = null, this._subscriptionService.subscribeToState(this._onDataChange);
|
|
2511
2987
|
}
|
|
2512
|
-
return
|
|
2988
|
+
return ne(e, [{
|
|
2513
2989
|
key: "performBackgroundRefresh",
|
|
2514
2990
|
value: function value() {
|
|
2515
2991
|
var e = this;
|
|
2516
2992
|
this._reauthenticateWithBackoff().then(function () {
|
|
2517
2993
|
e.scheduleBackgroundRefresh();
|
|
2518
2994
|
})["catch"](function (t) {
|
|
2519
|
-
|
|
2995
|
+
Oe("Session background refresh failed. Signalling to app that user is logged out.", {
|
|
2520
2996
|
error: t
|
|
2521
2997
|
}), e._subscriptionService.destroyState();
|
|
2522
2998
|
});
|
|
@@ -2542,30 +3018,29 @@ var de = s(function e(t, r) {
|
|
|
2542
3018
|
}, {
|
|
2543
3019
|
key: "isUnrecoverableError",
|
|
2544
3020
|
value: function value(e) {
|
|
2545
|
-
return
|
|
3021
|
+
return m.includes(e.error_type);
|
|
2546
3022
|
}
|
|
2547
3023
|
}]), e;
|
|
2548
3024
|
}();
|
|
2549
|
-
|
|
2550
|
-
var
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
Ee = function () {
|
|
3025
|
+
Ve.REFRESH_INTERVAL_MS = 18e4;
|
|
3026
|
+
var Je,
|
|
3027
|
+
$e,
|
|
3028
|
+
Xe,
|
|
3029
|
+
Ze,
|
|
3030
|
+
Qe,
|
|
3031
|
+
et,
|
|
3032
|
+
tt,
|
|
3033
|
+
rt,
|
|
3034
|
+
nt,
|
|
3035
|
+
it,
|
|
3036
|
+
ot = function () {
|
|
2562
3037
|
function e(t, r) {
|
|
2563
3038
|
var n = this;
|
|
2564
|
-
|
|
3039
|
+
ie(this, e), this.roles = t, this.resources = r, this.rolesByID = {}, t.forEach(function (e) {
|
|
2565
3040
|
return n.rolesByID[e.role_id] = e;
|
|
2566
3041
|
});
|
|
2567
3042
|
}
|
|
2568
|
-
return
|
|
3043
|
+
return ne(e, [{
|
|
2569
3044
|
key: "callerIsAuthorized",
|
|
2570
3045
|
value: function value(e, t, r) {
|
|
2571
3046
|
var n = this;
|
|
@@ -2599,7 +3074,7 @@ var _e,
|
|
|
2599
3074
|
}
|
|
2600
3075
|
}]), e;
|
|
2601
3076
|
}();
|
|
2602
|
-
function
|
|
3077
|
+
function st(e, t, r, n) {
|
|
2603
3078
|
return new (r || (r = Promise))(function (i, o) {
|
|
2604
3079
|
function s(e) {
|
|
2605
3080
|
try {
|
|
@@ -2626,63 +3101,61 @@ function Pe(e, t, r, n) {
|
|
|
2626
3101
|
}
|
|
2627
3102
|
"function" == typeof SuppressedError && SuppressedError, function (e) {
|
|
2628
3103
|
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords", e.passkeys = "passkeys";
|
|
2629
|
-
}(
|
|
3104
|
+
}(Je || (Je = {})), function (e) {
|
|
2630
3105
|
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";
|
|
2631
|
-
}(
|
|
3106
|
+
}($e || ($e = {})), function (e) {
|
|
2632
3107
|
e.Vessel = "Vessel", e.Phantom = "Phantom", e.Metamask = "Metamask", e.Coinbase = "Coinbase", e.Binance = "Binance", e.GenericEthereumWallet = "Other Ethereum Wallet", e.GenericSolanaWallet = "Other Solana Wallet";
|
|
2633
|
-
}(
|
|
3108
|
+
}(Xe || (Xe = {})), function (e) {
|
|
2634
3109
|
e.embedded = "embedded", e.floating = "floating";
|
|
2635
|
-
}(
|
|
3110
|
+
}(Ze || (Ze = {})), function (e) {
|
|
2636
3111
|
e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
|
|
2637
|
-
}(
|
|
3112
|
+
}(Qe || (Qe = {})), function (e) {
|
|
2638
3113
|
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";
|
|
2639
|
-
}(
|
|
2640
|
-
var
|
|
2641
|
-
_inherits(
|
|
2642
|
-
var _super = _createSuper(
|
|
2643
|
-
function
|
|
3114
|
+
}(et || (et = {}));
|
|
3115
|
+
var at = /*#__PURE__*/function (_Error) {
|
|
3116
|
+
_inherits(at, _Error);
|
|
3117
|
+
var _super = _createSuper(at);
|
|
3118
|
+
function at(e, t) {
|
|
2644
3119
|
var _this;
|
|
2645
|
-
_classCallCheck(this,
|
|
3120
|
+
_classCallCheck(this, at);
|
|
2646
3121
|
_this = _super.call(this), _this.name = "StytchSDKUsageError", _this.message = "Invalid call to ".concat(e, "\n") + t;
|
|
2647
3122
|
return _this;
|
|
2648
3123
|
}
|
|
2649
|
-
return _createClass(
|
|
3124
|
+
return _createClass(at);
|
|
2650
3125
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
2651
3126
|
!function (e) {
|
|
2652
|
-
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";
|
|
2653
|
-
}(ye || (ye = {})), function (e) {
|
|
2654
3127
|
e.emailMagicLinks = "emailMagicLinks", e.sso = "sso", e.passwords = "passwords", e.oauth = "oauth";
|
|
2655
|
-
}(
|
|
3128
|
+
}(tt || (tt = {})), function (e) {
|
|
2656
3129
|
e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
|
|
2657
|
-
}(
|
|
3130
|
+
}(rt || (rt = {})), function (e) {
|
|
2658
3131
|
e.Google = "google", e.Microsoft = "microsoft";
|
|
2659
|
-
}(
|
|
3132
|
+
}(nt || (nt = {})), function (e) {
|
|
2660
3133
|
e.RequiredCatcha = "Catcha Required";
|
|
2661
|
-
}(
|
|
2662
|
-
var
|
|
3134
|
+
}(it || (it = {}));
|
|
3135
|
+
var ct = function ct(e) {
|
|
2663
3136
|
var t = {
|
|
2664
3137
|
isObject: function isObject(r, n) {
|
|
2665
|
-
if (!("object" == _typeof(n) && !Array.isArray(n) && null !== n)) throw new
|
|
3138
|
+
if (!("object" == _typeof(n) && !Array.isArray(n) && null !== n)) throw new at(e, r + " must be an object.");
|
|
2666
3139
|
return t;
|
|
2667
3140
|
},
|
|
2668
3141
|
isOptionalObject: function isOptionalObject(e, r) {
|
|
2669
3142
|
return void 0 === r ? t : t.isObject(e, r);
|
|
2670
3143
|
},
|
|
2671
3144
|
isString: function isString(r, n) {
|
|
2672
|
-
if ("string" != typeof n) throw new
|
|
3145
|
+
if ("string" != typeof n) throw new at(e, r + " must be a string.");
|
|
2673
3146
|
return t;
|
|
2674
3147
|
},
|
|
2675
3148
|
isOptionalString: function isOptionalString(e, r) {
|
|
2676
3149
|
return void 0 === r ? t : t.isString(e, r);
|
|
2677
3150
|
},
|
|
2678
3151
|
isStringArray: function isStringArray(r, n) {
|
|
2679
|
-
if (!Array.isArray(n)) throw new
|
|
3152
|
+
if (!Array.isArray(n)) throw new at(e, r + " must be an array of strings.");
|
|
2680
3153
|
var _iterator = _createForOfIteratorHelper(n),
|
|
2681
3154
|
_step;
|
|
2682
3155
|
try {
|
|
2683
3156
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
2684
3157
|
var _t2 = _step.value;
|
|
2685
|
-
if ("string" != typeof _t2) throw new
|
|
3158
|
+
if ("string" != typeof _t2) throw new at(e, r + " must be an array of strings.");
|
|
2686
3159
|
}
|
|
2687
3160
|
} catch (err) {
|
|
2688
3161
|
_iterator.e(err);
|
|
@@ -2695,14 +3168,14 @@ var Oe = function Oe(e) {
|
|
|
2695
3168
|
return void 0 === r ? t : t.isStringArray(e, r);
|
|
2696
3169
|
},
|
|
2697
3170
|
isNumber: function isNumber(r, n) {
|
|
2698
|
-
if ("number" != typeof n) throw new
|
|
3171
|
+
if ("number" != typeof n) throw new at(e, r + " must be a number.");
|
|
2699
3172
|
return t;
|
|
2700
3173
|
},
|
|
2701
3174
|
isOptionalNumber: function isOptionalNumber(e, r) {
|
|
2702
3175
|
return void 0 === r ? t : t.isNumber(e, r);
|
|
2703
3176
|
},
|
|
2704
3177
|
isBoolean: function isBoolean(r, n) {
|
|
2705
|
-
if ("boolean" != typeof n) throw new
|
|
3178
|
+
if ("boolean" != typeof n) throw new at(e, r + " must be a boolean.");
|
|
2706
3179
|
return t;
|
|
2707
3180
|
},
|
|
2708
3181
|
isOptionalBoolean: function isOptionalBoolean(e, r) {
|
|
@@ -2711,26 +3184,26 @@ var Oe = function Oe(e) {
|
|
|
2711
3184
|
};
|
|
2712
3185
|
return t;
|
|
2713
3186
|
};
|
|
2714
|
-
var
|
|
3187
|
+
var ut;
|
|
2715
3188
|
!function (e) {
|
|
2716
3189
|
e.LoginOrCreateEML = "login_or_create_eml", e.LoginOrCreateOTP = "login_or_create_otp", e.ResetPassword = "reset_password";
|
|
2717
|
-
}(
|
|
3190
|
+
}(ut || (ut = {})), Promise.resolve({
|
|
2718
3191
|
pkceRequiredForEmailMagicLinks: !1
|
|
2719
3192
|
}), Promise.resolve({
|
|
2720
3193
|
pkceRequiredForPasswordResets: !1
|
|
2721
3194
|
}), Promise.resolve({
|
|
2722
3195
|
pkceRequiredForEmailMagicLinks: !1
|
|
2723
3196
|
});
|
|
2724
|
-
var
|
|
3197
|
+
var lt = Promise.resolve({
|
|
2725
3198
|
pkceRequiredForPasswordResets: !1
|
|
2726
3199
|
});
|
|
2727
|
-
var
|
|
2728
|
-
function
|
|
2729
|
-
var n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] :
|
|
3200
|
+
var dt = /*#__PURE__*/function () {
|
|
3201
|
+
function dt(e, t, r) {
|
|
3202
|
+
var n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : lt;
|
|
2730
3203
|
var i = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function () {
|
|
2731
3204
|
return {
|
|
2732
3205
|
isEnabled: function isEnabled() {
|
|
2733
|
-
return
|
|
3206
|
+
return st(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2734
3207
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2735
3208
|
while (1) switch (_context.prev = _context.next) {
|
|
2736
3209
|
case 0:
|
|
@@ -2743,7 +3216,7 @@ var Be = /*#__PURE__*/function () {
|
|
|
2743
3216
|
}));
|
|
2744
3217
|
},
|
|
2745
3218
|
getTelemetryID: function getTelemetryID() {
|
|
2746
|
-
return
|
|
3219
|
+
return st(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
2747
3220
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2748
3221
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2749
3222
|
case 0:
|
|
@@ -2754,7 +3227,7 @@ var Be = /*#__PURE__*/function () {
|
|
|
2754
3227
|
}));
|
|
2755
3228
|
},
|
|
2756
3229
|
getDFPTelemetryIDAndCaptcha: function getDFPTelemetryIDAndCaptcha() {
|
|
2757
|
-
return
|
|
3230
|
+
return st(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
2758
3231
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
2759
3232
|
while (1) switch (_context3.prev = _context3.next) {
|
|
2760
3233
|
case 0:
|
|
@@ -2770,7 +3243,7 @@ var Be = /*#__PURE__*/function () {
|
|
|
2770
3243
|
}));
|
|
2771
3244
|
},
|
|
2772
3245
|
retryWithCaptchaAndDFP: function retryWithCaptchaAndDFP() {
|
|
2773
|
-
return
|
|
3246
|
+
return st(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
2774
3247
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
2775
3248
|
while (1) switch (_context4.prev = _context4.next) {
|
|
2776
3249
|
case 0:
|
|
@@ -2784,13 +3257,13 @@ var Be = /*#__PURE__*/function () {
|
|
|
2784
3257
|
}
|
|
2785
3258
|
};
|
|
2786
3259
|
}();
|
|
2787
|
-
_classCallCheck(this,
|
|
3260
|
+
_classCallCheck(this, dt);
|
|
2788
3261
|
this._networkClient = e, this._subscriptionService = t, this._pkceManager = r, this._config = n, this.dfpProtectedAuth = i;
|
|
2789
3262
|
}
|
|
2790
|
-
_createClass(
|
|
3263
|
+
_createClass(dt, [{
|
|
2791
3264
|
key: "getCodeChallenge",
|
|
2792
3265
|
value: function getCodeChallenge() {
|
|
2793
|
-
return
|
|
3266
|
+
return st(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
2794
3267
|
var _yield$this$_config, e, t;
|
|
2795
3268
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
2796
3269
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -2831,12 +3304,12 @@ var Be = /*#__PURE__*/function () {
|
|
|
2831
3304
|
}, {
|
|
2832
3305
|
key: "authenticate",
|
|
2833
3306
|
value: function authenticate(e) {
|
|
2834
|
-
return
|
|
3307
|
+
return st(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
2835
3308
|
var t, r, _yield$this$dfpProtec, n, i, o;
|
|
2836
3309
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
2837
3310
|
while (1) switch (_context6.prev = _context6.next) {
|
|
2838
3311
|
case 0:
|
|
2839
|
-
|
|
3312
|
+
ct("stytch.passwords.authenticate").isString("org_id", e.organization_id).isString("password", e.password).isString("email_address", e.email_address).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalString("locale", e.locale);
|
|
2840
3313
|
_context6.next = 3;
|
|
2841
3314
|
return this._pkceManager.getPKPair();
|
|
2842
3315
|
case 3:
|
|
@@ -2891,12 +3364,12 @@ var Be = /*#__PURE__*/function () {
|
|
|
2891
3364
|
}, {
|
|
2892
3365
|
key: "resetByEmailStart",
|
|
2893
3366
|
value: function resetByEmailStart(e) {
|
|
2894
|
-
return
|
|
3367
|
+
return st(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
2895
3368
|
var t, _yield$this$dfpProtec2, r, n;
|
|
2896
3369
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
2897
3370
|
while (1) switch (_context7.prev = _context7.next) {
|
|
2898
3371
|
case 0:
|
|
2899
|
-
|
|
3372
|
+
ct("stytch.passwords.resetByEmailStart").isString("email", e.email_address).isOptionalString("login_redirect_url", e.login_redirect_url).isOptionalString("reset_password_redirect_url", e.reset_password_redirect_url).isOptionalString("reset_password_template_id", e.reset_password_template_id).isOptionalNumber("reset_password_expiration_minutes", e.reset_password_expiration_minutes);
|
|
2900
3373
|
_context7.next = 3;
|
|
2901
3374
|
return this.getCodeChallenge();
|
|
2902
3375
|
case 3:
|
|
@@ -2934,12 +3407,12 @@ var Be = /*#__PURE__*/function () {
|
|
|
2934
3407
|
}, {
|
|
2935
3408
|
key: "resetByEmail",
|
|
2936
3409
|
value: function resetByEmail(e) {
|
|
2937
|
-
return
|
|
3410
|
+
return st(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
2938
3411
|
var _yield$this$dfpProtec3, t, r, n, i, o;
|
|
2939
3412
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
2940
3413
|
while (1) switch (_context8.prev = _context8.next) {
|
|
2941
3414
|
case 0:
|
|
2942
|
-
|
|
3415
|
+
ct("stytch.passwords.resetByEmail").isString("password_reset_token", e.password_reset_token).isString("password", e.password).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalString("locale", e.locale);
|
|
2943
3416
|
_context8.next = 3;
|
|
2944
3417
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2945
3418
|
case 3:
|
|
@@ -2993,12 +3466,12 @@ var Be = /*#__PURE__*/function () {
|
|
|
2993
3466
|
}, {
|
|
2994
3467
|
key: "resetByExistingPassword",
|
|
2995
3468
|
value: function resetByExistingPassword(e) {
|
|
2996
|
-
return
|
|
3469
|
+
return st(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
2997
3470
|
var _yield$this$dfpProtec4, t, r, n;
|
|
2998
3471
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
2999
3472
|
while (1) switch (_context9.prev = _context9.next) {
|
|
3000
3473
|
case 0:
|
|
3001
|
-
|
|
3474
|
+
ct("stytch.passwords.resetByExistingPassword").isString("email", e.email_address).isString("existing_password", e.existing_password).isString("new_password", e.new_password).isOptionalString("locale", e.locale);
|
|
3002
3475
|
_context9.next = 3;
|
|
3003
3476
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
3004
3477
|
case 3:
|
|
@@ -3047,12 +3520,12 @@ var Be = /*#__PURE__*/function () {
|
|
|
3047
3520
|
}, {
|
|
3048
3521
|
key: "resetBySession",
|
|
3049
3522
|
value: function resetBySession(e) {
|
|
3050
|
-
return
|
|
3523
|
+
return st(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
3051
3524
|
var _yield$this$dfpProtec5, t, r, n;
|
|
3052
3525
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
3053
3526
|
while (1) switch (_context10.prev = _context10.next) {
|
|
3054
3527
|
case 0:
|
|
3055
|
-
|
|
3528
|
+
ct("stytch.passwords.resetBySession").isString("password", e.password);
|
|
3056
3529
|
_context10.next = 3;
|
|
3057
3530
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
3058
3531
|
case 3:
|
|
@@ -3092,11 +3565,11 @@ var Be = /*#__PURE__*/function () {
|
|
|
3092
3565
|
}, {
|
|
3093
3566
|
key: "strengthCheck",
|
|
3094
3567
|
value: function strengthCheck(e) {
|
|
3095
|
-
return
|
|
3568
|
+
return st(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
3096
3569
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
3097
3570
|
while (1) switch (_context11.prev = _context11.next) {
|
|
3098
3571
|
case 0:
|
|
3099
|
-
return _context11.abrupt("return", (
|
|
3572
|
+
return _context11.abrupt("return", (ct("stytch.passwords.strengthCheck").isOptionalString("email", e.email_address).isString("password", e.password), this._networkClient.fetchSDK({
|
|
3100
3573
|
url: "/b2b/passwords/strength_check",
|
|
3101
3574
|
method: "POST",
|
|
3102
3575
|
errorMessage: "Failed to check password strength.",
|
|
@@ -3113,21 +3586,21 @@ var Be = /*#__PURE__*/function () {
|
|
|
3113
3586
|
}));
|
|
3114
3587
|
}
|
|
3115
3588
|
}]);
|
|
3116
|
-
return
|
|
3589
|
+
return dt;
|
|
3117
3590
|
}();
|
|
3118
|
-
var
|
|
3119
|
-
var
|
|
3120
|
-
function
|
|
3591
|
+
var ht = "bootstrap";
|
|
3592
|
+
var pt = /*#__PURE__*/function () {
|
|
3593
|
+
function pt(e, t, r) {
|
|
3121
3594
|
var _this2 = this;
|
|
3122
|
-
_classCallCheck(this,
|
|
3595
|
+
_classCallCheck(this, pt);
|
|
3123
3596
|
this._publicToken = e, this._networkClient = t, this._dataLayer = r, this._bootstrapDataPromise = this._networkClient.fetchSDK({
|
|
3124
3597
|
url: "/projects/bootstrap/".concat(this._publicToken),
|
|
3125
3598
|
method: "GET",
|
|
3126
3599
|
errorMessage: "Error fetching bootstrap data for SDK for ".concat(this._publicToken)
|
|
3127
|
-
}).then(
|
|
3128
|
-
return _this2._dataLayer.setItem(
|
|
3600
|
+
}).then(pt.mapBootstrapData).then(function (e) {
|
|
3601
|
+
return _this2._dataLayer.setItem(ht, JSON.stringify(e)), e;
|
|
3129
3602
|
})["catch"](function (e) {
|
|
3130
|
-
return
|
|
3603
|
+
return xe(e), {
|
|
3131
3604
|
displayWatermark: !1,
|
|
3132
3605
|
cnameDomain: null,
|
|
3133
3606
|
emailDomains: ["stytch.com"],
|
|
@@ -3146,10 +3619,10 @@ var De = /*#__PURE__*/function () {
|
|
|
3146
3619
|
};
|
|
3147
3620
|
});
|
|
3148
3621
|
}
|
|
3149
|
-
_createClass(
|
|
3622
|
+
_createClass(pt, [{
|
|
3150
3623
|
key: "getSync",
|
|
3151
3624
|
value: function getSync() {
|
|
3152
|
-
var e = this._dataLayer.getItem(
|
|
3625
|
+
var e = this._dataLayer.getItem(ht);
|
|
3153
3626
|
if (null === e) return {
|
|
3154
3627
|
displayWatermark: !1,
|
|
3155
3628
|
cnameDomain: null,
|
|
@@ -3220,13 +3693,13 @@ var De = /*#__PURE__*/function () {
|
|
|
3220
3693
|
};
|
|
3221
3694
|
}
|
|
3222
3695
|
}]);
|
|
3223
|
-
return
|
|
3696
|
+
return pt;
|
|
3224
3697
|
}();
|
|
3225
|
-
var
|
|
3698
|
+
var _t = /*#__PURE__*/_createClass(function _t(e) {
|
|
3226
3699
|
var _this3 = this;
|
|
3227
|
-
_classCallCheck(this,
|
|
3700
|
+
_classCallCheck(this, _t);
|
|
3228
3701
|
this.bootstrapPromise = e, this.executeRecaptcha = function () {
|
|
3229
|
-
return
|
|
3702
|
+
return st(_this3, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
3230
3703
|
var _yield$this$state, e, t, r;
|
|
3231
3704
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
3232
3705
|
while (1) switch (_context12.prev = _context12.next) {
|
|
@@ -3257,7 +3730,7 @@ var Ie = /*#__PURE__*/_createClass(function Ie(e) {
|
|
|
3257
3730
|
}, _callee12, this);
|
|
3258
3731
|
}));
|
|
3259
3732
|
}, this.state = e.then(function (e) {
|
|
3260
|
-
return
|
|
3733
|
+
return st(_this3, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
3261
3734
|
var t;
|
|
3262
3735
|
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
3263
3736
|
while (1) switch (_context13.prev = _context13.next) {
|
|
@@ -3268,7 +3741,7 @@ var Ie = /*#__PURE__*/_createClass(function Ie(e) {
|
|
|
3268
3741
|
}
|
|
3269
3742
|
_context13.t1 = !0;
|
|
3270
3743
|
_context13.next = 4;
|
|
3271
|
-
return t = e.captchaSettings.siteKey,
|
|
3744
|
+
return t = e.captchaSettings.siteKey, Pe("https://www.google.com/recaptcha/enterprise.js?render=".concat(t), function () {
|
|
3272
3745
|
return window.grecaptcha.enterprise;
|
|
3273
3746
|
});
|
|
3274
3747
|
case 4:
|
|
@@ -3295,18 +3768,18 @@ var Ie = /*#__PURE__*/_createClass(function Ie(e) {
|
|
|
3295
3768
|
}));
|
|
3296
3769
|
});
|
|
3297
3770
|
});
|
|
3298
|
-
var
|
|
3299
|
-
function
|
|
3300
|
-
_classCallCheck(this,
|
|
3771
|
+
var ft = /*#__PURE__*/function () {
|
|
3772
|
+
function ft(e, t, r, n) {
|
|
3773
|
+
_classCallCheck(this, ft);
|
|
3301
3774
|
this._publicToken = e, this._subscriptionDataLayer = t, this.baseURL = r, this.additionalTelemetryDataFn = n, this.updateSessionToken = function () {
|
|
3302
3775
|
return null;
|
|
3303
|
-
}, this.eventLogger = new
|
|
3776
|
+
}, this.eventLogger = new Me({
|
|
3304
3777
|
maxBatchSize: 15,
|
|
3305
3778
|
intervalDurationMs: 800,
|
|
3306
3779
|
logEventURL: this.buildSDKUrl("/events")
|
|
3307
3780
|
});
|
|
3308
3781
|
}
|
|
3309
|
-
_createClass(
|
|
3782
|
+
_createClass(ft, [{
|
|
3310
3783
|
key: "logEvent",
|
|
3311
3784
|
value: function logEvent(_ref) {
|
|
3312
3785
|
var e = _ref.name,
|
|
@@ -3326,9 +3799,9 @@ var Le = /*#__PURE__*/function () {
|
|
|
3326
3799
|
key: "createTelemetryBlob",
|
|
3327
3800
|
value: function createTelemetryBlob() {
|
|
3328
3801
|
return Object.assign(Object.assign({
|
|
3329
|
-
event_id: "event-id-".concat(
|
|
3330
|
-
app_session_id: "app-session-id-".concat(
|
|
3331
|
-
persistent_id: "persistent-id-".concat(
|
|
3802
|
+
event_id: "event-id-".concat(we()),
|
|
3803
|
+
app_session_id: "app-session-id-".concat(we()),
|
|
3804
|
+
persistent_id: "persistent-id-".concat(we()),
|
|
3332
3805
|
client_sent_at: new Date().toISOString(),
|
|
3333
3806
|
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
3334
3807
|
}, this.additionalTelemetryDataFn()), {
|
|
@@ -3337,7 +3810,7 @@ var Le = /*#__PURE__*/function () {
|
|
|
3337
3810
|
},
|
|
3338
3811
|
sdk: {
|
|
3339
3812
|
identifier: "Stytch.js Javascript SDK",
|
|
3340
|
-
version: "
|
|
3813
|
+
version: "4.1.1"
|
|
3341
3814
|
}
|
|
3342
3815
|
});
|
|
3343
3816
|
}
|
|
@@ -3348,13 +3821,13 @@ var Le = /*#__PURE__*/function () {
|
|
|
3348
3821
|
t = _ref2.body,
|
|
3349
3822
|
r = _ref2.errorMessage,
|
|
3350
3823
|
n = _ref2.method;
|
|
3351
|
-
return
|
|
3824
|
+
return st(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
3352
3825
|
var i, o, s, a;
|
|
3353
3826
|
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
3354
3827
|
while (1) switch (_context14.prev = _context14.next) {
|
|
3355
3828
|
case 0:
|
|
3356
3829
|
i = this._subscriptionDataLayer.readSessionCookie().session_token, o = "Basic " + window.btoa(this._publicToken + ":" + (i || this._publicToken)), s = window.btoa(JSON.stringify(this.createTelemetryBlob())), a = window.location.origin;
|
|
3357
|
-
return _context14.abrupt("return",
|
|
3830
|
+
return _context14.abrupt("return", fe({
|
|
3358
3831
|
basicAuthHeader: o,
|
|
3359
3832
|
body: t,
|
|
3360
3833
|
errorMessage: r,
|
|
@@ -3377,47 +3850,47 @@ var Le = /*#__PURE__*/function () {
|
|
|
3377
3850
|
t = _ref3.body,
|
|
3378
3851
|
r = _ref3.errorMessage,
|
|
3379
3852
|
n = _ref3.method,
|
|
3380
|
-
|
|
3381
|
-
return
|
|
3382
|
-
var s, a, c
|
|
3853
|
+
i = _ref3.retryCallback;
|
|
3854
|
+
return st(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
3855
|
+
var o, s, a, c;
|
|
3383
3856
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
3384
3857
|
while (1) switch (_context15.prev = _context15.next) {
|
|
3385
3858
|
case 0:
|
|
3386
|
-
|
|
3859
|
+
o = this._subscriptionDataLayer.readSessionCookie().session_token, s = "Basic " + window.btoa(this._publicToken + ":" + (o || this._publicToken)), a = window.btoa(JSON.stringify(this.createTelemetryBlob())), c = window.location.origin;
|
|
3387
3860
|
return _context15.abrupt("return", function (e) {
|
|
3388
3861
|
var t = e.method,
|
|
3389
3862
|
r = e.errorMessage,
|
|
3390
3863
|
n = e.finalURL,
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
return
|
|
3397
|
-
var
|
|
3398
|
-
return
|
|
3864
|
+
i = e.basicAuthHeader,
|
|
3865
|
+
o = e.xSDKClientHeader,
|
|
3866
|
+
s = e.xSDKParentHostHeader,
|
|
3867
|
+
a = e.body,
|
|
3868
|
+
c = e.retryCallback;
|
|
3869
|
+
return he(this, void 0, void 0, te().mark(function e() {
|
|
3870
|
+
var u;
|
|
3871
|
+
return te().wrap(function (e) {
|
|
3399
3872
|
for (;;) switch (e.prev = e.next) {
|
|
3400
3873
|
case 0:
|
|
3401
|
-
return
|
|
3874
|
+
return u = {
|
|
3402
3875
|
method: t,
|
|
3403
3876
|
errorMessage: r,
|
|
3404
3877
|
finalURL: n,
|
|
3405
|
-
basicAuthHeader:
|
|
3406
|
-
xSDKClientHeader:
|
|
3407
|
-
xSDKParentHostHeader:
|
|
3408
|
-
body:
|
|
3409
|
-
}, e.prev = 1, e.next = 4,
|
|
3878
|
+
basicAuthHeader: i,
|
|
3879
|
+
xSDKClientHeader: o,
|
|
3880
|
+
xSDKParentHostHeader: s,
|
|
3881
|
+
body: a
|
|
3882
|
+
}, e.prev = 1, e.next = 4, fe(u);
|
|
3410
3883
|
case 4:
|
|
3411
3884
|
case 15:
|
|
3412
3885
|
return e.abrupt("return", e.sent);
|
|
3413
3886
|
case 7:
|
|
3414
|
-
if (e.prev = 7, e.t0 = e["catch"](1), !(e.t0 instanceof
|
|
3887
|
+
if (e.prev = 7, e.t0 = e["catch"](1), !(e.t0 instanceof _e)) {
|
|
3415
3888
|
e.next = 16;
|
|
3416
3889
|
break;
|
|
3417
3890
|
}
|
|
3418
|
-
return e.next = 12,
|
|
3891
|
+
return e.next = 12, c(e.t0, u);
|
|
3419
3892
|
case 12:
|
|
3420
|
-
return
|
|
3893
|
+
return u = e.sent, e.next = 15, fe(u);
|
|
3421
3894
|
case 16:
|
|
3422
3895
|
throw e.t0;
|
|
3423
3896
|
case 17:
|
|
@@ -3427,14 +3900,14 @@ var Le = /*#__PURE__*/function () {
|
|
|
3427
3900
|
}, e, null, [[1, 7]]);
|
|
3428
3901
|
}));
|
|
3429
3902
|
}({
|
|
3430
|
-
basicAuthHeader:
|
|
3903
|
+
basicAuthHeader: s,
|
|
3431
3904
|
body: t,
|
|
3432
3905
|
errorMessage: r,
|
|
3433
3906
|
finalURL: this.buildSDKUrl(e),
|
|
3434
3907
|
method: n,
|
|
3435
|
-
xSDKClientHeader:
|
|
3436
|
-
xSDKParentHostHeader:
|
|
3437
|
-
retryCallback:
|
|
3908
|
+
xSDKClientHeader: a,
|
|
3909
|
+
xSDKParentHostHeader: c,
|
|
3910
|
+
retryCallback: i
|
|
3438
3911
|
}));
|
|
3439
3912
|
case 2:
|
|
3440
3913
|
case "end":
|
|
@@ -3449,18 +3922,18 @@ var Le = /*#__PURE__*/function () {
|
|
|
3449
3922
|
return "".concat(this.baseURL, "/sdk/v1").concat(e);
|
|
3450
3923
|
}
|
|
3451
3924
|
}]);
|
|
3452
|
-
return
|
|
3925
|
+
return ft;
|
|
3453
3926
|
}();
|
|
3454
|
-
function
|
|
3927
|
+
function mt(e) {
|
|
3455
3928
|
var t = e.toString(16);
|
|
3456
3929
|
return 1 === t.length && (t = "0" + t), t;
|
|
3457
3930
|
}
|
|
3458
|
-
var
|
|
3459
|
-
function
|
|
3460
|
-
_classCallCheck(this,
|
|
3931
|
+
var vt = /*#__PURE__*/function () {
|
|
3932
|
+
function vt(e, t) {
|
|
3933
|
+
_classCallCheck(this, vt);
|
|
3461
3934
|
this._dataLayer = e, this.namespace = t;
|
|
3462
3935
|
}
|
|
3463
|
-
_createClass(
|
|
3936
|
+
_createClass(vt, [{
|
|
3464
3937
|
key: "key",
|
|
3465
3938
|
value: function key() {
|
|
3466
3939
|
return "PKCE_VERIFIER:" + this.namespace;
|
|
@@ -3468,13 +3941,13 @@ var Ne = /*#__PURE__*/function () {
|
|
|
3468
3941
|
}, {
|
|
3469
3942
|
key: "startPKCETransaction",
|
|
3470
3943
|
value: function startPKCETransaction() {
|
|
3471
|
-
return
|
|
3944
|
+
return st(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
3472
3945
|
var e;
|
|
3473
3946
|
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
3474
3947
|
while (1) switch (_context16.prev = _context16.next) {
|
|
3475
3948
|
case 0:
|
|
3476
3949
|
_context16.next = 2;
|
|
3477
|
-
return
|
|
3950
|
+
return vt.createProofkeyPair();
|
|
3478
3951
|
case 2:
|
|
3479
3952
|
e = _context16.sent;
|
|
3480
3953
|
return _context16.abrupt("return", (this._dataLayer.setItem(this.key(), JSON.stringify(e)), e));
|
|
@@ -3492,7 +3965,7 @@ var Ne = /*#__PURE__*/function () {
|
|
|
3492
3965
|
if (null !== e) try {
|
|
3493
3966
|
return JSON.parse(e);
|
|
3494
3967
|
} catch (e) {
|
|
3495
|
-
return void
|
|
3968
|
+
return void Oe("Found malformed Proof Key pair in localstorage.");
|
|
3496
3969
|
}
|
|
3497
3970
|
}
|
|
3498
3971
|
}, {
|
|
@@ -3503,7 +3976,7 @@ var Ne = /*#__PURE__*/function () {
|
|
|
3503
3976
|
}], [{
|
|
3504
3977
|
key: "createProofkeyPair",
|
|
3505
3978
|
value: function createProofkeyPair() {
|
|
3506
|
-
return
|
|
3979
|
+
return st(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
3507
3980
|
var _String$fromCharCode;
|
|
3508
3981
|
var e, t, r, n;
|
|
3509
3982
|
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
@@ -3511,7 +3984,7 @@ var Ne = /*#__PURE__*/function () {
|
|
|
3511
3984
|
case 0:
|
|
3512
3985
|
e = new Uint32Array(16);
|
|
3513
3986
|
window.crypto.getRandomValues(e);
|
|
3514
|
-
t = Array.from(e).map(
|
|
3987
|
+
t = Array.from(e).map(mt).join("");
|
|
3515
3988
|
_context17.next = 5;
|
|
3516
3989
|
return window.crypto.subtle.digest("SHA-256", new TextEncoder().encode(t));
|
|
3517
3990
|
case 5:
|
|
@@ -3528,14 +4001,14 @@ var Ne = /*#__PURE__*/function () {
|
|
|
3528
4001
|
}));
|
|
3529
4002
|
}
|
|
3530
4003
|
}]);
|
|
3531
|
-
return
|
|
4004
|
+
return vt;
|
|
3532
4005
|
}();
|
|
3533
|
-
var
|
|
3534
|
-
function
|
|
3535
|
-
_classCallCheck(this,
|
|
4006
|
+
var bt = /*#__PURE__*/function () {
|
|
4007
|
+
function bt(e) {
|
|
4008
|
+
_classCallCheck(this, bt);
|
|
3536
4009
|
this._networkClient = e;
|
|
3537
4010
|
}
|
|
3538
|
-
_createClass(
|
|
4011
|
+
_createClass(bt, [{
|
|
3539
4012
|
key: "searchUser",
|
|
3540
4013
|
value: function searchUser(e) {
|
|
3541
4014
|
return this._networkClient.fetchSDK({
|
|
@@ -3573,9 +4046,9 @@ var je = /*#__PURE__*/function () {
|
|
|
3573
4046
|
});
|
|
3574
4047
|
}
|
|
3575
4048
|
}]);
|
|
3576
|
-
return
|
|
4049
|
+
return bt;
|
|
3577
4050
|
}();
|
|
3578
|
-
var
|
|
4051
|
+
var gt = function gt(e) {
|
|
3579
4052
|
return (document.cookie ? document.cookie.split("; ") : []).filter(function (t) {
|
|
3580
4053
|
var _t$split = t.split("="),
|
|
3581
4054
|
_t$split2 = _slicedToArray(_t$split, 1),
|
|
@@ -3584,17 +4057,17 @@ var Fe = function Fe(e) {
|
|
|
3584
4057
|
}).length > 1;
|
|
3585
4058
|
};
|
|
3586
4059
|
/*! js-cookie v3.0.1 | MIT */
|
|
3587
|
-
function
|
|
4060
|
+
function yt(e) {
|
|
3588
4061
|
for (var t = 1; t < arguments.length; t++) {
|
|
3589
4062
|
var r = arguments[t];
|
|
3590
4063
|
for (var n in r) e[n] = r[n];
|
|
3591
4064
|
}
|
|
3592
4065
|
return e;
|
|
3593
4066
|
}
|
|
3594
|
-
var
|
|
4067
|
+
var kt = function e(t, r) {
|
|
3595
4068
|
function n(e, n, i) {
|
|
3596
4069
|
if ("undefined" != typeof document) {
|
|
3597
|
-
"number" == typeof (i =
|
|
4070
|
+
"number" == typeof (i = yt({}, r, i)).expires && (i.expires = new Date(Date.now() + 864e5 * i.expires)), i.expires && (i.expires = i.expires.toUTCString()), e = encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
3598
4071
|
var o = "";
|
|
3599
4072
|
for (var s in i) i[s] && (o += "; " + s, !0 !== i[s] && (o += "=" + i[s].split(";")[0]));
|
|
3600
4073
|
return document.cookie = e + "=" + t.write(n, e) + o;
|
|
@@ -3616,15 +4089,15 @@ var Ue = function e(t, r) {
|
|
|
3616
4089
|
}
|
|
3617
4090
|
},
|
|
3618
4091
|
remove: function remove(e, t) {
|
|
3619
|
-
n(e, "",
|
|
4092
|
+
n(e, "", yt({}, t, {
|
|
3620
4093
|
expires: -1
|
|
3621
4094
|
}));
|
|
3622
4095
|
},
|
|
3623
4096
|
withAttributes: function withAttributes(t) {
|
|
3624
|
-
return e(this.converter,
|
|
4097
|
+
return e(this.converter, yt({}, this.attributes, t));
|
|
3625
4098
|
},
|
|
3626
4099
|
withConverter: function withConverter(t) {
|
|
3627
|
-
return e(
|
|
4100
|
+
return e(yt({}, this.converter, t), this.attributes);
|
|
3628
4101
|
}
|
|
3629
4102
|
}, {
|
|
3630
4103
|
attributes: {
|
|
@@ -3644,26 +4117,26 @@ var Ue = function e(t, r) {
|
|
|
3644
4117
|
}, {
|
|
3645
4118
|
path: "/"
|
|
3646
4119
|
});
|
|
3647
|
-
var
|
|
4120
|
+
var wt = function wt(e) {
|
|
3648
4121
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
3649
4122
|
return "stytch_sdk_state_".concat(e).concat(t ? "::".concat(t) : "");
|
|
3650
4123
|
};
|
|
3651
|
-
var
|
|
3652
|
-
function
|
|
4124
|
+
var St = /*#__PURE__*/function () {
|
|
4125
|
+
function St(e, t) {
|
|
3653
4126
|
var _this4 = this;
|
|
3654
|
-
_classCallCheck(this,
|
|
4127
|
+
_classCallCheck(this, St);
|
|
3655
4128
|
this.browserSessionStorage = {
|
|
3656
4129
|
getItem: function getItem(e) {
|
|
3657
|
-
return sessionStorage.getItem(
|
|
4130
|
+
return sessionStorage.getItem(wt(_this4.publicToken, e));
|
|
3658
4131
|
},
|
|
3659
4132
|
setItem: function setItem(e, t) {
|
|
3660
|
-
return sessionStorage.setItem(
|
|
4133
|
+
return sessionStorage.setItem(wt(_this4.publicToken, e), t);
|
|
3661
4134
|
},
|
|
3662
4135
|
removeItem: function removeItem(e) {
|
|
3663
|
-
return sessionStorage.removeItem(
|
|
4136
|
+
return sessionStorage.removeItem(wt(_this4.publicToken, e));
|
|
3664
4137
|
}
|
|
3665
|
-
}, this.publicToken = e, this.state = null, this.subscriptions = {}, (null == t ? void 0 : t.cookieOptions) ? (
|
|
3666
|
-
var r = localStorage.getItem(
|
|
4138
|
+
}, this.publicToken = e, this.state = null, this.stateKeysUpdated = new Set(), this.subscriptions = {}, (null == t ? void 0 : t.cookieOptions) ? (Be("SubscriptionDataLayer").isOptionalString("cookieOptions.opaqueTokenCookieName", t.cookieOptions.opaqueTokenCookieName).isOptionalString("cookieOptions.jwtCookieName", t.cookieOptions.jwtCookieName).isOptionalString("cookieOptions.istCookieName", t.cookieOptions.istCookieName).isOptionalString("cookieOptions.path", t.cookieOptions.path).isOptionalString("cookieOptions.domain", t.cookieOptions.domain), this._jwtCookieName = t.cookieOptions.jwtCookieName || null, this._opaqueTokenCookieName = t.cookieOptions.opaqueTokenCookieName || null, this._cookiePath = t.cookieOptions.path || null, this._domain = t.cookieOptions.domain || null, this._cookieAvailableToSubdomains = t.cookieOptions.availableToSubdomains || !1, this._istCookieName = t.cookieOptions.istCookieName || null) : (this._opaqueTokenCookieName = null, this._jwtCookieName = null, this._cookiePath = null, this._domain = null, this._cookieAvailableToSubdomains = !1, this._istCookieName = null);
|
|
4139
|
+
var r = localStorage.getItem(wt(this.publicToken));
|
|
3667
4140
|
if (!r) return;
|
|
3668
4141
|
var n;
|
|
3669
4142
|
try {
|
|
@@ -3673,7 +4146,7 @@ var We = /*#__PURE__*/function () {
|
|
|
3673
4146
|
}
|
|
3674
4147
|
this.state = n;
|
|
3675
4148
|
}
|
|
3676
|
-
_createClass(
|
|
4149
|
+
_createClass(St, [{
|
|
3677
4150
|
key: "opaqueTokenCookieName",
|
|
3678
4151
|
get: function get() {
|
|
3679
4152
|
var e;
|
|
@@ -3695,14 +4168,14 @@ var We = /*#__PURE__*/function () {
|
|
|
3695
4168
|
key: "readSessionCookie",
|
|
3696
4169
|
value: function readSessionCookie() {
|
|
3697
4170
|
return {
|
|
3698
|
-
session_token:
|
|
3699
|
-
session_jwt:
|
|
4171
|
+
session_token: kt.get(this.opaqueTokenCookieName),
|
|
4172
|
+
session_jwt: kt.get(this.jwtCookieName)
|
|
3700
4173
|
};
|
|
3701
4174
|
}
|
|
3702
4175
|
}, {
|
|
3703
4176
|
key: "readIntermediateSessionTokenCookie",
|
|
3704
4177
|
value: function readIntermediateSessionTokenCookie() {
|
|
3705
|
-
return
|
|
4178
|
+
return kt.get(this.istCookieName);
|
|
3706
4179
|
}
|
|
3707
4180
|
}, {
|
|
3708
4181
|
key: "writeSessionCookie",
|
|
@@ -3711,32 +4184,32 @@ var We = /*#__PURE__*/function () {
|
|
|
3711
4184
|
var o = e.state,
|
|
3712
4185
|
s = e.session_token,
|
|
3713
4186
|
a = e.session_jwt,
|
|
3714
|
-
c =
|
|
4187
|
+
c = St.generateCookieOpts({
|
|
3715
4188
|
expiresAt: null !== (r = null === (t = null == o ? void 0 : o.session) || void 0 === t ? void 0 : t.expires_at) && void 0 !== r ? r : "",
|
|
3716
4189
|
availableToSubdomains: this._cookieAvailableToSubdomains,
|
|
3717
4190
|
path: this._cookiePath,
|
|
3718
4191
|
domain: this._domain
|
|
3719
4192
|
});
|
|
3720
|
-
|
|
3721
|
-
var u =
|
|
4193
|
+
kt.set(this.opaqueTokenCookieName, s, c), kt.set(this.jwtCookieName, a, c);
|
|
4194
|
+
var u = St.generateCookieOpts({
|
|
3722
4195
|
expiresAt: null !== (i = null === (n = null == o ? void 0 : o.session) || void 0 === n ? void 0 : n.expires_at) && void 0 !== i ? i : "",
|
|
3723
4196
|
availableToSubdomains: !this._cookieAvailableToSubdomains,
|
|
3724
4197
|
path: this._cookiePath,
|
|
3725
4198
|
domain: this._domain
|
|
3726
4199
|
});
|
|
3727
|
-
|
|
4200
|
+
gt(this.jwtCookieName) && kt.remove(this.jwtCookieName, u), gt(this.opaqueTokenCookieName) && kt.remove(this.opaqueTokenCookieName, u), gt(this.jwtCookieName) && Oe("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."), gt(this.opaqueTokenCookieName) && Oe("Could not remove extraneous opaque token cookie.");
|
|
3728
4201
|
}
|
|
3729
4202
|
}, {
|
|
3730
4203
|
key: "writeIntermediateSessionTokenCookie",
|
|
3731
4204
|
value: function writeIntermediateSessionTokenCookie(e) {
|
|
3732
4205
|
var t = new Date(Date.now() + 6e5),
|
|
3733
|
-
r =
|
|
4206
|
+
r = St.generateCookieOpts({
|
|
3734
4207
|
expiresAt: t.toString(),
|
|
3735
4208
|
availableToSubdomains: this._cookieAvailableToSubdomains,
|
|
3736
4209
|
path: this._cookiePath,
|
|
3737
4210
|
domain: this._domain
|
|
3738
4211
|
});
|
|
3739
|
-
|
|
4212
|
+
kt.set(this.istCookieName, e, r);
|
|
3740
4213
|
}
|
|
3741
4214
|
}, {
|
|
3742
4215
|
key: "removeSessionCookie",
|
|
@@ -3755,14 +4228,14 @@ var We = /*#__PURE__*/function () {
|
|
|
3755
4228
|
[!0, !1].forEach(function (t) {
|
|
3756
4229
|
[_this5._cookiePath, null].forEach(function (r) {
|
|
3757
4230
|
[_this5._domain, null].forEach(function (n) {
|
|
3758
|
-
var i =
|
|
4231
|
+
var i = St.generateCookieOpts({
|
|
3759
4232
|
expiresAt: new Date(0).toString(),
|
|
3760
4233
|
availableToSubdomains: t,
|
|
3761
4234
|
path: r,
|
|
3762
4235
|
domain: n
|
|
3763
4236
|
});
|
|
3764
4237
|
e.forEach(function (e) {
|
|
3765
|
-
|
|
4238
|
+
kt.remove(e, i);
|
|
3766
4239
|
});
|
|
3767
4240
|
});
|
|
3768
4241
|
});
|
|
@@ -3771,22 +4244,31 @@ var We = /*#__PURE__*/function () {
|
|
|
3771
4244
|
}, {
|
|
3772
4245
|
key: "syncToLocalStorage",
|
|
3773
4246
|
value: function syncToLocalStorage() {
|
|
3774
|
-
localStorage.setItem(
|
|
4247
|
+
localStorage.setItem(wt(this.publicToken), JSON.stringify(this.state));
|
|
3775
4248
|
}
|
|
3776
4249
|
}, {
|
|
3777
4250
|
key: "getItem",
|
|
3778
4251
|
value: function getItem(e) {
|
|
3779
|
-
return localStorage.getItem(
|
|
4252
|
+
return localStorage.getItem(wt(this.publicToken, e));
|
|
3780
4253
|
}
|
|
3781
4254
|
}, {
|
|
3782
4255
|
key: "setItem",
|
|
3783
4256
|
value: function setItem(e, t) {
|
|
3784
|
-
return localStorage.setItem(
|
|
4257
|
+
return localStorage.setItem(wt(this.publicToken, e), t);
|
|
3785
4258
|
}
|
|
3786
4259
|
}, {
|
|
3787
4260
|
key: "removeItem",
|
|
3788
4261
|
value: function removeItem(e) {
|
|
3789
|
-
return localStorage.removeItem(
|
|
4262
|
+
return localStorage.removeItem(wt(this.publicToken, e));
|
|
4263
|
+
}
|
|
4264
|
+
}, {
|
|
4265
|
+
key: "markStateKeysUpdated",
|
|
4266
|
+
value: function markStateKeysUpdated(e) {
|
|
4267
|
+
var _this6 = this;
|
|
4268
|
+
var t = this.stateKeysUpdated.size;
|
|
4269
|
+
return e.forEach(function (e) {
|
|
4270
|
+
return _this6.stateKeysUpdated.add(e);
|
|
4271
|
+
}), t !== this.stateKeysUpdated.size;
|
|
3790
4272
|
}
|
|
3791
4273
|
}], [{
|
|
3792
4274
|
key: "generateCookieOpts",
|
|
@@ -3802,64 +4284,64 @@ var We = /*#__PURE__*/function () {
|
|
|
3802
4284
|
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;
|
|
3803
4285
|
}
|
|
3804
4286
|
}]);
|
|
3805
|
-
return
|
|
4287
|
+
return St;
|
|
3806
4288
|
}();
|
|
3807
|
-
var
|
|
3808
|
-
_inherits(
|
|
3809
|
-
var _super2 = _createSuper(
|
|
3810
|
-
function
|
|
3811
|
-
_classCallCheck(this,
|
|
4289
|
+
var Pt = /*#__PURE__*/function (_St) {
|
|
4290
|
+
_inherits(Pt, _St);
|
|
4291
|
+
var _super2 = _createSuper(Pt);
|
|
4292
|
+
function Pt() {
|
|
4293
|
+
_classCallCheck(this, Pt);
|
|
3812
4294
|
return _super2.apply(this, arguments);
|
|
3813
4295
|
}
|
|
3814
|
-
return _createClass(
|
|
3815
|
-
}(
|
|
3816
|
-
var
|
|
3817
|
-
|
|
4296
|
+
return _createClass(Pt);
|
|
4297
|
+
}(St);
|
|
4298
|
+
var At = Symbol["for"]("__stytch_b2b_DataLayer"),
|
|
4299
|
+
Et = function Et(e, t) {
|
|
3818
4300
|
var r = function () {
|
|
3819
4301
|
var e = window;
|
|
3820
|
-
return e[
|
|
4302
|
+
return e[At] || (e[At] = {}), e[At];
|
|
3821
4303
|
}();
|
|
3822
|
-
return r[e] || (r[e] = new
|
|
4304
|
+
return r[e] || (r[e] = new Pt(e, t)), r[e];
|
|
3823
4305
|
},
|
|
3824
|
-
|
|
4306
|
+
Ct = function Ct(e, t) {
|
|
3825
4307
|
Object.values(e).forEach(function (e) {
|
|
3826
4308
|
return e(t);
|
|
3827
4309
|
});
|
|
3828
4310
|
},
|
|
3829
|
-
|
|
3830
|
-
var
|
|
3831
|
-
|
|
3832
|
-
return function
|
|
3833
|
-
return
|
|
3834
|
-
return !(e in
|
|
3835
|
-
}) && Object.entries(
|
|
3836
|
-
var
|
|
3837
|
-
return !
|
|
3838
|
-
}).every(function (
|
|
3839
|
-
var
|
|
3840
|
-
i =
|
|
3841
|
-
|
|
3842
|
-
return
|
|
3843
|
-
}) :
|
|
4311
|
+
Tt = function () {
|
|
4312
|
+
var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).KEYS_TO_EXCLUDE,
|
|
4313
|
+
t = void 0 === e ? [] : e;
|
|
4314
|
+
return function e(r, n) {
|
|
4315
|
+
return ee(r) === ee(n) && (null === r || null === n ? r === n : "object" === ee(r) ? Object.keys(r).length === Object.keys(n).length && !Object.keys(r).some(function (e) {
|
|
4316
|
+
return !(e in n);
|
|
4317
|
+
}) && Object.entries(r).filter(function (e) {
|
|
4318
|
+
var r = X(e, 1)[0];
|
|
4319
|
+
return !t.includes(r);
|
|
4320
|
+
}).every(function (t) {
|
|
4321
|
+
var r = X(t, 2),
|
|
4322
|
+
i = r[0],
|
|
4323
|
+
o = r[1];
|
|
4324
|
+
return e(o, n[i]);
|
|
4325
|
+
}) : r === n);
|
|
3844
4326
|
};
|
|
3845
4327
|
}({
|
|
3846
4328
|
KEYS_TO_EXCLUDE: ["last_accessed_at"]
|
|
3847
4329
|
});
|
|
3848
|
-
var
|
|
3849
|
-
function
|
|
3850
|
-
var
|
|
3851
|
-
_classCallCheck(this,
|
|
4330
|
+
var Ot = /*#__PURE__*/function () {
|
|
4331
|
+
function Ot(e, t) {
|
|
4332
|
+
var _this7 = this;
|
|
4333
|
+
_classCallCheck(this, Ot);
|
|
3852
4334
|
this._publicToken = e, this._datalayer = t, this._listen = function (e) {
|
|
3853
|
-
if (e.key !==
|
|
3854
|
-
if (null === e.newValue || "null" === e.newValue) return void
|
|
4335
|
+
if (e.key !== wt(_this7._publicToken)) return;
|
|
4336
|
+
if (null === e.newValue || "null" === e.newValue) return void _this7.destroyState();
|
|
3855
4337
|
var t = JSON.parse(e.newValue);
|
|
3856
|
-
|
|
4338
|
+
_this7.updateState(t);
|
|
3857
4339
|
}, window.addEventListener("storage", this._listen);
|
|
3858
4340
|
var _this$_datalayer$read = this._datalayer.readSessionCookie(),
|
|
3859
4341
|
r = _this$_datalayer$read.session_token;
|
|
3860
4342
|
r || this.destroyState();
|
|
3861
4343
|
}
|
|
3862
|
-
_createClass(
|
|
4344
|
+
_createClass(Ot, [{
|
|
3863
4345
|
key: "getTokens",
|
|
3864
4346
|
value: function getTokens() {
|
|
3865
4347
|
var _this$_datalayer$read2 = this._datalayer.readSessionCookie(),
|
|
@@ -3890,7 +4372,9 @@ var Je = /*#__PURE__*/function () {
|
|
|
3890
4372
|
value: function _updateStateAndTokensInternal(e) {
|
|
3891
4373
|
var t = this._datalayer.state,
|
|
3892
4374
|
r = null === e.state ? null : Object.assign(Object.assign({}, this._datalayer.state), e.state);
|
|
3893
|
-
this._datalayer.state = r
|
|
4375
|
+
this._datalayer.state = r;
|
|
4376
|
+
var n = e.state ? Object.keys(e.state) : [];
|
|
4377
|
+
!this._datalayer.markStateKeysUpdated(n) && Tt(t, r) || Ct(this._datalayer.subscriptions, r);
|
|
3894
4378
|
}
|
|
3895
4379
|
}, {
|
|
3896
4380
|
key: "updateStateAndTokens",
|
|
@@ -3902,7 +4386,11 @@ var Je = /*#__PURE__*/function () {
|
|
|
3902
4386
|
value: function updateState(e) {
|
|
3903
4387
|
var t = this._datalayer.state,
|
|
3904
4388
|
r = null === e ? null : Object.assign(Object.assign({}, this._datalayer.state), e);
|
|
3905
|
-
this._datalayer.state = r
|
|
4389
|
+
this._datalayer.state = r;
|
|
4390
|
+
var n = e ? Object.keys(e) : [],
|
|
4391
|
+
i = this._datalayer.markStateKeysUpdated(n),
|
|
4392
|
+
o = !Tt(t, r);
|
|
4393
|
+
(i || o) && (Ct(this._datalayer.subscriptions, r), o && this._datalayer.syncToLocalStorage());
|
|
3906
4394
|
}
|
|
3907
4395
|
}, {
|
|
3908
4396
|
key: "updateTokens",
|
|
@@ -3942,267 +4430,72 @@ var Je = /*#__PURE__*/function () {
|
|
|
3942
4430
|
return null;
|
|
3943
4431
|
}
|
|
3944
4432
|
}]);
|
|
3945
|
-
return
|
|
4433
|
+
return Ot;
|
|
3946
4434
|
}();
|
|
3947
|
-
var
|
|
3948
|
-
_inherits(
|
|
3949
|
-
var _super3 = _createSuper(
|
|
3950
|
-
function
|
|
3951
|
-
var
|
|
3952
|
-
_classCallCheck(this,
|
|
3953
|
-
|
|
3954
|
-
return
|
|
4435
|
+
var xt = /*#__PURE__*/function (_Ot) {
|
|
4436
|
+
_inherits(xt, _Ot);
|
|
4437
|
+
var _super3 = _createSuper(xt);
|
|
4438
|
+
function xt() {
|
|
4439
|
+
var _this8;
|
|
4440
|
+
_classCallCheck(this, xt);
|
|
4441
|
+
_this8 = _super3.apply(this, arguments), _this8.updateMember = function (e) {
|
|
4442
|
+
return _this8.updateState({
|
|
3955
4443
|
member: e
|
|
3956
4444
|
});
|
|
3957
|
-
},
|
|
4445
|
+
}, _this8.getMember = function () {
|
|
3958
4446
|
var e, t;
|
|
3959
|
-
return null !== (t = null === (e =
|
|
3960
|
-
},
|
|
4447
|
+
return null !== (t = null === (e = _this8.getState()) || void 0 === e ? void 0 : e.member) && void 0 !== t ? t : null;
|
|
4448
|
+
}, _this8.getSession = function () {
|
|
3961
4449
|
var e, t;
|
|
3962
|
-
return null !== (t = null === (e =
|
|
4450
|
+
return null !== (t = null === (e = _this8.getState()) || void 0 === e ? void 0 : e.session) && void 0 !== t ? t : null;
|
|
3963
4451
|
};
|
|
3964
|
-
return
|
|
3965
|
-
}
|
|
3966
|
-
return _createClass($e);
|
|
3967
|
-
}(Je);
|
|
3968
|
-
var Xe = Symbol["for"]("stytch__internal_b2b");
|
|
3969
|
-
function Ze(e) {
|
|
3970
|
-
return Ze = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
|
|
3971
|
-
return _typeof(e);
|
|
3972
|
-
} : function (e) {
|
|
3973
|
-
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
|
|
3974
|
-
}, Ze(e);
|
|
3975
|
-
}
|
|
3976
|
-
function Qe(e, t) {
|
|
3977
|
-
for (var r = 0; r < t.length; r++) {
|
|
3978
|
-
var n = t[r];
|
|
3979
|
-
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) {
|
|
3980
|
-
if ("object" !== Ze(e) || null === e) return e;
|
|
3981
|
-
var r = e[Symbol.toPrimitive];
|
|
3982
|
-
if (void 0 !== r) {
|
|
3983
|
-
var n = r.call(e, t || "default");
|
|
3984
|
-
if ("object" !== Ze(n)) return n;
|
|
3985
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3986
|
-
}
|
|
3987
|
-
return ("string" === t ? String : Number)(e);
|
|
3988
|
-
}(i, "string"), "symbol" === Ze(o) ? o : String(o)), n);
|
|
3989
|
-
}
|
|
3990
|
-
var i, o;
|
|
3991
|
-
}
|
|
3992
|
-
function et(e, t, r) {
|
|
3993
|
-
return t && Qe(e.prototype, t), r && Qe(e, r), Object.defineProperty(e, "prototype", {
|
|
3994
|
-
writable: !1
|
|
3995
|
-
}), e;
|
|
3996
|
-
}
|
|
3997
|
-
function tt(e, t) {
|
|
3998
|
-
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
3999
|
-
}
|
|
4000
|
-
function rt(e, t) {
|
|
4001
|
-
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
4002
|
-
e.prototype = Object.create(t && t.prototype, {
|
|
4003
|
-
constructor: {
|
|
4004
|
-
value: e,
|
|
4005
|
-
writable: !0,
|
|
4006
|
-
configurable: !0
|
|
4007
|
-
}
|
|
4008
|
-
}), Object.defineProperty(e, "prototype", {
|
|
4009
|
-
writable: !1
|
|
4010
|
-
}), t && ct(e, t);
|
|
4011
|
-
}
|
|
4012
|
-
function nt(e) {
|
|
4013
|
-
var t = at();
|
|
4014
|
-
return function () {
|
|
4015
|
-
var r,
|
|
4016
|
-
n = ut(e);
|
|
4017
|
-
if (t) {
|
|
4018
|
-
var i = ut(this).constructor;
|
|
4019
|
-
r = Reflect.construct(n, arguments, i);
|
|
4020
|
-
} else r = n.apply(this, arguments);
|
|
4021
|
-
return function (e, t) {
|
|
4022
|
-
if (t && ("object" === Ze(t) || "function" == typeof t)) return t;
|
|
4023
|
-
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
4024
|
-
return it(e);
|
|
4025
|
-
}(this, r);
|
|
4026
|
-
};
|
|
4027
|
-
}
|
|
4028
|
-
function it(e) {
|
|
4029
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4030
|
-
return e;
|
|
4031
|
-
}
|
|
4032
|
-
function ot(e) {
|
|
4033
|
-
var t = "function" == typeof Map ? new Map() : void 0;
|
|
4034
|
-
return ot = function ot(e) {
|
|
4035
|
-
if (null === e || !function (e) {
|
|
4036
|
-
try {
|
|
4037
|
-
return -1 !== Function.toString.call(e).indexOf("[native code]");
|
|
4038
|
-
} catch (t) {
|
|
4039
|
-
return "function" == typeof e;
|
|
4040
|
-
}
|
|
4041
|
-
}(e)) return e;
|
|
4042
|
-
if ("function" != typeof e) throw new TypeError("Super expression must either be null or a function");
|
|
4043
|
-
if (void 0 !== t) {
|
|
4044
|
-
if (t.has(e)) return t.get(e);
|
|
4045
|
-
t.set(e, r);
|
|
4046
|
-
}
|
|
4047
|
-
function r() {
|
|
4048
|
-
return st(e, arguments, ut(this).constructor);
|
|
4049
|
-
}
|
|
4050
|
-
return r.prototype = Object.create(e.prototype, {
|
|
4051
|
-
constructor: {
|
|
4052
|
-
value: r,
|
|
4053
|
-
enumerable: !1,
|
|
4054
|
-
writable: !0,
|
|
4055
|
-
configurable: !0
|
|
4056
|
-
}
|
|
4057
|
-
}), ct(r, e);
|
|
4058
|
-
}, ot(e);
|
|
4059
|
-
}
|
|
4060
|
-
function st(e, t, r) {
|
|
4061
|
-
return st = at() ? Reflect.construct.bind() : function (e, t, r) {
|
|
4062
|
-
var n = [null];
|
|
4063
|
-
n.push.apply(n, t);
|
|
4064
|
-
var i = new (Function.bind.apply(e, n))();
|
|
4065
|
-
return r && ct(i, r.prototype), i;
|
|
4066
|
-
}, st.apply(null, arguments);
|
|
4067
|
-
}
|
|
4068
|
-
function at() {
|
|
4069
|
-
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
|
|
4070
|
-
if (Reflect.construct.sham) return !1;
|
|
4071
|
-
if ("function" == typeof Proxy) return !0;
|
|
4072
|
-
try {
|
|
4073
|
-
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
|
|
4074
|
-
} catch (e) {
|
|
4075
|
-
return !1;
|
|
4452
|
+
return _this8;
|
|
4076
4453
|
}
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
}, ct(e, t);
|
|
4082
|
-
}
|
|
4083
|
-
function ut(e) {
|
|
4084
|
-
return ut = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
|
|
4085
|
-
return e.__proto__ || Object.getPrototypeOf(e);
|
|
4086
|
-
}, ut(e);
|
|
4087
|
-
}
|
|
4088
|
-
exports.Products = void 0, function (e) {
|
|
4089
|
-
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords", e.passkeys = "passkeys";
|
|
4090
|
-
}(exports.Products || (exports.Products = {})), exports.OAuthProviders = void 0, function (e) {
|
|
4091
|
-
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";
|
|
4092
|
-
}(exports.OAuthProviders || (exports.OAuthProviders = {})), exports.Wallets = void 0, function (e) {
|
|
4093
|
-
e.Vessel = "Vessel", e.Phantom = "Phantom", e.Metamask = "Metamask", e.Coinbase = "Coinbase", e.Binance = "Binance", e.GenericEthereumWallet = "Other Ethereum Wallet", e.GenericSolanaWallet = "Other Solana Wallet";
|
|
4094
|
-
}(exports.Wallets || (exports.Wallets = {})), exports.OneTapPositions = void 0, function (e) {
|
|
4095
|
-
e.embedded = "embedded", e.floating = "floating";
|
|
4096
|
-
}(exports.OneTapPositions || (exports.OneTapPositions = {})), exports.OTPMethods = void 0, function (e) {
|
|
4097
|
-
e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
|
|
4098
|
-
}(exports.OTPMethods || (exports.OTPMethods = {})), exports.StytchEventType = void 0, function (e) {
|
|
4099
|
-
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";
|
|
4100
|
-
}(exports.StytchEventType || (exports.StytchEventType = {}));
|
|
4101
|
-
var lt = function (e) {
|
|
4102
|
-
rt(r, ot(Error));
|
|
4103
|
-
var t = nt(r);
|
|
4104
|
-
function r(e, n) {
|
|
4105
|
-
var i;
|
|
4106
|
-
return tt(this, r), (i = t.call(this, e + "\n" + n)).message = e + "\n" + n, i.name = "SDKAPIUnreachableError", i.details = n, Object.setPrototypeOf(it(i), r.prototype), i;
|
|
4107
|
-
}
|
|
4108
|
-
return et(r);
|
|
4109
|
-
}(),
|
|
4110
|
-
dt = function (e) {
|
|
4111
|
-
rt(r, ot(Error));
|
|
4112
|
-
var t = nt(r);
|
|
4113
|
-
function r(e, n) {
|
|
4114
|
-
var i;
|
|
4115
|
-
return tt(this, r), (i = t.call(this)).name = "StytchSDKUsageError", i.message = "Invalid call to ".concat(e, "\n") + n, i;
|
|
4116
|
-
}
|
|
4117
|
-
return et(r);
|
|
4118
|
-
}(),
|
|
4119
|
-
ht = function (e) {
|
|
4120
|
-
rt(r, ot(Error));
|
|
4121
|
-
var t = nt(r);
|
|
4122
|
-
function r(e) {
|
|
4123
|
-
var n, i;
|
|
4124
|
-
tt(this, r), (n = t.call(this)).name = "StytchSDKSchemaError";
|
|
4125
|
-
var o = null === (i = e.body) || void 0 === i ? void 0 : i.map(function (e) {
|
|
4126
|
-
return "".concat(e.dataPath, ": ").concat(e.message);
|
|
4127
|
-
}).join("\n");
|
|
4128
|
-
return n.message = "[400] Request does not match expected schema\n".concat(o), n;
|
|
4129
|
-
}
|
|
4130
|
-
return et(r);
|
|
4131
|
-
}(),
|
|
4132
|
-
pt = function (e) {
|
|
4133
|
-
rt(r, ot(Error));
|
|
4134
|
-
var t = nt(r);
|
|
4135
|
-
function r(e) {
|
|
4136
|
-
var n;
|
|
4137
|
-
tt(this, r), (n = t.call(this)).name = "StytchSDKAPIError";
|
|
4138
|
-
var i = e.status_code,
|
|
4139
|
-
o = e.error_type,
|
|
4140
|
-
s = e.error_message,
|
|
4141
|
-
a = e.error_url,
|
|
4142
|
-
c = e.request_id;
|
|
4143
|
-
return n.error_type = o, n.error_message = s, n.error_url = a, n.request_id = c, n.status_code = i, n.message = "[".concat(i, "] ").concat(o, "\n") + "".concat(s, "\n") + "See ".concat(a, " for more information.\n") + (c ? "request_id: ".concat(c, "\n") : ""), n;
|
|
4144
|
-
}
|
|
4145
|
-
return et(r);
|
|
4146
|
-
}(),
|
|
4147
|
-
_t = function (e) {
|
|
4148
|
-
rt(r, ot(Error));
|
|
4149
|
-
var t = nt(r);
|
|
4150
|
-
function r(e) {
|
|
4151
|
-
var n;
|
|
4152
|
-
return tt(this, r), (n = t.call(this)).name = "StytchSDKNativeError", n.error_type = e, n.message = "".concat(e), n;
|
|
4153
|
-
}
|
|
4154
|
-
return et(r);
|
|
4155
|
-
}();
|
|
4156
|
-
exports.BiometricsErrors = void 0, function (e) {
|
|
4157
|
-
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";
|
|
4158
|
-
}(exports.BiometricsErrors || (exports.BiometricsErrors = {})), exports.B2BProducts = void 0, function (e) {
|
|
4159
|
-
e.emailMagicLinks = "emailMagicLinks", e.sso = "sso", e.passwords = "passwords", e.oauth = "oauth";
|
|
4160
|
-
}(exports.B2BProducts || (exports.B2BProducts = {})), exports.AuthFlowType = void 0, function (e) {
|
|
4161
|
-
e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
|
|
4162
|
-
}(exports.AuthFlowType || (exports.AuthFlowType = {})), exports.B2BOAuthProviders = void 0, function (e) {
|
|
4163
|
-
e.Google = "google", e.Microsoft = "microsoft";
|
|
4164
|
-
}(exports.B2BOAuthProviders || (exports.B2BOAuthProviders = {})), exports.SDKAPIUnreachableError = lt, exports.StytchB2BHeadlessClient = /*#__PURE__*/function () {
|
|
4454
|
+
return _createClass(xt);
|
|
4455
|
+
}(Ot);
|
|
4456
|
+
var Dt = Symbol["for"]("stytch__internal_b2b");
|
|
4457
|
+
exports.BiometricsFailedError = z, exports.BiometricsUnavailableError = A, exports.ChallengeSigningFailedError = F, exports.DeviceCredentialsNotAllowedError = D, exports.FailedCodeChallengeError = N, exports.FailedToDecryptDataError = U, exports.InternalError = S, exports.InvalidAuthorizationCredentialError = L, exports.InvalidCredentialTypeError = H, exports.InvalidRedirectSchemeError = W, exports.InvalidStartUrlError = q, exports.JSONDataNotConvertibleToStringError = V, exports.KeyInvalidatedError = E, exports.KeystoreUnavailableError = C, 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 = K, exports.RandomNumberGenerationFailed = J, exports.SDKAPIUnreachableError = h, exports.SDKNotConfiguredError = j, exports.StytchAPIError = y, exports.StytchAPISchemaError = g, exports.StytchAPIUnreachableError = b, exports.StytchB2BHeadlessClient = /*#__PURE__*/function () {
|
|
4165
4458
|
function _class(e, t) {
|
|
4166
|
-
var
|
|
4459
|
+
var _this9 = this;
|
|
4167
4460
|
_classCallCheck(this, _class);
|
|
4168
4461
|
var r;
|
|
4169
4462
|
!function (e) {
|
|
4170
4463
|
if ("undefined" == typeof window) throw new Error("The ".concat(e, " is not compatible with server-side environments.\nIf using nextjs, use the create").concat(e, " method instead.\n```\n").concat("import { createStytchB2BHeadlessClient } from '@stytch/nextjs/b2b';\n \n const stytch = createStytchB2BHeadlessClient('public-token-...');\n ", "\n```\n"));
|
|
4171
|
-
}("StytchB2BHeadlessClient"), "string" != typeof (r = e) ?
|
|
4172
|
-
var
|
|
4173
|
-
|
|
4174
|
-
cookieOptions: null == (
|
|
4464
|
+
}("StytchB2BHeadlessClient"), "string" != typeof (r = e) ? Oe("Public token is malformed. Expected a string, got ".concat(ee(r), ".").concat(De)) : "" === r ? Oe('Public token is malformed. Expected "public-token-...", got an empty string.'.concat(De)) : r.startsWith("public-token-") || Oe('Public token is malformed. Expected "public-token-...", got '.concat(r, ".").concat(De));
|
|
4465
|
+
var n = t,
|
|
4466
|
+
i = {
|
|
4467
|
+
cookieOptions: null == (o = n) ? void 0 : o.cookieOptions,
|
|
4175
4468
|
endpoints: {
|
|
4176
|
-
sdkBackendURL: null !== (
|
|
4177
|
-
testAPIURL: null !== (
|
|
4178
|
-
liveAPIURL: null !== (
|
|
4179
|
-
dfpBackendURL: null !== (
|
|
4180
|
-
clientsideServicesIframeURL: null !== (
|
|
4469
|
+
sdkBackendURL: null !== (a = null === (s = null == o ? void 0 : o.endpoints) || void 0 === s ? void 0 : s.sdkBackendURL) && void 0 !== a ? a : "https://web.stytch.com",
|
|
4470
|
+
testAPIURL: null !== (u = null === (c = null == o ? void 0 : o.endpoints) || void 0 === c ? void 0 : c.testAPIURL) && void 0 !== u ? u : "https://test.stytch.com",
|
|
4471
|
+
liveAPIURL: null !== (d = null === (l = null == o ? void 0 : o.endpoints) || void 0 === l ? void 0 : l.liveAPIURL) && void 0 !== d ? d : "https://api.stytch.com",
|
|
4472
|
+
dfpBackendURL: null !== (p = null === (h = null == o ? void 0 : o.endpoints) || void 0 === h ? void 0 : h.dfpBackendURL) && void 0 !== p ? p : "https://telemetry.stytch.com",
|
|
4473
|
+
clientsideServicesIframeURL: null !== (f = null === (_ = null == o ? void 0 : o.endpoints) || void 0 === _ ? void 0 : _.clientsideServicesIframeURL) && void 0 !== f ? f : "https://js.stytch.com/clientside-services/index.html"
|
|
4181
4474
|
}
|
|
4182
4475
|
};
|
|
4183
|
-
var s, a, c, u, l, d, h, p, _, f
|
|
4184
|
-
this._dataLayer =
|
|
4185
|
-
var
|
|
4186
|
-
this._networkClient = new
|
|
4476
|
+
var o, s, a, c, u, l, d, h, p, _, f;
|
|
4477
|
+
this._dataLayer = Et(e, n), this._subscriptionService = new xt(e, this._dataLayer);
|
|
4478
|
+
var m = new vt(this._dataLayer, "passwords");
|
|
4479
|
+
this._networkClient = new ft(e, this._dataLayer, i.endpoints.sdkBackendURL, function () {
|
|
4187
4480
|
var e, t, r, n;
|
|
4188
4481
|
return {
|
|
4189
|
-
stytch_member_id: null === (t = null === (e =
|
|
4190
|
-
stytch_member_session_id: null === (n = null === (r =
|
|
4482
|
+
stytch_member_id: null === (t = null === (e = _this9._dataLayer.state) || void 0 === e ? void 0 : e.member) || void 0 === t ? void 0 : t.member_id,
|
|
4483
|
+
stytch_member_session_id: null === (n = null === (r = _this9._dataLayer.state) || void 0 === r ? void 0 : r.session) || void 0 === n ? void 0 : n.member_session_id
|
|
4191
4484
|
};
|
|
4192
4485
|
});
|
|
4193
|
-
var
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
this.organization = new
|
|
4486
|
+
var v = new pt(e, this._networkClient, this._dataLayer),
|
|
4487
|
+
b = new _t(v.getAsync()),
|
|
4488
|
+
g = new Re(e, i.endpoints.dfpBackendURL, v.getAsync(), b.executeRecaptcha);
|
|
4489
|
+
this.organization = new Ue(this._networkClient, this._subscriptionService), this.member = new Ne(this._networkClient, this._subscriptionService), this.self = new Ne(this._networkClient, this._subscriptionService), this.session = new qe(this._networkClient, this._subscriptionService), this.magicLinks = new je(this._networkClient, this._subscriptionService, new vt(this._dataLayer, "magic_links"), m, v.getAsync(), g), this.oauth = new ze(this._networkClient, this._subscriptionService, new vt(this._dataLayer, "oauth"), v.getAsync(), {
|
|
4197
4490
|
publicToken: e,
|
|
4198
|
-
testAPIURL:
|
|
4199
|
-
liveAPIURL:
|
|
4200
|
-
},
|
|
4491
|
+
testAPIURL: i.endpoints.testAPIURL,
|
|
4492
|
+
liveAPIURL: i.endpoints.liveAPIURL
|
|
4493
|
+
}, g), this.sso = new Ke(this._networkClient, this._subscriptionService, new vt(this._dataLayer, "sso"), v.getAsync(), {
|
|
4201
4494
|
publicToken: e,
|
|
4202
|
-
testAPIURL:
|
|
4203
|
-
liveAPIURL:
|
|
4204
|
-
}), this.discovery = new
|
|
4205
|
-
var
|
|
4495
|
+
testAPIURL: i.endpoints.testAPIURL,
|
|
4496
|
+
liveAPIURL: i.endpoints.liveAPIURL
|
|
4497
|
+
}), this.discovery = new We(this._networkClient, this._subscriptionService), this.passwords = new dt(this._networkClient, this._subscriptionService, m, v.getAsync(), g), this.otps = new Ge(this._networkClient, this._subscriptionService, g), this.totp = new He(this._networkClient, this._subscriptionService, g), this.rbac = new Ye(v.getSync(), v.getAsync(), this._subscriptionService), this._sessionManager = new Ve(this._subscriptionService, this.session);
|
|
4498
|
+
var y = new bt(this._networkClient);
|
|
4206
4499
|
this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
|
|
4207
4500
|
name: "b2b_sdk_instance_instantiated",
|
|
4208
4501
|
details: {
|
|
@@ -4212,14 +4505,81 @@ exports.BiometricsErrors = void 0, function (e) {
|
|
|
4212
4505
|
}
|
|
4213
4506
|
});
|
|
4214
4507
|
(function (e, t) {
|
|
4215
|
-
Object.assign(e, _defineProperty({},
|
|
4508
|
+
Object.assign(e, _defineProperty({}, Dt, t));
|
|
4216
4509
|
})(this, {
|
|
4217
|
-
bootstrap:
|
|
4510
|
+
bootstrap: v,
|
|
4218
4511
|
publicToken: e,
|
|
4219
|
-
searchManager:
|
|
4512
|
+
searchManager: y,
|
|
4220
4513
|
dataLayer: this._dataLayer,
|
|
4221
4514
|
networkClient: this._networkClient
|
|
4222
4515
|
});
|
|
4223
4516
|
}
|
|
4224
4517
|
return _createClass(_class);
|
|
4225
|
-
}(), exports.StytchSDKAPIError =
|
|
4518
|
+
}(), exports.StytchError = v, exports.StytchSDKAPIError = f, exports.StytchSDKError = k, exports.StytchSDKSchemaError = _, exports.StytchSDKUsageError = p, exports.UNRECOVERABLE_ERROR_TYPES = m, exports.UserCancellationError = O, exports.UserLockedOutError = x, exports.errorToStytchError = function (e) {
|
|
4519
|
+
switch (e.message) {
|
|
4520
|
+
case "internal_error":
|
|
4521
|
+
return new S(e.message);
|
|
4522
|
+
case "no_current_session":
|
|
4523
|
+
return new w();
|
|
4524
|
+
case "no_biometrics_registration":
|
|
4525
|
+
case "no_biometrics_registration":
|
|
4526
|
+
return new P();
|
|
4527
|
+
case "biometrics_unavailable":
|
|
4528
|
+
case "device_hardware_error":
|
|
4529
|
+
case "biometrics_not_available":
|
|
4530
|
+
return new A();
|
|
4531
|
+
case "key_invalidated":
|
|
4532
|
+
case "no_biometric_key":
|
|
4533
|
+
return new E();
|
|
4534
|
+
case "no_biometrics_enrolled":
|
|
4535
|
+
return new T();
|
|
4536
|
+
case "keystore_unavailable":
|
|
4537
|
+
return new C();
|
|
4538
|
+
case "device_credentials_not_allowed":
|
|
4539
|
+
return new D();
|
|
4540
|
+
case "user_cancellation":
|
|
4541
|
+
return new O();
|
|
4542
|
+
case "user_locked_out":
|
|
4543
|
+
return new x();
|
|
4544
|
+
case "google_onetap_missing_id_token":
|
|
4545
|
+
case "oauth_apple_missing_id_token":
|
|
4546
|
+
case "missing_authorization_credential_id_token":
|
|
4547
|
+
return new R();
|
|
4548
|
+
case "google_onetap_missing_member":
|
|
4549
|
+
case "oauth_apple_credential_invalid":
|
|
4550
|
+
case "invalid_authorization_credential":
|
|
4551
|
+
return new L();
|
|
4552
|
+
case "missing_public_key":
|
|
4553
|
+
return new M();
|
|
4554
|
+
case "challenge_signing_failed":
|
|
4555
|
+
return new F();
|
|
4556
|
+
case "sdk_not_configured":
|
|
4557
|
+
return new j();
|
|
4558
|
+
case "failed_code_challenge":
|
|
4559
|
+
return new N();
|
|
4560
|
+
case "passkeys_unsupported":
|
|
4561
|
+
return new K();
|
|
4562
|
+
case "failed_to_decrypt_data":
|
|
4563
|
+
return new U();
|
|
4564
|
+
case "biometrics_failed":
|
|
4565
|
+
return new z();
|
|
4566
|
+
case "invalid_start_url":
|
|
4567
|
+
return new q();
|
|
4568
|
+
case "invalid_redirect_scheme":
|
|
4569
|
+
return new W();
|
|
4570
|
+
case "missing_url":
|
|
4571
|
+
return new G();
|
|
4572
|
+
case "invalid_credential_type":
|
|
4573
|
+
return new H();
|
|
4574
|
+
case "missing_attestation_object":
|
|
4575
|
+
return new Y();
|
|
4576
|
+
case "json_data_not_convertible_to_string":
|
|
4577
|
+
return new V();
|
|
4578
|
+
case "random_number_generation_failed":
|
|
4579
|
+
return new J();
|
|
4580
|
+
case "passkeys_invalid_encoding":
|
|
4581
|
+
return new $();
|
|
4582
|
+
default:
|
|
4583
|
+
return new k(e.name, e.message);
|
|
4584
|
+
}
|
|
4585
|
+
};
|