@sesamy/sesamy-js 1.8.0 → 1.9.0
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/README.md +3 -0
- package/dist/sesamy-js.cjs +5 -5
- package/dist/sesamy-js.d.ts +11 -2
- package/dist/sesamy-js.iife.js +5 -5
- package/dist/sesamy-js.mjs +899 -892
- package/package.json +1 -1
package/dist/sesamy-js.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var B = (t, e, n) => (
|
|
4
|
-
function
|
|
1
|
+
var xr = Object.defineProperty;
|
|
2
|
+
var Ar = (t, e, n) => e in t ? xr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var B = (t, e, n) => (Ar(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
function ue(t, e) {
|
|
5
5
|
const n = new CustomEvent(t, {
|
|
6
6
|
detail: e,
|
|
7
7
|
bubbles: !0,
|
|
@@ -9,7 +9,7 @@ function ge(t, e) {
|
|
|
9
9
|
});
|
|
10
10
|
dispatchEvent(n);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function te(t, e) {
|
|
13
13
|
var n = {};
|
|
14
14
|
for (var r in t)
|
|
15
15
|
Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
|
|
@@ -20,14 +20,14 @@ function Q(t, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return n;
|
|
22
22
|
}
|
|
23
|
-
var
|
|
23
|
+
var he = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
24
24
|
function xt(t) {
|
|
25
25
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
26
26
|
}
|
|
27
27
|
function At(t, e) {
|
|
28
28
|
return t(e = { exports: {} }, e.exports), e.exports;
|
|
29
29
|
}
|
|
30
|
-
var
|
|
30
|
+
var de = At(function(t, e) {
|
|
31
31
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
32
32
|
var n = function() {
|
|
33
33
|
function r() {
|
|
@@ -58,41 +58,41 @@ var ue = At(function(t, e) {
|
|
|
58
58
|
return n.getInstance();
|
|
59
59
|
};
|
|
60
60
|
});
|
|
61
|
-
xt(
|
|
62
|
-
var
|
|
63
|
-
var n =
|
|
64
|
-
return new (f || (f = Promise))(function(w,
|
|
61
|
+
xt(de);
|
|
62
|
+
var $r = xt(At(function(t, e) {
|
|
63
|
+
var n = he && he.__awaiter || function(u, c, f, d) {
|
|
64
|
+
return new (f || (f = Promise))(function(w, k) {
|
|
65
65
|
function v(g) {
|
|
66
66
|
try {
|
|
67
|
-
|
|
67
|
+
_(d.next(g));
|
|
68
68
|
} catch (l) {
|
|
69
|
-
|
|
69
|
+
k(l);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
function E(g) {
|
|
73
73
|
try {
|
|
74
|
-
|
|
74
|
+
_(d.throw(g));
|
|
75
75
|
} catch (l) {
|
|
76
|
-
|
|
76
|
+
k(l);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function _(g) {
|
|
80
80
|
g.done ? w(g.value) : new f(function(l) {
|
|
81
81
|
l(g.value);
|
|
82
82
|
}).then(v, E);
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
_((d = d.apply(u, c || [])).next());
|
|
85
85
|
});
|
|
86
|
-
}, r =
|
|
87
|
-
var f, d, w,
|
|
86
|
+
}, r = he && he.__generator || function(u, c) {
|
|
87
|
+
var f, d, w, k, v = { label: 0, sent: function() {
|
|
88
88
|
if (1 & w[0])
|
|
89
89
|
throw w[1];
|
|
90
90
|
return w[1];
|
|
91
91
|
}, trys: [], ops: [] };
|
|
92
|
-
return
|
|
92
|
+
return k = { next: E(0), throw: E(1), return: E(2) }, typeof Symbol == "function" && (k[Symbol.iterator] = function() {
|
|
93
93
|
return this;
|
|
94
|
-
}),
|
|
95
|
-
function E(
|
|
94
|
+
}), k;
|
|
95
|
+
function E(_) {
|
|
96
96
|
return function(g) {
|
|
97
97
|
return function(l) {
|
|
98
98
|
if (f)
|
|
@@ -143,10 +143,10 @@ var Ar = xt(At(function(t, e) {
|
|
|
143
143
|
if (5 & l[0])
|
|
144
144
|
throw l[1];
|
|
145
145
|
return { value: l[0] ? l[1] : void 0, done: !0 };
|
|
146
|
-
}([
|
|
146
|
+
}([_, g]);
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
}, i =
|
|
149
|
+
}, i = he;
|
|
150
150
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
151
151
|
var o = "browser-tabs-lock-key", a = { key: function(u) {
|
|
152
152
|
return n(i, void 0, void 0, function() {
|
|
@@ -205,19 +205,19 @@ var Ar = xt(At(function(t, e) {
|
|
|
205
205
|
}
|
|
206
206
|
return u.prototype.acquireLock = function(c, f) {
|
|
207
207
|
return f === void 0 && (f = 5e3), n(this, void 0, void 0, function() {
|
|
208
|
-
var d, w,
|
|
208
|
+
var d, w, k, v, E, _, g;
|
|
209
209
|
return r(this, function(l) {
|
|
210
210
|
switch (l.label) {
|
|
211
211
|
case 0:
|
|
212
|
-
d = Date.now() + h(4), w = Date.now() + f,
|
|
212
|
+
d = Date.now() + h(4), w = Date.now() + f, k = o + "-" + c, v = this.storageHandler === void 0 ? a : this.storageHandler, l.label = 1;
|
|
213
213
|
case 1:
|
|
214
214
|
return Date.now() < w ? [4, s(30)] : [3, 8];
|
|
215
215
|
case 2:
|
|
216
|
-
return l.sent(), v.getItemSync(
|
|
216
|
+
return l.sent(), v.getItemSync(k) !== null ? [3, 5] : (E = this.id + "-" + c + "-" + d, [4, s(Math.floor(25 * Math.random()))]);
|
|
217
217
|
case 3:
|
|
218
|
-
return l.sent(), v.setItemSync(
|
|
218
|
+
return l.sent(), v.setItemSync(k, JSON.stringify({ id: this.id, iat: d, timeoutKey: E, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, s(30)];
|
|
219
219
|
case 4:
|
|
220
|
-
return l.sent(), (
|
|
220
|
+
return l.sent(), (_ = v.getItemSync(k)) !== null && (g = JSON.parse(_)).id === this.id && g.iat === d ? (this.acquiredIatSet.add(d), this.refreshLockWhileAcquired(k, d), [2, !0]) : [3, 7];
|
|
221
221
|
case 5:
|
|
222
222
|
return u.lockCorrector(this.storageHandler === void 0 ? a : this.storageHandler), [4, this.waitForSomethingToChange(w)];
|
|
223
223
|
case 6:
|
|
@@ -235,13 +235,13 @@ var Ar = xt(At(function(t, e) {
|
|
|
235
235
|
return r(this, function(w) {
|
|
236
236
|
return setTimeout(function() {
|
|
237
237
|
return n(d, void 0, void 0, function() {
|
|
238
|
-
var
|
|
239
|
-
return r(this, function(
|
|
240
|
-
switch (
|
|
238
|
+
var k, v, E;
|
|
239
|
+
return r(this, function(_) {
|
|
240
|
+
switch (_.label) {
|
|
241
241
|
case 0:
|
|
242
|
-
return [4,
|
|
242
|
+
return [4, de.default().lock(f)];
|
|
243
243
|
case 1:
|
|
244
|
-
return
|
|
244
|
+
return _.sent(), this.acquiredIatSet.has(f) ? (k = this.storageHandler === void 0 ? a : this.storageHandler, (v = k.getItemSync(c)) === null ? (de.default().unlock(f), [2]) : ((E = JSON.parse(v)).timeRefreshed = Date.now(), k.setItemSync(c, JSON.stringify(E)), de.default().unlock(f), this.refreshLockWhileAcquired(c, f), [2])) : (de.default().unlock(f), [2]);
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
247
|
});
|
|
@@ -254,16 +254,16 @@ var Ar = xt(At(function(t, e) {
|
|
|
254
254
|
switch (f.label) {
|
|
255
255
|
case 0:
|
|
256
256
|
return [4, new Promise(function(d) {
|
|
257
|
-
var w = !1,
|
|
257
|
+
var w = !1, k = Date.now(), v = !1;
|
|
258
258
|
function E() {
|
|
259
|
-
if (v || (window.removeEventListener("storage", E), u.removeFromWaiting(E), clearTimeout(
|
|
259
|
+
if (v || (window.removeEventListener("storage", E), u.removeFromWaiting(E), clearTimeout(_), v = !0), !w) {
|
|
260
260
|
w = !0;
|
|
261
|
-
var g = 50 - (Date.now() -
|
|
261
|
+
var g = 50 - (Date.now() - k);
|
|
262
262
|
g > 0 ? setTimeout(d, g) : d(null);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
window.addEventListener("storage", E), u.addToWaiting(E);
|
|
266
|
-
var
|
|
266
|
+
var _ = setTimeout(E, Math.max(0, c - Date.now()));
|
|
267
267
|
})];
|
|
268
268
|
case 1:
|
|
269
269
|
return f.sent(), [2];
|
|
@@ -293,27 +293,27 @@ var Ar = xt(At(function(t, e) {
|
|
|
293
293
|
});
|
|
294
294
|
}, u.prototype.releaseLock__private__ = function(c) {
|
|
295
295
|
return n(this, void 0, void 0, function() {
|
|
296
|
-
var f, d, w,
|
|
296
|
+
var f, d, w, k;
|
|
297
297
|
return r(this, function(v) {
|
|
298
298
|
switch (v.label) {
|
|
299
299
|
case 0:
|
|
300
|
-
return f = this.storageHandler === void 0 ? a : this.storageHandler, d = o + "-" + c, (w = f.getItemSync(d)) === null ? [2] : (
|
|
300
|
+
return f = this.storageHandler === void 0 ? a : this.storageHandler, d = o + "-" + c, (w = f.getItemSync(d)) === null ? [2] : (k = JSON.parse(w)).id !== this.id ? [3, 2] : [4, de.default().lock(k.iat)];
|
|
301
301
|
case 1:
|
|
302
|
-
v.sent(), this.acquiredIatSet.delete(
|
|
302
|
+
v.sent(), this.acquiredIatSet.delete(k.iat), f.removeItemSync(d), de.default().unlock(k.iat), u.notifyWaiters(), v.label = 2;
|
|
303
303
|
case 2:
|
|
304
304
|
return [2];
|
|
305
305
|
}
|
|
306
306
|
});
|
|
307
307
|
});
|
|
308
308
|
}, u.lockCorrector = function(c) {
|
|
309
|
-
for (var f = Date.now() - 5e3, d = c, w = [],
|
|
310
|
-
var v = d.keySync(
|
|
309
|
+
for (var f = Date.now() - 5e3, d = c, w = [], k = 0; ; ) {
|
|
310
|
+
var v = d.keySync(k);
|
|
311
311
|
if (v === null)
|
|
312
312
|
break;
|
|
313
|
-
w.push(v),
|
|
313
|
+
w.push(v), k++;
|
|
314
314
|
}
|
|
315
|
-
for (var E = !1,
|
|
316
|
-
var g = w[
|
|
315
|
+
for (var E = !1, _ = 0; _ < w.length; _++) {
|
|
316
|
+
var g = w[_];
|
|
317
317
|
if (g.includes(o)) {
|
|
318
318
|
var l = d.getItemSync(g);
|
|
319
319
|
if (l !== null) {
|
|
@@ -327,37 +327,37 @@ var Ar = xt(At(function(t, e) {
|
|
|
327
327
|
}();
|
|
328
328
|
e.default = p;
|
|
329
329
|
}));
|
|
330
|
-
const
|
|
331
|
-
let
|
|
330
|
+
const Nr = { timeoutInSeconds: 60 }, Dn = { name: "auth0-spa-js", version: "2.1.3" }, Un = () => Date.now();
|
|
331
|
+
let G = class kt extends Error {
|
|
332
332
|
constructor(e, n) {
|
|
333
333
|
super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this, kt.prototype);
|
|
334
334
|
}
|
|
335
335
|
static fromPayload({ error: e, error_description: n }) {
|
|
336
336
|
return new kt(e, n);
|
|
337
337
|
}
|
|
338
|
-
},
|
|
338
|
+
}, zr = class Rn extends G {
|
|
339
339
|
constructor(e, n, r, i = null) {
|
|
340
340
|
super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, Rn.prototype);
|
|
341
341
|
}
|
|
342
|
-
}, It = class Ln extends
|
|
342
|
+
}, It = class Ln extends G {
|
|
343
343
|
constructor() {
|
|
344
344
|
super("timeout", "Timeout"), Object.setPrototypeOf(this, Ln.prototype);
|
|
345
345
|
}
|
|
346
|
-
},
|
|
346
|
+
}, Dr = class Mn extends It {
|
|
347
347
|
constructor(e) {
|
|
348
348
|
super(), this.popup = e, Object.setPrototypeOf(this, Mn.prototype);
|
|
349
349
|
}
|
|
350
|
-
},
|
|
350
|
+
}, Ur = class Zn extends G {
|
|
351
351
|
constructor(e) {
|
|
352
352
|
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, Zn.prototype);
|
|
353
353
|
}
|
|
354
|
-
},
|
|
354
|
+
}, Rr = class Kn extends G {
|
|
355
355
|
constructor(e, n, r) {
|
|
356
|
-
super(e, n), this.mfa_token = r, Object.setPrototypeOf(this,
|
|
356
|
+
super(e, n), this.mfa_token = r, Object.setPrototypeOf(this, Kn.prototype);
|
|
357
357
|
}
|
|
358
|
-
},
|
|
358
|
+
}, Wn = class Hn extends G {
|
|
359
359
|
constructor(e, n) {
|
|
360
|
-
super("missing_refresh_token", `Missing Refresh Token (audience: '${Ht(e, ["default"])}', scope: '${Ht(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this,
|
|
360
|
+
super("missing_refresh_token", `Missing Refresh Token (audience: '${Ht(e, ["default"])}', scope: '${Ht(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, Hn.prototype);
|
|
361
361
|
}
|
|
362
362
|
};
|
|
363
363
|
function Ht(t, e = []) {
|
|
@@ -367,23 +367,23 @@ const Qe = () => window.crypto, dt = () => {
|
|
|
367
367
|
const t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";
|
|
368
368
|
let e = "";
|
|
369
369
|
return Array.from(Qe().getRandomValues(new Uint8Array(43))).forEach((n) => e += t[n % t.length]), e;
|
|
370
|
-
},
|
|
371
|
-
var { clientId: e } = t, n =
|
|
370
|
+
}, Ft = (t) => btoa(t), St = (t) => {
|
|
371
|
+
var { clientId: e } = t, n = te(t, ["clientId"]);
|
|
372
372
|
return new URLSearchParams(((r) => Object.keys(r).filter((i) => r[i] !== void 0).reduce((i, o) => Object.assign(Object.assign({}, i), { [o]: r[o] }), {}))(Object.assign({ client_id: e }, n))).toString();
|
|
373
|
-
},
|
|
373
|
+
}, Jt = (t) => ((e) => decodeURIComponent(atob(e).split("").map((n) => "%" + ("00" + n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g, "/").replace(/-/g, "+")), Lr = async (t, e) => {
|
|
374
374
|
const n = await fetch(t, e);
|
|
375
375
|
return { ok: n.ok, json: await n.json() };
|
|
376
|
-
},
|
|
376
|
+
}, Mr = async (t, e, n) => {
|
|
377
377
|
const r = new AbortController();
|
|
378
378
|
let i;
|
|
379
|
-
return e.signal = r.signal, Promise.race([
|
|
379
|
+
return e.signal = r.signal, Promise.race([Lr(t, e), new Promise((o, a) => {
|
|
380
380
|
i = setTimeout(() => {
|
|
381
381
|
r.abort(), a(new Error("Timeout when executing 'fetch'"));
|
|
382
382
|
}, n);
|
|
383
383
|
})]).finally(() => {
|
|
384
384
|
clearTimeout(i);
|
|
385
385
|
});
|
|
386
|
-
},
|
|
386
|
+
}, Zr = async (t, e, n, r, i, o, a) => {
|
|
387
387
|
return s = { auth: { audience: e, scope: n }, timeout: i, fetchUrl: t, fetchOptions: r, useFormData: a }, h = o, new Promise(function(p, u) {
|
|
388
388
|
const c = new MessageChannel();
|
|
389
389
|
c.port1.onmessage = function(f) {
|
|
@@ -391,34 +391,34 @@ const Qe = () => window.crypto, dt = () => {
|
|
|
391
391
|
}, h.postMessage(s, [c.port2]);
|
|
392
392
|
});
|
|
393
393
|
var s, h;
|
|
394
|
-
},
|
|
394
|
+
}, Kr = async (t, e, n, r, i, o, a = 1e4) => i ? Zr(t, e, n, r, a, i, o) : Mr(t, r, a);
|
|
395
395
|
async function Wr(t, e) {
|
|
396
|
-
var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, h =
|
|
396
|
+
var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, h = te(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
|
|
397
397
|
const p = s ? St(h) : JSON.stringify(h);
|
|
398
|
-
return await async function(u, c, f, d, w,
|
|
399
|
-
let E,
|
|
400
|
-
for (let
|
|
398
|
+
return await async function(u, c, f, d, w, k, v) {
|
|
399
|
+
let E, _ = null;
|
|
400
|
+
for (let x = 0; x < 3; x++)
|
|
401
401
|
try {
|
|
402
|
-
E = await
|
|
402
|
+
E = await Kr(u, f, d, w, k, v, c), _ = null;
|
|
403
403
|
break;
|
|
404
|
-
} catch (
|
|
405
|
-
|
|
404
|
+
} catch (R) {
|
|
405
|
+
_ = R;
|
|
406
406
|
}
|
|
407
|
-
if (
|
|
408
|
-
throw
|
|
409
|
-
const g = E.json, { error: l, error_description: b } = g,
|
|
410
|
-
if (!
|
|
411
|
-
const
|
|
412
|
-
throw l === "mfa_required" ? new
|
|
407
|
+
if (_)
|
|
408
|
+
throw _;
|
|
409
|
+
const g = E.json, { error: l, error_description: b } = g, T = te(g, ["error", "error_description"]), { ok: O } = E;
|
|
410
|
+
if (!O) {
|
|
411
|
+
const x = b || `HTTP error. Unable to fetch ${u}`;
|
|
412
|
+
throw l === "mfa_required" ? new Rr(l, x, T.mfa_token) : l === "missing_refresh_token" ? new Wn(f, d) : new G(l || "request_error", x);
|
|
413
413
|
}
|
|
414
|
-
return
|
|
414
|
+
return T;
|
|
415
415
|
}(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: p, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a || Dn)) } }, e, s);
|
|
416
416
|
}
|
|
417
|
-
const
|
|
417
|
+
const Fe = (...t) => {
|
|
418
418
|
return (e = t.filter(Boolean).join(" ").trim().split(/\s+/), Array.from(new Set(e))).join(" ");
|
|
419
419
|
var e;
|
|
420
420
|
};
|
|
421
|
-
let
|
|
421
|
+
let pe = class _t {
|
|
422
422
|
constructor(e, n = "@@auth0spajs@@", r) {
|
|
423
423
|
this.prefix = n, this.suffix = r, this.clientId = e.clientId, this.scope = e.scope, this.audience = e.audience;
|
|
424
424
|
}
|
|
@@ -433,7 +433,7 @@ let he = class _t {
|
|
|
433
433
|
const { scope: n, audience: r, client_id: i } = e;
|
|
434
434
|
return new _t({ scope: n, audience: r, clientId: i });
|
|
435
435
|
}
|
|
436
|
-
},
|
|
436
|
+
}, Hr = class {
|
|
437
437
|
set(e, n) {
|
|
438
438
|
localStorage.setItem(e, JSON.stringify(n));
|
|
439
439
|
}
|
|
@@ -452,7 +452,7 @@ let he = class _t {
|
|
|
452
452
|
allKeys() {
|
|
453
453
|
return Object.keys(window.localStorage).filter((e) => e.startsWith("@@auth0spajs@@"));
|
|
454
454
|
}
|
|
455
|
-
},
|
|
455
|
+
}, Fn = class {
|
|
456
456
|
constructor() {
|
|
457
457
|
this.enclosedCache = /* @__PURE__ */ function() {
|
|
458
458
|
let e = {};
|
|
@@ -502,7 +502,7 @@ let he = class _t {
|
|
|
502
502
|
}
|
|
503
503
|
async set(e) {
|
|
504
504
|
var n;
|
|
505
|
-
const r = new
|
|
505
|
+
const r = new pe({ clientId: e.client_id, scope: e.scope, audience: e.audience }), i = await this.wrapCacheEntry(e);
|
|
506
506
|
await this.cache.set(r.toKey(), i), await ((n = this.keyManifest) === null || n === void 0 ? void 0 : n.add(r.toKey()));
|
|
507
507
|
}
|
|
508
508
|
async clear(e) {
|
|
@@ -521,16 +521,16 @@ let he = class _t {
|
|
|
521
521
|
return this.keyManifest ? (e = await this.keyManifest.get()) === null || e === void 0 ? void 0 : e.keys : this.cache.allKeys ? this.cache.allKeys() : void 0;
|
|
522
522
|
}
|
|
523
523
|
getIdTokenCacheKey(e) {
|
|
524
|
-
return new
|
|
524
|
+
return new pe({ clientId: e }, "@@auth0spajs@@", "@@user@@").toKey();
|
|
525
525
|
}
|
|
526
526
|
matchExistingCacheKey(e, n) {
|
|
527
527
|
return n.filter((r) => {
|
|
528
528
|
var i;
|
|
529
|
-
const o =
|
|
529
|
+
const o = pe.fromKey(r), a = new Set(o.scope && o.scope.split(" ")), s = ((i = e.scope) === null || i === void 0 ? void 0 : i.split(" ")) || [], h = o.scope && s.reduce((p, u) => p && a.has(u), !0);
|
|
530
530
|
return o.prefix === "@@auth0spajs@@" && o.clientId === e.clientId && o.audience === e.audience && h;
|
|
531
531
|
})[0];
|
|
532
532
|
}
|
|
533
|
-
},
|
|
533
|
+
}, Jr = class {
|
|
534
534
|
constructor(e, n, r) {
|
|
535
535
|
this.storage = e, this.clientId = n, this.cookieDomain = r, this.storageKey = `a0.spajs.txs.${this.clientId}`;
|
|
536
536
|
}
|
|
@@ -544,17 +544,17 @@ let he = class _t {
|
|
|
544
544
|
this.storage.remove(this.storageKey, { cookieDomain: this.cookieDomain });
|
|
545
545
|
}
|
|
546
546
|
};
|
|
547
|
-
const ze = (t) => typeof t == "number",
|
|
547
|
+
const ze = (t) => typeof t == "number", Xr = ["iss", "aud", "exp", "nbf", "iat", "jti", "azp", "nonce", "auth_time", "at_hash", "c_hash", "acr", "amr", "sub_jwk", "cnf", "sip_from_tag", "sip_date", "sip_callid", "sip_cseq_num", "sip_via_branch", "orig", "dest", "mky", "events", "toe", "txn", "rph", "sid", "vot", "vtm"], Vr = (t) => {
|
|
548
548
|
if (!t.id_token)
|
|
549
549
|
throw new Error("ID token is required but missing");
|
|
550
550
|
const e = ((o) => {
|
|
551
551
|
const a = o.split("."), [s, h, p] = a;
|
|
552
552
|
if (a.length !== 3 || !s || !h || !p)
|
|
553
553
|
throw new Error("ID token could not be decoded");
|
|
554
|
-
const u = JSON.parse(
|
|
554
|
+
const u = JSON.parse(Jt(h)), c = { __raw: o }, f = {};
|
|
555
555
|
return Object.keys(u).forEach((d) => {
|
|
556
|
-
c[d] = u[d],
|
|
557
|
-
}), { encoded: { header: s, payload: h, signature: p }, header: JSON.parse(
|
|
556
|
+
c[d] = u[d], Xr.includes(d) || (f[d] = u[d]);
|
|
557
|
+
}), { encoded: { header: s, payload: h, signature: p }, header: JSON.parse(Jt(s)), claims: c, user: f };
|
|
558
558
|
})(t.id_token);
|
|
559
559
|
if (!e.claims.iss)
|
|
560
560
|
throw new Error("Issuer (iss) claim must be a string present in the ID token");
|
|
@@ -620,8 +620,8 @@ const ze = (t) => typeof t == "number", Jr = ["iss", "aud", "exp", "nbf", "iat",
|
|
|
620
620
|
}
|
|
621
621
|
return e;
|
|
622
622
|
};
|
|
623
|
-
var
|
|
624
|
-
var n =
|
|
623
|
+
var me = At(function(t, e) {
|
|
624
|
+
var n = he && he.__assign || function() {
|
|
625
625
|
return n = Object.assign || function(h) {
|
|
626
626
|
for (var p, u = 1, c = arguments.length; u < c; u++)
|
|
627
627
|
for (var f in p = arguments[u])
|
|
@@ -667,10 +667,10 @@ var fe = At(function(t, e) {
|
|
|
667
667
|
s(h, "", n(n({}, p), { expires: -1 }));
|
|
668
668
|
};
|
|
669
669
|
});
|
|
670
|
-
xt(
|
|
671
|
-
var
|
|
672
|
-
const
|
|
673
|
-
const e =
|
|
670
|
+
xt(me), me.encode, me.parse, me.getAll;
|
|
671
|
+
var Yr = me.get, Jn = me.set, Xn = me.remove;
|
|
672
|
+
const Ie = { get(t) {
|
|
673
|
+
const e = Yr(t);
|
|
674
674
|
if (e !== void 0)
|
|
675
675
|
return JSON.parse(e);
|
|
676
676
|
}, save(t, e, n) {
|
|
@@ -679,15 +679,15 @@ const ke = { get(t) {
|
|
|
679
679
|
}, remove(t, e) {
|
|
680
680
|
let n = {};
|
|
681
681
|
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Xn(t, n);
|
|
682
|
-
} },
|
|
683
|
-
return
|
|
682
|
+
} }, Gr = { get(t) {
|
|
683
|
+
return Ie.get(t) || Ie.get(`_legacy_${t}`);
|
|
684
684
|
}, save(t, e, n) {
|
|
685
685
|
let r = {};
|
|
686
|
-
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), Jn(`_legacy_${t}`, JSON.stringify(e), r),
|
|
686
|
+
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), Jn(`_legacy_${t}`, JSON.stringify(e), r), Ie.save(t, e, n);
|
|
687
687
|
}, remove(t, e) {
|
|
688
688
|
let n = {};
|
|
689
|
-
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Xn(t, n),
|
|
690
|
-
} },
|
|
689
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Xn(t, n), Ie.remove(t, e), Ie.remove(`_legacy_${t}`, e);
|
|
690
|
+
} }, Br = { get(t) {
|
|
691
691
|
if (typeof sessionStorage > "u")
|
|
692
692
|
return;
|
|
693
693
|
const e = sessionStorage.getItem(t);
|
|
@@ -697,7 +697,7 @@ const ke = { get(t) {
|
|
|
697
697
|
}, remove(t) {
|
|
698
698
|
sessionStorage.removeItem(t);
|
|
699
699
|
} };
|
|
700
|
-
function
|
|
700
|
+
function qr(t, e, n) {
|
|
701
701
|
var r = e === void 0 ? null : e, i = function(h, p) {
|
|
702
702
|
var u = atob(h);
|
|
703
703
|
if (p) {
|
|
@@ -710,11 +710,11 @@ function Br(t, e, n) {
|
|
|
710
710
|
`, 10) + 1, a = i.substring(o) + (r ? "//# sourceMappingURL=" + r : ""), s = new Blob([a], { type: "application/javascript" });
|
|
711
711
|
return URL.createObjectURL(s);
|
|
712
712
|
}
|
|
713
|
-
var Vt, Yt,
|
|
714
|
-
return ht = ht ||
|
|
713
|
+
var Xt, Vt, Yt, ht, Qr = (Xt = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", Vt = null, Yt = !1, function(t) {
|
|
714
|
+
return ht = ht || qr(Xt, Vt, Yt), new Worker(ht, t);
|
|
715
715
|
});
|
|
716
716
|
const ft = {};
|
|
717
|
-
let
|
|
717
|
+
let ei = class {
|
|
718
718
|
constructor(e, n) {
|
|
719
719
|
this.cache = e, this.clientId = n, this.manifestKey = this.createManifestKeyFrom(this.clientId);
|
|
720
720
|
}
|
|
@@ -740,14 +740,14 @@ let Qr = class {
|
|
|
740
740
|
return `@@auth0spajs@@::${e}`;
|
|
741
741
|
}
|
|
742
742
|
};
|
|
743
|
-
const
|
|
744
|
-
const { openUrl: e, onRedirect: n } = t, r =
|
|
743
|
+
const ti = { memory: () => new Fn().enclosedCache, localstorage: () => new Hr() }, Gt = (t) => ti[t], Bt = (t) => {
|
|
744
|
+
const { openUrl: e, onRedirect: n } = t, r = te(t, ["openUrl", "onRedirect"]);
|
|
745
745
|
return Object.assign(Object.assign({}, r), { openUrl: e === !1 || e ? e : n });
|
|
746
|
-
}, pt = new
|
|
747
|
-
let
|
|
746
|
+
}, pt = new $r();
|
|
747
|
+
let ni = class {
|
|
748
748
|
constructor(e) {
|
|
749
749
|
let n, r;
|
|
750
|
-
if (this.userCache = new
|
|
750
|
+
if (this.userCache = new Fn().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
|
|
751
751
|
await pt.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
|
|
752
752
|
}, this.options = Object.assign(Object.assign(Object.assign({}, this.defaultOptions), e), { authorizationParams: Object.assign(Object.assign({}, this.defaultOptions.authorizationParams), e.authorizationParams) }), typeof window < "u" && (() => {
|
|
753
753
|
if (!Qe())
|
|
@@ -759,14 +759,14 @@ let ti = class {
|
|
|
759
759
|
})(), e.cache && e.cacheLocation && console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."), e.cache)
|
|
760
760
|
r = e.cache;
|
|
761
761
|
else {
|
|
762
|
-
if (n = e.cacheLocation || "memory", !
|
|
762
|
+
if (n = e.cacheLocation || "memory", !Gt(n))
|
|
763
763
|
throw new Error(`Invalid cache location "${n}"`);
|
|
764
|
-
r =
|
|
764
|
+
r = Gt(n)();
|
|
765
765
|
}
|
|
766
|
-
this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ?
|
|
767
|
-
const i = e.useCookiesForTransactions ? this.cookieStorage :
|
|
766
|
+
this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? Ie : Gr, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
|
|
767
|
+
const i = e.useCookiesForTransactions ? this.cookieStorage : Br;
|
|
768
768
|
var o;
|
|
769
|
-
this.scope =
|
|
769
|
+
this.scope = Fe("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new Jr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || Un, this.cacheManager = new Fr(r, r.allKeys ? void 0 : new ei(r, this.options.clientId), this.nowProvider), this.domainUrl = (o = this.options.domain, /^https?:\/\//.test(o) ? o : `https://${o}`), this.tokenIssuer = ((a, s) => a ? a.startsWith("https://") ? a : `https://${a}/` : `${s}/`)(this.options.issuer, this.domainUrl), typeof window < "u" && window.Worker && this.options.useRefreshTokens && n === "memory" && (this.options.workerUrl ? this.worker = new Worker(this.options.workerUrl) : this.worker = new Qr());
|
|
770
770
|
}
|
|
771
771
|
_url(e) {
|
|
772
772
|
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || Dn)));
|
|
@@ -777,20 +777,20 @@ let ti = class {
|
|
|
777
777
|
}
|
|
778
778
|
async _verifyIdToken(e, n, r) {
|
|
779
779
|
const i = await this.nowProvider();
|
|
780
|
-
return
|
|
780
|
+
return Vr({ iss: this.tokenIssuer, aud: this.options.clientId, id_token: e, nonce: n, organization: r, leeway: this.options.leeway, max_age: (o = this.options.authorizationParams.max_age, typeof o != "string" ? o : parseInt(o, 10) || void 0), now: i });
|
|
781
781
|
var o;
|
|
782
782
|
}
|
|
783
783
|
_processOrgHint(e) {
|
|
784
784
|
e ? this.cookieStorage.save(this.orgHintCookieName, e, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }) : this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain });
|
|
785
785
|
}
|
|
786
786
|
async _prepareAuthorizeUrl(e, n, r) {
|
|
787
|
-
const i =
|
|
787
|
+
const i = Ft(dt()), o = Ft(dt()), a = dt(), s = ((u) => {
|
|
788
788
|
const c = new Uint8Array(u);
|
|
789
789
|
return ((f) => {
|
|
790
790
|
const d = { "+": "-", "/": "_", "=": "" };
|
|
791
791
|
return f.replace(/[+/=]/g, (w) => d[w]);
|
|
792
792
|
})(window.btoa(String.fromCharCode(...Array.from(c))));
|
|
793
|
-
})(await (async (u) => await Qe().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), h = ((u, c, f, d, w,
|
|
793
|
+
})(await (async (u) => await Qe().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), h = ((u, c, f, d, w, k, v, E) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), f), { scope: Fe(c, f.scope), response_type: "code", response_mode: E || "query", state: d, nonce: w, redirect_uri: v || u.authorizationParams.redirect_uri, code_challenge: k, code_challenge_method: "S256" }))(this.options, this.scope, e, i, o, s, e.redirect_uri || this.options.authorizationParams.redirect_uri || r, n == null ? void 0 : n.response_mode), p = this._authorizeUrl(h);
|
|
794
794
|
return { nonce: o, code_verifier: a, scope: h.scope, audience: h.audience || "default", redirect_uri: h.redirect_uri, state: i, url: p };
|
|
795
795
|
}
|
|
796
796
|
async loginWithPopup(e, n) {
|
|
@@ -805,20 +805,20 @@ let ti = class {
|
|
|
805
805
|
const o = await ((s) => new Promise((h, p) => {
|
|
806
806
|
let u;
|
|
807
807
|
const c = setInterval(() => {
|
|
808
|
-
s.popup && s.popup.closed && (clearInterval(c), clearTimeout(f), window.removeEventListener("message", u, !1), p(new
|
|
808
|
+
s.popup && s.popup.closed && (clearInterval(c), clearTimeout(f), window.removeEventListener("message", u, !1), p(new Ur(s.popup)));
|
|
809
809
|
}, 1e3), f = setTimeout(() => {
|
|
810
|
-
clearInterval(c), p(new
|
|
810
|
+
clearInterval(c), p(new Dr(s.popup)), window.removeEventListener("message", u, !1);
|
|
811
811
|
}, 1e3 * (s.timeoutInSeconds || 60));
|
|
812
812
|
u = function(d) {
|
|
813
813
|
if (d.data && d.data.type === "authorization_response") {
|
|
814
814
|
if (clearTimeout(f), clearInterval(c), window.removeEventListener("message", u, !1), s.popup.close(), d.data.response.error)
|
|
815
|
-
return p(
|
|
815
|
+
return p(G.fromPayload(d.data.response));
|
|
816
816
|
h(d.data.response);
|
|
817
817
|
}
|
|
818
818
|
}, window.addEventListener("message", u);
|
|
819
819
|
}))(Object.assign(Object.assign({}, n), { timeoutInSeconds: n.timeoutInSeconds || this.options.authorizeTimeoutInSeconds || 60 }));
|
|
820
820
|
if (i.state !== o.state)
|
|
821
|
-
throw new
|
|
821
|
+
throw new G("state_mismatch", "Invalid state");
|
|
822
822
|
const a = ((r = e.authorizationParams) === null || r === void 0 ? void 0 : r.organization) || this.options.authorizationParams.organization;
|
|
823
823
|
await this._requestToken({ audience: i.audience, scope: i.scope, code_verifier: i.code_verifier, grant_type: "authorization_code", code: o.code, redirect_uri: i.redirect_uri }, { nonceIn: i.nonce, organization: a });
|
|
824
824
|
}
|
|
@@ -834,7 +834,7 @@ let ti = class {
|
|
|
834
834
|
}
|
|
835
835
|
async loginWithRedirect(e = {}) {
|
|
836
836
|
var n;
|
|
837
|
-
const r =
|
|
837
|
+
const r = Bt(e), { openUrl: i, fragment: o, appState: a } = r, s = te(r, ["openUrl", "fragment", "appState"]), h = ((n = s.authorizationParams) === null || n === void 0 ? void 0 : n.organization) || this.options.authorizationParams.organization, p = await this._prepareAuthorizeUrl(s.authorizationParams || {}), { url: u } = p, c = te(p, ["url"]);
|
|
838
838
|
this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, c), { appState: a }), h && { organization: h }));
|
|
839
839
|
const f = o ? `${u}#${o}` : u;
|
|
840
840
|
i ? await i(f) : window.location.assign(f);
|
|
@@ -849,11 +849,11 @@ let ti = class {
|
|
|
849
849
|
return { state: f.get("state"), code: f.get("code") || void 0, error: f.get("error") || void 0, error_description: f.get("error_description") || void 0 };
|
|
850
850
|
})(n.join("")), s = this.transactionManager.get();
|
|
851
851
|
if (!s)
|
|
852
|
-
throw new
|
|
852
|
+
throw new G("missing_transaction", "Invalid state");
|
|
853
853
|
if (this.transactionManager.remove(), o)
|
|
854
|
-
throw new
|
|
854
|
+
throw new zr(o, a || o, r, s.appState);
|
|
855
855
|
if (!s.code_verifier || s.state && s.state !== r)
|
|
856
|
-
throw new
|
|
856
|
+
throw new G("state_mismatch", "Invalid state");
|
|
857
857
|
const h = s.organization, p = s.nonce, u = s.redirect_uri;
|
|
858
858
|
return await this._requestToken(Object.assign({ audience: s.audience, scope: s.scope, code_verifier: s.code_verifier, grant_type: "authorization_code", code: i }, u ? { redirect_uri: u } : {}), { nonceIn: p, organization: h }), { appState: s.appState };
|
|
859
859
|
}
|
|
@@ -870,7 +870,7 @@ let ti = class {
|
|
|
870
870
|
}
|
|
871
871
|
async getTokenSilently(e = {}) {
|
|
872
872
|
var n;
|
|
873
|
-
const r = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope:
|
|
873
|
+
const r = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Fe(this.scope, (n = e.authorizationParams) === null || n === void 0 ? void 0 : n.scope) }) }), i = await ((o, a) => {
|
|
874
874
|
let s = ft[a];
|
|
875
875
|
return s || (s = o().finally(() => {
|
|
876
876
|
delete ft[a], s = null;
|
|
@@ -879,7 +879,7 @@ let ti = class {
|
|
|
879
879
|
return e.detailedResponse ? i : i == null ? void 0 : i.access_token;
|
|
880
880
|
}
|
|
881
881
|
async _getTokenSilently(e) {
|
|
882
|
-
const { cacheMode: n } = e, r =
|
|
882
|
+
const { cacheMode: n } = e, r = te(e, ["cacheMode"]);
|
|
883
883
|
if (n !== "off") {
|
|
884
884
|
const i = await this._getEntryFromCache({ scope: r.authorizationParams.scope, audience: r.authorizationParams.audience || "default", clientId: this.options.clientId });
|
|
885
885
|
if (i)
|
|
@@ -908,19 +908,19 @@ let ti = class {
|
|
|
908
908
|
}
|
|
909
909
|
async getTokenWithPopup(e = {}, n = {}) {
|
|
910
910
|
var r;
|
|
911
|
-
const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope:
|
|
912
|
-
return n = Object.assign(Object.assign({},
|
|
911
|
+
const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Fe(this.scope, (r = e.authorizationParams) === null || r === void 0 ? void 0 : r.scope) }) });
|
|
912
|
+
return n = Object.assign(Object.assign({}, Nr), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new pe({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId }))).access_token;
|
|
913
913
|
}
|
|
914
914
|
async isAuthenticated() {
|
|
915
915
|
return !!await this.getUser();
|
|
916
916
|
}
|
|
917
917
|
_buildLogoutUrl(e) {
|
|
918
918
|
e.clientId !== null ? e.clientId = e.clientId || this.options.clientId : delete e.clientId;
|
|
919
|
-
const n = e.logoutParams || {}, { federated: r } = n, i =
|
|
919
|
+
const n = e.logoutParams || {}, { federated: r } = n, i = te(n, ["federated"]), o = r ? "&federated" : "";
|
|
920
920
|
return this._url(`/v2/logout?${St(Object.assign({ clientId: e.clientId }, i))}`) + o;
|
|
921
921
|
}
|
|
922
922
|
async logout(e = {}) {
|
|
923
|
-
const n =
|
|
923
|
+
const n = Bt(e), { openUrl: r } = n, i = te(n, ["openUrl"]);
|
|
924
924
|
e.clientId === null ? await this.cacheManager.clear() : await this.cacheManager.clear(e.clientId || this.options.clientId), this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain }), this.cookieStorage.remove(this.isAuthenticatedCookieName, { cookieDomain: this.options.cookieDomain }), this.userCache.remove("@@user@@");
|
|
925
925
|
const o = this._buildLogoutUrl(i);
|
|
926
926
|
r ? await r(o) : r !== !1 && window.location.assign(o);
|
|
@@ -931,26 +931,26 @@ let ti = class {
|
|
|
931
931
|
const { url: i, state: o, nonce: a, code_verifier: s, redirect_uri: h, scope: p, audience: u } = await this._prepareAuthorizeUrl(n, { response_mode: "web_message" }, window.location.origin);
|
|
932
932
|
try {
|
|
933
933
|
if (window.crossOriginIsolated)
|
|
934
|
-
throw new
|
|
935
|
-
const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, f = await ((w,
|
|
934
|
+
throw new G("login_required", "The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");
|
|
935
|
+
const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, f = await ((w, k, v = 60) => new Promise((E, _) => {
|
|
936
936
|
const g = window.document.createElement("iframe");
|
|
937
937
|
g.setAttribute("width", "0"), g.setAttribute("height", "0"), g.style.display = "none";
|
|
938
938
|
const l = () => {
|
|
939
939
|
window.document.body.contains(g) && (window.document.body.removeChild(g), window.removeEventListener("message", b, !1));
|
|
940
940
|
};
|
|
941
941
|
let b;
|
|
942
|
-
const
|
|
943
|
-
|
|
942
|
+
const T = setTimeout(() => {
|
|
943
|
+
_(new It()), l();
|
|
944
944
|
}, 1e3 * v);
|
|
945
|
-
b = function(
|
|
946
|
-
if (
|
|
945
|
+
b = function(O) {
|
|
946
|
+
if (O.origin != k || !O.data || O.data.type !== "authorization_response")
|
|
947
947
|
return;
|
|
948
|
-
const
|
|
949
|
-
|
|
948
|
+
const x = O.source;
|
|
949
|
+
x && x.close(), O.data.response.error ? _(G.fromPayload(O.data.response)) : E(O.data.response), clearTimeout(T), window.removeEventListener("message", b, !1), setTimeout(l, 2e3);
|
|
950
950
|
}, window.addEventListener("message", b, !1), window.document.body.appendChild(g), g.setAttribute("src", w);
|
|
951
951
|
}))(i, this.domainUrl, c);
|
|
952
952
|
if (o !== f.state)
|
|
953
|
-
throw new
|
|
953
|
+
throw new G("state_mismatch", "Invalid state");
|
|
954
954
|
const d = await this._requestToken(Object.assign(Object.assign({}, e.authorizationParams), { code_verifier: s, code: f.code, grant_type: "authorization_code", redirect_uri: h, timeout: e.authorizationParams.timeout || this.httpTimeoutMs }), { nonceIn: a, organization: n.organization });
|
|
955
955
|
return Object.assign(Object.assign({}, d), { scope: p, oauthTokenScope: d.scope, audience: u });
|
|
956
956
|
} catch (c) {
|
|
@@ -958,11 +958,11 @@ let ti = class {
|
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
960
|
async _getTokenUsingRefreshToken(e) {
|
|
961
|
-
const n = await this.cacheManager.get(new
|
|
961
|
+
const n = await this.cacheManager.get(new pe({ scope: e.authorizationParams.scope, audience: e.authorizationParams.audience || "default", clientId: this.options.clientId }));
|
|
962
962
|
if (!(n && n.refresh_token || this.worker)) {
|
|
963
963
|
if (this.options.useRefreshTokensFallback)
|
|
964
964
|
return await this._getTokenFromIFrame(e);
|
|
965
|
-
throw new
|
|
965
|
+
throw new Wn(e.authorizationParams.audience || "default", e.authorizationParams.scope);
|
|
966
966
|
}
|
|
967
967
|
const r = e.authorizationParams.redirect_uri || this.options.authorizationParams.redirect_uri || window.location.origin, i = typeof e.timeoutInSeconds == "number" ? 1e3 * e.timeoutInSeconds : null;
|
|
968
968
|
try {
|
|
@@ -975,15 +975,15 @@ let ti = class {
|
|
|
975
975
|
}
|
|
976
976
|
}
|
|
977
977
|
async _saveEntryInCache(e) {
|
|
978
|
-
const { id_token: n, decodedToken: r } = e, i =
|
|
978
|
+
const { id_token: n, decodedToken: r } = e, i = te(e, ["id_token", "decodedToken"]);
|
|
979
979
|
this.userCache.set("@@user@@", { id_token: n, decodedToken: r }), await this.cacheManager.setIdToken(this.options.clientId, e.id_token, e.decodedToken), await this.cacheManager.set(i);
|
|
980
980
|
}
|
|
981
981
|
async _getIdTokenFromCache() {
|
|
982
|
-
const e = this.options.authorizationParams.audience || "default", n = await this.cacheManager.getIdToken(new
|
|
982
|
+
const e = this.options.authorizationParams.audience || "default", n = await this.cacheManager.getIdToken(new pe({ clientId: this.options.clientId, audience: e, scope: this.scope })), r = this.userCache.get("@@user@@");
|
|
983
983
|
return n && n.id_token === (r == null ? void 0 : r.id_token) ? r : (this.userCache.set("@@user@@", n), n);
|
|
984
984
|
}
|
|
985
985
|
async _getEntryFromCache({ scope: e, audience: n, clientId: r }) {
|
|
986
|
-
const i = await this.cacheManager.get(new
|
|
986
|
+
const i = await this.cacheManager.get(new pe({ scope: e, audience: n, clientId: r }), 60);
|
|
987
987
|
if (i && i.access_token) {
|
|
988
988
|
const { access_token: o, oauthTokenScope: a, expires_in: s } = i, h = await this._getIdTokenFromCache();
|
|
989
989
|
return h && Object.assign(Object.assign({ id_token: h.id_token, access_token: o }, a ? { scope: a } : null), { expires_in: s });
|
|
@@ -994,67 +994,57 @@ let ti = class {
|
|
|
994
994
|
return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({}, o), { decodedToken: a, scope: e.scope, audience: e.audience || "default" }), o.scope ? { oauthTokenScope: o.scope } : null), { client_id: this.options.clientId })), this.cookieStorage.save(this.isAuthenticatedCookieName, !0, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }), this._processOrgHint(i || a.claims.org_id), Object.assign(Object.assign({}, o), { decodedToken: a });
|
|
995
995
|
}
|
|
996
996
|
};
|
|
997
|
-
async function
|
|
998
|
-
const e = new
|
|
997
|
+
async function ri(t) {
|
|
998
|
+
const e = new ni(t);
|
|
999
999
|
return await e.checkSession(), e;
|
|
1000
1000
|
}
|
|
1001
|
-
const Vn = "sesamy.com",
|
|
1002
|
-
var
|
|
1003
|
-
let
|
|
1001
|
+
const Vn = "sesamy.com", ii = "https://logs.sesamy.com/events", Et = "sesamyCacheTimestamp";
|
|
1002
|
+
var Q = /* @__PURE__ */ ((t) => (t.READY = "sesamyJsReady", t.AUTHENTICATED = "sesamyJsAuthenticated", t.LOGOUT = "sesamyJsLogout", t.CLEAR_CACHE = "sesamyJsClearCache", t.USER_ATTRIBUTE_CHANGED = "sesamyUserAttributeChanged", t.PURCHASE = "sesamyJsPurchase", t))(Q || {});
|
|
1003
|
+
let q;
|
|
1004
1004
|
const $t = "sesamyAccessToken", Nt = "sesamyExpires";
|
|
1005
|
-
function
|
|
1005
|
+
function Yn() {
|
|
1006
1006
|
const t = localStorage.getItem(Nt);
|
|
1007
1007
|
if (!(t && parseInt(t, 10) < (/* @__PURE__ */ new Date()).getTime()))
|
|
1008
1008
|
return localStorage.getItem($t);
|
|
1009
1009
|
}
|
|
1010
|
-
async function
|
|
1011
|
-
if (t.enabled !== !1 && (
|
|
1010
|
+
async function oi(t) {
|
|
1011
|
+
if (t.enabled !== !1 && (q = await ri({
|
|
1012
1012
|
domain: t.endpoint || `token.${Vn}`,
|
|
1013
1013
|
clientId: t.clientId
|
|
1014
1014
|
}), window.location.search.includes("code=")))
|
|
1015
1015
|
try {
|
|
1016
|
-
await
|
|
1017
|
-
const e = await
|
|
1018
|
-
|
|
1016
|
+
await q.handleRedirectCallback();
|
|
1017
|
+
const e = await q.getUser();
|
|
1018
|
+
ue(Q.AUTHENTICATED, e);
|
|
1019
1019
|
const n = new URL(location.href), r = n.searchParams;
|
|
1020
1020
|
r.delete("code"), r.delete("state"), n.search = r.toString(), window.history.replaceState({}, document.title, n.toString());
|
|
1021
1021
|
} catch {
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
|
-
async function oi() {
|
|
1025
|
-
if (zt())
|
|
1026
|
-
return !0;
|
|
1027
|
-
if (!G)
|
|
1028
|
-
throw new Error("Auth0 client not initialized");
|
|
1029
|
-
return G.isAuthenticated();
|
|
1030
|
-
}
|
|
1031
1024
|
async function ai() {
|
|
1032
|
-
if (
|
|
1033
|
-
return
|
|
1034
|
-
|
|
1035
|
-
name: "Local User"
|
|
1036
|
-
};
|
|
1037
|
-
if (!G)
|
|
1025
|
+
if (Yn())
|
|
1026
|
+
return !0;
|
|
1027
|
+
if (!q)
|
|
1038
1028
|
throw new Error("Auth0 client not initialized");
|
|
1039
|
-
return
|
|
1029
|
+
return q.isAuthenticated();
|
|
1040
1030
|
}
|
|
1041
1031
|
function si() {
|
|
1042
|
-
if (!
|
|
1032
|
+
if (!q)
|
|
1043
1033
|
throw new Error("Auth0 client not initialized");
|
|
1044
|
-
return
|
|
1034
|
+
return q.loginWithRedirect({
|
|
1045
1035
|
authorizationParams: {
|
|
1046
1036
|
redirect_uri: window.location.href
|
|
1047
1037
|
}
|
|
1048
1038
|
});
|
|
1049
1039
|
}
|
|
1050
1040
|
async function ci(t = !0) {
|
|
1051
|
-
const e =
|
|
1041
|
+
const e = Yn();
|
|
1052
1042
|
if (e)
|
|
1053
1043
|
return e;
|
|
1054
1044
|
try {
|
|
1055
|
-
if (!
|
|
1045
|
+
if (!q)
|
|
1056
1046
|
throw new Error("Auth0 client not initialized");
|
|
1057
|
-
return await
|
|
1047
|
+
return await q.getTokenSilently();
|
|
1058
1048
|
} catch (n) {
|
|
1059
1049
|
if (t)
|
|
1060
1050
|
throw n;
|
|
@@ -1062,9 +1052,9 @@ async function ci(t = !0) {
|
|
|
1062
1052
|
}
|
|
1063
1053
|
}
|
|
1064
1054
|
async function ui() {
|
|
1065
|
-
if (localStorage.removeItem($t), localStorage.removeItem(Nt), !
|
|
1055
|
+
if (localStorage.removeItem($t), localStorage.removeItem(Nt), !q)
|
|
1066
1056
|
throw new Error("Auth0 client not initialized");
|
|
1067
|
-
return
|
|
1057
|
+
return ue(Q.LOGOUT, {}), q.logout({
|
|
1068
1058
|
logoutParams: {
|
|
1069
1059
|
returnTo: window.location.href
|
|
1070
1060
|
}
|
|
@@ -1081,12 +1071,12 @@ function li(t) {
|
|
|
1081
1071
|
);
|
|
1082
1072
|
return JSON.parse(i);
|
|
1083
1073
|
}
|
|
1084
|
-
async function
|
|
1074
|
+
async function Gn(t, e) {
|
|
1085
1075
|
localStorage.setItem($t, t), e && localStorage.setItem(Nt, JSON.stringify(e * 1e3 + (/* @__PURE__ */ new Date()).getTime()));
|
|
1086
1076
|
const n = li(t);
|
|
1087
|
-
|
|
1077
|
+
ue(Q.AUTHENTICATED, n);
|
|
1088
1078
|
}
|
|
1089
|
-
const di = (t, e) => e.skipDedupe || e.method !== "GET", hi = (t, e) => e.method + "@" + t, fi = (t) => t.clone(),
|
|
1079
|
+
const di = (t, e) => e.skipDedupe || e.method !== "GET", hi = (t, e) => e.method + "@" + t, fi = (t) => t.clone(), qt = ({ skip: t = di, key: e = hi, resolver: n = fi } = {}) => {
|
|
1090
1080
|
const r = /* @__PURE__ */ new Map();
|
|
1091
1081
|
return (i) => (o, a) => {
|
|
1092
1082
|
if (t(o, a))
|
|
@@ -1106,11 +1096,11 @@ const di = (t, e) => e.skipDedupe || e.method !== "GET", hi = (t, e) => e.method
|
|
|
1106
1096
|
return r.delete(s), Promise.reject(h);
|
|
1107
1097
|
}
|
|
1108
1098
|
};
|
|
1109
|
-
}, pi = (t, e) => t * e, mi = (t) => t && t.ok,
|
|
1099
|
+
}, pi = (t, e) => t * e, mi = (t) => t && t.ok, Qt = ({ delayTimer: t = 500, delayRamp: e = pi, maxAttempts: n = 10, until: r = mi, onRetry: i = null, retryOnNetworkError: o = !1, resolveWithLatestResponse: a = !1, skip: s } = {}) => (h) => (p, u) => {
|
|
1110
1100
|
let c = 0;
|
|
1111
1101
|
if (s && s(p, u))
|
|
1112
1102
|
return h(p, u);
|
|
1113
|
-
const f = (d, w) => Promise.resolve(r(d, w)).then((
|
|
1103
|
+
const f = (d, w) => Promise.resolve(r(d, w)).then((k) => k ? d && a ? d : w ? Promise.reject(w) : d : (c++, !n || c <= n ? new Promise((v) => {
|
|
1114
1104
|
const E = e(t, c);
|
|
1115
1105
|
setTimeout(() => {
|
|
1116
1106
|
typeof i == "function" ? Promise.resolve(i({
|
|
@@ -1118,9 +1108,9 @@ const di = (t, e) => e.skipDedupe || e.method !== "GET", hi = (t, e) => e.method
|
|
|
1118
1108
|
error: w,
|
|
1119
1109
|
url: p,
|
|
1120
1110
|
options: u
|
|
1121
|
-
})).then((
|
|
1111
|
+
})).then((_ = {}) => {
|
|
1122
1112
|
var g, l;
|
|
1123
|
-
v(h((g =
|
|
1113
|
+
v(h((g = _ && _.url) !== null && g !== void 0 ? g : p, (l = _ && _.options) !== null && l !== void 0 ? l : u));
|
|
1124
1114
|
}) : v(h(p, u));
|
|
1125
1115
|
}, E);
|
|
1126
1116
|
}).then(f).catch((v) => {
|
|
@@ -1133,18 +1123,18 @@ const di = (t, e) => e.skipDedupe || e.method !== "GET", hi = (t, e) => e.method
|
|
|
1133
1123
|
throw d;
|
|
1134
1124
|
return f(null, d);
|
|
1135
1125
|
});
|
|
1136
|
-
}, gi = "application/json",
|
|
1137
|
-
function
|
|
1126
|
+
}, gi = "application/json", Bn = "Content-Type", ke = Symbol(), qn = Symbol();
|
|
1127
|
+
function en(t = {}) {
|
|
1138
1128
|
var e;
|
|
1139
|
-
return (e = Object.entries(t).find(([n]) => n.toLowerCase() ===
|
|
1129
|
+
return (e = Object.entries(t).find(([n]) => n.toLowerCase() === Bn.toLowerCase())) === null || e === void 0 ? void 0 : e[1];
|
|
1140
1130
|
}
|
|
1141
|
-
function
|
|
1131
|
+
function tn(t) {
|
|
1142
1132
|
return /^application\/.*json.*/.test(t);
|
|
1143
1133
|
}
|
|
1144
|
-
const
|
|
1134
|
+
const ge = function(t, e, n = !1) {
|
|
1145
1135
|
return Object.entries(e).reduce((r, [i, o]) => {
|
|
1146
1136
|
const a = t[i];
|
|
1147
|
-
return Array.isArray(a) && Array.isArray(o) ? r[i] = n ? [...a, ...o] : o : typeof a == "object" && typeof o == "object" ? r[i] =
|
|
1137
|
+
return Array.isArray(a) && Array.isArray(o) ? r[i] = n ? [...a, ...o] : o : typeof a == "object" && typeof o == "object" ? r[i] = ge(a, o, n) : r[i] = o, r;
|
|
1148
1138
|
}, { ...t });
|
|
1149
1139
|
}, Oe = {
|
|
1150
1140
|
// Default options
|
|
@@ -1168,33 +1158,33 @@ const pe = function(t, e, n = !1) {
|
|
|
1168
1158
|
}
|
|
1169
1159
|
};
|
|
1170
1160
|
function yi(t, e = !1) {
|
|
1171
|
-
Oe.options = e ? t :
|
|
1161
|
+
Oe.options = e ? t : ge(Oe.options, t);
|
|
1172
1162
|
}
|
|
1173
1163
|
function vi(t, e = !1) {
|
|
1174
|
-
Oe.polyfills = e ? t :
|
|
1164
|
+
Oe.polyfills = e ? t : ge(Oe.polyfills, t);
|
|
1175
1165
|
}
|
|
1176
1166
|
function wi(t) {
|
|
1177
1167
|
Oe.errorType = t;
|
|
1178
1168
|
}
|
|
1179
1169
|
const bi = (t) => (e) => t.reduceRight((n, r) => r(n), e) || e;
|
|
1180
|
-
class
|
|
1170
|
+
class Qn extends Error {
|
|
1181
1171
|
}
|
|
1182
1172
|
const ki = (t) => {
|
|
1183
1173
|
const e = /* @__PURE__ */ Object.create(null);
|
|
1184
1174
|
t = t._addons.reduce((g, l) => l.beforeRequest && l.beforeRequest(g, t._options, e) || g, t);
|
|
1185
|
-
const { _url: n, _options: r, _config: i, _catchers: o, _resolvers: a, _middlewares: s, _addons: h } = t, p = new Map(o), u =
|
|
1175
|
+
const { _url: n, _options: r, _config: i, _catchers: o, _resolvers: a, _middlewares: s, _addons: h } = t, p = new Map(o), u = ge(i.options, r);
|
|
1186
1176
|
let c = n;
|
|
1187
1177
|
const f = bi(s)((g, l) => (c = g, i.polyfill("fetch")(g, l)))(n, u), d = new Error(), w = f.catch((g) => {
|
|
1188
|
-
throw { [
|
|
1178
|
+
throw { [ke]: g };
|
|
1189
1179
|
}).then((g) => {
|
|
1190
1180
|
if (!g.ok) {
|
|
1191
|
-
const l = new
|
|
1181
|
+
const l = new Qn();
|
|
1192
1182
|
if (l.cause = d, l.stack = l.stack + `
|
|
1193
1183
|
CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
1194
1184
|
throw l;
|
|
1195
1185
|
return g.text().then((b) => {
|
|
1196
|
-
var
|
|
1197
|
-
if (l.message = b, i.errorType === "json" || ((
|
|
1186
|
+
var T;
|
|
1187
|
+
if (l.message = b, i.errorType === "json" || ((T = g.headers.get("Content-Type")) === null || T === void 0 ? void 0 : T.split(";")[0]) === "application/json")
|
|
1198
1188
|
try {
|
|
1199
1189
|
l.json = JSON.parse(b);
|
|
1200
1190
|
} catch {
|
|
@@ -1203,15 +1193,15 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1203
1193
|
});
|
|
1204
1194
|
}
|
|
1205
1195
|
return g;
|
|
1206
|
-
}),
|
|
1207
|
-
const b = l.hasOwnProperty(
|
|
1208
|
-
if (
|
|
1209
|
-
return
|
|
1210
|
-
const
|
|
1211
|
-
if (
|
|
1212
|
-
return
|
|
1213
|
-
throw
|
|
1214
|
-
}), v = (g) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */
|
|
1196
|
+
}), k = (g) => g.catch((l) => {
|
|
1197
|
+
const b = l.hasOwnProperty(ke), T = b ? l[ke] : l, O = (T == null ? void 0 : T.status) && p.get(T.status) || p.get(T == null ? void 0 : T.name) || b && p.has(ke) && p.get(ke);
|
|
1198
|
+
if (O)
|
|
1199
|
+
return O(T, t);
|
|
1200
|
+
const x = p.get(qn);
|
|
1201
|
+
if (x)
|
|
1202
|
+
return x(T, t);
|
|
1203
|
+
throw T;
|
|
1204
|
+
}), v = (g) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */ k(g ? w.then((b) => b && b[g]()).then((b) => l ? l(b) : b) : w.then((b) => l ? l(b) : b)), E = {
|
|
1215
1205
|
_wretchReq: t,
|
|
1216
1206
|
_fetchReq: f,
|
|
1217
1207
|
_sharedState: e,
|
|
@@ -1243,13 +1233,13 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1243
1233
|
return this.error(500, g);
|
|
1244
1234
|
},
|
|
1245
1235
|
fetchError(g) {
|
|
1246
|
-
return this.error(
|
|
1236
|
+
return this.error(ke, g);
|
|
1247
1237
|
}
|
|
1248
|
-
},
|
|
1238
|
+
}, _ = h.reduce((g, l) => ({
|
|
1249
1239
|
...g,
|
|
1250
1240
|
...typeof l.resolver == "function" ? l.resolver(g) : l.resolver
|
|
1251
1241
|
}), E);
|
|
1252
|
-
return a.reduce((g, l) => l(g, t),
|
|
1242
|
+
return a.reduce((g, l) => l(g, t), _);
|
|
1253
1243
|
}, Ii = {
|
|
1254
1244
|
_url: "",
|
|
1255
1245
|
_options: {},
|
|
@@ -1276,7 +1266,7 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1276
1266
|
...this,
|
|
1277
1267
|
_config: {
|
|
1278
1268
|
...this._config,
|
|
1279
|
-
polyfills: e ? t :
|
|
1269
|
+
polyfills: e ? t : ge(this._config.polyfills, t)
|
|
1280
1270
|
}
|
|
1281
1271
|
};
|
|
1282
1272
|
},
|
|
@@ -1290,17 +1280,17 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1290
1280
|
};
|
|
1291
1281
|
},
|
|
1292
1282
|
options(t, e = !1) {
|
|
1293
|
-
return { ...this, _options: e ? t :
|
|
1283
|
+
return { ...this, _options: e ? t : ge(this._options, t) };
|
|
1294
1284
|
},
|
|
1295
1285
|
headers(t) {
|
|
1296
1286
|
const e = t ? Array.isArray(t) ? Object.fromEntries(t) : "entries" in t ? Object.fromEntries(t.entries()) : t : {};
|
|
1297
|
-
return { ...this, _options:
|
|
1287
|
+
return { ...this, _options: ge(this._options, { headers: e }) };
|
|
1298
1288
|
},
|
|
1299
1289
|
accept(t) {
|
|
1300
1290
|
return this.headers({ Accept: t });
|
|
1301
1291
|
},
|
|
1302
1292
|
content(t) {
|
|
1303
|
-
return this.headers({ [
|
|
1293
|
+
return this.headers({ [Bn]: t });
|
|
1304
1294
|
},
|
|
1305
1295
|
auth(t) {
|
|
1306
1296
|
return this.headers({ Authorization: t });
|
|
@@ -1310,7 +1300,7 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1310
1300
|
return n.set(t, e), { ...this, _catchers: n };
|
|
1311
1301
|
},
|
|
1312
1302
|
catcherFallback(t) {
|
|
1313
|
-
return this.catcher(
|
|
1303
|
+
return this.catcher(qn, t);
|
|
1314
1304
|
},
|
|
1315
1305
|
resolve(t, e = !1) {
|
|
1316
1306
|
return { ...this, _resolvers: e ? [t] : [...this._resolvers, t] };
|
|
@@ -1329,7 +1319,7 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1329
1319
|
},
|
|
1330
1320
|
fetch(t = this._options.method, e = "", n = null) {
|
|
1331
1321
|
let r = this.url(e).options({ method: t });
|
|
1332
|
-
const i =
|
|
1322
|
+
const i = en(r._options.headers), o = typeof n == "object" && (!r._options.headers || !i || tn(i));
|
|
1333
1323
|
return r = n ? o ? r.json(n, i) : r.body(n) : r, ki(r._deferred.reduce((a, s) => s(a, a._url, a._options), r));
|
|
1334
1324
|
},
|
|
1335
1325
|
get(t = "") {
|
|
@@ -1357,99 +1347,99 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1357
1347
|
return { ...this, _options: { ...this._options, body: t } };
|
|
1358
1348
|
},
|
|
1359
1349
|
json(t, e) {
|
|
1360
|
-
const n =
|
|
1361
|
-
return this.content(e ||
|
|
1350
|
+
const n = en(this._options.headers);
|
|
1351
|
+
return this.content(e || tn(n) && n || gi).body(JSON.stringify(t));
|
|
1362
1352
|
}
|
|
1363
1353
|
};
|
|
1364
|
-
function
|
|
1354
|
+
function le(t = "", e = {}) {
|
|
1365
1355
|
return { ...Ii, _url: t, _options: e };
|
|
1366
1356
|
}
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1357
|
+
le.default = le;
|
|
1358
|
+
le.options = yi;
|
|
1359
|
+
le.errorType = wi;
|
|
1360
|
+
le.polyfills = vi;
|
|
1361
|
+
le.WretchError = Qn;
|
|
1372
1362
|
function re() {
|
|
1373
|
-
sessionStorage.removeItem(Et),
|
|
1363
|
+
sessionStorage.removeItem(Et), ue(Q.CLEAR_CACHE, {});
|
|
1374
1364
|
}
|
|
1375
1365
|
function Si(t) {
|
|
1376
|
-
const e = t.endpoint || `https://api2.${Vn}`, n = (
|
|
1377
|
-
let
|
|
1378
|
-
|
|
1379
|
-
const
|
|
1380
|
-
|
|
1366
|
+
const e = t.endpoint || `https://api2.${Vn}`, n = (S) => async (I, N) => {
|
|
1367
|
+
let K = sessionStorage.getItem(Et);
|
|
1368
|
+
K || (K = Date.now().toString(), sessionStorage.setItem(Et, K));
|
|
1369
|
+
const X = {
|
|
1370
|
+
...N,
|
|
1381
1371
|
headers: {
|
|
1382
|
-
|
|
1383
|
-
"Cache-Timestamp":
|
|
1372
|
+
...N.headers,
|
|
1373
|
+
"Cache-Timestamp": K
|
|
1384
1374
|
}
|
|
1385
1375
|
};
|
|
1386
|
-
return
|
|
1387
|
-
}, r = (
|
|
1388
|
-
let
|
|
1389
|
-
if (
|
|
1390
|
-
if (
|
|
1376
|
+
return S(I, X);
|
|
1377
|
+
}, r = (S = !0) => (I) => async (N, K) => {
|
|
1378
|
+
let X = null;
|
|
1379
|
+
if (X = await ci(S), !X) {
|
|
1380
|
+
if (S)
|
|
1391
1381
|
throw new Error("No access token available");
|
|
1392
|
-
return
|
|
1382
|
+
return I(N, K);
|
|
1393
1383
|
}
|
|
1394
|
-
const
|
|
1395
|
-
...
|
|
1384
|
+
const m = {
|
|
1385
|
+
...K,
|
|
1396
1386
|
headers: {
|
|
1397
|
-
...
|
|
1398
|
-
...
|
|
1387
|
+
...K.headers,
|
|
1388
|
+
...X ? { Authorization: `Bearer ${X}` } : {}
|
|
1399
1389
|
}
|
|
1400
1390
|
};
|
|
1401
|
-
return
|
|
1402
|
-
}, i = (
|
|
1403
|
-
if (
|
|
1404
|
-
return
|
|
1405
|
-
const
|
|
1406
|
-
|
|
1391
|
+
return I(N, m);
|
|
1392
|
+
}, i = (S) => (I, N) => {
|
|
1393
|
+
if (N.headers.Authorization)
|
|
1394
|
+
return S(I, N);
|
|
1395
|
+
const K = localStorage.getItem("__anon_id"), X = btoa(`${K}:`), m = {
|
|
1396
|
+
...N,
|
|
1407
1397
|
headers: {
|
|
1408
|
-
|
|
1409
|
-
Authorization: `Basic ${
|
|
1398
|
+
...N.headers,
|
|
1399
|
+
Authorization: `Basic ${X}`
|
|
1410
1400
|
}
|
|
1411
1401
|
};
|
|
1412
|
-
return
|
|
1413
|
-
}, o =
|
|
1402
|
+
return S(I, m);
|
|
1403
|
+
}, o = le(e).headers({ "Content-Type": "application/json" }).middlewares([
|
|
1414
1404
|
n,
|
|
1415
1405
|
r(),
|
|
1416
|
-
|
|
1417
|
-
|
|
1406
|
+
qt(),
|
|
1407
|
+
Qt({
|
|
1418
1408
|
delayTimer: 1e3,
|
|
1419
|
-
delayRamp: (
|
|
1409
|
+
delayRamp: (S, I) => S * I,
|
|
1420
1410
|
maxAttempts: 3,
|
|
1421
|
-
until: (
|
|
1411
|
+
until: (S) => !!(S && (S.ok || S.status >= 400 && S.status < 500)),
|
|
1422
1412
|
retryOnNetworkError: !1
|
|
1423
1413
|
})
|
|
1424
|
-
]), a =
|
|
1414
|
+
]), a = le(e).headers({ "Content-Type": "application/json" }).middlewares([
|
|
1425
1415
|
n,
|
|
1426
1416
|
r(!1),
|
|
1427
1417
|
i,
|
|
1428
|
-
|
|
1429
|
-
|
|
1418
|
+
qt(),
|
|
1419
|
+
Qt({
|
|
1430
1420
|
delayTimer: 1e3,
|
|
1431
|
-
delayRamp: (
|
|
1421
|
+
delayRamp: (S, I) => S * I,
|
|
1432
1422
|
maxAttempts: 3,
|
|
1433
|
-
until: (
|
|
1423
|
+
until: (S) => !!(S && (S.ok || S.status >= 400 && S.status < 500)),
|
|
1434
1424
|
retryOnNetworkError: !1
|
|
1435
1425
|
})
|
|
1436
1426
|
]);
|
|
1437
1427
|
async function s() {
|
|
1438
1428
|
return o.get("/entitlements").json();
|
|
1439
1429
|
}
|
|
1440
|
-
async function h(
|
|
1441
|
-
const
|
|
1442
|
-
return
|
|
1430
|
+
async function h(S) {
|
|
1431
|
+
const I = await o.get("/entitlements").json();
|
|
1432
|
+
return I == null ? void 0 : I.find((N) => N.id === S);
|
|
1443
1433
|
}
|
|
1444
|
-
async function p(
|
|
1445
|
-
return o.get(`/entitlements/${
|
|
1434
|
+
async function p(S) {
|
|
1435
|
+
return o.get(`/entitlements/${S}/access`).json();
|
|
1446
1436
|
}
|
|
1447
1437
|
async function u() {
|
|
1448
1438
|
return o.get("/contracts").json();
|
|
1449
1439
|
}
|
|
1450
|
-
async function c(
|
|
1451
|
-
const
|
|
1452
|
-
return
|
|
1440
|
+
async function c(S) {
|
|
1441
|
+
const I = await o.get("/contracts").json();
|
|
1442
|
+
return I == null ? void 0 : I.find((N) => N.id === S);
|
|
1453
1443
|
}
|
|
1454
1444
|
async function f() {
|
|
1455
1445
|
return o.get("/subscriptions").json();
|
|
@@ -1457,54 +1447,60 @@ function Si(t) {
|
|
|
1457
1447
|
async function d() {
|
|
1458
1448
|
return o.get("/bills").json();
|
|
1459
1449
|
}
|
|
1460
|
-
async function w(
|
|
1461
|
-
const
|
|
1462
|
-
return
|
|
1450
|
+
async function w(S) {
|
|
1451
|
+
const I = await o.get("/bills").json();
|
|
1452
|
+
return I == null ? void 0 : I.find((N) => N.id === S);
|
|
1463
1453
|
}
|
|
1464
|
-
async function
|
|
1465
|
-
const
|
|
1466
|
-
return
|
|
1454
|
+
async function k(S, I) {
|
|
1455
|
+
const N = await o.url(`/user-metadata/${S}`).put(I).json();
|
|
1456
|
+
return ue(Q.USER_ATTRIBUTE_CHANGED, {}), re(), N;
|
|
1467
1457
|
}
|
|
1468
|
-
async function v(
|
|
1469
|
-
const
|
|
1470
|
-
return re(),
|
|
1458
|
+
async function v(S) {
|
|
1459
|
+
const I = await o.url(`/user-metadata/${S}`).delete().res();
|
|
1460
|
+
return re(), I.ok;
|
|
1471
1461
|
}
|
|
1472
|
-
async function E(
|
|
1473
|
-
return (await o.url(`/user-metadata/${
|
|
1462
|
+
async function E(S) {
|
|
1463
|
+
return (await o.url(`/user-metadata/${S}`).get().json())[S];
|
|
1474
1464
|
}
|
|
1475
|
-
async function
|
|
1465
|
+
async function _() {
|
|
1476
1466
|
return await o.url("/user-metadata").get().json();
|
|
1477
1467
|
}
|
|
1478
1468
|
async function g() {
|
|
1479
1469
|
return await o.url("/tags").get().json();
|
|
1480
1470
|
}
|
|
1481
|
-
async function l(
|
|
1482
|
-
const
|
|
1483
|
-
return re(),
|
|
1471
|
+
async function l(S) {
|
|
1472
|
+
const I = await o.url(`/tags/${S}`).delete().res();
|
|
1473
|
+
return re(), I.ok;
|
|
1484
1474
|
}
|
|
1485
|
-
async function b(
|
|
1486
|
-
const
|
|
1487
|
-
return
|
|
1475
|
+
async function b(S) {
|
|
1476
|
+
const I = await o.url("/tags").post(S).res();
|
|
1477
|
+
return ue(Q.USER_ATTRIBUTE_CHANGED, {}), re(), I.ok;
|
|
1488
1478
|
}
|
|
1489
|
-
async function
|
|
1490
|
-
return (await a.url("/tallies").get().json())[
|
|
1479
|
+
async function T(S) {
|
|
1480
|
+
return (await a.url("/tallies").get().json())[S];
|
|
1491
1481
|
}
|
|
1492
|
-
async function
|
|
1482
|
+
async function O() {
|
|
1493
1483
|
return await a.url("/tallies").get().json();
|
|
1494
1484
|
}
|
|
1495
|
-
async function
|
|
1496
|
-
const
|
|
1497
|
-
return re(),
|
|
1485
|
+
async function x(S) {
|
|
1486
|
+
const I = await a.url(`/tallies/${S}`).delete().res();
|
|
1487
|
+
return re(), I.ok;
|
|
1488
|
+
}
|
|
1489
|
+
async function R(S, I) {
|
|
1490
|
+
return await a.url(`/tallies/${S}/push`).post(I).json();
|
|
1498
1491
|
}
|
|
1499
|
-
async function
|
|
1500
|
-
return await
|
|
1492
|
+
async function L(S) {
|
|
1493
|
+
return await o.url(`/products/${S}`).get().json();
|
|
1501
1494
|
}
|
|
1502
|
-
async function
|
|
1503
|
-
return await o.url(
|
|
1495
|
+
async function H() {
|
|
1496
|
+
return await o.url("/profile").get().json();
|
|
1504
1497
|
}
|
|
1505
|
-
async function
|
|
1506
|
-
|
|
1507
|
-
|
|
1498
|
+
async function A() {
|
|
1499
|
+
return await o.url("/payment-issues").get().json();
|
|
1500
|
+
}
|
|
1501
|
+
async function D(S) {
|
|
1502
|
+
const I = await o.url(`/products/${S}/auto-onboard`).post().json();
|
|
1503
|
+
return I.length && re(), I;
|
|
1508
1504
|
}
|
|
1509
1505
|
return {
|
|
1510
1506
|
getEntitlements: s,
|
|
@@ -1512,64 +1508,66 @@ function Si(t) {
|
|
|
1512
1508
|
getEntitlementAccess: p,
|
|
1513
1509
|
getContracts: u,
|
|
1514
1510
|
getContract: c,
|
|
1511
|
+
getProfile: H,
|
|
1515
1512
|
getSubscriptions: f,
|
|
1516
1513
|
getBills: d,
|
|
1517
1514
|
getBill: w,
|
|
1518
|
-
setUserMetadata:
|
|
1515
|
+
setUserMetadata: k,
|
|
1519
1516
|
deleteUserMetadata: v,
|
|
1520
1517
|
getUserMetadata: E,
|
|
1521
|
-
listUserMetadata:
|
|
1518
|
+
listUserMetadata: _,
|
|
1522
1519
|
getTags: g,
|
|
1523
1520
|
deleteTag: l,
|
|
1524
1521
|
setTag: b,
|
|
1525
|
-
getTally:
|
|
1526
|
-
getTallies:
|
|
1527
|
-
deleteTally:
|
|
1528
|
-
pushTally:
|
|
1529
|
-
getProduct:
|
|
1530
|
-
|
|
1522
|
+
getTally: T,
|
|
1523
|
+
getTallies: O,
|
|
1524
|
+
deleteTally: x,
|
|
1525
|
+
pushTally: R,
|
|
1526
|
+
getProduct: L,
|
|
1527
|
+
getPaymentIssues: A,
|
|
1528
|
+
autoOnboardProduct: D
|
|
1531
1529
|
};
|
|
1532
1530
|
}
|
|
1533
|
-
const
|
|
1534
|
-
function
|
|
1531
|
+
const er = "@sesamy/sesamy-js", zt = "1.3.2";
|
|
1532
|
+
function nn(t, e, n, r, i) {
|
|
1535
1533
|
for (e = e.split ? e.split(".") : e, r = 0; r < e.length; r++)
|
|
1536
1534
|
t = t ? t[e[r]] : i;
|
|
1537
1535
|
return t === i ? n : t;
|
|
1538
1536
|
}
|
|
1539
|
-
var Je = "undefined",
|
|
1540
|
-
},
|
|
1537
|
+
var Je = "undefined", rn = "object", Tt = function() {
|
|
1538
|
+
}, tr = "any", nr = "*", ve = "__", tt = typeof process < "u" ? process : {};
|
|
1541
1539
|
tt.env && tt.env.NODE_ENV;
|
|
1542
1540
|
var J = typeof document < "u";
|
|
1543
1541
|
tt.versions != null && tt.versions.node != null;
|
|
1544
1542
|
typeof Deno < "u" && Deno.core;
|
|
1545
1543
|
J && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
|
|
1546
|
-
function
|
|
1544
|
+
function rr(t, e) {
|
|
1547
1545
|
return e.charAt(0)[t]() + e.slice(1);
|
|
1548
1546
|
}
|
|
1549
|
-
var _i =
|
|
1547
|
+
var _i = rr.bind(null, "toUpperCase"), Ei = rr.bind(null, "toLowerCase");
|
|
1550
1548
|
function Ti(t) {
|
|
1551
|
-
return
|
|
1549
|
+
return ir(t) ? _i("null") : typeof t == "object" ? Ci(t) : Object.prototype.toString.call(t).slice(8, -1);
|
|
1552
1550
|
}
|
|
1553
1551
|
function nt(t, e) {
|
|
1554
1552
|
e === void 0 && (e = !0);
|
|
1555
1553
|
var n = Ti(t);
|
|
1556
1554
|
return e ? Ei(n) : n;
|
|
1557
1555
|
}
|
|
1558
|
-
function
|
|
1556
|
+
function We(t, e) {
|
|
1559
1557
|
return typeof e === t;
|
|
1560
1558
|
}
|
|
1561
|
-
var
|
|
1562
|
-
|
|
1563
|
-
function
|
|
1559
|
+
var Y = We.bind(null, "function"), se = We.bind(null, "string"), Se = We.bind(null, "undefined"), Pi = We.bind(null, "boolean");
|
|
1560
|
+
We.bind(null, "symbol");
|
|
1561
|
+
function ir(t) {
|
|
1564
1562
|
return t === null;
|
|
1565
1563
|
}
|
|
1566
|
-
function
|
|
1564
|
+
function Oi(t) {
|
|
1567
1565
|
return nt(t) === "number" && !isNaN(t);
|
|
1568
1566
|
}
|
|
1569
|
-
function
|
|
1567
|
+
function or(t) {
|
|
1570
1568
|
return nt(t) === "array";
|
|
1571
1569
|
}
|
|
1572
|
-
function
|
|
1570
|
+
function V(t) {
|
|
1573
1571
|
if (!ji(t))
|
|
1574
1572
|
return !1;
|
|
1575
1573
|
for (var e = t; Object.getPrototypeOf(e) !== null; )
|
|
@@ -1580,13 +1578,13 @@ function ji(t) {
|
|
|
1580
1578
|
return t && (typeof t == "object" || t !== null);
|
|
1581
1579
|
}
|
|
1582
1580
|
function Ci(t) {
|
|
1583
|
-
return
|
|
1581
|
+
return Y(t.constructor) ? t.constructor.name : null;
|
|
1584
1582
|
}
|
|
1585
1583
|
function xi(t) {
|
|
1586
|
-
return t instanceof Error ||
|
|
1584
|
+
return t instanceof Error || se(t.message) && t.constructor && Oi(t.constructor.stackTraceLimit);
|
|
1587
1585
|
}
|
|
1588
|
-
function
|
|
1589
|
-
if (typeof e != "object" ||
|
|
1586
|
+
function ar(t, e) {
|
|
1587
|
+
if (typeof e != "object" || ir(e))
|
|
1590
1588
|
return !1;
|
|
1591
1589
|
if (e instanceof t)
|
|
1592
1590
|
return !0;
|
|
@@ -1599,8 +1597,8 @@ function or(t, e) {
|
|
|
1599
1597
|
}
|
|
1600
1598
|
return !1;
|
|
1601
1599
|
}
|
|
1602
|
-
|
|
1603
|
-
|
|
1600
|
+
ar.bind(null, TypeError);
|
|
1601
|
+
ar.bind(null, SyntaxError);
|
|
1604
1602
|
function ot(t, e) {
|
|
1605
1603
|
var n = t instanceof Element || t instanceof HTMLDocument;
|
|
1606
1604
|
return n && e ? Ai(t, e) : n;
|
|
@@ -1619,9 +1617,9 @@ at(ot, "button");
|
|
|
1619
1617
|
at(ot, "input");
|
|
1620
1618
|
at(ot, "select");
|
|
1621
1619
|
function $i(t) {
|
|
1622
|
-
return t ?
|
|
1620
|
+
return t ? or(t) ? t : [t] : [];
|
|
1623
1621
|
}
|
|
1624
|
-
function
|
|
1622
|
+
function on(t) {
|
|
1625
1623
|
try {
|
|
1626
1624
|
return decodeURIComponent(t.replace(/\+/g, " "));
|
|
1627
1625
|
} catch {
|
|
@@ -1643,7 +1641,7 @@ function zi() {
|
|
|
1643
1641
|
function Di(t) {
|
|
1644
1642
|
return function(e) {
|
|
1645
1643
|
for (var n, r = /* @__PURE__ */ Object.create(null), i = /([^&=]+)=?([^&]*)/g; n = i.exec(e); ) {
|
|
1646
|
-
var o =
|
|
1644
|
+
var o = on(n[1]), a = on(n[2]);
|
|
1647
1645
|
o.substring(o.length - 2) === "[]" ? (r[o = o.substring(0, o.length - 2)] || (r[o] = [])).push(a) : r[o] = a === "" || a;
|
|
1648
1646
|
}
|
|
1649
1647
|
for (var s in r) {
|
|
@@ -1688,20 +1686,20 @@ function Ri(t, e) {
|
|
|
1688
1686
|
return n = this, r = arguments, p <= 0 ? (clearTimeout(o), o = null, a = h, i = t.apply(n, r)) : o || (o = setTimeout(s, p)), i;
|
|
1689
1687
|
};
|
|
1690
1688
|
}
|
|
1691
|
-
var Re = "global",
|
|
1692
|
-
function
|
|
1693
|
-
return je
|
|
1689
|
+
var Re = "global", je = ve + "global" + ve, Ce = typeof self === rn && self.self === self && self || typeof global === rn && global.global === global && global || void 0;
|
|
1690
|
+
function we(t) {
|
|
1691
|
+
return Ce[je][t];
|
|
1694
1692
|
}
|
|
1695
|
-
function
|
|
1696
|
-
return je
|
|
1693
|
+
function be(t, e) {
|
|
1694
|
+
return Ce[je][t] = e;
|
|
1697
1695
|
}
|
|
1698
|
-
function
|
|
1699
|
-
delete je
|
|
1696
|
+
function Ae(t) {
|
|
1697
|
+
delete Ce[je][t];
|
|
1700
1698
|
}
|
|
1701
|
-
function
|
|
1699
|
+
function $e(t, e, n) {
|
|
1702
1700
|
var r;
|
|
1703
1701
|
try {
|
|
1704
|
-
if (
|
|
1702
|
+
if (Dt(t)) {
|
|
1705
1703
|
var i = window[t];
|
|
1706
1704
|
r = i[e].bind(i);
|
|
1707
1705
|
}
|
|
@@ -1709,9 +1707,9 @@ function Ae(t, e, n) {
|
|
|
1709
1707
|
}
|
|
1710
1708
|
return r || n;
|
|
1711
1709
|
}
|
|
1712
|
-
je
|
|
1710
|
+
Ce[je] || (Ce[je] = {});
|
|
1713
1711
|
var Xe = {};
|
|
1714
|
-
function
|
|
1712
|
+
function Dt(t) {
|
|
1715
1713
|
if (typeof Xe[t] !== Je)
|
|
1716
1714
|
return Xe[t];
|
|
1717
1715
|
try {
|
|
@@ -1722,27 +1720,27 @@ function Ut(t) {
|
|
|
1722
1720
|
}
|
|
1723
1721
|
return Xe[t] = !0;
|
|
1724
1722
|
}
|
|
1725
|
-
function
|
|
1726
|
-
return
|
|
1723
|
+
function C() {
|
|
1724
|
+
return C = Object.assign || function(t) {
|
|
1727
1725
|
for (var e = 1; e < arguments.length; e++) {
|
|
1728
1726
|
var n = arguments[e];
|
|
1729
1727
|
for (var r in n)
|
|
1730
1728
|
Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
|
|
1731
1729
|
}
|
|
1732
1730
|
return t;
|
|
1733
|
-
},
|
|
1731
|
+
}, C.apply(this, arguments);
|
|
1734
1732
|
}
|
|
1735
|
-
var
|
|
1736
|
-
return typeof Symbol ===
|
|
1737
|
-
}(), Ve = " != " +
|
|
1738
|
-
function
|
|
1733
|
+
var ae = "function", ie = "undefined", Li = "@@redux/" + Math.random().toString(36), an = /* @__PURE__ */ function() {
|
|
1734
|
+
return typeof Symbol === ae && Symbol.observable || "@@observable";
|
|
1735
|
+
}(), Ve = " != " + ae;
|
|
1736
|
+
function sr(t, e, n) {
|
|
1739
1737
|
var r;
|
|
1740
|
-
if (typeof e ===
|
|
1741
|
-
if (typeof n !==
|
|
1738
|
+
if (typeof e === ae && typeof n === ie && (n = e, e = void 0), typeof n !== ie) {
|
|
1739
|
+
if (typeof n !== ae)
|
|
1742
1740
|
throw new Error("enhancer" + Ve);
|
|
1743
|
-
return n(
|
|
1741
|
+
return n(sr)(t, e);
|
|
1744
1742
|
}
|
|
1745
|
-
if (typeof t !==
|
|
1743
|
+
if (typeof t !== ae)
|
|
1746
1744
|
throw new Error("reducer" + Ve);
|
|
1747
1745
|
var i = t, o = e, a = [], s = a, h = !1;
|
|
1748
1746
|
function p() {
|
|
@@ -1752,22 +1750,22 @@ function ar(t, e, n) {
|
|
|
1752
1750
|
return o;
|
|
1753
1751
|
}
|
|
1754
1752
|
function c(d) {
|
|
1755
|
-
if (typeof d !==
|
|
1753
|
+
if (typeof d !== ae)
|
|
1756
1754
|
throw new Error("Listener" + Ve);
|
|
1757
1755
|
var w = !0;
|
|
1758
1756
|
return p(), s.push(d), function() {
|
|
1759
1757
|
if (w) {
|
|
1760
1758
|
w = !1, p();
|
|
1761
|
-
var
|
|
1762
|
-
s.splice(
|
|
1759
|
+
var k = s.indexOf(d);
|
|
1760
|
+
s.splice(k, 1);
|
|
1763
1761
|
}
|
|
1764
1762
|
};
|
|
1765
1763
|
}
|
|
1766
1764
|
function f(d) {
|
|
1767
|
-
if (!
|
|
1765
|
+
if (!V(d))
|
|
1768
1766
|
throw new Error("Act != obj");
|
|
1769
|
-
if (typeof d.type ===
|
|
1770
|
-
throw new Error("ActType " +
|
|
1767
|
+
if (typeof d.type === ie)
|
|
1768
|
+
throw new Error("ActType " + ie);
|
|
1771
1769
|
if (h)
|
|
1772
1770
|
throw new Error("Dispatch in reducer");
|
|
1773
1771
|
try {
|
|
@@ -1775,33 +1773,33 @@ function ar(t, e, n) {
|
|
|
1775
1773
|
} finally {
|
|
1776
1774
|
h = !1;
|
|
1777
1775
|
}
|
|
1778
|
-
for (var w = a = s,
|
|
1779
|
-
(0, w[
|
|
1776
|
+
for (var w = a = s, k = 0; k < w.length; k++)
|
|
1777
|
+
(0, w[k])();
|
|
1780
1778
|
return d;
|
|
1781
1779
|
}
|
|
1782
1780
|
return f({ type: "@@redux/INIT" }), (r = { dispatch: f, subscribe: c, getState: u, replaceReducer: function(d) {
|
|
1783
|
-
if (typeof d !==
|
|
1781
|
+
if (typeof d !== ae)
|
|
1784
1782
|
throw new Error("next reducer" + Ve);
|
|
1785
1783
|
i = d, f({ type: "@@redux/INIT" });
|
|
1786
|
-
} })[
|
|
1784
|
+
} })[an] = function() {
|
|
1787
1785
|
var d, w = c;
|
|
1788
|
-
return (d = { subscribe: function(
|
|
1789
|
-
if (typeof
|
|
1786
|
+
return (d = { subscribe: function(k) {
|
|
1787
|
+
if (typeof k != "object")
|
|
1790
1788
|
throw new TypeError("Observer != obj");
|
|
1791
1789
|
function v() {
|
|
1792
|
-
|
|
1790
|
+
k.next && k.next(u());
|
|
1793
1791
|
}
|
|
1794
1792
|
return v(), { unsubscribe: w(v) };
|
|
1795
|
-
} })[
|
|
1793
|
+
} })[an] = function() {
|
|
1796
1794
|
return this;
|
|
1797
1795
|
}, d;
|
|
1798
1796
|
}, r;
|
|
1799
1797
|
}
|
|
1800
1798
|
function Mi(t, e) {
|
|
1801
1799
|
var n = e && e.type;
|
|
1802
|
-
return "action " + (n && n.toString() || "?") + "reducer " + t + " returns " +
|
|
1800
|
+
return "action " + (n && n.toString() || "?") + "reducer " + t + " returns " + ie;
|
|
1803
1801
|
}
|
|
1804
|
-
function
|
|
1802
|
+
function xe() {
|
|
1805
1803
|
var t = [].slice.call(arguments);
|
|
1806
1804
|
return t.length === 0 ? function(e) {
|
|
1807
1805
|
return e;
|
|
@@ -1820,39 +1818,39 @@ function Zi() {
|
|
|
1820
1818
|
} };
|
|
1821
1819
|
return o = [].slice.call(t).map(function(p) {
|
|
1822
1820
|
return p(h);
|
|
1823
|
-
}),
|
|
1821
|
+
}), C({}, a, { dispatch: s = xe.apply(void 0, o)(a.dispatch) });
|
|
1824
1822
|
};
|
|
1825
1823
|
};
|
|
1826
1824
|
}
|
|
1827
|
-
var
|
|
1825
|
+
var ce = ve + "anon_id", ye = ve + "user_id", Ee = ve + "user_traits", oe = "userId", _e = "anonymousId", et = ["bootstrap", "params", "campaign", "initializeStart", "initialize", "initializeEnd", "ready", "resetStart", "reset", "resetEnd", "pageStart", "page", "pageEnd", "pageAborted", "trackStart", "track", "trackEnd", "trackAborted", "identifyStart", "identify", "identifyEnd", "identifyAborted", "userIdChanged", "registerPlugins", "enablePlugin", "disablePlugin", "online", "offline", "setItemStart", "setItem", "setItemEnd", "setItemAborted", "removeItemStart", "removeItem", "removeItemEnd", "removeItemAborted"], Pt = ["name", "EVENTS", "config", "loaded"], j = et.reduce(function(t, e) {
|
|
1828
1826
|
return t[e] = e, t;
|
|
1829
1827
|
}, { registerPluginType: function(t) {
|
|
1830
1828
|
return "registerPlugin:" + t;
|
|
1831
1829
|
}, pluginReadyType: function(t) {
|
|
1832
1830
|
return "ready:" + t;
|
|
1833
|
-
} }),
|
|
1834
|
-
function
|
|
1831
|
+
} }), sn = /^utm_/, cn = /^an_prop_/, un = /^an_trait_/;
|
|
1832
|
+
function Ki(t) {
|
|
1835
1833
|
var e = t.storage.setItem;
|
|
1836
1834
|
return function(n) {
|
|
1837
1835
|
return function(r) {
|
|
1838
1836
|
return function(i) {
|
|
1839
|
-
if (i.type ===
|
|
1837
|
+
if (i.type === j.bootstrap) {
|
|
1840
1838
|
var o = i.params, a = i.user, s = i.persistedUser, h = i.initialUser, p = s.userId === a.userId;
|
|
1841
|
-
s.anonymousId !== a.anonymousId && e(
|
|
1839
|
+
s.anonymousId !== a.anonymousId && e(ce, a.anonymousId), p || e(ye, a.userId), h.traits && e(Ee, C({}, p && s.traits ? s.traits : {}, h.traits));
|
|
1842
1840
|
var u = Object.keys(i.params);
|
|
1843
1841
|
if (u.length) {
|
|
1844
|
-
var c = o.an_uid, f = o.an_event, d = u.reduce(function(w,
|
|
1845
|
-
if (
|
|
1846
|
-
var v =
|
|
1847
|
-
w.campaign[v === "campaign" ? "name" : v] = o[
|
|
1842
|
+
var c = o.an_uid, f = o.an_event, d = u.reduce(function(w, k) {
|
|
1843
|
+
if (k.match(sn) || k.match(/^(d|g)clid/)) {
|
|
1844
|
+
var v = k.replace(sn, "");
|
|
1845
|
+
w.campaign[v === "campaign" ? "name" : v] = o[k];
|
|
1848
1846
|
}
|
|
1849
|
-
return
|
|
1847
|
+
return k.match(cn) && (w.props[k.replace(cn, "")] = o[k]), k.match(un) && (w.traits[k.replace(un, "")] = o[k]), w;
|
|
1850
1848
|
}, { campaign: {}, props: {}, traits: {} });
|
|
1851
|
-
n.dispatch(
|
|
1849
|
+
n.dispatch(C({ type: j.params, raw: o }, d, c ? { userId: c } : {})), c && setTimeout(function() {
|
|
1852
1850
|
return t.identify(c, d.traits);
|
|
1853
1851
|
}, 0), f && setTimeout(function() {
|
|
1854
1852
|
return t.track(f, d.props);
|
|
1855
|
-
}, 0), Object.keys(d.campaign).length && n.dispatch({ type:
|
|
1853
|
+
}, 0), Object.keys(d.campaign).length && n.dispatch({ type: j.campaign, campaign: d.campaign });
|
|
1856
1854
|
}
|
|
1857
1855
|
}
|
|
1858
1856
|
return r(i);
|
|
@@ -1860,19 +1858,19 @@ function Wi(t) {
|
|
|
1860
1858
|
};
|
|
1861
1859
|
};
|
|
1862
1860
|
}
|
|
1863
|
-
function
|
|
1861
|
+
function Wi(t) {
|
|
1864
1862
|
return function(e, n) {
|
|
1865
|
-
if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type ===
|
|
1866
|
-
if (n.key ===
|
|
1867
|
-
return
|
|
1868
|
-
if (n.key ===
|
|
1869
|
-
return
|
|
1863
|
+
if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === j.setItemEnd) {
|
|
1864
|
+
if (n.key === ce)
|
|
1865
|
+
return C({}, e, { anonymousId: n.value });
|
|
1866
|
+
if (n.key === ye)
|
|
1867
|
+
return C({}, e, { userId: n.value });
|
|
1870
1868
|
}
|
|
1871
1869
|
switch (n.type) {
|
|
1872
|
-
case
|
|
1873
|
-
return Object.assign({}, e, { userId: n.userId, traits:
|
|
1874
|
-
case
|
|
1875
|
-
return [
|
|
1870
|
+
case j.identify:
|
|
1871
|
+
return Object.assign({}, e, { userId: n.userId, traits: C({}, e.traits, n.traits) });
|
|
1872
|
+
case j.reset:
|
|
1873
|
+
return [ye, ce, Ee].forEach(function(r) {
|
|
1876
1874
|
t.removeItem(r);
|
|
1877
1875
|
}), Object.assign({}, e, { userId: null, anonymousId: null, traits: {} });
|
|
1878
1876
|
default:
|
|
@@ -1880,26 +1878,26 @@ function Ki(t) {
|
|
|
1880
1878
|
}
|
|
1881
1879
|
};
|
|
1882
1880
|
}
|
|
1883
|
-
function
|
|
1884
|
-
return { userId: t.getItem(
|
|
1881
|
+
function ln(t) {
|
|
1882
|
+
return { userId: t.getItem(ye), anonymousId: t.getItem(ce), traits: t.getItem(Ee) };
|
|
1885
1883
|
}
|
|
1886
|
-
var
|
|
1887
|
-
return
|
|
1884
|
+
var Ot = function(t) {
|
|
1885
|
+
return ve + "TEMP" + ve + t;
|
|
1888
1886
|
};
|
|
1889
|
-
function
|
|
1887
|
+
function Hi(t) {
|
|
1890
1888
|
var e = t.storage, n = e.setItem, r = e.removeItem, i = e.getItem;
|
|
1891
1889
|
return function(o) {
|
|
1892
1890
|
return function(a) {
|
|
1893
1891
|
return function(s) {
|
|
1894
1892
|
var h = s.userId, p = s.traits, u = s.options;
|
|
1895
|
-
if (s.type ===
|
|
1893
|
+
if (s.type === j.reset && ([ye, Ee, ce].forEach(function(d) {
|
|
1896
1894
|
r(d);
|
|
1897
|
-
}), [
|
|
1898
|
-
|
|
1899
|
-
})), s.type ===
|
|
1900
|
-
i(
|
|
1901
|
-
var c = i(
|
|
1902
|
-
c && c !== h && o.dispatch({ type:
|
|
1895
|
+
}), [oe, _e, "traits"].forEach(function(d) {
|
|
1896
|
+
Ae(Ot(d));
|
|
1897
|
+
})), s.type === j.identify) {
|
|
1898
|
+
i(ce) || n(ce, st());
|
|
1899
|
+
var c = i(ye), f = i(Ee) || {};
|
|
1900
|
+
c && c !== h && o.dispatch({ type: j.userIdChanged, old: { userId: c, traits: f }, new: { userId: h, traits: p }, options: u }), h && n(ye, h), p && n(Ee, C({}, f, p));
|
|
1903
1901
|
}
|
|
1904
1902
|
return a(s);
|
|
1905
1903
|
};
|
|
@@ -1907,22 +1905,22 @@ function Fi(t) {
|
|
|
1907
1905
|
};
|
|
1908
1906
|
}
|
|
1909
1907
|
var Ue = {};
|
|
1910
|
-
function
|
|
1911
|
-
Ue[t] &&
|
|
1908
|
+
function dn(t, e) {
|
|
1909
|
+
Ue[t] && Y(Ue[t]) && (Ue[t](e), delete Ue[t]);
|
|
1912
1910
|
}
|
|
1913
|
-
function
|
|
1911
|
+
function cr(t, e, n) {
|
|
1914
1912
|
return new Promise(function(r, i) {
|
|
1915
|
-
return e() ? r(t) : n < 1 ? i(
|
|
1913
|
+
return e() ? r(t) : n < 1 ? i(C({}, t, { queue: !0 })) : new Promise(function(o) {
|
|
1916
1914
|
return setTimeout(o, 10);
|
|
1917
1915
|
}).then(function(o) {
|
|
1918
|
-
return
|
|
1916
|
+
return cr(t, e, n - 10).then(r, i);
|
|
1919
1917
|
});
|
|
1920
1918
|
});
|
|
1921
1919
|
}
|
|
1922
|
-
function
|
|
1920
|
+
function Fi(t) {
|
|
1923
1921
|
return { abort: t };
|
|
1924
1922
|
}
|
|
1925
|
-
function
|
|
1923
|
+
function ur(t, e, n) {
|
|
1926
1924
|
var r = {}, i = e(), o = t.getState(), a = o.plugins, s = o.queue, h = o.user;
|
|
1927
1925
|
if (!o.context.offline && s && s.actions && s.actions.length) {
|
|
1928
1926
|
var p = s.actions.reduce(function(c, f, d) {
|
|
@@ -1930,18 +1928,18 @@ function cr(t, e, n) {
|
|
|
1930
1928
|
}, { processIndex: [], process: [], requeue: [], requeueIndex: [] });
|
|
1931
1929
|
if (p.processIndex && p.processIndex.length) {
|
|
1932
1930
|
p.processIndex.forEach(function(c) {
|
|
1933
|
-
var f = s.actions[c], d = f.plugin, w = f.payload.type,
|
|
1934
|
-
if (
|
|
1931
|
+
var f = s.actions[c], d = f.plugin, w = f.payload.type, k = i[d][w];
|
|
1932
|
+
if (k && Y(k)) {
|
|
1935
1933
|
var v, E = function(l, b) {
|
|
1936
|
-
return l === void 0 && (l = {}), b === void 0 && (b = {}), [
|
|
1937
|
-
return l.hasOwnProperty(
|
|
1934
|
+
return l === void 0 && (l = {}), b === void 0 && (b = {}), [oe, _e].reduce(function(T, O) {
|
|
1935
|
+
return l.hasOwnProperty(O) && b[O] && b[O] !== l[O] && (T[O] = b[O]), T;
|
|
1938
1936
|
}, l);
|
|
1939
|
-
}(f.payload, h),
|
|
1940
|
-
if (!
|
|
1937
|
+
}(f.payload, h), _ = r[E.meta.rid];
|
|
1938
|
+
if (!_ && (v = k({ payload: E, config: a[d].config, instance: n, abort: Fi })) && V(v) && v.abort)
|
|
1941
1939
|
return void (r[E.meta.rid] = !0);
|
|
1942
|
-
if (!
|
|
1940
|
+
if (!_) {
|
|
1943
1941
|
var g = w + ":" + d;
|
|
1944
|
-
t.dispatch(
|
|
1942
|
+
t.dispatch(C({}, E, { type: g, _: { called: g, from: "queueDrain" } }));
|
|
1945
1943
|
}
|
|
1946
1944
|
}
|
|
1947
1945
|
});
|
|
@@ -1955,107 +1953,107 @@ function cr(t, e, n) {
|
|
|
1955
1953
|
var mt = function(t) {
|
|
1956
1954
|
var e = t.data, n = t.action, r = t.instance, i = t.state, o = t.allPlugins, a = t.allMatches, s = t.store, h = t.EVENTS;
|
|
1957
1955
|
try {
|
|
1958
|
-
var p = i.plugins, u = i.context, c = n.type, f = c.match(
|
|
1956
|
+
var p = i.plugins, u = i.context, c = n.type, f = c.match(Te), d = e.exact.map(function(v) {
|
|
1959
1957
|
return v.pluginName;
|
|
1960
1958
|
});
|
|
1961
1959
|
f && (d = a.during.map(function(v) {
|
|
1962
1960
|
return v.pluginName;
|
|
1963
1961
|
}));
|
|
1964
1962
|
var w = /* @__PURE__ */ function(v, E) {
|
|
1965
|
-
return function(
|
|
1966
|
-
var b = g.config,
|
|
1967
|
-
l && (
|
|
1968
|
-
var
|
|
1969
|
-
return function(
|
|
1970
|
-
var
|
|
1971
|
-
if (
|
|
1972
|
-
throw new Error("Method " +
|
|
1973
|
-
return
|
|
1963
|
+
return function(_, g, l) {
|
|
1964
|
+
var b = g.config, T = g.name, O = T + "." + _.type;
|
|
1965
|
+
l && (O = l.event);
|
|
1966
|
+
var x = _.type.match(Te) ? /* @__PURE__ */ function(R, L, H, A, D) {
|
|
1967
|
+
return function(S, I) {
|
|
1968
|
+
var N = A ? A.name : R, K = I && Ke(I) ? I : H;
|
|
1969
|
+
if (A && (!(K = I && Ke(I) ? I : [R]).includes(R) || K.length !== 1))
|
|
1970
|
+
throw new Error("Method " + L + " can only abort " + R + " plugin. " + JSON.stringify(K) + " input valid");
|
|
1971
|
+
return C({}, D, { abort: { reason: S, plugins: K, caller: L, _: N } });
|
|
1974
1972
|
};
|
|
1975
|
-
}(
|
|
1973
|
+
}(T, O, E, l, _) : /* @__PURE__ */ function(R, L) {
|
|
1976
1974
|
return function() {
|
|
1977
|
-
throw new Error(
|
|
1975
|
+
throw new Error(R.type + " action not cancellable. Remove abort in " + L);
|
|
1978
1976
|
};
|
|
1979
|
-
}(
|
|
1980
|
-
return { payload: Ji(
|
|
1977
|
+
}(_, O);
|
|
1978
|
+
return { payload: Ji(_), instance: v, config: b || {}, abort: x };
|
|
1981
1979
|
};
|
|
1982
|
-
}(r, d),
|
|
1983
|
-
var
|
|
1984
|
-
return g.match(/^initialize/) || g.match(/^reset/) || (l = !p[
|
|
1980
|
+
}(r, d), k = e.exact.reduce(function(v, E) {
|
|
1981
|
+
var _ = E.pluginName, g = E.methodName, l = !1;
|
|
1982
|
+
return g.match(/^initialize/) || g.match(/^reset/) || (l = !p[_].loaded), u.offline && g.match(/^(page|track|identify)/) && (l = !0), v["" + _] = l, v;
|
|
1985
1983
|
}, {});
|
|
1986
|
-
return Promise.resolve(e.exact.reduce(function(v, E,
|
|
1984
|
+
return Promise.resolve(e.exact.reduce(function(v, E, _) {
|
|
1987
1985
|
try {
|
|
1988
1986
|
var g = E.pluginName;
|
|
1989
1987
|
return Promise.resolve(v).then(function(l) {
|
|
1990
1988
|
function b() {
|
|
1991
1989
|
return Promise.resolve(l);
|
|
1992
1990
|
}
|
|
1993
|
-
var
|
|
1991
|
+
var T = function() {
|
|
1994
1992
|
if (e.namespaced && e.namespaced[g])
|
|
1995
|
-
return Promise.resolve(e.namespaced[g].reduce(function(
|
|
1993
|
+
return Promise.resolve(e.namespaced[g].reduce(function(O, x, R) {
|
|
1996
1994
|
try {
|
|
1997
|
-
return Promise.resolve(
|
|
1998
|
-
return
|
|
1999
|
-
var
|
|
2000
|
-
if (
|
|
2001
|
-
var K =
|
|
2002
|
-
throw new Error([
|
|
1995
|
+
return Promise.resolve(O).then(function(L) {
|
|
1996
|
+
return x.method && Y(x.method) ? (function(S, I) {
|
|
1997
|
+
var N = vn(S);
|
|
1998
|
+
if (N && N.name === I) {
|
|
1999
|
+
var K = vn(N.method);
|
|
2000
|
+
throw new Error([I + " plugin is calling method " + S, "Plugins cant call self", "Use " + N.method + " " + (K ? "or " + K.method : "") + " in " + I + " plugin insteadof " + S].join(`
|
|
2003
2001
|
`));
|
|
2004
2002
|
}
|
|
2005
|
-
}(
|
|
2006
|
-
return
|
|
2007
|
-
}), config:
|
|
2008
|
-
var
|
|
2009
|
-
return Promise.resolve(
|
|
2010
|
-
})) :
|
|
2011
|
-
var
|
|
2003
|
+
}(x.methodName, x.pluginName), Promise.resolve(x.method({ payload: L, instance: r, abort: (H = L, A = g, D = x.pluginName, function(S, I) {
|
|
2004
|
+
return C({}, H, { abort: { reason: S, plugins: I || [A], caller: c, from: D || A } });
|
|
2005
|
+
}), config: pn(x.pluginName, p, o), plugins: p })).then(function(S) {
|
|
2006
|
+
var I = V(S) ? S : {};
|
|
2007
|
+
return Promise.resolve(C({}, L, I));
|
|
2008
|
+
})) : L;
|
|
2009
|
+
var H, A, D;
|
|
2012
2010
|
});
|
|
2013
|
-
} catch (
|
|
2014
|
-
return Promise.reject(
|
|
2011
|
+
} catch (L) {
|
|
2012
|
+
return Promise.reject(L);
|
|
2015
2013
|
}
|
|
2016
|
-
}, Promise.resolve(n))).then(function(
|
|
2017
|
-
l[g] =
|
|
2014
|
+
}, Promise.resolve(n))).then(function(O) {
|
|
2015
|
+
l[g] = O;
|
|
2018
2016
|
});
|
|
2019
2017
|
l[g] = n;
|
|
2020
2018
|
}();
|
|
2021
|
-
return
|
|
2019
|
+
return T && T.then ? T.then(b) : b();
|
|
2022
2020
|
});
|
|
2023
2021
|
} catch (l) {
|
|
2024
2022
|
return Promise.reject(l);
|
|
2025
2023
|
}
|
|
2026
2024
|
}, Promise.resolve({}))).then(function(v) {
|
|
2027
|
-
return Promise.resolve(e.exact.reduce(function(E,
|
|
2025
|
+
return Promise.resolve(e.exact.reduce(function(E, _, g) {
|
|
2028
2026
|
try {
|
|
2029
|
-
var l = e.exact.length === g + 1, b =
|
|
2030
|
-
return Promise.resolve(E).then(function(
|
|
2031
|
-
var
|
|
2032
|
-
if (f && (
|
|
2033
|
-
return gt({ data:
|
|
2034
|
-
if (yt(
|
|
2035
|
-
return l && gt({ data:
|
|
2036
|
-
if (
|
|
2037
|
-
return s.dispatch({ type: "queue", plugin: b, payload:
|
|
2038
|
-
var
|
|
2039
|
-
return Promise.resolve(
|
|
2040
|
-
var
|
|
2041
|
-
if (yt(
|
|
2042
|
-
gt({ data:
|
|
2027
|
+
var l = e.exact.length === g + 1, b = _.pluginName, T = o[b];
|
|
2028
|
+
return Promise.resolve(E).then(function(O) {
|
|
2029
|
+
var x = v[b] ? v[b] : {};
|
|
2030
|
+
if (f && (x = O), yt(x, b))
|
|
2031
|
+
return gt({ data: x, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(O);
|
|
2032
|
+
if (yt(O, b))
|
|
2033
|
+
return l && gt({ data: O, method: c, instance: r, store: s }), Promise.resolve(O);
|
|
2034
|
+
if (k.hasOwnProperty(b) && k[b] === !0)
|
|
2035
|
+
return s.dispatch({ type: "queue", plugin: b, payload: x, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(O);
|
|
2036
|
+
var R = w(v[b], o[b]);
|
|
2037
|
+
return Promise.resolve(T[c]({ abort: R.abort, payload: x, instance: r, config: pn(b, p, o), plugins: p })).then(function(L) {
|
|
2038
|
+
var H = V(L) ? L : {}, A = C({}, O, H), D = v[b];
|
|
2039
|
+
if (yt(D, b))
|
|
2040
|
+
gt({ data: D, method: c, instance: r, pluginName: b, store: s });
|
|
2043
2041
|
else {
|
|
2044
|
-
var
|
|
2045
|
-
(
|
|
2042
|
+
var S = c + ":" + b;
|
|
2043
|
+
(S.match(/:/g) || []).length < 2 && !c.match(hn) && !c.match(fn) && r.dispatch(C({}, f ? A : x, { type: S, _: { called: S, from: "submethod" } }));
|
|
2046
2044
|
}
|
|
2047
|
-
return Promise.resolve(
|
|
2045
|
+
return Promise.resolve(A);
|
|
2048
2046
|
});
|
|
2049
2047
|
});
|
|
2050
|
-
} catch (
|
|
2051
|
-
return Promise.reject(
|
|
2048
|
+
} catch (O) {
|
|
2049
|
+
return Promise.reject(O);
|
|
2052
2050
|
}
|
|
2053
2051
|
}, Promise.resolve(n))).then(function(E) {
|
|
2054
|
-
if (!(c.match(
|
|
2052
|
+
if (!(c.match(Te) || c.match(/^registerPlugin/) || c.match(fn) || c.match(hn) || c.match(/^params/) || c.match(/^userIdChanged/))) {
|
|
2055
2053
|
if (h.plugins.includes(c), E._ && E._.originalAction === c)
|
|
2056
2054
|
return E;
|
|
2057
|
-
var
|
|
2058
|
-
|
|
2055
|
+
var _ = C({}, E, { _: { originalAction: E.type, called: E.type, from: "engineEnd" } });
|
|
2056
|
+
lr(E, e.exact.length) && !c.match(/End$/) && (_ = C({}, _, { type: E.type + "Aborted" })), s.dispatch(_);
|
|
2059
2057
|
}
|
|
2060
2058
|
return E;
|
|
2061
2059
|
});
|
|
@@ -2063,50 +2061,50 @@ var mt = function(t) {
|
|
|
2063
2061
|
} catch (v) {
|
|
2064
2062
|
return Promise.reject(v);
|
|
2065
2063
|
}
|
|
2066
|
-
},
|
|
2064
|
+
}, Te = /Start$/, hn = /^bootstrap/, fn = /^ready/;
|
|
2067
2065
|
function gt(t) {
|
|
2068
2066
|
var e = t.pluginName, n = t.method + "Aborted" + (e ? ":" + e : "");
|
|
2069
|
-
t.store.dispatch(
|
|
2067
|
+
t.store.dispatch(C({}, t.data, { type: n, _: { called: n, from: "abort" } }));
|
|
2070
2068
|
}
|
|
2071
|
-
function
|
|
2069
|
+
function pn(t, e, n) {
|
|
2072
2070
|
var r = e[t] || n[t];
|
|
2073
2071
|
return r && r.config ? r.config : {};
|
|
2074
2072
|
}
|
|
2075
|
-
function
|
|
2073
|
+
function mn(t, e) {
|
|
2076
2074
|
return e.reduce(function(n, r) {
|
|
2077
2075
|
return r[t] ? n.concat({ methodName: t, pluginName: r.name, method: r[t] }) : n;
|
|
2078
2076
|
}, []);
|
|
2079
2077
|
}
|
|
2080
|
-
function
|
|
2081
|
-
var n = t.replace(
|
|
2078
|
+
function gn(t, e) {
|
|
2079
|
+
var n = t.replace(Te, ""), r = e ? ":" + e : "";
|
|
2082
2080
|
return ["" + t + r, "" + n + r, n + "End" + r];
|
|
2083
2081
|
}
|
|
2084
2082
|
function yt(t, e) {
|
|
2085
2083
|
var n = t.abort;
|
|
2086
|
-
return !!n && (n === !0 ||
|
|
2084
|
+
return !!n && (n === !0 || yn(n, e) || n && yn(n.plugins, e));
|
|
2087
2085
|
}
|
|
2088
|
-
function
|
|
2086
|
+
function lr(t, e) {
|
|
2089
2087
|
var n = t.abort;
|
|
2090
2088
|
if (!n)
|
|
2091
2089
|
return !1;
|
|
2092
|
-
if (n === !0 ||
|
|
2090
|
+
if (n === !0 || se(n))
|
|
2093
2091
|
return !0;
|
|
2094
2092
|
var r = n.plugins;
|
|
2095
|
-
return
|
|
2093
|
+
return Ke(n) && n.length === e || Ke(r) && r.length === e;
|
|
2096
2094
|
}
|
|
2097
|
-
function
|
|
2095
|
+
function Ke(t) {
|
|
2098
2096
|
return Array.isArray(t);
|
|
2099
2097
|
}
|
|
2100
|
-
function
|
|
2101
|
-
return !(!t || !
|
|
2098
|
+
function yn(t, e) {
|
|
2099
|
+
return !(!t || !Ke(t)) && t.includes(e);
|
|
2102
2100
|
}
|
|
2103
|
-
function
|
|
2101
|
+
function vn(t) {
|
|
2104
2102
|
var e = t.match(/(.*):(.*)/);
|
|
2105
2103
|
return !!e && { method: e[1], name: e[2] };
|
|
2106
2104
|
}
|
|
2107
2105
|
function Ji(t) {
|
|
2108
2106
|
return Object.keys(t).reduce(function(e, n) {
|
|
2109
|
-
return n === "type" || (e[n] =
|
|
2107
|
+
return n === "type" || (e[n] = V(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
|
|
2110
2108
|
}, {});
|
|
2111
2109
|
}
|
|
2112
2110
|
function Xi(t, e, n) {
|
|
@@ -2120,95 +2118,95 @@ function Xi(t, e, n) {
|
|
|
2120
2118
|
}, p = a.type, u = a.plugins, c = a;
|
|
2121
2119
|
if (a.abort)
|
|
2122
2120
|
return Promise.resolve(o(a));
|
|
2123
|
-
if (p ===
|
|
2124
|
-
return
|
|
2125
|
-
}, 0), p ===
|
|
2121
|
+
if (p === j.enablePlugin && i.dispatch({ type: j.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), p === j.disablePlugin && setTimeout(function() {
|
|
2122
|
+
return dn(a.meta.rid, { payload: a });
|
|
2123
|
+
}, 0), p === j.initializeEnd) {
|
|
2126
2124
|
var f = e(), d = Object.keys(f), w = d.filter(function(l) {
|
|
2127
2125
|
return u.includes(l);
|
|
2128
2126
|
}).map(function(l) {
|
|
2129
2127
|
return f[l];
|
|
2130
|
-
}),
|
|
2131
|
-
var b = l.loaded,
|
|
2132
|
-
return
|
|
2133
|
-
return b({ config:
|
|
2134
|
-
}, 1e4).then(function(
|
|
2135
|
-
return r[
|
|
2136
|
-
return !
|
|
2137
|
-
}) }), r[
|
|
2138
|
-
}).catch(function(
|
|
2139
|
-
if (
|
|
2140
|
-
throw new Error(
|
|
2141
|
-
return v = v.concat(
|
|
2128
|
+
}), k = [], v = [], E = a.disabled, _ = w.map(function(l) {
|
|
2129
|
+
var b = l.loaded, T = l.name, O = l.config;
|
|
2130
|
+
return cr(l, function() {
|
|
2131
|
+
return b({ config: O });
|
|
2132
|
+
}, 1e4).then(function(x) {
|
|
2133
|
+
return r[T] || (i.dispatch({ type: j.pluginReadyType(T), name: T, events: Object.keys(l).filter(function(R) {
|
|
2134
|
+
return !Pt.includes(R);
|
|
2135
|
+
}) }), r[T] = !0), k = k.concat(T), l;
|
|
2136
|
+
}).catch(function(x) {
|
|
2137
|
+
if (x instanceof Error)
|
|
2138
|
+
throw new Error(x);
|
|
2139
|
+
return v = v.concat(x.name), x;
|
|
2142
2140
|
});
|
|
2143
2141
|
});
|
|
2144
|
-
Promise.all(
|
|
2145
|
-
var b = { plugins:
|
|
2142
|
+
Promise.all(_).then(function(l) {
|
|
2143
|
+
var b = { plugins: k, failed: v, disabled: E };
|
|
2146
2144
|
setTimeout(function() {
|
|
2147
|
-
d.length ===
|
|
2145
|
+
d.length === _.length + E.length && i.dispatch(C({}, { type: j.ready }, b));
|
|
2148
2146
|
}, 0);
|
|
2149
2147
|
});
|
|
2150
2148
|
}
|
|
2151
2149
|
var g = function() {
|
|
2152
|
-
if (p !==
|
|
2150
|
+
if (p !== j.bootstrap)
|
|
2153
2151
|
return /^ready:([^:]*)$/.test(p) && setTimeout(function() {
|
|
2154
|
-
return
|
|
2155
|
-
}, 0), Promise.resolve(function(l, b,
|
|
2152
|
+
return ur(i, e, t);
|
|
2153
|
+
}, 0), Promise.resolve(function(l, b, T, O, x) {
|
|
2156
2154
|
try {
|
|
2157
|
-
var
|
|
2155
|
+
var R = Y(b) ? b() : b, L = l.type, H = L.replace(Te, "");
|
|
2158
2156
|
if (l._ && l._.called)
|
|
2159
2157
|
return Promise.resolve(l);
|
|
2160
|
-
var
|
|
2161
|
-
var y =
|
|
2162
|
-
return
|
|
2158
|
+
var A = T.getState(), D = (N = R, (K = A.plugins) === void 0 && (K = {}), (X = l.options) === void 0 && (X = {}), Object.keys(N).filter(function(m) {
|
|
2159
|
+
var y = X.plugins || {};
|
|
2160
|
+
return Pi(y[m]) ? y[m] : y.all !== !1 && (!K[m] || K[m].enabled !== !1);
|
|
2163
2161
|
}).map(function(m) {
|
|
2164
|
-
return
|
|
2162
|
+
return N[m];
|
|
2165
2163
|
}));
|
|
2166
|
-
|
|
2167
|
-
var y =
|
|
2164
|
+
L === j.initializeStart && l.fromEnable && (D = Object.keys(A.plugins).filter(function(m) {
|
|
2165
|
+
var y = A.plugins[m];
|
|
2168
2166
|
return l.plugins.includes(m) && !y.initialized;
|
|
2169
2167
|
}).map(function(m) {
|
|
2170
|
-
return
|
|
2168
|
+
return R[m];
|
|
2171
2169
|
}));
|
|
2172
|
-
var
|
|
2170
|
+
var S = D.map(function(m) {
|
|
2173
2171
|
return m.name;
|
|
2174
|
-
}),
|
|
2175
|
-
var
|
|
2176
|
-
return
|
|
2172
|
+
}), I = function(m, y, P) {
|
|
2173
|
+
var $ = gn(m).map(function(z) {
|
|
2174
|
+
return mn(z, y);
|
|
2177
2175
|
});
|
|
2178
|
-
return y.reduce(function(z,
|
|
2179
|
-
var
|
|
2180
|
-
return
|
|
2181
|
-
}), W =
|
|
2182
|
-
return W.length && (z.beforeNS[
|
|
2183
|
-
}, { before:
|
|
2184
|
-
}(
|
|
2185
|
-
return Promise.resolve(mt({ action: l, data: { exact:
|
|
2176
|
+
return y.reduce(function(z, U) {
|
|
2177
|
+
var F = U.name, Z = gn(m, F).map(function(Ne) {
|
|
2178
|
+
return mn(Ne, y);
|
|
2179
|
+
}), W = Z[0], M = Z[1], ee = Z[2];
|
|
2180
|
+
return W.length && (z.beforeNS[F] = W), M.length && (z.duringNS[F] = M), ee.length && (z.afterNS[F] = ee), z;
|
|
2181
|
+
}, { before: $[0], beforeNS: {}, during: $[1], duringNS: {}, after: $[2], afterNS: {} });
|
|
2182
|
+
}(L, D);
|
|
2183
|
+
return Promise.resolve(mt({ action: l, data: { exact: I.before, namespaced: I.beforeNS }, state: A, allPlugins: R, allMatches: I, instance: T, store: O, EVENTS: x })).then(function(m) {
|
|
2186
2184
|
function y() {
|
|
2187
2185
|
var z = function() {
|
|
2188
|
-
if (
|
|
2189
|
-
return Promise.resolve(mt({ action:
|
|
2190
|
-
|
|
2186
|
+
if (L.match(Te))
|
|
2187
|
+
return Promise.resolve(mt({ action: C({}, P, { type: H + "End" }), data: { exact: I.after, namespaced: I.afterNS }, state: A, allPlugins: R, allMatches: I, instance: T, store: O, EVENTS: x })).then(function(U) {
|
|
2188
|
+
U.meta && U.meta.hasCallback && dn(U.meta.rid, { payload: U });
|
|
2191
2189
|
});
|
|
2192
2190
|
}();
|
|
2193
2191
|
return z && z.then ? z.then(function() {
|
|
2194
2192
|
return m;
|
|
2195
2193
|
}) : m;
|
|
2196
2194
|
}
|
|
2197
|
-
if (
|
|
2195
|
+
if (lr(m, S.length))
|
|
2198
2196
|
return m;
|
|
2199
|
-
var P,
|
|
2200
|
-
if (
|
|
2201
|
-
return Promise.resolve(mt({ action:
|
|
2197
|
+
var P, $ = function() {
|
|
2198
|
+
if (L !== H)
|
|
2199
|
+
return Promise.resolve(mt({ action: C({}, m, { type: H }), data: { exact: I.during, namespaced: I.duringNS }, state: A, allPlugins: R, allMatches: I, instance: T, store: O, EVENTS: x })).then(function(z) {
|
|
2202
2200
|
P = z;
|
|
2203
2201
|
});
|
|
2204
2202
|
P = m;
|
|
2205
2203
|
}();
|
|
2206
|
-
return
|
|
2204
|
+
return $ && $.then ? $.then(y) : y();
|
|
2207
2205
|
});
|
|
2208
2206
|
} catch (m) {
|
|
2209
2207
|
return Promise.reject(m);
|
|
2210
2208
|
}
|
|
2211
|
-
var
|
|
2209
|
+
var N, K, X;
|
|
2212
2210
|
}(a, e, t, i, n)).then(function(l) {
|
|
2213
2211
|
return s = 1, o(l);
|
|
2214
2212
|
});
|
|
@@ -2226,10 +2224,10 @@ function Vi(t) {
|
|
|
2226
2224
|
return function(n) {
|
|
2227
2225
|
return function(r) {
|
|
2228
2226
|
var i = r.type, o = r.key, a = r.value, s = r.options;
|
|
2229
|
-
if (i ===
|
|
2227
|
+
if (i === j.setItem || i === j.removeItem) {
|
|
2230
2228
|
if (r.abort)
|
|
2231
2229
|
return n(r);
|
|
2232
|
-
i ===
|
|
2230
|
+
i === j.setItem ? t.setItem(o, a, s) : t.removeItem(o, s);
|
|
2233
2231
|
}
|
|
2234
2232
|
return n(r);
|
|
2235
2233
|
};
|
|
@@ -2254,7 +2252,7 @@ var Yi = function() {
|
|
|
2254
2252
|
} }, a = t[e].map(function(s) {
|
|
2255
2253
|
return s(o);
|
|
2256
2254
|
});
|
|
2257
|
-
return
|
|
2255
|
+
return xe.apply(void 0, a)(r)(i);
|
|
2258
2256
|
};
|
|
2259
2257
|
};
|
|
2260
2258
|
};
|
|
@@ -2267,37 +2265,37 @@ function Gi(t) {
|
|
|
2267
2265
|
if (n.type === "initialize:aborted")
|
|
2268
2266
|
return e;
|
|
2269
2267
|
if (/^registerPlugin:([^:]*)$/.test(n.type)) {
|
|
2270
|
-
var i =
|
|
2268
|
+
var i = wn(n.type, "registerPlugin"), o = t()[i];
|
|
2271
2269
|
if (!o || !i)
|
|
2272
2270
|
return e;
|
|
2273
2271
|
var a = n.enabled, s = o.config;
|
|
2274
|
-
return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s },
|
|
2272
|
+
return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, C({}, e, r);
|
|
2275
2273
|
}
|
|
2276
2274
|
if (/^initialize:([^:]*)$/.test(n.type)) {
|
|
2277
|
-
var h =
|
|
2278
|
-
return p && h ? (r[h] =
|
|
2275
|
+
var h = wn(n.type, j.initialize), p = t()[h];
|
|
2276
|
+
return p && h ? (r[h] = C({}, e[h], { initialized: !0, loaded: !!p.loaded({ config: p.config }) }), C({}, e, r)) : e;
|
|
2279
2277
|
}
|
|
2280
2278
|
if (/^ready:([^:]*)$/.test(n.type))
|
|
2281
|
-
return r[n.name] =
|
|
2279
|
+
return r[n.name] = C({}, e[n.name], { loaded: !0 }), C({}, e, r);
|
|
2282
2280
|
switch (n.type) {
|
|
2283
|
-
case
|
|
2284
|
-
return
|
|
2285
|
-
case
|
|
2286
|
-
return
|
|
2281
|
+
case j.disablePlugin:
|
|
2282
|
+
return C({}, e, bn(n.plugins, !1, e));
|
|
2283
|
+
case j.enablePlugin:
|
|
2284
|
+
return C({}, e, bn(n.plugins, !0, e));
|
|
2287
2285
|
default:
|
|
2288
2286
|
return e;
|
|
2289
2287
|
}
|
|
2290
2288
|
};
|
|
2291
2289
|
}
|
|
2292
|
-
function
|
|
2290
|
+
function wn(t, e) {
|
|
2293
2291
|
return t.substring(e.length + 1, t.length);
|
|
2294
2292
|
}
|
|
2295
|
-
function
|
|
2293
|
+
function bn(t, e, n) {
|
|
2296
2294
|
return t.reduce(function(r, i) {
|
|
2297
|
-
return r[i] =
|
|
2295
|
+
return r[i] = C({}, n[i], { enabled: e }), r;
|
|
2298
2296
|
}, n);
|
|
2299
2297
|
}
|
|
2300
|
-
function
|
|
2298
|
+
function dr(t) {
|
|
2301
2299
|
try {
|
|
2302
2300
|
return JSON.parse(JSON.stringify(t));
|
|
2303
2301
|
} catch {
|
|
@@ -2308,9 +2306,9 @@ var Bi = { last: {}, history: [] };
|
|
|
2308
2306
|
function qi(t, e) {
|
|
2309
2307
|
t === void 0 && (t = Bi);
|
|
2310
2308
|
var n = e.options, r = e.meta;
|
|
2311
|
-
if (e.type ===
|
|
2312
|
-
var i =
|
|
2313
|
-
return
|
|
2309
|
+
if (e.type === j.track) {
|
|
2310
|
+
var i = dr(C({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
|
|
2311
|
+
return C({}, t, { last: i, history: t.history.concat(i) });
|
|
2314
2312
|
}
|
|
2315
2313
|
return t;
|
|
2316
2314
|
}
|
|
@@ -2321,61 +2319,61 @@ function eo(t, e) {
|
|
|
2321
2319
|
switch (e.type) {
|
|
2322
2320
|
case "queue":
|
|
2323
2321
|
var r;
|
|
2324
|
-
return r = n && n.type && n.type ===
|
|
2322
|
+
return r = n && n.type && n.type === j.identify ? [e].concat(t.actions) : t.actions.concat(e), C({}, t, { actions: r });
|
|
2325
2323
|
case "dequeue":
|
|
2326
2324
|
return [];
|
|
2327
2325
|
default:
|
|
2328
2326
|
return t;
|
|
2329
2327
|
}
|
|
2330
2328
|
}
|
|
2331
|
-
var
|
|
2329
|
+
var hr = /#.*$/;
|
|
2332
2330
|
function to(t) {
|
|
2333
2331
|
var e = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);
|
|
2334
|
-
return "/" + (e && e[3] ? e[3].split("?")[0].replace(
|
|
2332
|
+
return "/" + (e && e[3] ? e[3].split("?")[0].replace(hr, "") : "");
|
|
2335
2333
|
}
|
|
2336
|
-
var
|
|
2334
|
+
var fr, pr, mr, gr, no = function(t) {
|
|
2337
2335
|
if (t === void 0 && (t = {}), !J)
|
|
2338
2336
|
return t;
|
|
2339
2337
|
var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight, h = o.hash, p = o.search, u = function(f) {
|
|
2340
2338
|
var d = function() {
|
|
2341
2339
|
if (J) {
|
|
2342
|
-
for (var w,
|
|
2340
|
+
for (var w, k = document.getElementsByTagName("link"), v = 0; w = k[v]; v++)
|
|
2343
2341
|
if (w.getAttribute("rel") === "canonical")
|
|
2344
2342
|
return w.getAttribute("href");
|
|
2345
2343
|
}
|
|
2346
2344
|
}();
|
|
2347
|
-
return d ? d.match(/\?/) ? d : d + f : window.location.href.replace(
|
|
2345
|
+
return d ? d.match(/\?/) ? d : d + f : window.location.href.replace(hr, "");
|
|
2348
2346
|
}(p), c = { title: n, url: u, path: to(u), hash: h, search: p, width: a, height: s };
|
|
2349
|
-
return r && r !== "" && (c.referrer = r),
|
|
2347
|
+
return r && r !== "" && (c.referrer = r), C({}, c, t);
|
|
2350
2348
|
}, ro = { last: {}, history: [] };
|
|
2351
2349
|
function io(t, e) {
|
|
2352
2350
|
t === void 0 && (t = ro);
|
|
2353
2351
|
var n = e.options;
|
|
2354
|
-
if (e.type ===
|
|
2355
|
-
var r =
|
|
2356
|
-
return
|
|
2352
|
+
if (e.type === j.page) {
|
|
2353
|
+
var r = dr(C({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
|
|
2354
|
+
return C({}, t, { last: r, history: t.history.concat(r) });
|
|
2357
2355
|
}
|
|
2358
2356
|
return t;
|
|
2359
2357
|
}
|
|
2360
|
-
|
|
2358
|
+
fr = function() {
|
|
2361
2359
|
if (!J)
|
|
2362
2360
|
return !1;
|
|
2363
2361
|
var t = navigator.appVersion;
|
|
2364
2362
|
return ~t.indexOf("Win") ? "Windows" : ~t.indexOf("Mac") ? "MacOS" : ~t.indexOf("X11") ? "UNIX" : ~t.indexOf("Linux") ? "Linux" : "Unknown OS";
|
|
2365
|
-
}(),
|
|
2366
|
-
var
|
|
2363
|
+
}(), pr = J ? document.referrer : null, mr = Ni(), gr = zi();
|
|
2364
|
+
var kn = { initialized: !1, sessionId: st(), app: null, version: null, debug: !1, offline: !!J && !navigator.onLine, os: { name: fr }, userAgent: J ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.7" }, timezone: gr, locale: mr, campaign: {}, referrer: pr };
|
|
2367
2365
|
function oo(t, e) {
|
|
2368
|
-
t === void 0 && (t =
|
|
2366
|
+
t === void 0 && (t = kn);
|
|
2369
2367
|
var n = t.initialized, r = e.campaign;
|
|
2370
2368
|
switch (e.type) {
|
|
2371
|
-
case
|
|
2372
|
-
return
|
|
2373
|
-
case
|
|
2374
|
-
return
|
|
2375
|
-
case
|
|
2376
|
-
return
|
|
2369
|
+
case j.campaign:
|
|
2370
|
+
return C({}, t, { campaign: r });
|
|
2371
|
+
case j.offline:
|
|
2372
|
+
return C({}, t, { offline: !0 });
|
|
2373
|
+
case j.online:
|
|
2374
|
+
return C({}, t, { offline: !1 });
|
|
2377
2375
|
default:
|
|
2378
|
-
return n ? t :
|
|
2376
|
+
return n ? t : C({}, kn, t, { initialized: !0 });
|
|
2379
2377
|
}
|
|
2380
2378
|
}
|
|
2381
2379
|
var ao = ["plugins", "reducers", "storage"];
|
|
@@ -2395,300 +2393,300 @@ function co(t) {
|
|
|
2395
2393
|
return e(!1);
|
|
2396
2394
|
};
|
|
2397
2395
|
}
|
|
2398
|
-
function
|
|
2399
|
-
return
|
|
2396
|
+
function yr() {
|
|
2397
|
+
return be("analytics", []), function(t) {
|
|
2400
2398
|
return function(e, n, r) {
|
|
2401
2399
|
var i = t(e, n, r), o = i.dispatch;
|
|
2402
2400
|
return Object.assign(i, { dispatch: function(a) {
|
|
2403
|
-
return je
|
|
2401
|
+
return Ce[je].analytics.push(a.action || a), o(a);
|
|
2404
2402
|
} });
|
|
2405
2403
|
};
|
|
2406
2404
|
};
|
|
2407
2405
|
}
|
|
2408
|
-
function
|
|
2406
|
+
function In(t) {
|
|
2409
2407
|
return function() {
|
|
2410
|
-
return
|
|
2408
|
+
return xe(xe.apply(null, arguments), yr());
|
|
2411
2409
|
};
|
|
2412
2410
|
}
|
|
2413
2411
|
function vt(t) {
|
|
2414
|
-
return t ?
|
|
2412
|
+
return t ? or(t) ? t : [t] : [];
|
|
2415
2413
|
}
|
|
2416
|
-
function
|
|
2414
|
+
function Sn(t, e, n) {
|
|
2417
2415
|
t === void 0 && (t = {});
|
|
2418
2416
|
var r, i, o = st();
|
|
2419
2417
|
return e && (Ue[o] = (r = e, i = function(a) {
|
|
2420
2418
|
for (var s, h = a || Array.prototype.slice.call(arguments), p = 0; p < h.length; p++)
|
|
2421
|
-
if (
|
|
2419
|
+
if (Y(h[p])) {
|
|
2422
2420
|
s = h[p];
|
|
2423
2421
|
break;
|
|
2424
2422
|
}
|
|
2425
2423
|
return s;
|
|
2426
2424
|
}(n), function(a) {
|
|
2427
2425
|
i && i(a), r(a);
|
|
2428
|
-
})),
|
|
2426
|
+
})), C({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
|
|
2429
2427
|
}
|
|
2430
2428
|
function uo(t) {
|
|
2431
2429
|
t === void 0 && (t = {});
|
|
2432
2430
|
var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(m, y) {
|
|
2433
|
-
if (
|
|
2431
|
+
if (Y(y))
|
|
2434
2432
|
return m.middlewares = m.middlewares.concat(y), m;
|
|
2435
2433
|
if (y.NAMESPACE && (y.name = y.NAMESPACE), !y.name)
|
|
2436
2434
|
throw new Error("https://lytics.dev/errors/1");
|
|
2437
2435
|
y.config || (y.config = {});
|
|
2438
|
-
var P = y.EVENTS ? Object.keys(y.EVENTS).map(function(
|
|
2439
|
-
return y.EVENTS[
|
|
2436
|
+
var P = y.EVENTS ? Object.keys(y.EVENTS).map(function(U) {
|
|
2437
|
+
return y.EVENTS[U];
|
|
2440
2438
|
}) : [];
|
|
2441
|
-
m.pluginEnabled[y.name] = !(y.enabled === !1 || y.config.enabled === !1), delete y.enabled, y.methods && (m.methods[y.name] = Object.keys(y.methods).reduce(function(
|
|
2442
|
-
var
|
|
2443
|
-
return
|
|
2444
|
-
for (var W = Array.prototype.slice.call(arguments),
|
|
2445
|
-
|
|
2446
|
-
return
|
|
2447
|
-
}),
|
|
2439
|
+
m.pluginEnabled[y.name] = !(y.enabled === !1 || y.config.enabled === !1), delete y.enabled, y.methods && (m.methods[y.name] = Object.keys(y.methods).reduce(function(U, F) {
|
|
2440
|
+
var Z;
|
|
2441
|
+
return U[F] = (Z = y.methods[F], function() {
|
|
2442
|
+
for (var W = Array.prototype.slice.call(arguments), M = new Array(Z.length), ee = 0; ee < W.length; ee++)
|
|
2443
|
+
M[ee] = W[ee];
|
|
2444
|
+
return M[M.length] = b, Z.apply({ instance: b }, M);
|
|
2445
|
+
}), U;
|
|
2448
2446
|
}, {}), delete y.methods);
|
|
2449
|
-
var
|
|
2447
|
+
var $ = Object.keys(y).concat(P), z = new Set(m.events.concat($));
|
|
2450
2448
|
if (m.events = Array.from(z), m.pluginsArray = m.pluginsArray.concat(y), m.plugins[y.name])
|
|
2451
2449
|
throw new Error(y.name + "AlreadyLoaded");
|
|
2452
2450
|
return m.plugins[y.name] = y, m.plugins[y.name].loaded || (m.plugins[y.name].loaded = function() {
|
|
2453
2451
|
return !0;
|
|
2454
2452
|
}), m;
|
|
2455
|
-
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem:
|
|
2456
|
-
return function(y, P,
|
|
2457
|
-
return P.getState("user")[y] || (
|
|
2453
|
+
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: we, setItem: be, removeItem: Ae }, o = /* @__PURE__ */ function(m) {
|
|
2454
|
+
return function(y, P, $) {
|
|
2455
|
+
return P.getState("user")[y] || ($ && V($) && $[y] ? $[y] : ln(m)[y] || we(Ot(y)) || null);
|
|
2458
2456
|
};
|
|
2459
2457
|
}(i), a = r.plugins, s = r.events.filter(function(m) {
|
|
2460
|
-
return !
|
|
2458
|
+
return !Pt.includes(m);
|
|
2461
2459
|
}).sort(), h = new Set(s.concat(et).filter(function(m) {
|
|
2462
|
-
return !
|
|
2460
|
+
return !Pt.includes(m);
|
|
2463
2461
|
})), p = Array.from(h).sort(), u = function() {
|
|
2464
2462
|
return a;
|
|
2465
|
-
}, c = new Yi(), f = c.addMiddleware, d = c.removeMiddleware, w = c.dynamicMiddlewares,
|
|
2463
|
+
}, c = new Yi(), f = c.addMiddleware, d = c.removeMiddleware, w = c.dynamicMiddlewares, k = function() {
|
|
2466
2464
|
throw new Error("Abort disabled inListener");
|
|
2467
|
-
}, v = Di(), E =
|
|
2468
|
-
|
|
2469
|
-
var g =
|
|
2465
|
+
}, v = Di(), E = ln(i), _ = C({}, E, n, v.an_uid ? { userId: v.an_uid } : {}, v.an_aid ? { anonymousId: v.an_aid } : {});
|
|
2466
|
+
_.anonymousId || (_.anonymousId = st());
|
|
2467
|
+
var g = C({ enable: function(m, y) {
|
|
2470
2468
|
return new Promise(function(P) {
|
|
2471
|
-
|
|
2469
|
+
I.dispatch({ type: j.enablePlugin, plugins: vt(m), _: { originalAction: j.enablePlugin } }, P, [y]);
|
|
2472
2470
|
});
|
|
2473
2471
|
}, disable: function(m, y) {
|
|
2474
2472
|
return new Promise(function(P) {
|
|
2475
|
-
|
|
2473
|
+
I.dispatch({ type: j.disablePlugin, plugins: vt(m), _: { originalAction: j.disablePlugin } }, P, [y]);
|
|
2476
2474
|
});
|
|
2477
|
-
} }, r.methods), l = !1, b = { identify: function(m, y, P,
|
|
2475
|
+
} }, r.methods), l = !1, b = { identify: function(m, y, P, $) {
|
|
2478
2476
|
try {
|
|
2479
|
-
var z =
|
|
2480
|
-
|
|
2481
|
-
var W = z ||
|
|
2482
|
-
return Promise.resolve(new Promise(function(
|
|
2483
|
-
|
|
2477
|
+
var z = se(m) ? m : null, U = V(m) ? m : y, F = P || {}, Z = b.user();
|
|
2478
|
+
be(Ot(oe), z);
|
|
2479
|
+
var W = z || U.userId || o(oe, b, U);
|
|
2480
|
+
return Promise.resolve(new Promise(function(M) {
|
|
2481
|
+
I.dispatch(C({ type: j.identifyStart, userId: W, traits: U || {}, options: F, anonymousId: Z.anonymousId }, Z.id && Z.id !== z && { previousId: Z.id }), M, [y, P, $]);
|
|
2484
2482
|
}));
|
|
2485
|
-
} catch (
|
|
2486
|
-
return Promise.reject(
|
|
2483
|
+
} catch (M) {
|
|
2484
|
+
return Promise.reject(M);
|
|
2487
2485
|
}
|
|
2488
|
-
}, track: function(m, y, P,
|
|
2486
|
+
}, track: function(m, y, P, $) {
|
|
2489
2487
|
try {
|
|
2490
|
-
var z =
|
|
2491
|
-
if (!z || !
|
|
2488
|
+
var z = V(m) ? m.event : m;
|
|
2489
|
+
if (!z || !se(z))
|
|
2492
2490
|
throw new Error("EventMissing");
|
|
2493
|
-
var
|
|
2494
|
-
return Promise.resolve(new Promise(function(
|
|
2495
|
-
|
|
2491
|
+
var U = V(m) ? m : y || {}, F = V(P) ? P : {};
|
|
2492
|
+
return Promise.resolve(new Promise(function(Z) {
|
|
2493
|
+
I.dispatch({ type: j.trackStart, event: z, properties: U, options: F, userId: o(oe, b, y), anonymousId: o(_e, b, y) }, Z, [y, P, $]);
|
|
2496
2494
|
}));
|
|
2497
|
-
} catch (
|
|
2498
|
-
return Promise.reject(
|
|
2495
|
+
} catch (Z) {
|
|
2496
|
+
return Promise.reject(Z);
|
|
2499
2497
|
}
|
|
2500
2498
|
}, page: function(m, y, P) {
|
|
2501
2499
|
try {
|
|
2502
|
-
var
|
|
2503
|
-
return Promise.resolve(new Promise(function(
|
|
2504
|
-
|
|
2500
|
+
var $ = V(m) ? m : {}, z = V(y) ? y : {};
|
|
2501
|
+
return Promise.resolve(new Promise(function(U) {
|
|
2502
|
+
I.dispatch({ type: j.pageStart, properties: no($), options: z, userId: o(oe, b, $), anonymousId: o(_e, b, $) }, U, [m, y, P]);
|
|
2505
2503
|
}));
|
|
2506
|
-
} catch (
|
|
2507
|
-
return Promise.reject(
|
|
2504
|
+
} catch (U) {
|
|
2505
|
+
return Promise.reject(U);
|
|
2508
2506
|
}
|
|
2509
2507
|
}, user: function(m) {
|
|
2510
|
-
if (m ===
|
|
2511
|
-
return o(
|
|
2512
|
-
if (m ===
|
|
2513
|
-
return o(
|
|
2508
|
+
if (m === oe || m === "id")
|
|
2509
|
+
return o(oe, b);
|
|
2510
|
+
if (m === _e || m === "anonId")
|
|
2511
|
+
return o(_e, b);
|
|
2514
2512
|
var y = b.getState("user");
|
|
2515
|
-
return m ?
|
|
2513
|
+
return m ? nn(y, m) : y;
|
|
2516
2514
|
}, reset: function(m) {
|
|
2517
2515
|
return new Promise(function(y) {
|
|
2518
|
-
|
|
2516
|
+
I.dispatch({ type: j.resetStart }, y, m);
|
|
2519
2517
|
});
|
|
2520
2518
|
}, ready: function(m) {
|
|
2521
|
-
return l && m({ plugins: g, instance: b }), b.on(
|
|
2519
|
+
return l && m({ plugins: g, instance: b }), b.on(j.ready, function(y) {
|
|
2522
2520
|
m(y), l = !0;
|
|
2523
2521
|
});
|
|
2524
2522
|
}, on: function(m, y) {
|
|
2525
|
-
if (!m || !
|
|
2523
|
+
if (!m || !Y(y))
|
|
2526
2524
|
return !1;
|
|
2527
|
-
if (m ===
|
|
2525
|
+
if (m === j.bootstrap)
|
|
2528
2526
|
throw new Error(".on disabled for " + m);
|
|
2529
2527
|
var P = /Start$|Start:/;
|
|
2530
2528
|
if (m === "*") {
|
|
2531
|
-
var
|
|
2529
|
+
var $ = function(Z) {
|
|
2532
2530
|
return function(W) {
|
|
2533
|
-
return function(
|
|
2534
|
-
return
|
|
2531
|
+
return function(M) {
|
|
2532
|
+
return M.type.match(P) && y({ payload: M, instance: b, plugins: a }), W(M);
|
|
2535
2533
|
};
|
|
2536
2534
|
};
|
|
2537
|
-
}, z = function(
|
|
2535
|
+
}, z = function(Z) {
|
|
2538
2536
|
return function(W) {
|
|
2539
|
-
return function(
|
|
2540
|
-
return
|
|
2537
|
+
return function(M) {
|
|
2538
|
+
return M.type.match(P) || y({ payload: M, instance: b, plugins: a }), W(M);
|
|
2541
2539
|
};
|
|
2542
2540
|
};
|
|
2543
2541
|
};
|
|
2544
|
-
return f(
|
|
2545
|
-
d(
|
|
2542
|
+
return f($, Ye), f(z, Ge), function() {
|
|
2543
|
+
d($, Ye), d(z, Ge);
|
|
2546
2544
|
};
|
|
2547
2545
|
}
|
|
2548
|
-
var
|
|
2546
|
+
var U = m.match(P) ? Ye : Ge, F = function(Z) {
|
|
2549
2547
|
return function(W) {
|
|
2550
|
-
return function(
|
|
2551
|
-
return
|
|
2548
|
+
return function(M) {
|
|
2549
|
+
return M.type === m && y({ payload: M, instance: b, plugins: a, abort: k }), W(M);
|
|
2552
2550
|
};
|
|
2553
2551
|
};
|
|
2554
2552
|
};
|
|
2555
|
-
return f(
|
|
2556
|
-
return d(
|
|
2553
|
+
return f(F, U), function() {
|
|
2554
|
+
return d(F, U);
|
|
2557
2555
|
};
|
|
2558
2556
|
}, once: function(m, y) {
|
|
2559
|
-
if (!m || !
|
|
2557
|
+
if (!m || !Y(y))
|
|
2560
2558
|
return !1;
|
|
2561
|
-
if (m ===
|
|
2559
|
+
if (m === j.bootstrap)
|
|
2562
2560
|
throw new Error(".once disabled for " + m);
|
|
2563
|
-
var P = b.on(m, function(
|
|
2564
|
-
y({ payload:
|
|
2561
|
+
var P = b.on(m, function($) {
|
|
2562
|
+
y({ payload: $.payload, instance: b, plugins: a, abort: k }), P();
|
|
2565
2563
|
});
|
|
2566
2564
|
return P;
|
|
2567
2565
|
}, getState: function(m) {
|
|
2568
|
-
var y =
|
|
2569
|
-
return m ?
|
|
2566
|
+
var y = I.getState();
|
|
2567
|
+
return m ? nn(y, m) : Object.assign({}, y);
|
|
2570
2568
|
}, dispatch: function(m) {
|
|
2571
|
-
var y =
|
|
2569
|
+
var y = se(m) ? { type: m } : m;
|
|
2572
2570
|
if (et.includes(y.type))
|
|
2573
2571
|
throw new Error("reserved action " + y.type);
|
|
2574
|
-
var P =
|
|
2575
|
-
|
|
2572
|
+
var P = C({}, y, { _: C({ originalAction: y.type }, m._ || {}) });
|
|
2573
|
+
I.dispatch(P);
|
|
2576
2574
|
}, enablePlugin: g.enable, disablePlugin: g.disable, plugins: g, storage: { getItem: i.getItem, setItem: function(m, y, P) {
|
|
2577
|
-
|
|
2575
|
+
I.dispatch({ type: j.setItemStart, key: m, value: y, options: P });
|
|
2578
2576
|
}, removeItem: function(m, y) {
|
|
2579
|
-
|
|
2577
|
+
I.dispatch({ type: j.removeItemStart, key: m, options: y });
|
|
2580
2578
|
} }, setAnonymousId: function(m, y) {
|
|
2581
|
-
b.storage.setItem(
|
|
2582
|
-
}, events: { core: et, plugins: s } },
|
|
2579
|
+
b.storage.setItem(ce, m, y);
|
|
2580
|
+
}, events: { core: et, plugins: s } }, T = r.middlewares.concat([function(m) {
|
|
2583
2581
|
return function(y) {
|
|
2584
2582
|
return function(P) {
|
|
2585
|
-
return P.meta || (P.meta =
|
|
2583
|
+
return P.meta || (P.meta = Sn()), y(P);
|
|
2586
2584
|
};
|
|
2587
2585
|
};
|
|
2588
|
-
}, w(Ye), Xi(b, u, { all: p, plugins: s }), Vi(i),
|
|
2586
|
+
}, w(Ye), Xi(b, u, { all: p, plugins: s }), Vi(i), Ki(b), Hi(b), w(Ge)]), O = { context: oo, user: Wi(i), page: io, track: qi, plugins: Gi(u), queue: eo }, x = xe, R = xe;
|
|
2589
2587
|
if (J && t.debug) {
|
|
2590
|
-
var
|
|
2591
|
-
|
|
2592
|
-
return arguments.length === 0 ?
|
|
2588
|
+
var L = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
|
|
2589
|
+
L && (x = L({ trace: !0, traceLimit: 25 })), R = function() {
|
|
2590
|
+
return arguments.length === 0 ? yr() : V(typeof arguments[0]) ? In() : In().apply(null, arguments);
|
|
2593
2591
|
};
|
|
2594
2592
|
}
|
|
2595
|
-
var
|
|
2593
|
+
var H, A = function(m) {
|
|
2596
2594
|
return Object.keys(m).reduce(function(y, P) {
|
|
2597
2595
|
return ao.includes(P) || (y[P] = m[P]), y;
|
|
2598
2596
|
}, {});
|
|
2599
|
-
}(t),
|
|
2600
|
-
var P = y.name,
|
|
2601
|
-
return m[P] = { enabled:
|
|
2602
|
-
}, {}),
|
|
2603
|
-
for (var y = Object.keys(m), P = {},
|
|
2604
|
-
var z = y[
|
|
2605
|
-
typeof m[z] ===
|
|
2597
|
+
}(t), D = r.pluginsArray.reduce(function(m, y) {
|
|
2598
|
+
var P = y.name, $ = y.config, z = y.loaded, U = r.pluginEnabled[P];
|
|
2599
|
+
return m[P] = { enabled: U, initialized: !!U && !y.initialize, loaded: !!z({ config: $ }), config: $ }, m;
|
|
2600
|
+
}, {}), S = { context: A, user: _, plugins: D }, I = sr(function(m) {
|
|
2601
|
+
for (var y = Object.keys(m), P = {}, $ = 0; $ < y.length; $++) {
|
|
2602
|
+
var z = y[$];
|
|
2603
|
+
typeof m[z] === ae && (P[z] = m[z]);
|
|
2606
2604
|
}
|
|
2607
|
-
var
|
|
2605
|
+
var U, F = Object.keys(P);
|
|
2608
2606
|
try {
|
|
2609
|
-
(function(
|
|
2610
|
-
Object.keys(
|
|
2611
|
-
var
|
|
2612
|
-
if (typeof
|
|
2613
|
-
throw new Error("reducer " + W + " " +
|
|
2607
|
+
(function(Z) {
|
|
2608
|
+
Object.keys(Z).forEach(function(W) {
|
|
2609
|
+
var M = Z[W];
|
|
2610
|
+
if (typeof M(void 0, { type: "@@redux/INIT" }) === ie || typeof M(void 0, { type: Li }) === ie)
|
|
2611
|
+
throw new Error("reducer " + W + " " + ie);
|
|
2614
2612
|
});
|
|
2615
2613
|
})(P);
|
|
2616
|
-
} catch (
|
|
2617
|
-
|
|
2614
|
+
} catch (Z) {
|
|
2615
|
+
U = Z;
|
|
2618
2616
|
}
|
|
2619
|
-
return function(
|
|
2620
|
-
if (
|
|
2621
|
-
throw
|
|
2622
|
-
for (var
|
|
2623
|
-
var
|
|
2624
|
-
if (typeof lt ===
|
|
2625
|
-
var
|
|
2626
|
-
throw new Error(
|
|
2617
|
+
return function(Z, W) {
|
|
2618
|
+
if (Z === void 0 && (Z = {}), U)
|
|
2619
|
+
throw U;
|
|
2620
|
+
for (var M = !1, ee = {}, Ne = 0; Ne < F.length; Ne++) {
|
|
2621
|
+
var He = F[Ne], Wt = Z[He], lt = (0, P[He])(Wt, W);
|
|
2622
|
+
if (typeof lt === ie) {
|
|
2623
|
+
var Cr = Mi(He, W);
|
|
2624
|
+
throw new Error(Cr);
|
|
2627
2625
|
}
|
|
2628
|
-
|
|
2626
|
+
ee[He] = lt, M = M || lt !== Wt;
|
|
2629
2627
|
}
|
|
2630
|
-
return
|
|
2628
|
+
return M ? ee : Z;
|
|
2631
2629
|
};
|
|
2632
|
-
}(
|
|
2633
|
-
|
|
2634
|
-
var
|
|
2635
|
-
return
|
|
2630
|
+
}(C({}, O, e)), S, R(x(Zi.apply(void 0, T))));
|
|
2631
|
+
I.dispatch = (H = I.dispatch, function(m, y, P) {
|
|
2632
|
+
var $ = C({}, m, { meta: Sn(m.meta, y, vt(P)) });
|
|
2633
|
+
return H.apply(null, [$]);
|
|
2636
2634
|
});
|
|
2637
|
-
var
|
|
2638
|
-
|
|
2639
|
-
var K =
|
|
2635
|
+
var N = Object.keys(a);
|
|
2636
|
+
I.dispatch({ type: j.bootstrap, plugins: N, config: A, params: v, user: _, initialUser: n, persistedUser: E });
|
|
2637
|
+
var K = N.filter(function(m) {
|
|
2640
2638
|
return r.pluginEnabled[m];
|
|
2641
|
-
}),
|
|
2639
|
+
}), X = N.filter(function(m) {
|
|
2642
2640
|
return !r.pluginEnabled[m];
|
|
2643
2641
|
});
|
|
2644
|
-
return
|
|
2645
|
-
var P = m.bootstrap,
|
|
2646
|
-
P &&
|
|
2642
|
+
return I.dispatch({ type: j.registerPlugins, plugins: N, enabled: r.pluginEnabled }), r.pluginsArray.map(function(m, y) {
|
|
2643
|
+
var P = m.bootstrap, $ = m.config, z = m.name;
|
|
2644
|
+
P && Y(P) && P({ instance: b, config: $, payload: m }), I.dispatch({ type: j.registerPluginType(z), name: z, enabled: r.pluginEnabled[z], plugin: m }), r.pluginsArray.length === y + 1 && I.dispatch({ type: j.initializeStart, plugins: K, disabled: X });
|
|
2647
2645
|
}), co(function(m) {
|
|
2648
|
-
|
|
2646
|
+
I.dispatch({ type: m ? j.offline : j.online });
|
|
2649
2647
|
}), function(m, y, P) {
|
|
2650
2648
|
setInterval(function() {
|
|
2651
|
-
return
|
|
2649
|
+
return ur(m, y, P);
|
|
2652
2650
|
}, 3e3);
|
|
2653
|
-
}(
|
|
2651
|
+
}(I, u, b), b;
|
|
2654
2652
|
}
|
|
2655
|
-
var Ye = "before", Ge = "after", Le = "cookie",
|
|
2656
|
-
function
|
|
2657
|
-
return
|
|
2653
|
+
var Ye = "before", Ge = "after", Le = "cookie", fe = br(), vr = ct, lo = ct;
|
|
2654
|
+
function wr(t) {
|
|
2655
|
+
return fe ? ct(t, "", -1) : Ae(t);
|
|
2658
2656
|
}
|
|
2659
|
-
function
|
|
2660
|
-
if (
|
|
2661
|
-
return
|
|
2657
|
+
function br() {
|
|
2658
|
+
if (fe !== void 0)
|
|
2659
|
+
return fe;
|
|
2662
2660
|
var t = "cookiecookie";
|
|
2663
2661
|
try {
|
|
2664
|
-
ct(t, t),
|
|
2662
|
+
ct(t, t), fe = document.cookie.indexOf(t) !== -1, wr(t);
|
|
2665
2663
|
} catch {
|
|
2666
|
-
|
|
2664
|
+
fe = !1;
|
|
2667
2665
|
}
|
|
2668
|
-
return
|
|
2666
|
+
return fe;
|
|
2669
2667
|
}
|
|
2670
2668
|
function ct(t, e, n, r, i, o) {
|
|
2671
2669
|
if (typeof window < "u") {
|
|
2672
2670
|
var a = arguments.length > 1;
|
|
2673
|
-
return
|
|
2674
|
-
}
|
|
2675
|
-
}
|
|
2676
|
-
var Me = "localStorage", ho =
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
var Ze = "sessionStorage", fo =
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
function
|
|
2671
|
+
return fe === !1 && (a ? be(t, e) : we(t)), a ? document.cookie = t + "=" + encodeURIComponent(e) + (n ? "; expires=" + new Date(+/* @__PURE__ */ new Date() + 1e3 * n).toUTCString() + (r ? "; path=" + r : "") + (i ? "; domain=" + i : "") + (o ? "; secure" : "") : "") : decodeURIComponent((("; " + document.cookie).split("; " + t + "=")[1] || "").split(";")[0]);
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
2674
|
+
var Me = "localStorage", ho = Dt.bind(null, "localStorage");
|
|
2675
|
+
$e("localStorage", "getItem", we);
|
|
2676
|
+
$e("localStorage", "setItem", be);
|
|
2677
|
+
$e("localStorage", "removeItem", Ae);
|
|
2678
|
+
var Ze = "sessionStorage", fo = Dt.bind(null, "sessionStorage");
|
|
2679
|
+
$e("sessionStorage", "getItem", we);
|
|
2680
|
+
$e("sessionStorage", "setItem", be);
|
|
2681
|
+
$e("sessionStorage", "removeItem", Ae);
|
|
2682
|
+
function Pe(t) {
|
|
2685
2683
|
var e = t;
|
|
2686
2684
|
try {
|
|
2687
2685
|
if ((e = JSON.parse(t)) === "true")
|
|
2688
2686
|
return !0;
|
|
2689
2687
|
if (e === "false")
|
|
2690
2688
|
return !1;
|
|
2691
|
-
if (
|
|
2689
|
+
if (V(e))
|
|
2692
2690
|
return e;
|
|
2693
2691
|
parseFloat(e) === e && (e = parseFloat(e));
|
|
2694
2692
|
} catch {
|
|
@@ -2696,56 +2694,56 @@ function Te(t) {
|
|
|
2696
2694
|
if (e !== null && e !== "")
|
|
2697
2695
|
return e;
|
|
2698
2696
|
}
|
|
2699
|
-
var po = ho(), mo = fo(), go =
|
|
2700
|
-
function
|
|
2697
|
+
var po = ho(), mo = fo(), go = br();
|
|
2698
|
+
function kr(t, e) {
|
|
2701
2699
|
if (t) {
|
|
2702
|
-
var n =
|
|
2703
|
-
if (r && !
|
|
2700
|
+
var n = Ut(e), r = !Zt(n), i = Rt(n) ? Pe(localStorage.getItem(t)) : void 0;
|
|
2701
|
+
if (r && !Se(i))
|
|
2704
2702
|
return i;
|
|
2705
|
-
var o =
|
|
2703
|
+
var o = Lt(n) ? Pe(vr(t)) : void 0;
|
|
2706
2704
|
if (r && o)
|
|
2707
2705
|
return o;
|
|
2708
|
-
var a =
|
|
2706
|
+
var a = Mt(n) ? Pe(sessionStorage.getItem(t)) : void 0;
|
|
2709
2707
|
if (r && a)
|
|
2710
2708
|
return a;
|
|
2711
|
-
var s =
|
|
2709
|
+
var s = we(t);
|
|
2712
2710
|
return r ? s : { localStorage: i, sessionStorage: a, cookie: o, global: s };
|
|
2713
2711
|
}
|
|
2714
2712
|
}
|
|
2715
2713
|
function yo(t, e, n) {
|
|
2716
|
-
if (t && !
|
|
2717
|
-
var r = {}, i =
|
|
2718
|
-
return
|
|
2714
|
+
if (t && !Se(e)) {
|
|
2715
|
+
var r = {}, i = Ut(n), o = JSON.stringify(e), a = !Zt(i);
|
|
2716
|
+
return Rt(i) && (r[Me] = Be(Me, e, Pe(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Me] : Lt(i) && (r[Le] = Be(Le, e, Pe(vr(t))), lo(t, o), a) ? r[Le] : Mt(i) && (r[Ze] = Be(Ze, e, Pe(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Ze] : (r[Re] = Be(Re, e, we(t)), be(t, e), a ? r[Re] : r);
|
|
2719
2717
|
}
|
|
2720
2718
|
}
|
|
2721
2719
|
function vo(t, e) {
|
|
2722
2720
|
if (t) {
|
|
2723
|
-
var n =
|
|
2724
|
-
return !
|
|
2721
|
+
var n = Ut(e), r = kr(t, nr), i = {};
|
|
2722
|
+
return !Se(r.localStorage) && Rt(n) && (localStorage.removeItem(t), i[Me] = r.localStorage), !Se(r.cookie) && Lt(n) && (wr(t), i[Le] = r.cookie), !Se(r.sessionStorage) && Mt(n) && (sessionStorage.removeItem(t), i[Ze] = r.sessionStorage), !Se(r.global) && ut(n, Re) && (Ae(t), i[Re] = r.global), i;
|
|
2725
2723
|
}
|
|
2726
2724
|
}
|
|
2727
|
-
function
|
|
2728
|
-
return t ?
|
|
2725
|
+
function Ut(t) {
|
|
2726
|
+
return t ? se(t) ? t : t.storage : tr;
|
|
2729
2727
|
}
|
|
2730
|
-
function
|
|
2728
|
+
function Rt(t) {
|
|
2731
2729
|
return po && ut(t, Me);
|
|
2732
2730
|
}
|
|
2733
|
-
function
|
|
2731
|
+
function Lt(t) {
|
|
2734
2732
|
return go && ut(t, Le);
|
|
2735
2733
|
}
|
|
2736
|
-
function
|
|
2734
|
+
function Mt(t) {
|
|
2737
2735
|
return mo && ut(t, Ze);
|
|
2738
2736
|
}
|
|
2739
|
-
function
|
|
2740
|
-
return t ===
|
|
2737
|
+
function Zt(t) {
|
|
2738
|
+
return t === nr || t === "all";
|
|
2741
2739
|
}
|
|
2742
2740
|
function ut(t, e) {
|
|
2743
|
-
return t ===
|
|
2741
|
+
return t === tr || t === e || Zt(t);
|
|
2744
2742
|
}
|
|
2745
2743
|
function Be(t, e, n) {
|
|
2746
2744
|
return { location: t, current: e, previous: n };
|
|
2747
2745
|
}
|
|
2748
|
-
var wo = { setItem: yo, getItem:
|
|
2746
|
+
var wo = { setItem: yo, getItem: kr, removeItem: vo };
|
|
2749
2747
|
function bo(t, e, n) {
|
|
2750
2748
|
return e in t ? Object.defineProperty(t, e, {
|
|
2751
2749
|
value: n,
|
|
@@ -2754,7 +2752,7 @@ function bo(t, e, n) {
|
|
|
2754
2752
|
writable: !0
|
|
2755
2753
|
}) : t[e] = n, t;
|
|
2756
2754
|
}
|
|
2757
|
-
function
|
|
2755
|
+
function _n(t, e) {
|
|
2758
2756
|
var n = Object.keys(t);
|
|
2759
2757
|
if (Object.getOwnPropertySymbols) {
|
|
2760
2758
|
var r = Object.getOwnPropertySymbols(t);
|
|
@@ -2764,12 +2762,12 @@ function En(t, e) {
|
|
|
2764
2762
|
}
|
|
2765
2763
|
return n;
|
|
2766
2764
|
}
|
|
2767
|
-
function
|
|
2765
|
+
function En(t) {
|
|
2768
2766
|
for (var e = 1; e < arguments.length; e++) {
|
|
2769
2767
|
var n = arguments[e] != null ? arguments[e] : {};
|
|
2770
|
-
e % 2 ?
|
|
2768
|
+
e % 2 ? _n(Object(n), !0).forEach(function(r) {
|
|
2771
2769
|
bo(t, r, n[r]);
|
|
2772
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) :
|
|
2770
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : _n(Object(n)).forEach(function(r) {
|
|
2773
2771
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
2774
2772
|
});
|
|
2775
2773
|
}
|
|
@@ -2779,7 +2777,7 @@ function ko() {
|
|
|
2779
2777
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = {
|
|
2780
2778
|
storage: wo
|
|
2781
2779
|
};
|
|
2782
|
-
return uo(
|
|
2780
|
+
return uo(En(En({}, e), t));
|
|
2783
2781
|
}
|
|
2784
2782
|
function Io(t, e) {
|
|
2785
2783
|
e = e || {};
|
|
@@ -2829,39 +2827,39 @@ function Eo(t) {
|
|
|
2829
2827
|
}
|
|
2830
2828
|
function To() {
|
|
2831
2829
|
So(() => {
|
|
2832
|
-
|
|
2830
|
+
ne.page();
|
|
2833
2831
|
});
|
|
2834
2832
|
}
|
|
2835
|
-
function
|
|
2833
|
+
function Po(t) {
|
|
2836
2834
|
if (t === void 0 && (t = {}), !J)
|
|
2837
2835
|
return Tt;
|
|
2838
|
-
var e = Pn(), n = jt(), r =
|
|
2836
|
+
var e = Pn(), n = jt(), r = Tn(), i = qe(r, e), o = qe(n, e), a = [], s = [], h = [], p = r, u = i, c = o, f = Object.keys(t);
|
|
2839
2837
|
if (!f.length)
|
|
2840
2838
|
return Tt;
|
|
2841
|
-
var d = f.map(function(
|
|
2842
|
-
return Number(
|
|
2839
|
+
var d = f.map(function(k) {
|
|
2840
|
+
return Number(k);
|
|
2843
2841
|
}), w = Ri(function() {
|
|
2844
|
-
var
|
|
2845
|
-
return
|
|
2846
|
-
return
|
|
2842
|
+
var k = Pn(), v = function(A, D) {
|
|
2843
|
+
return D.map(function(S) {
|
|
2844
|
+
return S === 100 ? A - 5 : A * (S / 100);
|
|
2847
2845
|
});
|
|
2848
|
-
}(
|
|
2846
|
+
}(k, d), E = jt(), _ = Tn(), g = qe(_, k), l = qe(E, k);
|
|
2849
2847
|
if (u = g > u ? g : u, c = l < c ? l : c, !(a.length >= d.length)) {
|
|
2850
|
-
var b = p ===
|
|
2851
|
-
b ?
|
|
2852
|
-
var
|
|
2853
|
-
(
|
|
2854
|
-
var
|
|
2855
|
-
var
|
|
2856
|
-
return h.includes(
|
|
2857
|
-
return
|
|
2858
|
-
}),
|
|
2859
|
-
}, { foundFunc: [], singleFunction: null, callbacks: [], direction:
|
|
2860
|
-
if (p =
|
|
2861
|
-
|
|
2862
|
-
}),
|
|
2863
|
-
var
|
|
2864
|
-
|
|
2848
|
+
var b = p === _, T = "up";
|
|
2849
|
+
b ? T = "initial" : p <= _ && (T = "down");
|
|
2850
|
+
var O = v, x = d;
|
|
2851
|
+
(T === "up" || b) && (O = v.slice().reverse(), x = d.slice().reverse());
|
|
2852
|
+
var R = x.reduce(function(A, D, S) {
|
|
2853
|
+
var I = O[S];
|
|
2854
|
+
return h.includes(D) && _ <= I && (h = h.filter(function(N) {
|
|
2855
|
+
return N !== D;
|
|
2856
|
+
}), A.singleFunction = D), T === "down" && !a.includes(D) && _ >= I && D > o ? (s.push(D), A.callbacks = A.callbacks.concat(D), A) : T === "up" && !a.includes(D) && _ <= I && D <= g ? (A.foundFunc = [D], A) : (b && _ >= I && A.foundFunc.length === 0 && (A.foundFunc = [D]), !s.includes(D) && _ >= I && (s.push(D), A.singleFunction ? h.push(D) : A.singleFunction = D), A);
|
|
2857
|
+
}, { foundFunc: [], singleFunction: null, callbacks: [], direction: T });
|
|
2858
|
+
if (p = _, T === "down" && R.callbacks && R.callbacks.forEach(function(A) {
|
|
2859
|
+
Y(t[A]) && (t[A]({ trigger: A, direction: T, scrollMin: c, scrollMax: u, range: [c, u] }), a.push(A));
|
|
2860
|
+
}), R.singleFunction) {
|
|
2861
|
+
var L = R.singleFunction, H = R.direction;
|
|
2862
|
+
Y(t[L]) && t[L]({ trigger: L, direction: H, scrollMin: c, scrollMax: u, range: [c, u] }), a.push(L);
|
|
2865
2863
|
}
|
|
2866
2864
|
}
|
|
2867
2865
|
}, 500);
|
|
@@ -2872,11 +2870,11 @@ function Oo(t) {
|
|
|
2872
2870
|
function jt() {
|
|
2873
2871
|
return J ? document.body.scrollTop || document.documentElement.scrollTop : 0;
|
|
2874
2872
|
}
|
|
2875
|
-
function
|
|
2873
|
+
function Oo() {
|
|
2876
2874
|
return J ? window.innerHeight || document.documentElement.clientHeight : 0;
|
|
2877
2875
|
}
|
|
2878
|
-
function
|
|
2879
|
-
return Math.round(jt() +
|
|
2876
|
+
function Tn() {
|
|
2877
|
+
return Math.round(jt() + Oo());
|
|
2880
2878
|
}
|
|
2881
2879
|
function Pn() {
|
|
2882
2880
|
if (!J)
|
|
@@ -2887,7 +2885,7 @@ function Pn() {
|
|
|
2887
2885
|
function qe(t, e) {
|
|
2888
2886
|
return Math.round(t / e * 100);
|
|
2889
2887
|
}
|
|
2890
|
-
var
|
|
2888
|
+
var On = "EventListener";
|
|
2891
2889
|
function jo(t) {
|
|
2892
2890
|
return function(e, n, r, i) {
|
|
2893
2891
|
var o = r || Tt, a = i || !1;
|
|
@@ -2901,18 +2899,18 @@ function jo(t) {
|
|
|
2901
2899
|
var p = [];
|
|
2902
2900
|
return function u(c) {
|
|
2903
2901
|
c && (p = []);
|
|
2904
|
-
for (var f = c ? "add" +
|
|
2902
|
+
for (var f = c ? "add" + On : "remove" + On, d = 0; d < h.length; d++) {
|
|
2905
2903
|
var w = h[d];
|
|
2906
2904
|
p[d] = c ? a && a.once ? Co(o) : o : p[d] || o;
|
|
2907
|
-
for (var
|
|
2908
|
-
w[f] ? w["on" + s[
|
|
2905
|
+
for (var k = 0; k < s.length; k++)
|
|
2906
|
+
w[f] ? w["on" + s[k]] = c ? p[d] : null : w[f](s[k], p[d], a);
|
|
2909
2907
|
}
|
|
2910
2908
|
return u.bind(null, !c);
|
|
2911
2909
|
}(t);
|
|
2912
2910
|
};
|
|
2913
2911
|
}
|
|
2914
2912
|
function rt(t, e) {
|
|
2915
|
-
if (
|
|
2913
|
+
if (se(t))
|
|
2916
2914
|
return e ? rt(document.querySelectorAll(t)) : (n = t).split(n.indexOf(",") > -1 ? "," : " ").map(function(a) {
|
|
2917
2915
|
return a.trim();
|
|
2918
2916
|
});
|
|
@@ -2924,7 +2922,7 @@ function rt(t, e) {
|
|
|
2924
2922
|
}
|
|
2925
2923
|
var o = $i(t);
|
|
2926
2924
|
return e ? o.map(function(a) {
|
|
2927
|
-
return
|
|
2925
|
+
return se(a) ? rt(a, !0) : a;
|
|
2928
2926
|
}).flat() : o;
|
|
2929
2927
|
}
|
|
2930
2928
|
function Co(t, e) {
|
|
@@ -2934,17 +2932,17 @@ function Co(t, e) {
|
|
|
2934
2932
|
};
|
|
2935
2933
|
}
|
|
2936
2934
|
var wt = jo("Event");
|
|
2937
|
-
function
|
|
2938
|
-
return J &&
|
|
2935
|
+
function Ir(t, e) {
|
|
2936
|
+
return J && Y(window[t]) ? (n = window[t], r = e, (i = window) === void 0 && (i = null), Y(n) ? function() {
|
|
2939
2937
|
n.apply(i, arguments), r.apply(i, arguments);
|
|
2940
2938
|
} : r) : window[t] = e;
|
|
2941
2939
|
var n, r, i;
|
|
2942
2940
|
}
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
var
|
|
2941
|
+
Ir.bind(null, "onerror");
|
|
2942
|
+
Ir.bind(null, "onload");
|
|
2943
|
+
var Sr = typeof window > "u", jn = "hidden";
|
|
2946
2944
|
function xo(t) {
|
|
2947
|
-
if (
|
|
2945
|
+
if (Sr)
|
|
2948
2946
|
return !1;
|
|
2949
2947
|
var e = Ao(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
|
|
2950
2948
|
return t(!!document[e]);
|
|
@@ -2957,7 +2955,7 @@ function xo(t) {
|
|
|
2957
2955
|
}
|
|
2958
2956
|
function Ao() {
|
|
2959
2957
|
var t = ["webkit", "moz", "ms", "o"];
|
|
2960
|
-
return
|
|
2958
|
+
return Sr || jn in document ? jn : t.reduce(function(e, n) {
|
|
2961
2959
|
var r = n + "Hidden";
|
|
2962
2960
|
return !e && r in document ? r : e;
|
|
2963
2961
|
}, null);
|
|
@@ -2999,10 +2997,10 @@ function zo(t) {
|
|
|
2999
2997
|
u = !0, r && (n = /* @__PURE__ */ new Date(), r(De(f), v));
|
|
3000
2998
|
}, s);
|
|
3001
2999
|
}
|
|
3002
|
-
var
|
|
3000
|
+
var k = No(w, { throttle: p });
|
|
3003
3001
|
return { disable: function() {
|
|
3004
3002
|
c = !0, u = !1, d();
|
|
3005
|
-
var v =
|
|
3003
|
+
var v = k();
|
|
3006
3004
|
return function() {
|
|
3007
3005
|
return c = !1, f = /* @__PURE__ */ new Date(), w({ type: "load" }), v();
|
|
3008
3006
|
};
|
|
@@ -3013,7 +3011,7 @@ function zo(t) {
|
|
|
3013
3011
|
function De(t, e) {
|
|
3014
3012
|
return e ? 0 : Math.round((/* @__PURE__ */ new Date() - t) / 1e3);
|
|
3015
3013
|
}
|
|
3016
|
-
const
|
|
3014
|
+
const Cn = 5e3;
|
|
3017
3015
|
class Do {
|
|
3018
3016
|
constructor(e) {
|
|
3019
3017
|
B(this, "element");
|
|
@@ -3039,8 +3037,8 @@ class Do {
|
|
|
3039
3037
|
), this.observer.observe(this.element), zo({
|
|
3040
3038
|
onIdle: (n) => this.handleAwake(!1, n),
|
|
3041
3039
|
onWakeUp: (n) => this.handleAwake(!0, n),
|
|
3042
|
-
timeout:
|
|
3043
|
-
}),
|
|
3040
|
+
timeout: Cn
|
|
3041
|
+
}), Po({
|
|
3044
3042
|
25: this.handleScroll.bind(this),
|
|
3045
3043
|
50: this.handleScroll.bind(this),
|
|
3046
3044
|
75: this.handleScroll.bind(this),
|
|
@@ -3058,7 +3056,7 @@ class Do {
|
|
|
3058
3056
|
e ? (this.isAwake = !0, this.trackInViewport()) : this.handleAwake(!1), this.isInViewport = e;
|
|
3059
3057
|
}
|
|
3060
3058
|
handleAwake(e, n = Math.round((Date.now() - this.lastEventAt) / 1e3)) {
|
|
3061
|
-
this.isAwake = e, this.lastEventAt = e ? Date.now() - n *
|
|
3059
|
+
this.isAwake = e, this.lastEventAt = e ? Date.now() - n * Cn : Date.now(), this.isInViewport && this.trackAwake(e, n);
|
|
3062
3060
|
}
|
|
3063
3061
|
handleScroll(e) {
|
|
3064
3062
|
this.scrollCallback && this.scrollCallback(e);
|
|
@@ -3075,53 +3073,53 @@ class Do {
|
|
|
3075
3073
|
this.registeredView || (this.registeredView = !0, this.viewCallback && this.viewCallback());
|
|
3076
3074
|
}
|
|
3077
3075
|
}
|
|
3078
|
-
const
|
|
3076
|
+
const xn = "sesamy_session_id";
|
|
3079
3077
|
function Uo() {
|
|
3080
|
-
let t = sessionStorage.getItem(
|
|
3081
|
-
return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(
|
|
3078
|
+
let t = sessionStorage.getItem(xn);
|
|
3079
|
+
return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(xn, t)), t;
|
|
3082
3080
|
}
|
|
3083
|
-
let
|
|
3084
|
-
function Ro({ clientId: t, enabled: e = !0, endpoint: n =
|
|
3085
|
-
if (Ct = t,
|
|
3081
|
+
let _r = !1, Ct, An, it;
|
|
3082
|
+
function Ro({ clientId: t, enabled: e = !0, endpoint: n = ii }) {
|
|
3083
|
+
if (Ct = t, An = e, it = n, !An)
|
|
3086
3084
|
return;
|
|
3087
3085
|
To();
|
|
3088
3086
|
const r = new Do({
|
|
3089
3087
|
element: document.body,
|
|
3090
3088
|
viewCallback: () => {
|
|
3091
|
-
|
|
3089
|
+
ne.page();
|
|
3092
3090
|
},
|
|
3093
3091
|
activeDurationCallback: (i, o, a) => {
|
|
3094
|
-
|
|
3092
|
+
ne.track("activeDuration", {
|
|
3095
3093
|
duration: i,
|
|
3096
3094
|
durationStart: a,
|
|
3097
3095
|
flushing: o
|
|
3098
3096
|
});
|
|
3099
3097
|
},
|
|
3100
3098
|
idleDurationCallback: (i, o, a) => {
|
|
3101
|
-
|
|
3099
|
+
ne.track("idleDuration", {
|
|
3102
3100
|
duration: i,
|
|
3103
3101
|
durationStart: a,
|
|
3104
3102
|
flushing: o
|
|
3105
3103
|
});
|
|
3106
3104
|
},
|
|
3107
3105
|
scrollCallback: (i) => {
|
|
3108
|
-
|
|
3106
|
+
ne.track("scroll", {
|
|
3109
3107
|
scroll: i.scrollMax
|
|
3110
3108
|
});
|
|
3111
3109
|
}
|
|
3112
3110
|
});
|
|
3113
3111
|
Zo(document.body, () => {
|
|
3114
3112
|
r.flush();
|
|
3115
|
-
}),
|
|
3113
|
+
}), Ko(document.body, () => {
|
|
3116
3114
|
r.handleVisibilityChange();
|
|
3117
|
-
}), window.addEventListener(
|
|
3115
|
+
}), window.addEventListener(Q.AUTHENTICATED, async (i) => {
|
|
3118
3116
|
const o = i;
|
|
3119
|
-
await
|
|
3120
|
-
}), window.addEventListener(
|
|
3121
|
-
await
|
|
3117
|
+
await ne.identify(o.detail.sub);
|
|
3118
|
+
}), window.addEventListener(Q.LOGOUT, async () => {
|
|
3119
|
+
await ne.track("logout", {}), Kt.flush(), await ne.reset();
|
|
3122
3120
|
});
|
|
3123
3121
|
}
|
|
3124
|
-
function
|
|
3122
|
+
function Er(t) {
|
|
3125
3123
|
return JSON.stringify(
|
|
3126
3124
|
t.map((e) => ({
|
|
3127
3125
|
...e,
|
|
@@ -3129,7 +3127,7 @@ function _r(t) {
|
|
|
3129
3127
|
requestId: Math.random().toString(36).slice(2, 9),
|
|
3130
3128
|
sessionId: Uo(),
|
|
3131
3129
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3132
|
-
version:
|
|
3130
|
+
version: zt,
|
|
3133
3131
|
event: e.event,
|
|
3134
3132
|
context: {
|
|
3135
3133
|
page: {
|
|
@@ -3140,7 +3138,7 @@ function _r(t) {
|
|
|
3140
3138
|
referrer: document.referrer
|
|
3141
3139
|
},
|
|
3142
3140
|
locale: navigator.language,
|
|
3143
|
-
library:
|
|
3141
|
+
library: er,
|
|
3144
3142
|
userAgent: navigator.userAgent,
|
|
3145
3143
|
clientId: Ct
|
|
3146
3144
|
}
|
|
@@ -3150,8 +3148,8 @@ function _r(t) {
|
|
|
3150
3148
|
const Kt = Io(
|
|
3151
3149
|
async (t) => {
|
|
3152
3150
|
if (t.length > 0) {
|
|
3153
|
-
const e =
|
|
3154
|
-
|
|
3151
|
+
const e = Er(t);
|
|
3152
|
+
_r ? navigator.sendBeacon(it, e) : (await fetch(it, {
|
|
3155
3153
|
method: "POST",
|
|
3156
3154
|
body: e,
|
|
3157
3155
|
headers: {
|
|
@@ -3172,13 +3170,13 @@ function bt(t) {
|
|
|
3172
3170
|
if (t.anonymousId)
|
|
3173
3171
|
if ((e = t.properties) != null && e.flushing) {
|
|
3174
3172
|
const n = { ...t };
|
|
3175
|
-
delete n.properties.flushing, navigator.sendBeacon(it,
|
|
3173
|
+
delete n.properties.flushing, navigator.sendBeacon(it, Er([n]));
|
|
3176
3174
|
} else
|
|
3177
3175
|
Kt.push(t);
|
|
3178
3176
|
}
|
|
3179
|
-
const
|
|
3180
|
-
app:
|
|
3181
|
-
version:
|
|
3177
|
+
const ne = ko({
|
|
3178
|
+
app: er,
|
|
3179
|
+
version: zt,
|
|
3182
3180
|
plugins: [
|
|
3183
3181
|
{
|
|
3184
3182
|
name: "custom-analytics-plugin",
|
|
@@ -3215,39 +3213,39 @@ const te = ko({
|
|
|
3215
3213
|
]
|
|
3216
3214
|
});
|
|
3217
3215
|
function Lo(t, e) {
|
|
3218
|
-
|
|
3216
|
+
ne.track(t, e);
|
|
3219
3217
|
}
|
|
3220
3218
|
function Mo() {
|
|
3221
|
-
return
|
|
3219
|
+
return _r = !0, Kt.flush();
|
|
3222
3220
|
}
|
|
3223
|
-
const
|
|
3221
|
+
const Tr = /* @__PURE__ */ new Map();
|
|
3224
3222
|
function Zo(t, e) {
|
|
3225
|
-
|
|
3223
|
+
Tr.set(t, e);
|
|
3226
3224
|
}
|
|
3227
3225
|
window.addEventListener("beforeunload", () => {
|
|
3228
|
-
|
|
3226
|
+
Tr.forEach((t, e) => {
|
|
3229
3227
|
t.bind(e)();
|
|
3230
3228
|
}), Mo();
|
|
3231
3229
|
});
|
|
3232
|
-
const
|
|
3233
|
-
function
|
|
3234
|
-
|
|
3230
|
+
const Pr = /* @__PURE__ */ new Map();
|
|
3231
|
+
function Ko(t, e) {
|
|
3232
|
+
Pr.set(t, e);
|
|
3235
3233
|
}
|
|
3236
3234
|
window.addEventListener("visibilitychange", () => {
|
|
3237
|
-
document.visibilityState !== "visible" &&
|
|
3235
|
+
document.visibilityState !== "visible" && Pr.forEach((t, e) => {
|
|
3238
3236
|
t.bind(e)();
|
|
3239
3237
|
});
|
|
3240
3238
|
});
|
|
3241
3239
|
const Or = "sesamySignedURLs";
|
|
3242
|
-
function
|
|
3240
|
+
function jr() {
|
|
3243
3241
|
const t = sessionStorage.getItem(Or);
|
|
3244
3242
|
return t ? JSON.parse(t) : [];
|
|
3245
3243
|
}
|
|
3246
|
-
function
|
|
3247
|
-
const e =
|
|
3244
|
+
function Wo(t) {
|
|
3245
|
+
const e = jr();
|
|
3248
3246
|
e.push(t), sessionStorage.setItem(Or, JSON.stringify(e));
|
|
3249
3247
|
}
|
|
3250
|
-
function
|
|
3248
|
+
function Ho(t) {
|
|
3251
3249
|
const {
|
|
3252
3250
|
getEntitlement: e,
|
|
3253
3251
|
getEntitlements: n,
|
|
@@ -3257,40 +3255,41 @@ function Fo(t) {
|
|
|
3257
3255
|
getContracts: a,
|
|
3258
3256
|
getBill: s,
|
|
3259
3257
|
getBills: h,
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3258
|
+
getProfile: p,
|
|
3259
|
+
getTags: u,
|
|
3260
|
+
deleteTag: c,
|
|
3261
|
+
setTag: f,
|
|
3262
|
+
getUserMetadata: d,
|
|
3263
|
+
listUserMetadata: w,
|
|
3264
|
+
setUserMetadata: k,
|
|
3265
|
+
deleteUserMetadata: v,
|
|
3266
|
+
getTally: E,
|
|
3267
|
+
getTallies: _,
|
|
3268
|
+
pushTally: g,
|
|
3269
|
+
deleteTally: l,
|
|
3270
|
+
getProduct: b,
|
|
3271
|
+
autoOnboardProduct: T
|
|
3273
3272
|
} = Si(t), O = {
|
|
3274
3273
|
auth: {
|
|
3275
|
-
getUser:
|
|
3276
|
-
isAuthenticated:
|
|
3274
|
+
getUser: p,
|
|
3275
|
+
isAuthenticated: ai,
|
|
3277
3276
|
loginWithRedirect: si,
|
|
3278
3277
|
logout: ui,
|
|
3279
|
-
setToken:
|
|
3278
|
+
setToken: Gn
|
|
3280
3279
|
},
|
|
3281
3280
|
analytics: {
|
|
3282
3281
|
track: Lo
|
|
3283
3282
|
},
|
|
3284
3283
|
tags: {
|
|
3285
|
-
list:
|
|
3286
|
-
set:
|
|
3287
|
-
delete:
|
|
3284
|
+
list: u,
|
|
3285
|
+
set: f,
|
|
3286
|
+
delete: c
|
|
3288
3287
|
},
|
|
3289
3288
|
entitlements: {
|
|
3290
3289
|
get: e,
|
|
3291
3290
|
list: n,
|
|
3292
3291
|
access: r,
|
|
3293
|
-
signedLinks:
|
|
3292
|
+
signedLinks: jr
|
|
3294
3293
|
},
|
|
3295
3294
|
contracts: {
|
|
3296
3295
|
get: o,
|
|
@@ -3301,46 +3300,46 @@ function Fo(t) {
|
|
|
3301
3300
|
list: h
|
|
3302
3301
|
},
|
|
3303
3302
|
userMetadata: {
|
|
3304
|
-
get:
|
|
3305
|
-
list:
|
|
3306
|
-
set:
|
|
3307
|
-
delete:
|
|
3303
|
+
get: d,
|
|
3304
|
+
list: w,
|
|
3305
|
+
set: k,
|
|
3306
|
+
delete: v
|
|
3308
3307
|
},
|
|
3309
3308
|
tallies: {
|
|
3310
|
-
get:
|
|
3311
|
-
list:
|
|
3312
|
-
push:
|
|
3313
|
-
delete:
|
|
3309
|
+
get: E,
|
|
3310
|
+
list: _,
|
|
3311
|
+
push: g,
|
|
3312
|
+
delete: l
|
|
3314
3313
|
},
|
|
3315
3314
|
subscriptions: {
|
|
3316
3315
|
list: i
|
|
3317
3316
|
},
|
|
3318
3317
|
products: {
|
|
3319
|
-
get:
|
|
3320
|
-
autoOnboard:
|
|
3318
|
+
get: b,
|
|
3319
|
+
autoOnboard: T
|
|
3321
3320
|
},
|
|
3322
|
-
getVersion:
|
|
3321
|
+
getVersion: Fo,
|
|
3323
3322
|
clearCache: re
|
|
3324
3323
|
};
|
|
3325
3324
|
return t.namespace && (window[t.namespace] = O), O;
|
|
3326
3325
|
}
|
|
3327
|
-
function
|
|
3328
|
-
return
|
|
3326
|
+
function Fo() {
|
|
3327
|
+
return zt;
|
|
3329
3328
|
}
|
|
3330
3329
|
function Jo() {
|
|
3331
3330
|
const t = new URLSearchParams(window.location.hash.substring(1)), e = t.get("access_token"), n = t.get("expires_in");
|
|
3332
3331
|
if (e) {
|
|
3333
|
-
|
|
3332
|
+
Gn(e, n ? parseInt(n, 10) : void 0);
|
|
3334
3333
|
const r = new URL(window.location.href);
|
|
3335
3334
|
t.delete("access_token"), t.delete("expires_in"), r.hash = t.toString(), window.history.replaceState(null, "", r);
|
|
3336
3335
|
}
|
|
3337
3336
|
}
|
|
3338
|
-
const
|
|
3337
|
+
const $n = "sesamy-refresh", Nn = "force-refetch-entitlements";
|
|
3339
3338
|
function Xo() {
|
|
3340
|
-
const t = new URLSearchParams(window.location.search), e = t.get(
|
|
3339
|
+
const t = new URLSearchParams(window.location.search), e = t.get(Nn), n = t.get($n);
|
|
3341
3340
|
if (e !== null || n !== null) {
|
|
3342
3341
|
const r = new URL(window.location.href);
|
|
3343
|
-
t.delete(
|
|
3342
|
+
t.delete(Nn), t.delete($n), r.search = t.toString(), re(), window.history.replaceState(null, "", r);
|
|
3344
3343
|
}
|
|
3345
3344
|
}
|
|
3346
3345
|
function Vo() {
|
|
@@ -3350,7 +3349,7 @@ function Vo() {
|
|
|
3350
3349
|
const r = parseInt(n, 10);
|
|
3351
3350
|
if (Number.isNaN(r) || r < Date.now())
|
|
3352
3351
|
return;
|
|
3353
|
-
|
|
3352
|
+
Wo({
|
|
3354
3353
|
url: window.location.href.split("?")[0],
|
|
3355
3354
|
token: e,
|
|
3356
3355
|
expiresAt: r,
|
|
@@ -3359,29 +3358,37 @@ function Vo() {
|
|
|
3359
3358
|
const i = new URL(window.location.href);
|
|
3360
3359
|
i.searchParams.delete("ss"), i.searchParams.delete("se"), i.searchParams.delete("sp"), i.searchParams.delete("so"), i.searchParams.delete("token"), window.history.replaceState(null, "", i);
|
|
3361
3360
|
}
|
|
3362
|
-
|
|
3361
|
+
const zn = "sesamy-purchase";
|
|
3362
|
+
function Yo() {
|
|
3363
|
+
const t = new URLSearchParams(window.location.search), e = t.get(zn);
|
|
3364
|
+
if (e !== null) {
|
|
3365
|
+
const n = new URL(window.location.href);
|
|
3366
|
+
t.delete(zn), n.search = t.toString(), ue(Q.PURCHASE, { itemSrc: e }), re(), window.history.replaceState(null, "", n);
|
|
3367
|
+
}
|
|
3368
|
+
}
|
|
3369
|
+
async function Go(t) {
|
|
3363
3370
|
Ro({
|
|
3364
3371
|
clientId: t.clientId,
|
|
3365
3372
|
// The default client id can be overridden by the config
|
|
3366
3373
|
...t.analytics
|
|
3367
|
-
}), await
|
|
3374
|
+
}), await oi({
|
|
3368
3375
|
clientId: t.clientId,
|
|
3369
3376
|
// The default client id can be overridden by the config
|
|
3370
3377
|
...t.auth
|
|
3371
3378
|
});
|
|
3372
|
-
const e =
|
|
3373
|
-
return
|
|
3379
|
+
const e = Ho(t.api || {});
|
|
3380
|
+
return ue(Q.READY, {}), Jo(), Xo(), Vo(), Yo(), e;
|
|
3374
3381
|
}
|
|
3375
3382
|
if (typeof document < "u") {
|
|
3376
3383
|
const t = document.getElementById("sesamy-js");
|
|
3377
3384
|
if (t != null && t.textContent)
|
|
3378
3385
|
try {
|
|
3379
3386
|
const e = JSON.parse(t.textContent);
|
|
3380
|
-
|
|
3387
|
+
Go(e);
|
|
3381
3388
|
} catch (e) {
|
|
3382
3389
|
console.error("Failed to parse config", e);
|
|
3383
3390
|
}
|
|
3384
3391
|
}
|
|
3385
3392
|
export {
|
|
3386
|
-
|
|
3393
|
+
Go as init
|
|
3387
3394
|
};
|