@sesamy/sesamy-js 1.125.3 → 1.125.4
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/auth0-plugin.iife.js +1 -1
- package/dist/auth0-plugin.mjs +4 -0
- package/dist/capsule-plugin.iife.js +1 -1
- package/dist/capsule-plugin.mjs +4 -0
- package/dist/sesamy-js.cjs +7 -7
- package/dist/sesamy-js.iife.js +7 -7
- package/dist/sesamy-js.mjs +1117 -1112
- package/package.json +1 -1
package/dist/sesamy-js.mjs
CHANGED
|
@@ -2747,35 +2747,40 @@ async function pr(e) {
|
|
|
2747
2747
|
q("Auth disabled via config"), dr = !0;
|
|
2748
2748
|
return;
|
|
2749
2749
|
}
|
|
2750
|
-
e.useHttpCookies ? (q("useHttpCookies=true — using cookie-based BFF plugin"), qn(lr({ baseUrl: e.baseUrl }))) : Jn() || (q("No auth plugin registered — falling back to cookie-based BFF plugin"), qn(lr({ baseUrl: e.baseUrl }))), Xn(e), await fr().init(e), dr = !0;
|
|
2750
|
+
e.useHttpCookies ? (q("useHttpCookies=true — using cookie-based BFF plugin"), qn(lr({ baseUrl: e.baseUrl }))) : Jn() || (mr(e), q("No auth plugin registered — falling back to cookie-based BFF plugin"), qn(lr({ baseUrl: e.baseUrl }))), Xn(e), await fr().init(e), dr = !0;
|
|
2751
2751
|
}
|
|
2752
|
-
|
|
2752
|
+
function mr(e) {
|
|
2753
|
+
if (!(e.domain || e.domains?.length) || typeof window > "u") return;
|
|
2754
|
+
let t = typeof window.auth0Plugin?.createAuth0Plugin == "function", n = !e.baseUrl;
|
|
2755
|
+
console.warn(`[sesamy-js] Falling back to cookie-based (BFF) auth, but auth.domain="${e.domain ?? e.domains?.[0]}" is set and useHttpCookies is not — auth0 login was expected. The auth0-plugin was not registered when init() ran. ` + (t ? "window.auth0Plugin is present now but was missing at init() — likely a script load-order issue." : "window.auth0Plugin is undefined — the auth0-plugin did not attach to window. If the bundle is loaded with <script type=\"module\">, load it as a classic <script> or use the module-format bundle URL (…/bundle, without the .js extension).") + (n ? " As a result the cookie fallback will call a non-existent same-origin /auth/userinfo (empty baseUrl) and login will not work until the embed is fixed." : ""));
|
|
2756
|
+
}
|
|
2757
|
+
async function hr() {
|
|
2753
2758
|
return dr ? fr().isAuthenticated() : !1;
|
|
2754
2759
|
}
|
|
2755
|
-
async function
|
|
2760
|
+
async function gr(e = !0, t = !1) {
|
|
2756
2761
|
return dr ? fr().getTokenSilently(e, t) : null;
|
|
2757
2762
|
}
|
|
2758
|
-
function
|
|
2763
|
+
function _r() {
|
|
2759
2764
|
return dr ? Jn()?.getProxyAuthBaseUrl?.() ?? null : null;
|
|
2760
2765
|
}
|
|
2761
|
-
async function
|
|
2766
|
+
async function vr(e) {
|
|
2762
2767
|
return fr().login(e);
|
|
2763
2768
|
}
|
|
2764
|
-
async function
|
|
2769
|
+
async function yr(e) {
|
|
2765
2770
|
return fr().loginWithRedirect(e);
|
|
2766
2771
|
}
|
|
2767
|
-
async function
|
|
2772
|
+
async function br(e) {
|
|
2768
2773
|
return fr().loginWithPopup(e);
|
|
2769
2774
|
}
|
|
2770
|
-
async function
|
|
2775
|
+
async function xr(e = {}) {
|
|
2771
2776
|
return fr().logout(e);
|
|
2772
2777
|
}
|
|
2773
|
-
async function
|
|
2778
|
+
async function Sr() {
|
|
2774
2779
|
if (!dr) return !1;
|
|
2775
2780
|
let e = Jn();
|
|
2776
2781
|
return e ? typeof e.refresh == "function" ? e.refresh() : e.isAuthenticated() : !1;
|
|
2777
2782
|
}
|
|
2778
|
-
async function
|
|
2783
|
+
async function Cr(e) {
|
|
2779
2784
|
let t = e.split(".");
|
|
2780
2785
|
if (t.length !== 3) throw Error("Invalid token");
|
|
2781
2786
|
let n = decodeURIComponent(atob(t[1].replace(/-/g, "+").replace(/_/g, "/")).split("").map((e) => "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2)).join("")), r = JSON.parse(n);
|
|
@@ -2789,7 +2794,7 @@ async function Sr(e) {
|
|
|
2789
2794
|
}
|
|
2790
2795
|
//#endregion
|
|
2791
2796
|
//#region ../../node_modules/.pnpm/wretch@2.11.1/node_modules/wretch/dist/middlewares/dedupe.js
|
|
2792
|
-
var
|
|
2797
|
+
var wr = (e, t) => t.skipDedupe || t.method !== "GET", Tr = (e, t) => t.method + "@" + e, Er = (e) => e.clone(), Dr = ({ skip: e = wr, key: t = Tr, resolver: n = Er } = {}) => {
|
|
2793
2798
|
let r = /* @__PURE__ */ new Map();
|
|
2794
2799
|
return (i) => (a, o) => {
|
|
2795
2800
|
if (e(a, o)) return i(a, o);
|
|
@@ -2806,7 +2811,7 @@ var Cr = (e, t) => t.skipDedupe || t.method !== "GET", wr = (e, t) => t.method +
|
|
|
2806
2811
|
return r.delete(s), Promise.reject(e);
|
|
2807
2812
|
}
|
|
2808
2813
|
};
|
|
2809
|
-
},
|
|
2814
|
+
}, Or = (e, t) => e * t, kr = (e) => e && e.ok, Ar = ({ delayTimer: e = 500, delayRamp: t = Or, maxAttempts: n = 10, until: r = kr, onRetry: i = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: o = !1, skip: s } = {}) => (c) => (l, u) => {
|
|
2810
2815
|
let d = 0;
|
|
2811
2816
|
if (s && s(l, u)) return c(l, u);
|
|
2812
2817
|
let f = (s, p) => Promise.resolve(r(s, p)).then((r) => r ? s && o ? s : p ? Promise.reject(p) : s : (d++, !n || d <= n ? new Promise((n) => {
|
|
@@ -2829,7 +2834,7 @@ var Cr = (e, t) => t.skipDedupe || t.method !== "GET", wr = (e, t) => t.method +
|
|
|
2829
2834
|
if (!a) throw e;
|
|
2830
2835
|
return f(null, e);
|
|
2831
2836
|
});
|
|
2832
|
-
},
|
|
2837
|
+
}, jr = class e extends Error {
|
|
2833
2838
|
status;
|
|
2834
2839
|
statusText;
|
|
2835
2840
|
url;
|
|
@@ -2849,20 +2854,20 @@ var Cr = (e, t) => t.skipDedupe || t.method !== "GET", wr = (e, t) => t.method +
|
|
|
2849
2854
|
isNotFoundError() {
|
|
2850
2855
|
return this.status === 404;
|
|
2851
2856
|
}
|
|
2852
|
-
},
|
|
2853
|
-
function
|
|
2857
|
+
}, Mr = /* @__PURE__ */ ((e) => (e.BROWSER = "browser", e.NORMAL = "normal", e))(Mr || {}), Nr = "application/json", Pr = "Content-Type", Fr = Symbol(), Ir = Symbol();
|
|
2858
|
+
function Lr(e = {}) {
|
|
2854
2859
|
let t = e instanceof Array ? Object.fromEntries(e) : e;
|
|
2855
|
-
return Object.entries(t).find(([e]) => e.toLowerCase() ===
|
|
2860
|
+
return Object.entries(t).find(([e]) => e.toLowerCase() === Pr.toLowerCase())?.[1];
|
|
2856
2861
|
}
|
|
2857
|
-
function
|
|
2862
|
+
function Rr(e) {
|
|
2858
2863
|
return /^application\/.*json.*/.test(e);
|
|
2859
2864
|
}
|
|
2860
|
-
var
|
|
2865
|
+
var zr = function(e, t, n = !1) {
|
|
2861
2866
|
return Object.entries(t).reduce((t, [r, i]) => {
|
|
2862
2867
|
let a = e[r];
|
|
2863
|
-
return Array.isArray(a) && Array.isArray(i) ? t[r] = n ? [...a, ...i] : i : typeof a == "object" && typeof i == "object" ? t[r] =
|
|
2868
|
+
return Array.isArray(a) && Array.isArray(i) ? t[r] = n ? [...a, ...i] : i : typeof a == "object" && typeof i == "object" ? t[r] = zr(a, i, n) : t[r] = i, t;
|
|
2864
2869
|
}, { ...e });
|
|
2865
|
-
},
|
|
2870
|
+
}, Br = {
|
|
2866
2871
|
options: {},
|
|
2867
2872
|
errorType: "text",
|
|
2868
2873
|
polyfills: {},
|
|
@@ -2872,23 +2877,23 @@ var Rr = function(e, t, n = !1) {
|
|
|
2872
2877
|
return n && i ? new i(...r) : i;
|
|
2873
2878
|
}
|
|
2874
2879
|
};
|
|
2875
|
-
function Br(e, t = !1) {
|
|
2876
|
-
zr.options = t ? e : Rr(zr.options, e);
|
|
2877
|
-
}
|
|
2878
2880
|
function Vr(e, t = !1) {
|
|
2879
|
-
|
|
2881
|
+
Br.options = t ? e : zr(Br.options, e);
|
|
2880
2882
|
}
|
|
2881
|
-
function Hr(e) {
|
|
2882
|
-
|
|
2883
|
+
function Hr(e, t = !1) {
|
|
2884
|
+
Br.polyfills = t ? e : zr(Br.polyfills, e);
|
|
2883
2885
|
}
|
|
2884
|
-
|
|
2886
|
+
function Ur(e) {
|
|
2887
|
+
Br.errorType = e;
|
|
2888
|
+
}
|
|
2889
|
+
var Wr = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Gr = class extends Error {}, Kr = (e) => {
|
|
2885
2890
|
let t = /* @__PURE__ */ Object.create(null);
|
|
2886
2891
|
e = e._addons.reduce((n, r) => r.beforeRequest && r.beforeRequest(n, e._options, t) || n, e);
|
|
2887
|
-
let { _url: n, _options: r, _config: i, _catchers: a, _resolvers: o, _middlewares: s, _addons: c } = e, l = new Map(a), u =
|
|
2888
|
-
throw { [
|
|
2892
|
+
let { _url: n, _options: r, _config: i, _catchers: a, _resolvers: o, _middlewares: s, _addons: c } = e, l = new Map(a), u = zr(i.options, r), d = n, f = Wr(s)((e, t) => (d = e, i.polyfill("fetch")(e, t)))(n, u), p = /* @__PURE__ */ Error(), m = f.catch((e) => {
|
|
2893
|
+
throw { [Fr]: e };
|
|
2889
2894
|
}).then((e) => {
|
|
2890
2895
|
if (!e.ok) {
|
|
2891
|
-
let t = new
|
|
2896
|
+
let t = new Gr();
|
|
2892
2897
|
if (t.cause = p, t.stack = t.stack + "\nCAUSE: " + p.stack, t.response = e, t.status = e.status, t.url = d, e.type === "opaque") throw t;
|
|
2893
2898
|
let n = i.errorType === "json" || e.headers.get("Content-Type")?.split(";")[0] === "application/json";
|
|
2894
2899
|
return (i.errorType ? n ? e.text() : e[i.errorType]() : Promise.resolve(e.body)).then((r) => {
|
|
@@ -2903,9 +2908,9 @@ var Ur = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Wr = class extends
|
|
|
2903
2908
|
}
|
|
2904
2909
|
return e;
|
|
2905
2910
|
}), h = (t) => t.catch((t) => {
|
|
2906
|
-
let n = Object.prototype.hasOwnProperty.call(t,
|
|
2911
|
+
let n = Object.prototype.hasOwnProperty.call(t, Fr), r = n ? t[Fr] : t, i = r?.status && l.get(r.status) || l.get(r?.name) || n && l.has(Fr) && l.get(Fr);
|
|
2907
2912
|
if (i) return i(r, e);
|
|
2908
|
-
let a = l.get(
|
|
2913
|
+
let a = l.get(Ir);
|
|
2909
2914
|
if (a) return a(r, e);
|
|
2910
2915
|
throw r;
|
|
2911
2916
|
}), g = (e) => (t) => h(e ? m.then((t) => t && t[e]()).then((e) => t ? t(e) : e) : m.then((e) => t ? t(e) : e)), _ = {
|
|
@@ -2940,17 +2945,17 @@ var Ur = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Wr = class extends
|
|
|
2940
2945
|
return this.error(500, e);
|
|
2941
2946
|
},
|
|
2942
2947
|
fetchError(e) {
|
|
2943
|
-
return this.error(
|
|
2948
|
+
return this.error(Fr, e);
|
|
2944
2949
|
}
|
|
2945
2950
|
}, v = c.reduce((e, t) => ({
|
|
2946
2951
|
...e,
|
|
2947
2952
|
...typeof t.resolver == "function" ? t.resolver(e) : t.resolver
|
|
2948
2953
|
}), _);
|
|
2949
2954
|
return o.reduce((t, n) => n(t, e), v);
|
|
2950
|
-
},
|
|
2955
|
+
}, qr = {
|
|
2951
2956
|
_url: "",
|
|
2952
2957
|
_options: {},
|
|
2953
|
-
_config:
|
|
2958
|
+
_config: Br,
|
|
2954
2959
|
_catchers: /* @__PURE__ */ new Map(),
|
|
2955
2960
|
_resolvers: [],
|
|
2956
2961
|
_deferred: [],
|
|
@@ -2977,7 +2982,7 @@ var Ur = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Wr = class extends
|
|
|
2977
2982
|
...this,
|
|
2978
2983
|
_config: {
|
|
2979
2984
|
...this._config,
|
|
2980
|
-
polyfills: t ? e :
|
|
2985
|
+
polyfills: t ? e : zr(this._config.polyfills, e)
|
|
2981
2986
|
}
|
|
2982
2987
|
};
|
|
2983
2988
|
},
|
|
@@ -2995,21 +3000,21 @@ var Ur = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Wr = class extends
|
|
|
2995
3000
|
options(e, t = !1) {
|
|
2996
3001
|
return {
|
|
2997
3002
|
...this,
|
|
2998
|
-
_options: t ? e :
|
|
3003
|
+
_options: t ? e : zr(this._options, e)
|
|
2999
3004
|
};
|
|
3000
3005
|
},
|
|
3001
3006
|
headers(e) {
|
|
3002
3007
|
let t = e ? Array.isArray(e) ? Object.fromEntries(e) : "entries" in e ? Object.fromEntries(e.entries()) : e : {};
|
|
3003
3008
|
return {
|
|
3004
3009
|
...this,
|
|
3005
|
-
_options:
|
|
3010
|
+
_options: zr(this._options, { headers: t })
|
|
3006
3011
|
};
|
|
3007
3012
|
},
|
|
3008
3013
|
accept(e) {
|
|
3009
3014
|
return this.headers({ Accept: e });
|
|
3010
3015
|
},
|
|
3011
3016
|
content(e) {
|
|
3012
|
-
return this.headers({ [
|
|
3017
|
+
return this.headers({ [Pr]: e });
|
|
3013
3018
|
},
|
|
3014
3019
|
auth(e) {
|
|
3015
3020
|
return this.headers({ Authorization: e });
|
|
@@ -3022,7 +3027,7 @@ var Ur = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Wr = class extends
|
|
|
3022
3027
|
};
|
|
3023
3028
|
},
|
|
3024
3029
|
catcherFallback(e) {
|
|
3025
|
-
return this.catcher(
|
|
3030
|
+
return this.catcher(Ir, e);
|
|
3026
3031
|
},
|
|
3027
3032
|
resolve(e, t = !1) {
|
|
3028
3033
|
return {
|
|
@@ -3043,8 +3048,8 @@ var Ur = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Wr = class extends
|
|
|
3043
3048
|
};
|
|
3044
3049
|
},
|
|
3045
3050
|
fetch(e = this._options.method, t = "", n = null) {
|
|
3046
|
-
let r = this.url(t).options({ method: e }), i =
|
|
3047
|
-
return r = n ? o ? r.json(n, i) : r.body(n) : r,
|
|
3051
|
+
let r = this.url(t).options({ method: e }), i = Lr(r._options.headers), a = this._config.polyfill("FormData", !1), o = typeof n == "object" && !(a && n instanceof a) && (!r._options.headers || !i || Rr(i));
|
|
3052
|
+
return r = n ? o ? r.json(n, i) : r.body(n) : r, Kr(r._deferred.reduce((e, t) => t(e, e._url, e._options), r));
|
|
3048
3053
|
},
|
|
3049
3054
|
get(e = "") {
|
|
3050
3055
|
return this.fetch("GET", e);
|
|
@@ -3077,19 +3082,19 @@ var Ur = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Wr = class extends
|
|
|
3077
3082
|
};
|
|
3078
3083
|
},
|
|
3079
3084
|
json(e, t) {
|
|
3080
|
-
let n =
|
|
3081
|
-
return this.content(t ||
|
|
3085
|
+
let n = Lr(this._options.headers);
|
|
3086
|
+
return this.content(t || Rr(n) && n || Nr).body(JSON.stringify(e));
|
|
3082
3087
|
}
|
|
3083
3088
|
};
|
|
3084
|
-
function
|
|
3089
|
+
function Jr(e = "", t = {}) {
|
|
3085
3090
|
return {
|
|
3086
|
-
...
|
|
3091
|
+
...qr,
|
|
3087
3092
|
_url: e,
|
|
3088
3093
|
_options: t
|
|
3089
3094
|
};
|
|
3090
3095
|
}
|
|
3091
|
-
|
|
3092
|
-
var
|
|
3096
|
+
Jr.default = Jr, Jr.options = Vr, Jr.errorType = Ur, Jr.polyfills = Hr, Jr.WretchError = Gr;
|
|
3097
|
+
var Yr = (e, t) => t.skipDedupe || t.method !== "GET", Xr = (e, t) => t.method + "@" + e, Zr = (e) => e.clone(), Qr = ({ skip: e = Yr, key: t = Xr, resolver: n = Zr } = {}) => {
|
|
3093
3098
|
let r = /* @__PURE__ */ new Map();
|
|
3094
3099
|
return (i) => (a, o) => {
|
|
3095
3100
|
if (e(a, o)) return i(a, o);
|
|
@@ -3106,7 +3111,7 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3106
3111
|
return r.delete(s), Promise.reject(e);
|
|
3107
3112
|
}
|
|
3108
3113
|
};
|
|
3109
|
-
},
|
|
3114
|
+
}, $r = (e, t) => t.skipCache || t.method !== "GET", ei = (e, t) => t.method + "@" + e, ti = () => !1, ni = () => null, ri = (e) => e.ok, ii = ({ throttle: e = 1e3, skip: t = $r, key: n = ei, clear: r = ti, invalidate: i = ni, condition: a = ri, flagResponseOnCacheHit: o = "__cached" } = {}) => {
|
|
3110
3115
|
let s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = (t) => {
|
|
3111
3116
|
e && !l.has(t) && (l.add(t), setTimeout(() => {
|
|
3112
3117
|
l.delete(t);
|
|
@@ -3136,7 +3141,7 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3136
3141
|
return d.cacheResponse = function(e, t) {
|
|
3137
3142
|
u(e), s.set(e, t);
|
|
3138
3143
|
}, d.cache = s, d.inflight = c, d.throttling = l, d;
|
|
3139
|
-
},
|
|
3144
|
+
}, ai = (e, t) => e * t, oi = (e) => e && e.ok, si = ({ delayTimer: e = 500, delayRamp: t = ai, maxAttempts: n = 10, until: r = oi, onRetry: i = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: o = !1, skip: s } = {}) => (c) => (l, u) => {
|
|
3140
3145
|
let d = 0;
|
|
3141
3146
|
if (s && s(l, u)) return c(l, u);
|
|
3142
3147
|
let f = (s, p) => Promise.resolve(r(s, p)).then((r) => r ? s && o ? s : p ? Promise.reject(p) : s : (d++, !n || d <= n ? new Promise((n) => {
|
|
@@ -3159,7 +3164,7 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3159
3164
|
if (!a) throw e;
|
|
3160
3165
|
return f(null, e);
|
|
3161
3166
|
});
|
|
3162
|
-
},
|
|
3167
|
+
}, ci = "@sesamy/sdk", li = "1.33.0", ui = class {
|
|
3163
3168
|
cache = /* @__PURE__ */ new Map();
|
|
3164
3169
|
get(e) {
|
|
3165
3170
|
return this.cache.get(e) || null;
|
|
@@ -3173,12 +3178,12 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3173
3178
|
clear() {
|
|
3174
3179
|
this.cache.clear();
|
|
3175
3180
|
}
|
|
3176
|
-
},
|
|
3177
|
-
let { libraryName: t =
|
|
3181
|
+
}, di = "sesamyCacheTimestamp", fi = (e) => {
|
|
3182
|
+
let { libraryName: t = ci, libraryVersion: n = li, cache: r } = e, i = r?.storage || new ui(), a = [
|
|
3178
3183
|
(e) => async (t, n) => {
|
|
3179
|
-
if (r?.mode ===
|
|
3184
|
+
if (r?.mode === Mr.BROWSER) {
|
|
3180
3185
|
let r;
|
|
3181
|
-
return typeof sessionStorage < "u" ? (r = sessionStorage.getItem(
|
|
3186
|
+
return typeof sessionStorage < "u" ? (r = sessionStorage.getItem(di), r || (r = Date.now().toString(), sessionStorage.setItem(di, r))) : (r = i.get(di), r || (r = Date.now().toString(), i.set(di, r))), e(t, {
|
|
3182
3187
|
...n,
|
|
3183
3188
|
headers: {
|
|
3184
3189
|
...n.headers,
|
|
@@ -3201,19 +3206,19 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3201
3206
|
}
|
|
3202
3207
|
});
|
|
3203
3208
|
},
|
|
3204
|
-
|
|
3209
|
+
Qr()
|
|
3205
3210
|
];
|
|
3206
|
-
r?.mode ===
|
|
3211
|
+
r?.mode === Mr.NORMAL && a.push(ii({
|
|
3207
3212
|
throttle: 300 * 1e3,
|
|
3208
3213
|
skip: (e, t) => t.method !== "GET"
|
|
3209
|
-
})), a.push(
|
|
3214
|
+
})), a.push(si({
|
|
3210
3215
|
delayTimer: 1e3,
|
|
3211
3216
|
delayRamp: (e, t) => e * t,
|
|
3212
3217
|
maxAttempts: 3,
|
|
3213
3218
|
until: (e) => !!(e && (e.ok || e.status >= 400 && e.status < 500)),
|
|
3214
3219
|
retryOnNetworkError: !1
|
|
3215
3220
|
}));
|
|
3216
|
-
let o =
|
|
3221
|
+
let o = Jr(e.baseUrl).headers({
|
|
3217
3222
|
"X-Sesamy-Client": `${t}/${n}`,
|
|
3218
3223
|
...e.headers
|
|
3219
3224
|
}).middlewares(a);
|
|
@@ -3250,19 +3255,19 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3250
3255
|
"patch",
|
|
3251
3256
|
"put",
|
|
3252
3257
|
"delete"
|
|
3253
|
-
].includes(i) &&
|
|
3258
|
+
].includes(i) && pi(), s.status === 204) return null;
|
|
3254
3259
|
if (!s.ok) {
|
|
3255
3260
|
let e = await s.text().catch(() => "Unknown error");
|
|
3256
|
-
throw new
|
|
3261
|
+
throw new jr(s.status, s.statusText, s.url, `API Error ${s.status}: ${e}`, e);
|
|
3257
3262
|
}
|
|
3258
3263
|
return await s.json();
|
|
3259
3264
|
} catch (n) {
|
|
3260
|
-
if (n instanceof
|
|
3265
|
+
if (n instanceof jr) throw n;
|
|
3261
3266
|
let r = n.status || 500;
|
|
3262
|
-
throw new
|
|
3267
|
+
throw new jr(r, n.message || "Unknown error", `${e.baseUrl}${t}`, `API Error ${r}: ${n.message || "Unknown error"}`, n.message || "Unknown error");
|
|
3263
3268
|
}
|
|
3264
3269
|
} };
|
|
3265
|
-
},
|
|
3270
|
+
}, pi = () => (typeof sessionStorage < "u" && sessionStorage.removeItem(di), "Cache cleared"), mi = {
|
|
3266
3271
|
get: async (e, t) => e.request(`/profile/${t}`),
|
|
3267
3272
|
update: async (e, t, n) => e.request(`/profile/${t}`, {
|
|
3268
3273
|
method: "PATCH",
|
|
@@ -3273,7 +3278,7 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3273
3278
|
delete: async (e) => {
|
|
3274
3279
|
await e.request("/profile", { method: "DELETE" });
|
|
3275
3280
|
}
|
|
3276
|
-
},
|
|
3281
|
+
}, hi = {
|
|
3277
3282
|
list: async (e, t) => {
|
|
3278
3283
|
let n = new URLSearchParams();
|
|
3279
3284
|
t?.type && n.append("type", t.type), t?.sku && n.append("sku", t.sku), t?.purchaseOptionId && n.append("purchase-option-id", t.purchaseOptionId), t?.waitForEntitlementAfter && n.append("wait-for-entitlement-after", t.waitForEntitlementAfter);
|
|
@@ -3282,20 +3287,20 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3282
3287
|
},
|
|
3283
3288
|
get: async (e, t) => e.request(`/entitlements/${t}`),
|
|
3284
3289
|
getAccess: async (e, t) => e.request(`/entitlements/${t}/access`)
|
|
3285
|
-
},
|
|
3290
|
+
}, gi = {
|
|
3286
3291
|
list: async (e) => e.request("/subscriptions"),
|
|
3287
3292
|
get: async (e, t) => e.request(`/subscriptions/${t}`)
|
|
3288
|
-
},
|
|
3293
|
+
}, _i = {
|
|
3289
3294
|
get: async (e, t) => e.request(`/products/${t}`),
|
|
3290
3295
|
autoOnboard: async (e, t) => e.request(`/products/${t}/auto-onboard`, { method: "POST" })
|
|
3291
|
-
},
|
|
3296
|
+
}, vi = (e, t) => {
|
|
3292
3297
|
if (!e || !t) return e;
|
|
3293
3298
|
let n = new URL(e);
|
|
3294
3299
|
return n.hash = `access_token=${t}`, n.toString();
|
|
3295
|
-
},
|
|
3300
|
+
}, yi = (e, t) => !e.manageUrl || !t ? e : {
|
|
3296
3301
|
...e,
|
|
3297
|
-
manageUrl:
|
|
3298
|
-
},
|
|
3302
|
+
manageUrl: vi(e.manageUrl, t)
|
|
3303
|
+
}, bi = {
|
|
3299
3304
|
list: async (e) => e.request("/contracts"),
|
|
3300
3305
|
get: async (e, t) => e.request(`/contracts/${t}`),
|
|
3301
3306
|
cancel: async (e, t, n) => e.request(`/contracts/${t}/cancel`, {
|
|
@@ -3307,7 +3312,7 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3307
3312
|
body: JSON.stringify(n)
|
|
3308
3313
|
}),
|
|
3309
3314
|
confirmAmendment: async (e, t, n) => e.request(`/contracts/${t}/amendments/${n}/confirm`, { method: "POST" })
|
|
3310
|
-
},
|
|
3315
|
+
}, xi = {
|
|
3311
3316
|
get: async (e) => e.request("/user-metadata"),
|
|
3312
3317
|
set: async (e, t, n) => {
|
|
3313
3318
|
await e.request(`/user-metadata/${t}`, {
|
|
@@ -3318,7 +3323,7 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3318
3323
|
delete: async (e, t) => {
|
|
3319
3324
|
await e.request(`/user-metadata/${t}`, { method: "DELETE" });
|
|
3320
3325
|
}
|
|
3321
|
-
},
|
|
3326
|
+
}, Si = {
|
|
3322
3327
|
list: async (e) => e.request("/tallies"),
|
|
3323
3328
|
get: async (e, t) => e.request(`/tallies/${t}`),
|
|
3324
3329
|
update: async (e, t, n) => e.request(`/tallies/${t}`, {
|
|
@@ -3340,7 +3345,7 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3340
3345
|
method: "POST",
|
|
3341
3346
|
body: JSON.stringify(n)
|
|
3342
3347
|
})
|
|
3343
|
-
},
|
|
3348
|
+
}, Ci = {
|
|
3344
3349
|
list: async (e) => e.request("/tags"),
|
|
3345
3350
|
add: async (e, t) => {
|
|
3346
3351
|
await e.request("/tags", {
|
|
@@ -3351,7 +3356,7 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3351
3356
|
remove: async (e, t) => {
|
|
3352
3357
|
await e.request(`/tags/${t}`, { method: "DELETE" });
|
|
3353
3358
|
}
|
|
3354
|
-
},
|
|
3359
|
+
}, wi = {
|
|
3355
3360
|
generateCheckoutLink: (e, t) => {
|
|
3356
3361
|
let n = new URL(`${e.apiUrl}/checkouts`);
|
|
3357
3362
|
return t.items && n.searchParams.set("items", JSON.stringify(t.items)), t.email && n.searchParams.set("email", t.email), t.language && n.searchParams.set("lang", t.language), t.redirectUrl && n.searchParams.set("redirect-url", t.redirectUrl), t.giftMode && n.searchParams.set("gift-mode", "true"), t.payerEmail && n.searchParams.set("payer-email", t.payerEmail), t.requireAddress && n.searchParams.set("require-address", "true"), t.metadata && Object.entries(t.metadata).forEach(([e, t]) => {
|
|
@@ -3374,7 +3379,7 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3374
3379
|
let n = t.language || "en", r = new URL(`${e.baseUrl}/consume/${encodeURIComponent(n)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent(t.sku)}`);
|
|
3375
3380
|
return t.episodeId ? r.href += `/${encodeURIComponent(t.episodeId)}` : r.href += "/listen", r.searchParams.set("sesamy-redirect-url", t.redirectUrl || "/"), r.toString();
|
|
3376
3381
|
}
|
|
3377
|
-
},
|
|
3382
|
+
}, Ti = {
|
|
3378
3383
|
generateLink: (e, t) => {
|
|
3379
3384
|
let n = new URL(`${e.apiUrl}/checkouts`);
|
|
3380
3385
|
return t.items && n.searchParams.set("items", JSON.stringify(t.items)), t.email && n.searchParams.set("email", t.email), t.language && n.searchParams.set("lang", t.language), t.redirectUrl && n.searchParams.set("redirect-url", t.redirectUrl), t.giftMode && n.searchParams.set("gift-mode", "true"), t.payerEmail && n.searchParams.set("payer-email", t.payerEmail), t.requireAddress && n.searchParams.set("require-address", "true"), t.metadata && Object.entries(t.metadata).forEach(([e, t]) => {
|
|
@@ -3390,16 +3395,16 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3390
3395
|
method: "PATCH",
|
|
3391
3396
|
body: JSON.stringify(n)
|
|
3392
3397
|
})
|
|
3393
|
-
},
|
|
3398
|
+
}, Ei = {
|
|
3394
3399
|
list: async (e) => e.request("/bills"),
|
|
3395
3400
|
get: async (e, t) => e.request(`/bills/${t}`)
|
|
3396
|
-
},
|
|
3401
|
+
}, Di = {
|
|
3397
3402
|
list: async (e) => e.request("/fulfillments"),
|
|
3398
3403
|
create: async (e, t) => e.request("/fulfillments", {
|
|
3399
3404
|
method: "POST",
|
|
3400
3405
|
body: JSON.stringify(t)
|
|
3401
3406
|
})
|
|
3402
|
-
},
|
|
3407
|
+
}, Oi = {
|
|
3403
3408
|
get: async (e, t) => {
|
|
3404
3409
|
try {
|
|
3405
3410
|
return new URL(t), e.request(t);
|
|
@@ -3426,114 +3431,114 @@ var Jr = (e, t) => t.skipDedupe || t.method !== "GET", Yr = (e, t) => t.method +
|
|
|
3426
3431
|
})
|
|
3427
3432
|
});
|
|
3428
3433
|
}
|
|
3429
|
-
},
|
|
3434
|
+
}, ki = { list: async (e) => e.request("/payment-issues") }, Ai = { content: async (e, t, n, r, i) => {
|
|
3430
3435
|
let a = new URLSearchParams({ url: t });
|
|
3431
3436
|
return n && a.append("selector", n), r && a.append("cache", r), e.request(`/proxy?${a.toString()}`, i);
|
|
3432
|
-
} },
|
|
3437
|
+
} }, ji = { list: async (e, t) => {
|
|
3433
3438
|
let n = (t ? new URLSearchParams({ q: t }) : new URLSearchParams()).toString(), r = n ? `/transactions?${n}` : "/transactions";
|
|
3434
3439
|
return e.request(r);
|
|
3435
|
-
} },
|
|
3440
|
+
} }, Mi = {
|
|
3436
3441
|
get: async (e) => e.request("/vendor"),
|
|
3437
3442
|
list: async (e) => e.request("/vendors")
|
|
3438
|
-
},
|
|
3439
|
-
let t =
|
|
3443
|
+
}, Ni = (e) => {
|
|
3444
|
+
let t = fi(e);
|
|
3440
3445
|
return {
|
|
3441
3446
|
profile: {
|
|
3442
|
-
get: (e) =>
|
|
3443
|
-
update: (e, n) =>
|
|
3444
|
-
checkSpotifyLink: () =>
|
|
3445
|
-
unlinkSpotify: () =>
|
|
3446
|
-
delete: () =>
|
|
3447
|
+
get: (e) => mi.get(t, e),
|
|
3448
|
+
update: (e, n) => mi.update(t, e, n),
|
|
3449
|
+
checkSpotifyLink: () => mi.checkSpotifyLink(t),
|
|
3450
|
+
unlinkSpotify: () => mi.unlinkSpotify(t),
|
|
3451
|
+
delete: () => mi.delete(t)
|
|
3447
3452
|
},
|
|
3448
3453
|
entitlements: {
|
|
3449
|
-
list: (e) =>
|
|
3450
|
-
get: (e) =>
|
|
3451
|
-
getAccess: (e) =>
|
|
3454
|
+
list: (e) => hi.list(t, e),
|
|
3455
|
+
get: (e) => hi.get(t, e),
|
|
3456
|
+
getAccess: (e) => hi.getAccess(t, e)
|
|
3452
3457
|
},
|
|
3453
3458
|
subscriptions: {
|
|
3454
|
-
list: () =>
|
|
3455
|
-
get: (e) =>
|
|
3459
|
+
list: () => gi.list(t),
|
|
3460
|
+
get: (e) => gi.get(t, e)
|
|
3456
3461
|
},
|
|
3457
3462
|
products: {
|
|
3458
|
-
get: (e) =>
|
|
3459
|
-
autoOnboard: (e) =>
|
|
3463
|
+
get: (e) => _i.get(t, e),
|
|
3464
|
+
autoOnboard: (e) => _i.autoOnboard(t, e)
|
|
3460
3465
|
},
|
|
3461
3466
|
contracts: {
|
|
3462
3467
|
list: async () => {
|
|
3463
|
-
let n = await
|
|
3468
|
+
let n = await bi.list(t), r = await e.tokenProvider();
|
|
3464
3469
|
if (!r || !r.toLowerCase().startsWith("bearer ")) return n;
|
|
3465
3470
|
let i = r.substring(7);
|
|
3466
|
-
return n.map((e) =>
|
|
3471
|
+
return n.map((e) => yi(e, i));
|
|
3467
3472
|
},
|
|
3468
3473
|
get: async (n) => {
|
|
3469
|
-
let r = await
|
|
3470
|
-
return !i || !i.toLowerCase().startsWith("bearer ") ? r :
|
|
3474
|
+
let r = await bi.get(t, n), i = await e.tokenProvider();
|
|
3475
|
+
return !i || !i.toLowerCase().startsWith("bearer ") ? r : yi(r, i.substring(7));
|
|
3471
3476
|
},
|
|
3472
|
-
cancel: (e, n) =>
|
|
3473
|
-
createAmendment: (e, n) =>
|
|
3474
|
-
confirmAmendment: (e, n) =>
|
|
3477
|
+
cancel: (e, n) => bi.cancel(t, e, n),
|
|
3478
|
+
createAmendment: (e, n) => bi.createAmendment(t, e, n),
|
|
3479
|
+
confirmAmendment: (e, n) => bi.confirmAmendment(t, e, n)
|
|
3475
3480
|
},
|
|
3476
3481
|
userMetadata: {
|
|
3477
|
-
get: () =>
|
|
3478
|
-
set: (e, n) =>
|
|
3479
|
-
delete: (e) =>
|
|
3482
|
+
get: () => xi.get(t),
|
|
3483
|
+
set: (e, n) => xi.set(t, e, n),
|
|
3484
|
+
delete: (e) => xi.delete(t, e)
|
|
3480
3485
|
},
|
|
3481
3486
|
tallies: {
|
|
3482
|
-
list: () =>
|
|
3483
|
-
get: (e) =>
|
|
3484
|
-
update: (e, n) =>
|
|
3485
|
-
create: (e) =>
|
|
3486
|
-
delete: (e) =>
|
|
3487
|
-
push: (e, n) =>
|
|
3487
|
+
list: () => Si.list(t),
|
|
3488
|
+
get: (e) => Si.get(t, e),
|
|
3489
|
+
update: (e, n) => Si.update(t, e, n),
|
|
3490
|
+
create: (e) => Si.create(t, e),
|
|
3491
|
+
delete: (e) => Si.delete(t, e),
|
|
3492
|
+
push: (e, n) => Si.push(t, e, n)
|
|
3488
3493
|
},
|
|
3489
3494
|
tags: {
|
|
3490
|
-
list: () =>
|
|
3491
|
-
add: (e) =>
|
|
3492
|
-
remove: (e) =>
|
|
3495
|
+
list: () => Ci.list(t),
|
|
3496
|
+
add: (e) => Ci.add(t, e),
|
|
3497
|
+
remove: (e) => Ci.remove(t, e)
|
|
3493
3498
|
},
|
|
3494
3499
|
checkouts: {
|
|
3495
|
-
generateLink: (e, t) =>
|
|
3496
|
-
create: (e) =>
|
|
3497
|
-
get: (e) =>
|
|
3498
|
-
update: (e, n) =>
|
|
3500
|
+
generateLink: (e, t) => wi.generateCheckoutLink(e, t),
|
|
3501
|
+
create: (e) => Ti.create(t, e),
|
|
3502
|
+
get: (e) => Ti.get(t, e),
|
|
3503
|
+
update: (e, n) => Ti.update(t, e, n)
|
|
3499
3504
|
},
|
|
3500
3505
|
links: {
|
|
3501
|
-
generateCheckoutLink: (e, t) =>
|
|
3502
|
-
generateAccountLink: (e, t) =>
|
|
3503
|
-
generateChangePaymentLink: (e, t) =>
|
|
3504
|
-
generateChangePlanLink: (e, t) =>
|
|
3505
|
-
generateConsumeLink: (e, t) =>
|
|
3506
|
+
generateCheckoutLink: (e, t) => wi.generateCheckoutLink(e, t),
|
|
3507
|
+
generateAccountLink: (e, t) => wi.generateAccountLink(e, t),
|
|
3508
|
+
generateChangePaymentLink: (e, t) => wi.generateChangePaymentLink(e, t),
|
|
3509
|
+
generateChangePlanLink: (e, t) => wi.generateChangePlanLink(e, t),
|
|
3510
|
+
generateConsumeLink: (e, t) => wi.generateConsumeLink(e, t)
|
|
3506
3511
|
},
|
|
3507
3512
|
bills: {
|
|
3508
|
-
list: () =>
|
|
3509
|
-
get: (e) =>
|
|
3513
|
+
list: () => Ei.list(t),
|
|
3514
|
+
get: (e) => Ei.get(t, e)
|
|
3510
3515
|
},
|
|
3511
3516
|
fulfillments: {
|
|
3512
|
-
list: () =>
|
|
3513
|
-
create: (e) =>
|
|
3517
|
+
list: () => Di.list(t),
|
|
3518
|
+
create: (e) => Di.create(t, e)
|
|
3514
3519
|
},
|
|
3515
3520
|
paywalls: {
|
|
3516
|
-
get: (e) =>
|
|
3517
|
-
checkAccess: (e, n) =>
|
|
3518
|
-
registerAccess: (e, n) =>
|
|
3519
|
-
executeStrategy: (e, n) =>
|
|
3520
|
-
},
|
|
3521
|
-
paymentIssues: { list: () =>
|
|
3522
|
-
proxy: { content: (e, n, r, i) =>
|
|
3523
|
-
transactions: { list: (e) =>
|
|
3521
|
+
get: (e) => Oi.get(t, e),
|
|
3522
|
+
checkAccess: (e, n) => Oi.checkAccess(t, e, n),
|
|
3523
|
+
registerAccess: (e, n) => Oi.registerAccess(t, e, n),
|
|
3524
|
+
executeStrategy: (e, n) => Oi.executeStrategy(t, e, n)
|
|
3525
|
+
},
|
|
3526
|
+
paymentIssues: { list: () => ki.list(t) },
|
|
3527
|
+
proxy: { content: (e, n, r, i) => Ai.content(t, e, n, r, i) },
|
|
3528
|
+
transactions: { list: (e) => ji.list(t, e) },
|
|
3524
3529
|
vendor: {
|
|
3525
|
-
get: () =>
|
|
3526
|
-
list: () =>
|
|
3530
|
+
get: () => Mi.get(t),
|
|
3531
|
+
list: () => Mi.list(t)
|
|
3527
3532
|
}
|
|
3528
3533
|
};
|
|
3529
|
-
},
|
|
3530
|
-
function
|
|
3534
|
+
}, Pi = "sesamy.com", Fi = "sesamy.dev", Ii = "https://sesa.my", Li = "sesamyCacheTimestamp", Ri = "sesamyContentReloaded", zi = /* @__PURE__ */ "co.uk,com.au,co.nz,co.za,com.br,co.jp,gov.uk,ac.uk,org.uk,net.uk,com.sg,com.my,co.in,co.id,co.th,co.kr,com.mx,com.ar,com.co,com.pe,com.ph,com.pk,com.sa,com.eg,com.ng,co.ke,co.tz,co.zw,co.bw,co.mz,gov.au,edu.au,org.au,net.au,asn.au,id.au".split(",");
|
|
3535
|
+
function Bi(e) {
|
|
3531
3536
|
try {
|
|
3532
3537
|
let t = new URL(e).hostname;
|
|
3533
3538
|
if (t.startsWith("[") || /^\d{1,3}(\.\d{1,3}){3}$/.test(t)) return t;
|
|
3534
3539
|
let n = t.split(".");
|
|
3535
3540
|
if (n.length <= 1) return t;
|
|
3536
|
-
for (let e of
|
|
3541
|
+
for (let e of zi) if (t.endsWith(`.${e}`)) {
|
|
3537
3542
|
let t = e.split(".").length + 1;
|
|
3538
3543
|
return n.slice(-t).join(".");
|
|
3539
3544
|
}
|
|
@@ -3544,7 +3549,7 @@ function zi(e) {
|
|
|
3544
3549
|
}
|
|
3545
3550
|
//#endregion
|
|
3546
3551
|
//#region src/types/Cache.ts
|
|
3547
|
-
var
|
|
3552
|
+
var Vi = class {
|
|
3548
3553
|
get(e) {
|
|
3549
3554
|
return typeof sessionStorage > "u" ? null : sessionStorage.getItem(e);
|
|
3550
3555
|
}
|
|
@@ -3558,15 +3563,15 @@ var Bi = class {
|
|
|
3558
3563
|
};
|
|
3559
3564
|
//#endregion
|
|
3560
3565
|
//#region src/services/config/index.ts
|
|
3561
|
-
function Vi(e, t) {
|
|
3562
|
-
return `${e}.${t === "dev" ? Pi : Ni}`;
|
|
3563
|
-
}
|
|
3564
3566
|
function Hi(e, t) {
|
|
3565
|
-
return
|
|
3567
|
+
return `${e}.${t === "dev" ? Fi : Pi}`;
|
|
3568
|
+
}
|
|
3569
|
+
function Ui(e, t) {
|
|
3570
|
+
return `https://${Hi(e, t)}`;
|
|
3566
3571
|
}
|
|
3567
3572
|
//#endregion
|
|
3568
3573
|
//#region src/utils/links.ts
|
|
3569
|
-
function
|
|
3574
|
+
function Wi(e) {
|
|
3570
3575
|
let t;
|
|
3571
3576
|
try {
|
|
3572
3577
|
t = new URL(e);
|
|
@@ -3575,8 +3580,8 @@ function Ui(e) {
|
|
|
3575
3580
|
}
|
|
3576
3581
|
return t.protocol === "http:" || t.protocol === "https:";
|
|
3577
3582
|
}
|
|
3578
|
-
function
|
|
3579
|
-
if (
|
|
3583
|
+
function Gi(e, t) {
|
|
3584
|
+
if (Wi(e)) return { itemSrc: e };
|
|
3580
3585
|
let n = e.split(":");
|
|
3581
3586
|
if (n.length < 2) throw Error(`Invalid itemSrc format: expected at least 2 segments separated by ':', got ${n.length}`);
|
|
3582
3587
|
let [r, i, a] = n;
|
|
@@ -3586,17 +3591,17 @@ function Wi(e, t) {
|
|
|
3586
3591
|
purchaseOption: t || a
|
|
3587
3592
|
};
|
|
3588
3593
|
}
|
|
3589
|
-
function
|
|
3594
|
+
function Ki(e) {
|
|
3590
3595
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
3591
3596
|
}
|
|
3592
|
-
function
|
|
3593
|
-
if (!
|
|
3597
|
+
function qi(e, t) {
|
|
3598
|
+
if (!Wi(e) || !Wi(t)) return !1;
|
|
3594
3599
|
let n = new URL(e), r = new URL(t);
|
|
3595
|
-
return n.origin === r.origin &&
|
|
3600
|
+
return n.origin === r.origin && Ki(n.pathname) === Ki(r.pathname);
|
|
3596
3601
|
}
|
|
3597
3602
|
//#endregion
|
|
3598
3603
|
//#region src/services/consent/cmp-adapters.ts
|
|
3599
|
-
function
|
|
3604
|
+
function Ji(e) {
|
|
3600
3605
|
let t = window.Cookiebot;
|
|
3601
3606
|
t?.consent && e({
|
|
3602
3607
|
statistics: !!t.consent.statistics,
|
|
@@ -3611,25 +3616,25 @@ function qi(e) {
|
|
|
3611
3616
|
};
|
|
3612
3617
|
window.addEventListener("CookiebotOnAccept", n), window.addEventListener("CookiebotOnDecline", n);
|
|
3613
3618
|
}
|
|
3614
|
-
function
|
|
3619
|
+
function Yi() {
|
|
3615
3620
|
return window.Cookiebot !== void 0;
|
|
3616
3621
|
}
|
|
3617
|
-
function
|
|
3622
|
+
function Xi() {
|
|
3618
3623
|
let e = window.OptanonActiveGroups || "";
|
|
3619
3624
|
return {
|
|
3620
3625
|
statistics: e.includes("C0002"),
|
|
3621
3626
|
marketing: e.includes("C0004")
|
|
3622
3627
|
};
|
|
3623
3628
|
}
|
|
3624
|
-
function
|
|
3625
|
-
e(
|
|
3626
|
-
e(
|
|
3629
|
+
function Zi(e) {
|
|
3630
|
+
e(Xi()), window.addEventListener("OneTrustGroupsUpdated", () => {
|
|
3631
|
+
e(Xi());
|
|
3627
3632
|
});
|
|
3628
3633
|
}
|
|
3629
|
-
function
|
|
3634
|
+
function Qi() {
|
|
3630
3635
|
return window.OneTrust !== void 0;
|
|
3631
3636
|
}
|
|
3632
|
-
function
|
|
3637
|
+
function $i() {
|
|
3633
3638
|
let e = window.dataLayer;
|
|
3634
3639
|
if (!e) return null;
|
|
3635
3640
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
@@ -3644,8 +3649,8 @@ function Qi() {
|
|
|
3644
3649
|
}
|
|
3645
3650
|
return null;
|
|
3646
3651
|
}
|
|
3647
|
-
function
|
|
3648
|
-
let t =
|
|
3652
|
+
function ea(e) {
|
|
3653
|
+
let t = $i();
|
|
3649
3654
|
t && e(t);
|
|
3650
3655
|
let n = window.dataLayer ??= [], r = n.push.bind(n);
|
|
3651
3656
|
n.push = (...t) => {
|
|
@@ -3660,51 +3665,51 @@ function $i(e) {
|
|
|
3660
3665
|
return n;
|
|
3661
3666
|
};
|
|
3662
3667
|
}
|
|
3663
|
-
function
|
|
3668
|
+
function ta() {
|
|
3664
3669
|
return Array.isArray(window.dataLayer);
|
|
3665
3670
|
}
|
|
3666
3671
|
//#endregion
|
|
3667
3672
|
//#region src/services/consent/index.ts
|
|
3668
3673
|
Vn();
|
|
3669
|
-
var
|
|
3674
|
+
var na = !1, ra = {
|
|
3670
3675
|
statistics: !1,
|
|
3671
3676
|
marketing: !1
|
|
3672
3677
|
};
|
|
3673
|
-
function ra() {
|
|
3674
|
-
return ta;
|
|
3675
|
-
}
|
|
3676
3678
|
function ia() {
|
|
3677
|
-
return
|
|
3679
|
+
return na;
|
|
3678
3680
|
}
|
|
3679
|
-
function aa(
|
|
3680
|
-
return
|
|
3681
|
+
function aa() {
|
|
3682
|
+
return { ...ra };
|
|
3681
3683
|
}
|
|
3682
3684
|
function oa(e) {
|
|
3683
|
-
|
|
3684
|
-
e.statistics !== void 0 && (na.statistics = e.statistics), e.marketing !== void 0 && (na.marketing = e.marketing), t && window.dispatchEvent(new CustomEvent(J.CONSENT_CHANGED, { detail: ia() }));
|
|
3685
|
+
return na ? ra[e] : !0;
|
|
3685
3686
|
}
|
|
3686
3687
|
function sa(e) {
|
|
3688
|
+
let t = e.statistics !== void 0 && e.statistics !== ra.statistics || e.marketing !== void 0 && e.marketing !== ra.marketing;
|
|
3689
|
+
e.statistics !== void 0 && (ra.statistics = e.statistics), e.marketing !== void 0 && (ra.marketing = e.marketing), t && window.dispatchEvent(new CustomEvent(J.CONSENT_CHANGED, { detail: aa() }));
|
|
3690
|
+
}
|
|
3691
|
+
function ca(e) {
|
|
3687
3692
|
if (!e?.enabled) return;
|
|
3688
|
-
|
|
3689
|
-
let t = (e) =>
|
|
3690
|
-
e.cmp === "cookiebot" ?
|
|
3693
|
+
na = !0, e.defaultConsent && (e.defaultConsent.statistics !== void 0 && (ra.statistics = e.defaultConsent.statistics), e.defaultConsent.marketing !== void 0 && (ra.marketing = e.defaultConsent.marketing));
|
|
3694
|
+
let t = (e) => sa(e);
|
|
3695
|
+
e.cmp === "cookiebot" ? Ji(t) : e.cmp === "onetrust" ? Zi(t) : e.cmp === "google-consent-mode" ? ea(t) : e.onConsentChange ? e.onConsentChange(t) : Yi() ? Ji(t) : Qi() ? Zi(t) : ta() && ea(t);
|
|
3691
3696
|
}
|
|
3692
3697
|
//#endregion
|
|
3693
3698
|
//#region src/utils/google-analytics.ts
|
|
3694
|
-
var
|
|
3699
|
+
var la = [
|
|
3695
3700
|
"_ga",
|
|
3696
3701
|
"_gid",
|
|
3697
3702
|
"_fbp",
|
|
3698
3703
|
"_fbc"
|
|
3699
3704
|
];
|
|
3700
|
-
function
|
|
3705
|
+
function ua(e) {
|
|
3701
3706
|
if (!e) return;
|
|
3702
3707
|
let t = e.match(/[.$]s(\d+)/);
|
|
3703
3708
|
if (t) return t[1];
|
|
3704
3709
|
let n = e.split(".")[2];
|
|
3705
3710
|
return n && /^\d+$/.test(n) ? n : void 0;
|
|
3706
3711
|
}
|
|
3707
|
-
function
|
|
3712
|
+
function da(e) {
|
|
3708
3713
|
return e.split(";").map((e) => {
|
|
3709
3714
|
let [t, n] = e.trim().split("=");
|
|
3710
3715
|
return {
|
|
@@ -3713,26 +3718,26 @@ function ua(e) {
|
|
|
3713
3718
|
};
|
|
3714
3719
|
});
|
|
3715
3720
|
}
|
|
3716
|
-
function
|
|
3717
|
-
let t =
|
|
3721
|
+
function fa(e) {
|
|
3722
|
+
let t = da(e), n = t.filter((e) => la.includes(e.key)), r = t.find((e) => e.key === "_ga")?.value, i = r ? r.split(".") : [];
|
|
3718
3723
|
return {
|
|
3719
3724
|
cookies: n,
|
|
3720
3725
|
clientId: i.length >= 2 ? i.slice(-2).join(".") : void 0,
|
|
3721
|
-
sessionId:
|
|
3726
|
+
sessionId: ua(t.find((e) => e.key?.startsWith("_ga_"))?.value)
|
|
3722
3727
|
};
|
|
3723
3728
|
}
|
|
3724
3729
|
//#endregion
|
|
3725
3730
|
//#region src/controllers/checkout.ts
|
|
3726
|
-
function
|
|
3727
|
-
let r = new URL(`${
|
|
3731
|
+
function pa(e, t, n) {
|
|
3732
|
+
let r = new URL(`${Ui("checkout3", e.environment)}`);
|
|
3728
3733
|
t.language && r.searchParams.set("lang", t.language);
|
|
3729
3734
|
let i = t.sku, a = t.purchaseOptionId, o = t.itemSrc;
|
|
3730
3735
|
if (t.itemSrc) {
|
|
3731
|
-
let e =
|
|
3736
|
+
let e = Gi(t.itemSrc, t.purchaseOptionId);
|
|
3732
3737
|
i = e.sku || i, a = e.purchaseOption || a, o = e.itemSrc;
|
|
3733
3738
|
}
|
|
3734
|
-
if (i ? (r.searchParams.set("sku", i), a && r.searchParams.set("po-id", a)) : o && r.searchParams.set("url", o), t.email && r.searchParams.set("email", t.email), t.business && r.searchParams.set("business", "true"), t.currency && r.searchParams.set("currency", t.currency), t.price && r.searchParams.set("price", t.price.toString()), t.discountCode && r.searchParams.set("discount-code", t.discountCode), t.attributionItemSrc ? r.searchParams.set("itemSrc", t.attributionItemSrc) : n.itemSrc && r.searchParams.set("itemSrc", n.itemSrc), t.attributionPublisherContentId ? r.searchParams.set("publisherContentId", t.attributionPublisherContentId) : n.publisherContentId && r.searchParams.set("publisherContentId", n.publisherContentId), t.utmSource ? r.searchParams.set("utm_source", t.utmSource) : n.utmSource && r.searchParams.set("utm_source", n.utmSource), t.utmMedium ? r.searchParams.set("utm_medium", t.utmMedium) : n.utmMedium && r.searchParams.set("utm_medium", n.utmMedium), t.utmCampaign ? r.searchParams.set("utm_campaign", t.utmCampaign) : n.utmCampaign && r.searchParams.set("utm_campaign", n.utmCampaign), t.utmTerm ? r.searchParams.set("utm_term", t.utmTerm) : n.utmTerm && r.searchParams.set("utm_term", n.utmTerm), t.utmContent ? r.searchParams.set("utm_content", t.utmContent) : n.utmContent && r.searchParams.set("utm_content", n.utmContent),
|
|
3735
|
-
let { cookies: e, clientId: t, sessionId: n } =
|
|
3739
|
+
if (i ? (r.searchParams.set("sku", i), a && r.searchParams.set("po-id", a)) : o && r.searchParams.set("url", o), t.email && r.searchParams.set("email", t.email), t.business && r.searchParams.set("business", "true"), t.currency && r.searchParams.set("currency", t.currency), t.price && r.searchParams.set("price", t.price.toString()), t.discountCode && r.searchParams.set("discount-code", t.discountCode), t.attributionItemSrc ? r.searchParams.set("itemSrc", t.attributionItemSrc) : n.itemSrc && r.searchParams.set("itemSrc", n.itemSrc), t.attributionPublisherContentId ? r.searchParams.set("publisherContentId", t.attributionPublisherContentId) : n.publisherContentId && r.searchParams.set("publisherContentId", n.publisherContentId), t.utmSource ? r.searchParams.set("utm_source", t.utmSource) : n.utmSource && r.searchParams.set("utm_source", n.utmSource), t.utmMedium ? r.searchParams.set("utm_medium", t.utmMedium) : n.utmMedium && r.searchParams.set("utm_medium", n.utmMedium), t.utmCampaign ? r.searchParams.set("utm_campaign", t.utmCampaign) : n.utmCampaign && r.searchParams.set("utm_campaign", n.utmCampaign), t.utmTerm ? r.searchParams.set("utm_term", t.utmTerm) : n.utmTerm && r.searchParams.set("utm_term", n.utmTerm), t.utmContent ? r.searchParams.set("utm_content", t.utmContent) : n.utmContent && r.searchParams.set("utm_content", n.utmContent), oa("marketing")) {
|
|
3740
|
+
let { cookies: e, clientId: t, sessionId: n } = fa(document.cookie);
|
|
3736
3741
|
e.forEach((e) => {
|
|
3737
3742
|
r.searchParams.append(e.key, e.value);
|
|
3738
3743
|
}), t && r.searchParams.append("ga_client_id", t), n && r.searchParams.append("ga_session_id", n);
|
|
@@ -3750,22 +3755,22 @@ function fa(e, t, n) {
|
|
|
3750
3755
|
//#endregion
|
|
3751
3756
|
//#region src/controllers/index.ts
|
|
3752
3757
|
zn();
|
|
3753
|
-
var
|
|
3754
|
-
function
|
|
3755
|
-
let e = sessionStorage.getItem(
|
|
3758
|
+
var ma = "sesamySignedURLs";
|
|
3759
|
+
function ha() {
|
|
3760
|
+
let e = sessionStorage.getItem(ma);
|
|
3756
3761
|
return e ? JSON.parse(e) : [];
|
|
3757
3762
|
}
|
|
3758
|
-
function ha(e) {
|
|
3759
|
-
let t = ma();
|
|
3760
|
-
t.push(e), q(`Adding signed URL: ${e}`), sessionStorage.setItem(pa, JSON.stringify(t));
|
|
3761
|
-
}
|
|
3762
3763
|
function ga(e) {
|
|
3763
|
-
let t =
|
|
3764
|
-
sessionStorage.setItem(
|
|
3764
|
+
let t = ha();
|
|
3765
|
+
t.push(e), q(`Adding signed URL: ${e}`), sessionStorage.setItem(ma, JSON.stringify(t));
|
|
3766
|
+
}
|
|
3767
|
+
function _a(e) {
|
|
3768
|
+
let t = ha().filter((t) => !e(t));
|
|
3769
|
+
sessionStorage.setItem(ma, JSON.stringify(t));
|
|
3765
3770
|
}
|
|
3766
3771
|
//#endregion
|
|
3767
3772
|
//#region src/utils/removeUndefined.ts
|
|
3768
|
-
function
|
|
3773
|
+
function va(e) {
|
|
3769
3774
|
let t = {};
|
|
3770
3775
|
return Object.keys(e).forEach((n) => {
|
|
3771
3776
|
let r = e[n];
|
|
@@ -3775,8 +3780,8 @@ function _a(e) {
|
|
|
3775
3780
|
//#endregion
|
|
3776
3781
|
//#region src/controllers/attribution.ts
|
|
3777
3782
|
zn();
|
|
3778
|
-
var
|
|
3779
|
-
function
|
|
3783
|
+
var ya = "sesamyAttribution";
|
|
3784
|
+
function ba(e) {
|
|
3780
3785
|
let t = localStorage.getItem(e);
|
|
3781
3786
|
if (!t) return null;
|
|
3782
3787
|
try {
|
|
@@ -3785,7 +3790,7 @@ function ya(e) {
|
|
|
3785
3790
|
return console.error(`Failed to parse ${e}`), null;
|
|
3786
3791
|
}
|
|
3787
3792
|
}
|
|
3788
|
-
function
|
|
3793
|
+
function xa(e) {
|
|
3789
3794
|
return Object.keys(e).find((e) => e.startsWith("utm_")) ? {
|
|
3790
3795
|
utmSource: void 0,
|
|
3791
3796
|
utmMedium: void 0,
|
|
@@ -3793,12 +3798,12 @@ function ba(e) {
|
|
|
3793
3798
|
...e
|
|
3794
3799
|
} : e;
|
|
3795
3800
|
}
|
|
3796
|
-
function xa() {
|
|
3797
|
-
return ya(va) || {};
|
|
3798
|
-
}
|
|
3799
3801
|
function Sa() {
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
+
return ba(ya) || {};
|
|
3803
|
+
}
|
|
3804
|
+
function Ca() {
|
|
3805
|
+
let e = Sa();
|
|
3806
|
+
return va({
|
|
3802
3807
|
source: e.utmSource,
|
|
3803
3808
|
medium: e.utmMedium,
|
|
3804
3809
|
campaign: e.utmCampaign,
|
|
@@ -3807,20 +3812,20 @@ function Sa() {
|
|
|
3807
3812
|
referrer: typeof document < "u" && document.referrer ? document.referrer : void 0
|
|
3808
3813
|
});
|
|
3809
3814
|
}
|
|
3810
|
-
function
|
|
3811
|
-
if (e === null) localStorage.removeItem(
|
|
3815
|
+
function wa(e) {
|
|
3816
|
+
if (e === null) localStorage.removeItem(ya);
|
|
3812
3817
|
else {
|
|
3813
3818
|
q(`Setting attribution ${JSON.stringify(e)}`);
|
|
3814
|
-
let t =
|
|
3815
|
-
...
|
|
3816
|
-
...
|
|
3819
|
+
let t = va({
|
|
3820
|
+
...Sa() ?? {},
|
|
3821
|
+
...xa(e)
|
|
3817
3822
|
});
|
|
3818
|
-
localStorage.setItem(
|
|
3823
|
+
localStorage.setItem(ya, JSON.stringify({ value: t }));
|
|
3819
3824
|
}
|
|
3820
3825
|
}
|
|
3821
3826
|
//#endregion
|
|
3822
3827
|
//#region ../../node_modules/.pnpm/@analytics+type-utils@0.6.4/node_modules/@analytics/type-utils/dist/analytics-util-types.module.js
|
|
3823
|
-
var
|
|
3828
|
+
var Ta = /* @__PURE__ */ u((/* @__PURE__ */ s(((e, t) => {
|
|
3824
3829
|
(function(n, r) {
|
|
3825
3830
|
typeof e == "object" && t !== void 0 ? t.exports = function(e, t, n, r, i) {
|
|
3826
3831
|
for (t = t.split ? t.split(".") : t, r = 0; r < t.length; r++) e = e ? e[t[r]] : i;
|
|
@@ -3835,102 +3840,102 @@ var wa = /* @__PURE__ */ u((/* @__PURE__ */ s(((e, t) => {
|
|
|
3835
3840
|
return e === i ? n : e;
|
|
3836
3841
|
};
|
|
3837
3842
|
})(e);
|
|
3838
|
-
})))(), 1),
|
|
3839
|
-
|
|
3840
|
-
var Y = typeof document !==
|
|
3841
|
-
Y && window.location.hostname,
|
|
3842
|
-
function
|
|
3843
|
+
})))(), 1), Ea = "function", Da = "string", Oa = "undefined", ka = "boolean", Aa = "array", ja = "symbol", Ma = "null", Na = function() {}, Pa = "form", Fa = "input", Ia = "button", La = "select", Ra = typeof process < "u" ? process : {};
|
|
3844
|
+
Ra.env && Ra.env.NODE_ENV;
|
|
3845
|
+
var Y = typeof document !== Oa;
|
|
3846
|
+
Y && window.location.hostname, Ra.versions != null && Ra.versions.node, typeof Deno < "u" && Deno.core, typeof self == "object" && self.constructor && self.constructor.name, Y && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
|
|
3847
|
+
function za(e, t) {
|
|
3843
3848
|
return t.charAt(0)[e]() + t.slice(1);
|
|
3844
3849
|
}
|
|
3845
|
-
var
|
|
3846
|
-
function
|
|
3847
|
-
return
|
|
3850
|
+
var Ba = za.bind(null, "toUpperCase"), Va = za.bind(null, "toLowerCase");
|
|
3851
|
+
function Ha(e) {
|
|
3852
|
+
return Ya(e) ? Ba(Ma) : typeof e == "object" ? eo(e) : Object.prototype.toString.call(e).slice(8, -1);
|
|
3848
3853
|
}
|
|
3849
|
-
function
|
|
3854
|
+
function Ua(e, t) {
|
|
3850
3855
|
t === void 0 && (t = !0);
|
|
3851
|
-
var n =
|
|
3852
|
-
return t ?
|
|
3856
|
+
var n = Ha(e);
|
|
3857
|
+
return t ? Va(n) : n;
|
|
3853
3858
|
}
|
|
3854
|
-
function
|
|
3859
|
+
function Wa(e, t) {
|
|
3855
3860
|
return typeof t === e;
|
|
3856
3861
|
}
|
|
3857
|
-
var
|
|
3858
|
-
|
|
3859
|
-
function Ja(e) {
|
|
3860
|
-
return e === null;
|
|
3861
|
-
}
|
|
3862
|
+
var Ga = Wa.bind(null, Ea), Ka = Wa.bind(null, Da), qa = Wa.bind(null, Oa), Ja = Wa.bind(null, ka);
|
|
3863
|
+
Wa.bind(null, ja);
|
|
3862
3864
|
function Ya(e) {
|
|
3863
|
-
return
|
|
3865
|
+
return e === null;
|
|
3864
3866
|
}
|
|
3865
3867
|
function Xa(e) {
|
|
3866
|
-
return
|
|
3868
|
+
return Ua(e) === "number" && !isNaN(e);
|
|
3867
3869
|
}
|
|
3868
3870
|
function Za(e) {
|
|
3869
|
-
|
|
3870
|
-
for (var t = e; Object.getPrototypeOf(t) !== null;) t = Object.getPrototypeOf(t);
|
|
3871
|
-
return Object.getPrototypeOf(e) === t;
|
|
3871
|
+
return Ua(e) === Aa;
|
|
3872
3872
|
}
|
|
3873
3873
|
function Qa(e) {
|
|
3874
|
-
|
|
3874
|
+
if (!$a(e)) return !1;
|
|
3875
|
+
for (var t = e; Object.getPrototypeOf(t) !== null;) t = Object.getPrototypeOf(t);
|
|
3876
|
+
return Object.getPrototypeOf(e) === t;
|
|
3875
3877
|
}
|
|
3876
3878
|
function $a(e) {
|
|
3877
|
-
return
|
|
3879
|
+
return e && (typeof e == "object" || e !== null);
|
|
3878
3880
|
}
|
|
3879
3881
|
function eo(e) {
|
|
3880
|
-
return
|
|
3882
|
+
return Ga(e.constructor) ? e.constructor.name : null;
|
|
3883
|
+
}
|
|
3884
|
+
function to(e) {
|
|
3885
|
+
return e instanceof Error || Ka(e.message) && e.constructor && Xa(e.constructor.stackTraceLimit);
|
|
3881
3886
|
}
|
|
3882
|
-
function
|
|
3883
|
-
if (typeof t != "object" ||
|
|
3887
|
+
function no(e, t) {
|
|
3888
|
+
if (typeof t != "object" || Ya(t)) return !1;
|
|
3884
3889
|
if (t instanceof e) return !0;
|
|
3885
|
-
var n =
|
|
3886
|
-
if (
|
|
3887
|
-
if (
|
|
3890
|
+
var n = Ua(new e(""));
|
|
3891
|
+
if (to(t)) for (; t;) {
|
|
3892
|
+
if (Ua(t) === n) return !0;
|
|
3888
3893
|
t = Object.getPrototypeOf(t);
|
|
3889
3894
|
}
|
|
3890
3895
|
return !1;
|
|
3891
3896
|
}
|
|
3892
|
-
|
|
3893
|
-
function
|
|
3897
|
+
no.bind(null, TypeError), no.bind(null, SyntaxError);
|
|
3898
|
+
function ro(e, t) {
|
|
3894
3899
|
var n = e instanceof Element || e instanceof HTMLDocument;
|
|
3895
|
-
return n && t ?
|
|
3900
|
+
return n && t ? io(e, t) : n;
|
|
3896
3901
|
}
|
|
3897
|
-
function
|
|
3902
|
+
function io(e, t) {
|
|
3898
3903
|
return t === void 0 && (t = ""), e && e.nodeName === t.toUpperCase();
|
|
3899
3904
|
}
|
|
3900
|
-
function
|
|
3905
|
+
function ao(e) {
|
|
3901
3906
|
var t = [].slice.call(arguments, 1);
|
|
3902
3907
|
return function() {
|
|
3903
3908
|
return e.apply(void 0, [].slice.call(arguments).concat(t));
|
|
3904
3909
|
};
|
|
3905
3910
|
}
|
|
3906
|
-
|
|
3907
|
-
function
|
|
3908
|
-
return e ?
|
|
3911
|
+
ao(ro, Pa), ao(ro, Ia), ao(ro, Fa), ao(ro, La);
|
|
3912
|
+
function oo(e) {
|
|
3913
|
+
return e ? Za(e) ? e : [e] : [];
|
|
3909
3914
|
}
|
|
3910
3915
|
//#endregion
|
|
3911
3916
|
//#region ../../node_modules/.pnpm/analytics-utils@1.1.1_@types+dlv@1.1.5/node_modules/analytics-utils/dist/analytics-utils.module.js
|
|
3912
|
-
function
|
|
3917
|
+
function so(e) {
|
|
3913
3918
|
try {
|
|
3914
3919
|
return decodeURIComponent(e.replace(/\+/g, " "));
|
|
3915
3920
|
} catch {
|
|
3916
3921
|
return null;
|
|
3917
3922
|
}
|
|
3918
3923
|
}
|
|
3919
|
-
function
|
|
3924
|
+
function co() {
|
|
3920
3925
|
if (Y) {
|
|
3921
3926
|
var e = navigator, t = e.languages;
|
|
3922
3927
|
return e.userLanguage || (t && t.length ? t[0] : e.language);
|
|
3923
3928
|
}
|
|
3924
3929
|
}
|
|
3925
|
-
function
|
|
3930
|
+
function lo() {
|
|
3926
3931
|
try {
|
|
3927
3932
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
3928
3933
|
} catch {}
|
|
3929
3934
|
}
|
|
3930
|
-
function
|
|
3935
|
+
function uo(e) {
|
|
3931
3936
|
return function(e) {
|
|
3932
3937
|
for (var t, n = Object.create(null), r = /([^&=]+)=?([^&]*)/g; t = r.exec(e);) {
|
|
3933
|
-
var i =
|
|
3938
|
+
var i = so(t[1]), a = so(t[2]);
|
|
3934
3939
|
if (i) if (i.substring(i.length - 2) === "[]") {
|
|
3935
3940
|
var o = n[i = i.substring(0, i.length - 2)] || (n[i] = []);
|
|
3936
3941
|
n[i] = Array.isArray(o) ? o : [], n[i].push(a);
|
|
@@ -3938,7 +3943,7 @@ function lo(e) {
|
|
|
3938
3943
|
}
|
|
3939
3944
|
for (var s in n) {
|
|
3940
3945
|
var c = s.split("[");
|
|
3941
|
-
c.length > 1 && (
|
|
3946
|
+
c.length > 1 && (fo(n, c.map(function(e) {
|
|
3942
3947
|
return e.replace(/[?[\]\\ ]/g, "");
|
|
3943
3948
|
}), n[s]), delete n[s]);
|
|
3944
3949
|
}
|
|
@@ -3951,7 +3956,7 @@ function lo(e) {
|
|
|
3951
3956
|
return Y && window.location.search.substring(1);
|
|
3952
3957
|
}(e));
|
|
3953
3958
|
}
|
|
3954
|
-
function
|
|
3959
|
+
function fo(e, t, n) {
|
|
3955
3960
|
for (var r = t.length - 1, i = 0; i < r; ++i) {
|
|
3956
3961
|
var a = t[i];
|
|
3957
3962
|
if (a === "__proto__" || a === "constructor") break;
|
|
@@ -3959,14 +3964,14 @@ function uo(e, t, n) {
|
|
|
3959
3964
|
}
|
|
3960
3965
|
e[t[r]] = n;
|
|
3961
3966
|
}
|
|
3962
|
-
function
|
|
3967
|
+
function po() {
|
|
3963
3968
|
for (var e = "", t = 0, n = 4294967295 * Math.random() | 0; t++ < 36;) {
|
|
3964
3969
|
var r = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t - 1], i = 15 & n;
|
|
3965
3970
|
e += r == "-" || r == "4" ? r : (r == "x" ? i : 3 & i | 8).toString(16), n = t % 8 == 0 ? 4294967295 * Math.random() | 0 : n >> 4;
|
|
3966
3971
|
}
|
|
3967
3972
|
return e;
|
|
3968
3973
|
}
|
|
3969
|
-
function
|
|
3974
|
+
function mo(e, t) {
|
|
3970
3975
|
var n, r, i, a = null, o = 0, s = function() {
|
|
3971
3976
|
o = /* @__PURE__ */ new Date(), a = null, i = e.apply(n, r);
|
|
3972
3977
|
};
|
|
@@ -3979,37 +3984,37 @@ function po(e, t) {
|
|
|
3979
3984
|
}
|
|
3980
3985
|
//#endregion
|
|
3981
3986
|
//#region ../../node_modules/.pnpm/@analytics+global-storage-utils@0.1.9/node_modules/@analytics/global-storage-utils/dist/analytics-util-global-storage.module.js
|
|
3982
|
-
var
|
|
3983
|
-
function
|
|
3984
|
-
return go
|
|
3987
|
+
var ho = "global", go = "__" + ho + "__", _o = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
|
|
3988
|
+
function vo(e) {
|
|
3989
|
+
return _o[go][e];
|
|
3985
3990
|
}
|
|
3986
|
-
function
|
|
3987
|
-
return go
|
|
3991
|
+
function yo(e, t) {
|
|
3992
|
+
return _o[go][e] = t;
|
|
3988
3993
|
}
|
|
3989
|
-
function
|
|
3990
|
-
delete go
|
|
3994
|
+
function bo(e) {
|
|
3995
|
+
delete _o[go][e];
|
|
3991
3996
|
}
|
|
3992
|
-
function
|
|
3997
|
+
function xo(e, t, n) {
|
|
3993
3998
|
var r;
|
|
3994
3999
|
try {
|
|
3995
|
-
if (
|
|
4000
|
+
if (Co(e)) {
|
|
3996
4001
|
var i = window[e];
|
|
3997
4002
|
r = i[t].bind(i);
|
|
3998
4003
|
}
|
|
3999
4004
|
} catch {}
|
|
4000
4005
|
return r || n;
|
|
4001
4006
|
}
|
|
4002
|
-
go
|
|
4003
|
-
var
|
|
4004
|
-
function
|
|
4005
|
-
if (
|
|
4007
|
+
_o[go] || (_o[go] = {});
|
|
4008
|
+
var So = {};
|
|
4009
|
+
function Co(e) {
|
|
4010
|
+
if (So[e] !== void 0) return So[e];
|
|
4006
4011
|
try {
|
|
4007
4012
|
var t = window[e];
|
|
4008
|
-
t.setItem(
|
|
4013
|
+
t.setItem(Oa, Oa), t.removeItem(Oa);
|
|
4009
4014
|
} catch {
|
|
4010
|
-
return
|
|
4015
|
+
return So[e] = !1;
|
|
4011
4016
|
}
|
|
4012
|
-
return
|
|
4017
|
+
return So[e] = !0;
|
|
4013
4018
|
}
|
|
4014
4019
|
//#endregion
|
|
4015
4020
|
//#region ../../node_modules/.pnpm/@analytics+core@0.13.2_@types+dlv@1.1.5/node_modules/@analytics/core/dist/client/core.module.js
|
|
@@ -4022,16 +4027,16 @@ function X() {
|
|
|
4022
4027
|
return e;
|
|
4023
4028
|
}, X.apply(null, arguments);
|
|
4024
4029
|
}
|
|
4025
|
-
var
|
|
4026
|
-
return typeof Symbol ===
|
|
4027
|
-
}(),
|
|
4028
|
-
function
|
|
4030
|
+
var wo = "function", To = "undefined", Eo = "reducer", Do = "@@redux/", Oo = Do + "INIT", ko = Do + Math.random().toString(36), Ao = /* @__PURE__ */ function() {
|
|
4031
|
+
return typeof Symbol === wo && Symbol.observable || "@@observable";
|
|
4032
|
+
}(), jo = " != " + wo;
|
|
4033
|
+
function Mo(e, t, n) {
|
|
4029
4034
|
var r;
|
|
4030
|
-
if (typeof t ===
|
|
4031
|
-
if (typeof n !==
|
|
4032
|
-
return n(
|
|
4035
|
+
if (typeof t === wo && typeof n === To && (n = t, t = void 0), typeof n !== To) {
|
|
4036
|
+
if (typeof n !== wo) throw Error("enhancer" + jo);
|
|
4037
|
+
return n(Mo)(e, t);
|
|
4033
4038
|
}
|
|
4034
|
-
if (typeof e !==
|
|
4039
|
+
if (typeof e !== wo) throw Error(Eo + jo);
|
|
4035
4040
|
var i = e, a = t, o = [], s = o, c = !1;
|
|
4036
4041
|
function l() {
|
|
4037
4042
|
s === o && (s = o.slice());
|
|
@@ -4040,7 +4045,7 @@ function jo(e, t, n) {
|
|
|
4040
4045
|
return a;
|
|
4041
4046
|
}
|
|
4042
4047
|
function d(e) {
|
|
4043
|
-
if (typeof e !==
|
|
4048
|
+
if (typeof e !== wo) throw Error("Listener" + jo);
|
|
4044
4049
|
var t = !0;
|
|
4045
4050
|
return l(), s.push(e), function() {
|
|
4046
4051
|
if (t) {
|
|
@@ -4051,9 +4056,9 @@ function jo(e, t, n) {
|
|
|
4051
4056
|
};
|
|
4052
4057
|
}
|
|
4053
4058
|
function f(e) {
|
|
4054
|
-
if (!
|
|
4055
|
-
if (typeof e.type ===
|
|
4056
|
-
if (c) throw Error("Dispatch in " +
|
|
4059
|
+
if (!Qa(e)) throw Error("Act != obj");
|
|
4060
|
+
if (typeof e.type === To) throw Error("ActType " + To);
|
|
4061
|
+
if (c) throw Error("Dispatch in " + Eo);
|
|
4057
4062
|
try {
|
|
4058
4063
|
c = !0, a = i(a, e);
|
|
4059
4064
|
} finally {
|
|
@@ -4062,15 +4067,15 @@ function jo(e, t, n) {
|
|
|
4062
4067
|
for (var t = o = s, n = 0; n < t.length; n++) (0, t[n])();
|
|
4063
4068
|
return e;
|
|
4064
4069
|
}
|
|
4065
|
-
return f({ type:
|
|
4070
|
+
return f({ type: Oo }), (r = {
|
|
4066
4071
|
dispatch: f,
|
|
4067
4072
|
subscribe: d,
|
|
4068
4073
|
getState: u,
|
|
4069
4074
|
replaceReducer: function(e) {
|
|
4070
|
-
if (typeof e !==
|
|
4071
|
-
i = e, f({ type:
|
|
4075
|
+
if (typeof e !== wo) throw Error("next " + Eo + jo);
|
|
4076
|
+
i = e, f({ type: Oo });
|
|
4072
4077
|
}
|
|
4073
|
-
})[
|
|
4078
|
+
})[Ao] = function() {
|
|
4074
4079
|
var e, t = d;
|
|
4075
4080
|
return (e = { subscribe: function(e) {
|
|
4076
4081
|
if (typeof e != "object") throw TypeError("Observer != obj");
|
|
@@ -4078,16 +4083,16 @@ function jo(e, t, n) {
|
|
|
4078
4083
|
e.next && e.next(u());
|
|
4079
4084
|
}
|
|
4080
4085
|
return n(), { unsubscribe: t(n) };
|
|
4081
|
-
} })[
|
|
4086
|
+
} })[Ao] = function() {
|
|
4082
4087
|
return this;
|
|
4083
4088
|
}, e;
|
|
4084
4089
|
}, r;
|
|
4085
4090
|
}
|
|
4086
|
-
function
|
|
4091
|
+
function No(e, t) {
|
|
4087
4092
|
var n = t && t.type;
|
|
4088
|
-
return "action " + (n && n.toString() || "?") +
|
|
4093
|
+
return "action " + (n && n.toString() || "?") + Eo + " " + e + " returns " + To;
|
|
4089
4094
|
}
|
|
4090
|
-
function
|
|
4095
|
+
function Po() {
|
|
4091
4096
|
var e = [].slice.call(arguments);
|
|
4092
4097
|
return e.length === 0 ? function(e) {
|
|
4093
4098
|
return e;
|
|
@@ -4097,7 +4102,7 @@ function No() {
|
|
|
4097
4102
|
};
|
|
4098
4103
|
});
|
|
4099
4104
|
}
|
|
4100
|
-
function
|
|
4105
|
+
function Fo() {
|
|
4101
4106
|
var e = arguments;
|
|
4102
4107
|
return function(t) {
|
|
4103
4108
|
return function(n, r, i) {
|
|
@@ -4109,16 +4114,16 @@ function Po() {
|
|
|
4109
4114
|
};
|
|
4110
4115
|
return a = [].slice.call(e).map(function(e) {
|
|
4111
4116
|
return e(c);
|
|
4112
|
-
}), X({}, o, { dispatch: s =
|
|
4117
|
+
}), X({}, o, { dispatch: s = Po.apply(void 0, a)(o.dispatch) });
|
|
4113
4118
|
};
|
|
4114
4119
|
};
|
|
4115
4120
|
}
|
|
4116
|
-
var
|
|
4121
|
+
var Io = "__anon_id", Lo = "__user_id", Ro = "__user_traits", zo = "analytics", Bo = "userId", Vo = "anonymousId", Ho = /* @__PURE__ */ "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".split("."), Uo = [
|
|
4117
4122
|
"name",
|
|
4118
4123
|
"EVENTS",
|
|
4119
4124
|
"config",
|
|
4120
4125
|
"loaded"
|
|
4121
|
-
], Z =
|
|
4126
|
+
], Z = Ho.reduce(function(e, t) {
|
|
4122
4127
|
return e[t] = t, e;
|
|
4123
4128
|
}, {
|
|
4124
4129
|
registerPluginType: function(e) {
|
|
@@ -4127,23 +4132,23 @@ var Fo = "__anon_id", Io = "__user_id", Lo = "__user_traits", Ro = "analytics",
|
|
|
4127
4132
|
pluginReadyType: function(e) {
|
|
4128
4133
|
return "ready:" + e;
|
|
4129
4134
|
}
|
|
4130
|
-
}),
|
|
4131
|
-
function
|
|
4135
|
+
}), Wo = /^utm_/, Go = /^an_prop_/, Ko = /^an_trait_/;
|
|
4136
|
+
function qo(e) {
|
|
4132
4137
|
var t = e.storage.setItem;
|
|
4133
4138
|
return function(n) {
|
|
4134
4139
|
return function(r) {
|
|
4135
4140
|
return function(i) {
|
|
4136
4141
|
if (i.type === Z.bootstrap) {
|
|
4137
4142
|
var a = i.params, o = i.user, s = i.persistedUser, c = i.initialUser, l = s.userId === o.userId;
|
|
4138
|
-
s.anonymousId !== o.anonymousId && t(
|
|
4143
|
+
s.anonymousId !== o.anonymousId && t(Io, o.anonymousId), l || t(Lo, o.userId), c.traits && t(Ro, X({}, l && s.traits ? s.traits : {}, c.traits));
|
|
4139
4144
|
var u = Object.keys(i.params);
|
|
4140
4145
|
if (u.length) {
|
|
4141
4146
|
var d = a.an_uid, f = a.an_event, p = u.reduce(function(e, t) {
|
|
4142
|
-
if (t.match(
|
|
4143
|
-
var n = t.replace(
|
|
4147
|
+
if (t.match(Wo) || t.match(/^(d|g)clid/)) {
|
|
4148
|
+
var n = t.replace(Wo, "");
|
|
4144
4149
|
e.campaign[n === "campaign" ? "name" : n] = a[t];
|
|
4145
4150
|
}
|
|
4146
|
-
return t.match(
|
|
4151
|
+
return t.match(Go) && (e.props[t.replace(Go, "")] = a[t]), t.match(Ko) && (e.traits[t.replace(Ko, "")] = a[t]), e;
|
|
4147
4152
|
}, {
|
|
4148
4153
|
campaign: {},
|
|
4149
4154
|
props: {},
|
|
@@ -4167,11 +4172,11 @@ function Ko(e) {
|
|
|
4167
4172
|
};
|
|
4168
4173
|
};
|
|
4169
4174
|
}
|
|
4170
|
-
function
|
|
4175
|
+
function Jo(e) {
|
|
4171
4176
|
return function(t, n) {
|
|
4172
4177
|
if (t === void 0 && (t = {}), n === void 0 && (n = {}), n.type === Z.setItemEnd) {
|
|
4173
|
-
if (n.key ===
|
|
4174
|
-
if (n.key ===
|
|
4178
|
+
if (n.key === Io) return X({}, t, { anonymousId: n.value });
|
|
4179
|
+
if (n.key === Lo) return X({}, t, { userId: n.value });
|
|
4175
4180
|
}
|
|
4176
4181
|
switch (n.type) {
|
|
4177
4182
|
case Z.identify: return Object.assign({}, t, {
|
|
@@ -4179,9 +4184,9 @@ function qo(e) {
|
|
|
4179
4184
|
traits: X({}, t.traits, n.traits)
|
|
4180
4185
|
});
|
|
4181
4186
|
case Z.reset: return [
|
|
4187
|
+
Lo,
|
|
4182
4188
|
Io,
|
|
4183
|
-
|
|
4184
|
-
Lo
|
|
4189
|
+
Ro
|
|
4185
4190
|
].forEach(function(t) {
|
|
4186
4191
|
e.removeItem(t);
|
|
4187
4192
|
}), Object.assign({}, t, {
|
|
@@ -4193,37 +4198,37 @@ function qo(e) {
|
|
|
4193
4198
|
}
|
|
4194
4199
|
};
|
|
4195
4200
|
}
|
|
4196
|
-
function
|
|
4201
|
+
function Yo(e) {
|
|
4197
4202
|
return {
|
|
4198
|
-
userId: e.getItem(
|
|
4199
|
-
anonymousId: e.getItem(
|
|
4200
|
-
traits: e.getItem(
|
|
4203
|
+
userId: e.getItem(Lo),
|
|
4204
|
+
anonymousId: e.getItem(Io),
|
|
4205
|
+
traits: e.getItem(Ro)
|
|
4201
4206
|
};
|
|
4202
4207
|
}
|
|
4203
|
-
var
|
|
4208
|
+
var Xo = function(e) {
|
|
4204
4209
|
return "__TEMP__" + e;
|
|
4205
4210
|
};
|
|
4206
|
-
function
|
|
4211
|
+
function Zo(e) {
|
|
4207
4212
|
var t = e.storage, n = t.setItem, r = t.removeItem, i = t.getItem;
|
|
4208
4213
|
return function(e) {
|
|
4209
4214
|
return function(t) {
|
|
4210
4215
|
return function(a) {
|
|
4211
4216
|
var o = a.userId, s = a.traits, c = a.options;
|
|
4212
4217
|
if (a.type === Z.reset && ([
|
|
4213
|
-
Io,
|
|
4214
4218
|
Lo,
|
|
4215
|
-
|
|
4219
|
+
Ro,
|
|
4220
|
+
Io
|
|
4216
4221
|
].forEach(function(e) {
|
|
4217
4222
|
r(e);
|
|
4218
4223
|
}), [
|
|
4219
|
-
zo,
|
|
4220
4224
|
Bo,
|
|
4225
|
+
Vo,
|
|
4221
4226
|
"traits"
|
|
4222
4227
|
].forEach(function(e) {
|
|
4223
|
-
|
|
4228
|
+
bo(Xo(e));
|
|
4224
4229
|
})), a.type === Z.identify) {
|
|
4225
|
-
i(
|
|
4226
|
-
var l = i(
|
|
4230
|
+
i(Io) || n(Io, po());
|
|
4231
|
+
var l = i(Lo), u = i(Ro) || {};
|
|
4227
4232
|
l && l !== o && e.dispatch({
|
|
4228
4233
|
type: Z.userIdChanged,
|
|
4229
4234
|
old: {
|
|
@@ -4235,30 +4240,30 @@ function Xo(e) {
|
|
|
4235
4240
|
traits: s
|
|
4236
4241
|
},
|
|
4237
4242
|
options: c
|
|
4238
|
-
}), o && n(
|
|
4243
|
+
}), o && n(Lo, o), s && n(Ro, X({}, u, s));
|
|
4239
4244
|
}
|
|
4240
4245
|
return t(a);
|
|
4241
4246
|
};
|
|
4242
4247
|
};
|
|
4243
4248
|
};
|
|
4244
4249
|
}
|
|
4245
|
-
var
|
|
4246
|
-
function
|
|
4247
|
-
|
|
4250
|
+
var Qo = {};
|
|
4251
|
+
function $o(e, t) {
|
|
4252
|
+
Qo[e] && Ga(Qo[e]) && (Qo[e](t), delete Qo[e]);
|
|
4248
4253
|
}
|
|
4249
|
-
function
|
|
4254
|
+
function es(e, t, n) {
|
|
4250
4255
|
return new Promise(function(r, i) {
|
|
4251
4256
|
return t() ? r(e) : n < 1 ? i(X({}, e, { queue: !0 })) : new Promise(function(e) {
|
|
4252
4257
|
return setTimeout(e, 10);
|
|
4253
4258
|
}).then(function(a) {
|
|
4254
|
-
return
|
|
4259
|
+
return es(e, t, n - 10).then(r, i);
|
|
4255
4260
|
});
|
|
4256
4261
|
});
|
|
4257
4262
|
}
|
|
4258
|
-
function
|
|
4263
|
+
function ts(e) {
|
|
4259
4264
|
return { abort: e };
|
|
4260
4265
|
}
|
|
4261
|
-
function
|
|
4266
|
+
function ns(e, t, n) {
|
|
4262
4267
|
var r = {}, i = t(), a = e.getState(), o = a.plugins, s = a.queue, c = a.user;
|
|
4263
4268
|
if (!a.context.offline && s && s.actions && s.actions.length) {
|
|
4264
4269
|
var l = s.actions.reduce(function(e, t, n) {
|
|
@@ -4271,9 +4276,9 @@ function ts(e, t, n) {
|
|
|
4271
4276
|
});
|
|
4272
4277
|
l.processIndex && l.processIndex.length && (l.processIndex.forEach(function(t) {
|
|
4273
4278
|
var a = s.actions[t], l = a.plugin, u = a.payload.type, d = i[l][u];
|
|
4274
|
-
if (d &&
|
|
4279
|
+
if (d && Ga(d)) {
|
|
4275
4280
|
var f, p = function(e, t) {
|
|
4276
|
-
return e === void 0 && (e = {}), t === void 0 && (t = {}), [
|
|
4281
|
+
return e === void 0 && (e = {}), t === void 0 && (t = {}), [Bo, Vo].reduce(function(n, r) {
|
|
4277
4282
|
return e.hasOwnProperty(r) && t[r] && t[r] !== e[r] && (n[r] = t[r]), n;
|
|
4278
4283
|
}, e);
|
|
4279
4284
|
}(a.payload, c), m = r[p.meta.rid];
|
|
@@ -4281,8 +4286,8 @@ function ts(e, t, n) {
|
|
|
4281
4286
|
payload: p,
|
|
4282
4287
|
config: o[l].config,
|
|
4283
4288
|
instance: n,
|
|
4284
|
-
abort:
|
|
4285
|
-
})) &&
|
|
4289
|
+
abort: ts
|
|
4290
|
+
})) && Qa(f) && f.abort) return void (r[p.meta.rid] = !0);
|
|
4286
4291
|
if (!m) {
|
|
4287
4292
|
var h = u + ":" + l;
|
|
4288
4293
|
e.dispatch(X({}, p, {
|
|
@@ -4299,10 +4304,10 @@ function ts(e, t, n) {
|
|
|
4299
4304
|
}));
|
|
4300
4305
|
}
|
|
4301
4306
|
}
|
|
4302
|
-
var
|
|
4307
|
+
var rs = function(e) {
|
|
4303
4308
|
var t = e.data, n = e.action, r = e.instance, i = e.state, a = e.allPlugins, o = e.allMatches, s = e.store, c = e.EVENTS;
|
|
4304
4309
|
try {
|
|
4305
|
-
var l = i.plugins, u = i.context, d = n.type, f = d.match(
|
|
4310
|
+
var l = i.plugins, u = i.context, d = n.type, f = d.match(is), p = t.exact.map(function(e) {
|
|
4306
4311
|
return e.pluginName;
|
|
4307
4312
|
});
|
|
4308
4313
|
f && (p = o.during.map(function(e) {
|
|
@@ -4312,10 +4317,10 @@ var ns = function(e) {
|
|
|
4312
4317
|
return function(n, r, i) {
|
|
4313
4318
|
var a = r.config, o = r.name, s = o + "." + n.type;
|
|
4314
4319
|
i && (s = i.event);
|
|
4315
|
-
var c = n.type.match(
|
|
4320
|
+
var c = n.type.match(is) ? function(e, t, n, r, i) {
|
|
4316
4321
|
return function(a, o) {
|
|
4317
|
-
var s = r ? r.name : e, c = o &&
|
|
4318
|
-
if (r && (!(c = o &&
|
|
4322
|
+
var s = r ? r.name : e, c = o && ps(o) ? o : n;
|
|
4323
|
+
if (r && (!(c = o && ps(o) ? o : [e]).includes(e) || c.length !== 1)) throw Error("Method " + t + " can only abort " + e + " plugin. " + JSON.stringify(c) + " input valid");
|
|
4319
4324
|
return X({}, i, { abort: {
|
|
4320
4325
|
reason: a,
|
|
4321
4326
|
plugins: c,
|
|
@@ -4329,7 +4334,7 @@ var ns = function(e) {
|
|
|
4329
4334
|
};
|
|
4330
4335
|
}(n, s);
|
|
4331
4336
|
return {
|
|
4332
|
-
payload:
|
|
4337
|
+
payload: gs(n),
|
|
4333
4338
|
instance: e,
|
|
4334
4339
|
config: a || {},
|
|
4335
4340
|
abort: c
|
|
@@ -4348,10 +4353,10 @@ var ns = function(e) {
|
|
|
4348
4353
|
var o = function() {
|
|
4349
4354
|
if (t.namespaced && t.namespaced[s]) return Promise.resolve(t.namespaced[s].reduce(function(e, t, n) {
|
|
4350
4355
|
return Promise.resolve(e).then(function(e) {
|
|
4351
|
-
return t.method &&
|
|
4352
|
-
var n =
|
|
4356
|
+
return t.method && Ga(t.method) ? (function(e, t) {
|
|
4357
|
+
var n = hs(e);
|
|
4353
4358
|
if (n && n.name === t) {
|
|
4354
|
-
var r =
|
|
4359
|
+
var r = hs(n.method);
|
|
4355
4360
|
throw Error([
|
|
4356
4361
|
t + " plugin is calling method " + e,
|
|
4357
4362
|
"Plugins cant call self",
|
|
@@ -4369,10 +4374,10 @@ var ns = function(e) {
|
|
|
4369
4374
|
from: o || i
|
|
4370
4375
|
} });
|
|
4371
4376
|
}),
|
|
4372
|
-
config:
|
|
4377
|
+
config: cs(t.pluginName, l, a),
|
|
4373
4378
|
plugins: l
|
|
4374
4379
|
})).then(function(t) {
|
|
4375
|
-
var n =
|
|
4380
|
+
var n = Qa(t) ? t : {};
|
|
4376
4381
|
return Promise.resolve(X({}, e, n));
|
|
4377
4382
|
})) : e;
|
|
4378
4383
|
var n, i, o;
|
|
@@ -4390,14 +4395,14 @@ var ns = function(e) {
|
|
|
4390
4395
|
var c = t.exact.length === o + 1, u = i.pluginName, p = a[u];
|
|
4391
4396
|
return Promise.resolve(n).then(function(t) {
|
|
4392
4397
|
var n = e[u] ? e[u] : {};
|
|
4393
|
-
if (f && (n = t),
|
|
4398
|
+
if (f && (n = t), ds(n, u)) return ss({
|
|
4394
4399
|
data: n,
|
|
4395
4400
|
method: d,
|
|
4396
4401
|
instance: r,
|
|
4397
4402
|
pluginName: u,
|
|
4398
4403
|
store: s
|
|
4399
4404
|
}), Promise.resolve(t);
|
|
4400
|
-
if (
|
|
4405
|
+
if (ds(t, u)) return c && ss({
|
|
4401
4406
|
data: t,
|
|
4402
4407
|
method: d,
|
|
4403
4408
|
instance: r,
|
|
@@ -4417,11 +4422,11 @@ var ns = function(e) {
|
|
|
4417
4422
|
abort: i.abort,
|
|
4418
4423
|
payload: n,
|
|
4419
4424
|
instance: r,
|
|
4420
|
-
config:
|
|
4425
|
+
config: cs(u, l, a),
|
|
4421
4426
|
plugins: l
|
|
4422
4427
|
})).then(function(i) {
|
|
4423
|
-
var a =
|
|
4424
|
-
if (
|
|
4428
|
+
var a = Qa(i) ? i : {}, o = X({}, t, a), c = e[u];
|
|
4429
|
+
if (ds(c, u)) ss({
|
|
4425
4430
|
data: c,
|
|
4426
4431
|
method: d,
|
|
4427
4432
|
instance: r,
|
|
@@ -4430,7 +4435,7 @@ var ns = function(e) {
|
|
|
4430
4435
|
});
|
|
4431
4436
|
else {
|
|
4432
4437
|
var l = d + ":" + u;
|
|
4433
|
-
(l.match(/:/g) || []).length < 2 && !d.match(
|
|
4438
|
+
(l.match(/:/g) || []).length < 2 && !d.match(as) && !d.match(os) && r.dispatch(X({}, f ? o : n, {
|
|
4434
4439
|
type: l,
|
|
4435
4440
|
_: {
|
|
4436
4441
|
called: l,
|
|
@@ -4445,14 +4450,14 @@ var ns = function(e) {
|
|
|
4445
4450
|
return Promise.reject(e);
|
|
4446
4451
|
}
|
|
4447
4452
|
}, Promise.resolve(n))).then(function(e) {
|
|
4448
|
-
if (!(d.match(
|
|
4453
|
+
if (!(d.match(is) || d.match(/^registerPlugin/) || d.match(os) || d.match(as) || d.match(/^params/) || d.match(/^userIdChanged/))) {
|
|
4449
4454
|
if (c.plugins.includes(d), e._ && e._.originalAction === d) return e;
|
|
4450
4455
|
var n = X({}, e, { _: {
|
|
4451
4456
|
originalAction: e.type,
|
|
4452
4457
|
called: e.type,
|
|
4453
4458
|
from: "engineEnd"
|
|
4454
4459
|
} });
|
|
4455
|
-
|
|
4460
|
+
fs(e, t.exact.length) && !d.match(/End$/) && (n = X({}, n, { type: e.type + "Aborted" })), s.dispatch(n);
|
|
4456
4461
|
}
|
|
4457
4462
|
return e;
|
|
4458
4463
|
});
|
|
@@ -4460,8 +4465,8 @@ var ns = function(e) {
|
|
|
4460
4465
|
} catch (e) {
|
|
4461
4466
|
return Promise.reject(e);
|
|
4462
4467
|
}
|
|
4463
|
-
},
|
|
4464
|
-
function
|
|
4468
|
+
}, is = /Start$/, as = /^bootstrap/, os = /^ready/;
|
|
4469
|
+
function ss(e) {
|
|
4465
4470
|
var t = e.pluginName, n = e.method + "Aborted" + (t ? ":" + t : "");
|
|
4466
4471
|
e.store.dispatch(X({}, e.data, {
|
|
4467
4472
|
type: n,
|
|
@@ -4471,11 +4476,11 @@ function os(e) {
|
|
|
4471
4476
|
}
|
|
4472
4477
|
}));
|
|
4473
4478
|
}
|
|
4474
|
-
function
|
|
4479
|
+
function cs(e, t, n) {
|
|
4475
4480
|
var r = t[e] || n[e];
|
|
4476
4481
|
return r && r.config ? r.config : {};
|
|
4477
4482
|
}
|
|
4478
|
-
function
|
|
4483
|
+
function ls(e, t) {
|
|
4479
4484
|
return t.reduce(function(t, n) {
|
|
4480
4485
|
return n[e] ? t.concat({
|
|
4481
4486
|
methodName: e,
|
|
@@ -4484,44 +4489,44 @@ function cs(e, t) {
|
|
|
4484
4489
|
}) : t;
|
|
4485
4490
|
}, []);
|
|
4486
4491
|
}
|
|
4487
|
-
function
|
|
4488
|
-
var n = e.replace(
|
|
4492
|
+
function us(e, t) {
|
|
4493
|
+
var n = e.replace(is, ""), r = t ? ":" + t : "";
|
|
4489
4494
|
return [
|
|
4490
4495
|
"" + e + r,
|
|
4491
4496
|
"" + n + r,
|
|
4492
4497
|
n + "End" + r
|
|
4493
4498
|
];
|
|
4494
4499
|
}
|
|
4495
|
-
function
|
|
4500
|
+
function ds(e, t) {
|
|
4496
4501
|
var n = e.abort;
|
|
4497
|
-
return !!n && (!0 === n ||
|
|
4502
|
+
return !!n && (!0 === n || ms(n, t) || n && ms(n.plugins, t));
|
|
4498
4503
|
}
|
|
4499
|
-
function
|
|
4504
|
+
function fs(e, t) {
|
|
4500
4505
|
var n = e.abort;
|
|
4501
4506
|
if (!n) return !1;
|
|
4502
|
-
if (!0 === n ||
|
|
4507
|
+
if (!0 === n || Ka(n)) return !0;
|
|
4503
4508
|
var r = n.plugins;
|
|
4504
|
-
return
|
|
4509
|
+
return ps(n) && n.length === t || ps(r) && r.length === t;
|
|
4505
4510
|
}
|
|
4506
|
-
function
|
|
4511
|
+
function ps(e) {
|
|
4507
4512
|
return Array.isArray(e);
|
|
4508
4513
|
}
|
|
4509
|
-
function
|
|
4510
|
-
return !(!e || !
|
|
4514
|
+
function ms(e, t) {
|
|
4515
|
+
return !(!e || !ps(e)) && e.includes(t);
|
|
4511
4516
|
}
|
|
4512
|
-
function
|
|
4517
|
+
function hs(e) {
|
|
4513
4518
|
var t = e.match(/(.*):(.*)/);
|
|
4514
4519
|
return !!t && {
|
|
4515
4520
|
method: t[1],
|
|
4516
4521
|
name: t[2]
|
|
4517
4522
|
};
|
|
4518
4523
|
}
|
|
4519
|
-
function
|
|
4524
|
+
function gs(e) {
|
|
4520
4525
|
return Object.keys(e).reduce(function(t, n) {
|
|
4521
|
-
return n === "type" || (t[n] =
|
|
4526
|
+
return n === "type" || (t[n] = Qa(e[n]) ? Object.assign({}, e[n]) : e[n]), t;
|
|
4522
4527
|
}, {});
|
|
4523
4528
|
}
|
|
4524
|
-
function
|
|
4529
|
+
function _s(e, t, n) {
|
|
4525
4530
|
var r = {};
|
|
4526
4531
|
return function(i) {
|
|
4527
4532
|
return function(a) {
|
|
@@ -4538,7 +4543,7 @@ function gs(e, t, n) {
|
|
|
4538
4543
|
fromEnable: !0,
|
|
4539
4544
|
meta: o.meta
|
|
4540
4545
|
}), l === Z.disablePlugin && setTimeout(function() {
|
|
4541
|
-
return
|
|
4546
|
+
return $o(o.meta.rid, { payload: o });
|
|
4542
4547
|
}, 0), l === Z.initializeEnd) {
|
|
4543
4548
|
var f = t(), p = Object.keys(f), m = p.filter(function(e) {
|
|
4544
4549
|
return u.includes(e);
|
|
@@ -4546,14 +4551,14 @@ function gs(e, t, n) {
|
|
|
4546
4551
|
return f[e];
|
|
4547
4552
|
}), h = [], g = [], _ = o.disabled, v = m.map(function(e) {
|
|
4548
4553
|
var t = e.loaded, n = e.name, a = e.config;
|
|
4549
|
-
return
|
|
4554
|
+
return es(e, function() {
|
|
4550
4555
|
return t({ config: a });
|
|
4551
4556
|
}, 1e4).then(function(t) {
|
|
4552
4557
|
return r[n] || (i.dispatch({
|
|
4553
4558
|
type: Z.pluginReadyType(n),
|
|
4554
4559
|
name: n,
|
|
4555
4560
|
events: Object.keys(e).filter(function(e) {
|
|
4556
|
-
return !
|
|
4561
|
+
return !Uo.includes(e);
|
|
4557
4562
|
})
|
|
4558
4563
|
}), r[n] = !0), h = h.concat(n), e;
|
|
4559
4564
|
}).catch(function(e) {
|
|
@@ -4574,14 +4579,14 @@ function gs(e, t, n) {
|
|
|
4574
4579
|
}
|
|
4575
4580
|
var y = function() {
|
|
4576
4581
|
if (l !== Z.bootstrap) return /^ready:([^:]*)$/.test(l) && setTimeout(function() {
|
|
4577
|
-
return
|
|
4582
|
+
return ns(i, t, e);
|
|
4578
4583
|
}, 0), Promise.resolve(function(e, t, n, r, i) {
|
|
4579
4584
|
try {
|
|
4580
|
-
var a =
|
|
4585
|
+
var a = Ga(t) ? t() : t, o = e.type, s = o.replace(is, "");
|
|
4581
4586
|
if (e._ && e._.called) return Promise.resolve(e);
|
|
4582
4587
|
var c = n.getState(), l = (f = a, (p = c.plugins) === void 0 && (p = {}), (m = e.options) === void 0 && (m = {}), Object.keys(f).filter(function(e) {
|
|
4583
4588
|
var t = m.plugins || {};
|
|
4584
|
-
return
|
|
4589
|
+
return Ja(t[e]) ? t[e] : !1 !== t.all && (!p[e] || !1 !== p[e].enabled);
|
|
4585
4590
|
}).map(function(e) {
|
|
4586
4591
|
return f[e];
|
|
4587
4592
|
}));
|
|
@@ -4594,12 +4599,12 @@ function gs(e, t, n) {
|
|
|
4594
4599
|
var u = l.map(function(e) {
|
|
4595
4600
|
return e.name;
|
|
4596
4601
|
}), d = function(e, t) {
|
|
4597
|
-
var n =
|
|
4598
|
-
return
|
|
4602
|
+
var n = us(e).map(function(e) {
|
|
4603
|
+
return ls(e, t);
|
|
4599
4604
|
});
|
|
4600
4605
|
return t.reduce(function(n, r) {
|
|
4601
|
-
var i = r.name, a =
|
|
4602
|
-
return
|
|
4606
|
+
var i = r.name, a = us(e, i).map(function(e) {
|
|
4607
|
+
return ls(e, t);
|
|
4603
4608
|
}), o = a[0], s = a[1], c = a[2];
|
|
4604
4609
|
return o.length && (n.beforeNS[i] = o), s.length && (n.duringNS[i] = s), c.length && (n.afterNS[i] = c), n;
|
|
4605
4610
|
}, {
|
|
@@ -4611,7 +4616,7 @@ function gs(e, t, n) {
|
|
|
4611
4616
|
afterNS: {}
|
|
4612
4617
|
});
|
|
4613
4618
|
}(o, l);
|
|
4614
|
-
return Promise.resolve(
|
|
4619
|
+
return Promise.resolve(rs({
|
|
4615
4620
|
action: e,
|
|
4616
4621
|
data: {
|
|
4617
4622
|
exact: d.before,
|
|
@@ -4626,7 +4631,7 @@ function gs(e, t, n) {
|
|
|
4626
4631
|
})).then(function(e) {
|
|
4627
4632
|
function t() {
|
|
4628
4633
|
var t = function() {
|
|
4629
|
-
if (o.match(
|
|
4634
|
+
if (o.match(is)) return Promise.resolve(rs({
|
|
4630
4635
|
action: X({}, l, { type: s + "End" }),
|
|
4631
4636
|
data: {
|
|
4632
4637
|
exact: d.after,
|
|
@@ -4639,16 +4644,16 @@ function gs(e, t, n) {
|
|
|
4639
4644
|
store: r,
|
|
4640
4645
|
EVENTS: i
|
|
4641
4646
|
})).then(function(e) {
|
|
4642
|
-
e.meta && e.meta.hasCallback &&
|
|
4647
|
+
e.meta && e.meta.hasCallback && $o(e.meta.rid, { payload: e });
|
|
4643
4648
|
});
|
|
4644
4649
|
}();
|
|
4645
4650
|
return t && t.then ? t.then(function() {
|
|
4646
4651
|
return e;
|
|
4647
4652
|
}) : e;
|
|
4648
4653
|
}
|
|
4649
|
-
if (
|
|
4654
|
+
if (fs(e, u.length)) return e;
|
|
4650
4655
|
var l, f = function() {
|
|
4651
|
-
if (o !== s) return Promise.resolve(
|
|
4656
|
+
if (o !== s) return Promise.resolve(rs({
|
|
4652
4657
|
action: X({}, e, { type: s }),
|
|
4653
4658
|
data: {
|
|
4654
4659
|
exact: d.during,
|
|
@@ -4684,7 +4689,7 @@ function gs(e, t, n) {
|
|
|
4684
4689
|
};
|
|
4685
4690
|
};
|
|
4686
4691
|
}
|
|
4687
|
-
function
|
|
4692
|
+
function vs(e) {
|
|
4688
4693
|
return function(t) {
|
|
4689
4694
|
return function(t) {
|
|
4690
4695
|
return function(n) {
|
|
@@ -4698,7 +4703,7 @@ function _s(e) {
|
|
|
4698
4703
|
};
|
|
4699
4704
|
};
|
|
4700
4705
|
}
|
|
4701
|
-
var
|
|
4706
|
+
var ys = function() {
|
|
4702
4707
|
var e = this;
|
|
4703
4708
|
this.before = [], this.after = [], this.addMiddleware = function(t, n) {
|
|
4704
4709
|
e[n] = e[n].concat(t);
|
|
@@ -4719,19 +4724,19 @@ var vs = function() {
|
|
|
4719
4724
|
}, o = e[t].map(function(e) {
|
|
4720
4725
|
return e(a);
|
|
4721
4726
|
});
|
|
4722
|
-
return
|
|
4727
|
+
return Po.apply(void 0, o)(r)(i);
|
|
4723
4728
|
};
|
|
4724
4729
|
};
|
|
4725
4730
|
};
|
|
4726
4731
|
};
|
|
4727
4732
|
};
|
|
4728
|
-
function
|
|
4733
|
+
function bs(e) {
|
|
4729
4734
|
return function(t, n) {
|
|
4730
4735
|
t === void 0 && (t = {});
|
|
4731
4736
|
var r = {};
|
|
4732
4737
|
if (n.type === "initialize:aborted") return t;
|
|
4733
4738
|
if (/^registerPlugin:([^:]*)$/.test(n.type)) {
|
|
4734
|
-
var i =
|
|
4739
|
+
var i = xs(n.type, "registerPlugin"), a = e()[i];
|
|
4735
4740
|
if (!a || !i) return t;
|
|
4736
4741
|
var o = n.enabled, s = a.config;
|
|
4737
4742
|
return r[i] = {
|
|
@@ -4742,7 +4747,7 @@ function ys(e) {
|
|
|
4742
4747
|
}, X({}, t, r);
|
|
4743
4748
|
}
|
|
4744
4749
|
if (/^initialize:([^:]*)$/.test(n.type)) {
|
|
4745
|
-
var c =
|
|
4750
|
+
var c = xs(n.type, Z.initialize), l = e()[c];
|
|
4746
4751
|
return l && c ? (r[c] = X({}, t[c], {
|
|
4747
4752
|
initialized: !0,
|
|
4748
4753
|
loaded: !!l.loaded({ config: l.config })
|
|
@@ -4750,35 +4755,35 @@ function ys(e) {
|
|
|
4750
4755
|
}
|
|
4751
4756
|
if (/^ready:([^:]*)$/.test(n.type)) return r[n.name] = X({}, t[n.name], { loaded: !0 }), X({}, t, r);
|
|
4752
4757
|
switch (n.type) {
|
|
4753
|
-
case Z.disablePlugin: return X({}, t,
|
|
4754
|
-
case Z.enablePlugin: return X({}, t,
|
|
4758
|
+
case Z.disablePlugin: return X({}, t, Ss(n.plugins, !1, t));
|
|
4759
|
+
case Z.enablePlugin: return X({}, t, Ss(n.plugins, !0, t));
|
|
4755
4760
|
default: return t;
|
|
4756
4761
|
}
|
|
4757
4762
|
};
|
|
4758
4763
|
}
|
|
4759
|
-
function
|
|
4764
|
+
function xs(e, t) {
|
|
4760
4765
|
return e.substring(t.length + 1, e.length);
|
|
4761
4766
|
}
|
|
4762
|
-
function
|
|
4767
|
+
function Ss(e, t, n) {
|
|
4763
4768
|
return e.reduce(function(e, r) {
|
|
4764
4769
|
return e[r] = X({}, n[r], { enabled: t }), e;
|
|
4765
4770
|
}, n);
|
|
4766
4771
|
}
|
|
4767
|
-
function
|
|
4772
|
+
function Cs(e) {
|
|
4768
4773
|
try {
|
|
4769
4774
|
return JSON.parse(JSON.stringify(e));
|
|
4770
4775
|
} catch {}
|
|
4771
4776
|
return e;
|
|
4772
4777
|
}
|
|
4773
|
-
var
|
|
4778
|
+
var ws = {
|
|
4774
4779
|
last: {},
|
|
4775
4780
|
history: []
|
|
4776
4781
|
};
|
|
4777
|
-
function
|
|
4778
|
-
e === void 0 && (e =
|
|
4782
|
+
function Ts(e, t) {
|
|
4783
|
+
e === void 0 && (e = ws);
|
|
4779
4784
|
var n = t.options, r = t.meta;
|
|
4780
4785
|
if (t.type === Z.track) {
|
|
4781
|
-
var i =
|
|
4786
|
+
var i = Cs(X({
|
|
4782
4787
|
event: t.event,
|
|
4783
4788
|
properties: t.properties
|
|
4784
4789
|
}, Object.keys(n).length && { options: n }, { meta: r }));
|
|
@@ -4789,9 +4794,9 @@ function ws(e, t) {
|
|
|
4789
4794
|
}
|
|
4790
4795
|
return e;
|
|
4791
4796
|
}
|
|
4792
|
-
var
|
|
4793
|
-
function
|
|
4794
|
-
e === void 0 && (e =
|
|
4797
|
+
var Es = { actions: [] };
|
|
4798
|
+
function Ds(e, t) {
|
|
4799
|
+
e === void 0 && (e = Es);
|
|
4795
4800
|
var n = t.payload;
|
|
4796
4801
|
switch (t.type) {
|
|
4797
4802
|
case "queue":
|
|
@@ -4801,12 +4806,12 @@ function Es(e, t) {
|
|
|
4801
4806
|
default: return e;
|
|
4802
4807
|
}
|
|
4803
4808
|
}
|
|
4804
|
-
var
|
|
4805
|
-
function
|
|
4809
|
+
var Os = /#.*$/;
|
|
4810
|
+
function ks(e) {
|
|
4806
4811
|
var t = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);
|
|
4807
|
-
return "/" + (t && t[3] ? t[3].split("?")[0].replace(
|
|
4812
|
+
return "/" + (t && t[3] ? t[3].split("?")[0].replace(Os, "") : "");
|
|
4808
4813
|
}
|
|
4809
|
-
var
|
|
4814
|
+
var As, js, Ms, Ns, Ps = function(e) {
|
|
4810
4815
|
if (e === void 0 && (e = {}), !Y) return e;
|
|
4811
4816
|
var t = document, n = t.title, r = t.referrer, i = window, a = i.location, o = i.innerWidth, s = i.innerHeight, c = a.hash, l = a.search, u = function(e) {
|
|
4812
4817
|
var t = function() {
|
|
@@ -4814,26 +4819,26 @@ var ks, As, js, Ms, Ns = function(e) {
|
|
|
4814
4819
|
for (var e, t = document.getElementsByTagName("link"), n = 0; e = t[n]; n++) if (e.getAttribute("rel") === "canonical") return e.getAttribute("href");
|
|
4815
4820
|
}
|
|
4816
4821
|
}();
|
|
4817
|
-
return t ? t.match(/\?/) ? t : t + e : window.location.href.replace(
|
|
4822
|
+
return t ? t.match(/\?/) ? t : t + e : window.location.href.replace(Os, "");
|
|
4818
4823
|
}(l), d = {
|
|
4819
4824
|
title: n,
|
|
4820
4825
|
url: u,
|
|
4821
|
-
path:
|
|
4826
|
+
path: ks(u),
|
|
4822
4827
|
hash: c,
|
|
4823
4828
|
search: l,
|
|
4824
4829
|
width: o,
|
|
4825
4830
|
height: s
|
|
4826
4831
|
};
|
|
4827
4832
|
return r && r !== "" && (d.referrer = r), X({}, d, e);
|
|
4828
|
-
},
|
|
4833
|
+
}, Fs = {
|
|
4829
4834
|
last: {},
|
|
4830
4835
|
history: []
|
|
4831
4836
|
};
|
|
4832
|
-
function
|
|
4833
|
-
e === void 0 && (e =
|
|
4837
|
+
function Is(e, t) {
|
|
4838
|
+
e === void 0 && (e = Fs);
|
|
4834
4839
|
var n = t.options;
|
|
4835
4840
|
if (t.type === Z.page) {
|
|
4836
|
-
var r =
|
|
4841
|
+
var r = Cs(X({
|
|
4837
4842
|
properties: t.properties,
|
|
4838
4843
|
meta: t.meta
|
|
4839
4844
|
}, Object.keys(n).length && { options: n }));
|
|
@@ -4844,45 +4849,45 @@ function Fs(e, t) {
|
|
|
4844
4849
|
}
|
|
4845
4850
|
return e;
|
|
4846
4851
|
}
|
|
4847
|
-
|
|
4852
|
+
As = function() {
|
|
4848
4853
|
if (!Y) return !1;
|
|
4849
4854
|
var e = navigator.appVersion;
|
|
4850
4855
|
return ~e.indexOf("Win") ? "Windows" : ~e.indexOf("Mac") ? "MacOS" : ~e.indexOf("X11") ? "UNIX" : ~e.indexOf("Linux") ? "Linux" : "Unknown OS";
|
|
4851
|
-
}(),
|
|
4852
|
-
var
|
|
4856
|
+
}(), js = Y ? document.referrer : null, Ms = co(), Ns = lo();
|
|
4857
|
+
var Ls = {
|
|
4853
4858
|
initialized: !1,
|
|
4854
|
-
sessionId:
|
|
4859
|
+
sessionId: po(),
|
|
4855
4860
|
app: null,
|
|
4856
4861
|
version: null,
|
|
4857
4862
|
debug: !1,
|
|
4858
4863
|
offline: !!Y && !navigator.onLine,
|
|
4859
|
-
os: { name:
|
|
4864
|
+
os: { name: As },
|
|
4860
4865
|
userAgent: Y ? navigator.userAgent : "node",
|
|
4861
4866
|
library: {
|
|
4862
|
-
name:
|
|
4867
|
+
name: zo,
|
|
4863
4868
|
version: "0.13.1"
|
|
4864
4869
|
},
|
|
4865
|
-
timezone:
|
|
4866
|
-
locale:
|
|
4870
|
+
timezone: Ns,
|
|
4871
|
+
locale: Ms,
|
|
4867
4872
|
campaign: {},
|
|
4868
|
-
referrer:
|
|
4873
|
+
referrer: js
|
|
4869
4874
|
};
|
|
4870
|
-
function
|
|
4871
|
-
e === void 0 && (e =
|
|
4875
|
+
function Rs(e, t) {
|
|
4876
|
+
e === void 0 && (e = Ls);
|
|
4872
4877
|
var n = e.initialized, r = t.campaign;
|
|
4873
4878
|
switch (t.type) {
|
|
4874
4879
|
case Z.campaign: return X({}, e, { campaign: r });
|
|
4875
4880
|
case Z.offline: return X({}, e, { offline: !0 });
|
|
4876
4881
|
case Z.online: return X({}, e, { offline: !1 });
|
|
4877
|
-
default: return n ? e : X({},
|
|
4882
|
+
default: return n ? e : X({}, Ls, e, { initialized: !0 });
|
|
4878
4883
|
}
|
|
4879
4884
|
}
|
|
4880
|
-
var
|
|
4885
|
+
var zs = [
|
|
4881
4886
|
"plugins",
|
|
4882
4887
|
"reducers",
|
|
4883
4888
|
"storage"
|
|
4884
4889
|
];
|
|
4885
|
-
function
|
|
4890
|
+
function Bs(e, t, n) {
|
|
4886
4891
|
if (Y) {
|
|
4887
4892
|
var r = window[(n ? "add" : "remove") + "EventListener"];
|
|
4888
4893
|
e.split(" ").forEach(function(e) {
|
|
@@ -4890,37 +4895,37 @@ function zs(e, t, n) {
|
|
|
4890
4895
|
});
|
|
4891
4896
|
}
|
|
4892
4897
|
}
|
|
4893
|
-
function
|
|
4894
|
-
var t =
|
|
4898
|
+
function Vs(e) {
|
|
4899
|
+
var t = Bs.bind(null, "online offline", function(t) {
|
|
4895
4900
|
return Promise.resolve(!navigator.onLine).then(e);
|
|
4896
4901
|
});
|
|
4897
4902
|
return t(!0), function(e) {
|
|
4898
4903
|
return t(!1);
|
|
4899
4904
|
};
|
|
4900
4905
|
}
|
|
4901
|
-
function
|
|
4902
|
-
return
|
|
4906
|
+
function Hs() {
|
|
4907
|
+
return yo(zo, []), function(e) {
|
|
4903
4908
|
return function(t, n, r) {
|
|
4904
4909
|
var i = e(t, n, r), a = i.dispatch;
|
|
4905
4910
|
return Object.assign(i, { dispatch: function(e) {
|
|
4906
|
-
return go
|
|
4911
|
+
return _o[go][zo].push(e.action || e), a(e);
|
|
4907
4912
|
} });
|
|
4908
4913
|
};
|
|
4909
4914
|
};
|
|
4910
4915
|
}
|
|
4911
|
-
function
|
|
4916
|
+
function Us(e) {
|
|
4912
4917
|
return function() {
|
|
4913
|
-
return
|
|
4918
|
+
return Po(Po.apply(null, arguments), Hs());
|
|
4914
4919
|
};
|
|
4915
4920
|
}
|
|
4916
|
-
function
|
|
4917
|
-
return e ?
|
|
4921
|
+
function Ws(e) {
|
|
4922
|
+
return e ? Za(e) ? e : [e] : [];
|
|
4918
4923
|
}
|
|
4919
|
-
function
|
|
4924
|
+
function Gs(e, t, n) {
|
|
4920
4925
|
e === void 0 && (e = {});
|
|
4921
|
-
var r, i, a =
|
|
4922
|
-
return t && (
|
|
4923
|
-
for (var t, n = e || Array.prototype.slice.call(arguments), r = 0; r < n.length; r++) if (
|
|
4926
|
+
var r, i, a = po();
|
|
4927
|
+
return t && (Qo[a] = (r = t, i = function(e) {
|
|
4928
|
+
for (var t, n = e || Array.prototype.slice.call(arguments), r = 0; r < n.length; r++) if (Ga(n[r])) {
|
|
4924
4929
|
t = n[r];
|
|
4925
4930
|
break;
|
|
4926
4931
|
}
|
|
@@ -4932,10 +4937,10 @@ function Ws(e, t, n) {
|
|
|
4932
4937
|
ts: (/* @__PURE__ */ new Date()).getTime()
|
|
4933
4938
|
}, t ? { hasCallback: !0 } : {});
|
|
4934
4939
|
}
|
|
4935
|
-
function
|
|
4940
|
+
function Ks(e) {
|
|
4936
4941
|
e === void 0 && (e = {});
|
|
4937
4942
|
var t = e.reducers || {}, n = e.initialUser || {}, r = (e.plugins || []).reduce(function(e, t) {
|
|
4938
|
-
if (
|
|
4943
|
+
if (Ga(t)) return e.middlewares = e.middlewares.concat(t), e;
|
|
4939
4944
|
if (t.NAMESPACE && (t.name = t.NAMESPACE), !t.name) throw Error("https://lytics.dev/errors/1");
|
|
4940
4945
|
t.config ||= {};
|
|
4941
4946
|
var n = t.EVENTS ? Object.keys(t.EVENTS).map(function(e) {
|
|
@@ -4961,29 +4966,29 @@ function Gs(e) {
|
|
|
4961
4966
|
middlewares: [],
|
|
4962
4967
|
events: []
|
|
4963
4968
|
}), i = e.storage ? e.storage : {
|
|
4964
|
-
getItem:
|
|
4965
|
-
setItem:
|
|
4966
|
-
removeItem:
|
|
4969
|
+
getItem: vo,
|
|
4970
|
+
setItem: yo,
|
|
4971
|
+
removeItem: bo
|
|
4967
4972
|
}, a = function(e) {
|
|
4968
4973
|
return function(t, n, r) {
|
|
4969
|
-
return n.getState("user")[t] || (r &&
|
|
4974
|
+
return n.getState("user")[t] || (r && Qa(r) && r[t] ? r[t] : Yo(e)[t] || vo(Xo(t)) || null);
|
|
4970
4975
|
};
|
|
4971
4976
|
}(i), o = r.plugins, s = r.events.filter(function(e) {
|
|
4972
|
-
return !
|
|
4973
|
-
}).sort(), c = new Set(s.concat(
|
|
4974
|
-
return !
|
|
4977
|
+
return !Uo.includes(e);
|
|
4978
|
+
}).sort(), c = new Set(s.concat(Ho).filter(function(e) {
|
|
4979
|
+
return !Uo.includes(e);
|
|
4975
4980
|
})), l = Array.from(c).sort(), u = function() {
|
|
4976
4981
|
return o;
|
|
4977
|
-
}, d = new
|
|
4982
|
+
}, d = new ys(), f = d.addMiddleware, p = d.removeMiddleware, m = d.dynamicMiddlewares, h = function() {
|
|
4978
4983
|
throw Error("Abort disabled inListener");
|
|
4979
|
-
}, g =
|
|
4980
|
-
v.anonymousId ||=
|
|
4984
|
+
}, g = uo(), _ = Yo(i), v = X({}, _, n, g.an_uid ? { userId: g.an_uid } : {}, g.an_aid ? { anonymousId: g.an_aid } : {});
|
|
4985
|
+
v.anonymousId ||= po();
|
|
4981
4986
|
var y = X({
|
|
4982
4987
|
enable: function(e, t) {
|
|
4983
4988
|
return new Promise(function(n) {
|
|
4984
4989
|
A.dispatch({
|
|
4985
4990
|
type: Z.enablePlugin,
|
|
4986
|
-
plugins:
|
|
4991
|
+
plugins: Ws(e),
|
|
4987
4992
|
_: { originalAction: Z.enablePlugin }
|
|
4988
4993
|
}, n, [t]);
|
|
4989
4994
|
});
|
|
@@ -4992,7 +4997,7 @@ function Gs(e) {
|
|
|
4992
4997
|
return new Promise(function(n) {
|
|
4993
4998
|
A.dispatch({
|
|
4994
4999
|
type: Z.disablePlugin,
|
|
4995
|
-
plugins:
|
|
5000
|
+
plugins: Ws(e),
|
|
4996
5001
|
_: { originalAction: Z.disablePlugin }
|
|
4997
5002
|
}, n, [t]);
|
|
4998
5003
|
});
|
|
@@ -5000,9 +5005,9 @@ function Gs(e) {
|
|
|
5000
5005
|
}, r.methods), b = !1, x = {
|
|
5001
5006
|
identify: function(e, t, n, r) {
|
|
5002
5007
|
try {
|
|
5003
|
-
var i =
|
|
5004
|
-
|
|
5005
|
-
var l = i || o.userId || a(
|
|
5008
|
+
var i = Ka(e) ? e : null, o = Qa(e) ? e : t, s = n || {}, c = x.user();
|
|
5009
|
+
yo(Xo(Bo), i);
|
|
5010
|
+
var l = i || o.userId || a(Bo, x, o);
|
|
5006
5011
|
return Promise.resolve(new Promise(function(e) {
|
|
5007
5012
|
A.dispatch(X({
|
|
5008
5013
|
type: Z.identifyStart,
|
|
@@ -5022,17 +5027,17 @@ function Gs(e) {
|
|
|
5022
5027
|
},
|
|
5023
5028
|
track: function(e, t, n, r) {
|
|
5024
5029
|
try {
|
|
5025
|
-
var i =
|
|
5026
|
-
if (!i || !
|
|
5027
|
-
var o =
|
|
5030
|
+
var i = Qa(e) ? e.event : e;
|
|
5031
|
+
if (!i || !Ka(i)) throw Error("EventMissing");
|
|
5032
|
+
var o = Qa(e) ? e : t || {}, s = Qa(n) ? n : {};
|
|
5028
5033
|
return Promise.resolve(new Promise(function(e) {
|
|
5029
5034
|
A.dispatch({
|
|
5030
5035
|
type: Z.trackStart,
|
|
5031
5036
|
event: i,
|
|
5032
5037
|
properties: o,
|
|
5033
5038
|
options: s,
|
|
5034
|
-
userId: a(
|
|
5035
|
-
anonymousId: a(
|
|
5039
|
+
userId: a(Bo, x, t),
|
|
5040
|
+
anonymousId: a(Vo, x, t)
|
|
5036
5041
|
}, e, [
|
|
5037
5042
|
t,
|
|
5038
5043
|
n,
|
|
@@ -5045,14 +5050,14 @@ function Gs(e) {
|
|
|
5045
5050
|
},
|
|
5046
5051
|
page: function(e, t, n) {
|
|
5047
5052
|
try {
|
|
5048
|
-
var r =
|
|
5053
|
+
var r = Qa(e) ? e : {}, i = Qa(t) ? t : {};
|
|
5049
5054
|
return Promise.resolve(new Promise(function(o) {
|
|
5050
5055
|
A.dispatch({
|
|
5051
5056
|
type: Z.pageStart,
|
|
5052
|
-
properties:
|
|
5057
|
+
properties: Ps(r),
|
|
5053
5058
|
options: i,
|
|
5054
|
-
userId: a(
|
|
5055
|
-
anonymousId: a(
|
|
5059
|
+
userId: a(Bo, x, r),
|
|
5060
|
+
anonymousId: a(Vo, x, r)
|
|
5056
5061
|
}, o, [
|
|
5057
5062
|
e,
|
|
5058
5063
|
t,
|
|
@@ -5064,10 +5069,10 @@ function Gs(e) {
|
|
|
5064
5069
|
}
|
|
5065
5070
|
},
|
|
5066
5071
|
user: function(e) {
|
|
5067
|
-
if (e ===
|
|
5068
|
-
if (e ===
|
|
5072
|
+
if (e === Bo || e === "id") return a(Bo, x);
|
|
5073
|
+
if (e === Vo || e === "anonId") return a(Vo, x);
|
|
5069
5074
|
var t = x.getState("user");
|
|
5070
|
-
return e ? (0,
|
|
5075
|
+
return e ? (0, Ta.default)(t, e) : t;
|
|
5071
5076
|
},
|
|
5072
5077
|
reset: function(e) {
|
|
5073
5078
|
return new Promise(function(t) {
|
|
@@ -5083,7 +5088,7 @@ function Gs(e) {
|
|
|
5083
5088
|
});
|
|
5084
5089
|
},
|
|
5085
5090
|
on: function(e, t) {
|
|
5086
|
-
if (!e || !
|
|
5091
|
+
if (!e || !Ga(t)) return !1;
|
|
5087
5092
|
if (e === Z.bootstrap) throw Error(".on disabled for " + e);
|
|
5088
5093
|
var n = /Start$|Start:/;
|
|
5089
5094
|
if (e === "*") {
|
|
@@ -5108,11 +5113,11 @@ function Gs(e) {
|
|
|
5108
5113
|
};
|
|
5109
5114
|
};
|
|
5110
5115
|
};
|
|
5111
|
-
return f(r,
|
|
5112
|
-
p(r,
|
|
5116
|
+
return f(r, qs), f(i, Js), function() {
|
|
5117
|
+
p(r, qs), p(i, Js);
|
|
5113
5118
|
};
|
|
5114
5119
|
}
|
|
5115
|
-
var a = e.match(n) ?
|
|
5120
|
+
var a = e.match(n) ? qs : Js, s = function(n) {
|
|
5116
5121
|
return function(n) {
|
|
5117
5122
|
return function(r) {
|
|
5118
5123
|
return r.type === e && t({
|
|
@@ -5129,7 +5134,7 @@ function Gs(e) {
|
|
|
5129
5134
|
};
|
|
5130
5135
|
},
|
|
5131
5136
|
once: function(e, t) {
|
|
5132
|
-
if (!e || !
|
|
5137
|
+
if (!e || !Ga(t)) return !1;
|
|
5133
5138
|
if (e === Z.bootstrap) throw Error(".once disabled for " + e);
|
|
5134
5139
|
var n = x.on(e, function(e) {
|
|
5135
5140
|
t({
|
|
@@ -5143,11 +5148,11 @@ function Gs(e) {
|
|
|
5143
5148
|
},
|
|
5144
5149
|
getState: function(e) {
|
|
5145
5150
|
var t = A.getState();
|
|
5146
|
-
return e ? (0,
|
|
5151
|
+
return e ? (0, Ta.default)(t, e) : Object.assign({}, t);
|
|
5147
5152
|
},
|
|
5148
5153
|
dispatch: function(e) {
|
|
5149
|
-
var t =
|
|
5150
|
-
if (
|
|
5154
|
+
var t = Ka(e) ? { type: e } : e;
|
|
5155
|
+
if (Ho.includes(t.type)) throw Error("reserved action " + t.type);
|
|
5151
5156
|
var n = X({}, t, { _: X({ originalAction: t.type }, e._ || {}) });
|
|
5152
5157
|
A.dispatch(n);
|
|
5153
5158
|
},
|
|
@@ -5173,49 +5178,49 @@ function Gs(e) {
|
|
|
5173
5178
|
}
|
|
5174
5179
|
},
|
|
5175
5180
|
setAnonymousId: function(e, t) {
|
|
5176
|
-
x.storage.setItem(
|
|
5181
|
+
x.storage.setItem(Io, e, t);
|
|
5177
5182
|
},
|
|
5178
5183
|
events: {
|
|
5179
|
-
core:
|
|
5184
|
+
core: Ho,
|
|
5180
5185
|
plugins: s
|
|
5181
5186
|
}
|
|
5182
5187
|
}, S = r.middlewares.concat([
|
|
5183
5188
|
function(e) {
|
|
5184
5189
|
return function(e) {
|
|
5185
5190
|
return function(t) {
|
|
5186
|
-
return t.meta ||=
|
|
5191
|
+
return t.meta ||= Gs(), e(t);
|
|
5187
5192
|
};
|
|
5188
5193
|
};
|
|
5189
5194
|
},
|
|
5190
|
-
m(
|
|
5191
|
-
|
|
5195
|
+
m(qs),
|
|
5196
|
+
_s(x, u, {
|
|
5192
5197
|
all: l,
|
|
5193
5198
|
plugins: s
|
|
5194
5199
|
}),
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
m(
|
|
5200
|
+
vs(i),
|
|
5201
|
+
qo(x),
|
|
5202
|
+
Zo(x),
|
|
5203
|
+
m(Js)
|
|
5199
5204
|
]), C = {
|
|
5200
|
-
context:
|
|
5201
|
-
user:
|
|
5202
|
-
page:
|
|
5203
|
-
track:
|
|
5204
|
-
plugins:
|
|
5205
|
-
queue:
|
|
5206
|
-
}, w =
|
|
5205
|
+
context: Rs,
|
|
5206
|
+
user: Jo(i),
|
|
5207
|
+
page: Is,
|
|
5208
|
+
track: Ts,
|
|
5209
|
+
plugins: bs(u),
|
|
5210
|
+
queue: Ds
|
|
5211
|
+
}, w = Po, T = Po;
|
|
5207
5212
|
if (Y && e.debug) {
|
|
5208
5213
|
var E = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
|
|
5209
5214
|
E && (w = E({
|
|
5210
5215
|
trace: !0,
|
|
5211
5216
|
traceLimit: 25
|
|
5212
5217
|
})), T = function() {
|
|
5213
|
-
return arguments.length === 0 ?
|
|
5218
|
+
return arguments.length === 0 ? Hs() : Qa(typeof arguments[0]) ? Us() : Us().apply(null, arguments);
|
|
5214
5219
|
};
|
|
5215
5220
|
}
|
|
5216
5221
|
var D, O = function(e) {
|
|
5217
5222
|
return Object.keys(e).reduce(function(t, n) {
|
|
5218
|
-
return
|
|
5223
|
+
return zs.includes(n) || (t[n] = e[n]), t;
|
|
5219
5224
|
}, {});
|
|
5220
5225
|
}(e), k = {
|
|
5221
5226
|
context: O,
|
|
@@ -5229,17 +5234,17 @@ function Gs(e) {
|
|
|
5229
5234
|
config: i
|
|
5230
5235
|
}, e;
|
|
5231
5236
|
}, {})
|
|
5232
|
-
}, A =
|
|
5237
|
+
}, A = Mo(function(e) {
|
|
5233
5238
|
for (var t = Object.keys(e), n = {}, r = 0; r < t.length; r++) {
|
|
5234
5239
|
var i = t[r];
|
|
5235
|
-
typeof e[i] ===
|
|
5240
|
+
typeof e[i] === wo && (n[i] = e[i]);
|
|
5236
5241
|
}
|
|
5237
5242
|
var a, o = Object.keys(n);
|
|
5238
5243
|
try {
|
|
5239
5244
|
(function(e) {
|
|
5240
5245
|
Object.keys(e).forEach(function(t) {
|
|
5241
5246
|
var n = e[t];
|
|
5242
|
-
if (typeof n(void 0, { type:
|
|
5247
|
+
if (typeof n(void 0, { type: Oo }) === To || typeof n(void 0, { type: ko }) === To) throw Error(Eo + " " + t + " " + To);
|
|
5243
5248
|
});
|
|
5244
5249
|
})(n);
|
|
5245
5250
|
} catch (e) {
|
|
@@ -5249,17 +5254,17 @@ function Gs(e) {
|
|
|
5249
5254
|
if (e === void 0 && (e = {}), a) throw a;
|
|
5250
5255
|
for (var r = !1, i = {}, s = 0; s < o.length; s++) {
|
|
5251
5256
|
var c = o[s], l = e[c], u = (0, n[c])(l, t);
|
|
5252
|
-
if (typeof u ===
|
|
5253
|
-
var d =
|
|
5257
|
+
if (typeof u === To) {
|
|
5258
|
+
var d = No(c, t);
|
|
5254
5259
|
throw Error(d);
|
|
5255
5260
|
}
|
|
5256
5261
|
i[c] = u, r ||= u !== l;
|
|
5257
5262
|
}
|
|
5258
5263
|
return r ? i : e;
|
|
5259
5264
|
};
|
|
5260
|
-
}(X({}, C, t)), k, T(w(
|
|
5265
|
+
}(X({}, C, t)), k, T(w(Fo.apply(void 0, S))));
|
|
5261
5266
|
A.dispatch = (D = A.dispatch, function(e, t, n) {
|
|
5262
|
-
var r = X({}, e, { meta:
|
|
5267
|
+
var r = X({}, e, { meta: Gs(e.meta, t, Ws(n)) });
|
|
5263
5268
|
return D.apply(null, [r]);
|
|
5264
5269
|
});
|
|
5265
5270
|
var j = Object.keys(o);
|
|
@@ -5283,7 +5288,7 @@ function Gs(e) {
|
|
|
5283
5288
|
enabled: r.pluginEnabled
|
|
5284
5289
|
}), r.pluginsArray.map(function(e, t) {
|
|
5285
5290
|
var n = e.bootstrap, i = e.config, a = e.name;
|
|
5286
|
-
n &&
|
|
5291
|
+
n && Ga(n) && n({
|
|
5287
5292
|
instance: x,
|
|
5288
5293
|
config: i,
|
|
5289
5294
|
payload: e
|
|
@@ -5297,64 +5302,64 @@ function Gs(e) {
|
|
|
5297
5302
|
plugins: M,
|
|
5298
5303
|
disabled: N
|
|
5299
5304
|
});
|
|
5300
|
-
}),
|
|
5305
|
+
}), Vs(function(e) {
|
|
5301
5306
|
A.dispatch({ type: e ? Z.offline : Z.online });
|
|
5302
5307
|
}), function(e, t, n) {
|
|
5303
5308
|
setInterval(function() {
|
|
5304
|
-
return
|
|
5309
|
+
return ns(e, t, n);
|
|
5305
5310
|
}, 3e3);
|
|
5306
5311
|
}(A, u, x), x;
|
|
5307
5312
|
}
|
|
5308
|
-
var
|
|
5309
|
-
function
|
|
5310
|
-
return
|
|
5313
|
+
var qs = "before", Js = "after", Ys = "cookie", Xs = ec(), Zs = tc, Qs = tc;
|
|
5314
|
+
function $s(e) {
|
|
5315
|
+
return Xs ? tc(e, "", -1) : bo(e);
|
|
5311
5316
|
}
|
|
5312
|
-
function
|
|
5313
|
-
if (
|
|
5314
|
-
var e =
|
|
5317
|
+
function ec() {
|
|
5318
|
+
if (Xs !== void 0) return Xs;
|
|
5319
|
+
var e = Ys + Ys;
|
|
5315
5320
|
try {
|
|
5316
|
-
|
|
5321
|
+
tc(e, e), Xs = document.cookie.indexOf(e) !== -1, $s(e);
|
|
5317
5322
|
} catch {
|
|
5318
|
-
|
|
5323
|
+
Xs = !1;
|
|
5319
5324
|
}
|
|
5320
|
-
return
|
|
5325
|
+
return Xs;
|
|
5321
5326
|
}
|
|
5322
|
-
function
|
|
5327
|
+
function tc(e, t, n, r, i, a) {
|
|
5323
5328
|
if (typeof window < "u") {
|
|
5324
5329
|
var o = arguments.length > 1;
|
|
5325
|
-
return !1 ===
|
|
5330
|
+
return !1 === Xs && (o ? yo(e, t) : vo(e)), o ? document.cookie = e + "=" + encodeURIComponent(t) + (n ? "; expires=" + (/* @__PURE__ */ new Date(+/* @__PURE__ */ new Date() + 1e3 * n)).toUTCString() + (r ? "; path=" + r : "") + (i ? "; domain=" + i : "") + (a ? "; secure" : "") : "") : decodeURIComponent((("; " + document.cookie).split("; " + e + "=")[1] || "").split(";")[0]);
|
|
5326
5331
|
}
|
|
5327
5332
|
}
|
|
5328
5333
|
//#endregion
|
|
5329
5334
|
//#region ../../node_modules/.pnpm/@analytics+localstorage-utils@0.1.12/node_modules/@analytics/localstorage-utils/dist/analytics-util-localstorage.module.js
|
|
5330
|
-
var
|
|
5331
|
-
|
|
5335
|
+
var nc = "localStorage", rc = Co.bind(null, nc);
|
|
5336
|
+
xo(nc, "getItem", vo), xo(nc, "setItem", yo), xo(nc, "removeItem", bo);
|
|
5332
5337
|
//#endregion
|
|
5333
5338
|
//#region ../../node_modules/.pnpm/@analytics+session-storage-utils@0.0.9/node_modules/@analytics/session-storage-utils/dist/analytics-util-session-storage.module.js
|
|
5334
|
-
var
|
|
5335
|
-
|
|
5339
|
+
var ic = "sessionStorage", ac = Co.bind(null, ic);
|
|
5340
|
+
xo(ic, "getItem", vo), xo(ic, "setItem", yo), xo(ic, "removeItem", bo);
|
|
5336
5341
|
//#endregion
|
|
5337
5342
|
//#region ../../node_modules/.pnpm/@analytics+storage-utils@0.4.4/node_modules/@analytics/storage-utils/dist/analytics-util-storage.module.js
|
|
5338
|
-
function
|
|
5343
|
+
function oc(e) {
|
|
5339
5344
|
var t = e;
|
|
5340
5345
|
try {
|
|
5341
5346
|
if ((t = JSON.parse(e)) === "true") return !0;
|
|
5342
5347
|
if (t === "false") return !1;
|
|
5343
|
-
if (
|
|
5348
|
+
if (Qa(t)) return t;
|
|
5344
5349
|
parseFloat(t) === t && (t = parseFloat(t));
|
|
5345
5350
|
} catch {}
|
|
5346
5351
|
if (t !== null && t !== "") return t;
|
|
5347
5352
|
}
|
|
5348
|
-
var
|
|
5349
|
-
function
|
|
5353
|
+
var sc = rc(), cc = ac(), lc = ec();
|
|
5354
|
+
function uc(e, t) {
|
|
5350
5355
|
if (e) {
|
|
5351
|
-
var n =
|
|
5352
|
-
if (r && !
|
|
5353
|
-
var a =
|
|
5356
|
+
var n = pc(t), r = !_c(n), i = mc(n) ? oc(localStorage.getItem(e)) : void 0;
|
|
5357
|
+
if (r && !qa(i)) return i;
|
|
5358
|
+
var a = hc(n) ? oc(Zs(e)) : void 0;
|
|
5354
5359
|
if (r && a) return a;
|
|
5355
|
-
var o =
|
|
5360
|
+
var o = gc(n) ? oc(sessionStorage.getItem(e)) : void 0;
|
|
5356
5361
|
if (r && o) return o;
|
|
5357
|
-
var s =
|
|
5362
|
+
var s = vo(e);
|
|
5358
5363
|
return r ? s : {
|
|
5359
5364
|
localStorage: i,
|
|
5360
5365
|
sessionStorage: o,
|
|
@@ -5363,51 +5368,51 @@ function lc(e, t) {
|
|
|
5363
5368
|
};
|
|
5364
5369
|
}
|
|
5365
5370
|
}
|
|
5366
|
-
function
|
|
5367
|
-
if (e && !
|
|
5368
|
-
var r = {}, i =
|
|
5369
|
-
return
|
|
5371
|
+
function dc(e, t, n) {
|
|
5372
|
+
if (e && !qa(t)) {
|
|
5373
|
+
var r = {}, i = pc(n), a = JSON.stringify(t), o = !_c(i);
|
|
5374
|
+
return mc(i) && (r.localStorage = yc("localStorage", t, oc(localStorage.getItem(e))), localStorage.setItem(e, a), o) ? r[nc] : hc(i) && (r.cookie = yc("cookie", t, oc(Zs(e))), Qs(e, a), o) ? r[Ys] : gc(i) && (r.sessionStorage = yc("sessionStorage", t, oc(sessionStorage.getItem(e))), sessionStorage.setItem(e, a), o) ? r[ic] : (r[ho] = yc(ho, t, vo(e)), yo(e, t), o ? r[ho] : r);
|
|
5370
5375
|
}
|
|
5371
5376
|
}
|
|
5372
|
-
function
|
|
5377
|
+
function fc(e, t) {
|
|
5373
5378
|
if (e) {
|
|
5374
|
-
var n =
|
|
5375
|
-
return !
|
|
5379
|
+
var n = pc(t), r = uc(e, "*"), i = {};
|
|
5380
|
+
return !qa(r.localStorage) && mc(n) && (localStorage.removeItem(e), i.localStorage = r.localStorage), !qa(r.cookie) && hc(n) && ($s(e), i.cookie = r.cookie), !qa(r.sessionStorage) && gc(n) && (sessionStorage.removeItem(e), i.sessionStorage = r.sessionStorage), !qa(r.global) && vc(n, "global") && (bo(e), i.global = r.global), i;
|
|
5376
5381
|
}
|
|
5377
5382
|
}
|
|
5378
|
-
function fc(e) {
|
|
5379
|
-
return e ? Ga(e) ? e : e.storage : "any";
|
|
5380
|
-
}
|
|
5381
5383
|
function pc(e) {
|
|
5382
|
-
return
|
|
5384
|
+
return e ? Ka(e) ? e : e.storage : "any";
|
|
5383
5385
|
}
|
|
5384
5386
|
function mc(e) {
|
|
5385
|
-
return
|
|
5387
|
+
return sc && vc(e, "localStorage");
|
|
5386
5388
|
}
|
|
5387
5389
|
function hc(e) {
|
|
5388
|
-
return
|
|
5390
|
+
return lc && vc(e, "cookie");
|
|
5389
5391
|
}
|
|
5390
5392
|
function gc(e) {
|
|
5393
|
+
return cc && vc(e, "sessionStorage");
|
|
5394
|
+
}
|
|
5395
|
+
function _c(e) {
|
|
5391
5396
|
return e === "*" || e === "all";
|
|
5392
5397
|
}
|
|
5393
|
-
function
|
|
5394
|
-
return e === "any" || e === t ||
|
|
5398
|
+
function vc(e, t) {
|
|
5399
|
+
return e === "any" || e === t || _c(e);
|
|
5395
5400
|
}
|
|
5396
|
-
function
|
|
5401
|
+
function yc(e, t, n) {
|
|
5397
5402
|
return {
|
|
5398
5403
|
location: e,
|
|
5399
5404
|
current: t,
|
|
5400
5405
|
previous: n
|
|
5401
5406
|
};
|
|
5402
5407
|
}
|
|
5403
|
-
var
|
|
5404
|
-
setItem:
|
|
5405
|
-
getItem:
|
|
5406
|
-
removeItem:
|
|
5408
|
+
var bc = {
|
|
5409
|
+
setItem: dc,
|
|
5410
|
+
getItem: uc,
|
|
5411
|
+
removeItem: fc
|
|
5407
5412
|
};
|
|
5408
5413
|
//#endregion
|
|
5409
5414
|
//#region ../../node_modules/.pnpm/analytics@0.8.19_@types+dlv@1.1.5/node_modules/analytics/lib/analytics.browser.es.js
|
|
5410
|
-
function
|
|
5415
|
+
function xc(e, t, n) {
|
|
5411
5416
|
return t in e ? Object.defineProperty(e, t, {
|
|
5412
5417
|
value: n,
|
|
5413
5418
|
enumerable: !0,
|
|
@@ -5415,7 +5420,7 @@ function bc(e, t, n) {
|
|
|
5415
5420
|
writable: !0
|
|
5416
5421
|
}) : e[t] = n, e;
|
|
5417
5422
|
}
|
|
5418
|
-
function
|
|
5423
|
+
function Sc(e, t) {
|
|
5419
5424
|
var n = Object.keys(e);
|
|
5420
5425
|
if (Object.getOwnPropertySymbols) {
|
|
5421
5426
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -5425,27 +5430,27 @@ function xc(e, t) {
|
|
|
5425
5430
|
}
|
|
5426
5431
|
return n;
|
|
5427
5432
|
}
|
|
5428
|
-
function
|
|
5433
|
+
function Cc(e) {
|
|
5429
5434
|
for (var t = 1; t < arguments.length; t++) {
|
|
5430
5435
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
5431
|
-
t % 2 ?
|
|
5432
|
-
|
|
5433
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
5436
|
+
t % 2 ? Sc(Object(n), !0).forEach(function(t) {
|
|
5437
|
+
xc(e, t, n[t]);
|
|
5438
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Sc(Object(n)).forEach(function(t) {
|
|
5434
5439
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
5435
5440
|
});
|
|
5436
5441
|
}
|
|
5437
5442
|
return e;
|
|
5438
5443
|
}
|
|
5439
|
-
function
|
|
5444
|
+
function wc() {
|
|
5440
5445
|
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
5441
|
-
return
|
|
5446
|
+
return Ks(Cc(Cc({}, { storage: bc }), e));
|
|
5442
5447
|
}
|
|
5443
5448
|
//#endregion
|
|
5444
5449
|
//#region package.json
|
|
5445
|
-
var
|
|
5450
|
+
var Tc = "@sesamy/sesamy-js", Ec = "1.125.4";
|
|
5446
5451
|
//#endregion
|
|
5447
5452
|
//#region src/services/analytics/listeners/route.ts
|
|
5448
|
-
function
|
|
5453
|
+
function Dc(e) {
|
|
5449
5454
|
if (typeof window > "u") return;
|
|
5450
5455
|
let { addEventListener: t, history: n, location: r } = window, i = r.pathname;
|
|
5451
5456
|
t("popstate", () => e(r.pathname)), ["push", "replace"].map((t) => {
|
|
@@ -5453,56 +5458,56 @@ function Ec(e) {
|
|
|
5453
5458
|
if (r !== "pushState" && r !== "replaceState") return;
|
|
5454
5459
|
let a = n[r];
|
|
5455
5460
|
n[r] = function(...t) {
|
|
5456
|
-
let r = t[2]?.toString() || "", o =
|
|
5461
|
+
let r = t[2]?.toString() || "", o = kc(r);
|
|
5457
5462
|
return i !== o && (i = o, setTimeout(() => e(r), 0)), a.apply(n, t);
|
|
5458
5463
|
};
|
|
5459
5464
|
});
|
|
5460
5465
|
}
|
|
5461
|
-
function
|
|
5466
|
+
function Oc(e, t) {
|
|
5462
5467
|
let n = e.indexOf(t);
|
|
5463
5468
|
return n > -1 ? e.slice(0, n) : e;
|
|
5464
5469
|
}
|
|
5465
|
-
function
|
|
5466
|
-
return ["#", "?"].forEach((t) => e =
|
|
5470
|
+
function kc(e) {
|
|
5471
|
+
return ["#", "?"].forEach((t) => e = Oc(e, t)), e;
|
|
5467
5472
|
}
|
|
5468
|
-
function
|
|
5469
|
-
|
|
5470
|
-
|
|
5473
|
+
function Ac() {
|
|
5474
|
+
Dc(() => {
|
|
5475
|
+
_u();
|
|
5471
5476
|
});
|
|
5472
5477
|
}
|
|
5473
5478
|
//#endregion
|
|
5474
5479
|
//#region ../../node_modules/.pnpm/@analytics+scroll-utils@0.1.26_@types+dlv@1.1.5/node_modules/@analytics/scroll-utils/dist/analytics-util-scroll.module.js
|
|
5475
|
-
var
|
|
5476
|
-
function
|
|
5477
|
-
if (e === void 0 && (e = {}), !Y) return
|
|
5478
|
-
var t =
|
|
5479
|
-
if (!f.length) return
|
|
5480
|
+
var jc = "up", Mc = "down";
|
|
5481
|
+
function Nc(e) {
|
|
5482
|
+
if (e === void 0 && (e = {}), !Y) return Na;
|
|
5483
|
+
var t = Lc(), n = Pc(), r = Ic(), i = Rc(r, t), a = Rc(n, t), o = [], s = [], c = [], l = r, u = i, d = a, f = Object.keys(e);
|
|
5484
|
+
if (!f.length) return Na;
|
|
5480
5485
|
var p = f.map(function(e) {
|
|
5481
5486
|
return Number(e);
|
|
5482
|
-
}), m =
|
|
5483
|
-
var t =
|
|
5487
|
+
}), m = mo(function() {
|
|
5488
|
+
var t = Lc(), n = function(e, t) {
|
|
5484
5489
|
return t.map(function(t) {
|
|
5485
5490
|
return t === 100 ? e - 5 : t / 100 * e;
|
|
5486
5491
|
});
|
|
5487
|
-
}(t, p), r =
|
|
5492
|
+
}(t, p), r = Pc(), i = Ic(), f = Rc(i, t), m = Rc(r, t);
|
|
5488
5493
|
if (u = f > u ? f : u, d = m < d ? m : d, !(o.length >= p.length)) {
|
|
5489
|
-
var h = l === i, g =
|
|
5490
|
-
h ? g = "initial" : l <= i && (g =
|
|
5494
|
+
var h = l === i, g = jc;
|
|
5495
|
+
h ? g = "initial" : l <= i && (g = Mc);
|
|
5491
5496
|
var _ = n, v = p;
|
|
5492
|
-
(g ===
|
|
5497
|
+
(g === jc || h) && (_ = n.slice().reverse(), v = p.slice().reverse());
|
|
5493
5498
|
var y = v.reduce(function(e, t, n) {
|
|
5494
5499
|
var r = _[n];
|
|
5495
5500
|
return c.includes(t) && i <= r && (c = c.filter(function(e) {
|
|
5496
5501
|
return e !== t;
|
|
5497
|
-
}), e.singleFunction = t), g ===
|
|
5502
|
+
}), e.singleFunction = t), g === Mc && !o.includes(t) && i >= r && t > a ? (s.push(t), e.callbacks = e.callbacks.concat(t), e) : g === jc && !o.includes(t) && i <= r && t <= f ? (e.foundFunc = [t], e) : (h && i >= r && e.foundFunc.length === 0 && (e.foundFunc = [t]), !s.includes(t) && i >= r && (s.push(t), e.singleFunction ? c.push(t) : e.singleFunction = t), e);
|
|
5498
5503
|
}, {
|
|
5499
5504
|
foundFunc: [],
|
|
5500
5505
|
singleFunction: null,
|
|
5501
5506
|
callbacks: [],
|
|
5502
5507
|
direction: g
|
|
5503
5508
|
});
|
|
5504
|
-
if (l = i, g ===
|
|
5505
|
-
|
|
5509
|
+
if (l = i, g === Mc && y.callbacks && y.callbacks.forEach(function(t) {
|
|
5510
|
+
Ga(e[t]) && (e[t]({
|
|
5506
5511
|
trigger: t,
|
|
5507
5512
|
direction: g,
|
|
5508
5513
|
scrollMin: d,
|
|
@@ -5511,7 +5516,7 @@ function Mc(e) {
|
|
|
5511
5516
|
}), o.push(t));
|
|
5512
5517
|
}), y.singleFunction) {
|
|
5513
5518
|
var b = y.singleFunction, x = y.direction;
|
|
5514
|
-
|
|
5519
|
+
Ga(e[b]) && e[b]({
|
|
5515
5520
|
trigger: b,
|
|
5516
5521
|
direction: x,
|
|
5517
5522
|
scrollMin: d,
|
|
@@ -5525,47 +5530,47 @@ function Mc(e) {
|
|
|
5525
5530
|
return window.removeEventListener("scroll", m);
|
|
5526
5531
|
};
|
|
5527
5532
|
}
|
|
5528
|
-
function Nc() {
|
|
5529
|
-
return Y ? document.body.scrollTop || document.documentElement.scrollTop : 0;
|
|
5530
|
-
}
|
|
5531
5533
|
function Pc() {
|
|
5532
|
-
return Y ?
|
|
5534
|
+
return Y ? document.body.scrollTop || document.documentElement.scrollTop : 0;
|
|
5533
5535
|
}
|
|
5534
5536
|
function Fc() {
|
|
5535
|
-
return
|
|
5537
|
+
return Y ? window.innerHeight || document.documentElement.clientHeight : 0;
|
|
5536
5538
|
}
|
|
5537
5539
|
function Ic() {
|
|
5540
|
+
return Math.round(Pc() + Fc());
|
|
5541
|
+
}
|
|
5542
|
+
function Lc() {
|
|
5538
5543
|
if (!Y) return 0;
|
|
5539
5544
|
var e = document.body, t = document.documentElement;
|
|
5540
5545
|
return Math.max(e.scrollHeight, e.offsetHeight, t.clientHeight, t.scrollHeight, t.offsetHeight);
|
|
5541
5546
|
}
|
|
5542
|
-
function
|
|
5547
|
+
function Rc(e, t) {
|
|
5543
5548
|
return Math.round(e / t * 100);
|
|
5544
5549
|
}
|
|
5545
5550
|
//#endregion
|
|
5546
5551
|
//#region ../../node_modules/.pnpm/@analytics+listener-utils@0.4.2/node_modules/@analytics/listener-utils/dist/analytics-util-listener.module.js
|
|
5547
|
-
var
|
|
5548
|
-
function
|
|
5552
|
+
var zc = "Event", Bc = zc + "Listener";
|
|
5553
|
+
function Vc(e) {
|
|
5549
5554
|
return function(t, n, r, i) {
|
|
5550
|
-
var a = r ||
|
|
5555
|
+
var a = r || Na, o = i || !1;
|
|
5551
5556
|
if (!Y) return a;
|
|
5552
|
-
var s =
|
|
5557
|
+
var s = Hc(n), c = Hc(t, !0);
|
|
5553
5558
|
if (!c.length) throw Error("noElements");
|
|
5554
|
-
if (!s.length) throw Error("no" +
|
|
5559
|
+
if (!s.length) throw Error("no" + zc);
|
|
5555
5560
|
var l = [];
|
|
5556
5561
|
return function e(t) {
|
|
5557
5562
|
t && (l = []);
|
|
5558
|
-
for (var n = t ? "add" +
|
|
5563
|
+
for (var n = t ? "add" + Bc : "remove" + Bc, r = 0; r < c.length; r++) {
|
|
5559
5564
|
var i = c[r];
|
|
5560
|
-
l[r] = t ? o && o.once ?
|
|
5565
|
+
l[r] = t ? o && o.once ? Uc(a) : a : l[r] || a;
|
|
5561
5566
|
for (var u = 0; u < s.length; u++) i[n] ? i["on" + s[u]] = t ? l[r] : null : i[n](s[u], l[r], o);
|
|
5562
5567
|
}
|
|
5563
5568
|
return e.bind(null, !t);
|
|
5564
5569
|
}(e);
|
|
5565
5570
|
};
|
|
5566
5571
|
}
|
|
5567
|
-
function
|
|
5568
|
-
if (
|
|
5572
|
+
function Hc(e, t) {
|
|
5573
|
+
if (Ka(e)) return t ? Hc(document.querySelectorAll(e)) : (n = e).split(n.indexOf(",") > -1 ? "," : " ").map(function(e) {
|
|
5569
5574
|
return e.trim();
|
|
5570
5575
|
});
|
|
5571
5576
|
var n;
|
|
@@ -5573,31 +5578,31 @@ function Vc(e, t) {
|
|
|
5573
5578
|
for (var r = [], i = e.length >>> 0; i--;) r[i] = e[i];
|
|
5574
5579
|
return r;
|
|
5575
5580
|
}
|
|
5576
|
-
var a =
|
|
5581
|
+
var a = oo(e);
|
|
5577
5582
|
return t ? a.map(function(e) {
|
|
5578
|
-
return
|
|
5583
|
+
return Ka(e) ? Hc(e, !0) : e;
|
|
5579
5584
|
}).flat() : a;
|
|
5580
5585
|
}
|
|
5581
|
-
function
|
|
5586
|
+
function Uc(e, t) {
|
|
5582
5587
|
var n;
|
|
5583
5588
|
return function() {
|
|
5584
5589
|
return e &&= (n = e.apply(t || this, arguments), null), n;
|
|
5585
5590
|
};
|
|
5586
5591
|
}
|
|
5587
|
-
var
|
|
5588
|
-
function
|
|
5589
|
-
return Y &&
|
|
5592
|
+
var Wc = Vc(zc);
|
|
5593
|
+
function Gc(e, t) {
|
|
5594
|
+
return Y && Ga(window[e]) ? (n = window[e], r = t, (i = window) === void 0 && (i = null), Ga(n) ? function() {
|
|
5590
5595
|
n.apply(i, arguments), r.apply(i, arguments);
|
|
5591
5596
|
} : r) : window[e] = t;
|
|
5592
5597
|
var n, r, i;
|
|
5593
5598
|
}
|
|
5594
|
-
|
|
5599
|
+
Gc.bind(null, "onerror"), Gc.bind(null, "onload");
|
|
5595
5600
|
//#endregion
|
|
5596
5601
|
//#region ../../node_modules/.pnpm/analytics-plugin-tab-events@0.2.1/node_modules/analytics-plugin-tab-events/lib/analytics-plugin-tab-events.browser.es.js
|
|
5597
|
-
var
|
|
5598
|
-
function
|
|
5599
|
-
if (
|
|
5600
|
-
var t =
|
|
5602
|
+
var Kc = typeof window > "u", qc = "hidden";
|
|
5603
|
+
function Jc(e) {
|
|
5604
|
+
if (Kc) return !1;
|
|
5605
|
+
var t = Yc(), n = `${t.replace(/[H|h]idden/, "")}visibilitychange`, r = function() {
|
|
5601
5606
|
return e(!!document[t]);
|
|
5602
5607
|
}, i = function() {
|
|
5603
5608
|
return document.addEventListener(n, r);
|
|
@@ -5606,8 +5611,8 @@ function qc(e) {
|
|
|
5606
5611
|
return document.removeEventListener(n, r), i;
|
|
5607
5612
|
};
|
|
5608
5613
|
}
|
|
5609
|
-
function
|
|
5610
|
-
return
|
|
5614
|
+
function Yc() {
|
|
5615
|
+
return Kc || "hidden" in document ? qc : [
|
|
5611
5616
|
"webkit",
|
|
5612
5617
|
"moz",
|
|
5613
5618
|
"ms",
|
|
@@ -5619,7 +5624,7 @@ function Jc() {
|
|
|
5619
5624
|
}
|
|
5620
5625
|
//#endregion
|
|
5621
5626
|
//#region ../../node_modules/.pnpm/@analytics+activity-utils@0.1.16/node_modules/@analytics/activity-utils/dist/analytics-util-activity.module.js
|
|
5622
|
-
var
|
|
5627
|
+
var Xc = [
|
|
5623
5628
|
"mousemove",
|
|
5624
5629
|
"mousedown",
|
|
5625
5630
|
"touchmove",
|
|
@@ -5627,7 +5632,7 @@ var Yc = [
|
|
|
5627
5632
|
"touchend",
|
|
5628
5633
|
"keydown"
|
|
5629
5634
|
];
|
|
5630
|
-
function
|
|
5635
|
+
function Zc(e, t) {
|
|
5631
5636
|
t === void 0 && (t = {});
|
|
5632
5637
|
var n = function(e, t) {
|
|
5633
5638
|
var n = this, r = !1;
|
|
@@ -5638,11 +5643,11 @@ function Xc(e, t) {
|
|
|
5638
5643
|
};
|
|
5639
5644
|
}(e, t.throttle || 1e4), r = [];
|
|
5640
5645
|
function i() {
|
|
5641
|
-
return r = [
|
|
5646
|
+
return r = [Jc(function(e) {
|
|
5642
5647
|
e || n({ type: "tabVisible" });
|
|
5643
|
-
})].concat(
|
|
5644
|
-
return
|
|
5645
|
-
}),
|
|
5648
|
+
})].concat(Xc.map(function(e) {
|
|
5649
|
+
return Wc(document, e, n);
|
|
5650
|
+
}), Wc(window, "load", n), Wc(window, "scroll", n, {
|
|
5646
5651
|
capture: !0,
|
|
5647
5652
|
passive: !0
|
|
5648
5653
|
})), a;
|
|
@@ -5656,16 +5661,16 @@ function Xc(e, t) {
|
|
|
5656
5661
|
return a(), i;
|
|
5657
5662
|
};
|
|
5658
5663
|
}
|
|
5659
|
-
function
|
|
5664
|
+
function Qc(e) {
|
|
5660
5665
|
var t, n, r = e.onIdle, i = e.onWakeUp, a = e.onHeartbeat, o = e.timeout, s = o === void 0 ? 1e4 : o, c = e.throttle, l = c === void 0 ? 2e3 : c, u = !1, d = !1, f = /* @__PURE__ */ new Date(), p = function() {
|
|
5661
5666
|
return clearTimeout(t);
|
|
5662
5667
|
};
|
|
5663
5668
|
function m(e) {
|
|
5664
|
-
p(), a && !u && a(
|
|
5665
|
-
u = !0, r && (n = /* @__PURE__ */ new Date(), r(
|
|
5669
|
+
p(), a && !u && a($c(f), e), i && u && (u = !1, i($c(n), e), f = /* @__PURE__ */ new Date()), t = setTimeout(function() {
|
|
5670
|
+
u = !0, r && (n = /* @__PURE__ */ new Date(), r($c(f), e));
|
|
5666
5671
|
}, s);
|
|
5667
5672
|
}
|
|
5668
|
-
var h =
|
|
5673
|
+
var h = Zc(m, { throttle: l });
|
|
5669
5674
|
return {
|
|
5670
5675
|
disable: function() {
|
|
5671
5676
|
d = !0, u = !1, p();
|
|
@@ -5678,18 +5683,18 @@ function Zc(e) {
|
|
|
5678
5683
|
return {
|
|
5679
5684
|
isIdle: u,
|
|
5680
5685
|
isDisabled: d,
|
|
5681
|
-
active: u ? 0 :
|
|
5682
|
-
idle: u ?
|
|
5686
|
+
active: u ? 0 : $c(f, d),
|
|
5687
|
+
idle: u ? $c(n, d) : 0
|
|
5683
5688
|
};
|
|
5684
5689
|
}
|
|
5685
5690
|
};
|
|
5686
5691
|
}
|
|
5687
|
-
function
|
|
5692
|
+
function $c(e, t) {
|
|
5688
5693
|
return t ? 0 : Math.round((/* @__PURE__ */ new Date() - e) / 1e3);
|
|
5689
5694
|
}
|
|
5690
5695
|
//#endregion
|
|
5691
5696
|
//#region src/services/analytics/element-tracker.ts
|
|
5692
|
-
var
|
|
5697
|
+
var el = 5e3, tl = class {
|
|
5693
5698
|
element;
|
|
5694
5699
|
isInViewport = !1;
|
|
5695
5700
|
isAwake = !1;
|
|
@@ -5706,11 +5711,11 @@ var $c = 5e3, el = class {
|
|
|
5706
5711
|
e.forEach((e) => {
|
|
5707
5712
|
this.handleInViewPort(e.isIntersecting);
|
|
5708
5713
|
});
|
|
5709
|
-
}, { threshold: 0 }), this.observer.observe(this.element),
|
|
5714
|
+
}, { threshold: 0 }), this.observer.observe(this.element), Qc({
|
|
5710
5715
|
onIdle: (e) => this.handleAwake(!1, e),
|
|
5711
5716
|
onWakeUp: (e) => this.handleAwake(!0, e),
|
|
5712
|
-
timeout:
|
|
5713
|
-
}),
|
|
5717
|
+
timeout: el
|
|
5718
|
+
}), Nc({
|
|
5714
5719
|
25: this.handleScroll.bind(this),
|
|
5715
5720
|
50: this.handleScroll.bind(this),
|
|
5716
5721
|
75: this.handleScroll.bind(this),
|
|
@@ -5725,7 +5730,7 @@ var $c = 5e3, el = class {
|
|
|
5725
5730
|
e ? (this.isAwake = !0, this.trackInViewport()) : this.handleAwake(!1), this.isInViewport = e;
|
|
5726
5731
|
}
|
|
5727
5732
|
handleAwake(e, t = Math.round((Date.now() - this.lastEventAt) / 1e3)) {
|
|
5728
|
-
this.isAwake = e, this.lastEventAt = e ? Date.now() - t *
|
|
5733
|
+
this.isAwake = e, this.lastEventAt = e ? Date.now() - t * el : Date.now(), this.isInViewport && this.trackAwake(e, t);
|
|
5729
5734
|
}
|
|
5730
5735
|
handleScroll(e) {
|
|
5731
5736
|
this.scrollCallback && this.scrollCallback(e);
|
|
@@ -5744,17 +5749,17 @@ var $c = 5e3, el = class {
|
|
|
5744
5749
|
};
|
|
5745
5750
|
//#endregion
|
|
5746
5751
|
//#region src/utils/onDomContentLoaded.ts
|
|
5747
|
-
function
|
|
5752
|
+
function nl(e) {
|
|
5748
5753
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", e) : e();
|
|
5749
5754
|
}
|
|
5750
|
-
function
|
|
5755
|
+
function rl() {
|
|
5751
5756
|
return new Promise((e) => {
|
|
5752
|
-
|
|
5757
|
+
nl(() => e());
|
|
5753
5758
|
});
|
|
5754
5759
|
}
|
|
5755
5760
|
//#endregion
|
|
5756
5761
|
//#region ../../node_modules/.pnpm/saturated@1.0.0/node_modules/saturated/dist/saturated.mjs
|
|
5757
|
-
function
|
|
5762
|
+
function il(e, t) {
|
|
5758
5763
|
t ||= {};
|
|
5759
5764
|
var n, r, i = [], a = t.max || Infinity;
|
|
5760
5765
|
function o() {
|
|
@@ -5778,14 +5783,14 @@ function rl(e, t) {
|
|
|
5778
5783
|
}
|
|
5779
5784
|
//#endregion
|
|
5780
5785
|
//#region src/services/analytics/session-id.ts
|
|
5781
|
-
var
|
|
5782
|
-
function
|
|
5783
|
-
let e = sessionStorage.getItem(
|
|
5784
|
-
return e || (e = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(
|
|
5786
|
+
var al = "sesamy_session_id";
|
|
5787
|
+
function ol() {
|
|
5788
|
+
let e = sessionStorage.getItem(al);
|
|
5789
|
+
return e || (e = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(al, e)), e;
|
|
5785
5790
|
}
|
|
5786
5791
|
//#endregion
|
|
5787
5792
|
//#region src/utils/selector.ts
|
|
5788
|
-
function
|
|
5793
|
+
function sl(e) {
|
|
5789
5794
|
function t(e) {
|
|
5790
5795
|
return e.id ? `#${e.id}` : e.classList.length > 0 ? Array.from(e.classList).map((e) => `.${e}`).join("") : null;
|
|
5791
5796
|
}
|
|
@@ -5809,13 +5814,13 @@ function ol(e) {
|
|
|
5809
5814
|
}
|
|
5810
5815
|
//#endregion
|
|
5811
5816
|
//#region src/utils/cleanObject.ts
|
|
5812
|
-
function
|
|
5817
|
+
function cl(e) {
|
|
5813
5818
|
return e ? Object.fromEntries(Object.entries(e).filter(([e, t]) => t !== void 0)) : {};
|
|
5814
5819
|
}
|
|
5815
5820
|
//#endregion
|
|
5816
5821
|
//#region src/services/content/index.ts
|
|
5817
|
-
var
|
|
5818
|
-
function
|
|
5822
|
+
var ll = "leaky-paywall";
|
|
5823
|
+
function ul(e) {
|
|
5819
5824
|
return e.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
5820
5825
|
}
|
|
5821
5826
|
var Q = {
|
|
@@ -5860,8 +5865,8 @@ var Q = {
|
|
|
5860
5865
|
selector: "sesamy-article",
|
|
5861
5866
|
attribute: "paywall-url"
|
|
5862
5867
|
}
|
|
5863
|
-
},
|
|
5864
|
-
function
|
|
5868
|
+
}, dl = [], fl = !1, pl;
|
|
5869
|
+
function ml(e) {
|
|
5865
5870
|
try {
|
|
5866
5871
|
let t = new URL(e).pathname.split("/").filter(Boolean);
|
|
5867
5872
|
return t[t.length - 1] || e;
|
|
@@ -5869,9 +5874,9 @@ function pl(e) {
|
|
|
5869
5874
|
return e;
|
|
5870
5875
|
}
|
|
5871
5876
|
}
|
|
5872
|
-
function
|
|
5877
|
+
function hl() {
|
|
5873
5878
|
let e = window.location.pathname, t = new URLSearchParams(window.location.search), n = navigator.userAgent;
|
|
5874
|
-
return
|
|
5879
|
+
return dl.find((r) => {
|
|
5875
5880
|
if (r.path && !e.includes(r.path) || r.queryParam && t.get(r.queryParam.key) !== r.queryParam.value) return !1;
|
|
5876
5881
|
if (r.headers) {
|
|
5877
5882
|
let e = r.headers.name.toLowerCase(), t = r.headers.contains.toLowerCase();
|
|
@@ -5882,26 +5887,26 @@ function ml() {
|
|
|
5882
5887
|
return !(r.userAgentContains && !n.includes(r.userAgentContains));
|
|
5883
5888
|
});
|
|
5884
5889
|
}
|
|
5885
|
-
function
|
|
5886
|
-
return
|
|
5890
|
+
function gl() {
|
|
5891
|
+
return hl();
|
|
5887
5892
|
}
|
|
5888
|
-
function
|
|
5889
|
-
|
|
5890
|
-
let n =
|
|
5893
|
+
function _l(e, t) {
|
|
5894
|
+
dl = e.content || [];
|
|
5895
|
+
let n = hl();
|
|
5891
5896
|
n && n.type === "article" && (Q = {
|
|
5892
5897
|
...Q,
|
|
5893
|
-
...
|
|
5894
|
-
},
|
|
5898
|
+
...cl(n.selectors)
|
|
5899
|
+
}, fl = n.enablePaywallSettingsUrlFallback || !1), pl = t;
|
|
5895
5900
|
}
|
|
5896
|
-
function
|
|
5901
|
+
function vl(e, t) {
|
|
5897
5902
|
let { selector: n, attribute: r } = t;
|
|
5898
5903
|
return n === Q.article.selector || r && e.hasAttribute(r) ? e : e.querySelector(n);
|
|
5899
5904
|
}
|
|
5900
|
-
function
|
|
5905
|
+
function yl(e, t, n = !1) {
|
|
5901
5906
|
if (e) {
|
|
5902
5907
|
if (t.attribute) {
|
|
5903
5908
|
if (t.attribute === "textContent") return e.textContent ?? void 0;
|
|
5904
|
-
let r = e.getAttribute(t.attribute), i =
|
|
5909
|
+
let r = e.getAttribute(t.attribute), i = yl(e.parentElement, t, n);
|
|
5905
5910
|
if (n) {
|
|
5906
5911
|
let e = [];
|
|
5907
5912
|
return r && e.push(...r.split(",").map((e) => e.trim()).filter(Boolean)), i && e.push(...i.split(",").map((e) => e.trim()).filter(Boolean)), e.length > 0 ? [...new Set(e)].join(",") : void 0;
|
|
@@ -5917,7 +5922,7 @@ function $(e) {
|
|
|
5917
5922
|
let n = document.head.querySelectorAll(`[name~='${e}'][content]`);
|
|
5918
5923
|
for (let e = 0; e < n.length; e += 1) if (n[e].content) return n[e].content;
|
|
5919
5924
|
}
|
|
5920
|
-
function
|
|
5925
|
+
function bl(e) {
|
|
5921
5926
|
let t = [];
|
|
5922
5927
|
return document.head.querySelectorAll(`[property~='${e}'][content]`).forEach((e) => {
|
|
5923
5928
|
e.content && t.push(e.content);
|
|
@@ -5925,7 +5930,7 @@ function yl(e) {
|
|
|
5925
5930
|
e.content && t.push(e.content);
|
|
5926
5931
|
}), t;
|
|
5927
5932
|
}
|
|
5928
|
-
function
|
|
5933
|
+
function xl(e) {
|
|
5929
5934
|
try {
|
|
5930
5935
|
let t = e.split(".");
|
|
5931
5936
|
if (t.length !== 3) return null;
|
|
@@ -5935,17 +5940,17 @@ function bl(e) {
|
|
|
5935
5940
|
return null;
|
|
5936
5941
|
}
|
|
5937
5942
|
}
|
|
5938
|
-
var
|
|
5939
|
-
function
|
|
5940
|
-
if (
|
|
5943
|
+
var Sl = /* @__PURE__ */ new WeakMap();
|
|
5944
|
+
function Cl(e) {
|
|
5945
|
+
if (Sl.has(e)) return Sl.get(e) ?? null;
|
|
5941
5946
|
let t = e.querySelector("script.dca-manifest");
|
|
5942
|
-
if (!t?.textContent) return
|
|
5947
|
+
if (!t?.textContent) return Sl.set(e, null), null;
|
|
5943
5948
|
try {
|
|
5944
5949
|
let n = JSON.parse(t.textContent), r = n.resourceJWT, i = {};
|
|
5945
5950
|
n.resource?.resourceId && (i.id = String(n.resource.resourceId));
|
|
5946
5951
|
let a = n.issuerData?.sesamy ?? n.issuers?.sesamy;
|
|
5947
5952
|
if (a?.keyId && (i.pass = String(a.keyId)), r) {
|
|
5948
|
-
let e =
|
|
5953
|
+
let e = xl(r);
|
|
5949
5954
|
if (e) {
|
|
5950
5955
|
e.contentId && (i.id = String(e.contentId)), e.tier && (i.pass = String(e.tier)), e.url && (i.url = String(e.url));
|
|
5951
5956
|
let t = e.meta;
|
|
@@ -5959,13 +5964,13 @@ function Sl(e) {
|
|
|
5959
5964
|
}
|
|
5960
5965
|
}
|
|
5961
5966
|
let o = Object.keys(i).length > 0 ? i : null;
|
|
5962
|
-
return
|
|
5967
|
+
return Sl.set(e, o), Sl.get(e) ?? null;
|
|
5963
5968
|
} catch {
|
|
5964
|
-
return
|
|
5969
|
+
return Sl.set(e, null), null;
|
|
5965
5970
|
}
|
|
5966
5971
|
}
|
|
5967
|
-
var
|
|
5968
|
-
function
|
|
5972
|
+
var wl = null;
|
|
5973
|
+
function Tl() {
|
|
5969
5974
|
let e = [], t = document.querySelectorAll("script[type=\"application/ld+json\"]");
|
|
5970
5975
|
for (let n of t) try {
|
|
5971
5976
|
let t = JSON.parse(n.textContent || "");
|
|
@@ -5973,19 +5978,19 @@ function wl() {
|
|
|
5973
5978
|
} catch {}
|
|
5974
5979
|
return e;
|
|
5975
5980
|
}
|
|
5976
|
-
function Tl(e) {
|
|
5977
|
-
return wl().find((t) => !e || t["@type"] === e || Array.isArray(t["@type"]) && t["@type"].includes(e)) || null;
|
|
5978
|
-
}
|
|
5979
5981
|
function El(e) {
|
|
5980
|
-
return
|
|
5982
|
+
return Tl().find((t) => !e || t["@type"] === e || Array.isArray(t["@type"]) && t["@type"].includes(e)) || null;
|
|
5983
|
+
}
|
|
5984
|
+
function Dl(e) {
|
|
5985
|
+
return Tl().filter((t) => !e || t["@type"] === e || Array.isArray(t["@type"]) && t["@type"].includes(e));
|
|
5981
5986
|
}
|
|
5982
|
-
function
|
|
5987
|
+
function Ol(e, t, n) {
|
|
5983
5988
|
if (!e || typeof e != "object") return typeof e == "string" ? e : void 0;
|
|
5984
5989
|
let r = e[t];
|
|
5985
5990
|
if (typeof r == "string") return r;
|
|
5986
5991
|
if (r && typeof r == "object" && n) return r[n];
|
|
5987
5992
|
}
|
|
5988
|
-
function
|
|
5993
|
+
function kl(e) {
|
|
5989
5994
|
if (!e) return;
|
|
5990
5995
|
let t = (Array.isArray(e) ? e : [e]).map((e) => {
|
|
5991
5996
|
if (typeof e == "string") return { name: e };
|
|
@@ -5994,7 +5999,7 @@ function Ol(e) {
|
|
|
5994
5999
|
return n ? {
|
|
5995
6000
|
name: n,
|
|
5996
6001
|
url: t.url,
|
|
5997
|
-
image:
|
|
6002
|
+
image: Ol(t, "image", "url"),
|
|
5998
6003
|
jobTitle: t.jobTitle,
|
|
5999
6004
|
sameAs: t.sameAs
|
|
6000
6005
|
} : null;
|
|
@@ -6003,22 +6008,22 @@ function Ol(e) {
|
|
|
6003
6008
|
}).filter((e) => e !== null && !!e.name);
|
|
6004
6009
|
return t.length > 0 ? t : void 0;
|
|
6005
6010
|
}
|
|
6006
|
-
function
|
|
6011
|
+
function Al(e) {
|
|
6007
6012
|
if (Array.isArray(e)) return e.filter((e) => typeof e == "string");
|
|
6008
6013
|
if (typeof e == "string") {
|
|
6009
6014
|
let t = e.split(",").map((e) => e.trim()).filter(Boolean);
|
|
6010
6015
|
return t.length > 0 ? t : void 0;
|
|
6011
6016
|
}
|
|
6012
6017
|
}
|
|
6013
|
-
function
|
|
6014
|
-
if (
|
|
6015
|
-
let e =
|
|
6016
|
-
return
|
|
6018
|
+
function jl() {
|
|
6019
|
+
if (wl) return wl;
|
|
6020
|
+
let e = El("NewsArticle") || El("Article") || El("BlogPosting") || El("WebPage"), t = (...e) => e.find((e) => e != null && e !== "") || void 0;
|
|
6021
|
+
return wl = cl({
|
|
6017
6022
|
contentType: e ? Array.isArray(e["@type"]) ? e["@type"][0] : e["@type"] : void 0,
|
|
6018
|
-
authors:
|
|
6019
|
-
keywords: ((...e) => e.find((e) => e && e.length > 0))(
|
|
6020
|
-
tags:
|
|
6021
|
-
categories:
|
|
6023
|
+
authors: kl(e?.author) || (bl("article:author").length > 0 ? bl("article:author").map((e) => ({ name: e })) : void 0) || ($("author") ? [{ name: $("author") }] : void 0),
|
|
6024
|
+
keywords: ((...e) => e.find((e) => e && e.length > 0))(Al(e?.keywords), Al($("keywords"))),
|
|
6025
|
+
tags: bl("article:tag").length > 0 ? bl("article:tag") : void 0,
|
|
6026
|
+
categories: Al($("news_keywords")),
|
|
6022
6027
|
section: t(e?.articleSection, $("article:section")),
|
|
6023
6028
|
publishedAt: t(e?.datePublished, $("article:published_time")),
|
|
6024
6029
|
modifiedAt: t(e?.dateModified, $("article:modified_time")),
|
|
@@ -6029,28 +6034,28 @@ function Al() {
|
|
|
6029
6034
|
twitterSite: $("twitter:site"),
|
|
6030
6035
|
twitterCreator: $("twitter:creator"),
|
|
6031
6036
|
creator: t($("creator"), $("dc.creator")),
|
|
6032
|
-
mainEntityOfPage: e ?
|
|
6037
|
+
mainEntityOfPage: e ? Ol(e.mainEntityOfPage, "@id") || (typeof e.mainEntityOfPage == "string" ? e.mainEntityOfPage : void 0) : void 0,
|
|
6033
6038
|
isAccessibleForFree: typeof e?.isAccessibleForFree == "boolean" ? e.isAccessibleForFree : void 0,
|
|
6034
6039
|
wordCount: typeof e?.wordCount == "number" ? e.wordCount : void 0,
|
|
6035
6040
|
publisher: e?.publisher && typeof e.publisher == "object" ? {
|
|
6036
6041
|
name: e.publisher.name || "",
|
|
6037
6042
|
url: e.publisher.url,
|
|
6038
|
-
logo:
|
|
6043
|
+
logo: Ol(e.publisher, "logo", "url")
|
|
6039
6044
|
} : void 0
|
|
6040
|
-
}),
|
|
6045
|
+
}), wl;
|
|
6041
6046
|
}
|
|
6042
|
-
function
|
|
6043
|
-
|
|
6047
|
+
function Ml() {
|
|
6048
|
+
wl = null, Sl = /* @__PURE__ */ new WeakMap();
|
|
6044
6049
|
}
|
|
6045
|
-
function
|
|
6050
|
+
function Nl({ publisherContentId: e, key: t, defaultValue: n = "" }) {
|
|
6046
6051
|
let r = e ? document.body.querySelector(`sesamy-content-data[id='${e}']`) : null, i = t.replace(/-([a-z])/g, (e, t) => t.toUpperCase());
|
|
6047
6052
|
return r?.getAttribute(t) || $(`sesamy:${t}`) || $(`sesamy:${i}`) || $(`og:${t}`) || $(t) || n;
|
|
6048
6053
|
}
|
|
6049
|
-
function
|
|
6054
|
+
function Pl() {
|
|
6050
6055
|
let e = document.querySelectorAll(Q.article.selector);
|
|
6051
|
-
return Array.from(e).map(
|
|
6056
|
+
return Array.from(e).map(Fl).filter((e) => e !== null);
|
|
6052
6057
|
}
|
|
6053
|
-
function
|
|
6058
|
+
function Fl(e) {
|
|
6054
6059
|
let t = typeof e == "string" ? document.querySelector(e) : e;
|
|
6055
6060
|
if (!t) return null;
|
|
6056
6061
|
let n = Q.article.selector;
|
|
@@ -6062,14 +6067,14 @@ function Pl(e) {
|
|
|
6062
6067
|
} catch {}
|
|
6063
6068
|
let r = {
|
|
6064
6069
|
element: t,
|
|
6065
|
-
selector: typeof e == "string" ? e :
|
|
6066
|
-
}, i =
|
|
6070
|
+
selector: typeof e == "string" ? e : sl(t)
|
|
6071
|
+
}, i = Cl(t);
|
|
6067
6072
|
i && (i.id && (r.id = i.id), i.title && (r.title = i.title), i.excerpt && (r.excerpt = i.excerpt), i.image && (r.image = i.image), i.price != null && (r.price = i.price), i.currency && (r.currency = i.currency), i.url && (r.url = i.url), i.pass && (r.pass = i.pass), i.accessLevel && (r.accessLevel = i.accessLevel));
|
|
6068
6073
|
let a = (e, n, i, a) => {
|
|
6069
6074
|
if (r[e] !== void 0) return;
|
|
6070
|
-
let { transform: o, collect: s = !1 } = a || {}, c = vl(
|
|
6075
|
+
let { transform: o, collect: s = !1 } = a || {}, c = yl(vl(t, n), n, s), l = Nl({
|
|
6071
6076
|
publisherContentId: i,
|
|
6072
|
-
key:
|
|
6077
|
+
key: ul(String(e))
|
|
6073
6078
|
}), u = c || l || void 0;
|
|
6074
6079
|
u && (r[e] = o ? o(u) : u);
|
|
6075
6080
|
};
|
|
@@ -6077,66 +6082,66 @@ function Pl(e) {
|
|
|
6077
6082
|
let t = parseFloat(e);
|
|
6078
6083
|
return Number.isNaN(t) ? void 0 : t;
|
|
6079
6084
|
} }), a("currency", Q.currency, r.id), a("url", Q.url, r.id), a("pass", Q.pass, r.id, { collect: !0 }), a("paywallUrl", Q.paywallUrl, r.id), a("accessLevel", Q.accessLevel, r.id, { transform: (e) => e || "entitlement" });
|
|
6080
|
-
let o =
|
|
6081
|
-
if (o && o.type === "article" && (o.pass && (r.pass = r.pass ? `${r.pass},${o.pass}` : o.pass), o.price && !r.price && (r.price = o.price.amount), o.price?.currency && !r.currency && (r.currency = o.price.currency), o.paywallUrl && !r.paywallUrl && (r.paywallUrl = o.paywallUrl)),
|
|
6085
|
+
let o = hl();
|
|
6086
|
+
if (o && o.type === "article" && (o.pass && (r.pass = r.pass ? `${r.pass},${o.pass}` : o.pass), o.price && !r.price && (r.price = o.price.amount), o.price?.currency && !r.currency && (r.currency = o.price.currency), o.paywallUrl && !r.paywallUrl && (r.paywallUrl = o.paywallUrl)), fl && !r.paywallUrl) {
|
|
6082
6087
|
let e = document.querySelector("sesamy-paywall");
|
|
6083
6088
|
if (e) {
|
|
6084
6089
|
let t = e.getAttribute("settings-url");
|
|
6085
6090
|
t && (r.paywallUrl = t);
|
|
6086
6091
|
}
|
|
6087
6092
|
}
|
|
6088
|
-
return r.url ||= window.location.href, r.metadata =
|
|
6093
|
+
return r.url ||= window.location.href, r.metadata = jl(), r;
|
|
6089
6094
|
}
|
|
6090
|
-
async function
|
|
6091
|
-
let t = e === void 0 ?
|
|
6095
|
+
async function Il(e) {
|
|
6096
|
+
let t = e === void 0 ? Pl()[0] ?? null : Fl(e);
|
|
6092
6097
|
if (!t) throw Error("Could not find article element");
|
|
6093
6098
|
if (t.accessLevel === "public") return !0;
|
|
6094
|
-
if (t.accessLevel === "logged-in" && !t.paywallUrl || t.paywallUrl && ((await
|
|
6099
|
+
if (t.accessLevel === "logged-in" && !t.paywallUrl || t.paywallUrl && ((await pl.paywalls.get(t.paywallUrl)).settings.template === "LOGIN" ? "logged-in" : "entitlement") == "logged-in") return await pl.auth.isAuthenticated() ? !0 : null;
|
|
6095
6100
|
if (!t.url) throw Error("Article must have a URL");
|
|
6096
|
-
let n = await
|
|
6097
|
-
if (n && n.id !==
|
|
6101
|
+
let n = await pl.entitlements.hasAccess(t.url, t.pass?.split(",") || []);
|
|
6102
|
+
if (n && n.id !== ll) return n;
|
|
6098
6103
|
if (t.paywallUrl) {
|
|
6099
|
-
let e =
|
|
6100
|
-
if ((await
|
|
6104
|
+
let e = ml(t.paywallUrl);
|
|
6105
|
+
if ((await pl.paywalls.checkAccess(e, {
|
|
6101
6106
|
publisherContentId: t.id || t.url,
|
|
6102
6107
|
url: t.url
|
|
6103
6108
|
})).status === "allowed") {
|
|
6104
6109
|
let e = {
|
|
6105
|
-
id:
|
|
6110
|
+
id: ll,
|
|
6106
6111
|
sku: "",
|
|
6107
6112
|
url: t.url,
|
|
6108
6113
|
hasAccess: !0
|
|
6109
6114
|
};
|
|
6110
|
-
return
|
|
6115
|
+
return ha().some((e) => e.id === ll && e.url === t.url) || ga(e), e;
|
|
6111
6116
|
}
|
|
6112
|
-
|
|
6117
|
+
_a((e) => e.id === ll && e.url === t.url);
|
|
6113
6118
|
}
|
|
6114
6119
|
return null;
|
|
6115
6120
|
}
|
|
6116
|
-
async function
|
|
6121
|
+
async function Ll(e, t) {
|
|
6117
6122
|
let n = typeof e == "string" ? document.querySelector(e) : e;
|
|
6118
6123
|
if (!n) throw Error("Could not find element");
|
|
6119
|
-
let r =
|
|
6124
|
+
let r = Fl(n);
|
|
6120
6125
|
if (!r?.url) throw Error("Could not find content for element");
|
|
6121
|
-
let i = await
|
|
6122
|
-
if (i && i.id !==
|
|
6126
|
+
let i = await pl.entitlements.hasAccess(r.url, r.pass?.split(",") || []), a;
|
|
6127
|
+
if (i && i.id !== ll) if (i.token) a = i.token;
|
|
6123
6128
|
else {
|
|
6124
|
-
let e = await
|
|
6129
|
+
let e = await pl.entitlements.access(i.id);
|
|
6125
6130
|
if (!e.token) throw Error("Could not get access token");
|
|
6126
6131
|
a = e.token;
|
|
6127
6132
|
}
|
|
6128
6133
|
else if (r.paywallUrl) {
|
|
6129
|
-
let e =
|
|
6134
|
+
let e = ml(r.paywallUrl), t = await pl.paywalls.registerAccess(e, {
|
|
6130
6135
|
publisherContentId: r.id || r.url,
|
|
6131
6136
|
url: r.url
|
|
6132
6137
|
});
|
|
6133
6138
|
t.status === "allowed" && (a = new URL(t.signedLink).searchParams.get("sesamy_token") || void 0);
|
|
6134
6139
|
}
|
|
6135
6140
|
if (!a) throw Error("User does not have access to the content");
|
|
6136
|
-
let o = t ||
|
|
6137
|
-
return
|
|
6141
|
+
let o = t || sl(n.parentElement || n);
|
|
6142
|
+
return pl.proxy.getContent(a, r.url, o);
|
|
6138
6143
|
}
|
|
6139
|
-
function
|
|
6144
|
+
function Rl(e, t = {}) {
|
|
6140
6145
|
let { closeOnBackdropClick: n = !0, closeOnEscape: r = !0, zIndex: i = 2147483647, backdropBlur: a = "5px", overlayBackground: o = "rgba(0,0,0,0.5)" } = t, s = document.createElement("div");
|
|
6141
6146
|
s.setAttribute("data-sesamy-modal", "true"), Object.assign(s.style, {
|
|
6142
6147
|
position: "fixed",
|
|
@@ -6165,7 +6170,7 @@ function Ll(e, t = {}) {
|
|
|
6165
6170
|
close: l
|
|
6166
6171
|
};
|
|
6167
6172
|
}
|
|
6168
|
-
function
|
|
6173
|
+
function zl(e, t = {}) {
|
|
6169
6174
|
let { position: n = "top", fixed: r = !0, zIndex: i = 2147483647, autoDismissMs: a, pushContent: o = !1, height: s, transitionDuration: c = "0.3s" } = t, l = document.createElement("div");
|
|
6170
6175
|
l.setAttribute("data-sesamy-notification-bar", "true"), l.setAttribute("data-sesamy-notification-position", n), Object.assign(l.style, {
|
|
6171
6176
|
position: r ? "fixed" : "absolute",
|
|
@@ -6195,8 +6200,8 @@ function Rl(e, t = {}) {
|
|
|
6195
6200
|
}
|
|
6196
6201
|
//#endregion
|
|
6197
6202
|
//#region src/services/analytics/plugins/sesamy-logger.ts
|
|
6198
|
-
var
|
|
6199
|
-
function
|
|
6203
|
+
var Bl = !1, Vl, Hl, Ul;
|
|
6204
|
+
function Wl(e) {
|
|
6200
6205
|
return JSON.stringify(e.map((e) => {
|
|
6201
6206
|
let { campaign: t, ...n } = e.properties || {};
|
|
6202
6207
|
return {
|
|
@@ -6204,11 +6209,11 @@ function Ul(e) {
|
|
|
6204
6209
|
userId: e.userId,
|
|
6205
6210
|
type: e.type,
|
|
6206
6211
|
properties: n,
|
|
6207
|
-
clientId:
|
|
6212
|
+
clientId: Ul,
|
|
6208
6213
|
requestId: Math.random().toString(36).slice(2, 9),
|
|
6209
|
-
sessionId:
|
|
6214
|
+
sessionId: ol(),
|
|
6210
6215
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6211
|
-
version:
|
|
6216
|
+
version: Ec,
|
|
6212
6217
|
event: e.event,
|
|
6213
6218
|
context: {
|
|
6214
6219
|
...e.context,
|
|
@@ -6221,17 +6226,17 @@ function Ul(e) {
|
|
|
6221
6226
|
},
|
|
6222
6227
|
campaign: t,
|
|
6223
6228
|
locale: navigator.language,
|
|
6224
|
-
library:
|
|
6229
|
+
library: Tc,
|
|
6225
6230
|
userAgent: navigator.userAgent,
|
|
6226
|
-
clientId:
|
|
6231
|
+
clientId: Ul
|
|
6227
6232
|
}
|
|
6228
6233
|
};
|
|
6229
6234
|
}));
|
|
6230
6235
|
}
|
|
6231
|
-
var
|
|
6236
|
+
var Gl = il(async (e) => {
|
|
6232
6237
|
if (e.length > 0) {
|
|
6233
|
-
let t =
|
|
6234
|
-
|
|
6238
|
+
let t = Wl(e);
|
|
6239
|
+
Bl ? navigator.sendBeacon(Hl, t) : (await fetch(Hl, {
|
|
6235
6240
|
method: "POST",
|
|
6236
6241
|
body: t,
|
|
6237
6242
|
headers: { "Content-Type": "text/plain" }
|
|
@@ -6241,27 +6246,27 @@ var Wl = rl(async (e) => {
|
|
|
6241
6246
|
max: 10,
|
|
6242
6247
|
interval: 3e3
|
|
6243
6248
|
});
|
|
6244
|
-
function
|
|
6249
|
+
function Kl(e) {
|
|
6245
6250
|
if (e.anonymousId) if (e.properties?.flushing) {
|
|
6246
6251
|
let t = { ...e };
|
|
6247
|
-
delete t.properties.flushing, navigator.sendBeacon(
|
|
6248
|
-
} else
|
|
6252
|
+
delete t.properties.flushing, navigator.sendBeacon(Hl, Wl([t]));
|
|
6253
|
+
} else Gl.push(e);
|
|
6249
6254
|
}
|
|
6250
|
-
function
|
|
6251
|
-
return
|
|
6255
|
+
function ql() {
|
|
6256
|
+
return Bl = !0, Gl.flush();
|
|
6252
6257
|
}
|
|
6253
|
-
function
|
|
6254
|
-
|
|
6258
|
+
function Jl(e) {
|
|
6259
|
+
Kl(e);
|
|
6255
6260
|
}
|
|
6256
|
-
function
|
|
6257
|
-
|
|
6261
|
+
function Yl(e, t, n) {
|
|
6262
|
+
Vl = t, Hl = `${Ui("logs", n)}/events`, Ul = e;
|
|
6258
6263
|
}
|
|
6259
|
-
var
|
|
6264
|
+
var Xl = {
|
|
6260
6265
|
name: "custom-analytics-plugin",
|
|
6261
6266
|
page: ({ payload: e }) => {
|
|
6262
|
-
if (!
|
|
6267
|
+
if (!Vl) return;
|
|
6263
6268
|
let { properties: t, anonymousId: n, userId: r, event: i } = e;
|
|
6264
|
-
|
|
6269
|
+
Kl({
|
|
6265
6270
|
anonymousId: n,
|
|
6266
6271
|
userId: r,
|
|
6267
6272
|
properties: t,
|
|
@@ -6270,9 +6275,9 @@ var Yl = {
|
|
|
6270
6275
|
});
|
|
6271
6276
|
},
|
|
6272
6277
|
track: ({ payload: e }) => {
|
|
6273
|
-
if (!
|
|
6278
|
+
if (!Vl) return;
|
|
6274
6279
|
let { properties: t, anonymousId: n, userId: r, event: i } = e;
|
|
6275
|
-
|
|
6280
|
+
Kl({
|
|
6276
6281
|
anonymousId: n,
|
|
6277
6282
|
userId: r,
|
|
6278
6283
|
properties: t,
|
|
@@ -6281,9 +6286,9 @@ var Yl = {
|
|
|
6281
6286
|
});
|
|
6282
6287
|
},
|
|
6283
6288
|
identify: ({ payload: e }) => {
|
|
6284
|
-
if (!
|
|
6289
|
+
if (!Vl) return;
|
|
6285
6290
|
let { properties: t, anonymousId: n, userId: r } = e;
|
|
6286
|
-
|
|
6291
|
+
Kl({
|
|
6287
6292
|
anonymousId: n,
|
|
6288
6293
|
userId: r,
|
|
6289
6294
|
properties: t,
|
|
@@ -6294,56 +6299,56 @@ var Yl = {
|
|
|
6294
6299
|
//#endregion
|
|
6295
6300
|
//#region src/services/analytics/plugins/attribution-tracker.ts
|
|
6296
6301
|
Vn();
|
|
6297
|
-
var
|
|
6302
|
+
var Zl = [
|
|
6298
6303
|
"source",
|
|
6299
6304
|
"medium",
|
|
6300
6305
|
"campaign",
|
|
6301
6306
|
"term",
|
|
6302
6307
|
"content"
|
|
6303
|
-
],
|
|
6304
|
-
function
|
|
6305
|
-
return e ? Date.now() - parseInt(e, 10) >
|
|
6308
|
+
], Ql = "utm_", $l = 1800 * 1e3, eu = {};
|
|
6309
|
+
function tu(e) {
|
|
6310
|
+
return e ? Date.now() - parseInt(e, 10) > $l : !0;
|
|
6306
6311
|
}
|
|
6307
|
-
function
|
|
6308
|
-
|
|
6312
|
+
function nu(e, t) {
|
|
6313
|
+
oa("statistics") ? dc(e, t) : eu[e] = t;
|
|
6309
6314
|
}
|
|
6310
|
-
function
|
|
6311
|
-
return
|
|
6312
|
-
}
|
|
6313
|
-
function ru() {
|
|
6314
|
-
for (let [e, t] of Object.entries($l)) uc(e, t);
|
|
6315
|
+
function ru(e) {
|
|
6316
|
+
return oa("statistics") ? uc(e) : eu[e] || null;
|
|
6315
6317
|
}
|
|
6316
6318
|
function iu() {
|
|
6317
|
-
let e
|
|
6318
|
-
e && (eu(nu(`${Zl}set_at`)) || !nu(`${Zl}referrer`)) && tu(`${Zl}referrer`, e);
|
|
6319
|
+
for (let [e, t] of Object.entries(eu)) dc(e, t);
|
|
6319
6320
|
}
|
|
6320
6321
|
function au() {
|
|
6322
|
+
let e = document.referrer || "";
|
|
6323
|
+
e && (tu(ru(`${Ql}set_at`)) || !ru(`${Ql}referrer`)) && nu(`${Ql}referrer`, e);
|
|
6324
|
+
}
|
|
6325
|
+
function ou() {
|
|
6321
6326
|
let e = () => {
|
|
6322
6327
|
let e = {};
|
|
6323
|
-
for (let t of
|
|
6324
|
-
let n =
|
|
6328
|
+
for (let t of Zl) {
|
|
6329
|
+
let n = ru(`${Ql}${t}`);
|
|
6325
6330
|
n && (e[`utm_${t}`] = n);
|
|
6326
6331
|
}
|
|
6327
|
-
let t =
|
|
6332
|
+
let t = ru(`${Ql}referrer`);
|
|
6328
6333
|
return t && (e.utm_referrer = t), e;
|
|
6329
6334
|
};
|
|
6330
6335
|
return {
|
|
6331
6336
|
name: "attribution-tracking",
|
|
6332
6337
|
initialize() {
|
|
6333
|
-
|
|
6334
|
-
|
|
6338
|
+
au(), typeof window < "u" && window.addEventListener(J.CONSENT_CHANGED, () => {
|
|
6339
|
+
oa("statistics") && iu();
|
|
6335
6340
|
});
|
|
6336
6341
|
},
|
|
6337
6342
|
campaign({ payload: e }) {
|
|
6338
|
-
let t = e?.campaign || {}, n =
|
|
6339
|
-
if (Object.keys(t).length > 0 &&
|
|
6340
|
-
for (let e of
|
|
6343
|
+
let t = e?.campaign || {}, n = ru(`${Ql}set_at`);
|
|
6344
|
+
if (Object.keys(t).length > 0 && tu(n)) {
|
|
6345
|
+
for (let e of Zl) {
|
|
6341
6346
|
let n = t[e];
|
|
6342
|
-
n &&
|
|
6347
|
+
n && nu(`${Ql}${e}`, n);
|
|
6343
6348
|
}
|
|
6344
|
-
|
|
6349
|
+
nu(`${Ql}set_at`, String(Date.now()));
|
|
6345
6350
|
}
|
|
6346
|
-
|
|
6351
|
+
au();
|
|
6347
6352
|
},
|
|
6348
6353
|
page({ payload: t }) {
|
|
6349
6354
|
return t.properties.campaign = e(), t;
|
|
@@ -6357,70 +6362,70 @@ function au() {
|
|
|
6357
6362
|
//#endregion
|
|
6358
6363
|
//#region src/services/analytics/index.ts
|
|
6359
6364
|
Vn();
|
|
6360
|
-
var
|
|
6361
|
-
function
|
|
6362
|
-
return `session-${
|
|
6365
|
+
var su = /* @__PURE__ */ new Map(), cu = /* @__PURE__ */ new Map(), lu = [];
|
|
6366
|
+
function uu() {
|
|
6367
|
+
return `session-${ol()}`;
|
|
6363
6368
|
}
|
|
6364
|
-
function
|
|
6365
|
-
|
|
6366
|
-
anonymousId:
|
|
6369
|
+
function du(e) {
|
|
6370
|
+
Jl({
|
|
6371
|
+
anonymousId: uu(),
|
|
6367
6372
|
userId: e.userId,
|
|
6368
6373
|
properties: e.properties || {},
|
|
6369
6374
|
event: e.event,
|
|
6370
6375
|
type: e.type
|
|
6371
6376
|
});
|
|
6372
6377
|
}
|
|
6373
|
-
function
|
|
6374
|
-
|
|
6375
|
-
|
|
6378
|
+
function fu({ clientId: e, enabled: t = !0, environment: n }) {
|
|
6379
|
+
Yl(e, t, n), t && (window.addEventListener("beforeunload", () => {
|
|
6380
|
+
cu.forEach((e, t) => {
|
|
6376
6381
|
e.bind(t)();
|
|
6377
|
-
}),
|
|
6382
|
+
}), ql();
|
|
6378
6383
|
}), window.addEventListener("visibilitychange", () => {
|
|
6379
|
-
document.visibilityState !== "visible" &&
|
|
6384
|
+
document.visibilityState !== "visible" && su.forEach((e, t) => {
|
|
6380
6385
|
e.bind(t)();
|
|
6381
6386
|
});
|
|
6382
|
-
}),
|
|
6383
|
-
let e = new
|
|
6387
|
+
}), Ac(), nl(() => {
|
|
6388
|
+
let e = new tl({
|
|
6384
6389
|
element: document.body,
|
|
6385
6390
|
viewCallback: () => {
|
|
6386
|
-
|
|
6391
|
+
_u();
|
|
6387
6392
|
},
|
|
6388
6393
|
activeDurationCallback: (e, t, n) => {
|
|
6389
|
-
|
|
6394
|
+
yu("activeDuration", {
|
|
6390
6395
|
duration: e,
|
|
6391
6396
|
durationStart: n,
|
|
6392
6397
|
flushing: t
|
|
6393
6398
|
});
|
|
6394
6399
|
},
|
|
6395
6400
|
idleDurationCallback: (e, t, n) => {
|
|
6396
|
-
|
|
6401
|
+
yu("idleDuration", {
|
|
6397
6402
|
duration: e,
|
|
6398
6403
|
durationStart: n,
|
|
6399
6404
|
flushing: t
|
|
6400
6405
|
});
|
|
6401
6406
|
},
|
|
6402
6407
|
scrollCallback: (e) => {
|
|
6403
|
-
|
|
6408
|
+
yu("scroll", { scroll: e.scrollMax });
|
|
6404
6409
|
}
|
|
6405
6410
|
});
|
|
6406
|
-
|
|
6411
|
+
cu.set(document.body, () => {
|
|
6407
6412
|
e.flush();
|
|
6408
|
-
}),
|
|
6413
|
+
}), su.set(document.body, () => {
|
|
6409
6414
|
e.handleVisibilityChange();
|
|
6410
6415
|
});
|
|
6411
6416
|
}), window.addEventListener(J.AUTHENTICATED, async (e) => {
|
|
6412
6417
|
let t = e;
|
|
6413
|
-
if (
|
|
6418
|
+
if (pu()) await hu().identify(t.detail.sub);
|
|
6414
6419
|
else {
|
|
6415
6420
|
let e = {
|
|
6416
6421
|
type: "identify",
|
|
6417
6422
|
userId: t.detail.sub,
|
|
6418
6423
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
6419
6424
|
};
|
|
6420
|
-
|
|
6425
|
+
lu.push(e), du(e);
|
|
6421
6426
|
}
|
|
6422
6427
|
}), window.addEventListener(J.LOGOUT, async () => {
|
|
6423
|
-
if (
|
|
6428
|
+
if (pu()) await hu().track("logout", {}), await hu().reset();
|
|
6424
6429
|
else {
|
|
6425
6430
|
let e = {
|
|
6426
6431
|
type: "track",
|
|
@@ -6428,50 +6433,50 @@ function du({ clientId: e, enabled: t = !0, environment: n }) {
|
|
|
6428
6433
|
properties: {},
|
|
6429
6434
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
6430
6435
|
};
|
|
6431
|
-
|
|
6436
|
+
lu.push(e), du(e);
|
|
6432
6437
|
}
|
|
6433
|
-
}),
|
|
6434
|
-
|
|
6438
|
+
}), ia() && !oa("statistics") && window.addEventListener(J.CONSENT_CHANGED, () => {
|
|
6439
|
+
oa("statistics") && gu();
|
|
6435
6440
|
}));
|
|
6436
6441
|
}
|
|
6437
|
-
function
|
|
6438
|
-
return !
|
|
6439
|
-
}
|
|
6440
|
-
var pu;
|
|
6441
|
-
function mu() {
|
|
6442
|
-
return pu ||= Cc({
|
|
6443
|
-
app: wc,
|
|
6444
|
-
version: Tc,
|
|
6445
|
-
plugins: [au(), Yl]
|
|
6446
|
-
}), pu;
|
|
6442
|
+
function pu() {
|
|
6443
|
+
return !ia() || oa("statistics");
|
|
6447
6444
|
}
|
|
6445
|
+
var mu;
|
|
6448
6446
|
function hu() {
|
|
6449
|
-
|
|
6450
|
-
|
|
6447
|
+
return mu ||= wc({
|
|
6448
|
+
app: Tc,
|
|
6449
|
+
version: Ec,
|
|
6450
|
+
plugins: [ou(), Xl]
|
|
6451
|
+
}), mu;
|
|
6452
|
+
}
|
|
6453
|
+
function gu() {
|
|
6454
|
+
let e = hu().user().anonymousId;
|
|
6455
|
+
for (let t of lu) Jl({
|
|
6451
6456
|
anonymousId: e,
|
|
6452
6457
|
userId: t.userId,
|
|
6453
6458
|
properties: t.properties || {},
|
|
6454
6459
|
event: t.event,
|
|
6455
6460
|
type: t.type
|
|
6456
6461
|
});
|
|
6457
|
-
|
|
6462
|
+
lu.length = 0;
|
|
6458
6463
|
}
|
|
6459
|
-
function
|
|
6460
|
-
if (
|
|
6464
|
+
function _u() {
|
|
6465
|
+
if (pu()) hu().page();
|
|
6461
6466
|
else {
|
|
6462
6467
|
let e = {
|
|
6463
6468
|
type: "page",
|
|
6464
6469
|
properties: {},
|
|
6465
6470
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
6466
6471
|
};
|
|
6467
|
-
|
|
6472
|
+
lu.push(e), du(e);
|
|
6468
6473
|
}
|
|
6469
6474
|
}
|
|
6470
|
-
function
|
|
6471
|
-
return
|
|
6475
|
+
function vu() {
|
|
6476
|
+
return pu() ? hu().user().anonymousId : uu();
|
|
6472
6477
|
}
|
|
6473
|
-
function
|
|
6474
|
-
if (
|
|
6478
|
+
function yu(e, t) {
|
|
6479
|
+
if (pu()) hu().track(e, t);
|
|
6475
6480
|
else {
|
|
6476
6481
|
let n = {
|
|
6477
6482
|
type: "track",
|
|
@@ -6479,70 +6484,70 @@ function vu(e, t) {
|
|
|
6479
6484
|
properties: t,
|
|
6480
6485
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
6481
6486
|
};
|
|
6482
|
-
|
|
6487
|
+
lu.push(n), du(n);
|
|
6483
6488
|
}
|
|
6484
6489
|
}
|
|
6485
6490
|
//#endregion
|
|
6486
6491
|
//#region src/services/flags/index.ts
|
|
6487
6492
|
zn();
|
|
6488
|
-
var
|
|
6489
|
-
async function
|
|
6493
|
+
var bu = "sesamyFlags";
|
|
6494
|
+
async function xu(e) {
|
|
6490
6495
|
try {
|
|
6491
|
-
localStorage.setItem(
|
|
6496
|
+
localStorage.setItem(bu, JSON.stringify(e));
|
|
6492
6497
|
} catch {
|
|
6493
6498
|
q("Failed to save flags to localStorage");
|
|
6494
6499
|
}
|
|
6495
6500
|
}
|
|
6496
|
-
async function
|
|
6497
|
-
let n = await
|
|
6498
|
-
n[e] = t, await
|
|
6499
|
-
}
|
|
6500
|
-
async function Su(e) {
|
|
6501
|
-
return (await wu())[e];
|
|
6501
|
+
async function Su(e, t) {
|
|
6502
|
+
let n = await Tu();
|
|
6503
|
+
n[e] = t, await xu(n);
|
|
6502
6504
|
}
|
|
6503
6505
|
async function Cu(e) {
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
+
return (await Tu())[e];
|
|
6507
|
+
}
|
|
6508
|
+
async function wu(e) {
|
|
6509
|
+
let t = await Tu();
|
|
6510
|
+
e in t && (delete t[e], await xu(t));
|
|
6506
6511
|
}
|
|
6507
|
-
async function
|
|
6512
|
+
async function Tu() {
|
|
6508
6513
|
try {
|
|
6509
|
-
let e = localStorage.getItem(
|
|
6514
|
+
let e = localStorage.getItem(bu);
|
|
6510
6515
|
return e ? JSON.parse(e) : {};
|
|
6511
6516
|
} catch {
|
|
6512
6517
|
return {};
|
|
6513
6518
|
}
|
|
6514
6519
|
}
|
|
6515
6520
|
Vn(), Gn();
|
|
6516
|
-
function
|
|
6517
|
-
let t = e.endpoint ??
|
|
6521
|
+
function Eu(e) {
|
|
6522
|
+
let t = e.endpoint ?? Ui("api2", e.environment), n = (() => {
|
|
6518
6523
|
try {
|
|
6519
|
-
let e =
|
|
6524
|
+
let e = Bi(new URL(t, window.location.origin).href), n = Bi(window.location.href);
|
|
6520
6525
|
return e !== null && e === n;
|
|
6521
6526
|
} catch {
|
|
6522
6527
|
return !1;
|
|
6523
6528
|
}
|
|
6524
|
-
})(), r = e.useHttpCookies === !0, i =
|
|
6529
|
+
})(), r = e.useHttpCookies === !0, i = Ni({
|
|
6525
6530
|
baseUrl: t,
|
|
6526
6531
|
tokenProvider: async () => {
|
|
6527
6532
|
if (r) return null;
|
|
6528
|
-
if (await
|
|
6529
|
-
let e = await
|
|
6533
|
+
if (await hr()) try {
|
|
6534
|
+
let e = await gr(!1);
|
|
6530
6535
|
if (e) return `Bearer ${e}`;
|
|
6531
6536
|
if (n) return null;
|
|
6532
6537
|
} catch {}
|
|
6533
|
-
let t =
|
|
6538
|
+
let t = oa("statistics") ? localStorage.getItem("__anon_id") : vu();
|
|
6534
6539
|
return `Basic ${btoa(`${e.vendorId || e.clientId}|${t}:`)}`;
|
|
6535
6540
|
},
|
|
6536
|
-
libraryName:
|
|
6537
|
-
libraryVersion:
|
|
6541
|
+
libraryName: Tc,
|
|
6542
|
+
libraryVersion: Ec,
|
|
6538
6543
|
vendorId: e.vendorId,
|
|
6539
6544
|
cache: {
|
|
6540
|
-
mode:
|
|
6541
|
-
storage: new
|
|
6545
|
+
mode: Mr.BROWSER,
|
|
6546
|
+
storage: new Vi()
|
|
6542
6547
|
}
|
|
6543
6548
|
}), a = (e) => async (t, n) => {
|
|
6544
|
-
let r = sessionStorage.getItem(
|
|
6545
|
-
return r || (r = Date.now().toString(), sessionStorage.setItem(
|
|
6549
|
+
let r = sessionStorage.getItem(Li);
|
|
6550
|
+
return r || (r = Date.now().toString(), sessionStorage.setItem(Li, r)), e(t, {
|
|
6546
6551
|
...n,
|
|
6547
6552
|
headers: {
|
|
6548
6553
|
...n.headers,
|
|
@@ -6553,9 +6558,9 @@ function Tu(e) {
|
|
|
6553
6558
|
...n,
|
|
6554
6559
|
credentials: "include"
|
|
6555
6560
|
}), s = (e = !0) => (t) => async (r, i) => {
|
|
6556
|
-
let a = await
|
|
6561
|
+
let a = await gr(e);
|
|
6557
6562
|
if (!a) {
|
|
6558
|
-
if (n && await
|
|
6563
|
+
if (n && await hr()) return t(r, {
|
|
6559
6564
|
...i,
|
|
6560
6565
|
credentials: "include"
|
|
6561
6566
|
});
|
|
@@ -6569,11 +6574,11 @@ function Tu(e) {
|
|
|
6569
6574
|
Authorization: `Bearer ${a}`
|
|
6570
6575
|
}
|
|
6571
6576
|
});
|
|
6572
|
-
}, c =
|
|
6577
|
+
}, c = Jr(t).headers({ "Content-Type": "application/json" }).middlewares([
|
|
6573
6578
|
a,
|
|
6574
6579
|
r ? o : s(),
|
|
6575
|
-
|
|
6576
|
-
|
|
6580
|
+
Dr(),
|
|
6581
|
+
Ar({
|
|
6577
6582
|
delayTimer: 1e3,
|
|
6578
6583
|
delayRamp: (e, t) => e * t,
|
|
6579
6584
|
maxAttempts: 3,
|
|
@@ -6582,27 +6587,27 @@ function Tu(e) {
|
|
|
6582
6587
|
})
|
|
6583
6588
|
]);
|
|
6584
6589
|
async function l(e = {}) {
|
|
6585
|
-
let { waitForEntitlementAfter: t, includeSignedLinks: n = !0 } = e, r = await
|
|
6586
|
-
return n && r.push(...
|
|
6590
|
+
let { waitForEntitlementAfter: t, includeSignedLinks: n = !0 } = e, r = await hr() ? await i.entitlements.list({ waitForEntitlementAfter: t?.toISOString() }) : [];
|
|
6591
|
+
return n && r.push(...ha()), r;
|
|
6587
6592
|
}
|
|
6588
6593
|
async function u(e, t = []) {
|
|
6589
6594
|
return (await l())?.find((n) => {
|
|
6590
6595
|
if (e) {
|
|
6591
|
-
let { sku: t, purchaseOption: r } =
|
|
6592
|
-
if ("sku" in n && t === n.sku || r && "purchaseOptionsId" in n && r === n.purchaseOptionsId ||
|
|
6596
|
+
let { sku: t, purchaseOption: r } = Gi(e);
|
|
6597
|
+
if ("sku" in n && t === n.sku || r && "purchaseOptionsId" in n && r === n.purchaseOptionsId || qi(e, n.url)) return !0;
|
|
6593
6598
|
}
|
|
6594
|
-
return !!t.some((e) =>
|
|
6599
|
+
return !!t.some((e) => qi(e, n.url) || "sku" in n && e === n.sku);
|
|
6595
6600
|
});
|
|
6596
6601
|
}
|
|
6597
6602
|
async function d(e, n, i) {
|
|
6598
6603
|
let a = new URL(t, window.location.origin);
|
|
6599
6604
|
a.pathname = a.pathname.replace(/\/$/, "") + "/proxy", a.searchParams.set("url", n), i && a.searchParams.set("selector", i);
|
|
6600
|
-
let o =
|
|
6605
|
+
let o = Jr(a.toString());
|
|
6601
6606
|
return o = r ? o.options({ credentials: "include" }) : o.headers({ Authorization: `Bearer ${e}` }), o.get().text();
|
|
6602
6607
|
}
|
|
6603
6608
|
async function f(e) {
|
|
6604
6609
|
if (!e) throw Error("SKU is required to get fulfillments");
|
|
6605
|
-
return await
|
|
6610
|
+
return await hr() ? await c.get(`/fulfillments?sku=${encodeURIComponent(e)}`).json() : [];
|
|
6606
6611
|
}
|
|
6607
6612
|
async function p(e, t) {
|
|
6608
6613
|
if (!e || !t) throw Error("SKU and itemId are required to request delivery");
|
|
@@ -6619,11 +6624,11 @@ function Tu(e) {
|
|
|
6619
6624
|
}
|
|
6620
6625
|
async function _(e) {
|
|
6621
6626
|
let t = await c.url(`/tags/${encodeURIComponent(e)}`).delete().res();
|
|
6622
|
-
return
|
|
6627
|
+
return pi(), t.ok;
|
|
6623
6628
|
}
|
|
6624
6629
|
async function v(e) {
|
|
6625
6630
|
let t = await c.url("/tags").post(encodeURIComponent(e)).res();
|
|
6626
|
-
return Wn(J.USER_ATTRIBUTE_CHANGED, {}),
|
|
6631
|
+
return Wn(J.USER_ATTRIBUTE_CHANGED, {}), pi(), t.ok;
|
|
6627
6632
|
}
|
|
6628
6633
|
async function y(e) {
|
|
6629
6634
|
return (await i.tallies.get(e)).value;
|
|
@@ -6640,11 +6645,11 @@ function Tu(e) {
|
|
|
6640
6645
|
return await i.tallies.push(e, t);
|
|
6641
6646
|
}
|
|
6642
6647
|
async function C() {
|
|
6643
|
-
return !await
|
|
6648
|
+
return !await gr(!1) && !await hr() ? null : await c.url("/profile").get().json();
|
|
6644
6649
|
}
|
|
6645
6650
|
async function w(e) {
|
|
6646
6651
|
let t = await c.url("/profile").patch(e).res();
|
|
6647
|
-
return
|
|
6652
|
+
return pi(), t.ok;
|
|
6648
6653
|
}
|
|
6649
6654
|
async function T() {
|
|
6650
6655
|
return (await c.url("/profile/spotify-link").get().json()).isSpotifyLinked;
|
|
@@ -6653,14 +6658,14 @@ function Tu(e) {
|
|
|
6653
6658
|
return (await c.url("/profile/unlink-spotify").post().res()).ok;
|
|
6654
6659
|
}
|
|
6655
6660
|
async function D(t) {
|
|
6656
|
-
let n = await
|
|
6661
|
+
let n = await gr(!1);
|
|
6657
6662
|
if (n) {
|
|
6658
|
-
let r = new URL(`${
|
|
6663
|
+
let r = new URL(`${Ui("access-sync", e.environment)}/spotify/sesamy-callback`);
|
|
6659
6664
|
r.searchParams.set("access_token", n), r.searchParams.set("state", t), window.location.href = r.toString();
|
|
6660
6665
|
return;
|
|
6661
6666
|
}
|
|
6662
|
-
let r =
|
|
6663
|
-
if (r !== null && await
|
|
6667
|
+
let r = _r();
|
|
6668
|
+
if (r !== null && await hr()) {
|
|
6664
6669
|
let e = new URL(`${r}/auth/spotify-link`, window.location.origin);
|
|
6665
6670
|
e.searchParams.set("sku", t), window.location.href = e.toString();
|
|
6666
6671
|
return;
|
|
@@ -6669,32 +6674,32 @@ function Tu(e) {
|
|
|
6669
6674
|
}
|
|
6670
6675
|
async function O(e) {
|
|
6671
6676
|
let t = await c.url(`/products/${encodeURIComponent(e)}/auto-onboard`).post().json();
|
|
6672
|
-
return t.length &&
|
|
6677
|
+
return t.length && pi(), t;
|
|
6673
6678
|
}
|
|
6674
6679
|
async function k(e, t = 3600) {
|
|
6675
|
-
let { shortlink: n } = await
|
|
6680
|
+
let { shortlink: n } = await Jr(Ii).post({
|
|
6676
6681
|
url: e,
|
|
6677
6682
|
ttl: t
|
|
6678
6683
|
}).json();
|
|
6679
6684
|
return n;
|
|
6680
6685
|
}
|
|
6681
6686
|
async function A(t) {
|
|
6682
|
-
let n = await
|
|
6687
|
+
let n = await gr(!1, !0), r, i = t.language || Yn(), a = Sa();
|
|
6683
6688
|
switch (t.target) {
|
|
6684
6689
|
case "account":
|
|
6685
|
-
r = new URL(`${
|
|
6690
|
+
r = new URL(`${Ui("account", e.environment)}/${encodeURIComponent(t.language || i)}/subscriptions/${encodeURIComponent(e.vendorId || e.clientId)}${t.contractId ? `/${encodeURIComponent(t.contractId)}` : ""}`), r.searchParams.set("sesamy-redirect-url", t.redirectUrl || window.location.href);
|
|
6686
6691
|
break;
|
|
6687
6692
|
case "change-payment":
|
|
6688
|
-
r = new URL(`${
|
|
6693
|
+
r = new URL(`${Ui("account", e.environment)}/${encodeURIComponent(t.language || i)}/subscriptions/${encodeURIComponent(e.vendorId || e.clientId)}/${encodeURIComponent(t.contractId)}/change-payment-method`), r.searchParams.set("sesamy-redirect-url", t.redirectUrl || window.location.href);
|
|
6689
6694
|
break;
|
|
6690
6695
|
case "change-plan":
|
|
6691
|
-
r = new URL(`${
|
|
6696
|
+
r = new URL(`${Ui("account", e.environment)}/${encodeURIComponent(t.language || i)}/subscriptions/${encodeURIComponent(e.vendorId || e.clientId)}/${encodeURIComponent(t.contractId)}/edit-plan`), r.searchParams.set("sesamy-redirect-url", t.redirectUrl || window.location.href);
|
|
6692
6697
|
break;
|
|
6693
6698
|
case "consume":
|
|
6694
|
-
r = new URL(`${
|
|
6699
|
+
r = new URL(`${Ui("consume", e.environment)}/${encodeURIComponent(t.language || i)}/@${encodeURIComponent(e.vendorId || e.clientId)}/${encodeURIComponent(t.sku)}`), t.episodeId ? r.href += `/${t.episodeId}` : r.href += "/listen", r.searchParams.set("sesamy-redirect-url", t.redirectUrl || window.location.href);
|
|
6695
6700
|
break;
|
|
6696
6701
|
case "checkout":
|
|
6697
|
-
r =
|
|
6702
|
+
r = pa(e, {
|
|
6698
6703
|
language: i,
|
|
6699
6704
|
...t
|
|
6700
6705
|
}, a);
|
|
@@ -6704,13 +6709,13 @@ function Tu(e) {
|
|
|
6704
6709
|
return n && (r.hash = `#access_token=${n}`), t.shorten ? k(r.href, t.ttl) : r.href;
|
|
6705
6710
|
}
|
|
6706
6711
|
async function j() {
|
|
6707
|
-
let t = await
|
|
6712
|
+
let t = await gr(!1), n = new URL(`${Ui("account", e.environment)}/subscriptions/${e.vendorId || e.clientId}`);
|
|
6708
6713
|
t && (n.hash = `#access_token=${t}`), window.location.href = n.toString();
|
|
6709
6714
|
}
|
|
6710
6715
|
async function M(e) {
|
|
6711
|
-
let t =
|
|
6712
|
-
if (
|
|
6713
|
-
let { cookies: e, sessionId: n } =
|
|
6716
|
+
let t = Sa();
|
|
6717
|
+
if (oa("marketing")) {
|
|
6718
|
+
let { cookies: e, sessionId: n } = fa(document.cookie);
|
|
6714
6719
|
e.forEach(({ key: e, value: n }) => {
|
|
6715
6720
|
t[e] || (t[e] = n);
|
|
6716
6721
|
}), n && !t.gaSessionId && (t.gaSessionId = n);
|
|
@@ -6733,21 +6738,21 @@ function Tu(e) {
|
|
|
6733
6738
|
update: i.checkouts.update
|
|
6734
6739
|
},
|
|
6735
6740
|
content: {
|
|
6736
|
-
list:
|
|
6737
|
-
get:
|
|
6741
|
+
list: Pl,
|
|
6742
|
+
get: Fl,
|
|
6738
6743
|
getLanguage: Yn,
|
|
6739
|
-
unlock:
|
|
6740
|
-
getPropertyFromHTML:
|
|
6744
|
+
unlock: Ll,
|
|
6745
|
+
getPropertyFromHTML: Nl
|
|
6741
6746
|
},
|
|
6742
6747
|
contracts: i.contracts,
|
|
6743
6748
|
deleteTag: _,
|
|
6744
6749
|
deleteTally: x,
|
|
6745
6750
|
entitlements: i.entitlements,
|
|
6746
6751
|
flags: {
|
|
6747
|
-
get:
|
|
6748
|
-
set:
|
|
6749
|
-
list:
|
|
6750
|
-
delete:
|
|
6752
|
+
get: Cu,
|
|
6753
|
+
set: Su,
|
|
6754
|
+
list: Tu,
|
|
6755
|
+
delete: wu
|
|
6751
6756
|
},
|
|
6752
6757
|
generateLink: A,
|
|
6753
6758
|
getProxyContent: d,
|
|
@@ -6763,7 +6768,7 @@ function Tu(e) {
|
|
|
6763
6768
|
executeStrategy: (e, t = {}) => i.paywalls.executeStrategy(e, {
|
|
6764
6769
|
...t,
|
|
6765
6770
|
attribution: {
|
|
6766
|
-
...
|
|
6771
|
+
...Ca(),
|
|
6767
6772
|
...t.attribution
|
|
6768
6773
|
}
|
|
6769
6774
|
})
|
|
@@ -6787,16 +6792,16 @@ function Tu(e) {
|
|
|
6787
6792
|
}
|
|
6788
6793
|
//#endregion
|
|
6789
6794
|
//#region src/services/browser/detect-adblock.ts
|
|
6790
|
-
var
|
|
6795
|
+
var Du = [
|
|
6791
6796
|
"AdHeader",
|
|
6792
6797
|
"AdContainer",
|
|
6793
6798
|
"AD_Top",
|
|
6794
6799
|
"homead",
|
|
6795
6800
|
"ad-lead"
|
|
6796
6801
|
];
|
|
6797
|
-
function
|
|
6802
|
+
function Ou() {
|
|
6798
6803
|
return new Promise((e) => {
|
|
6799
|
-
let t =
|
|
6804
|
+
let t = Du.map((e) => {
|
|
6800
6805
|
let t = document.createElement("div");
|
|
6801
6806
|
return t.innerHTML = " ", t.id = e, t.style.position = "absolute", document.body.appendChild(t), t;
|
|
6802
6807
|
});
|
|
@@ -6808,7 +6813,7 @@ function Du() {
|
|
|
6808
6813
|
}
|
|
6809
6814
|
//#endregion
|
|
6810
6815
|
//#region src/services/browser/in-app-browser.ts
|
|
6811
|
-
function
|
|
6816
|
+
function ku() {
|
|
6812
6817
|
let e = navigator.userAgent.toLowerCase();
|
|
6813
6818
|
for (let t of [
|
|
6814
6819
|
{
|
|
@@ -6873,20 +6878,20 @@ function Ou() {
|
|
|
6873
6878
|
}
|
|
6874
6879
|
//#endregion
|
|
6875
6880
|
//#region ../../node_modules/.pnpm/detectincognitojs@1.6.2/node_modules/detectincognitojs/dist/detectIncognito.esm.js
|
|
6876
|
-
var
|
|
6881
|
+
var Au = {
|
|
6877
6882
|
d: (e, t) => {
|
|
6878
|
-
for (var n in t)
|
|
6883
|
+
for (var n in t) Au.o(t, n) && !Au.o(e, n) && Object.defineProperty(e, n, {
|
|
6879
6884
|
enumerable: !0,
|
|
6880
6885
|
get: t[n]
|
|
6881
6886
|
});
|
|
6882
6887
|
},
|
|
6883
6888
|
o: (e, t) => Object.prototype.hasOwnProperty.call(e, t)
|
|
6884
|
-
},
|
|
6885
|
-
|
|
6886
|
-
A: () =>
|
|
6887
|
-
k: () =>
|
|
6889
|
+
}, ju = {};
|
|
6890
|
+
Au.d(ju, {
|
|
6891
|
+
A: () => Fu,
|
|
6892
|
+
k: () => Pu
|
|
6888
6893
|
});
|
|
6889
|
-
var
|
|
6894
|
+
var Mu = function(e, t, n, r) {
|
|
6890
6895
|
return new (n ||= Promise)(function(i, a) {
|
|
6891
6896
|
function o(e) {
|
|
6892
6897
|
try {
|
|
@@ -6910,7 +6915,7 @@ var ju = function(e, t, n, r) {
|
|
|
6910
6915
|
}
|
|
6911
6916
|
c((r = r.apply(e, t || [])).next());
|
|
6912
6917
|
});
|
|
6913
|
-
},
|
|
6918
|
+
}, Nu = function(e, t) {
|
|
6914
6919
|
var n, r, i, a, o = {
|
|
6915
6920
|
label: 0,
|
|
6916
6921
|
sent: function() {
|
|
@@ -6983,9 +6988,9 @@ var ju = function(e, t, n, r) {
|
|
|
6983
6988
|
};
|
|
6984
6989
|
}
|
|
6985
6990
|
};
|
|
6986
|
-
function
|
|
6987
|
-
return
|
|
6988
|
-
return
|
|
6991
|
+
function Pu() {
|
|
6992
|
+
return Mu(this, void 0, Promise, function() {
|
|
6993
|
+
return Nu(this, function(e) {
|
|
6989
6994
|
switch (e.label) {
|
|
6990
6995
|
case 0: return [4, new Promise(function(e, t) {
|
|
6991
6996
|
var n = "Unknown", r = !1;
|
|
@@ -7005,9 +7010,9 @@ function Nu() {
|
|
|
7005
7010
|
return e;
|
|
7006
7011
|
}
|
|
7007
7012
|
function o() {
|
|
7008
|
-
return
|
|
7013
|
+
return Mu(this, void 0, void 0, function() {
|
|
7009
7014
|
var e, t;
|
|
7010
|
-
return
|
|
7015
|
+
return Nu(this, function(n) {
|
|
7011
7016
|
switch (n.label) {
|
|
7012
7017
|
case 0: return n.trys.push([
|
|
7013
7018
|
0,
|
|
@@ -7023,8 +7028,8 @@ function Nu() {
|
|
|
7023
7028
|
});
|
|
7024
7029
|
}
|
|
7025
7030
|
function s() {
|
|
7026
|
-
return
|
|
7027
|
-
return
|
|
7031
|
+
return Mu(this, void 0, Promise, function() {
|
|
7032
|
+
return Nu(this, function(e) {
|
|
7028
7033
|
switch (e.label) {
|
|
7029
7034
|
case 0: return typeof navigator.storage?.getDirectory == "function" ? [4, o()] : [3, 2];
|
|
7030
7035
|
case 1: return e.sent(), [3, 3];
|
|
@@ -7087,9 +7092,9 @@ function Nu() {
|
|
|
7087
7092
|
});
|
|
7088
7093
|
}
|
|
7089
7094
|
function u() {
|
|
7090
|
-
return
|
|
7095
|
+
return Mu(this, void 0, Promise, function() {
|
|
7091
7096
|
var e, t, n;
|
|
7092
|
-
return
|
|
7097
|
+
return Nu(this, function(r) {
|
|
7093
7098
|
switch (r.label) {
|
|
7094
7099
|
case 0:
|
|
7095
7100
|
if (typeof navigator.storage?.getDirectory != "function") return [3, 5];
|
|
@@ -7114,8 +7119,8 @@ function Nu() {
|
|
|
7114
7119
|
});
|
|
7115
7120
|
}
|
|
7116
7121
|
(function() {
|
|
7117
|
-
return
|
|
7118
|
-
return
|
|
7122
|
+
return Mu(this, void 0, Promise, function() {
|
|
7123
|
+
return Nu(this, function(e) {
|
|
7119
7124
|
switch (e.label) {
|
|
7120
7125
|
case 0: return a() !== 44 && a() !== 43 ? [3, 2] : (n = "Safari", [4, s()]);
|
|
7121
7126
|
case 1: return e.sent(), [3, 6];
|
|
@@ -7135,34 +7140,34 @@ function Nu() {
|
|
|
7135
7140
|
});
|
|
7136
7141
|
});
|
|
7137
7142
|
}
|
|
7138
|
-
typeof window < "u" && (window.detectIncognito =
|
|
7139
|
-
var
|
|
7140
|
-
|
|
7141
|
-
var
|
|
7142
|
-
function
|
|
7143
|
+
typeof window < "u" && (window.detectIncognito = Pu);
|
|
7144
|
+
var Fu = Pu;
|
|
7145
|
+
ju.A;
|
|
7146
|
+
var Iu = ju.k, Lu = "sesamy_incognito_mode";
|
|
7147
|
+
function Ru() {
|
|
7143
7148
|
try {
|
|
7144
|
-
let e = sessionStorage.getItem(
|
|
7149
|
+
let e = sessionStorage.getItem(Lu);
|
|
7145
7150
|
return e === null ? void 0 : e === "true";
|
|
7146
7151
|
} catch {
|
|
7147
7152
|
return;
|
|
7148
7153
|
}
|
|
7149
7154
|
}
|
|
7150
|
-
async function
|
|
7155
|
+
async function zu() {
|
|
7151
7156
|
try {
|
|
7152
|
-
let e = sessionStorage.getItem(
|
|
7157
|
+
let e = sessionStorage.getItem(Lu);
|
|
7153
7158
|
if (e !== null) return e === "true";
|
|
7154
|
-
let { isPrivate: t } = await
|
|
7155
|
-
return sessionStorage.setItem(
|
|
7159
|
+
let { isPrivate: t } = await Iu();
|
|
7160
|
+
return sessionStorage.setItem(Lu, t.toString()), t;
|
|
7156
7161
|
} catch {
|
|
7157
7162
|
try {
|
|
7158
|
-
sessionStorage.setItem(
|
|
7163
|
+
sessionStorage.setItem(Lu, "false");
|
|
7159
7164
|
} catch {}
|
|
7160
7165
|
return !1;
|
|
7161
7166
|
}
|
|
7162
7167
|
}
|
|
7163
7168
|
//#endregion
|
|
7164
7169
|
//#region src/services/events/index.ts
|
|
7165
|
-
function
|
|
7170
|
+
function Bu(e, t, n = !1) {
|
|
7166
7171
|
let r = {
|
|
7167
7172
|
name: e,
|
|
7168
7173
|
data: t
|
|
@@ -7171,7 +7176,7 @@ function zu(e, t, n = !1) {
|
|
|
7171
7176
|
cancelable: n,
|
|
7172
7177
|
bubbles: !0
|
|
7173
7178
|
});
|
|
7174
|
-
|
|
7179
|
+
yu(`event:${e}`, {
|
|
7175
7180
|
...t,
|
|
7176
7181
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
7177
7182
|
});
|
|
@@ -7181,55 +7186,55 @@ function zu(e, t, n = !1) {
|
|
|
7181
7186
|
message: r.cancellationMessage
|
|
7182
7187
|
} : { canceled: !1 };
|
|
7183
7188
|
}
|
|
7184
|
-
function
|
|
7189
|
+
function Vu(e, t) {
|
|
7185
7190
|
e.cancelable && (e.detail.cancellationMessage = t, e.preventDefault());
|
|
7186
7191
|
}
|
|
7187
7192
|
//#endregion
|
|
7188
7193
|
//#region src/services/capsule/plugin.ts
|
|
7189
|
-
var
|
|
7190
|
-
function
|
|
7191
|
-
|
|
7194
|
+
var Hu = null;
|
|
7195
|
+
function Uu(e) {
|
|
7196
|
+
Hu = e;
|
|
7192
7197
|
}
|
|
7193
|
-
function
|
|
7194
|
-
return
|
|
7198
|
+
function Wu() {
|
|
7199
|
+
return Hu;
|
|
7195
7200
|
}
|
|
7196
7201
|
zn(), Vn();
|
|
7197
|
-
var
|
|
7198
|
-
function
|
|
7199
|
-
return
|
|
7202
|
+
var Gu = null;
|
|
7203
|
+
function Ku() {
|
|
7204
|
+
return Wu()?.getDcaClient() ?? null;
|
|
7200
7205
|
}
|
|
7201
|
-
function
|
|
7202
|
-
let n =
|
|
7206
|
+
function qu(e, t) {
|
|
7207
|
+
let n = Wu();
|
|
7203
7208
|
if (!n) {
|
|
7204
7209
|
q("[capsule] No capsule plugin registered — capsule disabled");
|
|
7205
7210
|
return;
|
|
7206
7211
|
}
|
|
7207
7212
|
n.init(e, {
|
|
7208
|
-
getToken:
|
|
7213
|
+
getToken: gr,
|
|
7209
7214
|
apiEndpoint: t
|
|
7210
7215
|
}), q("[capsule] DcaClient initialized"), window.addEventListener(J.AUTH_INITIALIZED, () => {
|
|
7211
|
-
|
|
7216
|
+
Yu();
|
|
7212
7217
|
}), window.addEventListener(J.AUTHENTICATED, () => {
|
|
7213
|
-
|
|
7218
|
+
Ju(), Yu();
|
|
7214
7219
|
});
|
|
7215
7220
|
}
|
|
7216
|
-
function
|
|
7221
|
+
function Ju() {
|
|
7217
7222
|
document.querySelectorAll("article[publisher-content-id] sesamy-paywall[data-sesamy-injected]").forEach((e) => e.remove());
|
|
7218
7223
|
}
|
|
7219
|
-
async function
|
|
7220
|
-
let e =
|
|
7224
|
+
async function Yu() {
|
|
7225
|
+
let e = Wu();
|
|
7221
7226
|
if (!e) return null;
|
|
7222
7227
|
try {
|
|
7223
|
-
if (!await
|
|
7228
|
+
if (!await Il()) return q("[capsule] No access — skipping unlock"), Xu(), null;
|
|
7224
7229
|
} catch {}
|
|
7225
7230
|
try {
|
|
7226
7231
|
let t = await e.processPage();
|
|
7227
7232
|
return t && q(`[capsule] Decrypted ${Object.keys(t).length} content item(s)`), t;
|
|
7228
7233
|
} catch (e) {
|
|
7229
|
-
return q(`[capsule] Failed to process page: ${e}`),
|
|
7234
|
+
return q(`[capsule] Failed to process page: ${e}`), Xu(), null;
|
|
7230
7235
|
}
|
|
7231
7236
|
}
|
|
7232
|
-
function
|
|
7237
|
+
function Xu() {
|
|
7233
7238
|
let e = document.querySelectorAll("script.dca-manifest");
|
|
7234
7239
|
for (let t of e) {
|
|
7235
7240
|
let e = t.closest("article[publisher-content-id]");
|
|
@@ -7249,55 +7254,55 @@ function Yu() {
|
|
|
7249
7254
|
e.appendChild(n), q(`[capsule] Injected paywall for ${r}`);
|
|
7250
7255
|
}
|
|
7251
7256
|
}
|
|
7252
|
-
function
|
|
7253
|
-
|
|
7257
|
+
function Zu() {
|
|
7258
|
+
Gu || typeof MutationObserver > "u" || typeof document > "u" || !document.body || (Gu = new MutationObserver((e) => {
|
|
7254
7259
|
for (let t of e) for (let e of t.addedNodes) if (e instanceof HTMLElement && (e.matches?.("script.dca-manifest") || e.querySelector?.("script.dca-manifest"))) {
|
|
7255
|
-
|
|
7260
|
+
Yu();
|
|
7256
7261
|
return;
|
|
7257
7262
|
}
|
|
7258
|
-
}),
|
|
7263
|
+
}), Gu.observe(document.body, {
|
|
7259
7264
|
childList: !0,
|
|
7260
7265
|
subtree: !0
|
|
7261
7266
|
}), q("[capsule] DCA MutationObserver started"));
|
|
7262
7267
|
}
|
|
7263
7268
|
//#endregion
|
|
7264
7269
|
//#region src/services/diagnostics/index.ts
|
|
7265
|
-
var
|
|
7270
|
+
var Qu = [
|
|
7266
7271
|
"sesamy",
|
|
7267
7272
|
"__sesamy",
|
|
7268
7273
|
"__anon_id",
|
|
7269
7274
|
"auth0",
|
|
7270
7275
|
"a0",
|
|
7271
7276
|
"_legacy_auth0"
|
|
7272
|
-
],
|
|
7277
|
+
], $u = [
|
|
7273
7278
|
"access_token",
|
|
7274
7279
|
"id_token",
|
|
7275
7280
|
"refresh_token",
|
|
7276
7281
|
"token"
|
|
7277
7282
|
];
|
|
7278
|
-
function
|
|
7283
|
+
function ed(e) {
|
|
7279
7284
|
let t = e.split(".");
|
|
7280
7285
|
return t.length === 3 ? `${t[0]}.${t[1]}.[REDACTED]` : e;
|
|
7281
7286
|
}
|
|
7282
|
-
function
|
|
7287
|
+
function td(e) {
|
|
7283
7288
|
let t = e.toLowerCase();
|
|
7284
|
-
return
|
|
7289
|
+
return $u.some((e) => t.includes(e));
|
|
7285
7290
|
}
|
|
7286
|
-
function
|
|
7291
|
+
function nd(e) {
|
|
7287
7292
|
let t = e.split(".");
|
|
7288
7293
|
return t.length === 3 && t.every((e) => e.length > 0);
|
|
7289
7294
|
}
|
|
7290
|
-
function
|
|
7295
|
+
function rd(e) {
|
|
7291
7296
|
let t = [];
|
|
7292
7297
|
for (let n = 0; n < e.length; n++) {
|
|
7293
7298
|
let r = e.key(n);
|
|
7294
|
-
if (r &&
|
|
7299
|
+
if (r && Qu.some((e) => r.toLowerCase().startsWith(e.toLowerCase()))) {
|
|
7295
7300
|
let n = e.getItem(r) || "", i = !1;
|
|
7296
|
-
(
|
|
7301
|
+
(td(r) || nd(n)) && (n = ed(n), i = !0);
|
|
7297
7302
|
try {
|
|
7298
7303
|
let e = JSON.parse(n);
|
|
7299
7304
|
if (typeof e == "object" && e) {
|
|
7300
|
-
let t =
|
|
7305
|
+
let t = id(e);
|
|
7301
7306
|
t.wasRedacted && (n = JSON.stringify(t.value), i = !0);
|
|
7302
7307
|
}
|
|
7303
7308
|
} catch {}
|
|
@@ -7310,13 +7315,13 @@ function nd(e) {
|
|
|
7310
7315
|
}
|
|
7311
7316
|
return t;
|
|
7312
7317
|
}
|
|
7313
|
-
function
|
|
7318
|
+
function id(e) {
|
|
7314
7319
|
if (e == null) return {
|
|
7315
7320
|
value: e,
|
|
7316
7321
|
wasRedacted: !1
|
|
7317
7322
|
};
|
|
7318
|
-
if (typeof e == "string") return
|
|
7319
|
-
value:
|
|
7323
|
+
if (typeof e == "string") return nd(e) ? {
|
|
7324
|
+
value: ed(e),
|
|
7320
7325
|
wasRedacted: !0
|
|
7321
7326
|
} : {
|
|
7322
7327
|
value: e,
|
|
@@ -7326,7 +7331,7 @@ function rd(e) {
|
|
|
7326
7331
|
let t = !1;
|
|
7327
7332
|
return {
|
|
7328
7333
|
value: e.map((e) => {
|
|
7329
|
-
let n =
|
|
7334
|
+
let n = id(e);
|
|
7330
7335
|
return n.wasRedacted && (t = !0), n.value;
|
|
7331
7336
|
}),
|
|
7332
7337
|
wasRedacted: t
|
|
@@ -7334,9 +7339,9 @@ function rd(e) {
|
|
|
7334
7339
|
}
|
|
7335
7340
|
if (typeof e == "object") {
|
|
7336
7341
|
let t = !1, n = {};
|
|
7337
|
-
for (let [r, i] of Object.entries(e)) if (
|
|
7342
|
+
for (let [r, i] of Object.entries(e)) if (td(r) && typeof i == "string") n[r] = ed(i), t = !0;
|
|
7338
7343
|
else {
|
|
7339
|
-
let e =
|
|
7344
|
+
let e = id(i);
|
|
7340
7345
|
e.wasRedacted && (t = !0), n[r] = e.value;
|
|
7341
7346
|
}
|
|
7342
7347
|
return {
|
|
@@ -7349,7 +7354,7 @@ function rd(e) {
|
|
|
7349
7354
|
wasRedacted: !1
|
|
7350
7355
|
};
|
|
7351
7356
|
}
|
|
7352
|
-
function
|
|
7357
|
+
function ad() {
|
|
7353
7358
|
let e = navigator;
|
|
7354
7359
|
return {
|
|
7355
7360
|
userAgent: e.userAgent,
|
|
@@ -7372,46 +7377,46 @@ function id() {
|
|
|
7372
7377
|
timezoneOffset: (/* @__PURE__ */ new Date()).getTimezoneOffset()
|
|
7373
7378
|
};
|
|
7374
7379
|
}
|
|
7375
|
-
async function
|
|
7376
|
-
await
|
|
7377
|
-
let [e] = await Promise.all([
|
|
7380
|
+
async function od() {
|
|
7381
|
+
await zu();
|
|
7382
|
+
let [e] = await Promise.all([Ou()]), t = ku();
|
|
7378
7383
|
return {
|
|
7379
7384
|
adBlockEnabled: e,
|
|
7380
|
-
incognitoMode:
|
|
7385
|
+
incognitoMode: Ru() ?? !1,
|
|
7381
7386
|
inAppBrowser: t.isInAppBrowser
|
|
7382
7387
|
};
|
|
7383
7388
|
}
|
|
7384
|
-
async function
|
|
7389
|
+
async function sd(e) {
|
|
7385
7390
|
let t = [], n = {
|
|
7386
7391
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7387
|
-
sdkVersion:
|
|
7392
|
+
sdkVersion: Ec,
|
|
7388
7393
|
clientId: e.clientId,
|
|
7389
|
-
fallbackId: e.fallbackId ||
|
|
7394
|
+
fallbackId: e.fallbackId || vu()
|
|
7390
7395
|
};
|
|
7391
7396
|
n.pageUrl = window.location.href, n.pageTitle = document.title;
|
|
7392
7397
|
try {
|
|
7393
|
-
n.browser =
|
|
7398
|
+
n.browser = ad();
|
|
7394
7399
|
} catch (e) {
|
|
7395
7400
|
t.push(`Browser info collection failed: ${e.message}`);
|
|
7396
7401
|
}
|
|
7397
7402
|
try {
|
|
7398
|
-
n.detection = await
|
|
7403
|
+
n.detection = await od();
|
|
7399
7404
|
} catch (e) {
|
|
7400
7405
|
t.push(`Detection collection failed: ${e.message}`);
|
|
7401
7406
|
}
|
|
7402
7407
|
try {
|
|
7403
|
-
n.localStorage =
|
|
7408
|
+
n.localStorage = rd(localStorage);
|
|
7404
7409
|
} catch (e) {
|
|
7405
7410
|
t.push(`LocalStorage collection failed: ${e.message}`);
|
|
7406
7411
|
}
|
|
7407
7412
|
try {
|
|
7408
|
-
n.sessionStorage =
|
|
7413
|
+
n.sessionStorage = rd(sessionStorage);
|
|
7409
7414
|
} catch (e) {
|
|
7410
7415
|
t.push(`SessionStorage collection failed: ${e.message}`);
|
|
7411
7416
|
}
|
|
7412
|
-
if (await
|
|
7417
|
+
if (await hr()) {
|
|
7413
7418
|
try {
|
|
7414
|
-
let e = await
|
|
7419
|
+
let e = await gr(!1);
|
|
7415
7420
|
if (e) {
|
|
7416
7421
|
let t = e.split(".");
|
|
7417
7422
|
t.length >= 2 && (n.userId = JSON.parse(atob(t[1])).sub);
|
|
@@ -7447,14 +7452,14 @@ async function od(e) {
|
|
|
7447
7452
|
}
|
|
7448
7453
|
return t.length > 0 && (n.errors = t), n;
|
|
7449
7454
|
}
|
|
7450
|
-
async function
|
|
7451
|
-
let r = `${
|
|
7452
|
-
if (await
|
|
7453
|
-
let e = await
|
|
7455
|
+
async function cd(e, t, n) {
|
|
7456
|
+
let r = `${Ui("api2", t)}/diagnostics`, i = { "Content-Type": "application/json" };
|
|
7457
|
+
if (await hr()) try {
|
|
7458
|
+
let e = await gr(!1);
|
|
7454
7459
|
e && (i.Authorization = `Bearer ${e}`);
|
|
7455
7460
|
} catch {}
|
|
7456
7461
|
if (!i.Authorization && n) {
|
|
7457
|
-
let e =
|
|
7462
|
+
let e = vu() || "";
|
|
7458
7463
|
i.Authorization = `Basic ${btoa(`${n}|${e}:`)}`;
|
|
7459
7464
|
}
|
|
7460
7465
|
let a = await fetch(r, {
|
|
@@ -7471,11 +7476,11 @@ async function sd(e, t, n) {
|
|
|
7471
7476
|
//#endregion
|
|
7472
7477
|
//#region src/handlers/user-diagnostics.ts
|
|
7473
7478
|
zn();
|
|
7474
|
-
var
|
|
7475
|
-
function
|
|
7479
|
+
var ld = "user-diagnostics", ud = "diagnostics-id", dd = "\n .sesamy-diagnostics-modal {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;\n background: white;\n border-radius: 12px;\n padding: 24px;\n max-width: 400px;\n width: 90vw;\n box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);\n text-align: center;\n }\n\n .sesamy-diagnostics-modal h2 {\n margin: 0 0 12px;\n font-size: 20px;\n font-weight: 600;\n color: #1a1a1a;\n }\n\n .sesamy-diagnostics-modal p {\n margin: 0 0 20px;\n color: #666;\n font-size: 14px;\n line-height: 1.5;\n }\n\n .sesamy-diagnostics-modal .buttons {\n display: flex;\n gap: 12px;\n justify-content: center;\n }\n\n .sesamy-diagnostics-modal button {\n padding: 10px 20px;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.15s ease;\n border: none;\n }\n\n .sesamy-diagnostics-modal .btn-primary {\n background: #2563eb;\n color: white;\n }\n\n .sesamy-diagnostics-modal .btn-primary:hover {\n background: #1d4ed8;\n }\n\n .sesamy-diagnostics-modal .btn-primary:disabled {\n background: #93c5fd;\n cursor: not-allowed;\n }\n\n .sesamy-diagnostics-modal .btn-secondary {\n background: #f3f4f6;\n color: #374151;\n }\n\n .sesamy-diagnostics-modal .btn-secondary:hover {\n background: #e5e7eb;\n }\n\n .sesamy-diagnostics-modal .status {\n margin-top: 16px;\n font-size: 13px;\n }\n\n .sesamy-diagnostics-modal .status.success {\n color: #059669;\n }\n\n .sesamy-diagnostics-modal .status.error {\n color: #dc2626;\n }\n\n .sesamy-diagnostics-modal .status.loading {\n color: #6b7280;\n }\n\n .sesamy-diagnostics-modal .spinner {\n display: inline-block;\n width: 14px;\n height: 14px;\n border: 2px solid #e5e7eb;\n border-top-color: #2563eb;\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n margin-right: 8px;\n vertical-align: middle;\n }\n\n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n";
|
|
7480
|
+
function fd() {
|
|
7476
7481
|
let e = document.createElement("div");
|
|
7477
7482
|
return e.className = "sesamy-diagnostics-modal", e.innerHTML = `
|
|
7478
|
-
<style>${
|
|
7483
|
+
<style>${dd}</style>
|
|
7479
7484
|
<h2>Send Diagnostics</h2>
|
|
7480
7485
|
<p>
|
|
7481
7486
|
Our support team has requested diagnostic information to help troubleshoot your issue.
|
|
@@ -7488,9 +7493,9 @@ function dd() {
|
|
|
7488
7493
|
<div class="status" style="display: none;"></div>
|
|
7489
7494
|
`, e;
|
|
7490
7495
|
}
|
|
7491
|
-
function
|
|
7496
|
+
function pd(e) {
|
|
7492
7497
|
return new Promise((t) => {
|
|
7493
|
-
let n =
|
|
7498
|
+
let n = fd(), { close: r } = Rl(n, {
|
|
7494
7499
|
closeOnBackdropClick: !1,
|
|
7495
7500
|
closeOnEscape: !0
|
|
7496
7501
|
}), i = n.querySelector("[data-action=\"cancel\"]"), a = n.querySelector("[data-action=\"send\"]"), o = n.querySelector(".status"), s = (e, t) => {
|
|
@@ -7501,9 +7506,9 @@ function fd(e) {
|
|
|
7501
7506
|
}), a.addEventListener("click", async () => {
|
|
7502
7507
|
a.disabled = !0, i.disabled = !0, s("Collecting diagnostics...", "loading");
|
|
7503
7508
|
try {
|
|
7504
|
-
let n = await
|
|
7509
|
+
let n = await sd(e);
|
|
7505
7510
|
s("Sending diagnostics...", "loading");
|
|
7506
|
-
let i = await
|
|
7511
|
+
let i = await cd(n, e.environment, e.clientId);
|
|
7507
7512
|
s("Diagnostics sent successfully!", "success"), setTimeout(() => {
|
|
7508
7513
|
r(), t({
|
|
7509
7514
|
sent: !0,
|
|
@@ -7516,61 +7521,61 @@ function fd(e) {
|
|
|
7516
7521
|
});
|
|
7517
7522
|
});
|
|
7518
7523
|
}
|
|
7519
|
-
async function
|
|
7524
|
+
async function md(e) {
|
|
7520
7525
|
let t = new URLSearchParams(window.location.search);
|
|
7521
|
-
if (t.get(
|
|
7522
|
-
let n = t.get(
|
|
7526
|
+
if (t.get(ld)?.toLowerCase() !== "true") return;
|
|
7527
|
+
let n = t.get(ud);
|
|
7523
7528
|
n && (e.fallbackId = n), q("User diagnostics requested via query parameter");
|
|
7524
7529
|
let r = new URL(window.location.href);
|
|
7525
|
-
r.searchParams.delete(
|
|
7526
|
-
let i = await
|
|
7530
|
+
r.searchParams.delete(ld), r.searchParams.delete(ud), window.history.replaceState(null, "", r);
|
|
7531
|
+
let i = await pd(e);
|
|
7527
7532
|
i.sent ? q(`Diagnostics sent with ID: ${i.id}`) : q("User cancelled diagnostics");
|
|
7528
7533
|
}
|
|
7529
|
-
async function
|
|
7530
|
-
return
|
|
7534
|
+
async function hd(e) {
|
|
7535
|
+
return pd(e);
|
|
7531
7536
|
}
|
|
7532
7537
|
//#endregion
|
|
7533
7538
|
//#region src/javascript-api.ts
|
|
7534
7539
|
zn();
|
|
7535
|
-
function
|
|
7536
|
-
let { autoOnboardProduct: t, bills: n, checkouts: r, contracts: i, deleteTag: a, deleteTally: o, entitlements: s, generateLink: c, getEntitlements: l, getFulfillments: u, getProfile: d, getProxyContent: f, getSubscriptions: p, getTags: m, getTally: h, getTallies: g, getTransaction: _, hasAccess: v, isSpotifyLinked: y, linkSpotify: b, openHostedAccountPage: x, paywalls: S, paymentIssues: C, products: w, pushTally: T, requestDelivery: E, setTag: D, transactions: O, unlinkSpotify: k, updateProfile: A, userMetadata: j, vendor: M } =
|
|
7537
|
-
analytics: { track:
|
|
7540
|
+
function gd(e) {
|
|
7541
|
+
let { autoOnboardProduct: t, bills: n, checkouts: r, contracts: i, deleteTag: a, deleteTally: o, entitlements: s, generateLink: c, getEntitlements: l, getFulfillments: u, getProfile: d, getProxyContent: f, getSubscriptions: p, getTags: m, getTally: h, getTallies: g, getTransaction: _, hasAccess: v, isSpotifyLinked: y, linkSpotify: b, openHostedAccountPage: x, paywalls: S, paymentIssues: C, products: w, pushTally: T, requestDelivery: E, setTag: D, transactions: O, unlinkSpotify: k, updateProfile: A, userMetadata: j, vendor: M } = Eu(e), N = () => C.list(), P = {
|
|
7542
|
+
analytics: { track: yu },
|
|
7538
7543
|
attribution: {
|
|
7539
|
-
get:
|
|
7540
|
-
set:
|
|
7544
|
+
get: Sa,
|
|
7545
|
+
set: wa
|
|
7541
7546
|
},
|
|
7542
7547
|
auth: {
|
|
7543
7548
|
getUser: d,
|
|
7544
|
-
getTokenSilently:
|
|
7545
|
-
isAuthenticated:
|
|
7546
|
-
loginWithRedirect:
|
|
7547
|
-
loginWithPopup:
|
|
7548
|
-
login:
|
|
7549
|
-
logout:
|
|
7550
|
-
refresh:
|
|
7551
|
-
setToken:
|
|
7549
|
+
getTokenSilently: gr,
|
|
7550
|
+
isAuthenticated: hr,
|
|
7551
|
+
loginWithRedirect: yr,
|
|
7552
|
+
loginWithPopup: br,
|
|
7553
|
+
login: vr,
|
|
7554
|
+
logout: xr,
|
|
7555
|
+
refresh: Sr,
|
|
7556
|
+
setToken: Cr
|
|
7552
7557
|
},
|
|
7553
7558
|
bills: n,
|
|
7554
7559
|
browser: {
|
|
7555
|
-
detectAdblock:
|
|
7556
|
-
isInAppBrowser:
|
|
7557
|
-
isIncognito:
|
|
7560
|
+
detectAdblock: Ou,
|
|
7561
|
+
isInAppBrowser: ku,
|
|
7562
|
+
isIncognito: Ru
|
|
7558
7563
|
},
|
|
7559
7564
|
checkouts: r,
|
|
7560
|
-
clearCache:
|
|
7565
|
+
clearCache: pi,
|
|
7561
7566
|
content: {
|
|
7562
|
-
list:
|
|
7563
|
-
get:
|
|
7567
|
+
list: Pl,
|
|
7568
|
+
get: Fl,
|
|
7564
7569
|
getLanguage: Yn,
|
|
7565
|
-
hasAccess:
|
|
7566
|
-
unlock:
|
|
7567
|
-
getPropertyFromHTML:
|
|
7568
|
-
showModal:
|
|
7569
|
-
showNotificationBar:
|
|
7570
|
+
hasAccess: Il,
|
|
7571
|
+
unlock: Ll,
|
|
7572
|
+
getPropertyFromHTML: Nl,
|
|
7573
|
+
showModal: Rl,
|
|
7574
|
+
showNotificationBar: zl
|
|
7570
7575
|
},
|
|
7571
7576
|
contracts: i,
|
|
7572
7577
|
diagnostics: {
|
|
7573
|
-
send: (t) =>
|
|
7578
|
+
send: (t) => hd({
|
|
7574
7579
|
clientId: e.clientId || e.vendorId,
|
|
7575
7580
|
environment: e.environment,
|
|
7576
7581
|
fallbackId: t,
|
|
@@ -7580,7 +7585,7 @@ function hd(e) {
|
|
|
7580
7585
|
getTags: () => m(),
|
|
7581
7586
|
getTallies: () => g()
|
|
7582
7587
|
}),
|
|
7583
|
-
collect: (t) =>
|
|
7588
|
+
collect: (t) => sd({
|
|
7584
7589
|
clientId: e.clientId || e.vendorId,
|
|
7585
7590
|
environment: e.environment,
|
|
7586
7591
|
fallbackId: t,
|
|
@@ -7606,17 +7611,17 @@ function hd(e) {
|
|
|
7606
7611
|
},
|
|
7607
7612
|
hasAccess: v,
|
|
7608
7613
|
list: l,
|
|
7609
|
-
signedLinks:
|
|
7614
|
+
signedLinks: ha
|
|
7610
7615
|
},
|
|
7611
7616
|
events: {
|
|
7612
|
-
emit:
|
|
7613
|
-
cancel:
|
|
7617
|
+
emit: Bu,
|
|
7618
|
+
cancel: Vu
|
|
7614
7619
|
},
|
|
7615
7620
|
flags: {
|
|
7616
|
-
get:
|
|
7617
|
-
set:
|
|
7618
|
-
list:
|
|
7619
|
-
delete:
|
|
7621
|
+
get: Cu,
|
|
7622
|
+
set: Su,
|
|
7623
|
+
list: Tu,
|
|
7624
|
+
delete: wu
|
|
7620
7625
|
},
|
|
7621
7626
|
fulfillments: {
|
|
7622
7627
|
list: u,
|
|
@@ -7624,8 +7629,8 @@ function hd(e) {
|
|
|
7624
7629
|
},
|
|
7625
7630
|
generateLink: c,
|
|
7626
7631
|
getPaymentIssues: N,
|
|
7627
|
-
getVersion:
|
|
7628
|
-
isReady: () =>
|
|
7632
|
+
getVersion: _d,
|
|
7633
|
+
isReady: () => Qd,
|
|
7629
7634
|
log: q,
|
|
7630
7635
|
paywalls: S,
|
|
7631
7636
|
paymentIssues: C,
|
|
@@ -7660,25 +7665,25 @@ function hd(e) {
|
|
|
7660
7665
|
},
|
|
7661
7666
|
userMetadata: j,
|
|
7662
7667
|
capsule: {
|
|
7663
|
-
getClient: () =>
|
|
7664
|
-
processPage:
|
|
7668
|
+
getClient: () => Ku(),
|
|
7669
|
+
processPage: Yu
|
|
7665
7670
|
},
|
|
7666
7671
|
consent: {
|
|
7667
|
-
get:
|
|
7668
|
-
set:
|
|
7669
|
-
has:
|
|
7672
|
+
get: aa,
|
|
7673
|
+
set: sa,
|
|
7674
|
+
has: oa
|
|
7670
7675
|
},
|
|
7671
7676
|
vendor: M,
|
|
7672
|
-
setToken:
|
|
7677
|
+
setToken: Cr
|
|
7673
7678
|
};
|
|
7674
7679
|
return e.namespace && typeof window < "u" && (window[e.namespace] = P), P;
|
|
7675
7680
|
}
|
|
7676
|
-
function
|
|
7677
|
-
return
|
|
7681
|
+
function _d() {
|
|
7682
|
+
return Ec;
|
|
7678
7683
|
}
|
|
7679
7684
|
//#endregion
|
|
7680
7685
|
//#region src/services/transform/gradient.ts
|
|
7681
|
-
function
|
|
7686
|
+
function vd(e, t) {
|
|
7682
7687
|
e.style.position = "relative", e.style.height = "200px", e.style.overflow = "hidden";
|
|
7683
7688
|
let n = 0, r = Array.from(e.children);
|
|
7684
7689
|
for (let e of r) {
|
|
@@ -7701,7 +7706,7 @@ function _d(e, t) {
|
|
|
7701
7706
|
}
|
|
7702
7707
|
//#endregion
|
|
7703
7708
|
//#region src/services/transform/helpers/fetch-content.ts
|
|
7704
|
-
async function
|
|
7709
|
+
async function yd(e) {
|
|
7705
7710
|
try {
|
|
7706
7711
|
let t = await fetch(e);
|
|
7707
7712
|
return t.ok ? await t.text() : (console.error(`Failed to fetch content from ${e}: ${t.statusText}`), null);
|
|
@@ -7711,13 +7716,13 @@ async function vd(e) {
|
|
|
7711
7716
|
}
|
|
7712
7717
|
//#endregion
|
|
7713
7718
|
//#region src/services/transform/helpers/get-content.ts
|
|
7714
|
-
async function
|
|
7719
|
+
async function bd(e) {
|
|
7715
7720
|
if (e.contentType === "selector" && e.content) {
|
|
7716
7721
|
let t = document.querySelector(e.content);
|
|
7717
7722
|
if (t) return t.innerHTML;
|
|
7718
7723
|
console.warn(`Source element for selector '${e.content}' not found`);
|
|
7719
7724
|
} else if (e.contentType === "url" && e.content) {
|
|
7720
|
-
let t = await
|
|
7725
|
+
let t = await yd(e.content);
|
|
7721
7726
|
if (t) return t;
|
|
7722
7727
|
console.warn(`Failed to fetch content from URL '${e.content}'`);
|
|
7723
7728
|
} else if (e.content) return e.content;
|
|
@@ -7725,8 +7730,8 @@ async function yd(e) {
|
|
|
7725
7730
|
}
|
|
7726
7731
|
//#endregion
|
|
7727
7732
|
//#region src/services/transform/insert.ts
|
|
7728
|
-
async function
|
|
7729
|
-
let n = t.insertionPoint || "inside", r = await
|
|
7733
|
+
async function xd(e, t) {
|
|
7734
|
+
let n = t.insertionPoint || "inside", r = await bd(t);
|
|
7730
7735
|
switch (n) {
|
|
7731
7736
|
case "before":
|
|
7732
7737
|
e.insertAdjacentHTML("beforebegin", r);
|
|
@@ -7741,38 +7746,38 @@ async function bd(e, t) {
|
|
|
7741
7746
|
}
|
|
7742
7747
|
//#endregion
|
|
7743
7748
|
//#region src/services/transform/replace.ts
|
|
7744
|
-
async function
|
|
7745
|
-
e.innerHTML = await
|
|
7749
|
+
async function Sd(e, t) {
|
|
7750
|
+
e.innerHTML = await bd(t);
|
|
7746
7751
|
}
|
|
7747
7752
|
//#endregion
|
|
7748
7753
|
//#region src/services/transform/wrap.ts
|
|
7749
|
-
async function
|
|
7750
|
-
e.innerHTML = (await
|
|
7754
|
+
async function Cd(e, t) {
|
|
7755
|
+
e.innerHTML = (await bd(t)).replace("${content}", e.innerHTML);
|
|
7751
7756
|
}
|
|
7752
7757
|
//#endregion
|
|
7753
7758
|
//#region src/services/transform/index.ts
|
|
7754
|
-
async function
|
|
7755
|
-
e &&
|
|
7756
|
-
let e = await
|
|
7759
|
+
async function wd({ enabled: e = !1, rules: t }) {
|
|
7760
|
+
e && nl(async () => {
|
|
7761
|
+
let e = await hr(), n = window.location.href;
|
|
7757
7762
|
for (let r of t) {
|
|
7758
7763
|
let t = document.querySelectorAll(r.selector);
|
|
7759
7764
|
if (!(r.path && !new RegExp(r.path).test(n))) for (let n of t) {
|
|
7760
7765
|
let t = n;
|
|
7761
7766
|
if (!(r.authenticated !== void 0 && r.authenticated !== e)) switch (r.transform) {
|
|
7762
7767
|
case "insert":
|
|
7763
|
-
await
|
|
7768
|
+
await xd(t, r);
|
|
7764
7769
|
break;
|
|
7765
7770
|
case "replace":
|
|
7766
|
-
await
|
|
7771
|
+
await Sd(t, r);
|
|
7767
7772
|
break;
|
|
7768
7773
|
case "remove":
|
|
7769
7774
|
n.remove();
|
|
7770
7775
|
break;
|
|
7771
7776
|
case "wrap":
|
|
7772
|
-
await
|
|
7777
|
+
await Cd(t, r);
|
|
7773
7778
|
break;
|
|
7774
7779
|
case "gradient":
|
|
7775
|
-
|
|
7780
|
+
vd(t, r);
|
|
7776
7781
|
break;
|
|
7777
7782
|
default: console.warn(`Unknown transform type: ${r.transform}`);
|
|
7778
7783
|
}
|
|
@@ -7782,28 +7787,28 @@ async function Cd({ enabled: e = !1, rules: t }) {
|
|
|
7782
7787
|
}
|
|
7783
7788
|
//#endregion
|
|
7784
7789
|
//#region src/handlers/token.ts
|
|
7785
|
-
var
|
|
7786
|
-
function
|
|
7787
|
-
let e = new URLSearchParams(window.location.hash.substring(1)), t = e.get(
|
|
7790
|
+
var Td = "access_token";
|
|
7791
|
+
function Ed() {
|
|
7792
|
+
let e = new URLSearchParams(window.location.hash.substring(1)), t = e.get(Td);
|
|
7788
7793
|
if (t) {
|
|
7789
|
-
|
|
7794
|
+
Cr(t);
|
|
7790
7795
|
let n = new URL(window.location.href);
|
|
7791
|
-
e.delete(
|
|
7796
|
+
e.delete(Td), n.hash = e.toString(), window.history.replaceState(null, "", n);
|
|
7792
7797
|
}
|
|
7793
7798
|
}
|
|
7794
7799
|
//#endregion
|
|
7795
7800
|
//#region src/handlers/force-refresh.ts
|
|
7796
|
-
var
|
|
7797
|
-
function
|
|
7798
|
-
let e = new URLSearchParams(window.location.search), t = e.get(
|
|
7801
|
+
var Dd = "sesamy-refresh", Od = "force-refetch-entitlements";
|
|
7802
|
+
function kd() {
|
|
7803
|
+
let e = new URLSearchParams(window.location.search), t = e.get(Od), n = e.get(Dd);
|
|
7799
7804
|
if (t !== null || n !== null) {
|
|
7800
7805
|
let t = new URL(window.location.href);
|
|
7801
|
-
e.delete(
|
|
7806
|
+
e.delete(Od), e.delete(Dd), t.search = e.toString(), pi(), window.history.replaceState(null, "", t);
|
|
7802
7807
|
}
|
|
7803
7808
|
}
|
|
7804
7809
|
//#endregion
|
|
7805
7810
|
//#region src/utils/jwt.ts
|
|
7806
|
-
function
|
|
7811
|
+
function Ad(e) {
|
|
7807
7812
|
if (!e || typeof e != "string") throw Error("Invalid token: token must be a non-empty string");
|
|
7808
7813
|
let t = e.split(".");
|
|
7809
7814
|
if (t.length !== 3 && t.length !== 2) throw Error("Invalid JWT format: token must have 2 or 3 parts separated by dots");
|
|
@@ -7824,7 +7829,7 @@ function kd(e) {
|
|
|
7824
7829
|
//#endregion
|
|
7825
7830
|
//#region src/handlers/signed-links.ts
|
|
7826
7831
|
zn();
|
|
7827
|
-
function
|
|
7832
|
+
function jd(e) {
|
|
7828
7833
|
try {
|
|
7829
7834
|
let t = e.lastIndexOf(".");
|
|
7830
7835
|
if (t === -1) return {
|
|
@@ -7857,7 +7862,7 @@ function Ad(e) {
|
|
|
7857
7862
|
};
|
|
7858
7863
|
}
|
|
7859
7864
|
}
|
|
7860
|
-
function
|
|
7865
|
+
function Md(e, t) {
|
|
7861
7866
|
let n = /* @__PURE__ */ new Date(e.exp * 1e3);
|
|
7862
7867
|
return {
|
|
7863
7868
|
id: e.s?.toString() || "",
|
|
@@ -7874,7 +7879,7 @@ function jd(e, t) {
|
|
|
7874
7879
|
updatedAt: (/* @__PURE__ */ new Date(e.iat * 1e3)).toISOString()
|
|
7875
7880
|
};
|
|
7876
7881
|
}
|
|
7877
|
-
function
|
|
7882
|
+
function Nd(e, t) {
|
|
7878
7883
|
let n = /* @__PURE__ */ new Date(e.exp * 1e3), r = e.meta;
|
|
7879
7884
|
return {
|
|
7880
7885
|
id: e.tid,
|
|
@@ -7891,78 +7896,78 @@ function Md(e, t) {
|
|
|
7891
7896
|
updatedAt: (/* @__PURE__ */ new Date(e.iat * 1e3)).toISOString()
|
|
7892
7897
|
};
|
|
7893
7898
|
}
|
|
7894
|
-
function
|
|
7899
|
+
function Pd() {
|
|
7895
7900
|
let e = new URLSearchParams(window.location.search), t = e.get("sesamy_token") || e.get("sesamy-token") || e.get("token");
|
|
7896
7901
|
if (t) try {
|
|
7897
|
-
let e =
|
|
7898
|
-
e.valid && !e.expired ?
|
|
7902
|
+
let e = jd(t);
|
|
7903
|
+
e.valid && !e.expired ? ga(Nd(e.payload, t)) : e.valid ? e.expired && q("Share token has expired") : ga(Md(Ad(t), t));
|
|
7899
7904
|
} catch (e) {
|
|
7900
7905
|
q(`Failed to extract signed link ${e}`);
|
|
7901
7906
|
}
|
|
7902
7907
|
}
|
|
7903
|
-
function
|
|
7904
|
-
|
|
7908
|
+
function Fd() {
|
|
7909
|
+
Pd();
|
|
7905
7910
|
let e = new URL(window.location.href), t = e.search;
|
|
7906
7911
|
e.searchParams.delete("ss"), e.searchParams.delete("se"), e.searchParams.delete("sp"), e.searchParams.delete("so"), e.searchParams.delete("token"), e.searchParams.delete("sesamy-token"), e.searchParams.delete("sesamy_token"), e.search !== t && window.history.replaceState(null, "", e);
|
|
7907
7912
|
}
|
|
7908
7913
|
//#endregion
|
|
7909
7914
|
//#region src/handlers/user.ts
|
|
7910
7915
|
zn();
|
|
7911
|
-
var
|
|
7912
|
-
async function
|
|
7913
|
-
let e = new URLSearchParams(window.location.search).get(
|
|
7916
|
+
var Id = "sesamy-user";
|
|
7917
|
+
async function Ld() {
|
|
7918
|
+
let e = new URLSearchParams(window.location.search).get(Id)?.toLowerCase();
|
|
7914
7919
|
if (!e) return;
|
|
7915
7920
|
let t = new URL(window.location.href);
|
|
7916
|
-
if (t.searchParams.delete(
|
|
7921
|
+
if (t.searchParams.delete(Id), window.history.replaceState(null, "", t), await hr()) {
|
|
7917
7922
|
q("sesamy-user hint ignored — already authenticated");
|
|
7918
7923
|
return;
|
|
7919
7924
|
}
|
|
7920
|
-
q(`sesamy-user hint — not authenticated, starting login for ${e}`),
|
|
7925
|
+
q(`sesamy-user hint — not authenticated, starting login for ${e}`), pi(), yr({ authorizationParams: { login_hint: e } });
|
|
7921
7926
|
}
|
|
7922
7927
|
zn(), Gn(), Vn();
|
|
7923
|
-
var
|
|
7924
|
-
function
|
|
7925
|
-
let e = new URLSearchParams(window.location.search), t = e.get(
|
|
7928
|
+
var Rd = "sesamy-purchase";
|
|
7929
|
+
function zd() {
|
|
7930
|
+
let e = new URLSearchParams(window.location.search), t = e.get(Rd);
|
|
7926
7931
|
if (t !== null) {
|
|
7927
7932
|
let n = new URL(window.location.href);
|
|
7928
|
-
e.delete(
|
|
7933
|
+
e.delete(Rd), n.search = e.toString(), q(`Purchase ${t}`), Wn(J.PURCHASE, { itemSrc: t }), pi(), window.history.replaceState(null, "", n);
|
|
7929
7934
|
}
|
|
7930
7935
|
}
|
|
7931
7936
|
//#endregion
|
|
7932
7937
|
//#region src/handlers/login.ts
|
|
7933
|
-
var
|
|
7934
|
-
async function
|
|
7938
|
+
var Bd = "sesamy-login", Vd = "sesamy_login";
|
|
7939
|
+
async function Hd() {
|
|
7935
7940
|
let e = new URLSearchParams(window.location.search);
|
|
7936
|
-
if (!(e.get(
|
|
7937
|
-
await
|
|
7941
|
+
if (!(e.get(Bd) || e.get(Vd))) return;
|
|
7942
|
+
await hr() || yr();
|
|
7938
7943
|
let t = new URL(window.location.href);
|
|
7939
|
-
t.searchParams.delete(
|
|
7944
|
+
t.searchParams.delete(Bd), window.history.replaceState(null, "", t);
|
|
7940
7945
|
}
|
|
7941
7946
|
//#endregion
|
|
7942
7947
|
//#region src/handlers/debug.ts
|
|
7943
7948
|
Rn();
|
|
7944
|
-
var
|
|
7945
|
-
async function
|
|
7946
|
-
let e = new URLSearchParams(window.location.search).get(
|
|
7949
|
+
var Ud = "sesamy-debug";
|
|
7950
|
+
async function Wd() {
|
|
7951
|
+
let e = new URLSearchParams(window.location.search).get(Ud)?.toLowerCase();
|
|
7947
7952
|
if (!e) return;
|
|
7948
7953
|
Fn(e === "true");
|
|
7949
7954
|
let t = new URL(window.location.href);
|
|
7950
|
-
t.searchParams.delete(
|
|
7955
|
+
t.searchParams.delete(Ud), window.history.replaceState(null, "", t);
|
|
7951
7956
|
}
|
|
7952
7957
|
//#endregion
|
|
7953
7958
|
//#region src/utils/browser.ts
|
|
7954
|
-
function
|
|
7959
|
+
function Gd() {
|
|
7955
7960
|
return typeof window < "u";
|
|
7956
7961
|
}
|
|
7957
7962
|
//#endregion
|
|
7958
7963
|
//#region src/handlers/attribution.ts
|
|
7959
|
-
function
|
|
7964
|
+
function Kd() {
|
|
7960
7965
|
if (!document.referrer.length) return;
|
|
7961
7966
|
let e = new URL(document.referrer);
|
|
7962
7967
|
if (!(e.hostname === window.location.hostname || e.hostname.includes("sesamy"))) return console.log("handling referrer attribution:", document.referrer), document.referrer;
|
|
7963
7968
|
}
|
|
7964
|
-
async function
|
|
7965
|
-
if (!
|
|
7969
|
+
async function qd(e) {
|
|
7970
|
+
if (!Gd()) return;
|
|
7966
7971
|
let t = new URLSearchParams(window.location.search), n = {
|
|
7967
7972
|
utmSource: t.get("utm_source") ?? void 0,
|
|
7968
7973
|
utmMedium: t.get("utm_medium") ?? void 0,
|
|
@@ -7970,26 +7975,26 @@ async function Kd(e) {
|
|
|
7970
7975
|
utmTerm: t.get("utm_term") ?? void 0,
|
|
7971
7976
|
utmContent: t.get("utm_content") ?? void 0,
|
|
7972
7977
|
ref: t.get("ref") ?? void 0,
|
|
7973
|
-
referrer:
|
|
7978
|
+
referrer: Kd()
|
|
7974
7979
|
}, [r] = e.content.list();
|
|
7975
|
-
n.itemSrc = r?.url || window.location.href, r?.id && (n.publisherContentId = r.id),
|
|
7980
|
+
n.itemSrc = r?.url || window.location.href, r?.id && (n.publisherContentId = r.id), wa(n);
|
|
7976
7981
|
}
|
|
7977
7982
|
//#endregion
|
|
7978
7983
|
//#region src/handlers/login-reload.ts
|
|
7979
7984
|
zn();
|
|
7980
|
-
function
|
|
7985
|
+
function Jd() {
|
|
7981
7986
|
let e = new URLSearchParams(window.location.search), t = !1;
|
|
7982
7987
|
try {
|
|
7983
7988
|
t = !!window.opener && window.opener.location.origin === window.location.origin;
|
|
7984
7989
|
} catch {
|
|
7985
7990
|
t = !1;
|
|
7986
7991
|
}
|
|
7987
|
-
let n = sessionStorage.getItem(
|
|
7988
|
-
!t || n || (sessionStorage.setItem(
|
|
7992
|
+
let n = sessionStorage.getItem(Ri) === "true", r = e.has("code") || e.has("error") || e.has("state");
|
|
7993
|
+
!t || n || (sessionStorage.setItem(Ri, "true"), r || (q("Reloading page to get query params in incognito browser"), window.location.reload()));
|
|
7989
7994
|
}
|
|
7990
7995
|
//#endregion
|
|
7991
7996
|
//#region src/handlers/links.ts
|
|
7992
|
-
async function
|
|
7997
|
+
async function Yd(e) {
|
|
7993
7998
|
let t = (e) => (t) => {
|
|
7994
7999
|
t.preventDefault();
|
|
7995
8000
|
try {
|
|
@@ -8014,7 +8019,7 @@ async function Jd(e) {
|
|
|
8014
8019
|
}
|
|
8015
8020
|
//#endregion
|
|
8016
8021
|
//#region src/handlers/visibility.ts
|
|
8017
|
-
async function
|
|
8022
|
+
async function Xd(e) {
|
|
8018
8023
|
let t = await e.auth.isAuthenticated();
|
|
8019
8024
|
try {
|
|
8020
8025
|
document.querySelectorAll(`[sesamy-visibility="${t ? "not-logged-in" : "logged-in"}"]`).forEach((e) => {
|
|
@@ -8028,15 +8033,15 @@ async function Yd(e) {
|
|
|
8028
8033
|
}
|
|
8029
8034
|
//#endregion
|
|
8030
8035
|
//#region src/handlers/locked-content-redirect.ts
|
|
8031
|
-
async function
|
|
8036
|
+
async function Zd(e) {
|
|
8032
8037
|
let t = $("sesamy:locked-content-redirect-url");
|
|
8033
8038
|
if (!t) return;
|
|
8034
8039
|
let [n] = e.content.list();
|
|
8035
8040
|
n && (await e.entitlements.hasAccess(n.url || "", n.pass?.split(",") || []) || (location.href = t));
|
|
8036
8041
|
}
|
|
8037
8042
|
Gn(), Vn(), zn();
|
|
8038
|
-
var
|
|
8039
|
-
async function
|
|
8043
|
+
var Qd = !1;
|
|
8044
|
+
async function $d(e, t, n) {
|
|
8040
8045
|
let r = e.auth?.idToken ? {
|
|
8041
8046
|
...e,
|
|
8042
8047
|
auth: {
|
|
@@ -8046,7 +8051,7 @@ async function Qd(e, t, n) {
|
|
|
8046
8051
|
} : e;
|
|
8047
8052
|
q(`Init with config: ${JSON.stringify(r)}`);
|
|
8048
8053
|
try {
|
|
8049
|
-
|
|
8054
|
+
Jd(), ca(e.consent), fu({
|
|
8050
8055
|
clientId: e.clientId,
|
|
8051
8056
|
environment: e.environment,
|
|
8052
8057
|
...e.analytics
|
|
@@ -8056,7 +8061,7 @@ async function Qd(e, t, n) {
|
|
|
8056
8061
|
organization: e.organization,
|
|
8057
8062
|
environment: e.environment,
|
|
8058
8063
|
...e.auth
|
|
8059
|
-
}), await
|
|
8064
|
+
}), await rl(), _l(e, t), e.capsule?.enabled && (qu(e.capsule, e.api?.endpoint), Pd(), e.capsule.autoProcess !== !1 && (await Yu(), Zu())), e.transform && await wd(e.transform), zu(), Wd(), md({
|
|
8060
8065
|
clientId: e.clientId || e.vendorId,
|
|
8061
8066
|
environment: e.environment,
|
|
8062
8067
|
getProfile: () => t.profile.get(),
|
|
@@ -8064,15 +8069,15 @@ async function Qd(e, t, n) {
|
|
|
8064
8069
|
getContracts: () => t.contracts.list(),
|
|
8065
8070
|
getTags: () => t.tags.list(),
|
|
8066
8071
|
getTallies: () => t.tallies.list()
|
|
8067
|
-
}),
|
|
8072
|
+
}), qd(t), Ed(), kd(), Fd(), await Hd(), await Ld(), zd(), await Xd(t), await Yd(t), await Zd(t), Qd = !0, Wn(J.READY, {});
|
|
8068
8073
|
} catch (e) {
|
|
8069
8074
|
q(`Failed to init ${e.message}`);
|
|
8070
8075
|
}
|
|
8071
8076
|
}
|
|
8072
|
-
async function
|
|
8077
|
+
async function ef(e, t) {
|
|
8073
8078
|
q("Initializing Sesamy");
|
|
8074
8079
|
let n = e.api?.namespace || "sesamy";
|
|
8075
|
-
if (
|
|
8080
|
+
if (Gd() && n in window) return q("Sesamy already initialized. This is likely due to a duplicate import"), Qd = !0, window[n];
|
|
8076
8081
|
e.auth?.useHttpCookies && !e.api?.endpoint && (e = {
|
|
8077
8082
|
...e,
|
|
8078
8083
|
api: {
|
|
@@ -8081,17 +8086,17 @@ async function $d(e, t) {
|
|
|
8081
8086
|
}
|
|
8082
8087
|
}, q("useHttpCookies=true with no api.endpoint — defaulting to same-origin /api"));
|
|
8083
8088
|
let r = t?.authPlugin;
|
|
8084
|
-
if (!r && !Jn() &&
|
|
8089
|
+
if (!r && !Jn() && Gd()) {
|
|
8085
8090
|
let e = window;
|
|
8086
8091
|
typeof e.auth0Plugin?.createAuth0Plugin == "function" && (r = e.auth0Plugin.createAuth0Plugin());
|
|
8087
8092
|
}
|
|
8088
8093
|
let i = t?.capsulePlugin;
|
|
8089
|
-
if (!i && !
|
|
8094
|
+
if (!i && !Wu() && Gd()) {
|
|
8090
8095
|
let e = window;
|
|
8091
8096
|
typeof e.capsulePlugin?.createCapsulePlugin == "function" && (i = e.capsulePlugin.createCapsulePlugin());
|
|
8092
8097
|
}
|
|
8093
|
-
i &&
|
|
8094
|
-
let a =
|
|
8098
|
+
i && Uu(i);
|
|
8099
|
+
let a = gd({
|
|
8095
8100
|
clientId: e.clientId,
|
|
8096
8101
|
vendorId: e.vendorId,
|
|
8097
8102
|
environment: e.environment,
|
|
@@ -8099,16 +8104,16 @@ async function $d(e, t) {
|
|
|
8099
8104
|
...e.api,
|
|
8100
8105
|
namespace: n
|
|
8101
8106
|
});
|
|
8102
|
-
return
|
|
8107
|
+
return Gd() ? (e.awaitAllServices ? await $d(e, a, r) : $d(e, a, r), a) : (Qd = !0, a);
|
|
8103
8108
|
}
|
|
8104
|
-
if (
|
|
8109
|
+
if (Gd()) {
|
|
8105
8110
|
window.__sesamyLoaded = !0;
|
|
8106
8111
|
let e = document.getElementById("sesamy-js");
|
|
8107
8112
|
if (e?.textContent) try {
|
|
8108
|
-
|
|
8113
|
+
ef(JSON.parse(e.textContent));
|
|
8109
8114
|
} catch (e) {
|
|
8110
8115
|
console.error("Failed to parse config", e);
|
|
8111
8116
|
}
|
|
8112
8117
|
}
|
|
8113
8118
|
//#endregion
|
|
8114
|
-
export { J as Events,
|
|
8119
|
+
export { J as Events, Ml as clearMetadataCache, Dl as getAllLdJson, bl as getAllMetaTags, aa as getConsent, gl as getContentConfig, jl as getContentMetadata, Ku as getDcaClient, El as getLdJson, oa as hasConsent, ef as init, Qd as isInitialized, qn as registerAuthPlugin, Uu as registerCapsulePlugin, sa as setConsent };
|