@sesamy/sesamy-js 1.7.2 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/sesamy-js.cjs +5 -5
- package/dist/sesamy-js.d.ts +36 -4
- package/dist/sesamy-js.iife.js +5 -5
- package/dist/sesamy-js.mjs +915 -892
- package/package.json +1 -1
package/dist/sesamy-js.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
var Cr = Object.defineProperty;
|
|
2
|
+
var xr = (t, e, n) => e in t ? Cr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var G = (t, e, n) => (xr(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
function ye(t, e) {
|
|
5
5
|
const n = new CustomEvent(t, {
|
|
6
6
|
detail: e,
|
|
7
7
|
bubbles: !0,
|
|
@@ -20,14 +20,14 @@ function Q(t, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return n;
|
|
22
22
|
}
|
|
23
|
-
var
|
|
23
|
+
var de = 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 le = At(function(t, e) {
|
|
31
31
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
32
32
|
var n = function() {
|
|
33
33
|
function r() {
|
|
@@ -58,9 +58,9 @@ var ue = At(function(t, e) {
|
|
|
58
58
|
return n.getInstance();
|
|
59
59
|
};
|
|
60
60
|
});
|
|
61
|
-
xt(
|
|
62
|
-
var
|
|
63
|
-
var n =
|
|
61
|
+
xt(le);
|
|
62
|
+
var Ar = xt(At(function(t, e) {
|
|
63
|
+
var n = de && de.__awaiter || function(u, c, f, d) {
|
|
64
64
|
return new (f || (f = Promise))(function(w, k) {
|
|
65
65
|
function v(g) {
|
|
66
66
|
try {
|
|
@@ -83,7 +83,7 @@ var Cr = xt(At(function(t, e) {
|
|
|
83
83
|
}
|
|
84
84
|
S((d = d.apply(u, c || [])).next());
|
|
85
85
|
});
|
|
86
|
-
}, r =
|
|
86
|
+
}, r = de && de.__generator || function(u, c) {
|
|
87
87
|
var f, d, w, k, v = { label: 0, sent: function() {
|
|
88
88
|
if (1 & w[0])
|
|
89
89
|
throw w[1];
|
|
@@ -146,7 +146,7 @@ var Cr = xt(At(function(t, e) {
|
|
|
146
146
|
}([S, g]);
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
}, i =
|
|
149
|
+
}, i = de;
|
|
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() {
|
|
@@ -239,9 +239,9 @@ var Cr = xt(At(function(t, e) {
|
|
|
239
239
|
return r(this, function(S) {
|
|
240
240
|
switch (S.label) {
|
|
241
241
|
case 0:
|
|
242
|
-
return [4,
|
|
242
|
+
return [4, le.default().lock(f)];
|
|
243
243
|
case 1:
|
|
244
|
-
return S.sent(), this.acquiredIatSet.has(f) ? (k = this.storageHandler === void 0 ? a : this.storageHandler, (v = k.getItemSync(c)) === null ? (
|
|
244
|
+
return S.sent(), this.acquiredIatSet.has(f) ? (k = this.storageHandler === void 0 ? a : this.storageHandler, (v = k.getItemSync(c)) === null ? (le.default().unlock(f), [2]) : ((E = JSON.parse(v)).timeRefreshed = Date.now(), k.setItemSync(c, JSON.stringify(E)), le.default().unlock(f), this.refreshLockWhileAcquired(c, f), [2])) : (le.default().unlock(f), [2]);
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
247
|
});
|
|
@@ -297,9 +297,9 @@ var Cr = xt(At(function(t, e) {
|
|
|
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] : (k = JSON.parse(w)).id !== this.id ? [3, 2] : [4,
|
|
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, le.default().lock(k.iat)];
|
|
301
301
|
case 1:
|
|
302
|
-
v.sent(), this.acquiredIatSet.delete(k.iat), f.removeItemSync(d),
|
|
302
|
+
v.sent(), this.acquiredIatSet.delete(k.iat), f.removeItemSync(d), le.default().unlock(k.iat), u.notifyWaiters(), v.label = 2;
|
|
303
303
|
case 2:
|
|
304
304
|
return [2];
|
|
305
305
|
}
|
|
@@ -327,7 +327,7 @@ var Cr = xt(At(function(t, e) {
|
|
|
327
327
|
}();
|
|
328
328
|
e.default = p;
|
|
329
329
|
}));
|
|
330
|
-
const
|
|
330
|
+
const $r = { timeoutInSeconds: 60 }, zn = { name: "auth0-spa-js", version: "2.1.3" }, Dn = () => Date.now();
|
|
331
331
|
let Y = 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);
|
|
@@ -335,7 +335,7 @@ let Y = class kt extends Error {
|
|
|
335
335
|
static fromPayload({ error: e, error_description: n }) {
|
|
336
336
|
return new kt(e, n);
|
|
337
337
|
}
|
|
338
|
-
},
|
|
338
|
+
}, Nr = class Un extends Y {
|
|
339
339
|
constructor(e, n, r, i = null) {
|
|
340
340
|
super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, Un.prototype);
|
|
341
341
|
}
|
|
@@ -343,47 +343,47 @@ let Y = class kt extends Error {
|
|
|
343
343
|
constructor() {
|
|
344
344
|
super("timeout", "Timeout"), Object.setPrototypeOf(this, Rn.prototype);
|
|
345
345
|
}
|
|
346
|
-
},
|
|
346
|
+
}, zr = class Ln extends It {
|
|
347
347
|
constructor(e) {
|
|
348
|
-
super(), this.popup = e, Object.setPrototypeOf(this,
|
|
348
|
+
super(), this.popup = e, Object.setPrototypeOf(this, Ln.prototype);
|
|
349
349
|
}
|
|
350
|
-
},
|
|
350
|
+
}, Dr = class Mn extends Y {
|
|
351
351
|
constructor(e) {
|
|
352
|
-
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this,
|
|
352
|
+
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, Mn.prototype);
|
|
353
353
|
}
|
|
354
|
-
},
|
|
354
|
+
}, Ur = class Zn extends Y {
|
|
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, Zn.prototype);
|
|
357
357
|
}
|
|
358
|
-
},
|
|
358
|
+
}, Wn = class Kn extends Y {
|
|
359
359
|
constructor(e, n) {
|
|
360
|
-
super("missing_refresh_token", `Missing Refresh Token (audience: '${
|
|
360
|
+
super("missing_refresh_token", `Missing Refresh Token (audience: '${Ft(e, ["default"])}', scope: '${Ft(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, Kn.prototype);
|
|
361
361
|
}
|
|
362
362
|
};
|
|
363
|
-
function
|
|
363
|
+
function Ft(t, e = []) {
|
|
364
364
|
return t && !e.includes(t) ? t : "";
|
|
365
365
|
}
|
|
366
366
|
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
|
-
},
|
|
370
|
+
}, Ht = (t) => btoa(t), St = (t) => {
|
|
371
371
|
var { clientId: e } = t, n = Q(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, "+")), Rr = async (t, e) => {
|
|
374
374
|
const n = await fetch(t, e);
|
|
375
375
|
return { ok: n.ok, json: await n.json() };
|
|
376
376
|
}, Lr = 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([Rr(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
|
+
}, Mr = 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
|
-
},
|
|
395
|
-
async function
|
|
394
|
+
}, Zr = async (t, e, n, r, i, o, a = 1e4) => i ? Mr(t, e, n, r, a, i, o) : Lr(t, r, a);
|
|
395
|
+
async function Wr(t, e) {
|
|
396
396
|
var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, h = Q(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
|
|
397
397
|
const p = s ? St(h) : JSON.stringify(h);
|
|
398
398
|
return await async function(u, c, f, d, w, k, v) {
|
|
399
399
|
let E, S = null;
|
|
400
|
-
for (let
|
|
400
|
+
for (let A = 0; A < 3; A++)
|
|
401
401
|
try {
|
|
402
|
-
E = await
|
|
402
|
+
E = await Zr(u, f, d, w, k, v, c), S = null;
|
|
403
403
|
break;
|
|
404
404
|
} catch (U) {
|
|
405
405
|
S = U;
|
|
406
406
|
}
|
|
407
407
|
if (S)
|
|
408
408
|
throw S;
|
|
409
|
-
const g = E.json, { error: l, error_description: b } = g,
|
|
409
|
+
const g = E.json, { error: l, error_description: b } = g, O = Q(g, ["error", "error_description"]), { ok: j } = E;
|
|
410
410
|
if (!j) {
|
|
411
|
-
const
|
|
412
|
-
throw l === "mfa_required" ? new
|
|
411
|
+
const A = b || `HTTP error. Unable to fetch ${u}`;
|
|
412
|
+
throw l === "mfa_required" ? new Ur(l, A, O.mfa_token) : l === "missing_refresh_token" ? new Wn(f, d) : new Y(l || "request_error", A);
|
|
413
413
|
}
|
|
414
|
-
return
|
|
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 ||
|
|
414
|
+
return O;
|
|
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 || zn)) } }, e, s);
|
|
416
416
|
}
|
|
417
417
|
const He = (...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 fe = 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
|
+
}, Kr = 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 = {};
|
|
@@ -467,9 +467,9 @@ let he = class _t {
|
|
|
467
467
|
}, allKeys: () => Object.keys(e) };
|
|
468
468
|
}();
|
|
469
469
|
}
|
|
470
|
-
},
|
|
470
|
+
}, Fr = class {
|
|
471
471
|
constructor(e, n, r) {
|
|
472
|
-
this.cache = e, this.keyManifest = n, this.nowProvider = r ||
|
|
472
|
+
this.cache = e, this.keyManifest = n, this.nowProvider = r || Dn;
|
|
473
473
|
}
|
|
474
474
|
async setIdToken(e, n, r) {
|
|
475
475
|
var i;
|
|
@@ -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 fe({ 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 fe({ 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 = fe.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
|
+
}, Hr = 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", Jr = ["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"], Xr = (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], Jr.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", Fr = ["iss", "aud", "exp", "nbf", "iat",
|
|
|
620
620
|
}
|
|
621
621
|
return e;
|
|
622
622
|
};
|
|
623
|
-
var
|
|
624
|
-
var n =
|
|
623
|
+
var pe = At(function(t, e) {
|
|
624
|
+
var n = de && de.__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,27 +667,27 @@ 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(pe), pe.encode, pe.parse, pe.getAll;
|
|
671
|
+
var Vr = pe.get, Hn = pe.set, Jn = pe.remove;
|
|
672
|
+
const Ie = { get(t) {
|
|
673
|
+
const e = Vr(t);
|
|
674
674
|
if (e !== void 0)
|
|
675
675
|
return JSON.parse(e);
|
|
676
676
|
}, save(t, e, n) {
|
|
677
677
|
let r = {};
|
|
678
|
-
window.location.protocol === "https:" && (r = { secure: !0, sameSite: "none" }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain),
|
|
678
|
+
window.location.protocol === "https:" && (r = { secure: !0, sameSite: "none" }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), Hn(t, JSON.stringify(e), r);
|
|
679
679
|
}, remove(t, e) {
|
|
680
680
|
let n = {};
|
|
681
|
-
e != null && e.cookieDomain && (n.domain = e.cookieDomain),
|
|
682
|
-
} },
|
|
683
|
-
return
|
|
681
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Jn(t, n);
|
|
682
|
+
} }, Yr = { 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),
|
|
686
|
+
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), Hn(`_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),
|
|
690
|
-
} },
|
|
689
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Jn(t, n), Ie.remove(t, e), Ie.remove(`_legacy_${t}`, e);
|
|
690
|
+
} }, Gr = { get(t) {
|
|
691
691
|
if (typeof sessionStorage > "u")
|
|
692
692
|
return;
|
|
693
693
|
const e = sessionStorage.getItem(t);
|
|
@@ -697,7 +697,7 @@ const be = { get(t) {
|
|
|
697
697
|
}, remove(t) {
|
|
698
698
|
sessionStorage.removeItem(t);
|
|
699
699
|
} };
|
|
700
|
-
function
|
|
700
|
+
function Br(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 Yr(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 || Br(Xt, Vt, Yt), new Worker(ht, t);
|
|
715
715
|
});
|
|
716
716
|
const ft = {};
|
|
717
|
-
let
|
|
717
|
+
let Qr = 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 Br = class {
|
|
|
740
740
|
return `@@auth0spajs@@::${e}`;
|
|
741
741
|
}
|
|
742
742
|
};
|
|
743
|
-
const
|
|
743
|
+
const ei = { memory: () => new Fn().enclosedCache, localstorage: () => new Kr() }, Gt = (t) => ei[t], Bt = (t) => {
|
|
744
744
|
const { openUrl: e, onRedirect: n } = t, r = Q(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 Ar();
|
|
747
|
+
let ti = 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,17 +759,17 @@ let Qr = 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 : Yr, 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 : Gr;
|
|
768
768
|
var o;
|
|
769
|
-
this.scope = He("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new
|
|
769
|
+
this.scope = He("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new Hr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || Dn, this.cacheManager = new Fr(r, r.allKeys ? void 0 : new Qr(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
|
-
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client ||
|
|
772
|
+
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || zn)));
|
|
773
773
|
return `${this.domainUrl}${e}&auth0Client=${n}`;
|
|
774
774
|
}
|
|
775
775
|
_authorizeUrl(e) {
|
|
@@ -777,14 +777,14 @@ let Qr = class {
|
|
|
777
777
|
}
|
|
778
778
|
async _verifyIdToken(e, n, r) {
|
|
779
779
|
const i = await this.nowProvider();
|
|
780
|
-
return
|
|
780
|
+
return Xr({ 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 = Ht(dt()), o = Ht(dt()), a = dt(), s = ((u) => {
|
|
788
788
|
const c = new Uint8Array(u);
|
|
789
789
|
return ((f) => {
|
|
790
790
|
const d = { "+": "-", "/": "_", "=": "" };
|
|
@@ -805,9 +805,9 @@ let Qr = 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 Dr(s.popup)));
|
|
809
809
|
}, 1e3), f = setTimeout(() => {
|
|
810
|
-
clearInterval(c), p(new
|
|
810
|
+
clearInterval(c), p(new zr(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") {
|
|
@@ -834,7 +834,7 @@ let Qr = 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 = Q(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 = Q(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);
|
|
@@ -851,7 +851,7 @@ let Qr = class {
|
|
|
851
851
|
if (!s)
|
|
852
852
|
throw new Y("missing_transaction", "Invalid state");
|
|
853
853
|
if (this.transactionManager.remove(), o)
|
|
854
|
-
throw new
|
|
854
|
+
throw new Nr(o, a || o, r, s.appState);
|
|
855
855
|
if (!s.code_verifier || s.state && s.state !== r)
|
|
856
856
|
throw new Y("state_mismatch", "Invalid state");
|
|
857
857
|
const h = s.organization, p = s.nonce, u = s.redirect_uri;
|
|
@@ -909,7 +909,7 @@ let Qr = class {
|
|
|
909
909
|
async getTokenWithPopup(e = {}, n = {}) {
|
|
910
910
|
var r;
|
|
911
911
|
const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: He(this.scope, (r = e.authorizationParams) === null || r === void 0 ? void 0 : r.scope) }) });
|
|
912
|
-
return n = Object.assign(Object.assign({},
|
|
912
|
+
return n = Object.assign(Object.assign({}, $r), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new fe({ 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();
|
|
@@ -920,7 +920,7 @@ let Qr = class {
|
|
|
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 = Q(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);
|
|
@@ -939,14 +939,14 @@ let Qr = class {
|
|
|
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
|
|
942
|
+
const O = setTimeout(() => {
|
|
943
943
|
S(new It()), l();
|
|
944
944
|
}, 1e3 * v);
|
|
945
945
|
b = function(j) {
|
|
946
946
|
if (j.origin != k || !j.data || j.data.type !== "authorization_response")
|
|
947
947
|
return;
|
|
948
|
-
const
|
|
949
|
-
|
|
948
|
+
const A = j.source;
|
|
949
|
+
A && A.close(), j.data.response.error ? S(Y.fromPayload(j.data.response)) : E(j.data.response), clearTimeout(O), 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)
|
|
@@ -958,11 +958,11 @@ let Qr = 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 fe({ 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 {
|
|
@@ -979,98 +979,88 @@ let Qr = class {
|
|
|
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 fe({ 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 fe({ 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 });
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
992
|
async _requestToken(e, n) {
|
|
993
|
-
const { nonceIn: r, organization: i } = n || {}, o = await
|
|
993
|
+
const { nonceIn: r, organization: i } = n || {}, o = await Wr(Object.assign({ baseUrl: this.domainUrl, client_id: this.options.clientId, auth0Client: this.options.auth0Client, useFormData: this.options.useFormData, timeout: this.httpTimeoutMs }, e), this.worker), a = await this._verifyIdToken(o.id_token, r, i);
|
|
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 ni(t) {
|
|
998
|
+
const e = new ti(t);
|
|
999
999
|
return await e.checkSession(), e;
|
|
1000
1000
|
}
|
|
1001
|
-
const
|
|
1002
|
-
var
|
|
1003
|
-
let
|
|
1004
|
-
const $t = "sesamyAccessToken",
|
|
1005
|
-
function
|
|
1006
|
-
const t = localStorage.getItem(
|
|
1007
|
-
if (!(
|
|
1001
|
+
const Xn = "sesamy.com", ri = "https://logs.sesamy.com/events", Et = "sesamyCacheTimestamp";
|
|
1002
|
+
var ee = /* @__PURE__ */ ((t) => (t.READY = "sesamyJsReady", t.AUTHENTICATED = "sesamyJsAuthenticated", t.LOGOUT = "sesamyJsLogout", t.CLEAR_CACHE = "sesamyJsClearCache", t.USER_ATTRIBUTE_CHANGED = "sesamyUserAttributeChanged", t))(ee || {});
|
|
1003
|
+
let B;
|
|
1004
|
+
const $t = "sesamyAccessToken", Nt = "sesamyExpires";
|
|
1005
|
+
function Vn() {
|
|
1006
|
+
const t = localStorage.getItem(Nt);
|
|
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 && (
|
|
1012
|
-
domain: t.endpoint || `token.${
|
|
1010
|
+
async function ii(t) {
|
|
1011
|
+
if (t.enabled !== !1 && (B = await ni({
|
|
1012
|
+
domain: t.endpoint || `token.${Xn}`,
|
|
1013
1013
|
clientId: t.clientId
|
|
1014
1014
|
}), window.location.search.includes("code=")))
|
|
1015
1015
|
try {
|
|
1016
|
-
await
|
|
1017
|
-
const e = await
|
|
1018
|
-
|
|
1016
|
+
await B.handleRedirectCallback();
|
|
1017
|
+
const e = await B.getUser();
|
|
1018
|
+
ye(ee.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
|
|
1025
|
-
if (
|
|
1024
|
+
async function oi() {
|
|
1025
|
+
if (Vn())
|
|
1026
1026
|
return !0;
|
|
1027
|
-
if (!
|
|
1028
|
-
throw new Error("Auth0 client not initialized");
|
|
1029
|
-
return G.isAuthenticated();
|
|
1030
|
-
}
|
|
1031
|
-
async function ii() {
|
|
1032
|
-
if (Nt())
|
|
1033
|
-
return {
|
|
1034
|
-
sub: "local",
|
|
1035
|
-
name: "Local User"
|
|
1036
|
-
};
|
|
1037
|
-
if (!G)
|
|
1027
|
+
if (!B)
|
|
1038
1028
|
throw new Error("Auth0 client not initialized");
|
|
1039
|
-
return
|
|
1029
|
+
return B.isAuthenticated();
|
|
1040
1030
|
}
|
|
1041
|
-
function
|
|
1042
|
-
if (!
|
|
1031
|
+
function ai() {
|
|
1032
|
+
if (!B)
|
|
1043
1033
|
throw new Error("Auth0 client not initialized");
|
|
1044
|
-
return
|
|
1034
|
+
return B.loginWithRedirect({
|
|
1045
1035
|
authorizationParams: {
|
|
1046
1036
|
redirect_uri: window.location.href
|
|
1047
1037
|
}
|
|
1048
1038
|
});
|
|
1049
1039
|
}
|
|
1050
|
-
async function
|
|
1051
|
-
const e =
|
|
1040
|
+
async function si(t = !0) {
|
|
1041
|
+
const e = Vn();
|
|
1052
1042
|
if (e)
|
|
1053
1043
|
return e;
|
|
1054
1044
|
try {
|
|
1055
|
-
if (!
|
|
1045
|
+
if (!B)
|
|
1056
1046
|
throw new Error("Auth0 client not initialized");
|
|
1057
|
-
return await
|
|
1047
|
+
return await B.getTokenSilently();
|
|
1058
1048
|
} catch (n) {
|
|
1059
1049
|
if (t)
|
|
1060
1050
|
throw n;
|
|
1061
1051
|
return null;
|
|
1062
1052
|
}
|
|
1063
1053
|
}
|
|
1064
|
-
async function
|
|
1065
|
-
if (localStorage.removeItem($t), localStorage.removeItem(
|
|
1054
|
+
async function ci() {
|
|
1055
|
+
if (localStorage.removeItem($t), localStorage.removeItem(Nt), !B)
|
|
1066
1056
|
throw new Error("Auth0 client not initialized");
|
|
1067
|
-
return
|
|
1057
|
+
return ye(ee.LOGOUT, {}), B.logout({
|
|
1068
1058
|
logoutParams: {
|
|
1069
1059
|
returnTo: window.location.href
|
|
1070
1060
|
}
|
|
1071
1061
|
});
|
|
1072
1062
|
}
|
|
1073
|
-
function
|
|
1063
|
+
function ui(t) {
|
|
1074
1064
|
const e = t.split(".");
|
|
1075
1065
|
if (e.length !== 3)
|
|
1076
1066
|
throw new Error("Invalid JWT token format.");
|
|
@@ -1082,11 +1072,11 @@ function ci(t) {
|
|
|
1082
1072
|
return JSON.parse(i);
|
|
1083
1073
|
}
|
|
1084
1074
|
async function Yn(t, e) {
|
|
1085
|
-
localStorage.setItem($t, t), localStorage.setItem(
|
|
1086
|
-
const n =
|
|
1087
|
-
|
|
1075
|
+
localStorage.setItem($t, t), e && localStorage.setItem(Nt, JSON.stringify(e * 1e3 + (/* @__PURE__ */ new Date()).getTime()));
|
|
1076
|
+
const n = ui(t);
|
|
1077
|
+
ye(ee.AUTHENTICATED, n);
|
|
1088
1078
|
}
|
|
1089
|
-
const
|
|
1079
|
+
const li = (t, e) => e.skipDedupe || e.method !== "GET", di = (t, e) => e.method + "@" + t, hi = (t) => t.clone(), qt = ({ skip: t = li, key: e = di, resolver: n = hi } = {}) => {
|
|
1090
1080
|
const r = /* @__PURE__ */ new Map();
|
|
1091
1081
|
return (i) => (o, a) => {
|
|
1092
1082
|
if (t(o, a))
|
|
@@ -1106,7 +1096,7 @@ const ui = (t, e) => e.skipDedupe || e.method !== "GET", li = (t, e) => e.method
|
|
|
1106
1096
|
return r.delete(s), Promise.reject(h);
|
|
1107
1097
|
}
|
|
1108
1098
|
};
|
|
1109
|
-
},
|
|
1099
|
+
}, fi = (t, e) => t * e, pi = (t) => t && t.ok, Qt = ({ delayTimer: t = 500, delayRamp: e = fi, maxAttempts: n = 10, until: r = pi, 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);
|
|
@@ -1133,20 +1123,20 @@ const ui = (t, e) => e.skipDedupe || e.method !== "GET", li = (t, e) => e.method
|
|
|
1133
1123
|
throw d;
|
|
1134
1124
|
return f(null, d);
|
|
1135
1125
|
});
|
|
1136
|
-
},
|
|
1137
|
-
function
|
|
1126
|
+
}, mi = "application/json", Gn = "Content-Type", ke = Symbol(), Bn = Symbol();
|
|
1127
|
+
function en(t = {}) {
|
|
1138
1128
|
var e;
|
|
1139
1129
|
return (e = Object.entries(t).find(([n]) => n.toLowerCase() === Gn.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 me = 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] = me(a, o, n) : r[i] = o, r;
|
|
1148
1138
|
}, { ...t });
|
|
1149
|
-
},
|
|
1139
|
+
}, Pe = {
|
|
1150
1140
|
// Default options
|
|
1151
1141
|
options: {},
|
|
1152
1142
|
// Error type
|
|
@@ -1167,25 +1157,25 @@ const pe = function(t, e, n = !1) {
|
|
|
1167
1157
|
return n && i ? new i(...r) : i;
|
|
1168
1158
|
}
|
|
1169
1159
|
};
|
|
1170
|
-
function mi(t, e = !1) {
|
|
1171
|
-
Te.options = e ? t : pe(Te.options, t);
|
|
1172
|
-
}
|
|
1173
1160
|
function gi(t, e = !1) {
|
|
1174
|
-
|
|
1161
|
+
Pe.options = e ? t : me(Pe.options, t);
|
|
1175
1162
|
}
|
|
1176
|
-
function yi(t) {
|
|
1177
|
-
|
|
1163
|
+
function yi(t, e = !1) {
|
|
1164
|
+
Pe.polyfills = e ? t : me(Pe.polyfills, t);
|
|
1178
1165
|
}
|
|
1179
|
-
|
|
1166
|
+
function vi(t) {
|
|
1167
|
+
Pe.errorType = t;
|
|
1168
|
+
}
|
|
1169
|
+
const wi = (t) => (e) => t.reduceRight((n, r) => r(n), e) || e;
|
|
1180
1170
|
class qn extends Error {
|
|
1181
1171
|
}
|
|
1182
|
-
const
|
|
1172
|
+
const bi = (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 = me(i.options, r);
|
|
1186
1176
|
let c = n;
|
|
1187
|
-
const f =
|
|
1188
|
-
throw { [
|
|
1177
|
+
const f = wi(s)((g, l) => (c = g, i.polyfill("fetch")(g, l)))(n, u), d = new Error(), w = f.catch((g) => {
|
|
1178
|
+
throw { [ke]: g };
|
|
1189
1179
|
}).then((g) => {
|
|
1190
1180
|
if (!g.ok) {
|
|
1191
1181
|
const l = new qn();
|
|
@@ -1193,8 +1183,8 @@ const wi = (t) => {
|
|
|
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 O;
|
|
1187
|
+
if (l.message = b, i.errorType === "json" || ((O = g.headers.get("Content-Type")) === null || O === void 0 ? void 0 : O.split(";")[0]) === "application/json")
|
|
1198
1188
|
try {
|
|
1199
1189
|
l.json = JSON.parse(b);
|
|
1200
1190
|
} catch {
|
|
@@ -1204,13 +1194,13 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1204
1194
|
}
|
|
1205
1195
|
return g;
|
|
1206
1196
|
}), k = (g) => g.catch((l) => {
|
|
1207
|
-
const b = l.hasOwnProperty(
|
|
1197
|
+
const b = l.hasOwnProperty(ke), O = b ? l[ke] : l, j = (O == null ? void 0 : O.status) && p.get(O.status) || p.get(O == null ? void 0 : O.name) || b && p.has(ke) && p.get(ke);
|
|
1208
1198
|
if (j)
|
|
1209
|
-
return j(
|
|
1210
|
-
const
|
|
1211
|
-
if (
|
|
1212
|
-
return
|
|
1213
|
-
throw
|
|
1199
|
+
return j(O, t);
|
|
1200
|
+
const A = p.get(Bn);
|
|
1201
|
+
if (A)
|
|
1202
|
+
return A(O, t);
|
|
1203
|
+
throw O;
|
|
1214
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,
|
|
@@ -1243,17 +1233,17 @@ 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
|
}, S = h.reduce((g, l) => ({
|
|
1249
1239
|
...g,
|
|
1250
1240
|
...typeof l.resolver == "function" ? l.resolver(g) : l.resolver
|
|
1251
1241
|
}), E);
|
|
1252
1242
|
return a.reduce((g, l) => l(g, t), S);
|
|
1253
|
-
},
|
|
1243
|
+
}, ki = {
|
|
1254
1244
|
_url: "",
|
|
1255
1245
|
_options: {},
|
|
1256
|
-
_config:
|
|
1246
|
+
_config: Pe,
|
|
1257
1247
|
_catchers: /* @__PURE__ */ new Map(),
|
|
1258
1248
|
_resolvers: [],
|
|
1259
1249
|
_deferred: [],
|
|
@@ -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 : me(this._config.polyfills, t)
|
|
1280
1270
|
}
|
|
1281
1271
|
};
|
|
1282
1272
|
},
|
|
@@ -1290,11 +1280,11 @@ 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 : me(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: me(this._options, { headers: e }) };
|
|
1298
1288
|
},
|
|
1299
1289
|
accept(t) {
|
|
1300
1290
|
return this.headers({ Accept: t });
|
|
@@ -1329,8 +1319,8 @@ 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 =
|
|
1333
|
-
return r = n ? o ? r.json(n, i) : r.body(n) : r,
|
|
1322
|
+
const i = en(r._options.headers), o = typeof n == "object" && (!r._options.headers || !i || tn(i));
|
|
1323
|
+
return r = n ? o ? r.json(n, i) : r.body(n) : r, bi(r._deferred.reduce((a, s) => s(a, a._url, a._options), r));
|
|
1334
1324
|
},
|
|
1335
1325
|
get(t = "") {
|
|
1336
1326
|
return this.fetch("GET", t);
|
|
@@ -1357,151 +1347,157 @@ 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 || mi).body(JSON.stringify(t));
|
|
1362
1352
|
}
|
|
1363
1353
|
};
|
|
1364
|
-
function
|
|
1365
|
-
return { ...
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
function
|
|
1373
|
-
sessionStorage.removeItem(Et),
|
|
1374
|
-
}
|
|
1375
|
-
function
|
|
1376
|
-
const e = t.endpoint || `https://api2.${
|
|
1377
|
-
let
|
|
1378
|
-
|
|
1379
|
-
const
|
|
1380
|
-
...
|
|
1354
|
+
function ue(t = "", e = {}) {
|
|
1355
|
+
return { ...ki, _url: t, _options: e };
|
|
1356
|
+
}
|
|
1357
|
+
ue.default = ue;
|
|
1358
|
+
ue.options = gi;
|
|
1359
|
+
ue.errorType = vi;
|
|
1360
|
+
ue.polyfills = yi;
|
|
1361
|
+
ue.WretchError = qn;
|
|
1362
|
+
function ie() {
|
|
1363
|
+
sessionStorage.removeItem(Et), ye(ee.CLEAR_CACHE, {});
|
|
1364
|
+
}
|
|
1365
|
+
function Ii(t) {
|
|
1366
|
+
const e = t.endpoint || `https://api2.${Xn}`, n = (I) => async (T, _) => {
|
|
1367
|
+
let Z = sessionStorage.getItem(Et);
|
|
1368
|
+
Z || (Z = Date.now().toString(), sessionStorage.setItem(Et, Z));
|
|
1369
|
+
const W = {
|
|
1370
|
+
..._,
|
|
1381
1371
|
headers: {
|
|
1382
|
-
...
|
|
1383
|
-
"Cache-Timestamp":
|
|
1372
|
+
..._.headers,
|
|
1373
|
+
"Cache-Timestamp": Z
|
|
1384
1374
|
}
|
|
1385
1375
|
};
|
|
1386
|
-
return
|
|
1387
|
-
}, r = (
|
|
1388
|
-
let
|
|
1389
|
-
if (
|
|
1390
|
-
if (
|
|
1376
|
+
return I(T, W);
|
|
1377
|
+
}, r = (I = !0) => (T) => async (_, Z) => {
|
|
1378
|
+
let W = null;
|
|
1379
|
+
if (W = await si(I), !W) {
|
|
1380
|
+
if (I)
|
|
1391
1381
|
throw new Error("No access token available");
|
|
1392
|
-
return
|
|
1382
|
+
return T(_, Z);
|
|
1393
1383
|
}
|
|
1394
|
-
const
|
|
1395
|
-
...
|
|
1384
|
+
const te = {
|
|
1385
|
+
...Z,
|
|
1396
1386
|
headers: {
|
|
1397
|
-
...
|
|
1398
|
-
...
|
|
1387
|
+
...Z.headers,
|
|
1388
|
+
...W ? { Authorization: `Bearer ${W}` } : {}
|
|
1399
1389
|
}
|
|
1400
1390
|
};
|
|
1401
|
-
return
|
|
1402
|
-
}, i = (
|
|
1403
|
-
if (
|
|
1404
|
-
return
|
|
1405
|
-
const
|
|
1406
|
-
...
|
|
1391
|
+
return T(_, te);
|
|
1392
|
+
}, i = (I) => (T, _) => {
|
|
1393
|
+
if (_.headers.Authorization)
|
|
1394
|
+
return I(T, _);
|
|
1395
|
+
const Z = localStorage.getItem("__anon_id"), W = btoa(`${Z}:`), te = {
|
|
1396
|
+
..._,
|
|
1407
1397
|
headers: {
|
|
1408
|
-
...
|
|
1409
|
-
Authorization: `Basic ${
|
|
1398
|
+
..._.headers,
|
|
1399
|
+
Authorization: `Basic ${W}`
|
|
1410
1400
|
}
|
|
1411
1401
|
};
|
|
1412
|
-
return
|
|
1413
|
-
}, o =
|
|
1402
|
+
return I(T, te);
|
|
1403
|
+
}, o = ue(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: (I, T) => I * T,
|
|
1420
1410
|
maxAttempts: 3,
|
|
1421
|
-
until: (
|
|
1411
|
+
until: (I) => !!(I && (I.ok || I.status >= 400 && I.status < 500)),
|
|
1422
1412
|
retryOnNetworkError: !1
|
|
1423
1413
|
})
|
|
1424
|
-
]), a =
|
|
1414
|
+
]), a = ue(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: (I, T) => I * T,
|
|
1432
1422
|
maxAttempts: 3,
|
|
1433
|
-
until: (
|
|
1423
|
+
until: (I) => !!(I && (I.ok || I.status >= 400 && I.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(I) {
|
|
1431
|
+
const T = await o.get("/entitlements").json();
|
|
1432
|
+
return T == null ? void 0 : T.find((_) => _.id === I);
|
|
1443
1433
|
}
|
|
1444
|
-
async function p(
|
|
1445
|
-
return o.get(`/entitlements/${
|
|
1434
|
+
async function p(I) {
|
|
1435
|
+
return o.get(`/entitlements/${I}/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(I) {
|
|
1441
|
+
const T = await o.get("/contracts").json();
|
|
1442
|
+
return T == null ? void 0 : T.find((_) => _.id === I);
|
|
1453
1443
|
}
|
|
1454
1444
|
async function f() {
|
|
1445
|
+
return o.get("/subscriptions").json();
|
|
1446
|
+
}
|
|
1447
|
+
async function d() {
|
|
1455
1448
|
return o.get("/bills").json();
|
|
1456
1449
|
}
|
|
1457
|
-
async function
|
|
1458
|
-
const
|
|
1459
|
-
return
|
|
1450
|
+
async function w(I) {
|
|
1451
|
+
const T = await o.get("/bills").json();
|
|
1452
|
+
return T == null ? void 0 : T.find((_) => _.id === I);
|
|
1460
1453
|
}
|
|
1461
|
-
async function
|
|
1462
|
-
const
|
|
1463
|
-
return
|
|
1454
|
+
async function k(I, T) {
|
|
1455
|
+
const _ = await o.url(`/user-metadata/${I}`).put(T).json();
|
|
1456
|
+
return ye(ee.USER_ATTRIBUTE_CHANGED, {}), ie(), _;
|
|
1464
1457
|
}
|
|
1465
|
-
async function
|
|
1466
|
-
const
|
|
1467
|
-
return
|
|
1458
|
+
async function v(I) {
|
|
1459
|
+
const T = await o.url(`/user-metadata/${I}`).delete().res();
|
|
1460
|
+
return ie(), T.ok;
|
|
1468
1461
|
}
|
|
1469
|
-
async function
|
|
1470
|
-
return (await o.url(`/user-metadata/${
|
|
1462
|
+
async function E(I) {
|
|
1463
|
+
return (await o.url(`/user-metadata/${I}`).get().json())[I];
|
|
1471
1464
|
}
|
|
1472
|
-
async function
|
|
1465
|
+
async function S() {
|
|
1473
1466
|
return await o.url("/user-metadata").get().json();
|
|
1474
1467
|
}
|
|
1475
|
-
async function
|
|
1468
|
+
async function g() {
|
|
1476
1469
|
return await o.url("/tags").get().json();
|
|
1477
1470
|
}
|
|
1478
|
-
async function
|
|
1479
|
-
const
|
|
1480
|
-
return
|
|
1471
|
+
async function l(I) {
|
|
1472
|
+
const T = await o.url(`/tags/${I}`).delete().res();
|
|
1473
|
+
return ie(), T.ok;
|
|
1481
1474
|
}
|
|
1482
|
-
async function
|
|
1483
|
-
const
|
|
1484
|
-
return
|
|
1475
|
+
async function b(I) {
|
|
1476
|
+
const T = await o.url("/tags").post(I).res();
|
|
1477
|
+
return ye(ee.USER_ATTRIBUTE_CHANGED, {}), ie(), T.ok;
|
|
1485
1478
|
}
|
|
1486
|
-
async function
|
|
1487
|
-
return (await a.url("/tallies").get().json())[
|
|
1479
|
+
async function O(I) {
|
|
1480
|
+
return (await a.url("/tallies").get().json())[I];
|
|
1488
1481
|
}
|
|
1489
|
-
async function
|
|
1482
|
+
async function j() {
|
|
1490
1483
|
return await a.url("/tallies").get().json();
|
|
1491
1484
|
}
|
|
1492
|
-
async function
|
|
1493
|
-
const
|
|
1494
|
-
return
|
|
1485
|
+
async function A(I) {
|
|
1486
|
+
const T = await a.url(`/tallies/${I}`).delete().res();
|
|
1487
|
+
return ie(), T.ok;
|
|
1488
|
+
}
|
|
1489
|
+
async function U(I, T) {
|
|
1490
|
+
return await a.url(`/tallies/${I}/push`).post(T).json();
|
|
1495
1491
|
}
|
|
1496
|
-
async function
|
|
1497
|
-
return await
|
|
1492
|
+
async function R(I) {
|
|
1493
|
+
return await o.url(`/products/${I}`).get().json();
|
|
1498
1494
|
}
|
|
1499
|
-
async function
|
|
1500
|
-
return await o.url(
|
|
1495
|
+
async function F() {
|
|
1496
|
+
return await o.url("/profile").get().json();
|
|
1501
1497
|
}
|
|
1502
|
-
async function
|
|
1503
|
-
const
|
|
1504
|
-
return
|
|
1498
|
+
async function $(I) {
|
|
1499
|
+
const T = await o.url(`/products/${I}/auto-onboard`).post().json();
|
|
1500
|
+
return T.length && ie(), T;
|
|
1505
1501
|
}
|
|
1506
1502
|
return {
|
|
1507
1503
|
getEntitlements: s,
|
|
@@ -1509,77 +1505,79 @@ function ki(t) {
|
|
|
1509
1505
|
getEntitlementAccess: p,
|
|
1510
1506
|
getContracts: u,
|
|
1511
1507
|
getContract: c,
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1508
|
+
getProfile: F,
|
|
1509
|
+
getSubscriptions: f,
|
|
1510
|
+
getBills: d,
|
|
1511
|
+
getBill: w,
|
|
1512
|
+
setUserMetadata: k,
|
|
1513
|
+
deleteUserMetadata: v,
|
|
1514
|
+
getUserMetadata: E,
|
|
1515
|
+
listUserMetadata: S,
|
|
1516
|
+
getTags: g,
|
|
1517
|
+
deleteTag: l,
|
|
1518
|
+
setTag: b,
|
|
1519
|
+
getTally: O,
|
|
1520
|
+
getTallies: j,
|
|
1521
|
+
deleteTally: A,
|
|
1522
|
+
pushTally: U,
|
|
1523
|
+
getProduct: R,
|
|
1524
|
+
autoOnboardProduct: $
|
|
1527
1525
|
};
|
|
1528
1526
|
}
|
|
1529
|
-
const Qn = "@sesamy/sesamy-js",
|
|
1530
|
-
function
|
|
1527
|
+
const Qn = "@sesamy/sesamy-js", zt = "1.3.2";
|
|
1528
|
+
function nn(t, e, n, r, i) {
|
|
1531
1529
|
for (e = e.split ? e.split(".") : e, r = 0; r < e.length; r++)
|
|
1532
1530
|
t = t ? t[e[r]] : i;
|
|
1533
1531
|
return t === i ? n : t;
|
|
1534
1532
|
}
|
|
1535
|
-
var Je = "undefined",
|
|
1536
|
-
}, er = "any", tr = "*",
|
|
1533
|
+
var Je = "undefined", rn = "object", Tt = function() {
|
|
1534
|
+
}, er = "any", tr = "*", ve = "__", tt = typeof process < "u" ? process : {};
|
|
1537
1535
|
tt.env && tt.env.NODE_ENV;
|
|
1538
|
-
var
|
|
1536
|
+
var J = typeof document < "u";
|
|
1539
1537
|
tt.versions != null && tt.versions.node != null;
|
|
1540
1538
|
typeof Deno < "u" && Deno.core;
|
|
1541
|
-
|
|
1539
|
+
J && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
|
|
1542
1540
|
function nr(t, e) {
|
|
1543
1541
|
return e.charAt(0)[t]() + e.slice(1);
|
|
1544
1542
|
}
|
|
1545
|
-
var
|
|
1546
|
-
function
|
|
1547
|
-
return rr(t) ?
|
|
1543
|
+
var Si = nr.bind(null, "toUpperCase"), _i = nr.bind(null, "toLowerCase");
|
|
1544
|
+
function Ei(t) {
|
|
1545
|
+
return rr(t) ? Si("null") : typeof t == "object" ? ji(t) : Object.prototype.toString.call(t).slice(8, -1);
|
|
1548
1546
|
}
|
|
1549
1547
|
function nt(t, e) {
|
|
1550
1548
|
e === void 0 && (e = !0);
|
|
1551
|
-
var n =
|
|
1552
|
-
return e ?
|
|
1549
|
+
var n = Ei(t);
|
|
1550
|
+
return e ? _i(n) : n;
|
|
1553
1551
|
}
|
|
1554
1552
|
function Ke(t, e) {
|
|
1555
1553
|
return typeof e === t;
|
|
1556
1554
|
}
|
|
1557
|
-
var V = Ke.bind(null, "function"),
|
|
1555
|
+
var V = Ke.bind(null, "function"), se = Ke.bind(null, "string"), Se = Ke.bind(null, "undefined"), Ti = Ke.bind(null, "boolean");
|
|
1558
1556
|
Ke.bind(null, "symbol");
|
|
1559
1557
|
function rr(t) {
|
|
1560
1558
|
return t === null;
|
|
1561
1559
|
}
|
|
1562
|
-
function
|
|
1560
|
+
function Oi(t) {
|
|
1563
1561
|
return nt(t) === "number" && !isNaN(t);
|
|
1564
1562
|
}
|
|
1565
1563
|
function ir(t) {
|
|
1566
1564
|
return nt(t) === "array";
|
|
1567
1565
|
}
|
|
1568
1566
|
function X(t) {
|
|
1569
|
-
if (!
|
|
1567
|
+
if (!Pi(t))
|
|
1570
1568
|
return !1;
|
|
1571
1569
|
for (var e = t; Object.getPrototypeOf(e) !== null; )
|
|
1572
1570
|
e = Object.getPrototypeOf(e);
|
|
1573
1571
|
return Object.getPrototypeOf(t) === e;
|
|
1574
1572
|
}
|
|
1575
|
-
function
|
|
1573
|
+
function Pi(t) {
|
|
1576
1574
|
return t && (typeof t == "object" || t !== null);
|
|
1577
1575
|
}
|
|
1578
|
-
function
|
|
1576
|
+
function ji(t) {
|
|
1579
1577
|
return V(t.constructor) ? t.constructor.name : null;
|
|
1580
1578
|
}
|
|
1581
|
-
function
|
|
1582
|
-
return t instanceof Error ||
|
|
1579
|
+
function Ci(t) {
|
|
1580
|
+
return t instanceof Error || se(t.message) && t.constructor && Oi(t.constructor.stackTraceLimit);
|
|
1583
1581
|
}
|
|
1584
1582
|
function or(t, e) {
|
|
1585
1583
|
if (typeof e != "object" || rr(e))
|
|
@@ -1587,7 +1585,7 @@ function or(t, e) {
|
|
|
1587
1585
|
if (e instanceof t)
|
|
1588
1586
|
return !0;
|
|
1589
1587
|
var n = nt(new t(""));
|
|
1590
|
-
if (
|
|
1588
|
+
if (Ci(e))
|
|
1591
1589
|
for (; e; ) {
|
|
1592
1590
|
if (nt(e) === n)
|
|
1593
1591
|
return !0;
|
|
@@ -1599,9 +1597,9 @@ or.bind(null, TypeError);
|
|
|
1599
1597
|
or.bind(null, SyntaxError);
|
|
1600
1598
|
function ot(t, e) {
|
|
1601
1599
|
var n = t instanceof Element || t instanceof HTMLDocument;
|
|
1602
|
-
return n && e ?
|
|
1600
|
+
return n && e ? xi(t, e) : n;
|
|
1603
1601
|
}
|
|
1604
|
-
function
|
|
1602
|
+
function xi(t, e) {
|
|
1605
1603
|
return e === void 0 && (e = ""), t && t.nodeName === e.toUpperCase();
|
|
1606
1604
|
}
|
|
1607
1605
|
function at(t) {
|
|
@@ -1614,23 +1612,23 @@ at(ot, "form");
|
|
|
1614
1612
|
at(ot, "button");
|
|
1615
1613
|
at(ot, "input");
|
|
1616
1614
|
at(ot, "select");
|
|
1617
|
-
function
|
|
1615
|
+
function Ai(t) {
|
|
1618
1616
|
return t ? ir(t) ? t : [t] : [];
|
|
1619
1617
|
}
|
|
1620
|
-
function
|
|
1618
|
+
function on(t) {
|
|
1621
1619
|
try {
|
|
1622
1620
|
return decodeURIComponent(t.replace(/\+/g, " "));
|
|
1623
1621
|
} catch {
|
|
1624
1622
|
return null;
|
|
1625
1623
|
}
|
|
1626
1624
|
}
|
|
1627
|
-
function
|
|
1628
|
-
if (
|
|
1625
|
+
function $i() {
|
|
1626
|
+
if (J) {
|
|
1629
1627
|
var t = navigator, e = t.languages;
|
|
1630
1628
|
return t.userLanguage || (e && e.length ? e[0] : t.language);
|
|
1631
1629
|
}
|
|
1632
1630
|
}
|
|
1633
|
-
function
|
|
1631
|
+
function Ni() {
|
|
1634
1632
|
try {
|
|
1635
1633
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1636
1634
|
} catch {
|
|
@@ -1639,12 +1637,12 @@ function $i() {
|
|
|
1639
1637
|
function zi(t) {
|
|
1640
1638
|
return function(e) {
|
|
1641
1639
|
for (var n, r = /* @__PURE__ */ Object.create(null), i = /([^&=]+)=?([^&]*)/g; n = i.exec(e); ) {
|
|
1642
|
-
var o =
|
|
1640
|
+
var o = on(n[1]), a = on(n[2]);
|
|
1643
1641
|
o.substring(o.length - 2) === "[]" ? (r[o = o.substring(0, o.length - 2)] || (r[o] = [])).push(a) : r[o] = a === "" || a;
|
|
1644
1642
|
}
|
|
1645
1643
|
for (var s in r) {
|
|
1646
1644
|
var h = s.split("[");
|
|
1647
|
-
h.length > 1 && (
|
|
1645
|
+
h.length > 1 && (Di(r, h.map(function(p) {
|
|
1648
1646
|
return p.replace(/[?[\]\\ ]/g, "");
|
|
1649
1647
|
}), r[s]), delete r[s]);
|
|
1650
1648
|
}
|
|
@@ -1654,10 +1652,10 @@ function zi(t) {
|
|
|
1654
1652
|
var n = e.match(/\?(.*)/);
|
|
1655
1653
|
return n && n[1] ? n[1].split("#")[0] : "";
|
|
1656
1654
|
}
|
|
1657
|
-
return
|
|
1655
|
+
return J && window.location.search.substring(1);
|
|
1658
1656
|
}(t));
|
|
1659
1657
|
}
|
|
1660
|
-
function
|
|
1658
|
+
function Di(t, e, n) {
|
|
1661
1659
|
for (var r = e.length - 1, i = 0; i < r; ++i) {
|
|
1662
1660
|
var o = e[i];
|
|
1663
1661
|
if (o === "__proto__" || o === "constructor")
|
|
@@ -1673,7 +1671,7 @@ function st() {
|
|
|
1673
1671
|
}
|
|
1674
1672
|
return t;
|
|
1675
1673
|
}
|
|
1676
|
-
function
|
|
1674
|
+
function Ui(t, e) {
|
|
1677
1675
|
var n, r, i, o = null, a = 0, s = function() {
|
|
1678
1676
|
a = /* @__PURE__ */ new Date(), o = null, i = t.apply(n, r);
|
|
1679
1677
|
};
|
|
@@ -1684,20 +1682,20 @@ function Di(t, e) {
|
|
|
1684
1682
|
return n = this, r = arguments, p <= 0 ? (clearTimeout(o), o = null, a = h, i = t.apply(n, r)) : o || (o = setTimeout(s, p)), i;
|
|
1685
1683
|
};
|
|
1686
1684
|
}
|
|
1687
|
-
var
|
|
1688
|
-
function
|
|
1689
|
-
return
|
|
1685
|
+
var Re = "global", je = ve + "global" + ve, Ce = typeof self === rn && self.self === self && self || typeof global === rn && global.global === global && global || void 0;
|
|
1686
|
+
function we(t) {
|
|
1687
|
+
return Ce[je][t];
|
|
1690
1688
|
}
|
|
1691
|
-
function
|
|
1692
|
-
return
|
|
1689
|
+
function be(t, e) {
|
|
1690
|
+
return Ce[je][t] = e;
|
|
1693
1691
|
}
|
|
1694
|
-
function
|
|
1695
|
-
delete
|
|
1692
|
+
function Ae(t) {
|
|
1693
|
+
delete Ce[je][t];
|
|
1696
1694
|
}
|
|
1697
|
-
function
|
|
1695
|
+
function $e(t, e, n) {
|
|
1698
1696
|
var r;
|
|
1699
1697
|
try {
|
|
1700
|
-
if (
|
|
1698
|
+
if (Dt(t)) {
|
|
1701
1699
|
var i = window[t];
|
|
1702
1700
|
r = i[e].bind(i);
|
|
1703
1701
|
}
|
|
@@ -1705,9 +1703,9 @@ function xe(t, e, n) {
|
|
|
1705
1703
|
}
|
|
1706
1704
|
return r || n;
|
|
1707
1705
|
}
|
|
1708
|
-
|
|
1706
|
+
Ce[je] || (Ce[je] = {});
|
|
1709
1707
|
var Xe = {};
|
|
1710
|
-
function
|
|
1708
|
+
function Dt(t) {
|
|
1711
1709
|
if (typeof Xe[t] !== Je)
|
|
1712
1710
|
return Xe[t];
|
|
1713
1711
|
try {
|
|
@@ -1718,27 +1716,27 @@ function Lt(t) {
|
|
|
1718
1716
|
}
|
|
1719
1717
|
return Xe[t] = !0;
|
|
1720
1718
|
}
|
|
1721
|
-
function
|
|
1722
|
-
return
|
|
1719
|
+
function x() {
|
|
1720
|
+
return x = Object.assign || function(t) {
|
|
1723
1721
|
for (var e = 1; e < arguments.length; e++) {
|
|
1724
1722
|
var n = arguments[e];
|
|
1725
1723
|
for (var r in n)
|
|
1726
1724
|
Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
|
|
1727
1725
|
}
|
|
1728
1726
|
return t;
|
|
1729
|
-
},
|
|
1727
|
+
}, x.apply(this, arguments);
|
|
1730
1728
|
}
|
|
1731
|
-
var
|
|
1732
|
-
return typeof Symbol ===
|
|
1733
|
-
}(), Ve = " != " +
|
|
1729
|
+
var ae = "function", re = "undefined", Ri = "@@redux/" + Math.random().toString(36), an = /* @__PURE__ */ function() {
|
|
1730
|
+
return typeof Symbol === ae && Symbol.observable || "@@observable";
|
|
1731
|
+
}(), Ve = " != " + ae;
|
|
1734
1732
|
function ar(t, e, n) {
|
|
1735
1733
|
var r;
|
|
1736
|
-
if (typeof e ===
|
|
1737
|
-
if (typeof n !==
|
|
1734
|
+
if (typeof e === ae && typeof n === re && (n = e, e = void 0), typeof n !== re) {
|
|
1735
|
+
if (typeof n !== ae)
|
|
1738
1736
|
throw new Error("enhancer" + Ve);
|
|
1739
1737
|
return n(ar)(t, e);
|
|
1740
1738
|
}
|
|
1741
|
-
if (typeof t !==
|
|
1739
|
+
if (typeof t !== ae)
|
|
1742
1740
|
throw new Error("reducer" + Ve);
|
|
1743
1741
|
var i = t, o = e, a = [], s = a, h = !1;
|
|
1744
1742
|
function p() {
|
|
@@ -1748,7 +1746,7 @@ function ar(t, e, n) {
|
|
|
1748
1746
|
return o;
|
|
1749
1747
|
}
|
|
1750
1748
|
function c(d) {
|
|
1751
|
-
if (typeof d !==
|
|
1749
|
+
if (typeof d !== ae)
|
|
1752
1750
|
throw new Error("Listener" + Ve);
|
|
1753
1751
|
var w = !0;
|
|
1754
1752
|
return p(), s.push(d), function() {
|
|
@@ -1762,8 +1760,8 @@ function ar(t, e, n) {
|
|
|
1762
1760
|
function f(d) {
|
|
1763
1761
|
if (!X(d))
|
|
1764
1762
|
throw new Error("Act != obj");
|
|
1765
|
-
if (typeof d.type ===
|
|
1766
|
-
throw new Error("ActType " +
|
|
1763
|
+
if (typeof d.type === re)
|
|
1764
|
+
throw new Error("ActType " + re);
|
|
1767
1765
|
if (h)
|
|
1768
1766
|
throw new Error("Dispatch in reducer");
|
|
1769
1767
|
try {
|
|
@@ -1776,10 +1774,10 @@ function ar(t, e, n) {
|
|
|
1776
1774
|
return d;
|
|
1777
1775
|
}
|
|
1778
1776
|
return f({ type: "@@redux/INIT" }), (r = { dispatch: f, subscribe: c, getState: u, replaceReducer: function(d) {
|
|
1779
|
-
if (typeof d !==
|
|
1777
|
+
if (typeof d !== ae)
|
|
1780
1778
|
throw new Error("next reducer" + Ve);
|
|
1781
1779
|
i = d, f({ type: "@@redux/INIT" });
|
|
1782
|
-
} })[
|
|
1780
|
+
} })[an] = function() {
|
|
1783
1781
|
var d, w = c;
|
|
1784
1782
|
return (d = { subscribe: function(k) {
|
|
1785
1783
|
if (typeof k != "object")
|
|
@@ -1788,16 +1786,16 @@ function ar(t, e, n) {
|
|
|
1788
1786
|
k.next && k.next(u());
|
|
1789
1787
|
}
|
|
1790
1788
|
return v(), { unsubscribe: w(v) };
|
|
1791
|
-
} })[
|
|
1789
|
+
} })[an] = function() {
|
|
1792
1790
|
return this;
|
|
1793
1791
|
}, d;
|
|
1794
1792
|
}, r;
|
|
1795
1793
|
}
|
|
1796
|
-
function
|
|
1794
|
+
function Li(t, e) {
|
|
1797
1795
|
var n = e && e.type;
|
|
1798
|
-
return "action " + (n && n.toString() || "?") + "reducer " + t + " returns " +
|
|
1796
|
+
return "action " + (n && n.toString() || "?") + "reducer " + t + " returns " + re;
|
|
1799
1797
|
}
|
|
1800
|
-
function
|
|
1798
|
+
function xe() {
|
|
1801
1799
|
var t = [].slice.call(arguments);
|
|
1802
1800
|
return t.length === 0 ? function(e) {
|
|
1803
1801
|
return e;
|
|
@@ -1807,7 +1805,7 @@ function je() {
|
|
|
1807
1805
|
};
|
|
1808
1806
|
});
|
|
1809
1807
|
}
|
|
1810
|
-
function
|
|
1808
|
+
function Mi() {
|
|
1811
1809
|
var t = arguments;
|
|
1812
1810
|
return function(e) {
|
|
1813
1811
|
return function(n, r, i) {
|
|
@@ -1816,39 +1814,39 @@ function Ri() {
|
|
|
1816
1814
|
} };
|
|
1817
1815
|
return o = [].slice.call(t).map(function(p) {
|
|
1818
1816
|
return p(h);
|
|
1819
|
-
}),
|
|
1817
|
+
}), x({}, a, { dispatch: s = xe.apply(void 0, o)(a.dispatch) });
|
|
1820
1818
|
};
|
|
1821
1819
|
};
|
|
1822
1820
|
}
|
|
1823
|
-
var
|
|
1821
|
+
var ce = ve + "anon_id", ge = 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"], Ot = ["name", "EVENTS", "config", "loaded"], C = et.reduce(function(t, e) {
|
|
1824
1822
|
return t[e] = e, t;
|
|
1825
1823
|
}, { registerPluginType: function(t) {
|
|
1826
1824
|
return "registerPlugin:" + t;
|
|
1827
1825
|
}, pluginReadyType: function(t) {
|
|
1828
1826
|
return "ready:" + t;
|
|
1829
|
-
} }),
|
|
1830
|
-
function
|
|
1827
|
+
} }), sn = /^utm_/, cn = /^an_prop_/, un = /^an_trait_/;
|
|
1828
|
+
function Zi(t) {
|
|
1831
1829
|
var e = t.storage.setItem;
|
|
1832
1830
|
return function(n) {
|
|
1833
1831
|
return function(r) {
|
|
1834
1832
|
return function(i) {
|
|
1835
|
-
if (i.type ===
|
|
1833
|
+
if (i.type === C.bootstrap) {
|
|
1836
1834
|
var o = i.params, a = i.user, s = i.persistedUser, h = i.initialUser, p = s.userId === a.userId;
|
|
1837
|
-
s.anonymousId !== a.anonymousId && e(
|
|
1835
|
+
s.anonymousId !== a.anonymousId && e(ce, a.anonymousId), p || e(ge, a.userId), h.traits && e(Ee, x({}, p && s.traits ? s.traits : {}, h.traits));
|
|
1838
1836
|
var u = Object.keys(i.params);
|
|
1839
1837
|
if (u.length) {
|
|
1840
1838
|
var c = o.an_uid, f = o.an_event, d = u.reduce(function(w, k) {
|
|
1841
|
-
if (k.match(
|
|
1842
|
-
var v = k.replace(
|
|
1839
|
+
if (k.match(sn) || k.match(/^(d|g)clid/)) {
|
|
1840
|
+
var v = k.replace(sn, "");
|
|
1843
1841
|
w.campaign[v === "campaign" ? "name" : v] = o[k];
|
|
1844
1842
|
}
|
|
1845
|
-
return k.match(
|
|
1843
|
+
return k.match(cn) && (w.props[k.replace(cn, "")] = o[k]), k.match(un) && (w.traits[k.replace(un, "")] = o[k]), w;
|
|
1846
1844
|
}, { campaign: {}, props: {}, traits: {} });
|
|
1847
|
-
n.dispatch(
|
|
1845
|
+
n.dispatch(x({ type: C.params, raw: o }, d, c ? { userId: c } : {})), c && setTimeout(function() {
|
|
1848
1846
|
return t.identify(c, d.traits);
|
|
1849
1847
|
}, 0), f && setTimeout(function() {
|
|
1850
1848
|
return t.track(f, d.props);
|
|
1851
|
-
}, 0), Object.keys(d.campaign).length && n.dispatch({ type:
|
|
1849
|
+
}, 0), Object.keys(d.campaign).length && n.dispatch({ type: C.campaign, campaign: d.campaign });
|
|
1852
1850
|
}
|
|
1853
1851
|
}
|
|
1854
1852
|
return r(i);
|
|
@@ -1856,19 +1854,19 @@ function Mi(t) {
|
|
|
1856
1854
|
};
|
|
1857
1855
|
};
|
|
1858
1856
|
}
|
|
1859
|
-
function
|
|
1857
|
+
function Wi(t) {
|
|
1860
1858
|
return function(e, n) {
|
|
1861
|
-
if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type ===
|
|
1862
|
-
if (n.key ===
|
|
1863
|
-
return
|
|
1864
|
-
if (n.key ===
|
|
1865
|
-
return
|
|
1859
|
+
if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === C.setItemEnd) {
|
|
1860
|
+
if (n.key === ce)
|
|
1861
|
+
return x({}, e, { anonymousId: n.value });
|
|
1862
|
+
if (n.key === ge)
|
|
1863
|
+
return x({}, e, { userId: n.value });
|
|
1866
1864
|
}
|
|
1867
1865
|
switch (n.type) {
|
|
1868
|
-
case
|
|
1869
|
-
return Object.assign({}, e, { userId: n.userId, traits:
|
|
1870
|
-
case
|
|
1871
|
-
return [
|
|
1866
|
+
case C.identify:
|
|
1867
|
+
return Object.assign({}, e, { userId: n.userId, traits: x({}, e.traits, n.traits) });
|
|
1868
|
+
case C.reset:
|
|
1869
|
+
return [ge, ce, Ee].forEach(function(r) {
|
|
1872
1870
|
t.removeItem(r);
|
|
1873
1871
|
}), Object.assign({}, e, { userId: null, anonymousId: null, traits: {} });
|
|
1874
1872
|
default:
|
|
@@ -1876,46 +1874,46 @@ function Zi(t) {
|
|
|
1876
1874
|
}
|
|
1877
1875
|
};
|
|
1878
1876
|
}
|
|
1879
|
-
function
|
|
1880
|
-
return { userId: t.getItem(
|
|
1877
|
+
function ln(t) {
|
|
1878
|
+
return { userId: t.getItem(ge), anonymousId: t.getItem(ce), traits: t.getItem(Ee) };
|
|
1881
1879
|
}
|
|
1882
1880
|
var Pt = function(t) {
|
|
1883
|
-
return
|
|
1881
|
+
return ve + "TEMP" + ve + t;
|
|
1884
1882
|
};
|
|
1885
|
-
function
|
|
1883
|
+
function Ki(t) {
|
|
1886
1884
|
var e = t.storage, n = e.setItem, r = e.removeItem, i = e.getItem;
|
|
1887
1885
|
return function(o) {
|
|
1888
1886
|
return function(a) {
|
|
1889
1887
|
return function(s) {
|
|
1890
1888
|
var h = s.userId, p = s.traits, u = s.options;
|
|
1891
|
-
if (s.type ===
|
|
1889
|
+
if (s.type === C.reset && ([ge, Ee, ce].forEach(function(d) {
|
|
1892
1890
|
r(d);
|
|
1893
|
-
}), [
|
|
1894
|
-
|
|
1895
|
-
})), s.type ===
|
|
1896
|
-
i(
|
|
1897
|
-
var c = i(
|
|
1898
|
-
c && c !== h && o.dispatch({ type:
|
|
1891
|
+
}), [oe, _e, "traits"].forEach(function(d) {
|
|
1892
|
+
Ae(Pt(d));
|
|
1893
|
+
})), s.type === C.identify) {
|
|
1894
|
+
i(ce) || n(ce, st());
|
|
1895
|
+
var c = i(ge), f = i(Ee) || {};
|
|
1896
|
+
c && c !== h && o.dispatch({ type: C.userIdChanged, old: { userId: c, traits: f }, new: { userId: h, traits: p }, options: u }), h && n(ge, h), p && n(Ee, x({}, f, p));
|
|
1899
1897
|
}
|
|
1900
1898
|
return a(s);
|
|
1901
1899
|
};
|
|
1902
1900
|
};
|
|
1903
1901
|
};
|
|
1904
1902
|
}
|
|
1905
|
-
var
|
|
1906
|
-
function
|
|
1907
|
-
|
|
1903
|
+
var Ue = {};
|
|
1904
|
+
function dn(t, e) {
|
|
1905
|
+
Ue[t] && V(Ue[t]) && (Ue[t](e), delete Ue[t]);
|
|
1908
1906
|
}
|
|
1909
1907
|
function sr(t, e, n) {
|
|
1910
1908
|
return new Promise(function(r, i) {
|
|
1911
|
-
return e() ? r(t) : n < 1 ? i(
|
|
1909
|
+
return e() ? r(t) : n < 1 ? i(x({}, t, { queue: !0 })) : new Promise(function(o) {
|
|
1912
1910
|
return setTimeout(o, 10);
|
|
1913
1911
|
}).then(function(o) {
|
|
1914
1912
|
return sr(t, e, n - 10).then(r, i);
|
|
1915
1913
|
});
|
|
1916
1914
|
});
|
|
1917
1915
|
}
|
|
1918
|
-
function
|
|
1916
|
+
function Fi(t) {
|
|
1919
1917
|
return { abort: t };
|
|
1920
1918
|
}
|
|
1921
1919
|
function cr(t, e, n) {
|
|
@@ -1929,15 +1927,15 @@ function cr(t, e, n) {
|
|
|
1929
1927
|
var f = s.actions[c], d = f.plugin, w = f.payload.type, k = i[d][w];
|
|
1930
1928
|
if (k && V(k)) {
|
|
1931
1929
|
var v, E = function(l, b) {
|
|
1932
|
-
return l === void 0 && (l = {}), b === void 0 && (b = {}), [
|
|
1933
|
-
return l.hasOwnProperty(j) && b[j] && b[j] !== l[j] && (
|
|
1930
|
+
return l === void 0 && (l = {}), b === void 0 && (b = {}), [oe, _e].reduce(function(O, j) {
|
|
1931
|
+
return l.hasOwnProperty(j) && b[j] && b[j] !== l[j] && (O[j] = b[j]), O;
|
|
1934
1932
|
}, l);
|
|
1935
1933
|
}(f.payload, h), S = r[E.meta.rid];
|
|
1936
|
-
if (!S && (v = k({ payload: E, config: a[d].config, instance: n, abort:
|
|
1934
|
+
if (!S && (v = k({ payload: E, config: a[d].config, instance: n, abort: Fi })) && X(v) && v.abort)
|
|
1937
1935
|
return void (r[E.meta.rid] = !0);
|
|
1938
1936
|
if (!S) {
|
|
1939
1937
|
var g = w + ":" + d;
|
|
1940
|
-
t.dispatch(
|
|
1938
|
+
t.dispatch(x({}, E, { type: g, _: { called: g, from: "queueDrain" } }));
|
|
1941
1939
|
}
|
|
1942
1940
|
}
|
|
1943
1941
|
});
|
|
@@ -1951,7 +1949,7 @@ function cr(t, e, n) {
|
|
|
1951
1949
|
var mt = function(t) {
|
|
1952
1950
|
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;
|
|
1953
1951
|
try {
|
|
1954
|
-
var p = i.plugins, u = i.context, c = n.type, f = c.match(
|
|
1952
|
+
var p = i.plugins, u = i.context, c = n.type, f = c.match(Te), d = e.exact.map(function(v) {
|
|
1955
1953
|
return v.pluginName;
|
|
1956
1954
|
});
|
|
1957
1955
|
f && (d = a.during.map(function(v) {
|
|
@@ -1959,21 +1957,21 @@ var mt = function(t) {
|
|
|
1959
1957
|
}));
|
|
1960
1958
|
var w = /* @__PURE__ */ function(v, E) {
|
|
1961
1959
|
return function(S, g, l) {
|
|
1962
|
-
var b = g.config,
|
|
1960
|
+
var b = g.config, O = g.name, j = O + "." + S.type;
|
|
1963
1961
|
l && (j = l.event);
|
|
1964
|
-
var
|
|
1965
|
-
return function(
|
|
1966
|
-
var
|
|
1967
|
-
if (
|
|
1968
|
-
throw new Error("Method " + R + " can only abort " + U + " plugin. " + JSON.stringify(
|
|
1969
|
-
return
|
|
1962
|
+
var A = S.type.match(Te) ? /* @__PURE__ */ function(U, R, F, $, I) {
|
|
1963
|
+
return function(T, _) {
|
|
1964
|
+
var Z = $ ? $.name : U, W = _ && We(_) ? _ : F;
|
|
1965
|
+
if ($ && (!(W = _ && We(_) ? _ : [U]).includes(U) || W.length !== 1))
|
|
1966
|
+
throw new Error("Method " + R + " can only abort " + U + " plugin. " + JSON.stringify(W) + " input valid");
|
|
1967
|
+
return x({}, I, { abort: { reason: T, plugins: W, caller: R, _: Z } });
|
|
1970
1968
|
};
|
|
1971
|
-
}(
|
|
1969
|
+
}(O, j, E, l, S) : /* @__PURE__ */ function(U, R) {
|
|
1972
1970
|
return function() {
|
|
1973
1971
|
throw new Error(U.type + " action not cancellable. Remove abort in " + R);
|
|
1974
1972
|
};
|
|
1975
1973
|
}(S, j);
|
|
1976
|
-
return { payload:
|
|
1974
|
+
return { payload: Hi(S), instance: v, config: b || {}, abort: A };
|
|
1977
1975
|
};
|
|
1978
1976
|
}(r, d), k = e.exact.reduce(function(v, E) {
|
|
1979
1977
|
var S = E.pluginName, g = E.methodName, l = !1;
|
|
@@ -1986,25 +1984,25 @@ var mt = function(t) {
|
|
|
1986
1984
|
function b() {
|
|
1987
1985
|
return Promise.resolve(l);
|
|
1988
1986
|
}
|
|
1989
|
-
var
|
|
1987
|
+
var O = function() {
|
|
1990
1988
|
if (e.namespaced && e.namespaced[g])
|
|
1991
|
-
return Promise.resolve(e.namespaced[g].reduce(function(j,
|
|
1989
|
+
return Promise.resolve(e.namespaced[g].reduce(function(j, A, U) {
|
|
1992
1990
|
try {
|
|
1993
1991
|
return Promise.resolve(j).then(function(R) {
|
|
1994
|
-
return
|
|
1995
|
-
var
|
|
1996
|
-
if (
|
|
1997
|
-
var
|
|
1998
|
-
throw new Error([
|
|
1992
|
+
return A.method && V(A.method) ? (function(T, _) {
|
|
1993
|
+
var Z = vn(T);
|
|
1994
|
+
if (Z && Z.name === _) {
|
|
1995
|
+
var W = vn(Z.method);
|
|
1996
|
+
throw new Error([_ + " plugin is calling method " + T, "Plugins cant call self", "Use " + Z.method + " " + (W ? "or " + W.method : "") + " in " + _ + " plugin insteadof " + T].join(`
|
|
1999
1997
|
`));
|
|
2000
1998
|
}
|
|
2001
|
-
}(
|
|
2002
|
-
return
|
|
2003
|
-
}), config:
|
|
2004
|
-
var
|
|
2005
|
-
return Promise.resolve(
|
|
1999
|
+
}(A.methodName, A.pluginName), Promise.resolve(A.method({ payload: R, instance: r, abort: (F = R, $ = g, I = A.pluginName, function(T, _) {
|
|
2000
|
+
return x({}, F, { abort: { reason: T, plugins: _ || [$], caller: c, from: I || $ } });
|
|
2001
|
+
}), config: pn(A.pluginName, p, o), plugins: p })).then(function(T) {
|
|
2002
|
+
var _ = X(T) ? T : {};
|
|
2003
|
+
return Promise.resolve(x({}, R, _));
|
|
2006
2004
|
})) : R;
|
|
2007
|
-
var
|
|
2005
|
+
var F, $, I;
|
|
2008
2006
|
});
|
|
2009
2007
|
} catch (R) {
|
|
2010
2008
|
return Promise.reject(R);
|
|
@@ -2014,7 +2012,7 @@ var mt = function(t) {
|
|
|
2014
2012
|
});
|
|
2015
2013
|
l[g] = n;
|
|
2016
2014
|
}();
|
|
2017
|
-
return
|
|
2015
|
+
return O && O.then ? O.then(b) : b();
|
|
2018
2016
|
});
|
|
2019
2017
|
} catch (l) {
|
|
2020
2018
|
return Promise.reject(l);
|
|
@@ -2022,36 +2020,36 @@ var mt = function(t) {
|
|
|
2022
2020
|
}, Promise.resolve({}))).then(function(v) {
|
|
2023
2021
|
return Promise.resolve(e.exact.reduce(function(E, S, g) {
|
|
2024
2022
|
try {
|
|
2025
|
-
var l = e.exact.length === g + 1, b = S.pluginName,
|
|
2023
|
+
var l = e.exact.length === g + 1, b = S.pluginName, O = o[b];
|
|
2026
2024
|
return Promise.resolve(E).then(function(j) {
|
|
2027
|
-
var
|
|
2028
|
-
if (f && (
|
|
2029
|
-
return gt({ data:
|
|
2025
|
+
var A = v[b] ? v[b] : {};
|
|
2026
|
+
if (f && (A = j), yt(A, b))
|
|
2027
|
+
return gt({ data: A, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(j);
|
|
2030
2028
|
if (yt(j, b))
|
|
2031
2029
|
return l && gt({ data: j, method: c, instance: r, store: s }), Promise.resolve(j);
|
|
2032
2030
|
if (k.hasOwnProperty(b) && k[b] === !0)
|
|
2033
|
-
return s.dispatch({ type: "queue", plugin: b, payload:
|
|
2031
|
+
return s.dispatch({ type: "queue", plugin: b, payload: A, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(j);
|
|
2034
2032
|
var U = w(v[b], o[b]);
|
|
2035
|
-
return Promise.resolve(
|
|
2036
|
-
var
|
|
2037
|
-
if (yt(
|
|
2038
|
-
gt({ data:
|
|
2033
|
+
return Promise.resolve(O[c]({ abort: U.abort, payload: A, instance: r, config: pn(b, p, o), plugins: p })).then(function(R) {
|
|
2034
|
+
var F = X(R) ? R : {}, $ = x({}, j, F), I = v[b];
|
|
2035
|
+
if (yt(I, b))
|
|
2036
|
+
gt({ data: I, method: c, instance: r, pluginName: b, store: s });
|
|
2039
2037
|
else {
|
|
2040
|
-
var
|
|
2041
|
-
(
|
|
2038
|
+
var T = c + ":" + b;
|
|
2039
|
+
(T.match(/:/g) || []).length < 2 && !c.match(hn) && !c.match(fn) && r.dispatch(x({}, f ? $ : A, { type: T, _: { called: T, from: "submethod" } }));
|
|
2042
2040
|
}
|
|
2043
|
-
return Promise.resolve(
|
|
2041
|
+
return Promise.resolve($);
|
|
2044
2042
|
});
|
|
2045
2043
|
});
|
|
2046
2044
|
} catch (j) {
|
|
2047
2045
|
return Promise.reject(j);
|
|
2048
2046
|
}
|
|
2049
2047
|
}, Promise.resolve(n))).then(function(E) {
|
|
2050
|
-
if (!(c.match(
|
|
2048
|
+
if (!(c.match(Te) || c.match(/^registerPlugin/) || c.match(fn) || c.match(hn) || c.match(/^params/) || c.match(/^userIdChanged/))) {
|
|
2051
2049
|
if (h.plugins.includes(c), E._ && E._.originalAction === c)
|
|
2052
2050
|
return E;
|
|
2053
|
-
var S =
|
|
2054
|
-
ur(E, e.exact.length) && !c.match(/End$/) && (S =
|
|
2051
|
+
var S = x({}, E, { _: { originalAction: E.type, called: E.type, from: "engineEnd" } });
|
|
2052
|
+
ur(E, e.exact.length) && !c.match(/End$/) && (S = x({}, S, { type: E.type + "Aborted" })), s.dispatch(S);
|
|
2055
2053
|
}
|
|
2056
2054
|
return E;
|
|
2057
2055
|
});
|
|
@@ -2059,53 +2057,53 @@ var mt = function(t) {
|
|
|
2059
2057
|
} catch (v) {
|
|
2060
2058
|
return Promise.reject(v);
|
|
2061
2059
|
}
|
|
2062
|
-
},
|
|
2060
|
+
}, Te = /Start$/, hn = /^bootstrap/, fn = /^ready/;
|
|
2063
2061
|
function gt(t) {
|
|
2064
2062
|
var e = t.pluginName, n = t.method + "Aborted" + (e ? ":" + e : "");
|
|
2065
|
-
t.store.dispatch(
|
|
2063
|
+
t.store.dispatch(x({}, t.data, { type: n, _: { called: n, from: "abort" } }));
|
|
2066
2064
|
}
|
|
2067
|
-
function
|
|
2065
|
+
function pn(t, e, n) {
|
|
2068
2066
|
var r = e[t] || n[t];
|
|
2069
2067
|
return r && r.config ? r.config : {};
|
|
2070
2068
|
}
|
|
2071
|
-
function
|
|
2069
|
+
function mn(t, e) {
|
|
2072
2070
|
return e.reduce(function(n, r) {
|
|
2073
2071
|
return r[t] ? n.concat({ methodName: t, pluginName: r.name, method: r[t] }) : n;
|
|
2074
2072
|
}, []);
|
|
2075
2073
|
}
|
|
2076
|
-
function
|
|
2077
|
-
var n = t.replace(
|
|
2074
|
+
function gn(t, e) {
|
|
2075
|
+
var n = t.replace(Te, ""), r = e ? ":" + e : "";
|
|
2078
2076
|
return ["" + t + r, "" + n + r, n + "End" + r];
|
|
2079
2077
|
}
|
|
2080
2078
|
function yt(t, e) {
|
|
2081
2079
|
var n = t.abort;
|
|
2082
|
-
return !!n && (n === !0 ||
|
|
2080
|
+
return !!n && (n === !0 || yn(n, e) || n && yn(n.plugins, e));
|
|
2083
2081
|
}
|
|
2084
2082
|
function ur(t, e) {
|
|
2085
2083
|
var n = t.abort;
|
|
2086
2084
|
if (!n)
|
|
2087
2085
|
return !1;
|
|
2088
|
-
if (n === !0 ||
|
|
2086
|
+
if (n === !0 || se(n))
|
|
2089
2087
|
return !0;
|
|
2090
2088
|
var r = n.plugins;
|
|
2091
|
-
return
|
|
2089
|
+
return We(n) && n.length === e || We(r) && r.length === e;
|
|
2092
2090
|
}
|
|
2093
|
-
function
|
|
2091
|
+
function We(t) {
|
|
2094
2092
|
return Array.isArray(t);
|
|
2095
2093
|
}
|
|
2096
|
-
function
|
|
2097
|
-
return !(!t || !
|
|
2094
|
+
function yn(t, e) {
|
|
2095
|
+
return !(!t || !We(t)) && t.includes(e);
|
|
2098
2096
|
}
|
|
2099
|
-
function
|
|
2097
|
+
function vn(t) {
|
|
2100
2098
|
var e = t.match(/(.*):(.*)/);
|
|
2101
2099
|
return !!e && { method: e[1], name: e[2] };
|
|
2102
2100
|
}
|
|
2103
|
-
function
|
|
2101
|
+
function Hi(t) {
|
|
2104
2102
|
return Object.keys(t).reduce(function(e, n) {
|
|
2105
2103
|
return n === "type" || (e[n] = X(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
|
|
2106
2104
|
}, {});
|
|
2107
2105
|
}
|
|
2108
|
-
function
|
|
2106
|
+
function Ji(t, e, n) {
|
|
2109
2107
|
var r = {};
|
|
2110
2108
|
return function(i) {
|
|
2111
2109
|
return function(o) {
|
|
@@ -2116,95 +2114,95 @@ function Hi(t, e, n) {
|
|
|
2116
2114
|
}, p = a.type, u = a.plugins, c = a;
|
|
2117
2115
|
if (a.abort)
|
|
2118
2116
|
return Promise.resolve(o(a));
|
|
2119
|
-
if (p ===
|
|
2120
|
-
return
|
|
2121
|
-
}, 0), p ===
|
|
2117
|
+
if (p === C.enablePlugin && i.dispatch({ type: C.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), p === C.disablePlugin && setTimeout(function() {
|
|
2118
|
+
return dn(a.meta.rid, { payload: a });
|
|
2119
|
+
}, 0), p === C.initializeEnd) {
|
|
2122
2120
|
var f = e(), d = Object.keys(f), w = d.filter(function(l) {
|
|
2123
2121
|
return u.includes(l);
|
|
2124
2122
|
}).map(function(l) {
|
|
2125
2123
|
return f[l];
|
|
2126
2124
|
}), k = [], v = [], E = a.disabled, S = w.map(function(l) {
|
|
2127
|
-
var b = l.loaded,
|
|
2125
|
+
var b = l.loaded, O = l.name, j = l.config;
|
|
2128
2126
|
return sr(l, function() {
|
|
2129
2127
|
return b({ config: j });
|
|
2130
|
-
}, 1e4).then(function(
|
|
2131
|
-
return r[
|
|
2128
|
+
}, 1e4).then(function(A) {
|
|
2129
|
+
return r[O] || (i.dispatch({ type: C.pluginReadyType(O), name: O, events: Object.keys(l).filter(function(U) {
|
|
2132
2130
|
return !Ot.includes(U);
|
|
2133
|
-
}) }), r[
|
|
2134
|
-
}).catch(function(
|
|
2135
|
-
if (
|
|
2136
|
-
throw new Error(
|
|
2137
|
-
return v = v.concat(
|
|
2131
|
+
}) }), r[O] = !0), k = k.concat(O), l;
|
|
2132
|
+
}).catch(function(A) {
|
|
2133
|
+
if (A instanceof Error)
|
|
2134
|
+
throw new Error(A);
|
|
2135
|
+
return v = v.concat(A.name), A;
|
|
2138
2136
|
});
|
|
2139
2137
|
});
|
|
2140
2138
|
Promise.all(S).then(function(l) {
|
|
2141
2139
|
var b = { plugins: k, failed: v, disabled: E };
|
|
2142
2140
|
setTimeout(function() {
|
|
2143
|
-
d.length === S.length + E.length && i.dispatch(
|
|
2141
|
+
d.length === S.length + E.length && i.dispatch(x({}, { type: C.ready }, b));
|
|
2144
2142
|
}, 0);
|
|
2145
2143
|
});
|
|
2146
2144
|
}
|
|
2147
2145
|
var g = function() {
|
|
2148
|
-
if (p !==
|
|
2146
|
+
if (p !== C.bootstrap)
|
|
2149
2147
|
return /^ready:([^:]*)$/.test(p) && setTimeout(function() {
|
|
2150
2148
|
return cr(i, e, t);
|
|
2151
|
-
}, 0), Promise.resolve(function(l, b,
|
|
2149
|
+
}, 0), Promise.resolve(function(l, b, O, j, A) {
|
|
2152
2150
|
try {
|
|
2153
|
-
var U = V(b) ? b() : b, R = l.type,
|
|
2151
|
+
var U = V(b) ? b() : b, R = l.type, F = R.replace(Te, "");
|
|
2154
2152
|
if (l._ && l._.called)
|
|
2155
2153
|
return Promise.resolve(l);
|
|
2156
|
-
var
|
|
2157
|
-
var y =
|
|
2158
|
-
return
|
|
2154
|
+
var $ = O.getState(), I = (Z = U, (W = $.plugins) === void 0 && (W = {}), (te = l.options) === void 0 && (te = {}), Object.keys(Z).filter(function(m) {
|
|
2155
|
+
var y = te.plugins || {};
|
|
2156
|
+
return Ti(y[m]) ? y[m] : y.all !== !1 && (!W[m] || W[m].enabled !== !1);
|
|
2159
2157
|
}).map(function(m) {
|
|
2160
|
-
return
|
|
2158
|
+
return Z[m];
|
|
2161
2159
|
}));
|
|
2162
|
-
R ===
|
|
2163
|
-
var y =
|
|
2160
|
+
R === C.initializeStart && l.fromEnable && (I = Object.keys($.plugins).filter(function(m) {
|
|
2161
|
+
var y = $.plugins[m];
|
|
2164
2162
|
return l.plugins.includes(m) && !y.initialized;
|
|
2165
2163
|
}).map(function(m) {
|
|
2166
2164
|
return U[m];
|
|
2167
2165
|
}));
|
|
2168
|
-
var
|
|
2166
|
+
var T = I.map(function(m) {
|
|
2169
2167
|
return m.name;
|
|
2170
|
-
}),
|
|
2171
|
-
var
|
|
2172
|
-
return
|
|
2168
|
+
}), _ = function(m, y, P) {
|
|
2169
|
+
var N = gn(m).map(function(z) {
|
|
2170
|
+
return mn(z, y);
|
|
2173
2171
|
});
|
|
2174
|
-
return y.reduce(function(
|
|
2175
|
-
var
|
|
2176
|
-
return
|
|
2177
|
-
}), K =
|
|
2178
|
-
return K.length && (
|
|
2179
|
-
}, { before:
|
|
2180
|
-
}(R,
|
|
2181
|
-
return Promise.resolve(mt({ action: l, data: { exact:
|
|
2172
|
+
return y.reduce(function(z, D) {
|
|
2173
|
+
var H = D.name, M = gn(m, H).map(function(Ne) {
|
|
2174
|
+
return mn(Ne, y);
|
|
2175
|
+
}), K = M[0], L = M[1], q = M[2];
|
|
2176
|
+
return K.length && (z.beforeNS[H] = K), L.length && (z.duringNS[H] = L), q.length && (z.afterNS[H] = q), z;
|
|
2177
|
+
}, { before: N[0], beforeNS: {}, during: N[1], duringNS: {}, after: N[2], afterNS: {} });
|
|
2178
|
+
}(R, I);
|
|
2179
|
+
return Promise.resolve(mt({ action: l, data: { exact: _.before, namespaced: _.beforeNS }, state: $, allPlugins: U, allMatches: _, instance: O, store: j, EVENTS: A })).then(function(m) {
|
|
2182
2180
|
function y() {
|
|
2183
|
-
var
|
|
2184
|
-
if (R.match(
|
|
2185
|
-
return Promise.resolve(mt({ action:
|
|
2186
|
-
|
|
2181
|
+
var z = function() {
|
|
2182
|
+
if (R.match(Te))
|
|
2183
|
+
return Promise.resolve(mt({ action: x({}, P, { type: F + "End" }), data: { exact: _.after, namespaced: _.afterNS }, state: $, allPlugins: U, allMatches: _, instance: O, store: j, EVENTS: A })).then(function(D) {
|
|
2184
|
+
D.meta && D.meta.hasCallback && dn(D.meta.rid, { payload: D });
|
|
2187
2185
|
});
|
|
2188
2186
|
}();
|
|
2189
|
-
return
|
|
2187
|
+
return z && z.then ? z.then(function() {
|
|
2190
2188
|
return m;
|
|
2191
2189
|
}) : m;
|
|
2192
2190
|
}
|
|
2193
|
-
if (ur(m,
|
|
2191
|
+
if (ur(m, T.length))
|
|
2194
2192
|
return m;
|
|
2195
|
-
var
|
|
2196
|
-
if (R !==
|
|
2197
|
-
return Promise.resolve(mt({ action:
|
|
2198
|
-
|
|
2193
|
+
var P, N = function() {
|
|
2194
|
+
if (R !== F)
|
|
2195
|
+
return Promise.resolve(mt({ action: x({}, m, { type: F }), data: { exact: _.during, namespaced: _.duringNS }, state: $, allPlugins: U, allMatches: _, instance: O, store: j, EVENTS: A })).then(function(z) {
|
|
2196
|
+
P = z;
|
|
2199
2197
|
});
|
|
2200
|
-
|
|
2198
|
+
P = m;
|
|
2201
2199
|
}();
|
|
2202
|
-
return
|
|
2200
|
+
return N && N.then ? N.then(y) : y();
|
|
2203
2201
|
});
|
|
2204
2202
|
} catch (m) {
|
|
2205
2203
|
return Promise.reject(m);
|
|
2206
2204
|
}
|
|
2207
|
-
var
|
|
2205
|
+
var Z, W, te;
|
|
2208
2206
|
}(a, e, t, i, n)).then(function(l) {
|
|
2209
2207
|
return s = 1, o(l);
|
|
2210
2208
|
});
|
|
@@ -2217,22 +2215,22 @@ function Hi(t, e, n) {
|
|
|
2217
2215
|
};
|
|
2218
2216
|
};
|
|
2219
2217
|
}
|
|
2220
|
-
function
|
|
2218
|
+
function Xi(t) {
|
|
2221
2219
|
return function(e) {
|
|
2222
2220
|
return function(n) {
|
|
2223
2221
|
return function(r) {
|
|
2224
2222
|
var i = r.type, o = r.key, a = r.value, s = r.options;
|
|
2225
|
-
if (i ===
|
|
2223
|
+
if (i === C.setItem || i === C.removeItem) {
|
|
2226
2224
|
if (r.abort)
|
|
2227
2225
|
return n(r);
|
|
2228
|
-
i ===
|
|
2226
|
+
i === C.setItem ? t.setItem(o, a, s) : t.removeItem(o, s);
|
|
2229
2227
|
}
|
|
2230
2228
|
return n(r);
|
|
2231
2229
|
};
|
|
2232
2230
|
};
|
|
2233
2231
|
};
|
|
2234
2232
|
}
|
|
2235
|
-
var
|
|
2233
|
+
var Vi = function() {
|
|
2236
2234
|
var t = this;
|
|
2237
2235
|
this.before = [], this.after = [], this.addMiddleware = function(e, n) {
|
|
2238
2236
|
t[n] = t[n].concat(e);
|
|
@@ -2250,47 +2248,47 @@ var Xi = function() {
|
|
|
2250
2248
|
} }, a = t[e].map(function(s) {
|
|
2251
2249
|
return s(o);
|
|
2252
2250
|
});
|
|
2253
|
-
return
|
|
2251
|
+
return xe.apply(void 0, a)(r)(i);
|
|
2254
2252
|
};
|
|
2255
2253
|
};
|
|
2256
2254
|
};
|
|
2257
2255
|
};
|
|
2258
2256
|
};
|
|
2259
|
-
function
|
|
2257
|
+
function Yi(t) {
|
|
2260
2258
|
return function(e, n) {
|
|
2261
2259
|
e === void 0 && (e = {});
|
|
2262
2260
|
var r = {};
|
|
2263
2261
|
if (n.type === "initialize:aborted")
|
|
2264
2262
|
return e;
|
|
2265
2263
|
if (/^registerPlugin:([^:]*)$/.test(n.type)) {
|
|
2266
|
-
var i =
|
|
2264
|
+
var i = wn(n.type, "registerPlugin"), o = t()[i];
|
|
2267
2265
|
if (!o || !i)
|
|
2268
2266
|
return e;
|
|
2269
2267
|
var a = n.enabled, s = o.config;
|
|
2270
|
-
return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s },
|
|
2268
|
+
return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, x({}, e, r);
|
|
2271
2269
|
}
|
|
2272
2270
|
if (/^initialize:([^:]*)$/.test(n.type)) {
|
|
2273
|
-
var h =
|
|
2274
|
-
return p && h ? (r[h] =
|
|
2271
|
+
var h = wn(n.type, C.initialize), p = t()[h];
|
|
2272
|
+
return p && h ? (r[h] = x({}, e[h], { initialized: !0, loaded: !!p.loaded({ config: p.config }) }), x({}, e, r)) : e;
|
|
2275
2273
|
}
|
|
2276
2274
|
if (/^ready:([^:]*)$/.test(n.type))
|
|
2277
|
-
return r[n.name] =
|
|
2275
|
+
return r[n.name] = x({}, e[n.name], { loaded: !0 }), x({}, e, r);
|
|
2278
2276
|
switch (n.type) {
|
|
2279
|
-
case
|
|
2280
|
-
return
|
|
2281
|
-
case
|
|
2282
|
-
return
|
|
2277
|
+
case C.disablePlugin:
|
|
2278
|
+
return x({}, e, bn(n.plugins, !1, e));
|
|
2279
|
+
case C.enablePlugin:
|
|
2280
|
+
return x({}, e, bn(n.plugins, !0, e));
|
|
2283
2281
|
default:
|
|
2284
2282
|
return e;
|
|
2285
2283
|
}
|
|
2286
2284
|
};
|
|
2287
2285
|
}
|
|
2288
|
-
function
|
|
2286
|
+
function wn(t, e) {
|
|
2289
2287
|
return t.substring(e.length + 1, t.length);
|
|
2290
2288
|
}
|
|
2291
|
-
function
|
|
2289
|
+
function bn(t, e, n) {
|
|
2292
2290
|
return t.reduce(function(r, i) {
|
|
2293
|
-
return r[i] =
|
|
2291
|
+
return r[i] = x({}, n[i], { enabled: e }), r;
|
|
2294
2292
|
}, n);
|
|
2295
2293
|
}
|
|
2296
2294
|
function lr(t) {
|
|
@@ -2300,24 +2298,24 @@ function lr(t) {
|
|
|
2300
2298
|
}
|
|
2301
2299
|
return t;
|
|
2302
2300
|
}
|
|
2303
|
-
var
|
|
2304
|
-
function
|
|
2305
|
-
t === void 0 && (t =
|
|
2301
|
+
var Gi = { last: {}, history: [] };
|
|
2302
|
+
function Bi(t, e) {
|
|
2303
|
+
t === void 0 && (t = Gi);
|
|
2306
2304
|
var n = e.options, r = e.meta;
|
|
2307
|
-
if (e.type ===
|
|
2308
|
-
var i = lr(
|
|
2309
|
-
return
|
|
2305
|
+
if (e.type === C.track) {
|
|
2306
|
+
var i = lr(x({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
|
|
2307
|
+
return x({}, t, { last: i, history: t.history.concat(i) });
|
|
2310
2308
|
}
|
|
2311
2309
|
return t;
|
|
2312
2310
|
}
|
|
2313
|
-
var
|
|
2314
|
-
function
|
|
2315
|
-
t === void 0 && (t =
|
|
2311
|
+
var qi = { actions: [] };
|
|
2312
|
+
function Qi(t, e) {
|
|
2313
|
+
t === void 0 && (t = qi);
|
|
2316
2314
|
var n = e.payload;
|
|
2317
2315
|
switch (e.type) {
|
|
2318
2316
|
case "queue":
|
|
2319
2317
|
var r;
|
|
2320
|
-
return r = n && n.type && n.type ===
|
|
2318
|
+
return r = n && n.type && n.type === C.identify ? [e].concat(t.actions) : t.actions.concat(e), x({}, t, { actions: r });
|
|
2321
2319
|
case "dequeue":
|
|
2322
2320
|
return [];
|
|
2323
2321
|
default:
|
|
@@ -2325,66 +2323,66 @@ function qi(t, e) {
|
|
|
2325
2323
|
}
|
|
2326
2324
|
}
|
|
2327
2325
|
var dr = /#.*$/;
|
|
2328
|
-
function
|
|
2326
|
+
function eo(t) {
|
|
2329
2327
|
var e = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);
|
|
2330
2328
|
return "/" + (e && e[3] ? e[3].split("?")[0].replace(dr, "") : "");
|
|
2331
2329
|
}
|
|
2332
|
-
var hr, fr, pr, mr,
|
|
2333
|
-
if (t === void 0 && (t = {}), !
|
|
2330
|
+
var hr, fr, pr, mr, to = function(t) {
|
|
2331
|
+
if (t === void 0 && (t = {}), !J)
|
|
2334
2332
|
return t;
|
|
2335
2333
|
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) {
|
|
2336
2334
|
var d = function() {
|
|
2337
|
-
if (
|
|
2335
|
+
if (J) {
|
|
2338
2336
|
for (var w, k = document.getElementsByTagName("link"), v = 0; w = k[v]; v++)
|
|
2339
2337
|
if (w.getAttribute("rel") === "canonical")
|
|
2340
2338
|
return w.getAttribute("href");
|
|
2341
2339
|
}
|
|
2342
2340
|
}();
|
|
2343
2341
|
return d ? d.match(/\?/) ? d : d + f : window.location.href.replace(dr, "");
|
|
2344
|
-
}(p), c = { title: n, url: u, path:
|
|
2345
|
-
return r && r !== "" && (c.referrer = r),
|
|
2346
|
-
},
|
|
2347
|
-
function
|
|
2348
|
-
t === void 0 && (t =
|
|
2342
|
+
}(p), c = { title: n, url: u, path: eo(u), hash: h, search: p, width: a, height: s };
|
|
2343
|
+
return r && r !== "" && (c.referrer = r), x({}, c, t);
|
|
2344
|
+
}, no = { last: {}, history: [] };
|
|
2345
|
+
function ro(t, e) {
|
|
2346
|
+
t === void 0 && (t = no);
|
|
2349
2347
|
var n = e.options;
|
|
2350
|
-
if (e.type ===
|
|
2351
|
-
var r = lr(
|
|
2352
|
-
return
|
|
2348
|
+
if (e.type === C.page) {
|
|
2349
|
+
var r = lr(x({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
|
|
2350
|
+
return x({}, t, { last: r, history: t.history.concat(r) });
|
|
2353
2351
|
}
|
|
2354
2352
|
return t;
|
|
2355
2353
|
}
|
|
2356
2354
|
hr = function() {
|
|
2357
|
-
if (!
|
|
2355
|
+
if (!J)
|
|
2358
2356
|
return !1;
|
|
2359
2357
|
var t = navigator.appVersion;
|
|
2360
2358
|
return ~t.indexOf("Win") ? "Windows" : ~t.indexOf("Mac") ? "MacOS" : ~t.indexOf("X11") ? "UNIX" : ~t.indexOf("Linux") ? "Linux" : "Unknown OS";
|
|
2361
|
-
}(), fr =
|
|
2362
|
-
var
|
|
2363
|
-
function
|
|
2364
|
-
t === void 0 && (t =
|
|
2359
|
+
}(), fr = J ? document.referrer : null, pr = $i(), mr = Ni();
|
|
2360
|
+
var kn = { initialized: !1, sessionId: st(), app: null, version: null, debug: !1, offline: !!J && !navigator.onLine, os: { name: hr }, userAgent: J ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.7" }, timezone: mr, locale: pr, campaign: {}, referrer: fr };
|
|
2361
|
+
function io(t, e) {
|
|
2362
|
+
t === void 0 && (t = kn);
|
|
2365
2363
|
var n = t.initialized, r = e.campaign;
|
|
2366
2364
|
switch (e.type) {
|
|
2367
|
-
case
|
|
2368
|
-
return
|
|
2369
|
-
case
|
|
2370
|
-
return
|
|
2371
|
-
case
|
|
2372
|
-
return
|
|
2365
|
+
case C.campaign:
|
|
2366
|
+
return x({}, t, { campaign: r });
|
|
2367
|
+
case C.offline:
|
|
2368
|
+
return x({}, t, { offline: !0 });
|
|
2369
|
+
case C.online:
|
|
2370
|
+
return x({}, t, { offline: !1 });
|
|
2373
2371
|
default:
|
|
2374
|
-
return n ? t :
|
|
2372
|
+
return n ? t : x({}, kn, t, { initialized: !0 });
|
|
2375
2373
|
}
|
|
2376
2374
|
}
|
|
2377
|
-
var
|
|
2378
|
-
function
|
|
2379
|
-
if (
|
|
2375
|
+
var oo = ["plugins", "reducers", "storage"];
|
|
2376
|
+
function ao(t, e, n) {
|
|
2377
|
+
if (J) {
|
|
2380
2378
|
var r = window[(n ? "add" : "remove") + "EventListener"];
|
|
2381
2379
|
t.split(" ").forEach(function(i) {
|
|
2382
2380
|
r(i, e);
|
|
2383
2381
|
});
|
|
2384
2382
|
}
|
|
2385
2383
|
}
|
|
2386
|
-
function
|
|
2387
|
-
var e =
|
|
2384
|
+
function so(t) {
|
|
2385
|
+
var e = ao.bind(null, "online offline", function(n) {
|
|
2388
2386
|
return Promise.resolve(!navigator.onLine).then(t);
|
|
2389
2387
|
});
|
|
2390
2388
|
return e(!0), function(n) {
|
|
@@ -2392,27 +2390,27 @@ function ao(t) {
|
|
|
2392
2390
|
};
|
|
2393
2391
|
}
|
|
2394
2392
|
function gr() {
|
|
2395
|
-
return
|
|
2393
|
+
return be("analytics", []), function(t) {
|
|
2396
2394
|
return function(e, n, r) {
|
|
2397
2395
|
var i = t(e, n, r), o = i.dispatch;
|
|
2398
2396
|
return Object.assign(i, { dispatch: function(a) {
|
|
2399
|
-
return
|
|
2397
|
+
return Ce[je].analytics.push(a.action || a), o(a);
|
|
2400
2398
|
} });
|
|
2401
2399
|
};
|
|
2402
2400
|
};
|
|
2403
2401
|
}
|
|
2404
|
-
function
|
|
2402
|
+
function In(t) {
|
|
2405
2403
|
return function() {
|
|
2406
|
-
return
|
|
2404
|
+
return xe(xe.apply(null, arguments), gr());
|
|
2407
2405
|
};
|
|
2408
2406
|
}
|
|
2409
2407
|
function vt(t) {
|
|
2410
2408
|
return t ? ir(t) ? t : [t] : [];
|
|
2411
2409
|
}
|
|
2412
|
-
function
|
|
2410
|
+
function Sn(t, e, n) {
|
|
2413
2411
|
t === void 0 && (t = {});
|
|
2414
2412
|
var r, i, o = st();
|
|
2415
|
-
return e && (
|
|
2413
|
+
return e && (Ue[o] = (r = e, i = function(a) {
|
|
2416
2414
|
for (var s, h = a || Array.prototype.slice.call(arguments), p = 0; p < h.length; p++)
|
|
2417
2415
|
if (V(h[p])) {
|
|
2418
2416
|
s = h[p];
|
|
@@ -2421,9 +2419,9 @@ function _n(t, e, n) {
|
|
|
2421
2419
|
return s;
|
|
2422
2420
|
}(n), function(a) {
|
|
2423
2421
|
i && i(a), r(a);
|
|
2424
|
-
})),
|
|
2422
|
+
})), x({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
|
|
2425
2423
|
}
|
|
2426
|
-
function
|
|
2424
|
+
function co(t) {
|
|
2427
2425
|
t === void 0 && (t = {});
|
|
2428
2426
|
var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(m, y) {
|
|
2429
2427
|
if (V(y))
|
|
@@ -2431,26 +2429,26 @@ function so(t) {
|
|
|
2431
2429
|
if (y.NAMESPACE && (y.name = y.NAMESPACE), !y.name)
|
|
2432
2430
|
throw new Error("https://lytics.dev/errors/1");
|
|
2433
2431
|
y.config || (y.config = {});
|
|
2434
|
-
var
|
|
2435
|
-
return y.EVENTS[
|
|
2432
|
+
var P = y.EVENTS ? Object.keys(y.EVENTS).map(function(D) {
|
|
2433
|
+
return y.EVENTS[D];
|
|
2436
2434
|
}) : [];
|
|
2437
|
-
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(
|
|
2438
|
-
var
|
|
2439
|
-
return
|
|
2440
|
-
for (var K = Array.prototype.slice.call(arguments),
|
|
2441
|
-
|
|
2442
|
-
return
|
|
2443
|
-
}),
|
|
2435
|
+
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(D, H) {
|
|
2436
|
+
var M;
|
|
2437
|
+
return D[H] = (M = y.methods[H], function() {
|
|
2438
|
+
for (var K = Array.prototype.slice.call(arguments), L = new Array(M.length), q = 0; q < K.length; q++)
|
|
2439
|
+
L[q] = K[q];
|
|
2440
|
+
return L[L.length] = b, M.apply({ instance: b }, L);
|
|
2441
|
+
}), D;
|
|
2444
2442
|
}, {}), delete y.methods);
|
|
2445
|
-
var
|
|
2446
|
-
if (m.events = Array.from(
|
|
2443
|
+
var N = Object.keys(y).concat(P), z = new Set(m.events.concat(N));
|
|
2444
|
+
if (m.events = Array.from(z), m.pluginsArray = m.pluginsArray.concat(y), m.plugins[y.name])
|
|
2447
2445
|
throw new Error(y.name + "AlreadyLoaded");
|
|
2448
2446
|
return m.plugins[y.name] = y, m.plugins[y.name].loaded || (m.plugins[y.name].loaded = function() {
|
|
2449
2447
|
return !0;
|
|
2450
2448
|
}), m;
|
|
2451
|
-
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem:
|
|
2452
|
-
return function(y,
|
|
2453
|
-
return
|
|
2449
|
+
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: we, setItem: be, removeItem: Ae }, o = /* @__PURE__ */ function(m) {
|
|
2450
|
+
return function(y, P, N) {
|
|
2451
|
+
return P.getState("user")[y] || (N && X(N) && N[y] ? N[y] : ln(m)[y] || we(Pt(y)) || null);
|
|
2454
2452
|
};
|
|
2455
2453
|
}(i), a = r.plugins, s = r.events.filter(function(m) {
|
|
2456
2454
|
return !Ot.includes(m);
|
|
@@ -2458,226 +2456,226 @@ function so(t) {
|
|
|
2458
2456
|
return !Ot.includes(m);
|
|
2459
2457
|
})), p = Array.from(h).sort(), u = function() {
|
|
2460
2458
|
return a;
|
|
2461
|
-
}, c = new
|
|
2459
|
+
}, c = new Vi(), f = c.addMiddleware, d = c.removeMiddleware, w = c.dynamicMiddlewares, k = function() {
|
|
2462
2460
|
throw new Error("Abort disabled inListener");
|
|
2463
|
-
}, v = zi(), E =
|
|
2461
|
+
}, v = zi(), E = ln(i), S = x({}, E, n, v.an_uid ? { userId: v.an_uid } : {}, v.an_aid ? { anonymousId: v.an_aid } : {});
|
|
2464
2462
|
S.anonymousId || (S.anonymousId = st());
|
|
2465
|
-
var g =
|
|
2466
|
-
return new Promise(function(
|
|
2467
|
-
|
|
2463
|
+
var g = x({ enable: function(m, y) {
|
|
2464
|
+
return new Promise(function(P) {
|
|
2465
|
+
_.dispatch({ type: C.enablePlugin, plugins: vt(m), _: { originalAction: C.enablePlugin } }, P, [y]);
|
|
2468
2466
|
});
|
|
2469
2467
|
}, disable: function(m, y) {
|
|
2470
|
-
return new Promise(function(
|
|
2471
|
-
|
|
2468
|
+
return new Promise(function(P) {
|
|
2469
|
+
_.dispatch({ type: C.disablePlugin, plugins: vt(m), _: { originalAction: C.disablePlugin } }, P, [y]);
|
|
2472
2470
|
});
|
|
2473
|
-
} }, r.methods), l = !1, b = { identify: function(m, y,
|
|
2471
|
+
} }, r.methods), l = !1, b = { identify: function(m, y, P, N) {
|
|
2474
2472
|
try {
|
|
2475
|
-
var
|
|
2476
|
-
|
|
2477
|
-
var K =
|
|
2478
|
-
return Promise.resolve(new Promise(function(
|
|
2479
|
-
|
|
2473
|
+
var z = se(m) ? m : null, D = X(m) ? m : y, H = P || {}, M = b.user();
|
|
2474
|
+
be(Pt(oe), z);
|
|
2475
|
+
var K = z || D.userId || o(oe, b, D);
|
|
2476
|
+
return Promise.resolve(new Promise(function(L) {
|
|
2477
|
+
_.dispatch(x({ type: C.identifyStart, userId: K, traits: D || {}, options: H, anonymousId: M.anonymousId }, M.id && M.id !== z && { previousId: M.id }), L, [y, P, N]);
|
|
2480
2478
|
}));
|
|
2481
|
-
} catch (
|
|
2482
|
-
return Promise.reject(
|
|
2479
|
+
} catch (L) {
|
|
2480
|
+
return Promise.reject(L);
|
|
2483
2481
|
}
|
|
2484
|
-
}, track: function(m, y,
|
|
2482
|
+
}, track: function(m, y, P, N) {
|
|
2485
2483
|
try {
|
|
2486
|
-
var
|
|
2487
|
-
if (!
|
|
2484
|
+
var z = X(m) ? m.event : m;
|
|
2485
|
+
if (!z || !se(z))
|
|
2488
2486
|
throw new Error("EventMissing");
|
|
2489
|
-
var
|
|
2490
|
-
return Promise.resolve(new Promise(function(
|
|
2491
|
-
|
|
2487
|
+
var D = X(m) ? m : y || {}, H = X(P) ? P : {};
|
|
2488
|
+
return Promise.resolve(new Promise(function(M) {
|
|
2489
|
+
_.dispatch({ type: C.trackStart, event: z, properties: D, options: H, userId: o(oe, b, y), anonymousId: o(_e, b, y) }, M, [y, P, N]);
|
|
2492
2490
|
}));
|
|
2493
|
-
} catch (
|
|
2494
|
-
return Promise.reject(
|
|
2491
|
+
} catch (M) {
|
|
2492
|
+
return Promise.reject(M);
|
|
2495
2493
|
}
|
|
2496
|
-
}, page: function(m, y,
|
|
2494
|
+
}, page: function(m, y, P) {
|
|
2497
2495
|
try {
|
|
2498
|
-
var
|
|
2499
|
-
return Promise.resolve(new Promise(function(
|
|
2500
|
-
|
|
2496
|
+
var N = X(m) ? m : {}, z = X(y) ? y : {};
|
|
2497
|
+
return Promise.resolve(new Promise(function(D) {
|
|
2498
|
+
_.dispatch({ type: C.pageStart, properties: to(N), options: z, userId: o(oe, b, N), anonymousId: o(_e, b, N) }, D, [m, y, P]);
|
|
2501
2499
|
}));
|
|
2502
|
-
} catch (
|
|
2503
|
-
return Promise.reject(
|
|
2500
|
+
} catch (D) {
|
|
2501
|
+
return Promise.reject(D);
|
|
2504
2502
|
}
|
|
2505
2503
|
}, user: function(m) {
|
|
2506
|
-
if (m ===
|
|
2507
|
-
return o(
|
|
2508
|
-
if (m ===
|
|
2509
|
-
return o(
|
|
2504
|
+
if (m === oe || m === "id")
|
|
2505
|
+
return o(oe, b);
|
|
2506
|
+
if (m === _e || m === "anonId")
|
|
2507
|
+
return o(_e, b);
|
|
2510
2508
|
var y = b.getState("user");
|
|
2511
|
-
return m ?
|
|
2509
|
+
return m ? nn(y, m) : y;
|
|
2512
2510
|
}, reset: function(m) {
|
|
2513
2511
|
return new Promise(function(y) {
|
|
2514
|
-
|
|
2512
|
+
_.dispatch({ type: C.resetStart }, y, m);
|
|
2515
2513
|
});
|
|
2516
2514
|
}, ready: function(m) {
|
|
2517
|
-
return l && m({ plugins: g, instance: b }), b.on(
|
|
2515
|
+
return l && m({ plugins: g, instance: b }), b.on(C.ready, function(y) {
|
|
2518
2516
|
m(y), l = !0;
|
|
2519
2517
|
});
|
|
2520
2518
|
}, on: function(m, y) {
|
|
2521
2519
|
if (!m || !V(y))
|
|
2522
2520
|
return !1;
|
|
2523
|
-
if (m ===
|
|
2521
|
+
if (m === C.bootstrap)
|
|
2524
2522
|
throw new Error(".on disabled for " + m);
|
|
2525
|
-
var
|
|
2523
|
+
var P = /Start$|Start:/;
|
|
2526
2524
|
if (m === "*") {
|
|
2527
|
-
var
|
|
2525
|
+
var N = function(M) {
|
|
2528
2526
|
return function(K) {
|
|
2529
|
-
return function(
|
|
2530
|
-
return
|
|
2527
|
+
return function(L) {
|
|
2528
|
+
return L.type.match(P) && y({ payload: L, instance: b, plugins: a }), K(L);
|
|
2531
2529
|
};
|
|
2532
2530
|
};
|
|
2533
|
-
},
|
|
2531
|
+
}, z = function(M) {
|
|
2534
2532
|
return function(K) {
|
|
2535
|
-
return function(
|
|
2536
|
-
return
|
|
2533
|
+
return function(L) {
|
|
2534
|
+
return L.type.match(P) || y({ payload: L, instance: b, plugins: a }), K(L);
|
|
2537
2535
|
};
|
|
2538
2536
|
};
|
|
2539
2537
|
};
|
|
2540
|
-
return f(
|
|
2541
|
-
d(
|
|
2538
|
+
return f(N, Ye), f(z, Ge), function() {
|
|
2539
|
+
d(N, Ye), d(z, Ge);
|
|
2542
2540
|
};
|
|
2543
2541
|
}
|
|
2544
|
-
var
|
|
2542
|
+
var D = m.match(P) ? Ye : Ge, H = function(M) {
|
|
2545
2543
|
return function(K) {
|
|
2546
|
-
return function(
|
|
2547
|
-
return
|
|
2544
|
+
return function(L) {
|
|
2545
|
+
return L.type === m && y({ payload: L, instance: b, plugins: a, abort: k }), K(L);
|
|
2548
2546
|
};
|
|
2549
2547
|
};
|
|
2550
2548
|
};
|
|
2551
|
-
return f(
|
|
2552
|
-
return d(
|
|
2549
|
+
return f(H, D), function() {
|
|
2550
|
+
return d(H, D);
|
|
2553
2551
|
};
|
|
2554
2552
|
}, once: function(m, y) {
|
|
2555
2553
|
if (!m || !V(y))
|
|
2556
2554
|
return !1;
|
|
2557
|
-
if (m ===
|
|
2555
|
+
if (m === C.bootstrap)
|
|
2558
2556
|
throw new Error(".once disabled for " + m);
|
|
2559
|
-
var
|
|
2560
|
-
y({ payload:
|
|
2557
|
+
var P = b.on(m, function(N) {
|
|
2558
|
+
y({ payload: N.payload, instance: b, plugins: a, abort: k }), P();
|
|
2561
2559
|
});
|
|
2562
|
-
return
|
|
2560
|
+
return P;
|
|
2563
2561
|
}, getState: function(m) {
|
|
2564
|
-
var y =
|
|
2565
|
-
return m ?
|
|
2562
|
+
var y = _.getState();
|
|
2563
|
+
return m ? nn(y, m) : Object.assign({}, y);
|
|
2566
2564
|
}, dispatch: function(m) {
|
|
2567
|
-
var y =
|
|
2565
|
+
var y = se(m) ? { type: m } : m;
|
|
2568
2566
|
if (et.includes(y.type))
|
|
2569
2567
|
throw new Error("reserved action " + y.type);
|
|
2570
|
-
var
|
|
2571
|
-
|
|
2572
|
-
}, enablePlugin: g.enable, disablePlugin: g.disable, plugins: g, storage: { getItem: i.getItem, setItem: function(m, y,
|
|
2573
|
-
|
|
2568
|
+
var P = x({}, y, { _: x({ originalAction: y.type }, m._ || {}) });
|
|
2569
|
+
_.dispatch(P);
|
|
2570
|
+
}, enablePlugin: g.enable, disablePlugin: g.disable, plugins: g, storage: { getItem: i.getItem, setItem: function(m, y, P) {
|
|
2571
|
+
_.dispatch({ type: C.setItemStart, key: m, value: y, options: P });
|
|
2574
2572
|
}, removeItem: function(m, y) {
|
|
2575
|
-
|
|
2573
|
+
_.dispatch({ type: C.removeItemStart, key: m, options: y });
|
|
2576
2574
|
} }, setAnonymousId: function(m, y) {
|
|
2577
|
-
b.storage.setItem(
|
|
2578
|
-
}, events: { core: et, plugins: s } },
|
|
2575
|
+
b.storage.setItem(ce, m, y);
|
|
2576
|
+
}, events: { core: et, plugins: s } }, O = r.middlewares.concat([function(m) {
|
|
2579
2577
|
return function(y) {
|
|
2580
|
-
return function(
|
|
2581
|
-
return
|
|
2578
|
+
return function(P) {
|
|
2579
|
+
return P.meta || (P.meta = Sn()), y(P);
|
|
2582
2580
|
};
|
|
2583
2581
|
};
|
|
2584
|
-
}, w(Ye),
|
|
2585
|
-
if (
|
|
2582
|
+
}, w(Ye), Ji(b, u, { all: p, plugins: s }), Xi(i), Zi(b), Ki(b), w(Ge)]), j = { context: io, user: Wi(i), page: ro, track: Bi, plugins: Yi(u), queue: Qi }, A = xe, U = xe;
|
|
2583
|
+
if (J && t.debug) {
|
|
2586
2584
|
var R = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
|
|
2587
|
-
R && (
|
|
2588
|
-
return arguments.length === 0 ? gr() : X(typeof arguments[0]) ?
|
|
2585
|
+
R && (A = R({ trace: !0, traceLimit: 25 })), U = function() {
|
|
2586
|
+
return arguments.length === 0 ? gr() : X(typeof arguments[0]) ? In() : In().apply(null, arguments);
|
|
2589
2587
|
};
|
|
2590
2588
|
}
|
|
2591
|
-
var
|
|
2592
|
-
return Object.keys(m).reduce(function(y,
|
|
2593
|
-
return
|
|
2589
|
+
var F, $ = function(m) {
|
|
2590
|
+
return Object.keys(m).reduce(function(y, P) {
|
|
2591
|
+
return oo.includes(P) || (y[P] = m[P]), y;
|
|
2594
2592
|
}, {});
|
|
2595
|
-
}(t),
|
|
2596
|
-
var
|
|
2597
|
-
return m[
|
|
2598
|
-
}, {}),
|
|
2599
|
-
for (var y = Object.keys(m),
|
|
2600
|
-
var
|
|
2601
|
-
typeof m[
|
|
2593
|
+
}(t), I = r.pluginsArray.reduce(function(m, y) {
|
|
2594
|
+
var P = y.name, N = y.config, z = y.loaded, D = r.pluginEnabled[P];
|
|
2595
|
+
return m[P] = { enabled: D, initialized: !!D && !y.initialize, loaded: !!z({ config: N }), config: N }, m;
|
|
2596
|
+
}, {}), T = { context: $, user: S, plugins: I }, _ = ar(function(m) {
|
|
2597
|
+
for (var y = Object.keys(m), P = {}, N = 0; N < y.length; N++) {
|
|
2598
|
+
var z = y[N];
|
|
2599
|
+
typeof m[z] === ae && (P[z] = m[z]);
|
|
2602
2600
|
}
|
|
2603
|
-
var
|
|
2601
|
+
var D, H = Object.keys(P);
|
|
2604
2602
|
try {
|
|
2605
|
-
(function(
|
|
2606
|
-
Object.keys(
|
|
2607
|
-
var
|
|
2608
|
-
if (typeof
|
|
2609
|
-
throw new Error("reducer " + K + " " +
|
|
2603
|
+
(function(M) {
|
|
2604
|
+
Object.keys(M).forEach(function(K) {
|
|
2605
|
+
var L = M[K];
|
|
2606
|
+
if (typeof L(void 0, { type: "@@redux/INIT" }) === re || typeof L(void 0, { type: Ri }) === re)
|
|
2607
|
+
throw new Error("reducer " + K + " " + re);
|
|
2610
2608
|
});
|
|
2611
|
-
})(
|
|
2612
|
-
} catch (
|
|
2613
|
-
|
|
2609
|
+
})(P);
|
|
2610
|
+
} catch (M) {
|
|
2611
|
+
D = M;
|
|
2614
2612
|
}
|
|
2615
|
-
return function(
|
|
2616
|
-
if (
|
|
2617
|
-
throw
|
|
2618
|
-
for (var
|
|
2619
|
-
var Fe =
|
|
2620
|
-
if (typeof lt ===
|
|
2621
|
-
var
|
|
2622
|
-
throw new Error(
|
|
2613
|
+
return function(M, K) {
|
|
2614
|
+
if (M === void 0 && (M = {}), D)
|
|
2615
|
+
throw D;
|
|
2616
|
+
for (var L = !1, q = {}, Ne = 0; Ne < H.length; Ne++) {
|
|
2617
|
+
var Fe = H[Ne], Kt = M[Fe], lt = (0, P[Fe])(Kt, K);
|
|
2618
|
+
if (typeof lt === re) {
|
|
2619
|
+
var jr = Li(Fe, K);
|
|
2620
|
+
throw new Error(jr);
|
|
2623
2621
|
}
|
|
2624
|
-
q[Fe] = lt,
|
|
2622
|
+
q[Fe] = lt, L = L || lt !== Kt;
|
|
2625
2623
|
}
|
|
2626
|
-
return
|
|
2624
|
+
return L ? q : M;
|
|
2627
2625
|
};
|
|
2628
|
-
}(
|
|
2629
|
-
|
|
2630
|
-
var
|
|
2631
|
-
return
|
|
2626
|
+
}(x({}, j, e)), T, U(A(Mi.apply(void 0, O))));
|
|
2627
|
+
_.dispatch = (F = _.dispatch, function(m, y, P) {
|
|
2628
|
+
var N = x({}, m, { meta: Sn(m.meta, y, vt(P)) });
|
|
2629
|
+
return F.apply(null, [N]);
|
|
2632
2630
|
});
|
|
2633
|
-
var
|
|
2634
|
-
|
|
2635
|
-
var
|
|
2631
|
+
var Z = Object.keys(a);
|
|
2632
|
+
_.dispatch({ type: C.bootstrap, plugins: Z, config: $, params: v, user: S, initialUser: n, persistedUser: E });
|
|
2633
|
+
var W = Z.filter(function(m) {
|
|
2636
2634
|
return r.pluginEnabled[m];
|
|
2637
|
-
}),
|
|
2635
|
+
}), te = Z.filter(function(m) {
|
|
2638
2636
|
return !r.pluginEnabled[m];
|
|
2639
2637
|
});
|
|
2640
|
-
return
|
|
2641
|
-
var
|
|
2642
|
-
|
|
2643
|
-
}),
|
|
2644
|
-
|
|
2645
|
-
}), function(m, y,
|
|
2638
|
+
return _.dispatch({ type: C.registerPlugins, plugins: Z, enabled: r.pluginEnabled }), r.pluginsArray.map(function(m, y) {
|
|
2639
|
+
var P = m.bootstrap, N = m.config, z = m.name;
|
|
2640
|
+
P && V(P) && P({ instance: b, config: N, payload: m }), _.dispatch({ type: C.registerPluginType(z), name: z, enabled: r.pluginEnabled[z], plugin: m }), r.pluginsArray.length === y + 1 && _.dispatch({ type: C.initializeStart, plugins: W, disabled: te });
|
|
2641
|
+
}), so(function(m) {
|
|
2642
|
+
_.dispatch({ type: m ? C.offline : C.online });
|
|
2643
|
+
}), function(m, y, P) {
|
|
2646
2644
|
setInterval(function() {
|
|
2647
|
-
return cr(m, y,
|
|
2645
|
+
return cr(m, y, P);
|
|
2648
2646
|
}, 3e3);
|
|
2649
|
-
}(
|
|
2647
|
+
}(_, u, b), b;
|
|
2650
2648
|
}
|
|
2651
|
-
var Ye = "before", Ge = "after",
|
|
2649
|
+
var Ye = "before", Ge = "after", Le = "cookie", he = wr(), yr = ct, uo = ct;
|
|
2652
2650
|
function vr(t) {
|
|
2653
|
-
return
|
|
2651
|
+
return he ? ct(t, "", -1) : Ae(t);
|
|
2654
2652
|
}
|
|
2655
2653
|
function wr() {
|
|
2656
|
-
if (
|
|
2657
|
-
return
|
|
2654
|
+
if (he !== void 0)
|
|
2655
|
+
return he;
|
|
2658
2656
|
var t = "cookiecookie";
|
|
2659
2657
|
try {
|
|
2660
|
-
ct(t, t),
|
|
2658
|
+
ct(t, t), he = document.cookie.indexOf(t) !== -1, vr(t);
|
|
2661
2659
|
} catch {
|
|
2662
|
-
|
|
2660
|
+
he = !1;
|
|
2663
2661
|
}
|
|
2664
|
-
return
|
|
2662
|
+
return he;
|
|
2665
2663
|
}
|
|
2666
2664
|
function ct(t, e, n, r, i, o) {
|
|
2667
2665
|
if (typeof window < "u") {
|
|
2668
2666
|
var a = arguments.length > 1;
|
|
2669
|
-
return
|
|
2670
|
-
}
|
|
2671
|
-
}
|
|
2672
|
-
var
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
var
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
function
|
|
2667
|
+
return he === !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]);
|
|
2668
|
+
}
|
|
2669
|
+
}
|
|
2670
|
+
var Me = "localStorage", lo = Dt.bind(null, "localStorage");
|
|
2671
|
+
$e("localStorage", "getItem", we);
|
|
2672
|
+
$e("localStorage", "setItem", be);
|
|
2673
|
+
$e("localStorage", "removeItem", Ae);
|
|
2674
|
+
var Ze = "sessionStorage", ho = Dt.bind(null, "sessionStorage");
|
|
2675
|
+
$e("sessionStorage", "getItem", we);
|
|
2676
|
+
$e("sessionStorage", "setItem", be);
|
|
2677
|
+
$e("sessionStorage", "removeItem", Ae);
|
|
2678
|
+
function Oe(t) {
|
|
2681
2679
|
var e = t;
|
|
2682
2680
|
try {
|
|
2683
2681
|
if ((e = JSON.parse(t)) === "true")
|
|
@@ -2692,57 +2690,57 @@ function Ee(t) {
|
|
|
2692
2690
|
if (e !== null && e !== "")
|
|
2693
2691
|
return e;
|
|
2694
2692
|
}
|
|
2695
|
-
var
|
|
2693
|
+
var fo = lo(), po = ho(), mo = wr();
|
|
2696
2694
|
function br(t, e) {
|
|
2697
2695
|
if (t) {
|
|
2698
|
-
var n = Ut(e), r = !
|
|
2699
|
-
if (r && !
|
|
2696
|
+
var n = Ut(e), r = !Zt(n), i = Rt(n) ? Oe(localStorage.getItem(t)) : void 0;
|
|
2697
|
+
if (r && !Se(i))
|
|
2700
2698
|
return i;
|
|
2701
|
-
var o =
|
|
2699
|
+
var o = Lt(n) ? Oe(yr(t)) : void 0;
|
|
2702
2700
|
if (r && o)
|
|
2703
2701
|
return o;
|
|
2704
|
-
var a =
|
|
2702
|
+
var a = Mt(n) ? Oe(sessionStorage.getItem(t)) : void 0;
|
|
2705
2703
|
if (r && a)
|
|
2706
2704
|
return a;
|
|
2707
|
-
var s =
|
|
2705
|
+
var s = we(t);
|
|
2708
2706
|
return r ? s : { localStorage: i, sessionStorage: a, cookie: o, global: s };
|
|
2709
2707
|
}
|
|
2710
2708
|
}
|
|
2711
|
-
function
|
|
2712
|
-
if (t && !
|
|
2713
|
-
var r = {}, i = Ut(n), o = JSON.stringify(e), a = !
|
|
2714
|
-
return Rt(i) && (r[
|
|
2709
|
+
function go(t, e, n) {
|
|
2710
|
+
if (t && !Se(e)) {
|
|
2711
|
+
var r = {}, i = Ut(n), o = JSON.stringify(e), a = !Zt(i);
|
|
2712
|
+
return Rt(i) && (r[Me] = Be(Me, e, Oe(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Me] : Lt(i) && (r[Le] = Be(Le, e, Oe(yr(t))), uo(t, o), a) ? r[Le] : Mt(i) && (r[Ze] = Be(Ze, e, Oe(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Ze] : (r[Re] = Be(Re, e, we(t)), be(t, e), a ? r[Re] : r);
|
|
2715
2713
|
}
|
|
2716
2714
|
}
|
|
2717
|
-
function
|
|
2715
|
+
function yo(t, e) {
|
|
2718
2716
|
if (t) {
|
|
2719
2717
|
var n = Ut(e), r = br(t, tr), i = {};
|
|
2720
|
-
return !
|
|
2718
|
+
return !Se(r.localStorage) && Rt(n) && (localStorage.removeItem(t), i[Me] = r.localStorage), !Se(r.cookie) && Lt(n) && (vr(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;
|
|
2721
2719
|
}
|
|
2722
2720
|
}
|
|
2723
2721
|
function Ut(t) {
|
|
2724
|
-
return t ?
|
|
2722
|
+
return t ? se(t) ? t : t.storage : er;
|
|
2725
2723
|
}
|
|
2726
2724
|
function Rt(t) {
|
|
2727
|
-
return
|
|
2725
|
+
return fo && ut(t, Me);
|
|
2726
|
+
}
|
|
2727
|
+
function Lt(t) {
|
|
2728
|
+
return mo && ut(t, Le);
|
|
2728
2729
|
}
|
|
2729
2730
|
function Mt(t) {
|
|
2730
|
-
return po && ut(t,
|
|
2731
|
+
return po && ut(t, Ze);
|
|
2731
2732
|
}
|
|
2732
2733
|
function Zt(t) {
|
|
2733
|
-
return fo && ut(t, Me);
|
|
2734
|
-
}
|
|
2735
|
-
function Wt(t) {
|
|
2736
2734
|
return t === tr || t === "all";
|
|
2737
2735
|
}
|
|
2738
2736
|
function ut(t, e) {
|
|
2739
|
-
return t === er || t === e ||
|
|
2737
|
+
return t === er || t === e || Zt(t);
|
|
2740
2738
|
}
|
|
2741
2739
|
function Be(t, e, n) {
|
|
2742
2740
|
return { location: t, current: e, previous: n };
|
|
2743
2741
|
}
|
|
2744
|
-
var
|
|
2745
|
-
function
|
|
2742
|
+
var vo = { setItem: go, getItem: br, removeItem: yo };
|
|
2743
|
+
function wo(t, e, n) {
|
|
2746
2744
|
return e in t ? Object.defineProperty(t, e, {
|
|
2747
2745
|
value: n,
|
|
2748
2746
|
enumerable: !0,
|
|
@@ -2750,7 +2748,7 @@ function vo(t, e, n) {
|
|
|
2750
2748
|
writable: !0
|
|
2751
2749
|
}) : t[e] = n, t;
|
|
2752
2750
|
}
|
|
2753
|
-
function
|
|
2751
|
+
function _n(t, e) {
|
|
2754
2752
|
var n = Object.keys(t);
|
|
2755
2753
|
if (Object.getOwnPropertySymbols) {
|
|
2756
2754
|
var r = Object.getOwnPropertySymbols(t);
|
|
@@ -2760,24 +2758,24 @@ function En(t, e) {
|
|
|
2760
2758
|
}
|
|
2761
2759
|
return n;
|
|
2762
2760
|
}
|
|
2763
|
-
function
|
|
2761
|
+
function En(t) {
|
|
2764
2762
|
for (var e = 1; e < arguments.length; e++) {
|
|
2765
2763
|
var n = arguments[e] != null ? arguments[e] : {};
|
|
2766
|
-
e % 2 ?
|
|
2767
|
-
|
|
2768
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) :
|
|
2764
|
+
e % 2 ? _n(Object(n), !0).forEach(function(r) {
|
|
2765
|
+
wo(t, r, n[r]);
|
|
2766
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : _n(Object(n)).forEach(function(r) {
|
|
2769
2767
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
2770
2768
|
});
|
|
2771
2769
|
}
|
|
2772
2770
|
return t;
|
|
2773
2771
|
}
|
|
2774
|
-
function
|
|
2772
|
+
function bo() {
|
|
2775
2773
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = {
|
|
2776
|
-
storage:
|
|
2774
|
+
storage: vo
|
|
2777
2775
|
};
|
|
2778
|
-
return
|
|
2776
|
+
return co(En(En({}, e), t));
|
|
2779
2777
|
}
|
|
2780
|
-
function
|
|
2778
|
+
function ko(t, e) {
|
|
2781
2779
|
e = e || {};
|
|
2782
2780
|
var n, r, i = [], o = e.max || 1 / 0;
|
|
2783
2781
|
function a() {
|
|
@@ -2799,7 +2797,7 @@ function bo(t, e) {
|
|
|
2799
2797
|
}
|
|
2800
2798
|
};
|
|
2801
2799
|
}
|
|
2802
|
-
function
|
|
2800
|
+
function Io(t) {
|
|
2803
2801
|
if (typeof window > "u")
|
|
2804
2802
|
return;
|
|
2805
2803
|
const { addEventListener: e, history: n, location: r } = window;
|
|
@@ -2811,53 +2809,53 @@ function ko(t) {
|
|
|
2811
2809
|
const s = n[a];
|
|
2812
2810
|
n[a] = function(...h) {
|
|
2813
2811
|
var c;
|
|
2814
|
-
const p = ((c = h[2]) == null ? void 0 : c.toString()) || "", u =
|
|
2812
|
+
const p = ((c = h[2]) == null ? void 0 : c.toString()) || "", u = _o(p);
|
|
2815
2813
|
return i !== u && (i = u, setTimeout(() => t(p), 0)), s.apply(n, h);
|
|
2816
2814
|
};
|
|
2817
2815
|
});
|
|
2818
2816
|
}
|
|
2819
|
-
function
|
|
2817
|
+
function So(t, e) {
|
|
2820
2818
|
const n = t.indexOf(e);
|
|
2821
2819
|
return n > -1 ? t.slice(0, n) : t;
|
|
2822
2820
|
}
|
|
2823
|
-
function
|
|
2824
|
-
return ["#", "?"].forEach((e) => t =
|
|
2821
|
+
function _o(t) {
|
|
2822
|
+
return ["#", "?"].forEach((e) => t = So(t, e)), t;
|
|
2825
2823
|
}
|
|
2826
|
-
function
|
|
2827
|
-
|
|
2828
|
-
|
|
2824
|
+
function Eo() {
|
|
2825
|
+
Io(() => {
|
|
2826
|
+
ne.page();
|
|
2829
2827
|
});
|
|
2830
2828
|
}
|
|
2831
|
-
function
|
|
2832
|
-
if (t === void 0 && (t = {}), !
|
|
2829
|
+
function To(t) {
|
|
2830
|
+
if (t === void 0 && (t = {}), !J)
|
|
2833
2831
|
return Tt;
|
|
2834
|
-
var e =
|
|
2832
|
+
var e = On(), 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);
|
|
2835
2833
|
if (!f.length)
|
|
2836
2834
|
return Tt;
|
|
2837
2835
|
var d = f.map(function(k) {
|
|
2838
2836
|
return Number(k);
|
|
2839
|
-
}), w =
|
|
2840
|
-
var k =
|
|
2841
|
-
return
|
|
2842
|
-
return
|
|
2837
|
+
}), w = Ui(function() {
|
|
2838
|
+
var k = On(), v = function($, I) {
|
|
2839
|
+
return I.map(function(T) {
|
|
2840
|
+
return T === 100 ? $ - 5 : $ * (T / 100);
|
|
2843
2841
|
});
|
|
2844
|
-
}(k, d), E = jt(), S =
|
|
2842
|
+
}(k, d), E = jt(), S = Tn(), g = qe(S, k), l = qe(E, k);
|
|
2845
2843
|
if (u = g > u ? g : u, c = l < c ? l : c, !(a.length >= d.length)) {
|
|
2846
|
-
var b = p === S,
|
|
2847
|
-
b ?
|
|
2848
|
-
var j = v,
|
|
2849
|
-
(
|
|
2850
|
-
var U =
|
|
2851
|
-
var
|
|
2852
|
-
return h.includes(
|
|
2853
|
-
return
|
|
2854
|
-
}),
|
|
2855
|
-
}, { foundFunc: [], singleFunction: null, callbacks: [], direction:
|
|
2856
|
-
if (p = S,
|
|
2857
|
-
V(t[
|
|
2844
|
+
var b = p === S, O = "up";
|
|
2845
|
+
b ? O = "initial" : p <= S && (O = "down");
|
|
2846
|
+
var j = v, A = d;
|
|
2847
|
+
(O === "up" || b) && (j = v.slice().reverse(), A = d.slice().reverse());
|
|
2848
|
+
var U = A.reduce(function($, I, T) {
|
|
2849
|
+
var _ = j[T];
|
|
2850
|
+
return h.includes(I) && S <= _ && (h = h.filter(function(Z) {
|
|
2851
|
+
return Z !== I;
|
|
2852
|
+
}), $.singleFunction = I), O === "down" && !a.includes(I) && S >= _ && I > o ? (s.push(I), $.callbacks = $.callbacks.concat(I), $) : O === "up" && !a.includes(I) && S <= _ && I <= g ? ($.foundFunc = [I], $) : (b && S >= _ && $.foundFunc.length === 0 && ($.foundFunc = [I]), !s.includes(I) && S >= _ && (s.push(I), $.singleFunction ? h.push(I) : $.singleFunction = I), $);
|
|
2853
|
+
}, { foundFunc: [], singleFunction: null, callbacks: [], direction: O });
|
|
2854
|
+
if (p = S, O === "down" && U.callbacks && U.callbacks.forEach(function($) {
|
|
2855
|
+
V(t[$]) && (t[$]({ trigger: $, direction: O, scrollMin: c, scrollMax: u, range: [c, u] }), a.push($));
|
|
2858
2856
|
}), U.singleFunction) {
|
|
2859
|
-
var R = U.singleFunction,
|
|
2860
|
-
V(t[R]) && t[R]({ trigger: R, direction:
|
|
2857
|
+
var R = U.singleFunction, F = U.direction;
|
|
2858
|
+
V(t[R]) && t[R]({ trigger: R, direction: F, scrollMin: c, scrollMax: u, range: [c, u] }), a.push(R);
|
|
2861
2859
|
}
|
|
2862
2860
|
}
|
|
2863
2861
|
}, 500);
|
|
@@ -2866,16 +2864,16 @@ function Eo(t) {
|
|
|
2866
2864
|
};
|
|
2867
2865
|
}
|
|
2868
2866
|
function jt() {
|
|
2869
|
-
return
|
|
2867
|
+
return J ? document.body.scrollTop || document.documentElement.scrollTop : 0;
|
|
2870
2868
|
}
|
|
2871
|
-
function
|
|
2872
|
-
return
|
|
2869
|
+
function Oo() {
|
|
2870
|
+
return J ? window.innerHeight || document.documentElement.clientHeight : 0;
|
|
2873
2871
|
}
|
|
2874
|
-
function
|
|
2875
|
-
return Math.round(jt() +
|
|
2872
|
+
function Tn() {
|
|
2873
|
+
return Math.round(jt() + Oo());
|
|
2876
2874
|
}
|
|
2877
|
-
function
|
|
2878
|
-
if (!
|
|
2875
|
+
function On() {
|
|
2876
|
+
if (!J)
|
|
2879
2877
|
return 0;
|
|
2880
2878
|
var t = document.body, e = document.documentElement;
|
|
2881
2879
|
return Math.max(t.scrollHeight, t.offsetHeight, e.clientHeight, e.scrollHeight, e.offsetHeight);
|
|
@@ -2883,11 +2881,11 @@ function Pn() {
|
|
|
2883
2881
|
function qe(t, e) {
|
|
2884
2882
|
return Math.round(t / e * 100);
|
|
2885
2883
|
}
|
|
2886
|
-
var
|
|
2887
|
-
function
|
|
2884
|
+
var Pn = "EventListener";
|
|
2885
|
+
function Po(t) {
|
|
2888
2886
|
return function(e, n, r, i) {
|
|
2889
2887
|
var o = r || Tt, a = i || !1;
|
|
2890
|
-
if (!
|
|
2888
|
+
if (!J)
|
|
2891
2889
|
return o;
|
|
2892
2890
|
var s = rt(n), h = rt(e, !0);
|
|
2893
2891
|
if (!h.length)
|
|
@@ -2897,9 +2895,9 @@ function Oo(t) {
|
|
|
2897
2895
|
var p = [];
|
|
2898
2896
|
return function u(c) {
|
|
2899
2897
|
c && (p = []);
|
|
2900
|
-
for (var f = c ? "add" +
|
|
2898
|
+
for (var f = c ? "add" + Pn : "remove" + Pn, d = 0; d < h.length; d++) {
|
|
2901
2899
|
var w = h[d];
|
|
2902
|
-
p[d] = c ? a && a.once ?
|
|
2900
|
+
p[d] = c ? a && a.once ? jo(o) : o : p[d] || o;
|
|
2903
2901
|
for (var k = 0; k < s.length; k++)
|
|
2904
2902
|
w[f] ? w["on" + s[k]] = c ? p[d] : null : w[f](s[k], p[d], a);
|
|
2905
2903
|
}
|
|
@@ -2908,7 +2906,7 @@ function Oo(t) {
|
|
|
2908
2906
|
};
|
|
2909
2907
|
}
|
|
2910
2908
|
function rt(t, e) {
|
|
2911
|
-
if (
|
|
2909
|
+
if (se(t))
|
|
2912
2910
|
return e ? rt(document.querySelectorAll(t)) : (n = t).split(n.indexOf(",") > -1 ? "," : " ").map(function(a) {
|
|
2913
2911
|
return a.trim();
|
|
2914
2912
|
});
|
|
@@ -2918,31 +2916,31 @@ function rt(t, e) {
|
|
|
2918
2916
|
r[i] = t[i];
|
|
2919
2917
|
return r;
|
|
2920
2918
|
}
|
|
2921
|
-
var o =
|
|
2919
|
+
var o = Ai(t);
|
|
2922
2920
|
return e ? o.map(function(a) {
|
|
2923
|
-
return
|
|
2921
|
+
return se(a) ? rt(a, !0) : a;
|
|
2924
2922
|
}).flat() : o;
|
|
2925
2923
|
}
|
|
2926
|
-
function
|
|
2924
|
+
function jo(t, e) {
|
|
2927
2925
|
var n;
|
|
2928
2926
|
return function() {
|
|
2929
2927
|
return t && (n = t.apply(e || this, arguments), t = null), n;
|
|
2930
2928
|
};
|
|
2931
2929
|
}
|
|
2932
|
-
var wt =
|
|
2930
|
+
var wt = Po("Event");
|
|
2933
2931
|
function kr(t, e) {
|
|
2934
|
-
return
|
|
2932
|
+
return J && V(window[t]) ? (n = window[t], r = e, (i = window) === void 0 && (i = null), V(n) ? function() {
|
|
2935
2933
|
n.apply(i, arguments), r.apply(i, arguments);
|
|
2936
2934
|
} : r) : window[t] = e;
|
|
2937
2935
|
var n, r, i;
|
|
2938
2936
|
}
|
|
2939
2937
|
kr.bind(null, "onerror");
|
|
2940
2938
|
kr.bind(null, "onload");
|
|
2941
|
-
var Ir = typeof window > "u",
|
|
2942
|
-
function
|
|
2939
|
+
var Ir = typeof window > "u", jn = "hidden";
|
|
2940
|
+
function Co(t) {
|
|
2943
2941
|
if (Ir)
|
|
2944
2942
|
return !1;
|
|
2945
|
-
var e =
|
|
2943
|
+
var e = xo(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
|
|
2946
2944
|
return t(!!document[e]);
|
|
2947
2945
|
}, i = function() {
|
|
2948
2946
|
return document.addEventListener(n, r);
|
|
@@ -2951,15 +2949,15 @@ function jo(t) {
|
|
|
2951
2949
|
return document.removeEventListener(n, r), i;
|
|
2952
2950
|
};
|
|
2953
2951
|
}
|
|
2954
|
-
function
|
|
2952
|
+
function xo() {
|
|
2955
2953
|
var t = ["webkit", "moz", "ms", "o"];
|
|
2956
|
-
return Ir ||
|
|
2954
|
+
return Ir || jn in document ? jn : t.reduce(function(e, n) {
|
|
2957
2955
|
var r = n + "Hidden";
|
|
2958
2956
|
return !e && r in document ? r : e;
|
|
2959
2957
|
}, null);
|
|
2960
2958
|
}
|
|
2961
|
-
var
|
|
2962
|
-
function
|
|
2959
|
+
var Ao = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
|
|
2960
|
+
function $o(t, e) {
|
|
2963
2961
|
e === void 0 && (e = {});
|
|
2964
2962
|
var n = /* @__PURE__ */ function(a, s) {
|
|
2965
2963
|
var h = this, p = !1;
|
|
@@ -2970,10 +2968,10 @@ function Ao(t, e) {
|
|
|
2970
2968
|
};
|
|
2971
2969
|
}(t, e.throttle || 1e4), r = [];
|
|
2972
2970
|
function i() {
|
|
2973
|
-
var a =
|
|
2971
|
+
var a = Co(function(s) {
|
|
2974
2972
|
s || n({ type: "tabVisible" });
|
|
2975
2973
|
});
|
|
2976
|
-
return r = [a].concat(
|
|
2974
|
+
return r = [a].concat(Ao.map(function(s) {
|
|
2977
2975
|
return wt(document, s, n);
|
|
2978
2976
|
})).concat(wt(window, "load", n)).concat(wt(window, "scroll", n, { capture: !0, passive: !0 })), o;
|
|
2979
2977
|
}
|
|
@@ -2986,16 +2984,16 @@ function Ao(t, e) {
|
|
|
2986
2984
|
return o(), i;
|
|
2987
2985
|
};
|
|
2988
2986
|
}
|
|
2989
|
-
function
|
|
2987
|
+
function No(t) {
|
|
2990
2988
|
var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a, h = t.throttle, p = h === void 0 ? 2e3 : h, u = !1, c = !1, f = /* @__PURE__ */ new Date(), d = function() {
|
|
2991
2989
|
return clearTimeout(e);
|
|
2992
2990
|
};
|
|
2993
2991
|
function w(v) {
|
|
2994
|
-
d(), o && !u && o(
|
|
2995
|
-
u = !0, r && (n = /* @__PURE__ */ new Date(), r(
|
|
2992
|
+
d(), o && !u && o(De(f), v), i && u && (u = !1, i(De(n), v), f = /* @__PURE__ */ new Date()), e = setTimeout(function() {
|
|
2993
|
+
u = !0, r && (n = /* @__PURE__ */ new Date(), r(De(f), v));
|
|
2996
2994
|
}, s);
|
|
2997
2995
|
}
|
|
2998
|
-
var k =
|
|
2996
|
+
var k = $o(w, { throttle: p });
|
|
2999
2997
|
return { disable: function() {
|
|
3000
2998
|
c = !0, u = !1, d();
|
|
3001
2999
|
var v = k();
|
|
@@ -3003,26 +3001,26 @@ function $o(t) {
|
|
|
3003
3001
|
return c = !1, f = /* @__PURE__ */ new Date(), w({ type: "load" }), v();
|
|
3004
3002
|
};
|
|
3005
3003
|
}, getStatus: function() {
|
|
3006
|
-
return { isIdle: u, isDisabled: c, active: u ? 0 :
|
|
3004
|
+
return { isIdle: u, isDisabled: c, active: u ? 0 : De(f, c), idle: u ? De(n, c) : 0 };
|
|
3007
3005
|
} };
|
|
3008
3006
|
}
|
|
3009
|
-
function
|
|
3007
|
+
function De(t, e) {
|
|
3010
3008
|
return e ? 0 : Math.round((/* @__PURE__ */ new Date() - t) / 1e3);
|
|
3011
3009
|
}
|
|
3012
|
-
const
|
|
3010
|
+
const Cn = 5e3;
|
|
3013
3011
|
class zo {
|
|
3014
3012
|
constructor(e) {
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3013
|
+
G(this, "element");
|
|
3014
|
+
G(this, "isInViewport", !1);
|
|
3015
|
+
G(this, "isAwake", !1);
|
|
3016
|
+
G(this, "isFlushing");
|
|
3017
|
+
G(this, "observer");
|
|
3018
|
+
G(this, "lastEventAt", Date.now());
|
|
3019
|
+
G(this, "registeredView", !1);
|
|
3020
|
+
G(this, "viewCallback");
|
|
3021
|
+
G(this, "activeDurationCallback");
|
|
3022
|
+
G(this, "idleDurationCallback");
|
|
3023
|
+
G(this, "scrollCallback");
|
|
3026
3024
|
this.element = e.element, this.viewCallback = e.viewCallback, this.activeDurationCallback = e.activeDurationCallback, this.idleDurationCallback = e.idleDurationCallback, this.scrollCallback = e.scrollCallback, this.observer = new IntersectionObserver(
|
|
3027
3025
|
(n) => {
|
|
3028
3026
|
n.forEach((r) => {
|
|
@@ -3032,11 +3030,11 @@ class zo {
|
|
|
3032
3030
|
{
|
|
3033
3031
|
threshold: 0
|
|
3034
3032
|
}
|
|
3035
|
-
), this.observer.observe(this.element),
|
|
3033
|
+
), this.observer.observe(this.element), No({
|
|
3036
3034
|
onIdle: (n) => this.handleAwake(!1, n),
|
|
3037
3035
|
onWakeUp: (n) => this.handleAwake(!0, n),
|
|
3038
|
-
timeout:
|
|
3039
|
-
}),
|
|
3036
|
+
timeout: Cn
|
|
3037
|
+
}), To({
|
|
3040
3038
|
25: this.handleScroll.bind(this),
|
|
3041
3039
|
50: this.handleScroll.bind(this),
|
|
3042
3040
|
75: this.handleScroll.bind(this),
|
|
@@ -3054,7 +3052,7 @@ class zo {
|
|
|
3054
3052
|
e ? (this.isAwake = !0, this.trackInViewport()) : this.handleAwake(!1), this.isInViewport = e;
|
|
3055
3053
|
}
|
|
3056
3054
|
handleAwake(e, n = Math.round((Date.now() - this.lastEventAt) / 1e3)) {
|
|
3057
|
-
this.isAwake = e, this.lastEventAt = e ? Date.now() - n *
|
|
3055
|
+
this.isAwake = e, this.lastEventAt = e ? Date.now() - n * Cn : Date.now(), this.isInViewport && this.trackAwake(e, n);
|
|
3058
3056
|
}
|
|
3059
3057
|
handleScroll(e) {
|
|
3060
3058
|
this.scrollCallback && this.scrollCallback(e);
|
|
@@ -3071,50 +3069,50 @@ class zo {
|
|
|
3071
3069
|
this.registeredView || (this.registeredView = !0, this.viewCallback && this.viewCallback());
|
|
3072
3070
|
}
|
|
3073
3071
|
}
|
|
3074
|
-
const
|
|
3075
|
-
function
|
|
3076
|
-
let t = sessionStorage.getItem(
|
|
3077
|
-
return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(
|
|
3072
|
+
const xn = "sesamy_session_id";
|
|
3073
|
+
function Do() {
|
|
3074
|
+
let t = sessionStorage.getItem(xn);
|
|
3075
|
+
return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(xn, t)), t;
|
|
3078
3076
|
}
|
|
3079
|
-
let Sr = !1, Ct,
|
|
3080
|
-
function
|
|
3081
|
-
if (Ct = t,
|
|
3077
|
+
let Sr = !1, Ct, An, it;
|
|
3078
|
+
function Uo({ clientId: t, enabled: e = !0, endpoint: n = ri }) {
|
|
3079
|
+
if (Ct = t, An = e, it = n, !An)
|
|
3082
3080
|
return;
|
|
3083
|
-
|
|
3081
|
+
Eo();
|
|
3084
3082
|
const r = new zo({
|
|
3085
3083
|
element: document.body,
|
|
3086
3084
|
viewCallback: () => {
|
|
3087
|
-
|
|
3085
|
+
ne.page();
|
|
3088
3086
|
},
|
|
3089
3087
|
activeDurationCallback: (i, o, a) => {
|
|
3090
|
-
|
|
3088
|
+
ne.track("activeDuration", {
|
|
3091
3089
|
duration: i,
|
|
3092
3090
|
durationStart: a,
|
|
3093
3091
|
flushing: o
|
|
3094
3092
|
});
|
|
3095
3093
|
},
|
|
3096
3094
|
idleDurationCallback: (i, o, a) => {
|
|
3097
|
-
|
|
3095
|
+
ne.track("idleDuration", {
|
|
3098
3096
|
duration: i,
|
|
3099
3097
|
durationStart: a,
|
|
3100
3098
|
flushing: o
|
|
3101
3099
|
});
|
|
3102
3100
|
},
|
|
3103
3101
|
scrollCallback: (i) => {
|
|
3104
|
-
|
|
3102
|
+
ne.track("scroll", {
|
|
3105
3103
|
scroll: i.scrollMax
|
|
3106
3104
|
});
|
|
3107
3105
|
}
|
|
3108
3106
|
});
|
|
3109
|
-
|
|
3107
|
+
Mo(document.body, () => {
|
|
3110
3108
|
r.flush();
|
|
3111
|
-
}),
|
|
3109
|
+
}), Zo(document.body, () => {
|
|
3112
3110
|
r.handleVisibilityChange();
|
|
3113
|
-
}), window.addEventListener(
|
|
3111
|
+
}), window.addEventListener(ee.AUTHENTICATED, async (i) => {
|
|
3114
3112
|
const o = i;
|
|
3115
|
-
await
|
|
3116
|
-
}), window.addEventListener(
|
|
3117
|
-
await
|
|
3113
|
+
await ne.identify(o.detail.sub);
|
|
3114
|
+
}), window.addEventListener(ee.LOGOUT, async () => {
|
|
3115
|
+
await ne.track("logout", {}), Wt.flush(), await ne.reset();
|
|
3118
3116
|
});
|
|
3119
3117
|
}
|
|
3120
3118
|
function _r(t) {
|
|
@@ -3123,9 +3121,9 @@ function _r(t) {
|
|
|
3123
3121
|
...e,
|
|
3124
3122
|
clientId: Ct,
|
|
3125
3123
|
requestId: Math.random().toString(36).slice(2, 9),
|
|
3126
|
-
sessionId:
|
|
3124
|
+
sessionId: Do(),
|
|
3127
3125
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3128
|
-
version:
|
|
3126
|
+
version: zt,
|
|
3129
3127
|
event: e.event,
|
|
3130
3128
|
context: {
|
|
3131
3129
|
page: {
|
|
@@ -3143,7 +3141,7 @@ function _r(t) {
|
|
|
3143
3141
|
}))
|
|
3144
3142
|
);
|
|
3145
3143
|
}
|
|
3146
|
-
const
|
|
3144
|
+
const Wt = ko(
|
|
3147
3145
|
async (t) => {
|
|
3148
3146
|
if (t.length > 0) {
|
|
3149
3147
|
const e = _r(t);
|
|
@@ -3170,11 +3168,11 @@ function bt(t) {
|
|
|
3170
3168
|
const n = { ...t };
|
|
3171
3169
|
delete n.properties.flushing, navigator.sendBeacon(it, _r([n]));
|
|
3172
3170
|
} else
|
|
3173
|
-
|
|
3171
|
+
Wt.push(t);
|
|
3174
3172
|
}
|
|
3175
|
-
const
|
|
3173
|
+
const ne = bo({
|
|
3176
3174
|
app: Qn,
|
|
3177
|
-
version:
|
|
3175
|
+
version: zt,
|
|
3178
3176
|
plugins: [
|
|
3179
3177
|
{
|
|
3180
3178
|
name: "custom-analytics-plugin",
|
|
@@ -3210,23 +3208,23 @@ const ee = wo({
|
|
|
3210
3208
|
}
|
|
3211
3209
|
]
|
|
3212
3210
|
});
|
|
3213
|
-
function
|
|
3214
|
-
|
|
3211
|
+
function Ro(t, e) {
|
|
3212
|
+
ne.track(t, e);
|
|
3215
3213
|
}
|
|
3216
|
-
function
|
|
3217
|
-
return Sr = !0,
|
|
3214
|
+
function Lo() {
|
|
3215
|
+
return Sr = !0, Wt.flush();
|
|
3218
3216
|
}
|
|
3219
3217
|
const Er = /* @__PURE__ */ new Map();
|
|
3220
|
-
function
|
|
3218
|
+
function Mo(t, e) {
|
|
3221
3219
|
Er.set(t, e);
|
|
3222
3220
|
}
|
|
3223
3221
|
window.addEventListener("beforeunload", () => {
|
|
3224
3222
|
Er.forEach((t, e) => {
|
|
3225
3223
|
t.bind(e)();
|
|
3226
|
-
}),
|
|
3224
|
+
}), Lo();
|
|
3227
3225
|
});
|
|
3228
3226
|
const Tr = /* @__PURE__ */ new Map();
|
|
3229
|
-
function
|
|
3227
|
+
function Zo(t, e) {
|
|
3230
3228
|
Tr.set(t, e);
|
|
3231
3229
|
}
|
|
3232
3230
|
window.addEventListener("visibilitychange", () => {
|
|
@@ -3234,126 +3232,151 @@ window.addEventListener("visibilitychange", () => {
|
|
|
3234
3232
|
t.bind(e)();
|
|
3235
3233
|
});
|
|
3236
3234
|
});
|
|
3237
|
-
const
|
|
3238
|
-
function
|
|
3239
|
-
const t = sessionStorage.getItem(
|
|
3235
|
+
const Or = "sesamySignedURLs";
|
|
3236
|
+
function Pr() {
|
|
3237
|
+
const t = sessionStorage.getItem(Or);
|
|
3240
3238
|
return t ? JSON.parse(t) : [];
|
|
3241
3239
|
}
|
|
3240
|
+
function Wo(t) {
|
|
3241
|
+
const e = Pr();
|
|
3242
|
+
e.push(t), sessionStorage.setItem(Or, JSON.stringify(e));
|
|
3243
|
+
}
|
|
3242
3244
|
function Ko(t) {
|
|
3243
3245
|
const {
|
|
3244
3246
|
getEntitlement: e,
|
|
3245
3247
|
getEntitlements: n,
|
|
3246
3248
|
getEntitlementAccess: r,
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3249
|
+
getSubscriptions: i,
|
|
3250
|
+
getContract: o,
|
|
3251
|
+
getContracts: a,
|
|
3252
|
+
getBill: s,
|
|
3253
|
+
getBills: h,
|
|
3254
|
+
getProfile: p,
|
|
3255
|
+
getTags: u,
|
|
3256
|
+
deleteTag: c,
|
|
3257
|
+
setTag: f,
|
|
3258
|
+
getUserMetadata: d,
|
|
3259
|
+
listUserMetadata: w,
|
|
3260
|
+
setUserMetadata: k,
|
|
3261
|
+
deleteUserMetadata: v,
|
|
3262
|
+
getTally: E,
|
|
3263
|
+
getTallies: S,
|
|
3264
|
+
pushTally: g,
|
|
3265
|
+
deleteTally: l,
|
|
3266
|
+
getProduct: b,
|
|
3267
|
+
autoOnboardProduct: O
|
|
3268
|
+
} = Ii(t), j = {
|
|
3265
3269
|
auth: {
|
|
3266
|
-
getUser:
|
|
3267
|
-
isAuthenticated:
|
|
3268
|
-
loginWithRedirect:
|
|
3269
|
-
logout:
|
|
3270
|
+
getUser: p,
|
|
3271
|
+
isAuthenticated: oi,
|
|
3272
|
+
loginWithRedirect: ai,
|
|
3273
|
+
logout: ci,
|
|
3270
3274
|
setToken: Yn
|
|
3271
3275
|
},
|
|
3272
3276
|
analytics: {
|
|
3273
|
-
track:
|
|
3277
|
+
track: Ro
|
|
3274
3278
|
},
|
|
3275
3279
|
tags: {
|
|
3276
|
-
list:
|
|
3277
|
-
set:
|
|
3278
|
-
delete:
|
|
3280
|
+
list: u,
|
|
3281
|
+
set: f,
|
|
3282
|
+
delete: c
|
|
3279
3283
|
},
|
|
3280
3284
|
entitlements: {
|
|
3281
3285
|
get: e,
|
|
3282
3286
|
list: n,
|
|
3283
3287
|
access: r,
|
|
3284
|
-
signedLinks:
|
|
3288
|
+
signedLinks: Pr
|
|
3285
3289
|
},
|
|
3286
3290
|
contracts: {
|
|
3287
|
-
get:
|
|
3288
|
-
list:
|
|
3291
|
+
get: o,
|
|
3292
|
+
list: a
|
|
3289
3293
|
},
|
|
3290
3294
|
bills: {
|
|
3291
|
-
get:
|
|
3292
|
-
list:
|
|
3295
|
+
get: s,
|
|
3296
|
+
list: h
|
|
3293
3297
|
},
|
|
3294
3298
|
userMetadata: {
|
|
3295
|
-
get:
|
|
3296
|
-
list:
|
|
3297
|
-
set:
|
|
3298
|
-
delete:
|
|
3299
|
+
get: d,
|
|
3300
|
+
list: w,
|
|
3301
|
+
set: k,
|
|
3302
|
+
delete: v
|
|
3299
3303
|
},
|
|
3300
3304
|
tallies: {
|
|
3301
|
-
get:
|
|
3302
|
-
list:
|
|
3303
|
-
push:
|
|
3304
|
-
delete:
|
|
3305
|
+
get: E,
|
|
3306
|
+
list: S,
|
|
3307
|
+
push: g,
|
|
3308
|
+
delete: l
|
|
3309
|
+
},
|
|
3310
|
+
subscriptions: {
|
|
3311
|
+
list: i
|
|
3305
3312
|
},
|
|
3306
3313
|
products: {
|
|
3307
|
-
get:
|
|
3308
|
-
autoOnboard:
|
|
3314
|
+
get: b,
|
|
3315
|
+
autoOnboard: O
|
|
3309
3316
|
},
|
|
3310
3317
|
getVersion: Fo,
|
|
3311
|
-
clearCache:
|
|
3318
|
+
clearCache: ie
|
|
3312
3319
|
};
|
|
3313
|
-
return t.namespace && (window[t.namespace] =
|
|
3320
|
+
return t.namespace && (window[t.namespace] = j), j;
|
|
3314
3321
|
}
|
|
3315
3322
|
function Fo() {
|
|
3316
|
-
return
|
|
3323
|
+
return zt;
|
|
3317
3324
|
}
|
|
3318
3325
|
function Ho() {
|
|
3319
3326
|
const t = new URLSearchParams(window.location.hash.substring(1)), e = t.get("access_token"), n = t.get("expires_in");
|
|
3320
|
-
if (e
|
|
3321
|
-
Yn(e, parseInt(n, 10));
|
|
3327
|
+
if (e) {
|
|
3328
|
+
Yn(e, n ? parseInt(n, 10) : void 0);
|
|
3322
3329
|
const r = new URL(window.location.href);
|
|
3323
3330
|
t.delete("access_token"), t.delete("expires_in"), r.hash = t.toString(), window.history.replaceState(null, "", r);
|
|
3324
3331
|
}
|
|
3325
3332
|
}
|
|
3326
|
-
const
|
|
3333
|
+
const $n = "sesamy-refresh", Nn = "force-refetch-entitlements";
|
|
3327
3334
|
function Jo() {
|
|
3328
|
-
const t = new URLSearchParams(window.location.search), e = t.get(Nn), n = t.get(
|
|
3335
|
+
const t = new URLSearchParams(window.location.search), e = t.get(Nn), n = t.get($n);
|
|
3329
3336
|
if (e !== null || n !== null) {
|
|
3330
3337
|
const r = new URL(window.location.href);
|
|
3331
|
-
t.delete(Nn), t.delete(
|
|
3338
|
+
t.delete(Nn), t.delete($n), r.search = t.toString(), ie(), window.history.replaceState(null, "", r);
|
|
3332
3339
|
}
|
|
3333
3340
|
}
|
|
3334
|
-
|
|
3335
|
-
|
|
3341
|
+
function Xo() {
|
|
3342
|
+
const t = new URLSearchParams(window.location.search), e = t.get("token"), n = t.get("se");
|
|
3343
|
+
if (!n || !e)
|
|
3344
|
+
return;
|
|
3345
|
+
const r = parseInt(n, 10);
|
|
3346
|
+
if (Number.isNaN(r) || r < Date.now())
|
|
3347
|
+
return;
|
|
3348
|
+
Wo({
|
|
3349
|
+
url: window.location.href.split("?")[0],
|
|
3350
|
+
token: e,
|
|
3351
|
+
expiresAt: r,
|
|
3352
|
+
publisherContentId: t.get("sp") ?? void 0
|
|
3353
|
+
});
|
|
3354
|
+
const i = new URL(window.location.href);
|
|
3355
|
+
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);
|
|
3356
|
+
}
|
|
3357
|
+
async function Vo(t) {
|
|
3358
|
+
Uo({
|
|
3336
3359
|
clientId: t.clientId,
|
|
3337
3360
|
// The default client id can be overridden by the config
|
|
3338
3361
|
...t.analytics
|
|
3339
|
-
}), await
|
|
3362
|
+
}), await ii({
|
|
3340
3363
|
clientId: t.clientId,
|
|
3341
3364
|
// The default client id can be overridden by the config
|
|
3342
3365
|
...t.auth
|
|
3343
3366
|
});
|
|
3344
3367
|
const e = Ko(t.api || {});
|
|
3345
|
-
return
|
|
3368
|
+
return ye(ee.READY, {}), Ho(), Jo(), Xo(), e;
|
|
3346
3369
|
}
|
|
3347
3370
|
if (typeof document < "u") {
|
|
3348
3371
|
const t = document.getElementById("sesamy-js");
|
|
3349
3372
|
if (t != null && t.textContent)
|
|
3350
3373
|
try {
|
|
3351
3374
|
const e = JSON.parse(t.textContent);
|
|
3352
|
-
|
|
3375
|
+
Vo(e);
|
|
3353
3376
|
} catch (e) {
|
|
3354
3377
|
console.error("Failed to parse config", e);
|
|
3355
3378
|
}
|
|
3356
3379
|
}
|
|
3357
3380
|
export {
|
|
3358
|
-
|
|
3381
|
+
Vo as init
|
|
3359
3382
|
};
|