@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 Ge } from "../common/constants.js";
import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
const h = {
it: {
pn: "data",
Ji: "content_cards/sync",
Co: "feature_flags/sync",
Yo: "template",
st: "banners/sync",
},
Pl: (t) => (null == t ? void 0 : t.Rt(s.Tt.iS)),
Am: (t) => (null == t ? void 0 : t.Rt(s.Tt.ES)),
Rm: (t, e) => {
null == t || t.It(s.Tt.iS, e);
},
qm: (t, e) => {
null == t || t.It(s.Tt.ES, e);
},
ql: (t, e) => {
if (!t || !e) return -1;
const s = h.Pl(t);
if (null == s) return -1;
const n = s[e];
return null == n || isNaN(n) ? -1 : n;
},
Al: (t, e) => {
let s = Ge;
if (!t || !e) return s;
const n = h.Am(t);
return null == n ? s : ((s = n[e]), null == s || isNaN(s) ? Ge : s);
},
nt: (t, e, s) => {
if (!t || !e) return;
let n = h.Pl(t);
null == n && (n = {}), (n[e] = s), h.Rm(t, n);
},
Dl: (t, e, s) => {
if (!t || !e) return;
let n = h.Am(t);
null == n && (n = {}), (n[e] = s), h.qm(t, n);
},
Li: (t, e) => {
t && e && h.Dl(t, e, Ge);
},
zl: (t, e) => {
if (!t || !e) return;
const s = h.Al(t, e);
h.Dl(t, e, s + 1);
},
};
export default h;