@sesamy/sesamy-js 1.19.7 → 1.19.8
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/dist/sesamy-js.cjs +1 -1
- package/dist/sesamy-js.d.ts +86 -44
- package/dist/sesamy-js.iife.js +2 -2
- package/dist/sesamy-js.mjs +36 -17
- package/package.json +1 -1
package/dist/sesamy-js.mjs
CHANGED
|
@@ -5295,7 +5295,23 @@ function rP(e) {
|
|
|
5295
5295
|
const t = dv();
|
|
5296
5296
|
t.push(e), sessionStorage.setItem(fv, JSON.stringify(t));
|
|
5297
5297
|
}
|
|
5298
|
-
|
|
5298
|
+
const nP = ["AdHeader", "AdContainer", "AD_Top", "homead", "ad-lead"];
|
|
5299
|
+
function aP() {
|
|
5300
|
+
return new Promise((e) => {
|
|
5301
|
+
const t = nP.map((r) => {
|
|
5302
|
+
const n = document.createElement("div");
|
|
5303
|
+
return n.innerHTML = " ", n.id = r, n.style.position = "absolute", document.body.appendChild(n), n;
|
|
5304
|
+
});
|
|
5305
|
+
window.setTimeout(() => {
|
|
5306
|
+
const r = !t.every((n) => {
|
|
5307
|
+
const a = document.querySelector(`#${n.id}`);
|
|
5308
|
+
return a == null ? void 0 : a.offsetParent;
|
|
5309
|
+
});
|
|
5310
|
+
t.forEach((n) => n.remove()), e(r);
|
|
5311
|
+
}, 100);
|
|
5312
|
+
});
|
|
5313
|
+
}
|
|
5314
|
+
function iP(e) {
|
|
5299
5315
|
const {
|
|
5300
5316
|
createCheckout: t,
|
|
5301
5317
|
getCheckout: r,
|
|
@@ -5397,17 +5413,20 @@ function nP(e) {
|
|
|
5397
5413
|
autoOnboard: G,
|
|
5398
5414
|
linkSpotify: R
|
|
5399
5415
|
},
|
|
5400
|
-
|
|
5416
|
+
browser: {
|
|
5417
|
+
detectAdblock: aP
|
|
5418
|
+
},
|
|
5419
|
+
getVersion: oP,
|
|
5401
5420
|
getPaymentIssues: L,
|
|
5402
5421
|
generateLink: Le,
|
|
5403
5422
|
clearCache: Se
|
|
5404
5423
|
};
|
|
5405
5424
|
return e.namespace && (window[e.namespace] = m), m;
|
|
5406
5425
|
}
|
|
5407
|
-
function
|
|
5426
|
+
function oP() {
|
|
5408
5427
|
return Xo;
|
|
5409
5428
|
}
|
|
5410
|
-
async function
|
|
5429
|
+
async function sP({ enabled: e = !1, rules: t }) {
|
|
5411
5430
|
if (!e)
|
|
5412
5431
|
return;
|
|
5413
5432
|
const r = await Jo(), n = window.location.href;
|
|
@@ -5452,7 +5471,7 @@ async function fl(e) {
|
|
|
5452
5471
|
return console.error(`Error fetching content from ${e}:`, t), null;
|
|
5453
5472
|
}
|
|
5454
5473
|
}
|
|
5455
|
-
function
|
|
5474
|
+
function cP() {
|
|
5456
5475
|
const e = new URLSearchParams(window.location.hash.substring(1)), t = e.get("access_token");
|
|
5457
5476
|
if (t) {
|
|
5458
5477
|
jd(t);
|
|
@@ -5461,14 +5480,14 @@ function oP() {
|
|
|
5461
5480
|
}
|
|
5462
5481
|
}
|
|
5463
5482
|
const dl = "sesamy-refresh", vl = "force-refetch-entitlements";
|
|
5464
|
-
function
|
|
5483
|
+
function uP() {
|
|
5465
5484
|
const e = new URLSearchParams(window.location.search), t = e.get(vl), r = e.get(dl);
|
|
5466
5485
|
if (t !== null || r !== null) {
|
|
5467
5486
|
const n = new URL(window.location.href);
|
|
5468
5487
|
e.delete(vl), e.delete(dl), n.search = e.toString(), Se(), window.history.replaceState(null, "", n);
|
|
5469
5488
|
}
|
|
5470
5489
|
}
|
|
5471
|
-
function
|
|
5490
|
+
function lP() {
|
|
5472
5491
|
const e = new URLSearchParams(window.location.search), t = e.get("token"), r = e.get("se");
|
|
5473
5492
|
if (!r || !t)
|
|
5474
5493
|
return;
|
|
@@ -5485,7 +5504,7 @@ function cP() {
|
|
|
5485
5504
|
a.searchParams.delete("ss"), a.searchParams.delete("se"), a.searchParams.delete("sp"), a.searchParams.delete("so"), a.searchParams.delete("token"), window.history.replaceState(null, "", a);
|
|
5486
5505
|
}
|
|
5487
5506
|
const hl = "sesamy-user";
|
|
5488
|
-
async function
|
|
5507
|
+
async function fP() {
|
|
5489
5508
|
const t = new URLSearchParams(window.location.search).get(hl);
|
|
5490
5509
|
if (!t)
|
|
5491
5510
|
return;
|
|
@@ -5495,7 +5514,7 @@ async function uP() {
|
|
|
5495
5514
|
n.searchParams.delete(hl), window.history.replaceState(null, "", n);
|
|
5496
5515
|
}
|
|
5497
5516
|
const pl = "sesamy-purchase";
|
|
5498
|
-
function
|
|
5517
|
+
function dP() {
|
|
5499
5518
|
const e = new URLSearchParams(window.location.search), t = e.get(pl);
|
|
5500
5519
|
if (t !== null) {
|
|
5501
5520
|
const r = new URL(window.location.href);
|
|
@@ -5503,14 +5522,14 @@ function lP() {
|
|
|
5503
5522
|
}
|
|
5504
5523
|
}
|
|
5505
5524
|
const ml = "sesamy-login";
|
|
5506
|
-
async function
|
|
5525
|
+
async function vP() {
|
|
5507
5526
|
if (!new URLSearchParams(window.location.search).get(ml))
|
|
5508
5527
|
return;
|
|
5509
5528
|
await Jo() || Yo();
|
|
5510
5529
|
const n = new URL(window.location.href);
|
|
5511
5530
|
n.searchParams.delete(ml), window.history.replaceState(null, "", n);
|
|
5512
5531
|
}
|
|
5513
|
-
const
|
|
5532
|
+
const hP = typeof window < "u";
|
|
5514
5533
|
async function gl(e) {
|
|
5515
5534
|
XE({
|
|
5516
5535
|
clientId: e.clientId,
|
|
@@ -5523,22 +5542,22 @@ async function gl(e) {
|
|
|
5523
5542
|
environment: e.environment,
|
|
5524
5543
|
// The default client id can be overridden by the config
|
|
5525
5544
|
...e.auth
|
|
5526
|
-
}), e.transform && await
|
|
5545
|
+
}), e.transform && await sP(e.transform), cP(), uP(), lP(), await vP(), await fP(), dP(), Ye(Te.READY, {});
|
|
5527
5546
|
}
|
|
5528
|
-
async function
|
|
5529
|
-
const t =
|
|
5530
|
-
return
|
|
5547
|
+
async function pP(e) {
|
|
5548
|
+
const t = iP({ clientId: e.clientId, environment: e.environment, ...e.api });
|
|
5549
|
+
return hP && (e.awaitAllServices ? await gl(e) : gl(e)), t;
|
|
5531
5550
|
}
|
|
5532
5551
|
if (typeof document < "u") {
|
|
5533
5552
|
const e = document.getElementById("sesamy-js");
|
|
5534
5553
|
if (e != null && e.textContent)
|
|
5535
5554
|
try {
|
|
5536
5555
|
const t = JSON.parse(e.textContent);
|
|
5537
|
-
|
|
5556
|
+
pP(t);
|
|
5538
5557
|
} catch (t) {
|
|
5539
5558
|
console.error("Failed to parse config", t);
|
|
5540
5559
|
}
|
|
5541
5560
|
}
|
|
5542
5561
|
export {
|
|
5543
|
-
|
|
5562
|
+
pP as init
|
|
5544
5563
|
};
|