🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@braze/web-sdk

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@braze/web-sdk - npm Package Compare versions

Comparing version
6.9.0
to
6.10.0
+22
src/Core/logout.js
import r from "../managers/braze-instance.js";
import { unregisterPush } from "../Push/unregister-push.js";
import { disableSDK } from "./disable-sdk.js";
import { wipeData } from "./wipe-data.js";
export const logoutDependencies = {
unregisterPush: unregisterPush,
disableSDK: disableSDK,
wipeData: wipeData,
};
export function logout(e, o) {
r.rr() &&
logoutDependencies.unregisterPush(
() => {
logoutDependencies.wipeData(),
logoutDependencies.disableSDK(),
"function" == typeof e && e();
},
() => {
"function" == typeof o && o();
},
);
}
import r from "../managers/braze-instance.js";
import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
import ui from "../models/push-token.js";
import l from "../util/net.js";
import h from "../util/request-header-utils.js";
export function unregisterPushTokenOnServer() {
if (!r.rr()) return;
const e = r.m();
if (!e) return;
const t = r.p(),
n = null == t ? void 0 : t.St(s.It.Uu);
if (!n || "object" != typeof n || Array.isArray(n)) return;
const o = ui._u(n);
if (!o.endpoint) return;
const i = e.Z({}, !0);
i.push_token = o.endpoint;
const a = e.tt(i, h.it.qa);
e.et(
i,
(n = -1) => {
r.rr() &&
(h.nt(t, h.it.qa, new Date().valueOf()),
-1 !== n && a.push(["X-Braze-Req-Tokens-Remaining", n.toString()]),
l.ot({
url: `${e.ht()}/push/unregister`,
data: i,
headers: a,
lt: (r) => {
e.ut(i, r, a) && e.ct();
},
}));
},
h.it.qa,
);
}
+1
-1
{
"name": "@braze/web-sdk",
"version": "6.9.0",
"version": "6.10.0",
"description": "Braze SDK for web sites and other JS platforms.",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -6,4 +6,4 @@ const p = {

Fc: "ca",
gl: "i",
Ya: "ie",
bl: "i",
Qa: "ie",
vs: "cci",

@@ -10,0 +10,0 @@ ws: "ccic",

@@ -9,3 +9,3 @@ export default class et {

}
Od() {
kd() {
if ("indexedDB" in this.parent) return this.parent.indexedDB;

@@ -16,6 +16,6 @@ }

try {
if (null == this.Od()) return !1;
if (null == this.kd()) return !1;
{
const e =
null === (t = this.Od()) || void 0 === t
null === (t = this.kd()) || void 0 === t
? void 0

@@ -30,3 +30,3 @@ : t.open("Braze IndexedDB Support Test");

const t = window,
e = t.chrome || t.browser || t.kd;
e = t.chrome || t.browser || t.Kd;
if (e && e.runtime && e.runtime.id)

@@ -51,8 +51,8 @@ return (

}
Kd(t, e) {
Gd(t, e) {
var n;
const o =
null === (n = this.Od()) || void 0 === n
null === (n = this.kd()) || void 0 === n
? void 0
: n.open(this.database.Gd, this.database.VERSION);
: n.open(this.database.Hd, this.database.VERSION);
if (null == o) return "function" == typeof e && e(), !1;

@@ -65,3 +65,3 @@ const i = this;

"Upgrading indexedDB " +
i.database.Gd +
i.database.Hd +
" to v" +

@@ -97,3 +97,3 @@ i.database.VERSION +

"Could not open indexedDB " +
i.database.Gd +
i.database.Hd +
" v" +

@@ -114,3 +114,3 @@ i.database.VERSION +

const r = this;
return this.Kd((d) => {
return this.Gd((d) => {
if (!d.objectStoreNames.contains(t))

@@ -124,3 +124,3 @@ return (

" on indexedDB " +
r.database.Gd +
r.database.Hd +
" - " +

@@ -143,3 +143,3 @@ t +

" on indexedDB " +
r.database.Gd,
r.database.Hd,
),

@@ -156,3 +156,3 @@ "function" == typeof i && i();

const o = this;
return this.Kd((i) => {
return this.Gd((i) => {
if (!i.objectStoreNames.contains(t))

@@ -166,3 +166,3 @@ return (

" on indexedDB " +
o.database.Gd +
o.database.Hd +
" - " +

@@ -184,3 +184,3 @@ t +

" on indexedDB " +
o.database.Gd,
o.database.Hd,
);

@@ -198,3 +198,3 @@ }),

const o = this;
return this.Kd((i) => {
return this.Gd((i) => {
if (!i.objectStoreNames.contains(t))

@@ -206,3 +206,3 @@ return (

" on indexedDB " +
o.database.Gd +
o.database.Hd +
" - " +

@@ -220,3 +220,3 @@ t +

o.Ud.error(
"Could not open cursor for " + t + " on indexedDB " + o.database.Gd,
"Could not open cursor for " + t + " on indexedDB " + o.database.Hd,
),

@@ -237,3 +237,3 @@ "function" == typeof n && n();

const n = this;
return this.Kd((o) => {
return this.Gd((o) => {
if (!o.objectStoreNames.contains(t))

@@ -247,3 +247,3 @@ return (

" on indexedDB " +
n.database.Gd +
n.database.Hd +
" - " +

@@ -264,3 +264,3 @@ t +

" on indexedDB " +
n.database.Gd,
n.database.Hd,
);

@@ -273,3 +273,3 @@ };

const n = this;
return this.Kd((o) => {
return this.Gd((o) => {
if (!o.objectStoreNames.contains(t))

@@ -281,3 +281,3 @@ return (

" on indexedDB " +
n.database.Gd +
n.database.Hd +
" - " +

@@ -300,3 +300,3 @@ t +

" on indexedDB " +
n.database.Gd,
n.database.Hd,
),

@@ -308,3 +308,3 @@ e(s))

" on indexedDB " +
n.database.Gd,
n.database.Hd,
);

@@ -336,3 +336,3 @@ }),

const e = this;
return this.Kd(function (n) {
return this.Gd(function (n) {
const o = n.transaction(t, "readwrite");

@@ -347,3 +347,3 @@ o.oncomplete = () => n.close();

" on indexedDB " +
e.database.Gd,
e.database.Hd,
);

@@ -354,3 +354,3 @@ };

e.Ud.error(
"Could not clear object stores on indexedDB " + e.database.Gd,
"Could not clear object stores on indexedDB " + e.database.Hd,
);

@@ -363,3 +363,3 @@ };

Xs: {
Gd: "AppboyServiceWorkerAsyncStorage",
Hd: "AppboyServiceWorkerAsyncStorage",
VERSION: 6,

@@ -370,3 +370,3 @@ Ws: {

Fu: "pushSubscribed",
Hd: "fallbackDevice",
Vd: "fallbackDevice",
Vs: "cardUpdates",

@@ -373,0 +373,0 @@ pe: "optOut",

@@ -27,3 +27,3 @@ const b = {

if (b.zg) {
const o = "Braze SDK Warning: " + n + " (v6.9.0)";
const o = "Braze SDK Warning: " + n + " (v6.10.0)";
null != b.Ud ? b.Ud(o) : console.warn(o);

@@ -34,3 +34,3 @@ }

if (b.zg) {
const o = "Braze SDK Error: " + n + " (v6.9.0)";
const o = "Braze SDK Error: " + n + " (v6.10.0)";
null != b.Ud ? b.Ud(o) : console.error(o);

@@ -37,0 +37,0 @@ }

@@ -17,3 +17,3 @@ export default {

Ma: "safariWebsitePushId",
qa: "localization",
Aa: "localization",
sr: "contentSecurityNonce",

@@ -20,0 +20,0 @@ nr: "allowUserSuppliedJavascript",

@@ -14,2 +14,3 @@ export { addSdkMetadata } from "./add-sdk-metadata.js";

export { logCustomEvent } from "./log-custom-event.js";
export { logout } from "./logout.js";
export { logEcommerceEvent } from "./log-ecommerce-event.js";

@@ -16,0 +17,0 @@ export { logPurchase } from "./log-purchase.js";

import r, { OPTIONS as U } from "../managers/braze-instance.js";
import ro from "../util/browser-detector.js";
import gr from "./l10n-manager.js";
import jr from "./l10n-manager.js";
const Je = {

@@ -11,3 +11,3 @@ i: !1,

t = !1;
r.er(U.qa) && ((e = r.er(U.qa)), (t = !0)), (Je.na = new gr(e, t));
r.er(U.Aa) && ((e = r.er(U.Aa)), (t = !0)), (Je.na = new jr(e, t));
}

@@ -14,0 +14,0 @@ return Je.na;

import { logger as b } from "../../shared-lib/index.js";
import zt from "../common/translations.js";
export default class gr {
export default class jr {
constructor(t, e = !1) {

@@ -5,0 +5,0 @@ if (

@@ -45,3 +45,3 @@ import Gt from "./auth-manager.js";

Ma: "safariWebsitePushId",
qa: "localization",
Aa: "localization",
sr: "contentSecurityNonce",

@@ -81,3 +81,3 @@ nr: "allowUserSuppliedJavascript",

(this.In = []),
(this.Vh = "6.9.0");
(this.Vh = "6.10.0");
}

@@ -84,0 +84,0 @@ Zh(t) {

@@ -48,4 +48,4 @@ import ro from "../util/browser-detector.js";

Fa() {
if (ro.Aa()) return ro.Aa();
const t = this.j.St(s.It.Ba);
if (ro.Ba()) return ro.Ba();
const t = this.j.St(s.It.Ha);
return t && t.os_version ? t.os_version : ro.Fa();

@@ -70,5 +70,5 @@ }

const r = t.getTimezoneOffset();
return this.Ha(r);
return this.Ka(r);
}
Ha(t) {
Ka(t) {
const e = Math.trunc(t / 60),

@@ -75,0 +75,0 @@ r = Math.trunc(t % 60);

@@ -51,8 +51,8 @@ import Ne from "../models/backend-errors.js";

n = r.ta(),
o = this.j.St(s.It.Ba);
o = this.j.St(s.It.Ha);
oi(o, n) || (t.device = n),
(t.api_key = this.tu),
(t.time = X(new Date().valueOf(), !0));
const a = this.j.St(s.It.Ka) || [],
h = this.j.St(s.It.Pa) || "";
const a = this.j.St(s.It.Pa) || [],
h = this.j.St(s.It.Ua) || "";
this.$a.length > 0 &&

@@ -95,3 +95,3 @@ (!oi(a, this.$a) || h !== this.C.$t()) &&

b.error(`SDK Authentication failed ${e}`),
this.Ua(t.events || [], t.attributes || []),
this.Wa(t.events || [], t.attributes || []),
this.Gh.Ch(r),

@@ -105,24 +105,24 @@ !1

switch (s) {
case Ne.Wa:
case Ne.Ya:
return (
(i = "Received successful response with empty body."),
v.Dt(p.Ya, { e: i }),
v.Dt(p.Qa, { e: i }),
b.info(i),
!1
);
case Ne.Qa:
case Ne.Va:
return (
(i = "Received successful response with invalid JSON"),
v.Dt(p.Ya, { e: i + ": " + e.response }),
v.Dt(p.Qa, { e: i + ": " + e.response }),
b.info(i),
!1
);
case Ne.Va:
case Ne.Za:
s = `The API key "${t.api_key}" is invalid for the baseUrl ${this.Yh}`;
break;
case Ne.Za:
case Ne.dl:
s =
"Sorry, we are not currently accepting your requests. If you think this is in error, please contact us.";
break;
case Ne.dl:
case Ne.fl:
s =

@@ -135,6 +135,6 @@ "No device identifier. Please contact Braze Technical Support for assistance.";

}
fl(t, e, i) {
ml(t, e, i) {
return !!((t && 0 !== t.length) || (e && 0 !== e.length) || i);
}
ml(t, e, i, s = !1) {
vl(t, e, i, s = !1) {
const r = [],

@@ -171,3 +171,3 @@ n = (t) => t || "",

}
if ((this.Ua(l, u), (a = this.Z(a, !1, s)), d)) {
if ((this.Wa(l, u), (a = this.Z(a, !1, s)), d)) {
d = this.Z(d, !1, s);

@@ -177,7 +177,7 @@ const t = { requestData: d, headers: this.tt(d, h.it.pn) };

}
if (a && !this.fl(a.events, a.attributes, t)) return d ? r : null;
if (a && !this.ml(a.events, a.attributes, t)) return d ? r : null;
const f = { requestData: a, headers: this.tt(a, h.it.pn) };
return r.push(f), r;
}
Ua(t, e) {
Wa(t, e) {
if (t) {

@@ -191,3 +191,3 @@ const e = [];

}
if (e) for (const t of e) this.j.vl(t);
if (e) for (const t of e) this.j.Rl(t);
}

@@ -198,4 +198,4 @@ dt(t, e) {

}
Rl(t) {
return v.Dt(p.gl, { n: t });
gl(t) {
return v.Dt(p.bl, { n: t });
}

@@ -212,6 +212,6 @@ Zo(t, e) {

}
bl(t) {
ql(t) {
const e = new Date().valueOf();
let i = Ke.toString();
const s = h.ql(this.j, t);
const s = h.Al(this.j, t);
if (-1 !== s) {

@@ -224,5 +224,5 @@ i = (e - s).toString();

const s = [["X-Braze-Api-Key", this.tu]],
r = this.bl(e);
r = this.ql(e);
s.push(["X-Braze-Last-Req-Ms-Ago", r]);
const n = h.Al(this.j, e).toString();
const n = h.Dl(this.j, e).toString();
s.push(["X-Braze-Req-Attempt", n]);

@@ -237,4 +237,4 @@ let o = !1;

s.push(["X-Braze-ContentCardsRequest", "true"]);
let t = h.Al(this.j, h.it.Mi);
(t && "client" !== i) || ((t = 1), h.Dl(this.j, h.it.Mi, t));
let t = h.Dl(this.j, h.it.Mi);
(t && "client" !== i) || ((t = 1), h.Tl(this.j, h.it.Mi, t));
const e = Math.max(0, t - 1);

@@ -255,3 +255,3 @@ s.push(["BRAZE-SYNC-RETRY-COUNT", e.toString()]), (o = !0);

}
Tl(t, e, i, s) {
kl(t, e, i, s) {
if (this.La[s]) return;

@@ -272,3 +272,3 @@ const r = window.setTimeout(() => {

et(t, e, i, r) {
if (!this.kl(i))
if (!this.yl(i))
return (

@@ -278,6 +278,6 @@ b.info(`${this.Xa(i)}SDK request being rate limited.`),

);
const n = this.yl();
if (!n.wl)
const n = this.wl();
if (!n.Nl)
return (
this.Tl(n.Nl, t, e, i),
this.kl(n.Bl, t, e, i),
void b.info(

@@ -287,15 +287,15 @@ `${this.Xa(

)}SDK request being rate limited. Request will be retried in ${Math.trunc(
n.Nl / 1e3,
n.Bl / 1e3,
)} seconds.`,
)
);
this.j.Pt(s.It.Bl, new Date().valueOf());
this.j.Pt(s.It.Sl, new Date().valueOf());
const o = t.device;
o && o.os_version instanceof Promise
? o.os_version.then((i) => {
(t.device.os_version = i), e(n.Sl);
(t.device.os_version = i), e(n.Cl);
})
: e(n.Sl);
: e(n.Cl);
}
Cl(t) {
zl(t) {
const e = t ? Oe(t) : null;

@@ -311,3 +311,3 @@ if (!e || !e["retry-after"]) return null;

"Received unexpected value for retry-after header in /sync response";
v.Dt(p.Ya, { e: t + ": " + i });
v.Dt(p.Qa, { e: t + ": " + i });
}

@@ -317,6 +317,6 @@ return null;

yt(t, e, i, s, r, n) {
if (h.Al(this.j, i) >= Pe) return;
if (h.Dl(this.j, i) >= Pe) return;
let o;
n = n || 0;
const a = this.Cl(t);
const a = this.zl(t);
r();

@@ -327,3 +327,3 @@ const u = (t) => {

}, t);
s(r), h.zl(this.j, i);
s(r), h.jl(this.j, i);
};

@@ -341,33 +341,33 @@ if (a && !isNaN(a.value)) {

}
jl(t) {
Ml(t) {
var e;
null === (e = this.j) || void 0 === e || e.Pt(s.It.Ml, t);
null === (e = this.j) || void 0 === e || e.Pt(s.It.Xl, t);
}
Xl(t, e) {
let i = this.$l();
null == i && (i = {}), (i[t] = e), this.j.Pt(s.It.Ll, i);
$l(t, e) {
let i = this.Ll();
null == i && (i = {}), (i[t] = e), this.j.Pt(s.It.El, i);
}
El() {
Fl() {
var t;
return null === (t = this.j) || void 0 === t ? void 0 : t.St(s.It.Ml);
return null === (t = this.j) || void 0 === t ? void 0 : t.St(s.It.Xl);
}
$l() {
Ll() {
var t;
return null === (t = this.j) || void 0 === t ? void 0 : t.St(s.It.Ll);
return null === (t = this.j) || void 0 === t ? void 0 : t.St(s.It.El);
}
Fl(t, e, i, s, r = "") {
Il(t, e, i, s, r = "") {
let n;
if (r) {
const t = this.$l();
const t = this.Ll();
n = null == t || isNaN(t[r]) ? e : t[r];
} else (n = this.El()), (null == n || isNaN(n)) && (n = e);
} else (n = this.Fl()), (null == n || isNaN(n)) && (n = e);
const o = (t - s) / 1e3;
return (n = Math.min(n + o / i, e)), n;
}
Il(t, e) {
Kl(t, e) {
return Math.max(0, (1 - t) * e * 1e3);
}
Kl(t, e = "") {
Pl(t, e = "") {
var i, r, n, o, a;
const u = { wl: !0, Sl: -1, Nl: 0 };
const u = { Nl: !0, Cl: -1, Bl: 0 };
if ((null == t && (t = !0), !t && !e)) return u;

@@ -377,5 +377,5 @@ let l,

d = null;
if (t) d = null === (i = this.j) || void 0 === i ? void 0 : i.St(s.It.Bl);
if (t) d = null === (i = this.j) || void 0 === i ? void 0 : i.St(s.It.Sl);
else {
const t = h.Pl(this.j);
const t = h.Ul(this.j);
if (null == t || null == t[e]) return u;

@@ -388,8 +388,8 @@ d = t[e];

? ((l =
(null === (r = this.h) || void 0 === r ? void 0 : r.Ul()) || -1),
(c = (null === (n = this.h) || void 0 === n ? void 0 : n.xl()) || -1))
(null === (r = this.h) || void 0 === r ? void 0 : r.xl()) || -1),
(c = (null === (n = this.h) || void 0 === n ? void 0 : n.Hl()) || -1))
: ((l =
(null === (o = this.h) || void 0 === o ? void 0 : o.Hl(e)) || -1),
(null === (o = this.h) || void 0 === o ? void 0 : o.Ol(e)) || -1),
(c =
(null === (a = this.h) || void 0 === a ? void 0 : a.Ol(e)) || -1)),
(null === (a = this.h) || void 0 === a ? void 0 : a.Gl(e)) || -1)),
-1 === l || -1 === c)

@@ -399,16 +399,16 @@ )

const f = new Date().valueOf();
let m = this.Fl(f, l, c, d, e);
let m = this.Il(f, l, c, d, e);
return m < 1
? ((u.wl = !1), (u.Nl = this.Il(m, c)), u)
? ((u.Nl = !1), (u.Bl = this.Kl(m, c)), u)
: ((m = Math.trunc(m) - 1),
(u.Sl = m),
t ? this.jl(m) : this.Xl(e, m),
(u.Cl = m),
t ? this.Ml(m) : this.$l(e, m),
u);
}
yl() {
return this.Kl(!0);
wl() {
return this.Pl(!0);
}
kl(t) {
const e = this.Kl(!1, t);
return !(e && !e.wl);
yl(t) {
const e = this.Pl(!1, t);
return !(e && !e.Nl);
}

@@ -415,0 +415,0 @@ ct() {

@@ -16,3 +16,2 @@ import { STORAGE_KEYS as s } from "./storage-manager.js";

(this.j = t),
(this.Gl = new f()),
(this._l = new f()),

@@ -23,21 +22,22 @@ (this.Vl = new f()),

(this.Wl = new f()),
(this.Yl = null),
(this.Zl = null);
(this.Yl = new f()),
(this.Zl = null),
(this.ed = null);
}
ed() {
if (null == this.Zl) {
const t = this.j.St(s.It.sd);
this.Zl = null != t ? di._u(t) : new di();
sd() {
if (null == this.ed) {
const t = this.j.St(s.It.nd);
this.ed = null != t ? di._u(t) : new di();
}
return this.Zl;
return this.ed;
}
Qt() {
return this.ed().nd;
return this.sd().ld;
}
ld(t) {
ud(t) {
var i, e, n, l, r, o;
if (null != t && null != t.config) {
const u = t.config;
if (u.time > this.ed().nd) {
const t = (t) => (null == t ? this.ed().ud : t),
if (u.time > this.sd().ld) {
const t = (t) => (null == t ? this.sd().ad : t),
a = new di(

@@ -60,5 +60,5 @@ u.time,

let h = !1;
null != a.ad && this.ju() !== a.ad && (h = !0);
null != a.hd && this.ju() !== a.hd && (h = !0);
let d = !1;
null != a.hd.enabled && this.Pi() !== a.hd.enabled && (d = !0);
null != a.dd.enabled && this.Pi() !== a.dd.enabled && (d = !0);
let c = !1;

@@ -78,14 +78,14 @@ null != a.Xr.enabled && this.lo() !== a.Xr.enabled && (c = !0);

let g = !1;
null != (null === (r = a.dd) || void 0 === r ? void 0 : r.enabled) &&
this.vd() !==
(null === (o = a.dd) || void 0 === o ? void 0 : o.enabled) &&
null != (null === (r = a.vd) || void 0 === r ? void 0 : r.enabled) &&
this.md() !==
(null === (o = a.vd) || void 0 === o ? void 0 : o.enabled) &&
(g = !0),
(this.Zl = a),
this.j.Pt(s.It.sd, a.qt()),
h && this.Gl.A(),
d && this._l.A(),
c && this.Vl.A(),
v && this.Jl.A(),
m && this.Ql.A(),
g && this.Wl.A();
(this.ed = a),
this.j.Pt(s.It.nd, a.qt()),
h && this._l.A(),
d && this.Vl.A(),
c && this.Jl.A(),
v && this.Ql.A(),
m && this.Wl.A(),
g && this.Yl.A();
}

@@ -95,62 +95,62 @@ }

xu(t) {
const i = this.Gl.Ut(t);
return this.Yl && this.Gl.removeSubscription(this.Yl), (this.Yl = i), i;
const i = this._l.Ut(t);
return this.Zl && this._l.removeSubscription(this.Zl), (this.Zl = i), i;
}
$i(t) {
return this._l.Ut(t);
return this.Vl.Ut(t);
}
bo(t) {
return this.Vl.Ut(t);
return this.Jl.Ut(t);
}
V(t) {
return this.Jl.Ut(t);
return this.Ql.Ut(t);
}
Tr(t) {
return this.Ql.Ut(t);
}
md(t) {
return this.Wl.Ut(t);
}
gd(t) {
return this.Yl.Ut(t);
}
$e(t) {
return -1 !== this.ed().gd.indexOf(t);
return -1 !== this.sd().bd.indexOf(t);
}
qu(t) {
return -1 !== this.ed().bd.indexOf(t);
return -1 !== this.sd().fd.indexOf(t);
}
$r(t) {
return -1 !== this.ed().fd.indexOf(t);
return -1 !== this.sd().pd.indexOf(t);
}
pd() {
return this.ed().Rd;
Rd() {
return this.sd().Cd;
}
ju() {
return this.ed().ad;
return this.sd().hd;
}
Pi() {
return this.ed().hd.enabled || !1;
return this.sd().dd.enabled || !1;
}
Cd() {
const t = this.ed().ud;
Ed() {
const t = this.sd().ad;
return !(!t || null == t.enabled) && t.enabled;
}
Ul() {
if (!this.Cd()) return -1;
const t = this.ed().ud;
xl() {
if (!this.Ed()) return -1;
const t = this.sd().ad;
return null == t.capacity || t.capacity < 10 ? -1 : t.capacity;
}
xl() {
if (!this.Cd()) return -1;
const t = this.ed().ud;
Hl() {
if (!this.Ed()) return -1;
const t = this.sd().ad;
return null == t.refill_rate || t.refill_rate <= 0 ? -1 : t.refill_rate;
}
Ed(t) {
const i = this.ed().ud.endpoint_overrides;
wd(t) {
const i = this.sd().ad.endpoint_overrides;
return null == i ? null : i[t];
}
Hl(t) {
const i = this.Ed(t);
Ol(t) {
const i = this.wd(t);
return null == i || isNaN(i.capacity) || i.capacity <= 0 ? -1 : i.capacity;
}
Ol(t) {
const i = this.Ed(t);
Gl(t) {
const i = this.wd(t);
return null == i || isNaN(i.refill_rate) || i.refill_rate <= 0

@@ -161,8 +161,8 @@ ? -1

lo() {
return this.ed().Xr.enabled && null == this.Ro()
? (v.Dt(p.Ya, { e: "Missing feature flag refresh_rate_limit." }), !1)
: this.ed().Xr.enabled || !1;
return this.sd().Xr.enabled && null == this.Ro()
? (v.Dt(p.Qa, { e: "Missing feature flag refresh_rate_limit." }), !1)
: this.sd().Xr.enabled || !1;
}
Ro() {
return this.ed().Xr.refresh_rate_limit;
return this.sd().Xr.refresh_rate_limit;
}

@@ -172,3 +172,3 @@ Ot() {

return (
(null === (t = this.ed().banners) || void 0 === t ? void 0 : t.enabled) ||
(null === (t = this.sd().banners) || void 0 === t ? void 0 : t.enabled) ||
null

@@ -180,3 +180,3 @@ );

return (
(null === (t = this.ed().banners) || void 0 === t
(null === (t = this.sd().banners) || void 0 === t
? void 0

@@ -189,3 +189,3 @@ : t.max_placements) || 0

const i =
null === (t = this.ed().banners) || void 0 === t
null === (t = this.sd().banners) || void 0 === t
? void 0

@@ -198,9 +198,9 @@ : t.dismissals_cache_size;

return (
(null === (t = this.ed().dust) || void 0 === t ? void 0 : t.enabled) || !1
(null === (t = this.sd().dust) || void 0 === t ? void 0 : t.enabled) || !1
);
}
vd() {
md() {
var t;
return (
(null === (t = this.ed().dd) || void 0 === t ? void 0 : t.enabled) || !1
(null === (t = this.sd().vd) || void 0 === t ? void 0 : t.enabled) || !1
);

@@ -211,3 +211,3 @@ }

const i =
null === (t = this.ed().wd) || void 0 === t
null === (t = this.sd().Bd) || void 0 === t
? void 0

@@ -220,3 +220,3 @@ : t.min_sleep_duration_ms;

const i =
null === (t = this.ed().wd) || void 0 === t ? void 0 : t.scale_factor;
null === (t = this.sd().Bd) || void 0 === t ? void 0 : t.scale_factor;
return null != i ? i : m;

@@ -227,3 +227,3 @@ }

const i =
null === (t = this.ed().wd) || void 0 === t
null === (t = this.sd().Bd) || void 0 === t
? void 0

@@ -233,5 +233,5 @@ : t.max_sleep_duration_ms;

}
Bd() {
return this.ed().Td;
Td() {
return this.sd().yd;
}
}

@@ -20,3 +20,3 @@ import { STORAGE_KEYS as s } from "../managers/storage-manager.js";

(this.h = i);
const n = this.h.Bd();
const n = this.h.Td();
(this.im = n ? 1e3 * n : ts),

@@ -46,3 +46,3 @@ (null == e || isNaN(e)) && (e = 1800),

const t = new Date().valueOf(),
i = this.h.pd();
i = this.h.Rd();
if (null == i) return !1;

@@ -49,0 +49,0 @@ const e = this.j.St(s.It.dm),

@@ -24,8 +24,8 @@ import Ie from "../models/braze-event.js";

tS: "ab.storage.attributes.anonymous_user",
Ba: "ab.storage.device",
Ka: "ab.storage.sdk_metadata",
Pa: "ab.storage.session_id_for_cached_metadata",
Ha: "ab.storage.device",
Pa: "ab.storage.sdk_metadata",
Ua: "ab.storage.session_id_for_cached_metadata",
Uu: "ab.storage.pushToken",
eS: "ab.storage.cardImpressions",
sd: "ab.storage.serverConfig",
nd: "ab.storage.serverConfig",
sS: "ab.storage.triggers",

@@ -37,4 +37,4 @@ rS: "ab.storage.triggers.ts",

yi: "ab.storage.ccLastCardUpdated",
Ml: "ab.storage.globalRateLimitCurrentTokenCount",
Ll: "ab.storage.dynamicRateLimitCurrentTokenCount",
Xl: "ab.storage.globalRateLimitCurrentTokenCount",
El: "ab.storage.dynamicRateLimitCurrentTokenCount",
Zt: "ab.storage.ccClicks",

@@ -56,3 +56,3 @@ ps: "ab.storage.ccImpressions",

pa: "ab.storage.deferredIam",
Bl: "ab.storage.lastSdkReq",
Sl: "ab.storage.lastSdkReq",
lS: "ab.storage.alias",

@@ -150,3 +150,3 @@ Tt: "ab.storage.banners",

JSON.stringify(t)),
e.push(new Ie(null, p.Ya, new Date().valueOf(), null, { e: o }));
e.push(new Ie(null, p.Qa, new Date().valueOf(), null, { e: o }));
}

@@ -200,3 +200,3 @@ return e;

}
vl(t) {
Rl(t) {
let e = this.uS.wr(STORAGE_KEYS.It.$E);

@@ -240,3 +240,3 @@ null == e && (e = {});

(r[User.Sa] = t),
this.vl(r));
this.Rl(r));
}

@@ -243,0 +243,0 @@ const s = this.$u(STORAGE_KEYS.Ou.um);

export default {
Va: "invalid_api_key",
Za: "blacklisted",
dl: "no_device_identifier",
Qa: "invalid_json_response",
Wa: "empty_response",
Za: "invalid_api_key",
dl: "blacklisted",
fl: "no_device_identifier",
Va: "invalid_json_response",
Ya: "empty_response",
__: "sdk_auth_error",
};

@@ -8,3 +8,3 @@ import { rehydrateDateAfterJsonization as ee } from "../util/date-utils.js";

(this.sc = l),
(this.ad = h),
(this.hd = h),
(this.endpoint = t || null),

@@ -14,3 +14,3 @@ (this.Wu = i || null),

(this.sc = l || null),
(this.ad = h || null);
(this.hd = h || null);
}

@@ -23,3 +23,3 @@ qt() {

u: this.sc,
v: this.ad,
v: this.hd,
};

@@ -26,0 +26,0 @@ }

@@ -22,34 +22,34 @@ import {

) {
(this.nd = t),
(this.gd = i),
(this.bd = s),
(this.fd = h),
(this.Rd = l),
(this.ad = e),
(this.hd = r),
(this.ld = t),
(this.bd = i),
(this.fd = s),
(this.pd = h),
(this.Cd = l),
(this.hd = e),
(this.dd = r),
(this.Xr = n),
(this.ud = a),
(this.ad = a),
(this.banners = o),
(this.dust = u),
(this.wd = c),
(this.Td = d),
(this.dd = m);
(this.Bd = c),
(this.yd = d),
(this.vd = m);
}
qt() {
return {
s: "6.9.0",
l: this.nd,
e: this.gd,
a: this.bd,
p: this.fd,
m: this.Rd,
v: this.ad,
c: this.hd,
s: "6.10.0",
l: this.ld,
e: this.bd,
a: this.fd,
p: this.pd,
m: this.Cd,
v: this.hd,
c: this.dd,
f: this.Xr,
grl: this.ud,
grl: this.ad,
b: this.banners,
d: this.dust,
rb: this.wd,
mst: this.Td,
ch: this.dd,
rb: this.Bd,
mst: this.yd,
ch: this.vd,
};

@@ -60,3 +60,3 @@ }

return (
"6.9.0" !== t.s && (i = 0),
"6.10.0" !== t.s && (i = 0),
new di(

@@ -63,0 +63,0 @@ i,

@@ -343,3 +343,3 @@ import { isArray as g, isEqual as oi } from "../util/code-utils.js";

if (!It.isPushSupported())
return b.info(na.Au), void ("function" == typeof t && t());
return b.info(na.Au), void ("function" == typeof i && i());
this.hu

@@ -346,0 +346,0 @@ ? navigator.serviceWorker.getRegistration(this.su).then((e) => {

import r from "../managers/braze-instance.js";
import ra from "./push-manager-factory.js";
import { unregisterPushTokenOnServer as gr } from "./unregister-push-token-on-server.js";
export function unregisterPush(e, n) {
if (r.rr()) return ra.ra().unsubscribe(e, n);
if (r.rr()) return gr(), ra.ra().unsubscribe(e, n);
}

@@ -82,11 +82,11 @@ import {

? (this.Gh.ct(),
this.h.ld(i),
this.h.ud(i),
(null != t.respond_with &&
t.respond_with.user_id != this.Ss.getUserId()) ||
(null != t.device && this.j.Pt(s.It.Ba, t.device),
(null != t.device && this.j.Pt(s.It.Ha, t.device),
null != t.sdk_metadata &&
(this.j.Pt(s.It.Ka, t.sdk_metadata),
this.j.Pt(s.It.Pa, this.C.$t())),
(this.j.Pt(s.It.Pa, t.sdk_metadata),
this.j.Pt(s.It.Ua, this.C.$t())),
this.hc(i),
h.Dl(this.j, h.it.pn, 1),
h.Tl(this.j, h.it.pn, 1),
"function" == typeof e && e()))

@@ -100,3 +100,3 @@ : i.auth_error && (d = !0);

(this.nc = Math.max(this.nc - 1, 0)),
this.B.Ua(t.events, t.attributes),
this.B.Wa(t.events, t.attributes),
"function" == typeof n && n();

@@ -106,3 +106,3 @@ },

"function" == typeof o && o(!d);
const e = this.B.Cl(s);
const e = this.B.zl(s);
let n = 0;

@@ -119,3 +119,3 @@ if (e)

if (d) {
h.zl(this.j, h.it.pn);
h.jl(this.j, h.it.pn);
const t = this.h.vt(),

@@ -140,5 +140,5 @@ i = this.h.gt(),

);
if (i && !this.B.fl(c, d, p))
if (i && !this.B.ml(c, d, p))
return this.kc(), void ("function" == typeof o && o(!0));
const v = this.B.ml(p, c, d, u);
const v = this.B.vl(p, c, d, u);
p && this.nc++;

@@ -236,6 +236,6 @@ let w = !1;

Sc() {
this.j.Vt(s.It.Bl),
this.j.Vt(s.It.Sl),
this.j.Vt(s.It.ES),
this.j.Vt(s.It.Ml),
this.j.Vt(s.It.Ll);
this.j.Vt(s.It.Xl),
this.j.Vt(s.It.El);
}

@@ -254,3 +254,3 @@ changeUser(t, i, e) {

null != h && this.j.Vt(s.It.eS),
this.j.Vt(s.It.Ba),
this.j.Vt(s.It.Ha),
this.j.Vt(s.It.lS),

@@ -339,3 +339,3 @@ this.Sc(),

for (const i of t)
if (i.api_key === this.tu) this.B.Ua(i.events, i.attributes);
if (i.api_key === this.tu) this.B.Wa(i.events, i.attributes);
else {

@@ -342,0 +342,0 @@ const t = et._s.Xs;

import pi from "./trigger-condition.js";
export default class jr {
export default class wr {
constructor(t) {

@@ -10,3 +10,3 @@ (this.if = t), (this.if = t);

static fromJson(t) {
return new jr(t ? t.campaign_id : null);
return new wr(t ? t.campaign_id : null);
}

@@ -13,0 +13,0 @@ qt() {

@@ -7,3 +7,3 @@ import es from "./custom-event-data.js";

import fs from "./purchase-property-data.js";
import jr from "./push-click-data.js";
import wr from "./push-click-data.js";
import ot from "./trigger-events.js";

@@ -42,3 +42,3 @@ import { logger as b } from "../../../shared-lib/index.js";

case pi.la.Sr:
r = jr.fromJson(e.data);
r = wr.fromJson(e.data);
break;

@@ -73,3 +73,3 @@ case pi.la.he:

case pi.la.Sr:
r = new jr(e.d);
r = new wr(e.d);
break;

@@ -76,0 +76,0 @@ case pi.la.he:

@@ -17,7 +17,7 @@ import {

(this.data = l),
(this.yd = o),
(this.jd = n),
(this.jd = o),
(this.Nd = n),
(this.ca = a),
(this.Nd = u),
(this._d = d),
(this._d = u),
(this.Ad = d),
(this.id = t),

@@ -31,23 +31,23 @@ (this.Pd = i || []),

(this.type = h),
(this.yd = o || 0),
null == a && (a = 1e3 * (this.yd + 30)),
(this.jd = o || 0),
null == a && (a = 1e3 * (this.jd + 30)),
(this.ca = a),
(this.data = l),
null != n && (this.jd = n),
(this.Nd = u),
(this._d = d || null);
null != n && (this.Nd = n),
(this._d = u),
(this.Ad = d || null);
}
Ad(t) {
Id(t) {
return (
null == this._d || (this.jd !== gt.Dd && t - this._d >= 1e3 * this.jd)
null == this.Ad || (this.Nd !== gt.Dd && t - this.Ad >= 1e3 * this.Nd)
);
}
Id(t) {
this._d = t;
$d(t) {
this.Ad = t;
}
$d(t) {
const i = t + 1e3 * this.yd;
xd(t) {
const i = t + 1e3 * this.jd;
return Math.max(i - new Date().valueOf(), 0);
}
xd(t) {
zd(t) {
const i = new Date().valueOf() - t,

@@ -97,7 +97,7 @@ s = null == t || isNaN(i) || null == this.ca || i < this.ca;

da: this.data,
d: this.yd,
r: this.jd,
d: this.jd,
r: this.Nd,
tm: this.ca,
ss: this.Nd,
ld: this._d,
ss: this._d,
ld: this.Ad,
};

@@ -125,2 +125,2 @@ }

}
(gt.la = { oa: "inapp", zd: "templated_iam" }), (gt.Dd = -1);
(gt.la = { oa: "inapp", Md: "templated_iam" }), (gt.Dd = -1);

@@ -44,3 +44,3 @@ import t from "../common/base-provider.js";

const i = this.triggers[t];
i.id && null != this.og[i.id] && i.Id(this.og[i.id]);
i.id && null != this.og[i.id] && i.$d(this.og[i.id]);
}

@@ -74,3 +74,3 @@ }

const n = t[r],
o = s.$d(n.ma || 0);
o = s.xd(n.ma || 0);
if (o > 0) {

@@ -123,3 +123,3 @@ let t, r;

null != this.og[h.id] &&
(h.Id(this.og[h.id]), (e[h.id] = this.og[h.id])),
(h.$d(this.og[h.id]), (e[h.id] = this.og[h.id])),
h.id && null != this.ng[h.id] && (r[h.id] = this.ng[h.id]);

@@ -153,3 +153,3 @@ for (let t = 0; t < h.Pd.length; t++)

const r = new Date().valueOf();
t.xd(i) ||
t.zd(i) ||
(!1 === navigator.onLine && t.type === gt.la.oa && e.imageUrl

@@ -159,3 +159,3 @@ ? b.info(

)
: t.Ad(r) && this.wg(t, r, s)
: t.Id(r) && this.wg(t, r, s)
? 0 === this.Rs.Ve()

@@ -174,3 +174,3 @@ ? b.info(

if (null != h)
if ((this.Tg(h, i, s, e, r), h.xd(i))) {
if ((this.Tg(h, i, s, e, r), h.zd(i))) {
let t = `Server aborted in-app message display, but the timeout on fallback trigger ${h.id} has already elapsed.`;

@@ -182,3 +182,3 @@ r.length > 0 && (t += " Continuing to fall back."), b.info(t), n();

);
const n = 1e3 * h.yd - (new Date().valueOf() - i);
const n = 1e3 * h.jd - (new Date().valueOf() - i);
n > 0

@@ -208,3 +208,3 @@ ? this.eg.push(

break;
case gt.la.zd:
case gt.la.Md:
if (((a = Jt.fromJson(t.data, h, n, i, t.ca || 0)), null == a)) {

@@ -239,5 +239,5 @@ b.error(

const r = this.triggers[s],
l = e + 1e3 * r.yd;
l = e + 1e3 * r.jd;
if (
r.Ad(l) &&
r.Id(l) &&
(null == r.startTime || r.startTime.valueOf() <= e) &&

@@ -272,3 +272,3 @@ (null == r.endTime || r.endTime.valueOf() >= e)

this.Tg(l, e, t, s, o),
0 === l.yd
0 === l.jd
? this.cg(l, e, t, s, o)

@@ -278,3 +278,3 @@ : this.eg.push(

this.cg(l, e, t, s, o);
}, 1e3 * l.yd),
}, 1e3 * l.jd),
));

@@ -304,3 +304,3 @@ }

);
let e = t.Nd;
let e = t._d;
return null == e && (e = this.tg), i - this.hg >= 1e3 * e;

@@ -321,3 +321,3 @@ }

this.fg(),
t.Id(i),
t.$d(i),
(this.hg = i),

@@ -324,0 +324,0 @@ t.id && (this.og[t.id] = i),

export const CartUpdatedActions = {
REPLACE: "replace",
Ld: "add",
Md: "remove",
Od: "remove",
};
import r, { OPTIONS as U } from "../../managers/braze-instance.js";
export function attachCSS(n, t, o) {
const c = n || document.querySelector("head"),
e = `ab-${t}-css-definitions-${"6.9.0".replace(/\./g, "-")}`;
e = `ab-${t}-css-definitions-${"6.10.0".replace(/\./g, "-")}`;
if (!c) return;

@@ -6,0 +6,0 @@ const s = c.ownerDocument || document;

@@ -31,3 +31,3 @@ import Si from "./client-hints-parser.js";

}
Aa() {
Ba() {
return this.OS || null;

@@ -34,0 +34,0 @@ }

@@ -211,3 +211,3 @@ import { logger as b } from "../../shared-lib/index.js";

if (!1 === e || !1 === r || null == o) return null;
const c = r === un.Ld || r === un.Md,
const c = r === un.Ld || r === un.Od,
i =

@@ -214,0 +214,0 @@ void 0 === n.total_value && c ? void 0 : pn(n.total_value, "total_value");

@@ -30,3 +30,3 @@ import { logger as b } from "../../shared-lib/index.js";

const n = {
error: "" === e.responseText ? Ne.Wa : Ne.Qa,
error: "" === e.responseText ? Ne.Ya : Ne.Va,
response: e.responseText,

@@ -33,0 +33,0 @@ };

@@ -10,43 +10,44 @@ import { REQUEST_ATTEMPT_DEFAULT as Qe } from "../common/constants.js";

st: "banners/sync",
qa: "unregister",
},
Pl: (t) => (null == t ? void 0 : t.St(s.It.ES)),
Am: (t) => (null == t ? void 0 : t.St(s.It.SS)),
Rm: (t, e) => {
null == t || t.Pt(s.It.ES, e);
Ul: (e) => (null == e ? void 0 : e.St(s.It.ES)),
Rm: (e) => (null == e ? void 0 : e.St(s.It.SS)),
Am: (e, t) => {
null == e || e.Pt(s.It.ES, t);
},
qm: (t, e) => {
null == t || t.Pt(s.It.SS, e);
qm: (e, t) => {
null == e || e.Pt(s.It.SS, t);
},
ql: (t, e) => {
if (!t || !e) return -1;
const s = h.Pl(t);
Al: (e, t) => {
if (!e || !t) return -1;
const s = h.Ul(e);
if (null == s) return -1;
const n = s[e];
const n = s[t];
return null == n || isNaN(n) ? -1 : n;
},
Al: (t, e) => {
Dl: (e, t) => {
let s = Qe;
if (!t || !e) return s;
const n = h.Am(t);
return null == n ? s : ((s = n[e]), null == s || isNaN(s) ? Qe : s);
if (!e || !t) return s;
const n = h.Rm(e);
return null == n ? s : ((s = n[t]), null == s || isNaN(s) ? Qe : s);
},
nt: (t, e, s) => {
if (!t || !e) return;
let n = h.Pl(t);
null == n && (n = {}), (n[e] = s), h.Rm(t, n);
nt: (e, t, s) => {
if (!e || !t) return;
let n = h.Ul(e);
null == n && (n = {}), (n[t] = s), h.Am(e, n);
},
Dl: (t, e, s) => {
if (!t || !e) return;
let n = h.Am(t);
null == n && (n = {}), (n[e] = s), h.qm(t, n);
Tl: (e, t, s) => {
if (!e || !t) return;
let n = h.Rm(e);
null == n && (n = {}), (n[t] = s), h.qm(e, n);
},
Ji: (t, e) => {
t && e && h.Dl(t, e, Qe);
Ji: (e, t) => {
e && t && h.Tl(e, t, Qe);
},
zl: (t, e) => {
if (!t || !e) return;
const s = h.Al(t, e);
h.Dl(t, e, s + 1);
jl: (e, t) => {
if (!e || !t) return;
const s = h.Dl(e, t);
h.Tl(e, t, s + 1);
},
};
export default h;

Sorry, the diff of this file is too big to display