UNPKG

@braze/web-sdk

Version:

Braze SDK for web sites and other JS platforms.

52 lines (51 loc) 1.05 kB
import { STORAGE_KEYS as s } from "./storage-manager.js"; import u from "./subscription-manager.js"; import { logger as N, IndexedDBAdapter as et } from "../../shared-lib/index.js"; export default class Bt { constructor(t, i, s) { (this.C = t), (this.gh = i), (this.ph = s), (this.C = t), (this.gh = i || !1), (this.ph = s), (this.Fh = new u()), (this.kh = 0), (this.fh = 1); } wh() { return this.gh; } jh() { return this.C.ft(s.gt.xh); } setSdkAuthenticationSignature(t) { const i = this.jh(); this.C.Bt(s.gt.xh, t); const e = et.Ds.Us; new et(e, N).setItem(e.Ls.qh, this.fh, t), i !== t && this.it(); } yh() { this.C.Ut(s.gt.xh); const t = et.Ds.Us; new et(t, N).ge(t.Ls.qh, this.fh); } subscribeToSdkAuthenticationFailures(t) { return this.ph.Dt(t); } Bh(t) { this.ph.X(t); } Gh() { this.Fh.removeAllSubscriptions(); } Hh() { this.kh += 1; } Jh() { return this.kh; } it() { this.kh = 0; } }