@braze/web-sdk
Version:
Braze SDK for web sites and other JS platforms.
52 lines (51 loc) • 1.25 kB
JavaScript
import { REQUEST_ATTEMPT_DEFAULT as Ae } from "../common/constants.js";
import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
const h = {
H: {
Yi: "data",
Ci: "content_cards/sync",
ke: "feature_flags/sync",
mn: "template",
G: "banners/sync",
},
vl: (t) => (null == t ? void 0 : t.lt(s.ct.SE)),
nm: (t) => (null == t ? void 0 : t.lt(s.ct._E)),
rm: (t, e) => {
null == t || t.ft(s.ct.SE, e);
},
um: (t, e) => {
null == t || t.ft(s.ct._E, e);
},
Gu: (t, e) => {
if (!t || !e) return -1;
const s = h.vl(t);
if (null == s) return -1;
const n = s[e];
return null == n || isNaN(n) ? -1 : n;
},
_u: (t, e) => {
let s = Ae;
if (!t || !e) return s;
const n = h.nm(t);
return null == n ? s : ((s = n[e]), null == s || isNaN(s) ? Ae : s);
},
K: (t, e, s) => {
if (!t || !e) return;
let n = h.vl(t);
null == n && (n = {}), (n[e] = s), h.rm(t, n);
},
Wu: (t, e, s) => {
if (!t || !e) return;
let n = h.nm(t);
null == n && (n = {}), (n[e] = s), h.um(t, n);
},
fi: (t, e) => {
t && e && h.Wu(t, e, Ae);
},
sl: (t, e) => {
if (!t || !e) return;
const s = h._u(t, e);
h.Wu(t, e, s + 1);
},
};
export default h;