@braze/web-sdk
Advanced tools
Comparing version 5.2.0 to 5.3.0
{ | ||
"name": "@braze/web-sdk", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"description": "Braze SDK for web sites and other JS platforms.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
const i = { | ||
CustomEvent: "ce", | ||
Pr: "p", | ||
xu: "pc", | ||
_u: "pc", | ||
vc: "ca", | ||
Ua: "i", | ||
Ms: "ie", | ||
Ea: "i", | ||
qs: "ie", | ||
M: "cci", | ||
@@ -12,15 +12,15 @@ R: "ccic", | ||
F: "ccd", | ||
kl: "ss", | ||
ql: "ss", | ||
xl: "se", | ||
Xe: "si", | ||
Ve: "sc", | ||
We: "sbc", | ||
Oi: "si", | ||
Ei: "sc", | ||
Gi: "sbc", | ||
Cc: "sfe", | ||
po: "iec", | ||
Pu: "lr", | ||
Mu: "uae", | ||
mo: "iec", | ||
Uu: "lr", | ||
zu: "uae", | ||
O: "ci", | ||
$: "cc", | ||
Ou: "lcaa", | ||
Nu: "lcar", | ||
Ju: "lcaa", | ||
Eu: "lcar", | ||
On: "inc", | ||
@@ -31,6 +31,6 @@ Ln: "add", | ||
Bn: "ncam", | ||
Uu: "sgu", | ||
Ku: "sgu", | ||
Fr: "ffi", | ||
}, | ||
or = { Br: "feed_displayed", Ec: "content_cards_displayed" }; | ||
or = { Ar: "feed_displayed", Ec: "content_cards_displayed" }; | ||
export { i as EventTypes, or as InternalEventTypes }; |
export default class A { | ||
constructor(t, e) { | ||
(this.database = t), | ||
(this.dd = e), | ||
(this.vd = e), | ||
(this.parent = "undefined" == typeof window ? self : window), | ||
(this.database = t), | ||
(this.dd = e); | ||
(this.vd = e); | ||
} | ||
ud() { | ||
Dd() { | ||
if ("indexedDB" in this.parent) return this.parent.indexedDB; | ||
@@ -15,6 +15,6 @@ } | ||
try { | ||
if (null == this.ud()) return !1; | ||
if (null == this.Dd()) return !1; | ||
{ | ||
const e = | ||
null === (t = this.ud()) || void 0 === t | ||
null === (t = this.Dd()) || void 0 === t | ||
? void 0 | ||
@@ -29,6 +29,6 @@ : t.open("Braze IndexedDB Support Test"); | ||
const t = window, | ||
e = t.chrome || t.browser || t.fd; | ||
e = t.chrome || t.browser || t.pd; | ||
if (e && e.runtime && e.runtime.id) | ||
return ( | ||
this.dd.info( | ||
this.vd.info( | ||
"Not using IndexedDB for storage because we are running inside an extension", | ||
@@ -43,3 +43,3 @@ ), | ||
return ( | ||
this.dd.info( | ||
this.vd.info( | ||
"Not using IndexedDB for storage due to following error: " + t, | ||
@@ -51,8 +51,8 @@ ), | ||
} | ||
ad(t, e) { | ||
Bd(t, e) { | ||
var n; | ||
const o = | ||
null === (n = this.ud()) || void 0 === n | ||
null === (n = this.Dd()) || void 0 === n | ||
? void 0 | ||
: n.open(this.database.vd, this.database.VERSION); | ||
: n.open(this.database.Sd, this.database.VERSION); | ||
if (null == o) return "function" == typeof e && e(), !1; | ||
@@ -63,5 +63,5 @@ const i = this; | ||
var e; | ||
i.dd.info( | ||
i.vd.info( | ||
"Upgrading indexedDB " + | ||
i.database.vd + | ||
i.database.Sd + | ||
" to v" + | ||
@@ -85,3 +85,3 @@ i.database.VERSION + | ||
"function" == typeof e && e(), | ||
i.dd.error( | ||
i.vd.error( | ||
"Needed to close the database unexpectedly because of an upgrade in another tab", | ||
@@ -96,5 +96,5 @@ ); | ||
return ( | ||
i.dd.info( | ||
i.vd.info( | ||
"Could not open indexedDB " + | ||
i.database.vd + | ||
i.database.Sd + | ||
" v" + | ||
@@ -115,6 +115,6 @@ i.database.VERSION + | ||
const r = this; | ||
return this.ad((d) => { | ||
return this.Bd((d) => { | ||
if (!d.objectStoreNames.contains(t)) | ||
return ( | ||
r.dd.error( | ||
r.vd.error( | ||
"Could not store object " + | ||
@@ -125,3 +125,3 @@ e + | ||
" on indexedDB " + | ||
r.database.vd + | ||
r.database.Sd + | ||
" - " + | ||
@@ -138,3 +138,3 @@ t + | ||
(u.onerror = () => { | ||
r.dd.error( | ||
r.vd.error( | ||
"Could not store object " + | ||
@@ -145,3 +145,3 @@ e + | ||
" on indexedDB " + | ||
r.database.vd, | ||
r.database.Sd, | ||
), | ||
@@ -158,6 +158,6 @@ "function" == typeof i && i(); | ||
const o = this; | ||
return this.ad((i) => { | ||
return this.Bd((i) => { | ||
if (!i.objectStoreNames.contains(t)) | ||
return ( | ||
o.dd.error( | ||
o.vd.error( | ||
"Could not retrieve object " + | ||
@@ -168,3 +168,3 @@ e + | ||
" on indexedDB " + | ||
o.database.vd + | ||
o.database.Sd + | ||
" - " + | ||
@@ -180,3 +180,3 @@ t + | ||
(d.onerror = () => { | ||
o.dd.error( | ||
o.vd.error( | ||
"Could not retrieve object " + | ||
@@ -187,3 +187,3 @@ e + | ||
" on indexedDB " + | ||
o.database.vd, | ||
o.database.Sd, | ||
); | ||
@@ -201,10 +201,10 @@ }), | ||
const o = this; | ||
return this.ad((i) => { | ||
return this.Bd((i) => { | ||
if (!i.objectStoreNames.contains(t)) | ||
return ( | ||
o.dd.error( | ||
o.vd.error( | ||
"Could not retrieve last record from " + | ||
t + | ||
" on indexedDB " + | ||
o.database.vd + | ||
o.database.Sd + | ||
" - " + | ||
@@ -221,4 +221,4 @@ t + | ||
(d.onerror = () => { | ||
o.dd.error( | ||
"Could not open cursor for " + t + " on indexedDB " + o.database.vd, | ||
o.vd.error( | ||
"Could not open cursor for " + t + " on indexedDB " + o.database.Sd, | ||
), | ||
@@ -239,6 +239,6 @@ "function" == typeof n && n(); | ||
const n = this; | ||
return this.ad((o) => { | ||
return this.Bd((o) => { | ||
if (!o.objectStoreNames.contains(t)) | ||
return ( | ||
n.dd.error( | ||
n.vd.error( | ||
"Could not delete record " + | ||
@@ -249,3 +249,3 @@ e + | ||
" on indexedDB " + | ||
n.database.vd + | ||
n.database.Sd + | ||
" - " + | ||
@@ -260,3 +260,3 @@ t + | ||
i.objectStore(t).delete(e).onerror = () => { | ||
n.dd.error( | ||
n.vd.error( | ||
"Could not delete record " + | ||
@@ -267,3 +267,3 @@ e + | ||
" on indexedDB " + | ||
n.database.vd, | ||
n.database.Sd, | ||
); | ||
@@ -276,10 +276,10 @@ }; | ||
const n = this; | ||
return this.ad((o) => { | ||
return this.Bd((o) => { | ||
if (!o.objectStoreNames.contains(t)) | ||
return ( | ||
n.dd.error( | ||
n.vd.error( | ||
"Could not retrieve objects from " + | ||
t + | ||
" on indexedDB " + | ||
n.database.vd + | ||
n.database.Sd + | ||
" - " + | ||
@@ -298,14 +298,14 @@ t + | ||
s.length > 0 | ||
? (n.dd.info( | ||
? (n.vd.info( | ||
"Cursor closed midway through for " + | ||
t + | ||
" on indexedDB " + | ||
n.database.vd, | ||
n.database.Sd, | ||
), | ||
e(s)) | ||
: n.dd.error( | ||
: n.vd.error( | ||
"Could not open cursor for " + | ||
t + | ||
" on indexedDB " + | ||
n.database.vd, | ||
n.database.Sd, | ||
); | ||
@@ -337,3 +337,3 @@ }), | ||
const e = this; | ||
return this.ad(function (n) { | ||
return this.Bd(function (n) { | ||
const o = n.transaction(t, "readwrite"); | ||
@@ -344,7 +344,7 @@ o.oncomplete = () => n.close(); | ||
o.objectStore(i).clear().onerror = function () { | ||
e.dd.error( | ||
e.vd.error( | ||
"Could not clear " + | ||
this.source.name + | ||
" on indexedDB " + | ||
e.database.vd, | ||
e.database.Sd, | ||
); | ||
@@ -354,4 +354,4 @@ }; | ||
o.onerror = function () { | ||
e.dd.error( | ||
"Could not clear object stores on indexedDB " + e.database.vd, | ||
e.vd.error( | ||
"Could not clear object stores on indexedDB " + e.database.Sd, | ||
); | ||
@@ -364,9 +364,9 @@ }; | ||
Qt: { | ||
vd: "AppboyServiceWorkerAsyncStorage", | ||
Sd: "AppboyServiceWorkerAsyncStorage", | ||
VERSION: 6, | ||
ss: { | ||
La: "data", | ||
$a: "data", | ||
hr: "pushClicks", | ||
cu: "pushSubscribed", | ||
Dd: "fallbackDevice", | ||
Cd: "fallbackDevice", | ||
ts: "cardUpdates", | ||
@@ -373,0 +373,0 @@ ae: "optOut", |
@@ -6,7 +6,7 @@ const r = { | ||
destroy: function () { | ||
(r.t = !1), (r.zg = void 0), (r.dd = void 0); | ||
(r.t = !1), (r.zg = void 0), (r.vd = void 0); | ||
}, | ||
setLogger: function (n) { | ||
"function" == typeof n | ||
? (r.init(), (r.dd = n)) | ||
? (r.init(), (r.vd = n)) | ||
: r.info("Ignoring setLogger call since logger is not a function"); | ||
@@ -23,3 +23,3 @@ }, | ||
const o = "Braze: " + n; | ||
null != r.dd ? r.dd(o) : console.log(o); | ||
null != r.vd ? r.vd(o) : console.log(o); | ||
} | ||
@@ -29,4 +29,4 @@ }, | ||
if (r.zg) { | ||
const o = "Braze SDK Warning: " + n + " (v5.2.0)"; | ||
null != r.dd ? r.dd(o) : console.warn(o); | ||
const o = "Braze SDK Warning: " + n + " (v5.3.0)"; | ||
null != r.vd ? r.vd(o) : console.warn(o); | ||
} | ||
@@ -36,4 +36,4 @@ }, | ||
if (r.zg) { | ||
const o = "Braze SDK Error: " + n + " (v5.2.0)"; | ||
null != r.dd ? r.dd(o) : console.error(o); | ||
const o = "Braze SDK Error: " + n + " (v5.3.0)"; | ||
null != r.vd ? r.vd(o) : console.error(o); | ||
} | ||
@@ -40,0 +40,0 @@ }, |
@@ -6,6 +6,6 @@ export default { | ||
Ao: "devicePropertyAllowlist", | ||
Aa: "disablePushTokenMaintenance", | ||
_a: "disablePushTokenMaintenance", | ||
So: "enableLogging", | ||
No: "enableSdkAuthentication", | ||
qa: "manageServiceWorkerExternally", | ||
Ma: "manageServiceWorkerExternally", | ||
Oo: "minimumIntervalBetweenTriggerActionsInSeconds", | ||
@@ -15,9 +15,9 @@ Po: "sessionTimeoutInSeconds", | ||
Lo: "appVersionNumber", | ||
_a: "serviceWorkerLocation", | ||
ka: "safariWebsitePushId", | ||
wa: "serviceWorkerLocation", | ||
ya: "safariWebsitePushId", | ||
zn: "localization", | ||
ho: "contentSecurityNonce", | ||
bo: "contentSecurityNonce", | ||
Do: "allowUserSuppliedJavascript", | ||
bo: "inAppMessageZIndex", | ||
wo: "openInAppMessagesInNewTab", | ||
jo: "inAppMessageZIndex", | ||
ho: "openInAppMessagesInNewTab", | ||
en: "openNewsFeedCardsInNewTab", | ||
@@ -24,0 +24,0 @@ Lh: "requireExplicitInAppMessageDismissal", |
export default class y { | ||
constructor() {} | ||
Rs(a) {} | ||
Ns(a) {} | ||
changeUser(a = !1) {} | ||
clearData(a = !1) {} | ||
} |
@@ -10,4 +10,2 @@ export const MAX_PURCHASE_QUANTITY = 100; | ||
"Braze must be initialized before calling methods."; | ||
export const CONTENT_CARDS_RATE_LIMIT_CAPACITY_DEFAULT = 5; | ||
export const CONTENT_CARDS_RATE_LIMIT_REFILL_RATE_DEFAULT = 90; | ||
export const GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT = 30; | ||
@@ -14,0 +12,0 @@ export const GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT = 30; |
@@ -17,3 +17,3 @@ import { logger as r } from "../../shared-lib/index.js"; | ||
); | ||
const u = m.xo(); | ||
const u = m.wo(); | ||
return ( | ||
@@ -30,3 +30,3 @@ d.ge.push( | ||
(d.L = | ||
(null === (l = e.l()) || void 0 === l ? void 0 : l.zo(d.ge)) || !1), | ||
(null === (l = e.l()) || void 0 === l ? void 0 : l.xo(d.ge)) || !1), | ||
d | ||
@@ -33,0 +33,0 @@ ); |
@@ -190,3 +190,3 @@ import x from "./base-feed.js"; | ||
if (ft(t)) { | ||
r.error(dt(jt.Vi, "Content Card")); | ||
r.error(dt(jt.Qi, "Content Card")); | ||
continue; | ||
@@ -193,0 +193,0 @@ } |
@@ -6,6 +6,6 @@ import C, { readResponseHeaders as b } from "../util/net.js"; | ||
import { dateFromUnixTimestamp as l } from "../util/date-utils.js"; | ||
import { isURIJavascriptOrData as N } from "../util/url-utils.js"; | ||
import { isURIJavascriptOrData as R } from "../util/url-utils.js"; | ||
import { | ||
newCardFromContentCardsJson as R, | ||
newCardFromSerializedValue as D, | ||
newCardFromContentCardsJson as N, | ||
newCardFromSerializedValue as S, | ||
} from "../Card/util/card-factory.js"; | ||
@@ -15,5 +15,5 @@ import { STORAGE_KEYS as o } from "../managers/storage-manager.js"; | ||
import s from "../common/event-logger.js"; | ||
import S from "../util/request-header-utils.js"; | ||
import { randomInclusive as k } from "../util/math.js"; | ||
import { MAX_ERROR_RETRIES_CONTENT_CARDS as U } from "../common/constants.js"; | ||
import D from "../util/request-header-utils.js"; | ||
import { randomInclusive as U } from "../util/math.js"; | ||
import { MAX_ERROR_RETRIES_CONTENT_CARDS as k } from "../common/constants.js"; | ||
import { | ||
@@ -69,13 +69,13 @@ logger as r, | ||
if (!this.u) return; | ||
const t = this.u.j(o.C.Cs) || [], | ||
const t = this.u.j(o.C.ws) || [], | ||
s = []; | ||
for (let i = 0; i < t.length; i++) { | ||
const e = D(t[i]); | ||
const e = S(t[i]); | ||
null != e && s.push(e); | ||
} | ||
(this.cards = this.ws(this.bs(s, !1))), | ||
(this.cards = this.Cs(this.bs(s, !1))), | ||
(this.Bt = this.u.j(o.C.gs) || this.Bt), | ||
(this.Ht = this.u.j(o.C.ys) || this.Ht); | ||
} | ||
Ns(t, s = !1, i = 0, e = 0) { | ||
js(t, s = !1, i = 0, e = 0) { | ||
let h; | ||
@@ -95,6 +95,6 @@ if (s) { | ||
if (s) { | ||
const t = R(e); | ||
const t = N(e); | ||
null != r && r.viewed && t && (t.viewed = !0), null != t && h.push(t); | ||
} else if (null == r) { | ||
const t = R(e); | ||
const t = N(e); | ||
null != t && h.push(t); | ||
@@ -110,4 +110,4 @@ } else { | ||
} | ||
(this.cards = this.ws(this.bs(h, s))), | ||
this.js(), | ||
(this.cards = this.Cs(this.bs(h, s))), | ||
this.Rs(), | ||
(this.Bt = i), | ||
@@ -117,21 +117,21 @@ (this.Ht = e), | ||
} | ||
Rs(t) { | ||
Ns(t) { | ||
if (this.Ts() && null != t && t.cards) { | ||
this.u && this.u.k(o.C.Ds, e.Ss()); | ||
this.u && this.u.k(o.C.Ss, e.Ds()); | ||
const s = t.full_sync; | ||
s || this.Kt(), | ||
this.Ns(t.cards, s, t.last_full_sync_at, t.last_card_updated_at), | ||
this.Jt.Dt(this.ks(!0)); | ||
this.js(t.cards, s, t.last_full_sync_at, t.last_card_updated_at), | ||
this.Jt.Dt(this.Us(!0)); | ||
} | ||
} | ||
Us(t) { | ||
ks(t) { | ||
this.u && this.u.k(o.C.As, t); | ||
} | ||
Ls(t, e, h) { | ||
Fs(t, e, h) { | ||
const r = () => { | ||
this.Fs(e, h, !0); | ||
this.xs(e, h, !0); | ||
}, | ||
n = t ? b(t) : null; | ||
let l; | ||
if ((this.xs(), !n || !n["retry-after"])) return void this.Us(0); | ||
if ((this.zs(), !n || !n["retry-after"])) return void this.ks(0); | ||
const a = n["retry-after"]; | ||
@@ -144,3 +144,3 @@ if (isNaN(a) && !isNaN(Date.parse(a))) | ||
"Received unexpected value for retry-after header in /sync response"; | ||
return s.q(i.Ms, { e: t + ": " + a }), void this.Us(0); | ||
return s.q(i.qs, { e: t + ": " + a }), void this.ks(0); | ||
} | ||
@@ -155,3 +155,3 @@ l = 1e3 * parseFloat(a.toString()); | ||
(null == u || isNaN(parseInt(u.toString()))) && (u = 0), | ||
this.Us(parseInt(u.toString()) + 1); | ||
this.ks(parseInt(u.toString()) + 1); | ||
} | ||
@@ -175,3 +175,3 @@ es(t) { | ||
if (null == h) { | ||
const t = R(e); | ||
const t = N(e); | ||
null != t && i.push(t); | ||
@@ -187,3 +187,3 @@ } else { | ||
} | ||
(this.cards = this.ws(this.bs(i, !1))), this.js(), this.Jt.Dt(this.ks(!0)); | ||
(this.cards = this.Cs(this.bs(i, !1))), this.Rs(), this.Jt.Dt(this.Us(!0)); | ||
} | ||
@@ -215,3 +215,3 @@ bs(t, s) { | ||
} | ||
ws(t) { | ||
Cs(t) { | ||
const s = [], | ||
@@ -224,3 +224,3 @@ i = new Date(); | ||
const o = t[n].url; | ||
if (!this.Ft && o && N(o)) { | ||
if (!this.Ft && o && R(o)) { | ||
r.error( | ||
@@ -242,93 +242,86 @@ `Card with url ${o} will not be displayed because Javascript URLs are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable this card.`, | ||
} | ||
js() { | ||
Rs() { | ||
var t; | ||
const s = []; | ||
for (let t = 0; t < this.cards.length; t++) s.push(this.cards[t].Y()); | ||
null === (t = this.u) || void 0 === t || t.k(o.C.Cs, s); | ||
null === (t = this.u) || void 0 === t || t.k(o.C.ws, s); | ||
} | ||
xs() { | ||
zs() { | ||
this.ns && (clearTimeout(this.ns), (this.ns = null)); | ||
} | ||
zs() { | ||
Es() { | ||
null != this.os && (clearTimeout(this.os), (this.os = null)); | ||
} | ||
Es(t = 1e3 * this.us, s, i) { | ||
this.zs(), | ||
Ls(t = 1e3 * this.us, s, i) { | ||
this.Es(), | ||
(this.os = window.setTimeout(() => { | ||
this.Fs(s, i, !0); | ||
this.xs(s, i, !0); | ||
}, t)), | ||
(this.ls = t); | ||
} | ||
Fs(t, s, i = !1, h = !0) { | ||
var n, l; | ||
const a = this.qt, | ||
u = this.u; | ||
if (!a || !u) return void ("function" == typeof s && s()); | ||
const c = !i; | ||
if ((c && (this.xs(), this.Us(0)), !this.Ts())) | ||
xs(t, s, i = !1, h = !0) { | ||
var r; | ||
const n = this.qt, | ||
l = this.u; | ||
if (!n || !l) return void ("function" == typeof s && s()); | ||
if ((!i && (this.zs(), this.ks(0)), !this.Ts())) | ||
return void ( | ||
null === (n = this.yt) || | ||
void 0 === n || | ||
n.qs(() => { | ||
this.Fs(t, s); | ||
null === (r = this.yt) || | ||
void 0 === r || | ||
r.Is(() => { | ||
this.xs(t, s); | ||
}) | ||
); | ||
let f = !0; | ||
if ( | ||
(c && | ||
(null === (l = this.yt) || void 0 === l ? void 0 : l.Is()) && | ||
(f = this.Js()), | ||
!f) | ||
) | ||
return void r.info("Content card sync being throttled."); | ||
h && this.zs(); | ||
const d = a.Ps({}, !0); | ||
u.j(o.C.Ds) !== e.Ss() && this.$s(), | ||
(d.last_full_sync_at = this.Bt), | ||
(d.last_card_updated_at = this.Ht); | ||
const m = a._s(d, S.Gs.Bs, i); | ||
let p = !1; | ||
a.Hs( | ||
d, | ||
() => { | ||
h && this.Es(); | ||
const a = n.Js({}, !0); | ||
l.j(o.C.Ss) !== e.Ds() && this.Ms(), | ||
(a.last_full_sync_at = this.Bt), | ||
(a.last_card_updated_at = this.Ht); | ||
const u = n.$s(a, D.Ps.Bs, i); | ||
let c = !1; | ||
n.Xs( | ||
a, | ||
(i = -1) => { | ||
if (this.u) { | ||
const t = new Date().valueOf(); | ||
c && this.u.k(o.C.Ks, t), S.Os(this.u, S.Gs.Bs, t); | ||
D._s(this.u, D.Ps.Bs, t); | ||
} | ||
C.Qs({ | ||
url: a.Vs() + "/content_cards/sync", | ||
data: d, | ||
headers: m, | ||
L: (i, e) => { | ||
if (!a.Ws(d, i, m)) | ||
return (p = !0), void ("function" == typeof s && s()); | ||
a.Xs(), | ||
this.Ls(e, t, s), | ||
this.Rs(i), | ||
(p = !1), | ||
S.Ys(this.u, S.Gs.Bs, 1), | ||
"function" == typeof t && t(); | ||
}, | ||
error: (t) => { | ||
a.Zs(t, "retrieving content cards"), | ||
(p = !0), | ||
"function" == typeof s && s(); | ||
}, | ||
ti: () => { | ||
if (p && h && !this.os && this.cs + 1 < U) { | ||
S.si(this.u, S.Gs.Bs); | ||
let i = this.ls; | ||
(null == i || i < 1e3 * this.us) && (i = 1e3 * this.us), | ||
this.Es(Math.min(3e5, k(1e3 * this.us, 3 * i)), t, s), | ||
(this.cs = this.cs + 1); | ||
} | ||
}, | ||
}); | ||
-1 !== i && u.push(["X-Braze-Req-Tokens-Remaining", i.toString()]), | ||
C.Gs({ | ||
url: `${n.Hs()}/content_cards/sync`, | ||
data: a, | ||
headers: u, | ||
L: (i, e) => { | ||
if (!n.Ks(a, i, u)) | ||
return (c = !0), void ("function" == typeof s && s()); | ||
n.Os(), | ||
this.Fs(e, t, s), | ||
this.Ns(i), | ||
(c = !1), | ||
D.Qs(this.u, D.Ps.Bs, 1), | ||
"function" == typeof t && t(); | ||
}, | ||
error: (t) => { | ||
n.Vs(t, "retrieving content cards"), | ||
(c = !0), | ||
"function" == typeof s && s(); | ||
}, | ||
Ws: () => { | ||
if (c && h && !this.os && this.cs + 1 < k) { | ||
D.Ys(this.u, D.Ps.Bs); | ||
let i = this.ls; | ||
(null == i || i < 1e3 * this.us) && (i = 1e3 * this.us), | ||
this.Ls(Math.min(3e5, U(1e3 * this.us, 3 * i)), t, s), | ||
(this.cs = this.cs + 1); | ||
} | ||
}, | ||
}); | ||
}, | ||
S.ii.Bs, | ||
D.Ps.Bs, | ||
s, | ||
); | ||
} | ||
ks(t) { | ||
Us(t) { | ||
t || this.Kt(); | ||
const s = this.ws(this.cards); | ||
const s = this.Cs(this.cards); | ||
s.sort((t, s) => | ||
@@ -352,9 +345,9 @@ t.pinned && !s.pinned | ||
} | ||
ei(t) { | ||
Zs(t) { | ||
return this.Jt.It(t); | ||
} | ||
$s() { | ||
Ms() { | ||
(this.Bt = 0), | ||
(this.Ht = 0), | ||
this.u && (this.u.hi(o.C.gs), this.u.hi(o.C.ys)); | ||
this.u && (this.u.ti(o.C.gs), this.u.ti(o.C.ys)); | ||
} | ||
@@ -366,7 +359,7 @@ changeUser(t) { | ||
this.u && | ||
(this.u.hi(o.C.Cs), | ||
this.u.hi(o.C.v), | ||
this.u.hi(o.C.H), | ||
this.u.hi(o.C.A))), | ||
this.$s(); | ||
(this.u.ti(o.C.ws), | ||
this.u.ti(o.C.v), | ||
this.u.ti(o.C.H), | ||
this.u.ti(o.C.A))), | ||
this.Ms(); | ||
} | ||
@@ -380,38 +373,17 @@ clearData(t) { | ||
this.u && | ||
(this.u.hi(o.C.Cs), | ||
this.u.hi(o.C.v), | ||
this.u.hi(o.C.H), | ||
this.u.hi(o.C.A), | ||
this.u.hi(o.C.gs), | ||
this.u.hi(o.C.ys)); | ||
(this.u.ti(o.C.ws), | ||
this.u.ti(o.C.v), | ||
this.u.ti(o.C.H), | ||
this.u.ti(o.C.A), | ||
this.u.ti(o.C.gs), | ||
this.u.ti(o.C.ys)); | ||
} | ||
Ts() { | ||
return ( | ||
!!this.yt && (!!this.yt.ri() || (0 !== this.yt.ni() && this.oi(), !1)) | ||
!!this.yt && (!!this.yt.si() || (0 !== this.yt.ii() && this.ei(), !1)) | ||
); | ||
} | ||
li(t) { | ||
this.u && this.u.k(o.C.ai, t); | ||
ei() { | ||
this.Jt.Dt(new ContentCards([], new Date())), this.u && this.u.ti(o.C.ws); | ||
} | ||
ui() { | ||
return this.u ? this.u.j(o.C.ai) : null; | ||
} | ||
Js() { | ||
var t, s, i; | ||
const e = null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.Ks); | ||
if (null == e || isNaN(e)) return !0; | ||
const h = (null === (s = this.yt) || void 0 === s ? void 0 : s.ci()) || -1, | ||
r = (null === (i = this.yt) || void 0 === i ? void 0 : i.fi()) || -1; | ||
if (-1 === h || -1 === r) return !0; | ||
let n = this.ui(); | ||
(null == n || isNaN(n)) && (n = h); | ||
const l = (new Date().valueOf() - e) / 1e3; | ||
return ( | ||
(n = Math.min(n + l / r, h)), | ||
!(n < 1) && ((n = Math.trunc(n) - 1), this.li(n), !0) | ||
); | ||
} | ||
oi() { | ||
this.Jt.Dt(new ContentCards([], new Date())), this.u && this.u.hi(o.C.Cs); | ||
} | ||
} |
import g from "./content-cards-provider-factory.js"; | ||
import e from "../managers/braze-instance.js"; | ||
export function getCachedContentCards() { | ||
if (e.X()) return g.rr().ks(!1); | ||
if (e.X()) return g.rr().Us(!1); | ||
} |
import e from "../managers/braze-instance.js"; | ||
import g from "./content-cards-provider-factory.js"; | ||
export function requestContentCardsRefresh(r, t) { | ||
if (e.X()) return g.rr().Fs(r, t); | ||
if (e.X()) return g.rr().xs(r, t); | ||
} |
@@ -6,3 +6,3 @@ import e from "../managers/braze-instance.js"; | ||
const t = g.rr(), | ||
n = t.ei(r); | ||
n = t.Zs(r); | ||
if (!t.ps()) { | ||
@@ -12,3 +12,3 @@ const r = e.cr(); | ||
const n = r.mr(() => { | ||
t.Fs(); | ||
t.xs(); | ||
}); | ||
@@ -15,0 +15,0 @@ n && t.vs(n); |
@@ -22,3 +22,3 @@ import e, { OPTIONS as L } from "../../managers/braze-instance.js"; | ||
const i = e.nn(L.tn) || e.nn(L.en) || !1, | ||
a = g.rr().ks(!1); | ||
a = g.rr().Us(!1); | ||
"function" == typeof t && F(a, t(a.cards.slice()), a.lastUpdated, null, i); | ||
@@ -25,0 +25,0 @@ const s = I(a, i, o), |
import { logger as r } from "../../shared-lib/index.js"; | ||
export default class FeatureFlag { | ||
constructor(t, r = !1, e = {}, s) { | ||
constructor(t, e = !1, r = {}, i) { | ||
(this.id = t), | ||
(this.enabled = r), | ||
(this.properties = e), | ||
(this.trackingString = s), | ||
(this.enabled = e), | ||
(this.properties = r), | ||
(this.trackingString = i), | ||
(this.id = t), | ||
(this.enabled = r), | ||
(this.properties = e), | ||
(this.trackingString = s); | ||
(this.enabled = e), | ||
(this.properties = r), | ||
(this.trackingString = i); | ||
} | ||
he(t, e, r) { | ||
const i = this.properties[t]; | ||
return null == i ? (this.ye(t), null) : e(i) ? i.value : (this.Pe(r), null); | ||
} | ||
getStringProperty(t) { | ||
const r = this.properties[t]; | ||
return null == r | ||
? (this.Er(t), null) | ||
: this.Ir(r) | ||
? r.value | ||
: (this.Nr("string"), null); | ||
return this.he(t, this.be, "string"); | ||
} | ||
getNumberProperty(t) { | ||
const r = this.properties[t]; | ||
return null == r | ||
? (this.Er(t), null) | ||
: this.Tr(r) | ||
? r.value | ||
: (this.Nr("number"), null); | ||
return this.he(t, this.Ie, "number"); | ||
} | ||
getBooleanProperty(t) { | ||
const r = this.properties[t]; | ||
return null == r | ||
? (this.Er(t), null) | ||
: this.Ar(r) | ||
? r.value | ||
: (this.Nr("boolean"), null); | ||
return this.he(t, this.de, "boolean"); | ||
} | ||
getImageProperty(t) { | ||
return this.he(t, this.Te, "image"); | ||
} | ||
getJsonProperty(t) { | ||
return this.he(t, this.Ee, "jsonobject"); | ||
} | ||
getTimestampProperty(t) { | ||
return this.he(t, this.Ne, "datetime"); | ||
} | ||
Y() { | ||
@@ -47,19 +45,32 @@ const t = {}; | ||
} | ||
Nr(t) { | ||
Pe(t) { | ||
r.info(`Property is not of type ${t}.`); | ||
} | ||
Er(t) { | ||
ye(t) { | ||
r.info(`${t} not found in feature flag properties.`); | ||
} | ||
Ir(t) { | ||
be(t) { | ||
return "string" === t.type && "string" == typeof t.value; | ||
} | ||
Tr(t) { | ||
Ie(t) { | ||
return "number" === t.type && "number" == typeof t.value; | ||
} | ||
Ar(t) { | ||
de(t) { | ||
return "boolean" === t.type && "boolean" == typeof t.value; | ||
} | ||
Te(t) { | ||
return "image" === t.type && "string" == typeof t.value; | ||
} | ||
Ee(t) { | ||
return ( | ||
"jsonobject" === t.type && | ||
"object" == typeof t.value && | ||
t.value.constructor == Object | ||
); | ||
} | ||
Ne(t) { | ||
return "datetime" === t.type && "number" == typeof t.value; | ||
} | ||
} | ||
(FeatureFlag.tt = { ht: "id", le: "e", pe: "pr", Fe: "fts" }), | ||
(FeatureFlag.Rt = { ht: "id", le: "enabled", pe: "properties", Fe: "fts" }); |
@@ -6,3 +6,3 @@ import { logger as r } from "../../shared-lib/index.js"; | ||
import T from "../managers/subscription-manager.js"; | ||
import { randomInclusive as k } from "../util/math.js"; | ||
import { randomInclusive as U } from "../util/math.js"; | ||
import C from "../util/net.js"; | ||
@@ -13,3 +13,3 @@ import { | ||
} from "./feature-flag-factory.js"; | ||
import S from "../util/request-header-utils.js"; | ||
import D from "../util/request-header-utils.js"; | ||
export default class er extends y { | ||
@@ -21,34 +21,34 @@ constructor(t, s, i, r) { | ||
(this.u = i), | ||
(this.di = r), | ||
(this.mi = []), | ||
(this.gi = 0), | ||
(this.ri = r), | ||
(this.hi = []), | ||
(this.oi = 0), | ||
(this.yt = t), | ||
(this.qt = s), | ||
(this.u = i), | ||
(this.di = r), | ||
(this.Fi = null), | ||
(this.vi = new T()), | ||
(this.pi = 10), | ||
(this.wi = null), | ||
(this.ji = null), | ||
e.$t(this.vi); | ||
(this.ri = r), | ||
(this.ai = null), | ||
(this.ni = new T()), | ||
(this.li = 10), | ||
(this.ui = null), | ||
(this.fi = null), | ||
e.$t(this.ni); | ||
} | ||
Rs(t) { | ||
Ns(t) { | ||
var s; | ||
if ( | ||
(null === (s = this.yt) || void 0 === s ? void 0 : s.yi()) && | ||
(null === (s = this.yt) || void 0 === s ? void 0 : s.ci()) && | ||
null != t && | ||
t.feature_flags | ||
) { | ||
this.mi = []; | ||
this.hi = []; | ||
for (const s of t.feature_flags) { | ||
const t = st(s); | ||
t && this.mi.push(t); | ||
t && this.hi.push(t); | ||
} | ||
(this.gi = new Date().getTime()), this.bi(), this.vi.Dt(this.mi); | ||
(this.oi = new Date().getTime()), this.di(), this.ni.Dt(this.hi); | ||
} | ||
} | ||
Ci() { | ||
mi() { | ||
let t = {}; | ||
this.u && (t = this.u.j(o.C.Ti)); | ||
this.u && (t = this.u.j(o.C.gi)); | ||
const s = {}; | ||
@@ -61,21 +61,21 @@ for (const i in t) { | ||
} | ||
Di() { | ||
Fi() { | ||
var t; | ||
return (null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.Ii)) || {}; | ||
return (null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.vi)) || {}; | ||
} | ||
Ri(t) { | ||
this.u && this.u.k(o.C.Ii, t); | ||
pi(t) { | ||
this.u && this.u.k(o.C.vi, t); | ||
} | ||
ei(t) { | ||
return this.vi.It(t); | ||
Zs(t) { | ||
return this.ni.It(t); | ||
} | ||
refreshFeatureFlags(t, s, i = !1, e = !0) { | ||
const r = () => { | ||
"function" == typeof s && s(), this.vi.Dt(this.mi); | ||
"function" == typeof s && s(), this.ni.Dt(this.hi); | ||
}; | ||
if (!this.Si(i)) | ||
if (!this.wi(i)) | ||
return ( | ||
!this.Fi && | ||
!this.ai && | ||
this.yt && | ||
(this.Fi = this.yt.xi(() => { | ||
(this.ai = this.yt.ji(() => { | ||
this.refreshFeatureFlags(t, s); | ||
@@ -85,54 +85,58 @@ })), | ||
); | ||
if ((e && this.Ni(), !this.qt)) return void r(); | ||
const h = this.qt.Ps({}, !0), | ||
o = this.qt._s(h, S.Gs.qi); | ||
let a = !1; | ||
this.qt.Hs( | ||
h, | ||
() => { | ||
this.qt | ||
? (S.Os(this.u, S.Gs.qi, new Date().valueOf()), | ||
C.Qs({ | ||
url: `${this.qt.Vs()}/feature_flags/sync`, | ||
headers: o, | ||
data: h, | ||
L: (s) => { | ||
if (!this.qt.Ws(h, s, o)) return (a = !0), void r(); | ||
this.qt.Xs(), | ||
this.Rs(s), | ||
(a = !1), | ||
S.Ys(this.u, S.Gs.qi, 1), | ||
"function" == typeof t && t(); | ||
}, | ||
error: (t) => { | ||
this.qt.Zs(t, "retrieving feature flags"), (a = !0), r(); | ||
}, | ||
ti: () => { | ||
if (e && a && !this.ji) { | ||
S.si(this.u, S.Gs.qi); | ||
let e = this.wi; | ||
(null == e || e < 1e3 * this.pi) && (e = 1e3 * this.pi), | ||
this.$i(Math.min(3e5, k(1e3 * this.pi, 3 * e)), t, s, i); | ||
} | ||
}, | ||
})) | ||
: r(); | ||
const h = this.qt; | ||
if (!h) return void r(); | ||
e && this.yi(); | ||
const o = h.Js({}, !0), | ||
a = h.$s(o, D.Ps.bi); | ||
let n = !1; | ||
h.Xs( | ||
o, | ||
(h = -1) => { | ||
if (!this.qt) return void r(); | ||
const l = new Date().valueOf(); | ||
D._s(this.u, D.Ps.bi, l), | ||
-1 !== h && a.push(["X-Braze-Req-Tokens-Remaining", h.toString()]), | ||
C.Gs({ | ||
url: `${this.qt.Hs()}/feature_flags/sync`, | ||
headers: a, | ||
data: o, | ||
L: (s) => { | ||
if (!this.qt.Ks(o, s, a)) return (n = !0), void r(); | ||
this.qt.Os(), | ||
this.Ns(s), | ||
(n = !1), | ||
D.Qs(this.u, D.Ps.bi, 1), | ||
"function" == typeof t && t(); | ||
}, | ||
error: (t) => { | ||
this.qt.Vs(t, "retrieving feature flags"), (n = !0), r(); | ||
}, | ||
Ws: () => { | ||
if (e && n && !this.fi) { | ||
D.Ys(this.u, D.Ps.bi); | ||
let e = this.ui; | ||
(null == e || e < 1e3 * this.li) && (e = 1e3 * this.li), | ||
this.Ci(Math.min(3e5, U(1e3 * this.li, 3 * e)), t, s, i); | ||
} | ||
}, | ||
}); | ||
}, | ||
S.ii.qi, | ||
D.Ps.bi, | ||
s, | ||
); | ||
} | ||
Ni() { | ||
null != this.ji && (clearTimeout(this.ji), (this.ji = null)); | ||
yi() { | ||
null != this.fi && (clearTimeout(this.fi), (this.fi = null)); | ||
} | ||
$i(t = 1e3 * this.pi, s, i, e = !1) { | ||
this.Ni(), | ||
(this.ji = window.setTimeout(() => { | ||
Ci(t = 1e3 * this.li, s, i, e = !1) { | ||
this.yi(), | ||
(this.fi = window.setTimeout(() => { | ||
this.refreshFeatureFlags(s, i, e); | ||
}, t)), | ||
(this.wi = t); | ||
(this.ui = t); | ||
} | ||
Si(t) { | ||
wi(t) { | ||
if (!this.yt) return !1; | ||
if (!t) { | ||
const t = this.yt.zi(); | ||
const t = this.yt.Ri(); | ||
if (null == t) return !1; | ||
@@ -142,3 +146,3 @@ let s = !1; | ||
if (-1 === t) return r.info("Feature flag refreshes not allowed"), !1; | ||
s = new Date().getTime() >= (this.gi || 0) + 1e3 * t; | ||
s = new Date().getTime() >= (this.oi || 0) + 1e3 * t; | ||
} | ||
@@ -150,31 +154,31 @@ if (!s) | ||
} | ||
return this.yt.yi(); | ||
return this.yt.ci(); | ||
} | ||
Mi() { | ||
Ti() { | ||
var t; | ||
return ( | ||
(null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.Ui)) || null | ||
(null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.Di)) || null | ||
); | ||
} | ||
_i() { | ||
Ii() { | ||
var t, s; | ||
null === (t = this.u) || | ||
void 0 === t || | ||
t.k(o.C.Ui, null === (s = this.di) || void 0 === s ? void 0 : s.ki()); | ||
t.k(o.C.Di, null === (s = this.ri) || void 0 === s ? void 0 : s.Si()); | ||
} | ||
Ai() { | ||
qi() { | ||
var t; | ||
const s = null === (t = this.di) || void 0 === t ? void 0 : t.ki(), | ||
i = this.Mi(); | ||
const s = null === (t = this.ri) || void 0 === t ? void 0 : t.Si(), | ||
i = this.Ti(); | ||
return null == i || s === i; | ||
} | ||
bi() { | ||
di() { | ||
if (!this.u) return; | ||
const t = {}; | ||
for (const s of this.mi) { | ||
for (const s of this.hi) { | ||
const i = s.Y(); | ||
t[s.id] = i; | ||
} | ||
this.u.k(o.C.Ti, t), this.u.k(o.C.Bi, this.gi), this._i(); | ||
this.u.k(o.C.gi, t), this.u.k(o.C.xi, this.oi), this.Ii(); | ||
} | ||
} |
@@ -8,6 +8,6 @@ import { logger as r } from "../../shared-lib/index.js"; | ||
n = e.ir(); | ||
if (n && !n.yi()) return r.info("Feature flags are not enabled."), t; | ||
const o = ir.rr().Ci(); | ||
if (n && !n.ci()) return r.info("Feature flags are not enabled."), t; | ||
const o = ir.rr().mi(); | ||
for (const r in o) t.push(o[r]); | ||
return t; | ||
} |
@@ -7,5 +7,5 @@ import { logger as r } from "../../shared-lib/index.js"; | ||
const n = e.ir(); | ||
if (n && !n.yi()) return r.info("Feature flags are not enabled."), null; | ||
const a = ir.rr().Ci(); | ||
if (n && !n.ci()) return r.info("Feature flags are not enabled."), null; | ||
const a = ir.rr().mi(); | ||
return a[t] ? a[t] : null; | ||
} |
@@ -10,7 +10,7 @@ import { logger as r, EventTypes as i } from "../../shared-lib/index.js"; | ||
"Not logging a feature flag impression. The feature flag was not part of any matching experiment.", | ||
n = ir.rr().Ci(); | ||
n = ir.rr().mi(); | ||
if (!n[t]) return r.info(o), !1; | ||
const a = n[t].trackingString; | ||
if (!a) return r.info(o), !1; | ||
const f = ir.rr().Di(); | ||
const f = ir.rr().Fi(); | ||
if (f[a]) | ||
@@ -23,5 +23,5 @@ return ( | ||
); | ||
(f[a] = !0), ir.rr().Ri(f); | ||
(f[a] = !0), ir.rr().pi(f); | ||
const g = { fid: t, fts: a }; | ||
return s.q(i.Fr, g).L; | ||
} |
@@ -7,7 +7,7 @@ import e from "../managers/braze-instance.js"; | ||
const t = ir.rr(); | ||
if (t.Ai()) { | ||
if (t.qi()) { | ||
const t = getAllFeatureFlags(); | ||
t && "function" == typeof r && r(t); | ||
} | ||
return t.ei(r); | ||
return t.Zs(r); | ||
} |
@@ -6,3 +6,3 @@ import y from "../common/base-provider.js"; | ||
newCardFromFeedJson as ht, | ||
newCardFromSerializedValue as D, | ||
newCardFromSerializedValue as S, | ||
} from "../Card/util/card-factory.js"; | ||
@@ -16,7 +16,7 @@ import { rehydrateDateAfterJsonization as w } from "../util/date-utils.js"; | ||
(this.u = t), | ||
(this.Ei = s), | ||
(this.zi = s), | ||
(this.cards = []), | ||
(this.Gi = null), | ||
(this.Ni = null), | ||
(this.u = t), | ||
(this.Ei = s), | ||
(this.zi = s), | ||
(this.Jt = new T()), | ||
@@ -28,11 +28,11 @@ e.$t(this.Jt), | ||
let t = []; | ||
this.u && (t = this.u.j(o.C.Hi) || []); | ||
this.u && (t = this.u.j(o.C.Ui) || []); | ||
const s = []; | ||
for (let i = 0; i < t.length; i++) { | ||
const e = D(t[i]); | ||
const e = S(t[i]); | ||
null != e && s.push(e); | ||
} | ||
(this.cards = s), this.u && (this.Gi = w(this.u.j(o.C.Ji))); | ||
(this.cards = s), this.u && (this.Ni = w(this.u.j(o.C.ki))); | ||
} | ||
Ki(t) { | ||
Ai(t) { | ||
const s = []; | ||
@@ -52,20 +52,20 @@ let i = null, | ||
(this.cards = s), | ||
this.js(), | ||
(this.Gi = new Date()), | ||
this.u && (this.u.k(o.C.J, r), this.u.k(o.C.Ji, this.Gi)); | ||
this.Rs(), | ||
(this.Ni = new Date()), | ||
this.u && (this.u.k(o.C.J, r), this.u.k(o.C.ki, this.Ni)); | ||
} | ||
js() { | ||
Rs() { | ||
var t; | ||
const s = []; | ||
for (let t = 0; t < this.cards.length; t++) s.push(this.cards[t].Y()); | ||
null === (t = this.u) || void 0 === t || t.k(o.C.Hi, s); | ||
null === (t = this.u) || void 0 === t || t.k(o.C.Ui, s); | ||
} | ||
Rs(t) { | ||
Ns(t) { | ||
null != t && | ||
t.feed && | ||
(this.Kt(), | ||
this.Ki(t.feed), | ||
this.Jt.Dt(new Feed(this.cards.slice(), this.Gi))); | ||
this.Ai(t.feed), | ||
this.Jt.Dt(new Feed(this.cards.slice(), this.Ni))); | ||
} | ||
Li() { | ||
Bi() { | ||
this.Kt(); | ||
@@ -79,8 +79,8 @@ const t = [], | ||
} | ||
return new Feed(t, this.Gi); | ||
return new Feed(t, this.Ni); | ||
} | ||
Fs() { | ||
this.Ei && this.Ei.requestFeedRefresh(); | ||
xs() { | ||
this.zi && this.zi.requestFeedRefresh(); | ||
} | ||
ei(t) { | ||
Zs(t) { | ||
return this.Jt.It(t); | ||
@@ -91,6 +91,6 @@ } | ||
(this.cards = []), | ||
(this.Gi = null), | ||
t && this.u && (this.u.hi(o.C.Hi), this.u.hi(o.C.Ji)), | ||
this.Jt.Dt(new Feed(this.cards.slice(), this.Gi)); | ||
(this.Ni = null), | ||
t && this.u && (this.u.ti(o.C.Ui), this.u.ti(o.C.ki)), | ||
this.Jt.Dt(new Feed(this.cards.slice(), this.Ni)); | ||
} | ||
} |
import e from "../managers/braze-instance.js"; | ||
import re from "./feed-provider-factory.js"; | ||
export function getCachedFeed() { | ||
if (e.X()) return re.rr().Li(); | ||
if (e.X()) return re.rr().Bi(); | ||
} |
@@ -6,3 +6,3 @@ import e from "../managers/braze-instance.js"; | ||
if (e.X()) | ||
return null === (r = e.nr()) || void 0 === r ? void 0 : r.qr(or.Br).L; | ||
return null === (r = e.nr()) || void 0 === r ? void 0 : r.qr(or.Ar).L; | ||
} |
import e from "../managers/braze-instance.js"; | ||
import re from "./feed-provider-factory.js"; | ||
export function requestFeedRefresh() { | ||
if (e.X()) return re.rr().Fs(); | ||
if (e.X()) return re.rr().xs(); | ||
} |
import e from "../managers/braze-instance.js"; | ||
import re from "./feed-provider-factory.js"; | ||
export function subscribeToFeedUpdates(r) { | ||
if (e.X()) return re.rr().ei(r); | ||
if (e.X()) return re.rr().Zs(r); | ||
} |
@@ -39,3 +39,3 @@ import e, { OPTIONS as L } from "../../managers/braze-instance.js"; | ||
null == n | ||
? ((f = re.rr().Li()), | ||
? ((f = re.rr().Bi()), | ||
F(f, i(f.cards, o), f.lastUpdated, null, s), | ||
@@ -42,0 +42,0 @@ (a = !0)) |
@@ -11,4 +11,4 @@ import InAppMessage from "./models/in-app-message.js"; | ||
: s instanceof InAppMessage | ||
? se.m().de(s) | ||
? se.m().je(s) | ||
: (r.info("Not an instance of InAppMessage, ignoring."), !1); | ||
} |
@@ -34,3 +34,3 @@ import X from "../../util/browser-detector.js"; | ||
}; | ||
u ? a() : t.he(c, a); | ||
u ? a() : t.Ae(c, a); | ||
} else logInAppMessageHtmlClick(t, i, o || void 0); | ||
@@ -77,6 +77,6 @@ return r.stopPropagation(), !1; | ||
if (null != f) { | ||
if (t.be()) { | ||
if (t.Ce()) { | ||
const e = document.createElement("style"); | ||
(e.innerHTML = t.css || ""), | ||
(e.id = t.ye() || ""), | ||
(e.id = t.ve() || ""), | ||
null != u && e.setAttribute("nonce", u), | ||
@@ -92,3 +92,3 @@ f.appendChild(e); | ||
closeMessage: function () { | ||
t.he(c); | ||
t.Ae(c); | ||
}, | ||
@@ -203,3 +203,3 @@ logClick: function () { | ||
const o = arguments; | ||
t.he(c, function () { | ||
t.Ae(c, function () { | ||
j[e](...Array.prototype.slice.call(o)); | ||
@@ -220,3 +220,3 @@ }); | ||
if ( | ||
((i.appboyBridge = p), (i.brazeBridge = p), t.Ae !== InAppMessage.Ce.je) | ||
((i.appboyBridge = p), (i.brazeBridge = p), t.we !== InAppMessage.qe.$e) | ||
) { | ||
@@ -230,3 +230,3 @@ const t = i.document.getElementsByTagName("a"); | ||
if (null != $) { | ||
t.ve() && ($.id = t.htmlId || ""); | ||
t.xe() && ($.id = t.htmlId || ""); | ||
const e = document.createElement("hidden"); | ||
@@ -248,6 +248,6 @@ (e.onclick = p.closeMessage), | ||
return ( | ||
(e.className = "ab-ios-scroll-wrapper"), e.appendChild(c), (t.Pe = e), e | ||
(e.className = "ab-ios-scroll-wrapper"), e.appendChild(c), (t.Me = e), e | ||
); | ||
} | ||
return (t.Pe = c), c; | ||
return (t.Me = c), c; | ||
} |
@@ -20,3 +20,3 @@ import { | ||
export default function ce(e, o, a, t, n, s, i, l = document.body) { | ||
if (((e.we = document.activeElement), e instanceof HtmlMessage)) | ||
if (((e.ke = document.activeElement), e instanceof HtmlMessage)) | ||
return at(e, o, a, n, s, i); | ||
@@ -28,6 +28,6 @@ const b = (function (e, o, a, t, n, s, i = document.body) { | ||
s && (l.style.zIndex = (s + 1).toString()), | ||
e.xe() && | ||
e.ze() && | ||
((l.className += " ab-modal-interactions"), | ||
l.setAttribute("tabindex", "-1")), | ||
e.be() || | ||
e.Ce() || | ||
((l.style.color = ie(e.textColor)), | ||
@@ -42,3 +42,3 @@ (l.style.backgroundColor = ie(e.backgroundColor)), | ||
`Cannot show in-app message ${e.message} because another message is being shown.`, | ||
InAppMessage.Me.ke, | ||
InAppMessage.Be.Le, | ||
) | ||
@@ -69,3 +69,3 @@ : a(l)); | ||
(l.onclick = (a) => ( | ||
e.he(l, () => { | ||
e.Ae(l, () => { | ||
logInAppMessageClick(e), | ||
@@ -85,5 +85,5 @@ e.clickAction === InAppMessage.ClickAction.URI | ||
"Close Message", | ||
e.be() ? void 0 : ie(e.closeButtonColor), | ||
e.Ce() ? void 0 : ie(e.closeButtonColor), | ||
() => { | ||
e.he(l); | ||
e.Ae(l); | ||
}, | ||
@@ -94,3 +94,3 @@ ); | ||
f.className = "ab-message-text"; | ||
const h = (e.messageAlignment || e.$e).toLowerCase(); | ||
const h = (e.messageAlignment || e.De).toLowerCase(); | ||
f.className += " " + h + "-aligned"; | ||
@@ -106,3 +106,3 @@ let j = !1; | ||
o.setAttribute("aria-label", "Modal Image"), | ||
e.ze(o), | ||
e.Ge(o), | ||
w.appendChild(o); | ||
@@ -113,3 +113,3 @@ } else { | ||
(o.setAttribute("src", e.imageUrl), | ||
e.ze(o), | ||
e.Ge(o), | ||
0 === document.querySelectorAll(".ab-iam-img-loading").length) | ||
@@ -137,3 +137,3 @@ ) { | ||
(o.className = "ab-icon"), | ||
e.be() || | ||
e.Ce() || | ||
((o.style.backgroundColor = ie(e.iconBackgroundColor)), | ||
@@ -152,3 +152,3 @@ (o.style.color = ie(e.iconColor))); | ||
const o = document.createElement("h1"); | ||
(o.className = "ab-message-header"), (e.Le = p.W()), (o.id = e.Le); | ||
(o.className = "ab-message-header"), (e.He = p.W()), (o.id = e.He); | ||
const a = ( | ||
@@ -158,7 +158,7 @@ e.headerAlignment || InAppMessage.TextAlignment.CENTER | ||
(o.className += " " + a + "-aligned"), | ||
e.be() || (o.style.color = ie(e.headerTextColor)), | ||
e.Ce() || (o.style.color = ie(e.headerTextColor)), | ||
o.appendChild(document.createTextNode(e.header)), | ||
f.appendChild(o); | ||
} | ||
return f.appendChild(e.Ie()), l.appendChild(f), j || c(), (e.Pe = l), l; | ||
return f.appendChild(e.Je()), l.appendChild(f), j || c(), (e.Me = l), l; | ||
})(e, o, a, t, n, s, l); | ||
@@ -168,5 +168,5 @@ if (e instanceof FullScreenMessage || e instanceof ModalMessage) { | ||
(b.className += ` ${a} ab-centered`), | ||
le.Te(e, o, b, n), | ||
le.qe(b), | ||
le.Be(e.Le, b); | ||
le.Ke(e, o, b, n), | ||
le.Oe(b), | ||
le.Qe(e.He, b); | ||
} else if (e instanceof SlideUpMessage) { | ||
@@ -179,3 +179,3 @@ b.className += " ab-slideup"; | ||
"M11.38 9.72l-9.33 9.72L0 17.3l7.27-7.58L0 2.14 2.05 0l9.33 9.72z", | ||
e.be() ? void 0 : ie(e.closeButtonColor), | ||
e.Ce() ? void 0 : ie(e.closeButtonColor), | ||
); | ||
@@ -194,4 +194,4 @@ a.setAttribute("class", "ab-chevron"), o.appendChild(a); | ||
e.slideFrom === InAppMessage.SlideFrom.TOP | ||
? ((a = m.De), (t = " ab-swiped-up")) | ||
: ((a = m.Ee), (t = " ab-swiped-down")), | ||
? ((a = m.Re), (t = " ab-swiped-up")) | ||
: ((a = m.Se), (t = " ab-swiped-down")), | ||
c(b, a, (e) => { | ||
@@ -198,0 +198,0 @@ (b.className += t), null != o && null != o.onclick && o.onclick(e); |
@@ -8,3 +8,3 @@ import InAppMessage from "../models/in-app-message.js"; | ||
const le = { | ||
qe: (t) => { | ||
Oe: (t) => { | ||
const o = t.querySelectorAll( | ||
@@ -29,3 +29,3 @@ ".ab-close-button, .ab-message-text, .ab-message-button", | ||
}, | ||
Be: (t, o) => { | ||
Qe: (t, o) => { | ||
o.setAttribute("role", "dialog"), | ||
@@ -36,3 +36,3 @@ o.setAttribute("aria-modal", "true"), | ||
}, | ||
Te: (t, o, e, s) => { | ||
Ke: (t, o, e, s) => { | ||
if (t.buttons && t.buttons.length > 0) { | ||
@@ -44,3 +44,3 @@ const a = document.createElement("div"); | ||
const n = (a) => (l) => ( | ||
t.he(e, () => { | ||
t.Ae(e, () => { | ||
logInAppMessageButtonClick(a, t), | ||
@@ -67,3 +67,3 @@ a.clickAction === InAppMessage.ClickAction.URI | ||
s.appendChild(document.createTextNode(l)), | ||
t.be() || | ||
t.Ce() || | ||
((s.style.backgroundColor = ie(e.backgroundColor)), | ||
@@ -70,0 +70,0 @@ (s.style.color = ie(e.textColor)), |
import e from "../managers/braze-instance.js"; | ||
import se from "./in-app-message-manager-factory.js"; | ||
export function getDeferredInAppMessage() { | ||
if (e.X()) return se.m().Ge(); | ||
if (e.X()) return se.m().Ue(); | ||
} |
@@ -50,3 +50,3 @@ import InAppMessage from "./models/in-app-message.js"; | ||
let D; | ||
if (o === ModalMessage.it || o === InAppMessage.Ce.Je) | ||
if (o === ModalMessage.it || o === InAppMessage.qe.Ve) | ||
D = new ModalMessage( | ||
@@ -142,4 +142,4 @@ s, | ||
o !== HtmlMessage.it && | ||
o !== InAppMessage.Ce.je && | ||
o !== InAppMessage.Ce.Se | ||
o !== InAppMessage.qe.$e && | ||
o !== InAppMessage.qe.We | ||
) | ||
@@ -153,3 +153,3 @@ return void r.error("Ignoring message with unknown type " + o); | ||
} | ||
return (D.Ae = o), D; | ||
return (D.we = o), D; | ||
} | ||
@@ -156,0 +156,0 @@ export function buttonsFromSerializedInAppMessage(e) { |
@@ -9,3 +9,3 @@ import C from "../util/net.js"; | ||
import { newInAppMessageFromJson as pt } from "./in-app-message-factory.js"; | ||
import { randomInclusive as k } from "../util/math.js"; | ||
import { randomInclusive as U } from "../util/math.js"; | ||
import t from "../models/request-result.js"; | ||
@@ -24,3 +24,3 @@ import { logger as r, EventTypes as i } from "../../shared-lib/index.js"; | ||
import vt from "../Push/utils/push-utils.js"; | ||
import S from "../util/request-header-utils.js"; | ||
import D from "../util/request-header-utils.js"; | ||
import { STORAGE_KEYS as o } from "../managers/storage-manager.js"; | ||
@@ -31,7 +31,7 @@ import { FullScreenMessage, ModalMessage, SlideUpMessage } from "./index.js"; | ||
(this.qt = t), | ||
(this.di = s), | ||
(this.ri = s), | ||
(this.u = i), | ||
(this.wt = r), | ||
(this.qt = t), | ||
(this.di = s), | ||
(this.ri = s), | ||
(this.u = i), | ||
@@ -41,17 +41,17 @@ (this.wt = r), | ||
e.$t(this._e), | ||
(this.Ne = 1e3), | ||
(this.Oe = 6e4), | ||
(this.Re = null); | ||
(this.Xe = 1e3), | ||
(this.Ye = 6e4), | ||
(this.Ze = null); | ||
} | ||
He() { | ||
Mi() { | ||
return this._e; | ||
} | ||
Ke(t) { | ||
_i(t) { | ||
return this._e.It(t); | ||
} | ||
Qe() { | ||
return this.Re; | ||
Pi() { | ||
return this.Ze; | ||
} | ||
Ue(t) { | ||
this.Re = t; | ||
$i(t) { | ||
this.Ze = t; | ||
} | ||
@@ -63,3 +63,3 @@ q(e, n, o, a) { | ||
else { | ||
if (n === i.Ve || (e instanceof HtmlMessage && n === i.We)) { | ||
if (n === i.Ei || (e instanceof HtmlMessage && n === i.Gi)) { | ||
if (!e.p(a)) | ||
@@ -72,3 +72,3 @@ return ( | ||
); | ||
} else if (n === i.Xe) { | ||
} else if (n === i.Oi) { | ||
if (!e.K()) | ||
@@ -82,3 +82,3 @@ return ( | ||
} | ||
u = this.Ye(e); | ||
u = this.Xi(e); | ||
} | ||
@@ -91,3 +91,3 @@ return null == u | ||
} | ||
Ze(e, n) { | ||
Hi(e, n) { | ||
const o = new t(); | ||
@@ -101,6 +101,6 @@ if (!e.p()) | ||
); | ||
const a = this.Ye(n); | ||
const a = this.Xi(n); | ||
return null == a | ||
? o | ||
: e.id === InAppMessageButton.Pi | ||
: e.id === InAppMessageButton.Ji | ||
? (r.info( | ||
@@ -110,9 +110,9 @@ "This in-app message button does not have a tracking id. Not logging event to Braze servers.", | ||
o) | ||
: (null != e.id && (a.bid = e.id), s.q(i.We, a)); | ||
: (null != e.id && (a.bid = e.id), s.q(i.Gi, a)); | ||
} | ||
Oi(t) { | ||
Ki(t) { | ||
const e = t.messageFields; | ||
return (null != e && e.is_push_primer) || !1; | ||
} | ||
Qi(t) { | ||
Li(t) { | ||
if (!(t instanceof InAppMessage)) return; | ||
@@ -123,8 +123,8 @@ const e = (t) => { | ||
return ft(e) | ||
? dt(jt.Vi, "In-App Message") | ||
: gt(e) && !vt.Wi() | ||
? dt(jt.Xi, "In-App Message") | ||
? dt(jt.Qi, "In-App Message") | ||
: gt(e) && !vt.Vi() | ||
? dt(jt.Wi, "In-App Message") | ||
: void 0; | ||
}; | ||
if (this.Oi(t) && !vt.Wi()) | ||
if (this.Ki(t) && !vt.Vi()) | ||
return "In-App Message contains a push prompt, but is not eligible for a push prompt. Ignoring."; | ||
@@ -148,39 +148,42 @@ const s = t.buttons || []; | ||
Yi(t, e, s, i) { | ||
if (!this.qt) return; | ||
const n = this.qt.Zi(!1, !1), | ||
o = this.qt.Ps(n); | ||
(o.template = { trigger_id: t.triggerId, trigger_event_type: e }), | ||
null != s && (o.template.data = s.Mr()); | ||
const a = this.qt._s(o, S.Gs._r); | ||
this.qt.Hs( | ||
o, | ||
() => { | ||
this.qt && | ||
(S.Os(this.u, S.Gs._r, new Date().valueOf()), | ||
C.Qs({ | ||
url: `${this.qt.Vs()}/template/`, | ||
data: o, | ||
headers: a, | ||
const n = this.qt; | ||
if (!n) return; | ||
const o = n.Zi(!1, !1), | ||
a = n.Js(o); | ||
(a.template = { trigger_id: t.triggerId, trigger_event_type: e }), | ||
null != s && (a.template.data = s.Ir()); | ||
const l = n.$s(a, D.Ps.Mr); | ||
n.Xs( | ||
a, | ||
(n = -1) => { | ||
if (!this.qt) return; | ||
const o = new Date().valueOf(); | ||
D._s(this.u, D.Ps.Mr, o), | ||
-1 !== n && l.push(["X-Braze-Req-Tokens-Remaining", n.toString()]), | ||
C.Gs({ | ||
url: `${this.qt.Hs()}/template/`, | ||
data: a, | ||
headers: l, | ||
L: (e) => { | ||
if ((S.Ys(this.u, S.Gs._r, 1), !this.qt.Ws(o, e, a))) | ||
return void ("function" == typeof t.Gr && t.Gr()); | ||
if ((this.qt.Xs(), null == e || null == e.templated_message)) | ||
if ((D.Qs(this.u, D.Ps.Mr, 1), !this.qt.Ks(a, e, l))) | ||
return void ("function" == typeof t.Tr && t.Tr()); | ||
if ((this.qt.Os(), null == e || null == e.templated_message)) | ||
return; | ||
const s = e.templated_message; | ||
if (s.type !== mt.Or.Cr) return; | ||
if (s.type !== mt._r.Br) return; | ||
const i = pt(s.data); | ||
if (null == i) return; | ||
const n = this.Qi(i); | ||
const n = this.Li(i); | ||
if (n) | ||
return r.error(n), void ("function" == typeof t.Gr && t.Gr()); | ||
"function" == typeof t.Hr && t.Hr(i); | ||
return r.error(n), void ("function" == typeof t.Tr && t.Tr()); | ||
"function" == typeof t.Er && t.Er(i); | ||
}, | ||
error: (r) => { | ||
let n = `getting user personalization for message ${t.triggerId}`; | ||
if (new Date().valueOf() - t.Jr < t.Kr) { | ||
S.si(this.u, S.Gs._r); | ||
const r = Math.min(t.Kr, this.Oe), | ||
o = this.Ne; | ||
if (new Date().valueOf() - t.Gr < t.Nr) { | ||
D.Ys(this.u, D.Ps.Mr); | ||
const r = Math.min(t.Nr, this.Ye), | ||
o = this.Xe; | ||
null == i && (i = o); | ||
const a = Math.min(r, k(o, 3 * i)); | ||
const a = Math.min(r, U(o, 3 * i)); | ||
(n += `. Retrying in ${a} ms`), | ||
@@ -191,10 +194,10 @@ setTimeout(() => { | ||
} | ||
this.qt.Zs(r, n); | ||
this.qt.Vs(r, n); | ||
}, | ||
})); | ||
}); | ||
}, | ||
S.ii._r, | ||
D.Ps.Mr, | ||
); | ||
} | ||
Ye(t) { | ||
Xi(t) { | ||
if (null == t.triggerId) | ||
@@ -210,3 +213,3 @@ return ( | ||
} | ||
de(t) { | ||
je(t) { | ||
return ( | ||
@@ -218,31 +221,31 @@ !!this.u && | ||
) && | ||
this.u.k(o.C.Lr, t.Y()) | ||
this.u.k(o.C.Cr, t.Y()) | ||
); | ||
} | ||
Ge() { | ||
Ue() { | ||
if (!this.u) return null; | ||
const t = this.u.j(o.C.Lr); | ||
const t = this.u.j(o.C.Cr); | ||
if (!t) return null; | ||
let e; | ||
switch (t.type) { | ||
case InAppMessage.Ce.Qr: | ||
e = FullScreenMessage.Ur(t); | ||
case InAppMessage.qe.Or: | ||
e = FullScreenMessage.Xr(t); | ||
break; | ||
case InAppMessage.Ce.Vr: | ||
case InAppMessage.Ce.je: | ||
case InAppMessage.Ce.Se: | ||
e = HtmlMessage.Ur(t); | ||
case InAppMessage.qe.Hr: | ||
case InAppMessage.qe.$e: | ||
case InAppMessage.qe.We: | ||
e = HtmlMessage.Xr(t); | ||
break; | ||
case InAppMessage.Ce.Wr: | ||
case InAppMessage.Ce.Je: | ||
e = ModalMessage.Ur(t); | ||
case InAppMessage.qe.Jr: | ||
case InAppMessage.qe.Ve: | ||
e = ModalMessage.Xr(t); | ||
break; | ||
case InAppMessage.Ce.Xr: | ||
e = SlideUpMessage.Ur(t); | ||
case InAppMessage.qe.Kr: | ||
e = SlideUpMessage.Xr(t); | ||
} | ||
return e && this.Yr(), e; | ||
return e && this.Lr(), e; | ||
} | ||
Yr() { | ||
this.u && this.u.hi(o.C.Lr); | ||
Lr() { | ||
this.u && this.u.ti(o.C.Cr); | ||
} | ||
} |
@@ -15,7 +15,7 @@ import e from "../managers/braze-instance.js"; | ||
if (!(t instanceof InAppMessage)) return r.error(sr), !1; | ||
const n = se.m().Ze(o, t); | ||
const n = se.m().Hi(o, t); | ||
if (n.L) | ||
for (let r = 0; r < n.ge.length; r++) | ||
et.rr().fe( | ||
tt.Zr, | ||
tt.Qr, | ||
[ | ||
@@ -22,0 +22,0 @@ t.triggerId, |
@@ -12,9 +12,9 @@ import e from "../managers/braze-instance.js"; | ||
if (!(o instanceof InAppMessage)) return r.error(sr), !1; | ||
const s = se.m().q(o, i.Ve); | ||
const s = se.m().q(o, i.Ei); | ||
if (s) { | ||
o.mo() || logInAppMessageImpression(o); | ||
o.Ur() || logInAppMessageImpression(o); | ||
for (let r = 0; r < s.ge.length; r++) | ||
et.rr().fe(tt.Zr, [o.triggerId], s.ge[r]); | ||
et.rr().fe(tt.Qr, [o.triggerId], s.ge[r]); | ||
} | ||
return s.L; | ||
} |
@@ -16,9 +16,9 @@ import e from "../managers/braze-instance.js"; | ||
); | ||
let m = i.Ve; | ||
null != s && (m = i.We); | ||
let m = i.Ei; | ||
null != s && (m = i.Gi); | ||
const n = se.m().q(t, m, s, o); | ||
if (n.L) | ||
for (let e = 0; e < n.ge.length; e++) | ||
et.rr().fe(tt.Zr, [t.triggerId, s], n.ge[e]); | ||
et.rr().fe(tt.Qr, [t.triggerId, s], n.ge[e]); | ||
return n.L; | ||
} |
@@ -11,4 +11,4 @@ import e from "../managers/braze-instance.js"; | ||
return r.error(sr), !1; | ||
const s = o instanceof ControlMessage ? i.po : i.Xe; | ||
const s = o instanceof ControlMessage ? i.mo : i.Oi; | ||
return se.m().q(o, s).L; | ||
} |
@@ -69,3 +69,3 @@ import { buttonsFromSerializedInAppMessage as pe } from "../in-app-message-factory.js"; | ||
), | ||
(this.$e = InAppMessage.TextAlignment.CENTER); | ||
(this.De = InAppMessage.TextAlignment.CENTER); | ||
} | ||
@@ -75,10 +75,15 @@ Y() { | ||
} | ||
static Ur(e) { | ||
static Xr(e) { | ||
return new FullScreenMessage( | ||
e[InAppMessage.tt.Vr], | ||
e[InAppMessage.tt.Wr], | ||
e[InAppMessage.tt.bt], | ||
e[InAppMessage.tt.Yr], | ||
e[InAppMessage.tt.Zr], | ||
e[InAppMessage.tt.URI], | ||
e[InAppMessage.tt.ea], | ||
e[InAppMessage.tt.ra], | ||
e[InAppMessage.tt.bt], | ||
e[InAppMessage.tt.sa], | ||
e[InAppMessage.tt.ta], | ||
e[InAppMessage.tt.URI], | ||
e[InAppMessage.tt.ot], | ||
e[InAppMessage.tt.ia], | ||
@@ -88,3 +93,2 @@ e[InAppMessage.tt.aa], | ||
e[InAppMessage.tt.pa], | ||
e[InAppMessage.tt.ot], | ||
e[InAppMessage.tt.ma], | ||
@@ -98,15 +102,11 @@ e[InAppMessage.tt.na], | ||
e[InAppMessage.tt.ga], | ||
e[InAppMessage.tt.ja], | ||
pe(e[InAppMessage.tt.ja]), | ||
e[InAppMessage.tt.xa], | ||
e[InAppMessage.tt.za], | ||
e[InAppMessage.tt.ha], | ||
pe(e[InAppMessage.tt.va]), | ||
e[InAppMessage.tt.wa], | ||
e[InAppMessage.tt.ya], | ||
e[InAppMessage.tt.Sa], | ||
e[InAppMessage.tt.CSS], | ||
e[InAppMessage.tt.ba], | ||
e[InAppMessage.tt.va], | ||
); | ||
} | ||
} | ||
FullScreenMessage.it = InAppMessage.Ce.Qr; | ||
FullScreenMessage.it = InAppMessage.qe.Or; |
@@ -43,3 +43,3 @@ import InAppMessage from "./in-app-message.js"; | ||
p(i) { | ||
if (this.Ae === InAppMessage.Ce.Vr) { | ||
if (this.we === InAppMessage.qe.Hr) { | ||
if (this.vo) return !1; | ||
@@ -54,19 +54,19 @@ this.vo = !0; | ||
} | ||
static Ur(i) { | ||
static Xr(i) { | ||
return new HtmlMessage( | ||
i[InAppMessage.tt.ea], | ||
i[InAppMessage.tt.Vr], | ||
i[InAppMessage.tt.bt], | ||
i[InAppMessage.tt.Yr], | ||
i[InAppMessage.tt.ra], | ||
i[InAppMessage.tt.sa], | ||
i[InAppMessage.tt.aa], | ||
i[InAppMessage.tt.oa], | ||
i[InAppMessage.tt.la], | ||
i[InAppMessage.tt.ua], | ||
i[InAppMessage.tt.ca], | ||
i[InAppMessage.tt.ga], | ||
i[InAppMessage.tt.ha], | ||
i[InAppMessage.tt.Sa], | ||
i[InAppMessage.tt.CSS], | ||
i[InAppMessage.tt.uo], | ||
i[InAppMessage.tt.ba], | ||
i[InAppMessage.tt.va], | ||
); | ||
} | ||
} | ||
HtmlMessage.it = InAppMessage.Ce.Vr; | ||
HtmlMessage.it = InAppMessage.qe.Hr; |
@@ -18,3 +18,3 @@ import InAppMessage from "./in-app-message.js"; | ||
(this.uri = e), | ||
null == n && (n = InAppMessageButton.Pi), | ||
null == n && (n = InAppMessageButton.Ji), | ||
(this.id = n), | ||
@@ -48,2 +48,2 @@ (this.vo = !1), | ||
} | ||
InAppMessageButton.Pi = -1; | ||
InAppMessageButton.Ji = -1; |
@@ -110,7 +110,7 @@ import e, { OPTIONS as L } from "../../managers/braze-instance.js"; | ||
(this.oh = !1), | ||
(this.Pe = null), | ||
(this.we = null), | ||
(this.Me = null), | ||
(this.ke = null), | ||
(this.Et = new T()), | ||
(this.rh = new T()), | ||
(this.$e = InAppMessage.TextAlignment.CENTER); | ||
(this.De = InAppMessage.TextAlignment.CENTER); | ||
} | ||
@@ -130,18 +130,18 @@ subscribeToClickedEvent(t) { | ||
closeMessage() { | ||
this.he(this.Pe); | ||
this.Ae(this.Me); | ||
} | ||
xe() { | ||
ze() { | ||
return !0; | ||
} | ||
do() { | ||
return this.xe(); | ||
return this.ze(); | ||
} | ||
ve() { | ||
xe() { | ||
return null != this.htmlId && this.htmlId.length > 4; | ||
} | ||
be() { | ||
return this.ve() && null != this.css && this.css.length > 0; | ||
Ce() { | ||
return this.xe() && null != this.css && this.css.length > 0; | ||
} | ||
ye() { | ||
if (this.ve() && this.be()) return this.htmlId + "-css"; | ||
ve() { | ||
if (this.xe() && this.Ce()) return this.htmlId + "-css"; | ||
} | ||
@@ -151,3 +151,3 @@ K() { | ||
} | ||
mo() { | ||
Ur() { | ||
return this.Th; | ||
@@ -164,3 +164,3 @@ } | ||
let s = t.closest(".ab-iam-root"); | ||
if ((null == s && (s = t), this.xe() && null != s.parentNode)) { | ||
if ((null == s && (s = t), this.ze() && null != s.parentNode)) { | ||
const t = s.parentNode.classList; | ||
@@ -174,6 +174,6 @@ t && t.contains(InAppMessage.lh) && t.remove(InAppMessage.lh), | ||
} | ||
he(t, s) { | ||
Ae(t, s) { | ||
if (null == t) return; | ||
let i; | ||
(this.Pe = null), | ||
(this.Me = null), | ||
(i = | ||
@@ -193,3 +193,3 @@ -1 === t.className.indexOf("ab-in-app-message") | ||
} | ||
const i = this.ye(); | ||
const i = this.ve(); | ||
if (null != i) { | ||
@@ -202,10 +202,10 @@ const t = document.getElementById(i); | ||
}; | ||
h ? setTimeout(n, InAppMessage.Ah) : n(), this.we && this.we.focus(); | ||
h ? setTimeout(n, InAppMessage.Ah) : n(), this.ke && this.ke.focus(); | ||
} | ||
Ie() { | ||
Je() { | ||
return document.createTextNode(this.message || ""); | ||
} | ||
ze(t) { | ||
Ge(t) { | ||
let s = ""; | ||
this.message || this.header || !this.xe() || (s = "Modal Image"), | ||
this.message || this.header || !this.ze() || (s = "Modal Image"), | ||
t.setAttribute("alt", s); | ||
@@ -220,7 +220,9 @@ } | ||
s.scrollHeight > s.clientHeight) || | ||
(document.querySelector(`.${InAppMessage.lh}`) && t.preventDefault()); | ||
(document.querySelector(`.${InAppMessage.lh}`) && | ||
t.cancelable && | ||
t.preventDefault()); | ||
} | ||
Oh(t) { | ||
const s = t.parentNode; | ||
this.xe() && | ||
this.ze() && | ||
null != s && | ||
@@ -273,33 +275,33 @@ this.orientation !== InAppMessage.Orientation.LANDSCAPE && | ||
return t | ||
? ((s[InAppMessage.tt.ea] = this.message), | ||
(s[InAppMessage.tt.ra] = this.messageAlignment), | ||
? ((s[InAppMessage.tt.Vr] = this.message), | ||
(s[InAppMessage.tt.Wr] = this.messageAlignment), | ||
(s[InAppMessage.tt.Rh] = this.slideFrom), | ||
(s[InAppMessage.tt.bt] = this.extras), | ||
(s[InAppMessage.tt.sa] = this.triggerId), | ||
(s[InAppMessage.tt.ta] = this.clickAction), | ||
(s[InAppMessage.tt.Yr] = this.triggerId), | ||
(s[InAppMessage.tt.Zr] = this.clickAction), | ||
(s[InAppMessage.tt.URI] = this.uri), | ||
(s[InAppMessage.tt.ia] = this.openTarget), | ||
(s[InAppMessage.tt.aa] = this.dismissType), | ||
(s[InAppMessage.tt.oa] = this.duration), | ||
(s[InAppMessage.tt.pa] = this.icon), | ||
(s[InAppMessage.tt.ea] = this.openTarget), | ||
(s[InAppMessage.tt.ra] = this.dismissType), | ||
(s[InAppMessage.tt.sa] = this.duration), | ||
(s[InAppMessage.tt.ta] = this.icon), | ||
(s[InAppMessage.tt.ot] = this.imageUrl), | ||
(s[InAppMessage.tt.ma] = this.imageStyle), | ||
(s[InAppMessage.tt.na] = this.iconColor), | ||
(s[InAppMessage.tt.ua] = this.iconBackgroundColor), | ||
(s[InAppMessage.tt.ca] = this.backgroundColor), | ||
(s[InAppMessage.tt.fa] = this.textColor), | ||
(s[InAppMessage.tt.da] = this.closeButtonColor), | ||
(s[InAppMessage.tt.la] = this.animateIn), | ||
(s[InAppMessage.tt.ga] = this.animateOut), | ||
(s[InAppMessage.tt.ja] = this.header), | ||
(s[InAppMessage.tt.xa] = this.headerAlignment), | ||
(s[InAppMessage.tt.za] = this.headerTextColor), | ||
(s[InAppMessage.tt.ha] = this.frameColor), | ||
(s[InAppMessage.tt.va] = this.buttons), | ||
(s[InAppMessage.tt.wa] = this.cropType), | ||
(s[InAppMessage.tt.ya] = this.orientation), | ||
(s[InAppMessage.tt.Sa] = this.htmlId), | ||
(s[InAppMessage.tt.ia] = this.imageStyle), | ||
(s[InAppMessage.tt.aa] = this.iconColor), | ||
(s[InAppMessage.tt.oa] = this.iconBackgroundColor), | ||
(s[InAppMessage.tt.pa] = this.backgroundColor), | ||
(s[InAppMessage.tt.ma] = this.textColor), | ||
(s[InAppMessage.tt.na] = this.closeButtonColor), | ||
(s[InAppMessage.tt.ua] = this.animateIn), | ||
(s[InAppMessage.tt.ca] = this.animateOut), | ||
(s[InAppMessage.tt.fa] = this.header), | ||
(s[InAppMessage.tt.da] = this.headerAlignment), | ||
(s[InAppMessage.tt.la] = this.headerTextColor), | ||
(s[InAppMessage.tt.ga] = this.frameColor), | ||
(s[InAppMessage.tt.ja] = this.buttons), | ||
(s[InAppMessage.tt.xa] = this.cropType), | ||
(s[InAppMessage.tt.za] = this.orientation), | ||
(s[InAppMessage.tt.ha] = this.htmlId), | ||
(s[InAppMessage.tt.CSS] = this.css), | ||
(s[InAppMessage.tt.Z] = t), | ||
(s[InAppMessage.tt.ba] = this.messageExtras), | ||
(s[InAppMessage.tt.va] = this.messageExtras), | ||
s) | ||
@@ -318,5 +320,5 @@ : s; | ||
}), | ||
(InAppMessage.Me = { | ||
(InAppMessage.Be = { | ||
Ch: "hd", | ||
ke: "ias", | ||
Le: "ias", | ||
dh: "of", | ||
@@ -350,10 +352,10 @@ Uh: "do", | ||
}), | ||
(InAppMessage.Ce = { | ||
Xr: "SLIDEUP", | ||
Wr: "MODAL", | ||
Je: "MODAL_STYLED", | ||
Qr: "FULL", | ||
Vr: "WEB_HTML", | ||
je: "HTML", | ||
Se: "HTML_FULL", | ||
(InAppMessage.qe = { | ||
Kr: "SLIDEUP", | ||
Jr: "MODAL", | ||
Ve: "MODAL_STYLED", | ||
Or: "FULL", | ||
Hr: "WEB_HTML", | ||
$e: "HTML", | ||
We: "HTML_FULL", | ||
}), | ||
@@ -366,34 +368,34 @@ (InAppMessage.Ah = 500), | ||
(InAppMessage.tt = { | ||
ea: "m", | ||
ra: "ma", | ||
Vr: "m", | ||
Wr: "ma", | ||
Rh: "sf", | ||
bt: "e", | ||
sa: "ti", | ||
ta: "ca", | ||
Yr: "ti", | ||
Zr: "ca", | ||
URI: "u", | ||
ia: "oa", | ||
aa: "dt", | ||
oa: "d", | ||
pa: "i", | ||
ea: "oa", | ||
ra: "dt", | ||
sa: "d", | ||
ta: "i", | ||
ot: "iu", | ||
ma: "is", | ||
na: "ic", | ||
ua: "ibc", | ||
ca: "bc", | ||
fa: "tc", | ||
da: "cbc", | ||
la: "ai", | ||
ga: "ao", | ||
ja: "h", | ||
xa: "ha", | ||
za: "htc", | ||
ha: "fc", | ||
va: "b", | ||
wa: "ct", | ||
ya: "o", | ||
Sa: "hi", | ||
ia: "is", | ||
aa: "ic", | ||
oa: "ibc", | ||
pa: "bc", | ||
ma: "tc", | ||
na: "cbc", | ||
ua: "ai", | ||
ca: "ao", | ||
fa: "h", | ||
da: "ha", | ||
la: "htc", | ||
ga: "fc", | ||
ja: "b", | ||
xa: "ct", | ||
za: "o", | ||
ha: "hi", | ||
CSS: "css", | ||
Z: "type", | ||
uo: "messageFields", | ||
ba: "me", | ||
va: "me", | ||
}); |
@@ -66,3 +66,3 @@ import { buttonsFromSerializedInAppMessage as pe } from "../in-app-message-factory.js"; | ||
), | ||
(this.$e = InAppMessage.TextAlignment.CENTER); | ||
(this.De = InAppMessage.TextAlignment.CENTER); | ||
} | ||
@@ -72,10 +72,15 @@ Y() { | ||
} | ||
static Ur(e) { | ||
static Xr(e) { | ||
return new ModalMessage( | ||
e[InAppMessage.tt.Vr], | ||
e[InAppMessage.tt.Wr], | ||
e[InAppMessage.tt.bt], | ||
e[InAppMessage.tt.Yr], | ||
e[InAppMessage.tt.Zr], | ||
e[InAppMessage.tt.URI], | ||
e[InAppMessage.tt.ea], | ||
e[InAppMessage.tt.ra], | ||
e[InAppMessage.tt.bt], | ||
e[InAppMessage.tt.sa], | ||
e[InAppMessage.tt.ta], | ||
e[InAppMessage.tt.URI], | ||
e[InAppMessage.tt.ot], | ||
e[InAppMessage.tt.ia], | ||
@@ -85,3 +90,2 @@ e[InAppMessage.tt.aa], | ||
e[InAppMessage.tt.pa], | ||
e[InAppMessage.tt.ot], | ||
e[InAppMessage.tt.ma], | ||
@@ -95,14 +99,10 @@ e[InAppMessage.tt.na], | ||
e[InAppMessage.tt.ga], | ||
e[InAppMessage.tt.ja], | ||
pe(e[InAppMessage.tt.ja]), | ||
e[InAppMessage.tt.xa], | ||
e[InAppMessage.tt.za], | ||
e[InAppMessage.tt.ha], | ||
pe(e[InAppMessage.tt.va]), | ||
e[InAppMessage.tt.wa], | ||
e[InAppMessage.tt.Sa], | ||
e[InAppMessage.tt.CSS], | ||
e[InAppMessage.tt.ba], | ||
e[InAppMessage.tt.va], | ||
); | ||
} | ||
} | ||
ModalMessage.it = InAppMessage.Ce.Wr; | ||
ModalMessage.it = InAppMessage.qe.Jr; |
@@ -62,8 +62,8 @@ import InAppMessage from "./in-app-message.js"; | ||
), | ||
(this.$e = InAppMessage.TextAlignment.START); | ||
(this.De = InAppMessage.TextAlignment.START); | ||
} | ||
xe() { | ||
ze() { | ||
return !1; | ||
} | ||
Ie() { | ||
Je() { | ||
const e = document.createElement("span"); | ||
@@ -74,3 +74,3 @@ return e.appendChild(document.createTextNode(this.message || "")), e; | ||
const t = e.getElementsByClassName("ab-in-app-message")[0]; | ||
de.co(t, !0, !0) || | ||
de.po(t, !0, !0) || | ||
(this.slideFrom === InAppMessage.SlideFrom.TOP | ||
@@ -84,29 +84,29 @@ ? (t.style.top = "0px") | ||
} | ||
static Ur(e) { | ||
static Xr(e) { | ||
return new SlideUpMessage( | ||
e[InAppMessage.tt.Vr], | ||
e[InAppMessage.tt.Wr], | ||
e[InAppMessage.tt.Rh], | ||
e[InAppMessage.tt.bt], | ||
e[InAppMessage.tt.Yr], | ||
e[InAppMessage.tt.Zr], | ||
e[InAppMessage.tt.URI], | ||
e[InAppMessage.tt.ea], | ||
e[InAppMessage.tt.ra], | ||
e[InAppMessage.tt.Rh], | ||
e[InAppMessage.tt.bt], | ||
e[InAppMessage.tt.sa], | ||
e[InAppMessage.tt.ta], | ||
e[InAppMessage.tt.URI], | ||
e[InAppMessage.tt.ia], | ||
e[InAppMessage.tt.ot], | ||
e[InAppMessage.tt.aa], | ||
e[InAppMessage.tt.oa], | ||
e[InAppMessage.tt.pa], | ||
e[InAppMessage.tt.ot], | ||
e[InAppMessage.tt.ma], | ||
e[InAppMessage.tt.na], | ||
e[InAppMessage.tt.ua], | ||
e[InAppMessage.tt.ca], | ||
e[InAppMessage.tt.fa], | ||
e[InAppMessage.tt.da], | ||
e[InAppMessage.tt.la], | ||
e[InAppMessage.tt.ga], | ||
e[InAppMessage.tt.Sa], | ||
e[InAppMessage.tt.ha], | ||
e[InAppMessage.tt.CSS], | ||
e[InAppMessage.tt.ba], | ||
e[InAppMessage.tt.va], | ||
); | ||
} | ||
} | ||
SlideUpMessage.it = InAppMessage.Ce.Xr; | ||
SlideUpMessage.it = InAppMessage.qe.Kr; |
export default class wt { | ||
constructor(t, s, i, h, l) { | ||
(this.triggerId = t), | ||
(this.Hr = s), | ||
(this.Gr = i), | ||
(this.Jr = h), | ||
(this.Kr = l), | ||
(this.Er = s), | ||
(this.Tr = i), | ||
(this.Gr = h), | ||
(this.Nr = l), | ||
(this.triggerId = t), | ||
(this.Hr = s), | ||
(this.Gr = i), | ||
(this.Jr = h), | ||
(this.Kr = l); | ||
(this.Er = s), | ||
(this.Tr = i), | ||
(this.Gr = h), | ||
(this.Nr = l); | ||
} | ||
@@ -14,0 +14,0 @@ static fromJson(t, s, i, h, l) { |
@@ -7,5 +7,5 @@ import e from "../managers/braze-instance.js"; | ||
? null | ||
: se.m().Ke(function (r) { | ||
: se.m()._i(function (r) { | ||
return n(r[0]), r.slice(1); | ||
}); | ||
} |
@@ -10,7 +10,7 @@ import se from "../in-app-message-manager-factory.js"; | ||
const s = se.m(); | ||
if (null == s.Qe()) { | ||
if (null == s.Pi()) { | ||
const r = subscribeToInAppMessage((s) => showInAppMessage(s)); | ||
s.Ue(r); | ||
s.$i(r); | ||
} | ||
return s.Qe(); | ||
return s.Pi(); | ||
} |
@@ -13,3 +13,3 @@ import e, { OPTIONS as L } from "../../managers/braze-instance.js"; | ||
} from "../../util/window-utils.js"; | ||
import { isURIJavascriptOrData as N } from "../../util/url-utils.js"; | ||
import { isURIJavascriptOrData as R } from "../../util/url-utils.js"; | ||
import { KeyCodes as lt } from "../../util/key-codes.js"; | ||
@@ -43,3 +43,3 @@ import { setupInAppMessageUI as ss } from "../../ui/js/index.js"; | ||
); | ||
if ((null == s && (s = document.body), t.xe())) { | ||
if ((null == s && (s = document.body), t.ze())) { | ||
if (s.querySelectorAll(".ab-modal-interactions").length > 0) | ||
@@ -54,3 +54,3 @@ return ( | ||
if (eo.fo()) { | ||
const e = eo.jo(); | ||
const e = eo.co(); | ||
if ( | ||
@@ -82,5 +82,5 @@ (e === fe.PORTRAIT && | ||
const o = s[t].uri; | ||
e = N(o); | ||
e = R(o); | ||
} | ||
} else t.clickAction === InAppMessage.ClickAction.URI && (e = N(t.uri)); | ||
} else t.clickAction === InAppMessage.ClickAction.URI && (e = R(t.uri)); | ||
if (e) | ||
@@ -99,11 +99,11 @@ return ( | ||
n.setAttribute("role", "complementary"), | ||
t.ve() && (n.id = t.htmlId), | ||
e.nn(L.bo) && (n.style.zIndex = (e.nn(L.bo) + 1).toString()), | ||
t.xe() && (n.id = t.htmlId), | ||
e.nn(L.jo) && (n.style.zIndex = (e.nn(L.jo) + 1).toString()), | ||
s.appendChild(n), | ||
t.be()) | ||
t.Ce()) | ||
) { | ||
const s = document.createElement("style"); | ||
(s.innerHTML = t.css), | ||
(s.id = t.ye()), | ||
null != e.nn(L.ho) && s.setAttribute("nonce", e.nn(L.ho)), | ||
(s.id = t.ve()), | ||
null != e.nn(L.bo) && s.setAttribute("nonce", e.nn(L.bo)), | ||
document.getElementsByTagName("head")[0].appendChild(s); | ||
@@ -120,8 +120,8 @@ } | ||
(s) => { | ||
if (t.xe() && t.do()) { | ||
if (t.ze() && t.do()) { | ||
const o = document.createElement("div"); | ||
if ( | ||
((o.className = "ab-page-blocker"), | ||
t.be() || (o.style.backgroundColor = ie(t.frameColor)), | ||
e.nn(L.bo) && (o.style.zIndex = e.nn(L.bo).toString()), | ||
t.Ce() || (o.style.backgroundColor = ie(t.frameColor)), | ||
e.nn(L.jo) && (o.style.zIndex = e.nn(L.jo).toString()), | ||
n.appendChild(o), | ||
@@ -133,3 +133,3 @@ !e.nn(L.Lh)) | ||
new Date().valueOf() - e > InAppMessage.fh && | ||
(t.he(s), o.stopPropagation()); | ||
(t.Ae(s), o.stopPropagation()); | ||
}; | ||
@@ -169,3 +169,3 @@ } | ||
setTimeout(() => { | ||
n.contains(s) && t.he(s); | ||
n.contains(s) && t.Ae(s); | ||
}, t.duration), | ||
@@ -177,5 +177,5 @@ "function" == typeof o && o(); | ||
}, | ||
e.nn(L.wo), | ||
e.nn(L.ho), | ||
e.nn(L.jo), | ||
e.nn(L.bo), | ||
e.nn(L.ho), | ||
s, | ||
@@ -182,0 +182,0 @@ ); |
@@ -26,6 +26,6 @@ import { STORAGE_KEYS as o } from "./storage-manager.js"; | ||
const s = A.Yt.Qt; | ||
new A(s, r).setItem(s.ss.jh, this.gh, t), i !== t && this.Xs(); | ||
new A(s, r).setItem(s.ss.jh, this.gh, t), i !== t && this.Os(); | ||
} | ||
xh() { | ||
this.u.hi(o.C.wh); | ||
this.u.ti(o.C.wh); | ||
const t = A.Yt.Qt; | ||
@@ -49,5 +49,5 @@ new A(t, r).re(t.ss.jh, this.gh); | ||
} | ||
Xs() { | ||
Os() { | ||
this.Zn = 0; | ||
} | ||
} |
@@ -32,6 +32,6 @@ import kt from "./auth-manager.js"; | ||
Ao: "devicePropertyAllowlist", | ||
Aa: "disablePushTokenMaintenance", | ||
_a: "disablePushTokenMaintenance", | ||
So: "enableLogging", | ||
No: "enableSdkAuthentication", | ||
qa: "manageServiceWorkerExternally", | ||
Ma: "manageServiceWorkerExternally", | ||
Oo: "minimumIntervalBetweenTriggerActionsInSeconds", | ||
@@ -41,9 +41,9 @@ Po: "sessionTimeoutInSeconds", | ||
Lo: "appVersionNumber", | ||
_a: "serviceWorkerLocation", | ||
ka: "safariWebsitePushId", | ||
wa: "serviceWorkerLocation", | ||
ya: "safariWebsitePushId", | ||
zn: "localization", | ||
ho: "contentSecurityNonce", | ||
bo: "contentSecurityNonce", | ||
Do: "allowUserSuppliedJavascript", | ||
bo: "inAppMessageZIndex", | ||
wo: "openInAppMessagesInNewTab", | ||
jo: "inAppMessageZIndex", | ||
ho: "openInAppMessagesInNewTab", | ||
tn: "openCardsInNewTab", | ||
@@ -61,26 +61,26 @@ en: "openNewsFeedCardsInNewTab", | ||
(this.Vo = void 0), | ||
(this.Go = null), | ||
(this.zo = null), | ||
(this.on = null), | ||
(this.qt = null), | ||
(this.Ei = null), | ||
(this.zi = null), | ||
(this.yt = null), | ||
(this.di = null), | ||
(this.ri = null), | ||
(this.u = null), | ||
(this.wt = null), | ||
(this.Ko = ""), | ||
(this.Go = ""), | ||
(this.Ko = !1), | ||
(this.$o = !1), | ||
(this.qo = !1), | ||
(this.qo = new T()), | ||
(this.Jo = new T()), | ||
(this.Yo = new T()), | ||
(this.options = {}), | ||
(this.Yo = []), | ||
(this.Ho = []), | ||
(this.Xo = []), | ||
(this._e = []), | ||
(this.Wo = "5.2.0"); | ||
(this.Wo = "5.3.0"); | ||
} | ||
Zo(t) { | ||
this.Jo.It(t); | ||
Xo(t) { | ||
this.qo.It(t); | ||
} | ||
Sh(t) { | ||
this.Yo.It(t); | ||
this.Jo.It(t); | ||
} | ||
@@ -112,8 +112,8 @@ initialize(t, i) { | ||
"/" === n.pathname && (n = `${n}api/v3`), | ||
(this.Ko = n.toString()), | ||
X.Qo && !this.nn(L.Eo)) | ||
(this.Go = n.toString()), | ||
X.Zo && !this.nn(L.Eo)) | ||
) | ||
return ( | ||
r.info("Ignoring activity from crawler bot " + navigator.userAgent), | ||
(this.qo = !0), | ||
(this.$o = !0), | ||
!1 | ||
@@ -123,7 +123,7 @@ ); | ||
if ( | ||
((this.u = Bt.Wh(t, a)), a && this.u.Vh(t), new Q.ee(null, !0).br(o.se)) | ||
((this.u = Bt.Qo(t, a)), a && this.u.Wh(t), new Q.ee(null, !0).br(o.se)) | ||
) | ||
return ( | ||
r.info("Ignoring all activity due to previous opt out"), | ||
(this.qo = !0), | ||
(this.$o = !0), | ||
!1 | ||
@@ -166,6 +166,6 @@ ); | ||
(this.wt = new bt(this.yt, this.u)), | ||
(this.di = new Mt(this.u, this.wt, this.yt, this.nn(L.Po))); | ||
(this.ri = new Mt(this.u, this.wt, this.yt, this.nn(L.Po))); | ||
const c = new T(); | ||
return ( | ||
(this.Go = new kt(this.u, this.nn(L.No), c)), | ||
(this.zo = new kt(this.u, this.nn(L.No), c)), | ||
this.$t(c), | ||
@@ -175,8 +175,8 @@ (this.qt = new Rt( | ||
this.u, | ||
this.Go, | ||
this.zo, | ||
this.wt, | ||
this.di, | ||
this.ri, | ||
this.yt, | ||
this.rn, | ||
this.Ko, | ||
this.Go, | ||
this.Wo, | ||
@@ -187,6 +187,6 @@ this.Vo || "", | ||
)), | ||
(this.Ei = new Lt( | ||
(this.zi = new Lt( | ||
this.rn, | ||
this.Ko, | ||
this.di, | ||
this.Go, | ||
this.ri, | ||
this.on, | ||
@@ -197,9 +197,9 @@ this.wt, | ||
(t) => { | ||
if (this.so()) for (const i of this.gr()) i.Rs(t); | ||
if (this.so()) for (const i of this.gr()) i.Ns(t); | ||
}, | ||
this.Go, | ||
this.zo, | ||
this.qt, | ||
)), | ||
this.Ei.initialize(), | ||
a || this.u.Kh(), | ||
this.zi.initialize(), | ||
a || this.u.Vh(), | ||
r.info( | ||
@@ -211,22 +211,22 @@ `Initialized for the Braze backend at "${this.nn( | ||
et.o(), | ||
this.yt.xi(() => { | ||
this.yt.ji(() => { | ||
var t; | ||
this.$o && | ||
(null === (t = this.yt) || void 0 === t ? void 0 : t.yi()) && | ||
this.Ko && | ||
(null === (t = this.yt) || void 0 === t ? void 0 : t.ci()) && | ||
import("../FeatureFlags/refresh-feature-flags.js").then((t) => { | ||
if (!this.$o) return; | ||
if (!this.Ko) return; | ||
(0, t.default)(); | ||
}); | ||
}), | ||
this.Ei.mr(() => { | ||
this.zi.mr(() => { | ||
var t; | ||
this.$o && | ||
(null === (t = this.yt) || void 0 === t ? void 0 : t.yi()) && | ||
this.Ko && | ||
(null === (t = this.yt) || void 0 === t ? void 0 : t.ci()) && | ||
import("../FeatureFlags/refresh-feature-flags.js").then((t) => { | ||
if (!this.$o) return; | ||
if (!this.Ko) return; | ||
(0, t.default)(void 0, void 0, !0); | ||
}); | ||
}), | ||
this.Jo.Dt(this.options), | ||
(this.$o = !0), | ||
this.qo.Dt(this.options), | ||
(this.Ko = !0), | ||
!0 | ||
@@ -237,21 +237,21 @@ ); | ||
if ((r.destroy(), this.so())) { | ||
this.Yo.Dt(), this.Yo.removeAllSubscriptions(); | ||
for (const t of this.Ho) t.destroy(); | ||
this.Ho = []; | ||
for (const t of this.Xo) t.clearData(!1); | ||
(this.Xo = []), | ||
this.Jo.Dt(), this.Jo.removeAllSubscriptions(); | ||
for (const t of this.Yo) t.destroy(); | ||
this.Yo = []; | ||
for (const t of this.Ho) t.clearData(!1); | ||
(this.Ho = []), | ||
this.removeAllSubscriptions(), | ||
(this._e = []), | ||
null != this.Ei && this.Ei.destroy(), | ||
(this.Ei = null), | ||
(this.Go = null), | ||
null != this.zi && this.zi.destroy(), | ||
(this.zi = null), | ||
(this.zo = null), | ||
(this.on = null), | ||
(this.qt = null), | ||
(this.yt = null), | ||
(this.di = null), | ||
(this.ri = null), | ||
(this.wt = null), | ||
(this.options = {}), | ||
(this.Vo = void 0), | ||
(this.Ko = !1), | ||
(this.$o = !1), | ||
(this.qo = !1), | ||
t && (this.u = null); | ||
@@ -261,13 +261,13 @@ } | ||
X() { | ||
return !this.$h() && (!!this.so() || (console.warn(_), !1)); | ||
return !this.Kh() && (!!this.so() || (console.warn(_), !1)); | ||
} | ||
Ma() { | ||
ba() { | ||
return this.rn; | ||
} | ||
Sr() { | ||
return this.zo; | ||
} | ||
Hs() { | ||
return this.Go; | ||
} | ||
Vs() { | ||
return this.Ko; | ||
} | ||
te() { | ||
@@ -283,6 +283,6 @@ return this.on; | ||
gr() { | ||
return this.Xo; | ||
return this.Ho; | ||
} | ||
cr() { | ||
return this.Ei; | ||
return this.zi; | ||
} | ||
@@ -293,3 +293,3 @@ ir() { | ||
zr() { | ||
return this.di; | ||
return this.ri; | ||
} | ||
@@ -300,3 +300,3 @@ l() { | ||
pr() { | ||
if (this.wt && this.Ei) return new User(this.wt, this.Ei); | ||
if (this.wt && this.zi) return new User(this.wt, this.zi); | ||
} | ||
@@ -311,9 +311,9 @@ er() { | ||
let i = !1; | ||
for (const s of this.Ho) s === t && (i = !0); | ||
i || this.Ho.push(t); | ||
for (const s of this.Yo) s === t && (i = !0); | ||
i || this.Yo.push(t); | ||
} | ||
ar(t) { | ||
let i = !1; | ||
for (const s of this.Xo) s.constructor === t.constructor && (i = !0); | ||
t instanceof y && !i && this.Xo.push(t); | ||
for (const s of this.Ho) s.constructor === t.constructor && (i = !0); | ||
t instanceof y && !i && this.Ho.push(t); | ||
} | ||
@@ -330,11 +330,11 @@ $t(t) { | ||
oe(t) { | ||
this.qo = t; | ||
this.$o = t; | ||
} | ||
so() { | ||
return this.Ko; | ||
} | ||
Kh() { | ||
return this.$o; | ||
} | ||
$h() { | ||
return this.qo; | ||
} | ||
Ss() { | ||
Ds() { | ||
return this.Wo; | ||
@@ -341,0 +341,0 @@ } |
@@ -12,6 +12,6 @@ import X from "../util/browser-detector.js"; | ||
(this.u = t), | ||
(this.Ia = e), | ||
(this.ka = e), | ||
(this.u = t), | ||
null == e && (e = Pt(DeviceProperties)), | ||
(this.Ia = e); | ||
(this.ka = e); | ||
} | ||
@@ -22,4 +22,4 @@ ce(t = !0) { | ||
const r = new zt(e.eu); | ||
for (let t = 0; t < this.Ia.length; t++) { | ||
switch (this.Ia[t]) { | ||
for (let t = 0; t < this.ka.length; t++) { | ||
switch (this.ka[t]) { | ||
case DeviceProperties.BROWSER: | ||
@@ -29,9 +29,9 @@ r.browser = X.browser; | ||
case DeviceProperties.BROWSER_VERSION: | ||
r.Ta = X.version; | ||
r.Ia = X.version; | ||
break; | ||
case DeviceProperties.OS: | ||
r.os = this.Da(); | ||
r.os = this.Ta(); | ||
break; | ||
case DeviceProperties.RESOLUTION: | ||
r.Oa = screen.width + "x" + screen.height; | ||
r.Da = screen.width + "x" + screen.height; | ||
break; | ||
@@ -42,3 +42,3 @@ case DeviceProperties.LANGUAGE: | ||
case DeviceProperties.TIME_ZONE: | ||
r.timeZone = this.Ca(new Date()); | ||
r.timeZone = this.Sa(new Date()); | ||
break; | ||
@@ -51,8 +51,8 @@ case DeviceProperties.USER_AGENT: | ||
} | ||
Da() { | ||
if (X.Fa()) return X.Fa(); | ||
const t = this.u.j(o.C.Ga); | ||
return t && t.os_version ? t.os_version : X.Da(); | ||
Ta() { | ||
if (X.Oa()) return X.Oa(); | ||
const t = this.u.j(o.C.Ca); | ||
return t && t.os_version ? t.os_version : X.Ta(); | ||
} | ||
Ca(t) { | ||
Sa(t) { | ||
let e = !1; | ||
@@ -74,5 +74,5 @@ if ("undefined" != typeof Intl && "function" == typeof Intl.DateTimeFormat) | ||
const s = t.getTimezoneOffset(); | ||
return this.Ja(s); | ||
return this.Fa(s); | ||
} | ||
Ja(t) { | ||
Fa(t) { | ||
const e = Math.trunc(t / 60), | ||
@@ -79,0 +79,0 @@ r = Math.trunc(t % 60); |
@@ -11,15 +11,15 @@ import qt from "../models/backend-errors.js"; | ||
import { STORAGE_KEYS as o } from "./storage-manager.js"; | ||
import S from "../util/request-header-utils.js"; | ||
import D from "../util/request-header-utils.js"; | ||
import { LAST_REQUEST_TO_ENDPOINT_MS_AGO_DEFAULT as Kt } from "../common/constants.js"; | ||
import { getAlias as Ht } from "./utils.js"; | ||
import { getAlias as Gt } from "./utils.js"; | ||
export default class Rt { | ||
constructor(t, e, s, i, r, n, o, h, a, u, l, c) { | ||
constructor(t, e, i, s, r, n, o, h, a, u, l, c) { | ||
(this.on = t), | ||
(this.u = e), | ||
(this.Go = s), | ||
(this.wt = i), | ||
(this.di = r), | ||
(this.zo = i), | ||
(this.wt = s), | ||
(this.ri = r), | ||
(this.yt = n), | ||
(this.rn = o), | ||
(this.Ko = h), | ||
(this.Go = h), | ||
(this.Wo = a), | ||
@@ -29,11 +29,11 @@ (this.Vo = u), | ||
(this.Xh = c), | ||
(this.Hh = (t) => (null == t ? "" : `${t} `)), | ||
(this.$h = (t) => (null == t ? "" : `${t} `)), | ||
(this.on = t), | ||
(this.u = e), | ||
(this.Go = s), | ||
(this.wt = i), | ||
(this.di = r), | ||
(this.zo = i), | ||
(this.wt = s), | ||
(this.ri = r), | ||
(this.yt = n), | ||
(this.rn = o), | ||
(this.Ko = h), | ||
(this.Go = h), | ||
(this.Wo = a), | ||
@@ -43,17 +43,17 @@ (this.Vo = u), | ||
(this.Xh = c), | ||
(this.Yh = ["npm"]); | ||
(this.Hh = ["npm"]); | ||
} | ||
Ps(t, e = !1, s = !1) { | ||
const i = this.on.ce(!s), | ||
r = i.Mr(), | ||
n = this.u.j(o.C.Ga); | ||
Js(t, e = !1, i = !1) { | ||
const s = this.on.ce(!i), | ||
r = s.Ir(), | ||
n = this.u.j(o.C.Ca); | ||
ii(n, r) || (t.device = r), | ||
(t.api_key = this.rn), | ||
(t.time = h(new Date().valueOf(), !0)); | ||
const a = this.u.j(o.C.Jh) || [], | ||
u = this.u.j(o.C.Qh) || ""; | ||
const a = this.u.j(o.C.Yh) || [], | ||
u = this.u.j(o.C.Jh) || ""; | ||
if ( | ||
(this.Yh.length > 0 && | ||
(!ii(a, this.Yh) || u !== this.di.ki()) && | ||
(t.sdk_metadata = this.Yh), | ||
(this.Hh.length > 0 && | ||
(!ii(a, this.Hh) || u !== this.ri.Si()) && | ||
(t.sdk_metadata = this.Hh), | ||
(t.sdk_version = this.Wo), | ||
@@ -63,3 +63,3 @@ this.Vo && (t.sdk_flavor = this.Vo), | ||
(t.app_version_code = this.Xh), | ||
(t.device_id = i.id), | ||
(t.device_id = s.id), | ||
e) | ||
@@ -70,4 +70,4 @@ ) { | ||
} | ||
if (!t.user_id && !this.Go.Fh()) { | ||
const e = Ht(this.u); | ||
if (!t.user_id && !this.zo.Fh()) { | ||
const e = Gt(this.u); | ||
e && (t.alias = e); | ||
@@ -77,3 +77,3 @@ } | ||
} | ||
Ws(t, e, n) { | ||
Ks(t, e, n) { | ||
const o = e.auth_error, | ||
@@ -84,20 +84,20 @@ h = e.error; | ||
let e; | ||
this.Go.Bh(); | ||
const s = { errorCode: o.error_code }; | ||
this.zo.Bh(); | ||
const i = { errorCode: o.error_code }; | ||
for (const t of n) | ||
j(t) && "X-Braze-Auth-Signature" === t[0] && (s.signature = t[1]); | ||
j(t) && "X-Braze-Auth-Signature" === t[0] && (i.signature = t[1]); | ||
t.respond_with && t.respond_with.user_id | ||
? (s.userId = t.respond_with.user_id) | ||
: t.user_id && (s.userId = t.user_id); | ||
const i = o.reason; | ||
? (i.userId = t.respond_with.user_id) | ||
: t.user_id && (i.userId = t.user_id); | ||
const s = o.reason; | ||
return ( | ||
i | ||
? ((s.reason = i), (e = `due to ${i}`)) | ||
s | ||
? ((i.reason = s), (e = `due to ${s}`)) | ||
: (e = `with error code ${o.error_code}.`), | ||
this.Go.Fh() || | ||
this.zo.Fh() || | ||
(e += | ||
' Please use the "enableSdkAuthentication" initialization option to enable authentication.'), | ||
r.error(`SDK Authentication failed ${e}`), | ||
this.Zh(t.events || [], t.attributes || []), | ||
this.Go.qh(s), | ||
this.Qh(t.events || [], t.attributes || []), | ||
this.zo.qh(i), | ||
!1 | ||
@@ -110,24 +110,24 @@ ); | ||
switch (o) { | ||
case qt.Ra: | ||
case qt.Zh: | ||
return ( | ||
(n = "Received successful response with empty body."), | ||
s.q(i.Ms, { e: n }), | ||
s.q(i.qs, { e: n }), | ||
r.info(n), | ||
!1 | ||
); | ||
case qt.Ba: | ||
case qt.Ra: | ||
return ( | ||
(n = "Received successful response with invalid JSON"), | ||
s.q(i.Ms, { e: n + ": " + e.response }), | ||
s.q(i.qs, { e: n + ": " + e.response }), | ||
r.info(n), | ||
!1 | ||
); | ||
case qt.Xa: | ||
o = `The API key "${t.api_key}" is invalid for the baseUrl ${this.Ko}`; | ||
case qt.qa: | ||
o = `The API key "${t.api_key}" is invalid for the baseUrl ${this.Go}`; | ||
break; | ||
case qt.Na: | ||
case qt.Aa: | ||
o = | ||
"Sorry, we are not currently accepting your requests. If you think this is in error, please contact us."; | ||
break; | ||
case qt.$a: | ||
case qt.Ba: | ||
o = "No device identifier. Please contact support@braze.com"; | ||
@@ -139,6 +139,6 @@ } | ||
} | ||
Ea(t, e, s, i) { | ||
return !!((t && 0 !== t.length) || (e && 0 !== e.length) || s || i); | ||
Na(t, e, i, s) { | ||
return !!((t && 0 !== t.length) || (e && 0 !== e.length) || i || s); | ||
} | ||
Ka(t, e, s, i, r = !1) { | ||
Xa(t, e, i, s, r = !1) { | ||
const n = [], | ||
@@ -152,6 +152,6 @@ o = (t) => t || "", | ||
d = null; | ||
if (s.length > 0) { | ||
if (i.length > 0) { | ||
const t = []; | ||
for (const e of s) { | ||
if (((c = e.Mr()), this.Go.Fh())) { | ||
for (const e of i) { | ||
if (((c = e.Ir()), this.zo.Fh())) { | ||
if (h && !c.user_id) { | ||
@@ -170,60 +170,60 @@ d || (d = {}), d.events || (d.events = []), d.events.push(c); | ||
} | ||
if (i.length > 0) { | ||
if (s.length > 0) { | ||
const t = []; | ||
for (const e of i) | ||
e && (this.Go.Fh() && o(e.user_id) !== h ? u.push(e) : t.push(e)); | ||
for (const e of s) | ||
e && (this.zo.Fh() && o(e.user_id) !== h ? u.push(e) : t.push(e)); | ||
t.length > 0 && (a.attributes = t); | ||
} | ||
if ((this.Zh(l, u), (a = this.Ps(a, !0, r)), d)) { | ||
d = this.Ps(d, !1, r); | ||
const t = { requestData: d, headers: this._s(d, S.Gs.La) }; | ||
if ((this.Qh(l, u), (a = this.Js(a, !0, r)), d)) { | ||
d = this.Js(d, !1, r); | ||
const t = { requestData: d, headers: this.$s(d, D.Ps.$a) }; | ||
n.push(t); | ||
} | ||
if (a && !this.Ea(a.events, a.attributes, t, e)) return d ? n : null; | ||
const f = { requestData: a, headers: this._s(a, S.Gs.La) }; | ||
if (a && !this.Na(a.events, a.attributes, t, e)) return d ? n : null; | ||
const f = { requestData: a, headers: this.$s(a, D.Ps.$a) }; | ||
return n.push(f), n; | ||
} | ||
Zh(t, e) { | ||
Qh(t, e) { | ||
if (t) { | ||
const e = []; | ||
for (const s of t) { | ||
const t = ue.fromJson(s); | ||
for (const i of t) { | ||
const t = ue.fromJson(i); | ||
(t.time = Xt(t.time)), e.push(t); | ||
} | ||
this.u.zo(e); | ||
this.u.xo(e); | ||
} | ||
if (e) for (const t of e) this.u.Pa(t); | ||
if (e) for (const t of e) this.u.La(t); | ||
} | ||
Zs(t, e) { | ||
let s = "HTTP error "; | ||
null != t && (s += t + " "), (s += e), r.error(s); | ||
Vs(t, e) { | ||
let i = "HTTP error "; | ||
null != t && (i += t + " "), (i += e), r.error(i); | ||
} | ||
qr(t) { | ||
return s.q(i.Ua, { n: t }); | ||
return s.q(i.Ea, { n: t }); | ||
} | ||
Zi(t, e, s) { | ||
const i = {}; | ||
t && (i.feed = !0), e && (i.triggers = !0); | ||
const r = null != s ? s : this.wt.getUserId(); | ||
if ((r && (i.user_id = r), !i.user_id && !this.Go.Fh())) { | ||
const t = Ht(this.u); | ||
t && (i.alias = t); | ||
Zi(t, e, i) { | ||
const s = {}; | ||
t && (s.feed = !0), e && (s.triggers = !0); | ||
const r = null != i ? i : this.wt.getUserId(); | ||
if ((r && (s.user_id = r), !s.user_id && !this.zo.Fh())) { | ||
const t = Gt(this.u); | ||
t && (s.alias = t); | ||
} | ||
return (i.config = { config_time: this.yt.ni() }), { respond_with: i }; | ||
return (s.config = { config_time: this.yt.ii() }), { respond_with: s }; | ||
} | ||
Ha(t) { | ||
Ka(t) { | ||
const e = new Date().valueOf(); | ||
let s = Kt.toString(); | ||
const i = S.Wa(this.u, t); | ||
if (-1 !== i) { | ||
s = (e - i).toString(); | ||
let i = Kt.toString(); | ||
const s = D.Pa(this.u, t); | ||
if (-1 !== s) { | ||
i = (e - s).toString(); | ||
} | ||
return s; | ||
return i; | ||
} | ||
_s(t, e, s = !1) { | ||
const i = [["X-Braze-Api-Key", this.rn]], | ||
r = this.Ha(e); | ||
i.push(["X-Braze-Last-Req-Ms-Ago", r]); | ||
const n = S.Ya(this.u, e).toString(); | ||
i.push(["X-Braze-Req-Attempt", n]); | ||
$s(t, e, i = !1) { | ||
const s = [["X-Braze-Api-Key", this.rn]], | ||
r = this.Ka(e); | ||
s.push(["X-Braze-Last-Req-Ms-Ago", r]); | ||
const n = D.Ua(this.u, e).toString(); | ||
s.push(["X-Braze-Req-Attempt", n]); | ||
let h = !1; | ||
@@ -233,92 +233,137 @@ if ( | ||
t.respond_with.triggers && | ||
(i.push(["X-Braze-TriggersRequest", "true"]), (h = !0)), | ||
(s.push(["X-Braze-TriggersRequest", "true"]), (h = !0)), | ||
null != t.respond_with && | ||
t.respond_with.feed && | ||
(i.push(["X-Braze-FeedRequest", "true"]), (h = !0)), | ||
e === S.Gs.Bs) | ||
(s.push(["X-Braze-FeedRequest", "true"]), (h = !0)), | ||
e === D.Ps.Bs) | ||
) { | ||
i.push(["X-Braze-ContentCardsRequest", "true"]); | ||
s.push(["X-Braze-ContentCardsRequest", "true"]); | ||
let t = this.u.j(o.C.As); | ||
(t && s) || ((t = 0), this.u.k(o.C.As, t)), | ||
i.push(["BRAZE-SYNC-RETRY-COUNT", t.toString()]), | ||
(t && i) || ((t = 0), this.u.k(o.C.As, t)), | ||
s.push(["BRAZE-SYNC-RETRY-COUNT", t.toString()]), | ||
(h = !0); | ||
} | ||
if ( | ||
(e === S.Gs.qi && | ||
(i.push(["X-Braze-FeatureFlagsRequest", "true"]), (h = !0)), | ||
h && i.push(["X-Braze-DataRequest", "true"]), | ||
this.Go.Fh()) | ||
(e === D.Ps.bi && | ||
(s.push(["X-Braze-FeatureFlagsRequest", "true"]), (h = !0)), | ||
h && s.push(["X-Braze-DataRequest", "true"]), | ||
this.zo.Fh()) | ||
) { | ||
const t = this.Go.kh(); | ||
null != t && i.push(["X-Braze-Auth-Signature", t]); | ||
const t = this.zo.kh(); | ||
null != t && s.push(["X-Braze-Auth-Signature", t]); | ||
} | ||
return i; | ||
return s; | ||
} | ||
Qa(t, e, s, i) { | ||
Ga(t, e, i, s) { | ||
window.setTimeout(() => { | ||
r.info(`Retrying rate limited ${this.Hh(i)}SDK request.`), | ||
this.Hs(e, s, i); | ||
r.info(`Retrying rate limited ${this.$h(s)}SDK request.`), | ||
this.Xs(e, i, s); | ||
}, t); | ||
} | ||
Hs(t, e, s) { | ||
const i = this.Va(); | ||
if (!i.Za) | ||
Xs(t, e, i, s) { | ||
if (!this.Ha(i)) | ||
return ( | ||
r.info(`${this.$h(i)}SDK request being rate limited.`), | ||
void ("function" == typeof s && s()) | ||
); | ||
const n = this.Wa(); | ||
if (!n.Ya) | ||
return ( | ||
r.info( | ||
`${this.Hh( | ||
s, | ||
`${this.$h( | ||
i, | ||
)}SDK request being rate limited. Request will be retried in ${Math.trunc( | ||
i.au / 1e3, | ||
n.Ja / 1e3, | ||
)} seconds.`, | ||
), | ||
void this.Qa(i.au, t, e, s) | ||
void this.Ga(n.Ja, t, e, i) | ||
); | ||
this.u.k(o.C.du, new Date().valueOf()); | ||
const n = t.device; | ||
n && n.os_version instanceof Promise | ||
? n.os_version.then((s) => { | ||
(t.device.os_version = s), e(); | ||
this.u.k(o.C.Qa, new Date().valueOf()); | ||
const h = t.device; | ||
h && h.os_version instanceof Promise | ||
? h.os_version.then((i) => { | ||
(t.device.os_version = i), e(n.Va); | ||
}) | ||
: e(); | ||
: e(n.Va); | ||
} | ||
li(t) { | ||
Za(t) { | ||
var e; | ||
null === (e = this.u) || void 0 === e || e.k(o.C.fu, t); | ||
null === (e = this.u) || void 0 === e || e.k(o.C.au, t); | ||
} | ||
ui() { | ||
du(t, e) { | ||
let i = this.fu(); | ||
null == i && (i = {}), (i[t] = e), this.u.k(o.C.vu, i); | ||
} | ||
Ru() { | ||
var t; | ||
return null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.fu); | ||
return null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.au); | ||
} | ||
Ru(t, e, s, i) { | ||
let r = this.ui(); | ||
(null == r || isNaN(r)) && (r = e); | ||
const n = (t - i) / 1e3; | ||
return (r = Math.min(r + n / s, e)), r; | ||
fu() { | ||
var t; | ||
return null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.vu); | ||
} | ||
vu(t, e) { | ||
gu(t, e, i, s, r = "") { | ||
let n; | ||
if (r) { | ||
const t = this.fu(); | ||
n = null == t || isNaN(t[r]) ? e : t[r]; | ||
} else (n = this.Ru()), (null == n || isNaN(n)) && (n = e); | ||
const o = (t - s) / 1e3; | ||
return (n = Math.min(n + o / i, e)), n; | ||
} | ||
pu(t, e) { | ||
return Math.max(0, (1 - t) * e * 1e3); | ||
} | ||
Va() { | ||
var t, e, s; | ||
const i = { Za: !0, au: 0 }, | ||
r = null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.du); | ||
if (null == r || isNaN(r)) return i; | ||
const n = (null === (e = this.yt) || void 0 === e ? void 0 : e.pu()) || -1, | ||
h = (null === (s = this.yt) || void 0 === s ? void 0 : s.gu()) || -1; | ||
if (-1 === n || -1 === h) return i; | ||
const a = new Date().valueOf(); | ||
let u = this.Ru(a, n, h, r); | ||
return u < 1 | ||
? ((i.Za = !1), (i.au = this.vu(u, h)), i) | ||
: ((u = Math.trunc(u) - 1), this.li(u), i); | ||
bu(t, e = "") { | ||
var i, s, r, n, h; | ||
const a = { Ya: !0, Va: -1, Ja: 0 }; | ||
if ((null == t && (t = !0), !t && !e)) return a; | ||
let u, | ||
l, | ||
c = null; | ||
if (t) c = null === (i = this.u) || void 0 === i ? void 0 : i.j(o.C.Qa); | ||
else { | ||
const t = D.qu(this.u); | ||
if (null == t || null == t[e]) return a; | ||
c = t[e]; | ||
} | ||
if (null == c || isNaN(c)) return a; | ||
if ( | ||
(t | ||
? ((u = | ||
(null === (s = this.yt) || void 0 === s ? void 0 : s.Au()) || -1), | ||
(l = | ||
(null === (r = this.yt) || void 0 === r ? void 0 : r.Du()) || -1)) | ||
: ((u = | ||
(null === (n = this.yt) || void 0 === n ? void 0 : n.Tu(e)) || -1), | ||
(l = | ||
(null === (h = this.yt) || void 0 === h ? void 0 : h.ku(e)) || -1)), | ||
-1 === u || -1 === l) | ||
) | ||
return a; | ||
const d = new Date().valueOf(); | ||
let f = this.gu(d, u, l, c, e); | ||
return f < 1 | ||
? ((a.Ya = !1), (a.Ja = this.pu(f, l)), a) | ||
: ((f = Math.trunc(f) - 1), | ||
(a.Va = f), | ||
t ? this.Za(f) : this.du(e, f), | ||
a); | ||
} | ||
Xs() { | ||
this.Go.Xs(); | ||
Wa() { | ||
return this.bu(!0); | ||
} | ||
Vs() { | ||
return this.Ko; | ||
Ha(t) { | ||
const e = this.bu(!1, t); | ||
return !(e && !e.Ya); | ||
} | ||
Os() { | ||
this.zo.Os(); | ||
} | ||
Hs() { | ||
return this.Go; | ||
} | ||
addSdkMetadata(t) { | ||
for (const e of t) -1 === this.Yh.indexOf(e) && this.Yh.push(e); | ||
for (const e of t) -1 === this.Hh.indexOf(e) && this.Hh.push(e); | ||
} | ||
} |
import { STORAGE_KEYS as o } from "./storage-manager.js"; | ||
import T from "./subscription-manager.js"; | ||
import Gt from "../models/server-config.js"; | ||
import Ht from "../models/server-config.js"; | ||
import s from "../common/event-logger.js"; | ||
import { EventTypes as i } from "../../shared-lib/index.js"; | ||
import { | ||
CONTENT_CARDS_RATE_LIMIT_CAPACITY_DEFAULT as Jt, | ||
CONTENT_CARDS_RATE_LIMIT_REFILL_RATE_DEFAULT as Qt, | ||
} from "../common/constants.js"; | ||
export default class Dt { | ||
@@ -22,16 +18,16 @@ constructor(t) { | ||
if (null == this.rl) { | ||
const t = this.u.j(o.C.hl); | ||
this.rl = null != t ? Gt.qn(t) : new Gt(); | ||
const t = this.u.j(o.C.ul); | ||
this.rl = null != t ? Ht.qn(t) : new Ht(); | ||
} | ||
return this.rl; | ||
} | ||
ni() { | ||
return this.ll().ol; | ||
ii() { | ||
return this.ll().hl; | ||
} | ||
ul(t) { | ||
al(t) { | ||
if (null != t && null != t.config) { | ||
const e = t.config; | ||
if (e.time > this.ll().ol) { | ||
const t = (t) => (null == t ? this.ll().al : t), | ||
i = new Gt( | ||
if (e.time > this.ll().hl) { | ||
const t = (t) => (null == t ? this.ll().ol : t), | ||
i = new Ht( | ||
e.time, | ||
@@ -50,7 +46,7 @@ e.events_blacklist, | ||
let r = !1; | ||
null != i.ml.enabled && this.ri() !== i.ml.enabled && (r = !0); | ||
null != i.ml.enabled && this.si() !== i.ml.enabled && (r = !0); | ||
let n = !1; | ||
null != i.mi.enabled && this.yi() !== i.mi.enabled && (n = !0), | ||
null != i.hi.enabled && this.ci() !== i.hi.enabled && (n = !0), | ||
(this.rl = i), | ||
this.u.k(o.C.hl, i.Y()), | ||
this.u.k(o.C.ul, i.Y()), | ||
s && this.tl.Dt(), | ||
@@ -66,6 +62,6 @@ r && this.el.Dt(), | ||
} | ||
qs(t) { | ||
Is(t) { | ||
return this.el.It(t); | ||
} | ||
xi(t) { | ||
ji(t) { | ||
return this.il.It(t); | ||
@@ -83,3 +79,3 @@ } | ||
dl() { | ||
return this.ll().Cl; | ||
return this.ll().Rl; | ||
} | ||
@@ -89,41 +85,41 @@ Wn() { | ||
} | ||
ri() { | ||
si() { | ||
return this.ll().ml.enabled || !1; | ||
} | ||
Is() { | ||
const t = this.ll().ml.rate_limit; | ||
Cl() { | ||
const t = this.ll().ol; | ||
return !(!t || null == t.enabled) && t.enabled; | ||
} | ||
ci() { | ||
if (!this.Is()) return -1; | ||
const t = this.ll().ml.rate_limit; | ||
return null == t.capacity ? Jt : t.capacity <= 0 ? -1 : t.capacity; | ||
Au() { | ||
if (!this.Cl()) return -1; | ||
const t = this.ll().ol; | ||
return null == t.capacity || t.capacity < 10 ? -1 : t.capacity; | ||
} | ||
fi() { | ||
if (!this.Is()) return -1; | ||
const t = this.ll().ml.rate_limit; | ||
return null == t.refill_rate ? Qt : t.refill_rate <= 0 ? -1 : t.refill_rate; | ||
Du() { | ||
if (!this.Cl()) return -1; | ||
const t = this.ll().ol; | ||
return null == t.refill_rate || t.refill_rate <= 0 ? -1 : t.refill_rate; | ||
} | ||
Rl() { | ||
const t = this.ll().al; | ||
return !(!t || null == t.enabled) && t.enabled; | ||
vl(t) { | ||
const e = this.ll().ol.endpoint_overrides; | ||
return null == e ? null : e[t]; | ||
} | ||
pu() { | ||
if (!this.Rl()) return -1; | ||
const t = this.ll().al; | ||
return null == t.capacity || t.capacity < 10 ? -1 : t.capacity; | ||
Tu(t) { | ||
const e = this.vl(t); | ||
return null == e || isNaN(e.capacity) || e.capacity <= 0 ? -1 : e.capacity; | ||
} | ||
gu() { | ||
if (!this.Rl()) return -1; | ||
const t = this.ll().al; | ||
return null == t.refill_rate || t.refill_rate <= 0 ? -1 : t.refill_rate; | ||
ku(t) { | ||
const e = this.vl(t); | ||
return null == e || isNaN(e.refill_rate) || e.refill_rate <= 0 | ||
? -1 | ||
: e.refill_rate; | ||
} | ||
yi() { | ||
return this.ll().mi.enabled && null == this.zi() | ||
? (s.q(i.Ms, { e: "Missing feature flag refresh_rate_limit." }), !1) | ||
: this.ll().mi.enabled || !1; | ||
ci() { | ||
return this.ll().hi.enabled && null == this.Ri() | ||
? (s.q(i.qs, { e: "Missing feature flag refresh_rate_limit." }), !1) | ||
: this.ll().hi.enabled || !1; | ||
} | ||
zi() { | ||
return this.ll().mi.refresh_rate_limit; | ||
Ri() { | ||
return this.ll().hi.refresh_rate_limit; | ||
} | ||
} |
@@ -33,12 +33,12 @@ import { STORAGE_KEYS as o } from "../managers/storage-manager.js"; | ||
jl(s, t) { | ||
return new ue(this.wt.getUserId(), i.xl, s, t.eu, { d: h(s - t.vl) }); | ||
return new ue(this.wt.getUserId(), i.xl, s, t.eu, { d: h(s - t.Dl) }); | ||
} | ||
ki() { | ||
const s = this.u.tu(o.iu.Dl); | ||
Si() { | ||
const s = this.u.tu(o.iu.El); | ||
return null == s ? null : s.eu; | ||
} | ||
El() { | ||
Gl() { | ||
const s = new Date().valueOf(), | ||
t = this.yt.dl(), | ||
i = this.u.j(o.C.Gl); | ||
i = this.u.j(o.C.Nl); | ||
if (null != i && null == t) return !1; | ||
@@ -48,19 +48,19 @@ let e = !1; | ||
null == i ? (e = !0) : null != t && (e = s - i > 1e3 * t), | ||
e && this.u.k(o.C.Gl, s), | ||
e && this.u.k(o.C.Nl, s), | ||
e | ||
); | ||
} | ||
Nl(s, t) { | ||
return null == t || null == t.zl || (!(s - t.vl < this.Sl) && t.zl < s); | ||
zl(s, t) { | ||
return null == t || null == t.Hl || (!(s - t.Dl < this.Sl) && t.Hl < s); | ||
} | ||
xo() { | ||
wo() { | ||
const s = new Date().valueOf(), | ||
t = s + 1e3 * this.wl, | ||
e = this.u.tu(o.iu.Dl); | ||
if (this.Nl(s, e)) { | ||
e = this.u.tu(o.iu.El); | ||
if (this.zl(s, e)) { | ||
let n = "Generating session start event with time " + s; | ||
if (null != e) { | ||
let s = e.Hl; | ||
s - e.vl < this.Sl && (s = e.vl + this.Sl), | ||
this.u.Wl(this.jl(s, e)), | ||
let s = e.Wl; | ||
s - e.Dl < this.Sl && (s = e.Dl + this.Sl), | ||
this.u.kl(this.jl(s, e)), | ||
(n += " (old session ended " + s + ")"); | ||
@@ -70,13 +70,13 @@ } | ||
const l = new _t(p.W(), t); | ||
this.u.Wl(new ue(this.wt.getUserId(), i.kl, s, l.eu)), | ||
this.u.uu(o.iu.Dl, l); | ||
return null == this.u.j(o.C.Gl) && this.u.k(o.C.Gl, s), l.eu; | ||
this.u.kl(new ue(this.wt.getUserId(), i.ql, s, l.eu)), | ||
this.u.uu(o.iu.El, l); | ||
return null == this.u.j(o.C.Nl) && this.u.k(o.C.Nl, s), l.eu; | ||
} | ||
if (null != e) return (e.Hl = s), (e.zl = t), this.u.uu(o.iu.Dl, e), e.eu; | ||
if (null != e) return (e.Wl = s), (e.Hl = t), this.u.uu(o.iu.El, e), e.eu; | ||
} | ||
ql() { | ||
const s = this.u.tu(o.iu.Dl); | ||
yl() { | ||
const s = this.u.tu(o.iu.El); | ||
null != s && | ||
(this.u.yl(o.iu.Dl), this.u.Wl(this.jl(new Date().valueOf(), s))); | ||
(this.u.Al(o.iu.El), this.u.kl(this.jl(new Date().valueOf(), s))); | ||
} | ||
} |
import Q, { STORAGE_KEYS as o } from "./storage-manager.js"; | ||
import { logger as r } from "../../shared-lib/index.js"; | ||
const Bt = { | ||
Wh: function (e, t = !1) { | ||
Qo: function (e, t = !1) { | ||
let a = !1; | ||
@@ -6,0 +6,0 @@ try { |
@@ -17,3 +17,3 @@ import ue from "../models/braze-event.js"; | ||
Uo: "ab.storage.deviceId", | ||
Dl: "ab.storage.sessionId", | ||
El: "ab.storage.sessionId", | ||
}, | ||
@@ -25,37 +25,37 @@ C: { | ||
sE: "ab.storage.attributes.anonymous_user", | ||
Ga: "ab.storage.device", | ||
Jh: "ab.storage.sdk_metadata", | ||
Qh: "ab.storage.session_id_for_cached_metadata", | ||
Ca: "ab.storage.device", | ||
Yh: "ab.storage.sdk_metadata", | ||
Jh: "ab.storage.session_id_for_cached_metadata", | ||
In: "ab.storage.pushToken", | ||
Hi: "ab.storage.newsFeed", | ||
Ji: "ab.storage.lastNewsFeedRefresh", | ||
Ui: "ab.storage.newsFeed", | ||
ki: "ab.storage.lastNewsFeedRefresh", | ||
J: "ab.storage.cardImpressions", | ||
hl: "ab.storage.serverConfig", | ||
ul: "ab.storage.serverConfig", | ||
rE: "ab.storage.triggers", | ||
oE: "ab.storage.triggers.ts", | ||
Gl: "ab.storage.messagingSessionStart", | ||
Cs: "ab.storage.cc", | ||
Nl: "ab.storage.messagingSessionStart", | ||
ws: "ab.storage.cc", | ||
gs: "ab.storage.ccLastFullSync", | ||
ys: "ab.storage.ccLastCardUpdated", | ||
Ks: "ab.storage.ccLastClientRequest", | ||
ai: "ab.storage.ccRateLimitCurrentTokenCount", | ||
fu: "ab.storage.globalRateLimitCurrentTokenCount", | ||
nE: "ab.storage.ccRateLimitCurrentTokenCount", | ||
au: "ab.storage.globalRateLimitCurrentTokenCount", | ||
vu: "ab.storage.dynamicRateLimitCurrentTokenCount", | ||
v: "ab.storage.ccClicks", | ||
H: "ab.storage.ccImpressions", | ||
A: "ab.storage.ccDismissals", | ||
nE: "ab.storage.lastDisplayedTriggerTimesById", | ||
aE: "ab.storage.lastDisplayedTriggerTime", | ||
iE: "ab.storage.triggerFireInstancesById", | ||
aE: "ab.storage.lastDisplayedTriggerTimesById", | ||
iE: "ab.storage.lastDisplayedTriggerTime", | ||
EE: "ab.storage.triggerFireInstancesById", | ||
wh: "ab.storage.signature", | ||
As: "ab.storage.brazeSyncRetryCount", | ||
Ds: "ab.storage.sdkVersion", | ||
Ti: "ab.storage.ff", | ||
Ii: "ab.storage.ffImpressions", | ||
Bi: "ab.storage.ffLastRefreshAt", | ||
Ui: "ab.storage.ff.sessionId", | ||
EE: "ab.storage.lastReqToEndpoint", | ||
lE: "ab.storage.requestAttempts", | ||
Lr: "ab.storage.deferredIam", | ||
du: "ab.storage.lastSdkReq", | ||
SE: "ab.storage.alias", | ||
Ss: "ab.storage.sdkVersion", | ||
gi: "ab.storage.ff", | ||
vi: "ab.storage.ffImpressions", | ||
xi: "ab.storage.ffLastRefreshAt", | ||
Di: "ab.storage.ff.sessionId", | ||
lE: "ab.storage.lastReqToEndpoint", | ||
SE: "ab.storage.requestAttempts", | ||
Cr: "ab.storage.deferredIam", | ||
Qa: "ab.storage.lastSdkReq", | ||
_E: "ab.storage.alias", | ||
}, | ||
@@ -66,5 +66,5 @@ se: "ab.optOut", | ||
constructor(t, e) { | ||
(this._E = t), (this.uE = e), (this._E = t), (this.uE = e); | ||
(this.uE = t), (this.TE = e), (this.uE = t), (this.TE = e); | ||
} | ||
Vh(t) { | ||
Wh(t) { | ||
const e = to(STORAGE_KEYS.iu), | ||
@@ -76,10 +76,10 @@ s = new Q.ee(t); | ||
let s = null; | ||
null != e && e instanceof _t && (s = e.Y()), this._E.store(t, s); | ||
null != e && e instanceof _t && (s = e.Y()), this.uE.store(t, s); | ||
} | ||
cE(t) { | ||
const e = this.tu(t); | ||
null != e && ((e.Hl = new Date().valueOf()), this.uu(t, e)); | ||
null != e && ((e.Wl = new Date().valueOf()), this.uu(t, e)); | ||
} | ||
tu(t) { | ||
const e = this._E.br(t), | ||
const e = this.uE.br(t), | ||
s = ((t) => { | ||
@@ -97,3 +97,3 @@ let e; | ||
else { | ||
const s = _t.TE(e); | ||
const s = _t.hE(e); | ||
(r = _t.qn(s) || null), s !== e && r && this.uu(t, r); | ||
@@ -103,6 +103,6 @@ } | ||
} | ||
yl(t) { | ||
this._E.remove(t); | ||
Al(t) { | ||
this.uE.remove(t); | ||
} | ||
Kh() { | ||
Vh() { | ||
const t = to(STORAGE_KEYS.iu); | ||
@@ -114,17 +114,17 @@ let e; | ||
} | ||
zo(t) { | ||
xo(t) { | ||
let e; | ||
if (null == t || 0 === t.length) return !1; | ||
e = j(t) ? t : [t]; | ||
let s = this.uE.br(STORAGE_KEYS.C.tE); | ||
let s = this.TE.br(STORAGE_KEYS.C.tE); | ||
(null != s && j(s)) || (s = []); | ||
for (let t = 0; t < e.length; t++) s.push(e[t].Y()); | ||
return this.uE.store(STORAGE_KEYS.C.tE, s); | ||
return this.TE.store(STORAGE_KEYS.C.tE, s); | ||
} | ||
Wl(t) { | ||
return null != t && this.zo([t]); | ||
kl(t) { | ||
return null != t && this.xo([t]); | ||
} | ||
hE() { | ||
let t = this.uE.br(STORAGE_KEYS.C.tE); | ||
this.uE.remove(STORAGE_KEYS.C.tE), null == t && (t = []); | ||
AE() { | ||
let t = this.TE.br(STORAGE_KEYS.C.tE); | ||
this.TE.remove(STORAGE_KEYS.C.tE), null == t && (t = []); | ||
const e = []; | ||
@@ -135,3 +135,3 @@ let s = !1, | ||
for (let s = 0; s < t.length; s++) | ||
ue.AE(t[s]) ? e.push(ue.qn(t[s])) : (r = s); | ||
ue.RE(t[s]) ? e.push(ue.qn(t[s])) : (r = s); | ||
else s = !0; | ||
@@ -149,3 +149,3 @@ if (s || null != r) { | ||
JSON.stringify(t)), | ||
e.push(new ue(null, i.Ms, new Date().valueOf(), null, { e: o })); | ||
e.push(new ue(null, i.qs, new Date().valueOf(), null, { e: o })); | ||
} | ||
@@ -161,3 +161,3 @@ return e; | ||
"STORAGE_KEYS.OBJECTS", | ||
) && this.uE.store(t, e) | ||
) && this.TE.store(t, e) | ||
); | ||
@@ -172,6 +172,6 @@ } | ||
"STORAGE_KEYS.OBJECTS", | ||
) && this.uE.br(t) | ||
) && this.TE.br(t) | ||
); | ||
} | ||
hi(t) { | ||
ti(t) { | ||
return ( | ||
@@ -183,3 +183,3 @@ !!J( | ||
"STORAGE_KEYS.OBJECTS", | ||
) && (this.uE.remove(t), !0) | ||
) && (this.TE.remove(t), !0) | ||
); | ||
@@ -192,16 +192,16 @@ } | ||
const s = t[e]; | ||
this._E.remove(STORAGE_KEYS.iu[s]); | ||
this.uE.remove(STORAGE_KEYS.iu[s]); | ||
} | ||
for (let t = 0; t < e.length; t++) { | ||
const s = e[t]; | ||
this.uE.remove(STORAGE_KEYS.C[s]); | ||
this.TE.remove(STORAGE_KEYS.C[s]); | ||
} | ||
} | ||
RE(t) { | ||
gE(t) { | ||
return t || STORAGE_KEYS.C.sE; | ||
} | ||
Pa(t) { | ||
let e = this.uE.br(STORAGE_KEYS.C.eE); | ||
La(t) { | ||
let e = this.TE.br(STORAGE_KEYS.C.eE); | ||
null == e && (e = {}); | ||
const s = this.RE(t[User.Yn]), | ||
const s = this.gE(t[User.Yn]), | ||
r = e[s]; | ||
@@ -214,5 +214,5 @@ for (const o in t) | ||
mu(t, e, s) { | ||
let r = this.uE.br(STORAGE_KEYS.C.eE); | ||
let r = this.TE.br(STORAGE_KEYS.C.eE); | ||
null == r && (r = {}); | ||
const o = this.RE(t); | ||
const o = this.gE(t); | ||
let n = r[o]; | ||
@@ -225,7 +225,7 @@ if ( | ||
} else n[e] = s; | ||
return (r[o] = n), this.uE.store(STORAGE_KEYS.C.eE, r); | ||
return (r[o] = n), this.TE.store(STORAGE_KEYS.C.eE, r); | ||
} | ||
gE() { | ||
const t = this.uE.br(STORAGE_KEYS.C.eE); | ||
this.uE.remove(STORAGE_KEYS.C.eE); | ||
OE() { | ||
const t = this.TE.br(STORAGE_KEYS.C.eE); | ||
this.TE.remove(STORAGE_KEYS.C.eE); | ||
const e = []; | ||
@@ -236,24 +236,24 @@ for (const s in t) null != t[s] && e.push(t[s]); | ||
ru(t) { | ||
const e = this.uE.br(STORAGE_KEYS.C.eE); | ||
const e = this.TE.br(STORAGE_KEYS.C.eE); | ||
if (null != e) { | ||
const s = this.RE(null), | ||
const s = this.gE(null), | ||
r = e[s]; | ||
null != r && | ||
((e[s] = void 0), | ||
this.uE.store(STORAGE_KEYS.C.eE, e), | ||
this.TE.store(STORAGE_KEYS.C.eE, e), | ||
(r[User.Yn] = t), | ||
this.Pa(r)); | ||
this.La(r)); | ||
} | ||
const s = this.tu(STORAGE_KEYS.iu.Dl); | ||
const s = this.tu(STORAGE_KEYS.iu.El); | ||
let r = null; | ||
null != s && (r = s.eu); | ||
const o = this.hE(); | ||
const o = this.AE(); | ||
if (null != o) | ||
for (let e = 0; e < o.length; e++) { | ||
const s = o[e]; | ||
null == s.userId && s.sessionId == r && (s.userId = t), this.Wl(s); | ||
null == s.userId && s.sessionId == r && (s.userId = t), this.kl(s); | ||
} | ||
} | ||
OE() { | ||
return this.uE.fE; | ||
dE() { | ||
return this.TE.fE; | ||
} | ||
@@ -263,5 +263,5 @@ } | ||
constructor(t) { | ||
(this.rn = t), (this.rn = t), (this.fE = X.dE() ? 3 : 10); | ||
(this.rn = t), (this.rn = t), (this.fE = X.IE() ? 3 : 10); | ||
} | ||
IE(t) { | ||
bE(t) { | ||
return t + "." + this.rn; | ||
@@ -272,3 +272,3 @@ } | ||
try { | ||
return localStorage.setItem(this.IE(t), JSON.stringify(s)), !0; | ||
return localStorage.setItem(this.bE(t), JSON.stringify(s)), !0; | ||
} catch (t) { | ||
@@ -281,3 +281,3 @@ return r.info("Storage failure: " + si(t)), !1; | ||
let e = null; | ||
const s = localStorage.getItem(this.IE(t)); | ||
const s = localStorage.getItem(this.bE(t)); | ||
return null != s && (e = JSON.parse(s)), null == e ? null : e.v; | ||
@@ -290,3 +290,3 @@ } catch (t) { | ||
try { | ||
localStorage.removeItem(this.IE(t)); | ||
localStorage.removeItem(this.bE(t)); | ||
} catch (t) { | ||
@@ -299,7 +299,7 @@ return r.info("Storage removal failure: " + si(t)), !1; | ||
constructor() { | ||
(this.bE = {}), (this.KE = 5242880), (this.fE = 3); | ||
(this.mE = {}), (this.KE = 5242880), (this.fE = 3); | ||
} | ||
store(t, e) { | ||
const s = { value: e }, | ||
o = this.mE(e); | ||
o = this.YE(e); | ||
return o > this.KE | ||
@@ -313,5 +313,5 @@ ? (r.info( | ||
!1) | ||
: ((this.bE[t] = s), !0); | ||
: ((this.mE[t] = s), !0); | ||
} | ||
mE(t) { | ||
YE(t) { | ||
const e = [], | ||
@@ -334,7 +334,7 @@ s = [t]; | ||
br(t) { | ||
const e = this.bE[t]; | ||
const e = this.mE[t]; | ||
return null == e ? null : e.value; | ||
} | ||
remove(t) { | ||
this.bE[t] = null; | ||
this.mE[t] = null; | ||
} | ||
@@ -345,12 +345,12 @@ }), | ||
(this.rn = t), | ||
(this.YE = e), | ||
(this.NE = e), | ||
(this.rn = t), | ||
(this.NE = this.CE()), | ||
(this.GE = 576e3), | ||
(this.YE = !!e); | ||
(this.CE = this.GE()), | ||
(this.DE = 576e3), | ||
(this.NE = !!e); | ||
} | ||
IE(t) { | ||
bE(t) { | ||
return null != this.rn ? t + "." + this.rn : t; | ||
} | ||
CE() { | ||
GE() { | ||
let t = 0, | ||
@@ -372,5 +372,5 @@ e = document.location.hostname; | ||
const t = new Date(); | ||
return t.setTime(t.getTime() + 60 * this.GE * 1e3), t.getFullYear(); | ||
return t.setTime(t.getTime() + 60 * this.DE * 1e3), t.getFullYear(); | ||
} | ||
DE() { | ||
ME() { | ||
const t = Pt(STORAGE_KEYS.iu), | ||
@@ -389,3 +389,3 @@ e = document.cookie.split(";"); | ||
const t = r.split("=")[0]; | ||
-1 === t.indexOf("." + this.rn) && this.ME(t); | ||
-1 === t.indexOf("." + this.rn) && this.pE(t); | ||
} | ||
@@ -395,10 +395,10 @@ } | ||
store(t, e) { | ||
this.DE(); | ||
this.ME(); | ||
const s = new Date(); | ||
s.setTime(s.getTime() + 60 * this.GE * 1e3); | ||
s.setTime(s.getTime() + 60 * this.DE * 1e3); | ||
const o = "expires=" + s.toUTCString(), | ||
n = "domain=" + this.NE; | ||
n = "domain=" + this.CE; | ||
let a; | ||
a = this.YE ? e : encodeURIComponent(e); | ||
const i = this.IE(t) + "=" + a + ";" + o + ";" + n + ";path=/"; | ||
a = this.NE ? e : encodeURIComponent(e); | ||
const i = this.bE(t) + "=" + a + ";" + o + ";" + n + ";path=/"; | ||
return i.length >= 4093 | ||
@@ -415,3 +415,3 @@ ? (r.info( | ||
const e = [], | ||
s = this.IE(t) + "=", | ||
s = this.bE(t) + "=", | ||
o = document.cookie.split(";"); | ||
@@ -424,3 +424,3 @@ for (let n = 0; n < o.length; n++) { | ||
let t; | ||
(t = this.YE | ||
(t = this.NE | ||
? a.substring(s.length, a.length) | ||
@@ -440,8 +440,8 @@ : decodeURIComponent(a.substring(s.length, a.length))), | ||
remove(t) { | ||
this.ME(this.IE(t)); | ||
this.pE(this.bE(t)); | ||
} | ||
ME(t) { | ||
pE(t) { | ||
const e = t + "=;expires=" + new Date(0).toUTCString(); | ||
(document.cookie = e), (document.cookie = e + ";path=/"); | ||
const s = e + ";domain=" + this.NE; | ||
const s = e + ";domain=" + this.CE; | ||
(document.cookie = s), (document.cookie = s + ";path=/"); | ||
@@ -453,15 +453,15 @@ } | ||
(this.rn = t), | ||
(this.pE = []), | ||
e && this.pE.push(new Q.ee(t)), | ||
s && this.pE.push(new Q.rc(t)), | ||
this.pE.push(new Q.ac()); | ||
(this.vE = []), | ||
e && this.vE.push(new Q.ee(t)), | ||
s && this.vE.push(new Q.rc(t)), | ||
this.vE.push(new Q.ac()); | ||
} | ||
store(t, e) { | ||
let s = !0; | ||
for (let r = 0; r < this.pE.length; r++) s = this.pE[r].store(t, e) && s; | ||
for (let r = 0; r < this.vE.length; r++) s = this.vE[r].store(t, e) && s; | ||
return s; | ||
} | ||
br(t) { | ||
for (let e = 0; e < this.pE.length; e++) { | ||
const s = this.pE[e].br(t); | ||
for (let e = 0; e < this.vE.length; e++) { | ||
const s = this.vE[e].br(t); | ||
if (null != s) return s; | ||
@@ -473,4 +473,4 @@ } | ||
new Q.ee(this.rn).remove(t); | ||
for (let e = 0; e < this.pE.length; e++) this.pE[e].remove(t); | ||
for (let e = 0; e < this.vE.length; e++) this.vE[e].remove(t); | ||
} | ||
}); |
import { STORAGE_KEYS as o } from "./storage-manager.js"; | ||
export function getAlias(e) { | ||
const t = null == e ? void 0 : e.j(o.C.SE); | ||
const t = null == e ? void 0 : e.j(o.C._E); | ||
let n; | ||
return t && (n = { label: t.l, name: t.a }), n; | ||
} |
export default { | ||
Xa: "invalid_api_key", | ||
Na: "blacklisted", | ||
$a: "no_device_identifier", | ||
Ba: "invalid_json_response", | ||
Ra: "empty_response", | ||
qa: "invalid_api_key", | ||
Aa: "blacklisted", | ||
Ba: "no_device_identifier", | ||
Ra: "invalid_json_response", | ||
Zh: "empty_response", | ||
__: "sdk_auth_error", | ||
}; |
import e from "../managers/braze-instance.js"; | ||
import { getAlias as Ht } from "../managers/utils.js"; | ||
import { getAlias as Gt } from "../managers/utils.js"; | ||
import { isObject as Nt } from "../util/code-utils.js"; | ||
import { | ||
convertMsToSeconds as h, | ||
timestampOrNow as Yt, | ||
timestampOrNow as Jt, | ||
} from "../util/date-utils.js"; | ||
@@ -17,7 +17,7 @@ export default class ue { | ||
(this.type = s), | ||
(this.time = Yt(i)), | ||
(this.time = Jt(i)), | ||
(this.sessionId = r), | ||
(this.data = e); | ||
} | ||
Mr() { | ||
Ir() { | ||
var t; | ||
@@ -33,3 +33,3 @@ const s = { | ||
if (!s.user_id && !i) { | ||
const t = Ht(e.l()); | ||
const t = Gt(e.l()); | ||
t && (s.alias = t); | ||
@@ -51,3 +51,3 @@ } | ||
} | ||
static AE(t) { | ||
static RE(t) { | ||
return null != t && Nt(t) && null != t.t && "" !== t.t; | ||
@@ -54,0 +54,0 @@ } |
@@ -5,7 +5,7 @@ export default class zt { | ||
} | ||
Mr() { | ||
Ir() { | ||
const s = {}; | ||
return ( | ||
null != this.browser && (s.browser = this.browser), | ||
null != this.Ta && (s.browser_version = this.Ta), | ||
null != this.Ia && (s.browser_version = this.Ia), | ||
null != this.os && (s.os_version = this.os), | ||
@@ -12,0 +12,0 @@ null != this.resolution && (s.resolution = this.resolution), |
@@ -8,13 +8,13 @@ import { Guid as p, logger as r } from "../../shared-lib/index.js"; | ||
null == t && (t = p.W()), | ||
!i || isNaN(i) ? (this.vl = new Date().valueOf()) : (this.vl = i), | ||
!i || isNaN(i) ? (this.Dl = new Date().valueOf()) : (this.Dl = i), | ||
(this.eu = t), | ||
(this.Hl = new Date().valueOf()), | ||
(this.zl = e); | ||
(this.Wl = new Date().valueOf()), | ||
(this.Hl = e); | ||
} | ||
Y() { | ||
return `g:${encodeURIComponent(this.eu)}|e:${this.zl}|c:${this.vl}|l:${ | ||
this.Hl | ||
return `g:${encodeURIComponent(this.eu)}|e:${this.Hl}|c:${this.Dl}|l:${ | ||
this.Wl | ||
}`; | ||
} | ||
static TE(t) { | ||
static hE(t) { | ||
if ("string" != typeof t) return null; | ||
@@ -42,3 +42,3 @@ const e = t.lastIndexOf("|e:"), | ||
(e = new _t(decodeURIComponent(r(i[0])), n(i[1]), n(i[2]))), | ||
(e.Hl = n(i[3])); | ||
(e.Wl = n(i[3])); | ||
} catch (e) { | ||
@@ -51,3 +51,3 @@ r.info( | ||
if (null == t || null == t.g) return null; | ||
(e = new _t(t.g, t.e, t.c)), (e.Hl = t.l); | ||
(e = new _t(t.g, t.e, t.c)), (e.Wl = t.l); | ||
} | ||
@@ -54,0 +54,0 @@ return e; |
import { | ||
GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as Zt, | ||
GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as hi, | ||
GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as Qt, | ||
GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as Yt, | ||
} from "../common/constants.js"; | ||
export default class Gt { | ||
export default class Ht { | ||
constructor( | ||
@@ -12,38 +12,38 @@ t = 0, | ||
e = null, | ||
l = null, | ||
r = { enabled: !1 }, | ||
r = null, | ||
l = { enabled: !1 }, | ||
a = { enabled: !1, refresh_rate_limit: void 0 }, | ||
n = { enabled: !0, capacity: Zt, refill_rate: hi }, | ||
n = { enabled: !0, capacity: Qt, refill_rate: Yt, endpoint_overrides: {} }, | ||
) { | ||
(this.ol = t), | ||
(this.hl = t), | ||
(this.gl = i), | ||
(this.fl = s), | ||
(this.bl = h), | ||
(this.Cl = e), | ||
(this.cl = l), | ||
(this.ml = r), | ||
(this.mi = a), | ||
(this.al = n), | ||
(this.ol = t), | ||
(this.Rl = e), | ||
(this.cl = r), | ||
(this.ml = l), | ||
(this.hi = a), | ||
(this.ol = n), | ||
(this.hl = t), | ||
(this.gl = i), | ||
(this.fl = s), | ||
(this.bl = h), | ||
(this.Cl = e), | ||
(this.cl = l), | ||
(this.ml = r), | ||
(this.mi = a), | ||
(this.al = n); | ||
(this.Rl = e), | ||
(this.cl = r), | ||
(this.ml = l), | ||
(this.hi = a), | ||
(this.ol = n); | ||
} | ||
Y() { | ||
return { | ||
s: "5.2.0", | ||
l: this.ol, | ||
s: "5.3.0", | ||
l: this.hl, | ||
e: this.gl, | ||
a: this.fl, | ||
p: this.bl, | ||
m: this.Cl, | ||
m: this.Rl, | ||
v: this.cl, | ||
c: this.ml, | ||
f: this.mi, | ||
grl: this.al, | ||
f: this.hi, | ||
grl: this.ol, | ||
}; | ||
@@ -54,6 +54,6 @@ } | ||
return ( | ||
"5.2.0" !== t.s && (i = 0), | ||
new Gt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl) | ||
"5.3.0" !== t.s && (i = 0), | ||
new Ht(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl) | ||
); | ||
} | ||
} |
@@ -11,10 +11,10 @@ import e, { OPTIONS as L } from "../managers/braze-instance.js"; | ||
e.pr(), | ||
e.Ma(), | ||
e.ba(), | ||
e.te(), | ||
e.Vs(), | ||
e.Hs(), | ||
e.nn(L.wa), | ||
e.nn(L.ya), | ||
e.ir(), | ||
e.nn(L.Ma), | ||
e.nn(L._a), | ||
e.nn(L.ka), | ||
e.ir(), | ||
e.nn(L.qa), | ||
e.nn(L.Aa), | ||
e.l(), | ||
@@ -21,0 +21,0 @@ )), |
@@ -227,3 +227,3 @@ import { isArray as j, isEqual as ii } from "../util/code-utils.js"; | ||
); | ||
if (this.yt && !this.yt.Wn() && 0 === this.yt.ni()) | ||
if (this.yt && !this.yt.Wn() && 0 === this.yt.ii()) | ||
return ( | ||
@@ -230,0 +230,0 @@ r.info( |
@@ -31,3 +31,3 @@ const vt = { | ||
"granted" === window.Notification.permission, | ||
Wi: () => | ||
Vi: () => | ||
!vt.isPushBlocked() && | ||
@@ -34,0 +34,0 @@ vt.isPushSupported() && |
import C from "./util/net.js"; | ||
import ue from "./models/braze-event.js"; | ||
import s from "./common/event-logger.js"; | ||
import { randomInclusive as k } from "./util/math.js"; | ||
import { randomInclusive as U } from "./util/math.js"; | ||
import t from "./models/request-result.js"; | ||
@@ -15,3 +15,3 @@ import { | ||
import vt from "./Push/utils/push-utils.js"; | ||
import S from "./util/request-header-utils.js"; | ||
import D from "./util/request-header-utils.js"; | ||
export default class Lt { | ||
@@ -21,3 +21,3 @@ constructor(t, i, s, e, h, o, n, r, u, l) { | ||
(this.baseUrl = i), | ||
(this.di = s), | ||
(this.ri = s), | ||
(this.on = e), | ||
@@ -27,11 +27,11 @@ (this.wt = h), | ||
(this.u = n), | ||
(this.bu = r), | ||
(this.Go = u), | ||
(this.wu = r), | ||
(this.zo = u), | ||
(this.qt = l), | ||
(this.rn = t), | ||
(this.baseUrl = i), | ||
(this.wu = 0), | ||
(this.fE = n.OE() || 0), | ||
(this.ku = null), | ||
(this.di = s), | ||
(this.yu = 0), | ||
(this.fE = n.dE() || 0), | ||
(this.ju = null), | ||
(this.ri = s), | ||
(this.on = e), | ||
@@ -41,15 +41,15 @@ (this.wt = h), | ||
(this.u = n), | ||
(this.Go = u), | ||
(this.zo = u), | ||
(this.qt = l), | ||
(this.bu = r), | ||
(this.yu = new T()), | ||
(this.ju = null), | ||
(this.Su = 50), | ||
(this.Au = !1); | ||
(this.wu = r), | ||
(this.Su = new T()), | ||
(this.$u = null), | ||
(this.Cu = 50), | ||
(this.Fu = !1); | ||
} | ||
$u(t, i) { | ||
return !t && !i && this.Go.Gh() >= this.Su; | ||
Lu(t, i) { | ||
return !t && !i && this.zo.Gh() >= this.Cu; | ||
} | ||
qu(t) { | ||
let s = this.di.El(); | ||
Mu(t) { | ||
let s = this.ri.Gl(); | ||
if (t.length > 0) { | ||
@@ -59,3 +59,3 @@ const e = this.wt.getUserId(); | ||
const t = (!h.userId && !e) || h.userId === e; | ||
h.type === i.kl && t && (s = !0); | ||
h.type === i.ql && t && (s = !0); | ||
} | ||
@@ -65,11 +65,13 @@ } | ||
} | ||
Cu(t = !1, i = !1, s = !0, e, h, n, u = !1, l = !1) { | ||
s && this.Du(); | ||
const a = this.u.hE(), | ||
c = this.u.gE(); | ||
Pu(t = !1, i = !1, s = !0, e, h, n, u = !1, l = !1) { | ||
s && this.xu(); | ||
const a = this.u.AE(), | ||
c = this.u.OE(); | ||
let d = !1; | ||
const f = (t, i) => { | ||
let r = !1; | ||
S.Os(this.u, S.Gs.La, new Date().valueOf()), | ||
C.Qs({ | ||
const m = (t, i, r = -1) => { | ||
let u = !1; | ||
const l = new Date().valueOf(); | ||
D._s(this.u, D.Ps.$a, l), | ||
-1 !== r && i.push(["X-Braze-Req-Tokens-Remaining", r.toString()]), | ||
C.Gs({ | ||
url: this.baseUrl + "/data/", | ||
@@ -81,16 +83,16 @@ data: t, | ||
t.respond_with.triggers && | ||
(this.wu = Math.max(this.wu - 1, 0)), | ||
this.qt.Ws(t, s, i) | ||
? (this.Go.Xs(), | ||
this.yt.ul(s), | ||
(this.yu = Math.max(this.yu - 1, 0)), | ||
this.qt.Ks(t, s, i) | ||
? (this.zo.Os(), | ||
this.yt.al(s), | ||
(null != t.respond_with && | ||
t.respond_with.user_id != this.wt.getUserId()) || | ||
(null != t.device && this.u.k(o.C.Ga, t.device), | ||
(null != t.device && this.u.k(o.C.Ca, t.device), | ||
null != t.sdk_metadata && | ||
(this.u.k(o.C.Jh, t.sdk_metadata), | ||
this.u.k(o.C.Qh, this.di.ki())), | ||
this.bu(s), | ||
S.Ys(this.u, S.Gs.La, 1), | ||
(this.u.k(o.C.Yh, t.sdk_metadata), | ||
this.u.k(o.C.Jh, this.ri.Si())), | ||
this.wu(s), | ||
D.Qs(this.u, D.Ps.$a, 1), | ||
"function" == typeof e && e())) | ||
: s.auth_error && (r = !0); | ||
: s.auth_error && (u = !0); | ||
}, | ||
@@ -100,14 +102,14 @@ error: () => { | ||
t.respond_with.triggers && | ||
(this.wu = Math.max(this.wu - 1, 0)), | ||
this.qt.Zh(t.events, t.attributes), | ||
(this.yu = Math.max(this.yu - 1, 0)), | ||
this.qt.Qh(t.events, t.attributes), | ||
"function" == typeof h && h(); | ||
}, | ||
ti: (t) => { | ||
Ws: (t) => { | ||
if (("function" == typeof n && n(t), s && !d)) { | ||
if (t && !r) this.Fu(); | ||
if (t && !u) this.Iu(); | ||
else { | ||
S.si(this.u, S.Gs.La); | ||
let t = this.ku; | ||
D.Ys(this.u, D.Ps.$a); | ||
let t = this.ju; | ||
(null == t || t < 1e3 * this.fE) && (t = 1e3 * this.fE), | ||
this.Fu(Math.min(3e5, k(1e3 * this.fE, 3 * t))); | ||
this.Iu(Math.min(3e5, U(1e3 * this.fE, 3 * t))); | ||
} | ||
@@ -119,28 +121,33 @@ d = !0; | ||
}, | ||
m = this.qu(a), | ||
g = i || m; | ||
if (this.$u(u, m)) | ||
f = this.Mu(a), | ||
g = i || f; | ||
if (this.Lu(u, f)) | ||
return void r.info( | ||
"Declining to flush data due to 50 consecutive authentication failures", | ||
); | ||
if (s && !this.qt.Ea(a, c, t, g)) | ||
return this.Fu(), void ("function" == typeof n && n(!0)); | ||
const v = this.qt.Ka(t, g, a, c, l); | ||
g && this.wu++; | ||
if (s && !this.qt.Na(a, c, t, g)) | ||
return this.Iu(), void ("function" == typeof n && n(!0)); | ||
const v = this.qt.Xa(t, g, a, c, l); | ||
g && this.yu++; | ||
let p = !1; | ||
if (v) | ||
for (const t of v) | ||
this.qt.Hs(t.requestData, () => f(t.requestData, t.headers), S.ii.La), | ||
this.qt.Xs( | ||
t.requestData, | ||
(i) => m(t.requestData, t.headers, i), | ||
D.Ps.$a, | ||
h, | ||
), | ||
(p = !0); | ||
this.Go.Fh() && s && !p | ||
? this.Fu() | ||
: m && (r.info("Invoking new session subscriptions"), this.yu.Dt()); | ||
this.zo.Fh() && s && !p | ||
? this.Iu() | ||
: f && (r.info("Invoking new session subscriptions"), this.Su.Dt()); | ||
} | ||
Tu() { | ||
return this.wu > 0; | ||
Nu() { | ||
return this.yu > 0; | ||
} | ||
Fu(t = 1e3 * this.fE) { | ||
this.Au || | ||
(this.Du(), | ||
(this.ju = window.setTimeout(() => { | ||
Iu(t = 1e3 * this.fE) { | ||
this.Fu || | ||
(this.xu(), | ||
(this.$u = window.setTimeout(() => { | ||
if (document.hidden) { | ||
@@ -150,31 +157,31 @@ const t = "visibilitychange", | ||
document.hidden || | ||
(document.removeEventListener(t, i, !1), this.Cu()); | ||
(document.removeEventListener(t, i, !1), this.Pu()); | ||
}; | ||
document.addEventListener(t, i, !1); | ||
} else this.Cu(); | ||
} else this.Pu(); | ||
}, t)), | ||
(this.ku = t)); | ||
(this.ju = t)); | ||
} | ||
Du() { | ||
null != this.ju && (clearTimeout(this.ju), (this.ju = null)); | ||
xu() { | ||
null != this.$u && (clearTimeout(this.$u), (this.$u = null)); | ||
} | ||
initialize() { | ||
(this.Au = !1), this.Fu(); | ||
(this.Fu = !1), this.Iu(); | ||
} | ||
destroy() { | ||
this.yu.removeAllSubscriptions(), | ||
this.Go.yh(), | ||
this.Du(), | ||
(this.Au = !0), | ||
this.Cu(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0), | ||
(this.ju = null); | ||
this.Su.removeAllSubscriptions(), | ||
this.zo.yh(), | ||
this.xu(), | ||
(this.Fu = !0), | ||
this.Pu(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0), | ||
(this.$u = null); | ||
} | ||
mr(t) { | ||
return this.yu.It(t); | ||
return this.Su.It(t); | ||
} | ||
openSession() { | ||
const t = this.di.ki() !== this.di.xo(); | ||
const t = this.ri.Si() !== this.ri.wo(); | ||
t && (this.u.cE(o.iu.Uo), this.u.cE(o.iu.su)), | ||
this.Cu(void 0, !1, void 0, () => { | ||
this.u.hi(o.C.Ii); | ||
this.Pu(void 0, !1, void 0, () => { | ||
this.u.ti(o.C.vi); | ||
}), | ||
@@ -184,3 +191,3 @@ this.Mn(), | ||
import("./Push/push-manager-factory.js").then((t) => { | ||
if (this.Au) return; | ||
if (this.Fu) return; | ||
const i = t.default.m(); | ||
@@ -210,4 +217,4 @@ if ( | ||
} | ||
Lu() { | ||
this.u.hi(o.C.Ti), this.u.hi(o.C.Cs), this.u.hi(o.C.Lr); | ||
Ou() { | ||
this.u.ti(o.C.gi), this.u.ti(o.C.ws), this.u.ti(o.C.Cr); | ||
} | ||
@@ -217,12 +224,12 @@ changeUser(t, i, s) { | ||
if (e !== t) { | ||
this.di.ql(), | ||
this.Lu(), | ||
null != e && this.Cu(void 0, !1, void 0, void 0, void 0), | ||
this.ri.yl(), | ||
this.Ou(), | ||
null != e && this.Pu(void 0, !1, void 0, void 0, void 0), | ||
this.wt.ou(t), | ||
s ? this.Go.setSdkAuthenticationSignature(s) : this.Go.xh(); | ||
s ? this.zo.setSdkAuthenticationSignature(s) : this.zo.xh(); | ||
for (let t = 0; t < i.length; t++) i[t].changeUser(null == e); | ||
null != e && this.u.hi(o.C.J), | ||
this.u.hi(o.C.Ga), | ||
this.u.hi(o.C.ai), | ||
this.u.hi(o.C.SE), | ||
null != e && this.u.ti(o.C.J), | ||
this.u.ti(o.C.Ca), | ||
this.u.ti(o.C.nE), | ||
this.u.ti(o.C._E), | ||
this.openSession(), | ||
@@ -233,4 +240,4 @@ r.info('Changed user to "' + t + '".'); | ||
s && | ||
this.Go.kh() !== s && | ||
(this.Go.setSdkAuthenticationSignature(s), | ||
this.zo.kh() !== s && | ||
(this.zo.setSdkAuthenticationSignature(s), | ||
(i = "Updated SDK authentication signature")), | ||
@@ -241,4 +248,4 @@ r.info(`Current user is already ${t}. ${i}`); | ||
requestImmediateDataFlush(t) { | ||
this.Du(), this.di.xo(); | ||
this.Cu( | ||
this.xu(), this.ri.wo(); | ||
this.Pu( | ||
void 0, | ||
@@ -256,15 +263,15 @@ void 0, | ||
requestFeedRefresh() { | ||
this.di.xo(), this.Cu(!0); | ||
this.ri.wo(), this.Pu(!0); | ||
} | ||
$r(t, i) { | ||
this.di.xo(), | ||
this.ri.wo(), | ||
r.info("Requesting explicit trigger refresh."), | ||
this.Cu(void 0, !0, void 0, t, i); | ||
this.Pu(void 0, !0, void 0, t, i); | ||
} | ||
Cn(t, e) { | ||
const h = i.Mu, | ||
const h = i.zu, | ||
n = { a: t, l: e }, | ||
u = s.q(h, n); | ||
return ( | ||
u && (r.info(`Logged alias ${t} with label ${e}`), this.u.k(o.C.SE, n)), u | ||
u && (r.info(`Logged alias ${t} with label ${e}`), this.u.k(o.C._E, n)), u | ||
); | ||
@@ -290,3 +297,3 @@ } | ||
null != u && (l.alt_accuracy = u); | ||
const a = s.q(i.Pu, l, t || void 0); | ||
const a = s.q(i.Uu, l, t || void 0); | ||
return ( | ||
@@ -299,6 +306,6 @@ a && | ||
kr(t, s) { | ||
const e = this.di.xo(); | ||
return new ue(this.wt.getUserId(), i.xu, t, e, { cid: s }); | ||
const e = this.ri.wo(); | ||
return new ue(this.wt.getUserId(), i._u, t, e, { cid: s }); | ||
} | ||
Iu(t, i) { | ||
Bu(t, i) { | ||
return new A(t, i); | ||
@@ -308,7 +315,7 @@ } | ||
const t = A.Yt.Qt; | ||
this.Iu(t, r).setItem(t.ss.La, 1, { | ||
this.Bu(t, r).setItem(t.ss.$a, 1, { | ||
baseUrl: this.baseUrl, | ||
data: { api_key: this.rn, device_id: this.on.ce().id }, | ||
userId: this.wt.getUserId(), | ||
sdkAuthEnabled: this.Go.Fh(), | ||
sdkAuthEnabled: this.zo.Fh(), | ||
}); | ||
@@ -318,3 +325,3 @@ } | ||
for (const i of t) | ||
if (i.api_key === this.rn) this.qt.Zh(i.events, i.attributes); | ||
if (i.api_key === this.rn) this.qt.Qh(i.events, i.attributes); | ||
else { | ||
@@ -333,4 +340,4 @@ const t = A.Yt.Qt; | ||
null === h && null === o | ||
? ((n = i.Nu), (u = { key: e })) | ||
: ((n = i.Ou), (u = { key: e, latitude: h, longitude: o })), | ||
? ((n = i.Eu), (u = { key: e })) | ||
: ((n = i.Ju), (u = { key: e, latitude: h, longitude: o })), | ||
s.q(n, u) | ||
@@ -341,4 +348,4 @@ ); | ||
const h = { group_id: t, status: e }; | ||
return s.q(i.Uu, h); | ||
return s.q(i.Ku, h); | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
export default class ts { | ||
export default class Zt { | ||
constructor(t) { | ||
@@ -9,3 +9,3 @@ (this.Bl = t), (this.Bl = t); | ||
static fromJson(t) { | ||
return new ts(t ? t.event_name : null); | ||
return new Zt(t ? t.event_name : null); | ||
} | ||
@@ -12,0 +12,0 @@ Y() { |
@@ -1,3 +0,3 @@ | ||
import is from "./filter-set.js"; | ||
export default class rs { | ||
import ts from "./filter-set.js"; | ||
export default class is { | ||
constructor(t, s) { | ||
@@ -13,5 +13,5 @@ (this.Bl = t), (this.Ml = s), (this.Bl = t), (this.Ml = s); | ||
static fromJson(t) { | ||
return new rs( | ||
return new is( | ||
t ? t.event_name : null, | ||
t ? is.fromJson(t.property_filters) : null, | ||
t ? ts.fromJson(t.property_filters) : null, | ||
); | ||
@@ -18,0 +18,0 @@ } |
import lr from "./filter.js"; | ||
import { isArray as j } from "../../util/code-utils.js"; | ||
export default class is { | ||
export default class ts { | ||
constructor(t) { | ||
@@ -33,3 +33,3 @@ (this.filters = t), (this.filters = t); | ||
} | ||
return new is(r); | ||
return new ts(r); | ||
} | ||
@@ -54,4 +54,4 @@ Y() { | ||
} | ||
return new is(r); | ||
return new ts(r); | ||
} | ||
} |
@@ -11,15 +11,15 @@ import { isDate as yt } from "../../util/code-utils.js"; | ||
(this.Tl = t), | ||
(this.Al = s), | ||
(this._l = s), | ||
(this.comparator = e), | ||
(this._l = i), | ||
(this.Ll = i), | ||
(this.Tl = t), | ||
(this.Al = s), | ||
(this._l = s), | ||
(this.comparator = e), | ||
(this._l = i), | ||
this.Al === lr.Il.Ll && | ||
this.comparator !== lr.Ul.Ol && | ||
this.comparator !== lr.Ul.Ql && | ||
this.comparator !== lr.Ul.Xl && | ||
this.comparator !== lr.Ul.Fl && | ||
(this._l = l(this._l)); | ||
(this.Ll = i), | ||
this._l === lr.Ol.Il && | ||
this.comparator !== lr.Ql.Ul && | ||
this.comparator !== lr.Ql.Xl && | ||
this.comparator !== lr.Ql.Fl && | ||
this.comparator !== lr.Ql.Kl && | ||
(this.Ll = l(this.Ll)); | ||
} | ||
@@ -29,39 +29,39 @@ Jl(t) { | ||
switch ((null != t && (s = t[this.Tl]), this.comparator)) { | ||
case lr.Ul.Kl: | ||
return null != s && s.valueOf() === this._l.valueOf(); | ||
case lr.Ul.Pl: | ||
return null == s || s.valueOf() !== this._l.valueOf(); | ||
case lr.Ul.Yl: | ||
return null != s && typeof s == typeof this._l && s > this._l; | ||
case lr.Ul.Ol: | ||
return this.Al === lr.Il.Ll | ||
? null != s && yt(s) && es(s) <= this._l.valueOf() | ||
: null != s && typeof s == typeof this._l && s >= this._l; | ||
case lr.Ul.Zl: | ||
return null != s && typeof s == typeof this._l && s < this._l; | ||
case lr.Ul.Ql: | ||
return this.Al === lr.Il.Ll | ||
? null != s && yt(s) && es(s) >= this._l.valueOf() | ||
: null != s && typeof s == typeof this._l && s <= this._l; | ||
case lr.Ul.$l: | ||
case lr.Ql.Pl: | ||
return null != s && s.valueOf() === this.Ll.valueOf(); | ||
case lr.Ql.Yl: | ||
return null == s || s.valueOf() !== this.Ll.valueOf(); | ||
case lr.Ql.Zl: | ||
return null != s && typeof s == typeof this.Ll && s > this.Ll; | ||
case lr.Ql.Ul: | ||
return this._l === lr.Ol.Il | ||
? null != s && yt(s) && es(s) <= this.Ll.valueOf() | ||
: null != s && typeof s == typeof this.Ll && s >= this.Ll; | ||
case lr.Ql.$l: | ||
return null != s && typeof s == typeof this.Ll && s < this.Ll; | ||
case lr.Ql.Xl: | ||
return this._l === lr.Ol.Il | ||
? null != s && yt(s) && es(s) >= this.Ll.valueOf() | ||
: null != s && typeof s == typeof this.Ll && s <= this.Ll; | ||
case lr.Ql.Hu: | ||
return ( | ||
null != s && | ||
"string" == typeof s && | ||
typeof s == typeof this._l && | ||
null != s.match(this._l) | ||
typeof s == typeof this.Ll && | ||
null != s.match(this.Ll) | ||
); | ||
case lr.Ul.Eu: | ||
case lr.Ql.Qu: | ||
return null != s; | ||
case lr.Ul._u: | ||
case lr.Ql.Xu: | ||
return null == s; | ||
case lr.Ul.Xl: | ||
return null != s && yt(s) && ls(s) < this._l; | ||
case lr.Ul.Fl: | ||
return null != s && yt(s) && ls(s) > this._l; | ||
case lr.Ul.Hu: | ||
case lr.Ql.Fl: | ||
return null != s && yt(s) && ls(s) < this.Ll; | ||
case lr.Ql.Kl: | ||
return null != s && yt(s) && ls(s) > this.Ll; | ||
case lr.Ql.Gu: | ||
return ( | ||
null == s || | ||
typeof s != typeof this._l || | ||
typeof s != typeof this.Ll || | ||
"string" != typeof s || | ||
null == s.match(this._l) | ||
null == s.match(this.Ll) | ||
); | ||
@@ -80,6 +80,6 @@ } | ||
Y() { | ||
let t = this._l; | ||
let t = this.Ll; | ||
return ( | ||
yt(this._l) && (t = h(t.valueOf())), | ||
{ k: this.Tl, t: this.Al, c: this.comparator, v: t } | ||
yt(this.Ll) && (t = h(t.valueOf())), | ||
{ k: this.Tl, t: this._l, c: this.comparator, v: t } | ||
); | ||
@@ -91,16 +91,16 @@ } | ||
} | ||
(lr.Il = { Qu: "boolean", Xu: "number", Bu: "string", Ll: "date" }), | ||
(lr.Ul = { | ||
Kl: 1, | ||
Pl: 2, | ||
Yl: 3, | ||
Ol: 4, | ||
Zl: 5, | ||
Ql: 6, | ||
$l: 10, | ||
Eu: 11, | ||
_u: 12, | ||
Xl: 15, | ||
Fl: 16, | ||
Hu: 17, | ||
(lr.Ol = { Vu: "boolean", Wu: "number", Yu: "string", Il: "date" }), | ||
(lr.Ql = { | ||
Pl: 1, | ||
Yl: 2, | ||
Zl: 3, | ||
Ul: 4, | ||
$l: 5, | ||
Xl: 6, | ||
Hu: 10, | ||
Qu: 11, | ||
Xu: 12, | ||
Fl: 15, | ||
Kl: 16, | ||
Gu: 17, | ||
}); |
import ri from "./trigger-condition.js"; | ||
export default class ni { | ||
constructor(t, i) { | ||
(this.zu = t), (this.Ju = i), (this.zu = t), (this.Ju = i); | ||
(this.Zu = t), (this.tf = i), (this.Zu = t), (this.tf = i); | ||
} | ||
Jl(t) { | ||
if (null == this.zu) return !1; | ||
const i = ri.Gu(t[0], this.zu); | ||
if (null == this.Zu) return !1; | ||
const i = ri.if(t[0], this.Zu); | ||
if (!i) return !1; | ||
let r = null == this.Ju || 0 === this.Ju.length; | ||
if (null != this.Ju) | ||
for (let i = 0; i < this.Ju.length; i++) | ||
if (this.Ju[i] === t[1]) { | ||
let r = null == this.tf || 0 === this.tf.length; | ||
if (null != this.tf) | ||
for (let i = 0; i < this.tf.length; i++) | ||
if (this.tf[i] === t[1]) { | ||
r = !0; | ||
@@ -23,4 +23,4 @@ break; | ||
Y() { | ||
return this.zu; | ||
return this.Zu; | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
export default class ns { | ||
export default class rs { | ||
constructor(t) { | ||
@@ -9,3 +9,3 @@ (this.productId = t), (this.productId = t); | ||
static fromJson(t) { | ||
return new ns(t ? t.product_id : null); | ||
return new rs(t ? t.product_id : null); | ||
} | ||
@@ -12,0 +12,0 @@ Y() { |
@@ -1,3 +0,3 @@ | ||
import is from "./filter-set.js"; | ||
export default class hs { | ||
import ts from "./filter-set.js"; | ||
export default class ns { | ||
constructor(t, s) { | ||
@@ -13,5 +13,5 @@ (this.productId = t), (this.Ml = s), (this.productId = t), (this.Ml = s); | ||
static fromJson(t) { | ||
return new hs( | ||
return new ns( | ||
t ? t.product_id : null, | ||
t ? is.fromJson(t.property_filters) : null, | ||
t ? ts.fromJson(t.property_filters) : null, | ||
); | ||
@@ -18,0 +18,0 @@ } |
import ri from "./trigger-condition.js"; | ||
export default class ur { | ||
constructor(t) { | ||
(this.zu = t), (this.zu = t); | ||
(this.Zu = t), (this.Zu = t); | ||
} | ||
Jl(t) { | ||
return null == this.zu || ri.Gu(t[0], this.zu); | ||
return null == this.Zu || ri.if(t[0], this.Zu); | ||
} | ||
@@ -13,4 +13,4 @@ static fromJson(t) { | ||
Y() { | ||
return this.zu; | ||
return this.Zu; | ||
} | ||
} |
@@ -1,7 +0,7 @@ | ||
import ts from "./custom-event-data.js"; | ||
import rs from "./custom-event-property-data.js"; | ||
import is from "./filter-set.js"; | ||
import Zt from "./custom-event-data.js"; | ||
import is from "./custom-event-property-data.js"; | ||
import ts from "./filter-set.js"; | ||
import ni from "./in-app-message-click-data.js"; | ||
import ns from "./purchase-data.js"; | ||
import hs from "./purchase-property-data.js"; | ||
import rs from "./purchase-data.js"; | ||
import ns from "./purchase-property-data.js"; | ||
import ur from "./push-click-data.js"; | ||
@@ -18,3 +18,3 @@ import tt from "./trigger-events.js"; | ||
} | ||
static Gu(e, t) { | ||
static if(e, t) { | ||
let s = null; | ||
@@ -32,21 +32,21 @@ try { | ||
switch (t) { | ||
case ri.Or.OPEN: | ||
case ri.Or.kt: | ||
case ri._r.OPEN: | ||
case ri._r.kt: | ||
break; | ||
case ri.Or.Rr: | ||
case ri._r.Rr: | ||
r = rs.fromJson(e.data); | ||
break; | ||
case ri._r.nc: | ||
r = ns.fromJson(e.data); | ||
break; | ||
case ri.Or.nc: | ||
r = hs.fromJson(e.data); | ||
break; | ||
case ri.Or.vr: | ||
case ri._r.vr: | ||
r = ur.fromJson(e.data); | ||
break; | ||
case ri.Or.ue: | ||
r = ts.fromJson(e.data); | ||
case ri._r.ue: | ||
r = Zt.fromJson(e.data); | ||
break; | ||
case ri.Or.lc: | ||
r = rs.fromJson(e.data); | ||
case ri._r.lc: | ||
r = is.fromJson(e.data); | ||
break; | ||
case ri.Or.Zr: | ||
case ri._r.Qr: | ||
r = ni.fromJson(e.data); | ||
@@ -63,21 +63,21 @@ } | ||
switch (e.t) { | ||
case ri.Or.OPEN: | ||
case ri.Or.kt: | ||
case ri._r.OPEN: | ||
case ri._r.kt: | ||
break; | ||
case ri.Or.Rr: | ||
r = new ns(e.d); | ||
case ri._r.Rr: | ||
r = new rs(e.d); | ||
break; | ||
case ri.Or.nc: | ||
(t = e.d || {}), (r = new hs(t.id, is.qn(t.pf || []))); | ||
case ri._r.nc: | ||
(t = e.d || {}), (r = new ns(t.id, ts.qn(t.pf || []))); | ||
break; | ||
case ri.Or.vr: | ||
case ri._r.vr: | ||
r = new ur(e.d); | ||
break; | ||
case ri.Or.ue: | ||
r = new ts(e.d); | ||
case ri._r.ue: | ||
r = new Zt(e.d); | ||
break; | ||
case ri.Or.lc: | ||
(t = e.d || {}), (r = new rs(t.e, is.qn(t.pf || []))); | ||
case ri._r.lc: | ||
(t = e.d || {}), (r = new is(t.e, ts.qn(t.pf || []))); | ||
break; | ||
case ri.Or.Zr: | ||
case ri._r.Qr: | ||
r = new ni(e.d); | ||
@@ -88,3 +88,3 @@ } | ||
} | ||
(ri.Or = { | ||
(ri._r = { | ||
OPEN: "open", | ||
@@ -96,13 +96,13 @@ Rr: "purchase", | ||
lc: "custom_event_property", | ||
Zr: "iam_click", | ||
Qr: "iam_click", | ||
kt: "test", | ||
}), | ||
(ri.cc = {}), | ||
(ri.cc[ri.Or.OPEN] = tt.OPEN), | ||
(ri.cc[ri.Or.Rr] = tt.Rr), | ||
(ri.cc[ri.Or.nc] = tt.Rr), | ||
(ri.cc[ri.Or.vr] = tt.vr), | ||
(ri.cc[ri.Or.ue] = tt.ue), | ||
(ri.cc[ri.Or.lc] = tt.ue), | ||
(ri.cc[ri.Or.Zr] = tt.Zr), | ||
(ri.cc[ri.Or.kt] = tt.kt); | ||
(ri.cc[ri._r.OPEN] = tt.OPEN), | ||
(ri.cc[ri._r.Rr] = tt.Rr), | ||
(ri.cc[ri._r.nc] = tt.Rr), | ||
(ri.cc[ri._r.vr] = tt.vr), | ||
(ri.cc[ri._r.ue] = tt.ue), | ||
(ri.cc[ri._r.lc] = tt.ue), | ||
(ri.cc[ri._r.Qr] = tt.Qr), | ||
(ri.cc[ri._r.kt] = tt.kt); |
@@ -6,4 +6,4 @@ export default { | ||
ue: "custom_event", | ||
Zr: "iam_click", | ||
Qr: "iam_click", | ||
kt: "test", | ||
}; |
@@ -9,5 +9,5 @@ import { | ||
export default class mt { | ||
constructor(t, i = [], s, e, r = 0, h, l, o = 0, n = mt.Vu, a, u, d) { | ||
constructor(t, i = [], s, e, r = 0, h, l, o = 0, n = mt.td, a, u, d) { | ||
(this.id = t), | ||
(this.Ku = i), | ||
(this.sd = i), | ||
(this.startTime = s), | ||
@@ -18,9 +18,9 @@ (this.endTime = e), | ||
(this.data = l), | ||
(this.Wu = o), | ||
(this.Yu = n), | ||
(this.Kr = a), | ||
(this.Zu = u), | ||
(this.td = d), | ||
(this.ed = o), | ||
(this.rd = n), | ||
(this.Nr = a), | ||
(this.hd = u), | ||
(this.od = d), | ||
(this.id = t), | ||
(this.Ku = i || []), | ||
(this.sd = i || []), | ||
void 0 === s && (s = null), | ||
@@ -32,29 +32,29 @@ (this.startTime = s), | ||
(this.type = h), | ||
(this.Wu = o || 0), | ||
null == a && (a = 1e3 * (this.Wu + 30)), | ||
(this.Kr = a), | ||
(this.ed = o || 0), | ||
null == a && (a = 1e3 * (this.ed + 30)), | ||
(this.Nr = a), | ||
(this.data = l), | ||
null != n && (this.Yu = n), | ||
(this.Zu = u), | ||
(this.td = d || null); | ||
null != n && (this.rd = n), | ||
(this.hd = u), | ||
(this.od = d || null); | ||
} | ||
sd(t) { | ||
nd(t) { | ||
return ( | ||
null == this.td || (this.Yu !== mt.Vu && t - this.td >= 1e3 * this.Yu) | ||
null == this.od || (this.rd !== mt.td && t - this.od >= 1e3 * this.rd) | ||
); | ||
} | ||
ed(t) { | ||
this.td = t; | ||
ad(t) { | ||
this.od = t; | ||
} | ||
rd(t) { | ||
const i = t + 1e3 * this.Wu; | ||
ud(t) { | ||
const i = t + 1e3 * this.ed; | ||
return Math.max(i - new Date().valueOf(), 0); | ||
} | ||
hd(t) { | ||
dd(t) { | ||
const i = new Date().valueOf() - t, | ||
s = null == t || isNaN(i) || null == this.Kr || i < this.Kr; | ||
s = null == t || isNaN(i) || null == this.Nr || i < this.Nr; | ||
return ( | ||
s || | ||
r.info( | ||
`Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.Kr}ms.`, | ||
`Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.Nr}ms.`, | ||
), | ||
@@ -79,3 +79,3 @@ !s | ||
return J( | ||
mt.Or, | ||
mt._r, | ||
o, | ||
@@ -90,3 +90,3 @@ "Could not construct Trigger from server data", | ||
const t = []; | ||
for (let i = 0; i < this.Ku.length; i++) t.push(this.Ku[i].Y()); | ||
for (let i = 0; i < this.sd.length; i++) t.push(this.sd[i].Y()); | ||
return { | ||
@@ -100,7 +100,7 @@ i: this.id, | ||
da: this.data, | ||
d: this.Wu, | ||
r: this.Yu, | ||
tm: this.Kr, | ||
ss: this.Zu, | ||
ld: this.td, | ||
d: this.ed, | ||
r: this.rd, | ||
tm: this.Nr, | ||
ss: this.hd, | ||
ld: this.od, | ||
}; | ||
@@ -128,2 +128,2 @@ } | ||
} | ||
(mt.Or = { Cr: "inapp", od: "templated_iam" }), (mt.Vu = -1); | ||
(mt._r = { Br: "inapp", md: "templated_iam" }), (mt.td = -1); |
@@ -17,3 +17,3 @@ import se from "../InAppMessage/in-app-message-manager-factory.js"; | ||
null != r ? r : 30, | ||
se.m().He(), | ||
se.m().Mi(), | ||
e.l(), | ||
@@ -20,0 +20,0 @@ e.cr(), |
@@ -20,3 +20,3 @@ import y from "../common/base-provider.js"; | ||
(this.u = s), | ||
(this.Ei = e), | ||
(this.zi = e), | ||
(this.ig = r), | ||
@@ -26,3 +26,3 @@ (this.tg = t), | ||
(this.u = s), | ||
(this.Ei = e), | ||
(this.zi = e), | ||
(this.ig = r), | ||
@@ -41,8 +41,8 @@ (this.sg = []), | ||
if (this.u) { | ||
(this.hg = this.u.j(o.C.aE) || this.hg), | ||
(this.ng = this.u.j(o.C.iE) || this.ng), | ||
(this.og = this.u.j(o.C.nE) || this.og); | ||
(this.hg = this.u.j(o.C.iE) || this.hg), | ||
(this.ng = this.u.j(o.C.EE) || this.ng), | ||
(this.og = this.u.j(o.C.aE) || this.og); | ||
for (let t = 0; t < this.triggers.length; t++) { | ||
const i = this.triggers[t]; | ||
i.id && null != this.og[i.id] && i.ed(this.og[i.id]); | ||
i.id && null != this.og[i.id] && i.ad(this.og[i.id]); | ||
} | ||
@@ -76,3 +76,3 @@ } | ||
const n = t[e], | ||
o = r.rd(n.Jr || 0); | ||
o = r.ud(n.Gr || 0); | ||
if (o > 0) { | ||
@@ -82,3 +82,3 @@ let t, e; | ||
null != n.ug && (t = n.ug), | ||
null != n.dg && ue.AE(n.dg) && (e = ue.qn(n.dg)); | ||
null != n.dg && ue.RE(n.dg) && (e = ue.qn(n.dg)); | ||
const l = []; | ||
@@ -90,3 +90,3 @@ if (n.pg && j(n.pg)) | ||
} | ||
this.eg.push(window.setTimeout(i(r, n.Jr || 0, t, e, l), o)); | ||
this.eg.push(window.setTimeout(i(r, n.Gr || 0, t, e, l), o)); | ||
} | ||
@@ -100,3 +100,3 @@ } | ||
} | ||
e && this.u && this.u.k(o.C.iE, this.ng); | ||
e && this.u && this.u.k(o.C.EE, this.ng); | ||
} | ||
@@ -115,6 +115,6 @@ mg() { | ||
} | ||
Rs(t) { | ||
Ns(t) { | ||
let i = !1; | ||
if (null != t && t.triggers) { | ||
this.ig.Yr(), this.fg(); | ||
this.ig.Lr(), this.fg(); | ||
const s = {}, | ||
@@ -128,6 +128,6 @@ e = {}; | ||
null != this.og[h.id] && | ||
(h.ed(this.og[h.id]), (s[h.id] = this.og[h.id])), | ||
(h.ad(this.og[h.id]), (s[h.id] = this.og[h.id])), | ||
h.id && null != this.ng[h.id] && (e[h.id] = this.ng[h.id]); | ||
for (let t = 0; t < h.Ku.length; t++) | ||
if (h.Ku[t].sc(tt.kt, null)) { | ||
for (let t = 0; t < h.sd.length; t++) | ||
if (h.sd[t].sc(tt.kt, null)) { | ||
i = !0; | ||
@@ -139,4 +139,4 @@ break; | ||
} | ||
ii(this.og, s) || ((this.og = s), this.u && this.u.k(o.C.nE, this.og)), | ||
ii(this.ng, e) || ((this.ng = e), this.u && this.u.k(o.C.iE, this.ng)), | ||
ii(this.og, s) || ((this.og = s), this.u && this.u.k(o.C.aE, this.og)), | ||
ii(this.ng, e) || ((this.ng = e), this.u && this.u.k(o.C.EE, this.ng)), | ||
this.mg(), | ||
@@ -158,8 +158,8 @@ i && | ||
const h = new Date().valueOf(); | ||
t.hd(i) || | ||
(!1 === navigator.onLine && t.type === mt.Or.Cr && e.imageUrl | ||
t.dd(i) || | ||
(!1 === navigator.onLine && t.type === mt._r.Br && e.imageUrl | ||
? r.info( | ||
`Not showing ${t.type} trigger action ${t.id} due to offline state.`, | ||
) | ||
: t.sd(h) && this.wg(t, h, s) | ||
: t.nd(h) && this.wg(t, h, s) | ||
? 0 === this.Jt.ic() | ||
@@ -178,3 +178,3 @@ ? r.info( | ||
if (null != n) | ||
if ((this.Tg(n, i, s, e, h), n.hd(i))) { | ||
if ((this.Tg(n, i, s, e, h), n.dd(i))) { | ||
let t = `Server aborted in-app message display, but the timeout on fallback trigger ${n.id} has already elapsed.`; | ||
@@ -186,3 +186,3 @@ h.length > 0 && (t += " Continuing to fall back."), r.info(t), o(); | ||
); | ||
const o = 1e3 * n.Wu - (new Date().valueOf() - i); | ||
const o = 1e3 * n.ed - (new Date().valueOf() - i); | ||
o > 0 | ||
@@ -199,3 +199,3 @@ ? this.eg.push( | ||
switch (t.type) { | ||
case mt.Or.Cr: | ||
case mt._r.Br: | ||
if (((l = pt(t.data)), null == l)) { | ||
@@ -207,3 +207,3 @@ r.error( | ||
} | ||
if (((a = this.ig.Qi(l)), a)) { | ||
if (((a = this.ig.Li(l)), a)) { | ||
r.error(a), o(); | ||
@@ -214,4 +214,4 @@ break; | ||
break; | ||
case mt.Or.od: | ||
if (((g = wt.fromJson(t.data, n, o, i, t.Kr || 0)), null == g)) { | ||
case mt._r.md: | ||
if (((g = wt.fromJson(t.data, n, o, i, t.Nr || 0)), null == g)) { | ||
r.error( | ||
@@ -230,3 +230,3 @@ `Could not parse trigger data for trigger ${t.id}, ignoring.`, | ||
if (!J(tt, t, "Cannot fire trigger action.", "TriggerEvents")) return; | ||
if (this.Ei && this.Ei.Tu()) | ||
if (this.zi && this.zi.Nu()) | ||
return ( | ||
@@ -246,5 +246,5 @@ r.info( | ||
const r = this.triggers[s], | ||
h = e + 1e3 * r.Wu; | ||
h = e + 1e3 * r.ed; | ||
if ( | ||
r.sd(h) && | ||
r.nd(h) && | ||
(null == r.startTime || r.startTime.valueOf() <= e) && | ||
@@ -254,4 +254,4 @@ (null == r.endTime || r.endTime.valueOf() >= e) | ||
let s = !1; | ||
for (let e = 0; e < r.Ku.length; e++) | ||
if (r.Ku[e].sc(t, i)) { | ||
for (let e = 0; e < r.sd.length; e++) | ||
if (r.sd[e].sc(t, i)) { | ||
s = !0; | ||
@@ -280,3 +280,3 @@ break; | ||
this.Tg(a, e, t, s, l), | ||
0 === a.Wu | ||
0 === a.ed | ||
? this.cg(a, e, t, s, l) | ||
@@ -286,11 +286,11 @@ : this.eg.push( | ||
this.cg(a, e, t, s, l); | ||
}, 1e3 * a.Wu), | ||
}, 1e3 * a.ed), | ||
)); | ||
} | ||
changeUser(t = !1) { | ||
if (((this.triggers = []), this.u && this.u.hi(o.C.rE), !t)) { | ||
if (((this.triggers = []), this.u && this.u.ti(o.C.rE), !t)) { | ||
(this.sg = []), (this.hg = null), (this.og = {}), (this.ng = {}); | ||
for (let t = 0; t < this.eg.length; t++) clearTimeout(this.eg[t]); | ||
(this.eg = []), | ||
this.u && (this.u.hi(o.C.aE), this.u.hi(o.C.nE), this.u.hi(o.C.iE)); | ||
this.u && (this.u.ti(o.C.iE), this.u.ti(o.C.aE), this.u.ti(o.C.EE)); | ||
} | ||
@@ -312,3 +312,3 @@ } | ||
); | ||
let e = t.Zu; | ||
let e = t.hd; | ||
return null == e && (e = this.tg), i - this.hg >= 1e3 * e; | ||
@@ -320,3 +320,3 @@ } | ||
let n; | ||
(h.Jr = i), (h.ug = s), null != e && (n = e.Y()), (h.dg = n); | ||
(h.Gr = i), (h.ug = s), null != e && (n = e.Y()), (h.dg = n); | ||
const l = []; | ||
@@ -326,11 +326,11 @@ for (const t of r) t.id && l.push(t.id); | ||
t.id && this.ng[t.id].push(h), | ||
this.u && this.u.k(o.C.iE, this.ng); | ||
this.u && this.u.k(o.C.EE, this.ng); | ||
} | ||
yg(t, i) { | ||
this.fg(), | ||
t.ed(i), | ||
t.ad(i), | ||
(this.hg = i), | ||
t.id && (this.og[t.id] = i), | ||
this.u && (this.u.k(o.C.aE, i), this.u.k(o.C.nE, this.og)); | ||
this.u && (this.u.k(o.C.iE, i), this.u.k(o.C.aE, this.og)); | ||
} | ||
} |
import e, { OPTIONS as L } from "../../managers/braze-instance.js"; | ||
export function attachCSS(n, t, o) { | ||
const c = n || document.querySelector("head"), | ||
s = `ab-${t}-css-definitions-${"5.2.0".replace(/\./g, "-")}`; | ||
s = `ab-${t}-css-definitions-${"5.3.0".replace(/\./g, "-")}`; | ||
if (!c) return; | ||
@@ -10,5 +10,5 @@ const a = c.ownerDocument || document; | ||
(n.innerHTML = o || ""), (n.id = s); | ||
const t = e.nn(L.ho); | ||
const t = e.nn(L.bo); | ||
null != t && n.setAttribute("nonce", t), c.appendChild(n); | ||
} | ||
} |
@@ -21,3 +21,3 @@ import { | ||
constructor(t, e) { | ||
(this.wt = t), (this.Ei = e), (this.wt = t), (this.Ei = e); | ||
(this.wt = t), (this.zi = e), (this.wt = t), (this.zi = e); | ||
} | ||
@@ -37,3 +37,3 @@ getUserId(t) { | ||
? (r.error("addAlias requires a non-empty label"), !1) | ||
: this.Ei.Cn(t, e).L; | ||
: this.zi.Cn(t, e).L; | ||
} | ||
@@ -167,3 +167,3 @@ setFirstName(t) { | ||
!1) | ||
: this.Ei.setLastKnownLocation(this.wt.getUserId(), t, e, n, s, i).L); | ||
: this.zi.setLastKnownLocation(this.wt.getUserId(), t, e, n, s, i).L); | ||
} | ||
@@ -185,7 +185,7 @@ setCustomUserAttribute(t, e, r) { | ||
if (!r && !n && 0 !== e.length) return !1; | ||
if (r || 0 === e.length) return this.Ei.Fn(i.$n, t, e).L; | ||
if (r || 0 === e.length) return this.zi.Fn(i.$n, t, e).L; | ||
for (const t of e) if (!s(t)) return !1; | ||
} else if (Nt(e)) { | ||
if (!s(e)) return !1; | ||
if (r) return this.Ei.Fn(i.Bn, t, e).L; | ||
if (r) return this.zi.Fn(i.Bn, t, e).L; | ||
} else { | ||
@@ -213,3 +213,3 @@ if (!(void 0 !== e && Ut(e))) return !1; | ||
) && | ||
this.Ei.Fn(i.Ln, t, e).L | ||
this.zi.Fn(i.Ln, t, e).L | ||
); | ||
@@ -224,3 +224,3 @@ } | ||
) && | ||
this.Ei.Fn(i.Rn, t, e).L | ||
this.zi.Fn(i.Rn, t, e).L | ||
); | ||
@@ -237,3 +237,3 @@ } | ||
!1) | ||
: this.Ei.Fn(i.On, t, s).L; | ||
: this.zi.Fn(i.On, t, s).L; | ||
} | ||
@@ -254,3 +254,3 @@ setCustomLocationAttribute(t, e, s) { | ||
!1) | ||
: this.Ei.Gn(t, e, s).L) | ||
: this.zi.Gn(t, e, s).L) | ||
); | ||
@@ -269,3 +269,3 @@ } | ||
!1) | ||
: this.Ei.Hn(t, User.Kn.SUBSCRIBED).L; | ||
: this.zi.Hn(t, User.Kn.SUBSCRIBED).L; | ||
} | ||
@@ -283,6 +283,6 @@ removeFromSubscriptionGroup(t) { | ||
!1) | ||
: this.Ei.Hn(t, User.Kn.UNSUBSCRIBED).L; | ||
: this.zi.Hn(t, User.Kn.UNSUBSCRIBED).L; | ||
} | ||
kn(t, e, r, s, n) { | ||
this.wt.kn(t, e, r, s, n), this.Ei.Mn(); | ||
this.wt.kn(t, e, r, s, n), this.zi.Mn(); | ||
} | ||
@@ -289,0 +289,0 @@ Dn(t) { |
import { isArray as j } from "./code-utils.js"; | ||
export default class ge { | ||
constructor() {} | ||
tf() {} | ||
ef() {} | ||
Da(t) {} | ||
static rf(t, e) { | ||
rf() {} | ||
Ta(t) {} | ||
static sf(t, e) { | ||
if (t && e) | ||
if (((t = t.toLowerCase()), j(e.if))) { | ||
for (let r = 0; r < e.if.length; r++) | ||
if (-1 !== t.indexOf(e.if[r].toLowerCase())) return e.identity; | ||
} else if (-1 !== t.indexOf(e.if.toLowerCase())) return e.identity; | ||
if (((t = t.toLowerCase()), j(e.ff))) { | ||
for (let r = 0; r < e.ff.length; r++) | ||
if (-1 !== t.indexOf(e.ff[r].toLowerCase())) return e.identity; | ||
} else if (-1 !== t.indexOf(e.ff.toLowerCase())) return e.identity; | ||
} | ||
} |
@@ -28,10 +28,10 @@ import { logger as r } from "../../shared-lib/index.js"; | ||
export const INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES = { | ||
Vi: "unknownBrazeAction", | ||
Xi: "noPushPrompt", | ||
Qi: "unknownBrazeAction", | ||
Wi: "noPushPrompt", | ||
}; | ||
export const ineligibleBrazeActionURLErrorMessage = (t, o) => { | ||
switch (t) { | ||
case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Vi: | ||
case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Qi: | ||
return `${o} contains an unknown braze action type and will not be displayed.`; | ||
case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Xi: | ||
case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Wi: | ||
return `${o} contains a push prompt braze action, but is not eligible for a push prompt. Ignoring.`; | ||
@@ -38,0 +38,0 @@ default: |
@@ -9,6 +9,6 @@ import ai from "./client-hints-parser.js"; | ||
(this.userAgent = navigator.userAgent), | ||
(this.browser = this.Sg.tf()), | ||
(this.version = this.Sg.ef()), | ||
(this.browser = this.Sg.ef()), | ||
(this.version = this.Sg.rf()), | ||
(this.OS = null), | ||
this.Da().then((t) => (this.OS = t)); | ||
this.Ta().then((t) => (this.OS = t)); | ||
const i = navigator; | ||
@@ -22,14 +22,14 @@ (this.language = ( | ||
).toLowerCase()), | ||
(this.Qo = ui.vg(this.userAgent)); | ||
(this.Zo = ui.vg(this.userAgent)); | ||
} | ||
dE() { | ||
IE() { | ||
return this.browser === gi.Bg; | ||
} | ||
Fa() { | ||
Oa() { | ||
return this.OS || null; | ||
} | ||
Da() { | ||
Ta() { | ||
return this.OS | ||
? Promise.resolve(this.OS) | ||
: this.Sg.Da(ui.kg).then((t) => ((this.OS = t), t)); | ||
: this.Sg.Ta(ui.kg).then((t) => ((this.OS = t), t)); | ||
} | ||
@@ -62,27 +62,27 @@ static vg(t) { | ||
ui.kg = [ | ||
{ string: navigator.platform, if: "Win", identity: Y.Og }, | ||
{ string: navigator.platform, if: "Mac", identity: Y.Pg }, | ||
{ string: navigator.platform, if: "BlackBerry", identity: "BlackBerry" }, | ||
{ string: navigator.platform, if: "FreeBSD", identity: "FreeBSD" }, | ||
{ string: navigator.platform, if: "OpenBSD", identity: "OpenBSD" }, | ||
{ string: navigator.platform, if: "Nintendo", identity: "Nintendo" }, | ||
{ string: navigator.platform, if: "SunOS", identity: "SunOS" }, | ||
{ string: navigator.platform, if: "PlayStation", identity: "PlayStation" }, | ||
{ string: navigator.platform, if: "X11", identity: "X11" }, | ||
{ string: navigator.platform, ff: "Win", identity: Y.Og }, | ||
{ string: navigator.platform, ff: "Mac", identity: Y.Pg }, | ||
{ string: navigator.platform, ff: "BlackBerry", identity: "BlackBerry" }, | ||
{ string: navigator.platform, ff: "FreeBSD", identity: "FreeBSD" }, | ||
{ string: navigator.platform, ff: "OpenBSD", identity: "OpenBSD" }, | ||
{ string: navigator.platform, ff: "Nintendo", identity: "Nintendo" }, | ||
{ string: navigator.platform, ff: "SunOS", identity: "SunOS" }, | ||
{ string: navigator.platform, ff: "PlayStation", identity: "PlayStation" }, | ||
{ string: navigator.platform, ff: "X11", identity: "X11" }, | ||
{ | ||
string: navigator.userAgent, | ||
if: ["iPhone", "iPad", "iPod"], | ||
ff: ["iPhone", "iPad", "iPod"], | ||
identity: Y.io, | ||
}, | ||
{ string: navigator.platform, if: "Pike v", identity: Y.io }, | ||
{ string: navigator.userAgent, if: ["Web0S"], identity: "WebOS" }, | ||
{ string: navigator.platform, ff: "Pike v", identity: Y.io }, | ||
{ string: navigator.userAgent, ff: ["Web0S"], identity: "WebOS" }, | ||
{ | ||
string: navigator.platform, | ||
if: ["Linux armv7l", "Android"], | ||
ff: ["Linux armv7l", "Android"], | ||
identity: Y.xg, | ||
}, | ||
{ string: navigator.userAgent, if: ["Android"], identity: Y.xg }, | ||
{ string: navigator.platform, if: "Linux", identity: "Linux" }, | ||
{ string: navigator.userAgent, ff: ["Android"], identity: Y.xg }, | ||
{ string: navigator.platform, ff: "Linux", identity: "Linux" }, | ||
]; | ||
const X = new ui(); | ||
export { X as default, ui as BrowserDetector }; |
@@ -18,13 +18,13 @@ import ge from "./base-device-parser.js"; | ||
} | ||
tf() { | ||
ef() { | ||
return this.browser; | ||
} | ||
ef() { | ||
rf() { | ||
return this.version; | ||
} | ||
Da(t) { | ||
Ta(t) { | ||
if (this.OS) return Promise.resolve(this.OS); | ||
const s = (s) => { | ||
for (let r = 0; r < t.length; r++) { | ||
const i = ai.rf(s, t[r]); | ||
const i = ai.sf(s, t[r]); | ||
if (i) return (this.OS = i), this.OS; | ||
@@ -31,0 +31,0 @@ } |
@@ -21,4 +21,4 @@ import { logger as r } from "../../shared-lib/index.js"; | ||
} | ||
export const DOMUtils = { dc: null, co: _isInView }; | ||
export const DIRECTIONS = { De: "up", Ee: "down", U: "left", V: "right" }; | ||
export const DOMUtils = { dc: null, po: _isInView }; | ||
export const DIRECTIONS = { Re: "up", Se: "down", U: "left", V: "right" }; | ||
export function supportsPassive() { | ||
@@ -45,6 +45,6 @@ if (null == DOMUtils.dc) { | ||
export function topIsInView(t) { | ||
return DOMUtils.co(t, !0, !1, !1); | ||
return DOMUtils.po(t, !0, !1, !1); | ||
} | ||
export function bottomIsInView(t) { | ||
return DOMUtils.co(t, !1, !0, !1); | ||
return DOMUtils.po(t, !1, !0, !1); | ||
} | ||
@@ -74,5 +74,5 @@ export function clickElement(t) { | ||
(((u > 0 && | ||
n === DIRECTIONS.De && | ||
n === DIRECTIONS.Re && | ||
t.scrollTop === t.scrollHeight - t.offsetHeight) || | ||
(u < 0 && n === DIRECTIONS.Ee && 0 === t.scrollTop)) && | ||
(u < 0 && n === DIRECTIONS.Se && 0 === t.scrollTop)) && | ||
e(o), | ||
@@ -79,0 +79,0 @@ (s = null), |
@@ -5,3 +5,3 @@ import { logger as r } from "../../shared-lib/index.js"; | ||
const C = { | ||
Qs: (t) => { | ||
Gs: (t) => { | ||
let e, o; | ||
@@ -17,3 +17,3 @@ try { | ||
"function" == typeof t.error && t.error(e.status), | ||
"function" == typeof t.ti && t.ti(!1); | ||
"function" == typeof t.Ws && t.Ws(!1); | ||
}; | ||
@@ -33,3 +33,3 @@ (e.onload = () => { | ||
const n = { | ||
error: "" === e.responseText ? qt.Ra : qt.Ba, | ||
error: "" === e.responseText ? qt.Zh : qt.Ra, | ||
response: e.responseText, | ||
@@ -41,3 +41,3 @@ }; | ||
} | ||
"function" == typeof t.ti && t.ti(!0); | ||
"function" == typeof t.Ws && t.Ws(!0); | ||
} else i(); | ||
@@ -44,0 +44,0 @@ }), |
import { REQUEST_ATTEMPT_DEFAULT as Ae } from "../common/constants.js"; | ||
import { STORAGE_KEYS as o } from "../managers/storage-manager.js"; | ||
const S = { | ||
Gs: { La: "d", Bs: "cc", qi: "ff", _r: "t" }, | ||
ii: { | ||
La: "/data", | ||
Bs: "/content_cards/sync", | ||
qi: "/feature_flags/sync", | ||
_r: "/template", | ||
const D = { | ||
Ps: { | ||
$a: "data", | ||
Bs: "content_cards/sync", | ||
bi: "feature_flags/sync", | ||
Mr: "template", | ||
}, | ||
mc: (e) => (null == e ? void 0 : e.j(o.C.EE)), | ||
Ac: (e) => (null == e ? void 0 : e.j(o.C.lE)), | ||
Tc: (e, t) => { | ||
null == e || e.k(o.C.EE, t); | ||
qu: (t) => (null == t ? void 0 : t.j(o.C.lE)), | ||
sm: (t) => (null == t ? void 0 : t.j(o.C.SE)), | ||
nm: (t, e) => { | ||
null == t || t.k(o.C.lE, e); | ||
}, | ||
Rc: (e, t) => { | ||
null == e || e.k(o.C.lE, t); | ||
um: (t, e) => { | ||
null == t || t.k(o.C.SE, e); | ||
}, | ||
Wa: (e, t) => { | ||
if (!e || !t) return -1; | ||
const s = S.mc(e); | ||
Pa: (t, e) => { | ||
if (!t || !e) return -1; | ||
const s = D.qu(t); | ||
if (null == s) return -1; | ||
const n = s[t]; | ||
const n = s[e]; | ||
return null == n || isNaN(n) ? -1 : n; | ||
}, | ||
Ya: (e, t) => { | ||
Ua: (t, e) => { | ||
let s = Ae; | ||
if (!e || !t) return s; | ||
const n = S.Ac(e); | ||
return null == n ? s : ((s = n[t]), null == s || isNaN(s) ? Ae : s); | ||
if (!t || !e) return s; | ||
const n = D.sm(t); | ||
return null == n ? s : ((s = n[e]), null == s || isNaN(s) ? Ae : s); | ||
}, | ||
Os: (e, t, s) => { | ||
if (!e || !t) return; | ||
let n = S.mc(e); | ||
null == n && (n = {}), (n[t] = s), S.Tc(e, n); | ||
_s: (t, e, s) => { | ||
if (!t || !e) return; | ||
let n = D.qu(t); | ||
null == n && (n = {}), (n[e] = s), D.nm(t, n); | ||
}, | ||
Ys: (e, t, s) => { | ||
if (!e || !t) return; | ||
let n = S.Ac(e); | ||
null == n && (n = {}), (n[t] = s), S.Rc(e, n); | ||
Qs: (t, e, s) => { | ||
if (!t || !e) return; | ||
let n = D.sm(t); | ||
null == n && (n = {}), (n[e] = s), D.um(t, n); | ||
}, | ||
si: (e, t) => { | ||
if (!e || !t) return; | ||
const s = S.Ya(e, t); | ||
S.Ys(e, t, s + 1); | ||
Ys: (t, e) => { | ||
if (!t || !e) return; | ||
const s = D.Ua(t, e); | ||
D.Qs(t, e, s + 1); | ||
}, | ||
}; | ||
export default S; | ||
export default D; |
@@ -5,14 +5,14 @@ import ge from "./base-device-parser.js"; | ||
constructor() { | ||
super(), (this.nd = oi.hc(navigator.userAgent || "")); | ||
super(), (this.fd = oi.hc(navigator.userAgent || "")); | ||
} | ||
tf() { | ||
return this.nd[0] || "Unknown Browser"; | ||
} | ||
ef() { | ||
return this.nd[1] || "Unknown Version"; | ||
return this.fd[0] || "Unknown Browser"; | ||
} | ||
Da(r) { | ||
rf() { | ||
return this.fd[1] || "Unknown Version"; | ||
} | ||
Ta(r) { | ||
for (let n = 0; n < r.length; n++) { | ||
const e = r[n].string; | ||
let i = oi.rf(e, r[n]); | ||
let i = oi.sf(e, r[n]); | ||
if (i) | ||
@@ -19,0 +19,0 @@ return ( |
@@ -32,4 +32,4 @@ export const ORIENTATION = { PORTRAIT: 0, LANDSCAPE: 1 }; | ||
fo: _isPhone, | ||
jo: _getOrientation, | ||
co: _getOrientation, | ||
Un: _getCurrentUrl, | ||
}; |
Sorry, the diff of this file is too big to display
457647
12979