@braze/web-sdk 4.9.0 → 4.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/index.d.ts +2289 -2228
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +1 -1
  4. package/shared-lib/event-types.js +9 -9
  5. package/shared-lib/indexed-db-adapter.js +1 -1
  6. package/shared-lib/logger.js +2 -2
  7. package/shared-lib/supported-options.js +5 -4
  8. package/src/Core/get-device-id.js +9 -7
  9. package/src/User/user.js +10 -9
  10. package/src/managers/braze-instance.js +68 -66
  11. package/src/managers/device-manager.js +15 -15
  12. package/src/managers/network-manager.js +64 -61
  13. package/src/managers/session-manager.js +1 -1
  14. package/src/managers/storage-manager-factory.js +8 -8
  15. package/src/managers/storage-manager.js +15 -15
  16. package/src/managers/subscription-manager.js +1 -1
  17. package/src/models/backend-errors.js +5 -5
  18. package/src/models/braze-event.js +2 -2
  19. package/src/models/device.js +1 -1
  20. package/src/models/server-config.js +2 -2
  21. package/src/request-controller.js +112 -108
  22. package/src/triggers/models/filter.js +7 -7
  23. package/src/triggers/models/trigger-condition.js +17 -17
  24. package/src/triggers/models/trigger.js +25 -25
  25. package/src/triggers/triggers-provider.js +21 -21
  26. package/src/ui/js/attach-css.js +1 -1
  27. package/src/ui/js/load-font-awesome.js +1 -1
  28. package/src/util/base-device-parser.js +1 -1
  29. package/src/util/browser-detector.js +5 -5
  30. package/src/util/client-hints-parser.js +6 -6
  31. package/src/util/date-utils.js +2 -2
  32. package/src/util/device-constants.js +1 -1
  33. package/src/util/dom-utils.js +5 -5
  34. package/src/util/net.js +1 -1
  35. package/src/util/request-header-utils.js +14 -14
  36. package/src/util/user-agent-parser.js +5 -5
  37. package/src/util/validation-utils.js +9 -9
@@ -8,40 +8,40 @@ import { STORAGE_KEYS as i } from "./managers/storage-manager.js";
8
8
  import E from "./managers/subscription-manager.js";
9
9
  import jt from "./Push/utils/push-utils.js";
10
10
  import T from "./util/request-header-utils.js";
11
- export default class Rt {
12
- constructor(t, i, s, e, o, h, n, r, u, l) {
11
+ export default class Lt {
12
+ constructor(t, i, s, e, h, o, n, r, u, l) {
13
13
  (this.cn = t),
14
14
  (this.baseUrl = i),
15
15
  (this._e = s),
16
16
  (this.fn = e),
17
- (this.ft = o),
18
- (this.wt = h),
17
+ (this.ft = h),
18
+ (this.wt = o),
19
19
  (this.u = n),
20
- (this.$h = r),
21
- (this.Do = u),
20
+ (this.fu = r),
21
+ (this.Uo = u),
22
22
  (this.gt = l),
23
23
  (this.cn = t),
24
24
  (this.baseUrl = i),
25
- (this.Kh = 0),
25
+ (this.gu = 0),
26
26
  (this.gE = n.RE() || 0),
27
- (this.Wh = null),
27
+ (this.vu = null),
28
28
  (this._e = s),
29
29
  (this.fn = e),
30
- (this.ft = o),
31
- (this.wt = h),
30
+ (this.ft = h),
31
+ (this.wt = o),
32
32
  (this.u = n),
33
- (this.Do = u),
33
+ (this.Uo = u),
34
34
  (this.gt = l),
35
- (this.$h = r),
36
- (this.Qh = new E()),
37
- (this.Vh = null),
38
- (this.Yh = 50),
39
- (this.Zh = !1);
35
+ (this.fu = r),
36
+ (this.wu = new E()),
37
+ (this.ku = null),
38
+ (this.yu = 50),
39
+ (this.ju = !1);
40
40
  }
41
- fu(t, i) {
42
- return !t && !i && this.Do.Jh() >= this.Yh;
41
+ Su(t, i) {
42
+ return !t && !i && this.Uo.Jh() >= this.yu;
43
43
  }
44
- gu(t) {
44
+ $u(t) {
45
45
  let i = this._e.El();
46
46
  if (t.length > 0) {
47
47
  const s = this.ft.getUserId();
@@ -52,14 +52,14 @@ export default class Rt {
52
52
  }
53
53
  return i;
54
54
  }
55
- vu(t = !1, s = !1, e = !0, o, h, n, u = !1, l = !1) {
56
- e && this.wu();
55
+ qu(t = !1, s = !1, e = !0, h, o, n, u = !1, l = !1) {
56
+ e && this.Au();
57
57
  const a = this.u.cE(),
58
58
  c = this.u.AE();
59
59
  let d = !1;
60
60
  const f = (t, s) => {
61
61
  let r = !1;
62
- T.Ws(this.u, T.Os.Ja, new Date().valueOf()),
62
+ T.Ws(this.u, T.Os.Na, new Date().valueOf()),
63
63
  C.Xs({
64
64
  url: this.baseUrl + "/data/",
65
65
  data: t,
@@ -67,103 +67,103 @@ export default class Rt {
67
67
  O: (e) => {
68
68
  null != t.respond_with &&
69
69
  t.respond_with.triggers &&
70
- (this.Kh = Math.max(this.Kh - 1, 0)),
70
+ (this.gu = Math.max(this.gu - 1, 0)),
71
71
  this.gt.Zs(t, e, s)
72
- ? (this.Do.ti(),
72
+ ? (this.Uo.ti(),
73
73
  this.wt.ul(e),
74
74
  (null != t.respond_with &&
75
75
  t.respond_with.user_id != this.ft.getUserId()) ||
76
- (null != t.device && this.u.D(i.k.Ca, t.device),
76
+ (null != t.device && this.u.D(i.k.Fa, t.device),
77
77
  null != t.sdk_metadata &&
78
- (this.u.D(i.k.Xa, t.sdk_metadata),
79
- this.u.D(i.k.Ea, this._e.Pa())),
80
- this.$h(e),
81
- T.si(this.u, T.Os.Ja, 1),
82
- "function" == typeof o && o()))
78
+ (this.u.D(i.k.Kh, t.sdk_metadata),
79
+ this.u.D(i.k.Wh, this._e.Yh())),
80
+ this.fu(e),
81
+ T.si(this.u, T.Os.Na, 1),
82
+ "function" == typeof h && h()))
83
83
  : e.auth_error && (r = !0);
84
84
  },
85
85
  error: () => {
86
86
  null != t.respond_with &&
87
87
  t.respond_with.triggers &&
88
- (this.Kh = Math.max(this.Kh - 1, 0)),
89
- this.gt.$a(t.events, t.attributes),
90
- "function" == typeof h && h();
88
+ (this.gu = Math.max(this.gu - 1, 0)),
89
+ this.gt.Qh(t.events, t.attributes),
90
+ "function" == typeof o && o();
91
91
  },
92
92
  ei: (t) => {
93
93
  if (("function" == typeof n && n(t), e && !d)) {
94
- if (t && !r) this.ku();
94
+ if (t && !r) this.Cu();
95
95
  else {
96
- T.hi(this.u, T.Os.Ja);
97
- let t = this.Wh;
96
+ T.hi(this.u, T.Os.Na);
97
+ let t = this.vu;
98
98
  (null == t || t < 1e3 * this.gE) && (t = 1e3 * this.gE),
99
- this.ku(Math.min(3e5, D(1e3 * this.gE, 3 * t)));
99
+ this.Cu(Math.min(3e5, D(1e3 * this.gE, 3 * t)));
100
100
  }
101
101
  d = !0;
102
102
  }
103
103
  },
104
104
  });
105
105
  },
106
- m = this.gu(a),
106
+ m = this.$u(a),
107
107
  g = s || m;
108
- if (this.fu(u, m))
108
+ if (this.Su(u, m))
109
109
  return void r.j.info(
110
110
  "Declining to flush data due to 50 consecutive authentication failures",
111
111
  );
112
- if (e && !this.gt.Wa(a, c, t, g))
113
- return this.ku(), void ("function" == typeof n && n(!0));
114
- const v = this.gt.Ya(t, g, a, c, l);
115
- g && this.Kh++;
112
+ if (e && !this.gt.Pa(a, c, t, g))
113
+ return this.Cu(), void ("function" == typeof n && n(!0));
114
+ const v = this.gt.$a(t, g, a, c, l);
115
+ g && this.gu++;
116
116
  let p = !1;
117
117
  if (v)
118
118
  for (const t of v)
119
119
  this.gt.Qs(t.requestData, () => f(t.requestData, t.headers)), (p = !0);
120
- this.Do.wh() && e && !p
121
- ? this.ku()
122
- : m && (r.j.info("Invoking new session subscriptions"), this.Qh.Et());
120
+ this.Uo.wh() && e && !p
121
+ ? this.Cu()
122
+ : m && (r.j.info("Invoking new session subscriptions"), this.wu.Et());
123
123
  }
124
- yu() {
125
- return this.Kh > 0;
124
+ Du() {
125
+ return this.gu > 0;
126
126
  }
127
- ku(t = 1e3 * this.gE) {
128
- this.Zh ||
129
- (this.wu(),
130
- (this.Vh = window.setTimeout(() => {
127
+ Cu(t = 1e3 * this.gE) {
128
+ this.ju ||
129
+ (this.Au(),
130
+ (this.ku = window.setTimeout(() => {
131
131
  if (document.hidden) {
132
132
  const t = "visibilitychange",
133
133
  i = () => {
134
134
  document.hidden ||
135
- (document.removeEventListener(t, i, !1), this.vu());
135
+ (document.removeEventListener(t, i, !1), this.qu());
136
136
  };
137
137
  document.addEventListener(t, i, !1);
138
- } else this.vu();
138
+ } else this.qu();
139
139
  }, t)),
140
- (this.Wh = t));
140
+ (this.vu = t));
141
141
  }
142
- wu() {
143
- null != this.Vh && (clearTimeout(this.Vh), (this.Vh = null));
142
+ Au() {
143
+ null != this.ku && (clearTimeout(this.ku), (this.ku = null));
144
144
  }
145
145
  initialize() {
146
- (this.Zh = !1), this.ku();
146
+ (this.ju = !1), this.Cu();
147
147
  }
148
148
  destroy() {
149
- this.Qh.removeAllSubscriptions(),
150
- this.Do.Gh(),
151
- this.wu(),
152
- (this.Zh = !0),
153
- this.vu(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
154
- (this.Vh = null);
149
+ this.wu.removeAllSubscriptions(),
150
+ this.Uo.Gh(),
151
+ this.Au(),
152
+ (this.ju = !0),
153
+ this.qu(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
154
+ (this.ku = null);
155
155
  }
156
156
  pr(t) {
157
- return this.Qh.lt(t);
157
+ return this.wu.lt(t);
158
158
  }
159
159
  openSession() {
160
- const t = this._e.Pa() !== this._e.co();
161
- t && (this.u.uE(i.eu.Xo), this.u.uE(i.eu.su), this.u.ni(i.k.qi)),
162
- this.vu(void 0, !1, void 0, void 0, void 0),
160
+ const t = this._e.Yh() !== this._e.co();
161
+ t && (this.u.uE(i.eu.Zo), this.u.uE(i.eu.su)),
162
+ this.qu(void 0, !1, void 0, void 0, void 0),
163
163
  this.pu(),
164
164
  t &&
165
165
  import("./Push/push-manager-factory.js").then((t) => {
166
- if (this.Zh) return;
166
+ if (this.ju) return;
167
167
  const s = t.default.m();
168
168
  if (
169
169
  null != s &&
@@ -179,39 +179,43 @@ export default class Rt {
179
179
  e = (i, s) => {
180
180
  s && t();
181
181
  },
182
- o = () => {
182
+ h = () => {
183
183
  const s = this.u.v(i.k.Bn);
184
184
  (null == s || s) && t();
185
185
  },
186
- h = r.zt.Ft;
187
- new r.xt(h, r.j).hr(h.Jt.cu, e, o);
186
+ o = r.zt.Ft;
187
+ new r.xt(o, r.j).hr(o.Jt.cu, e, h);
188
188
  }
189
189
  });
190
190
  }
191
+ Fu() {
192
+ this.u.ni(i.k.Ri), this.u.ni(i.k.Yt), this.u.ni(i.k.rn);
193
+ }
191
194
  changeUser(t, s, e) {
192
- const o = this.ft.getUserId();
193
- if (o !== t) {
195
+ const h = this.ft.getUserId();
196
+ if (h !== t) {
194
197
  this._e.kl(),
195
- null != o && this.vu(void 0, !1, void 0, void 0, void 0),
198
+ this.Fu(),
199
+ null != h && this.qu(void 0, !1, void 0, void 0, void 0),
196
200
  this.ft.ru(t),
197
- e ? this.Do.setSdkAuthenticationSignature(e) : this.Do.yh();
198
- for (let t = 0; t < s.length; t++) s[t].changeUser(null == o);
199
- null != o && this.u.ni(i.k.L),
200
- this.u.ni(i.k.Ca),
201
+ e ? this.Uo.setSdkAuthenticationSignature(e) : this.Uo.yh();
202
+ for (let t = 0; t < s.length; t++) s[t].changeUser(null == h);
203
+ null != h && this.u.ni(i.k.L),
204
+ this.u.ni(i.k.Fa),
201
205
  this.openSession(),
202
206
  r.j.info('Changed user to "' + t + '".');
203
207
  } else {
204
208
  let i = "Doing nothing.";
205
209
  e &&
206
- this.Do.jh() !== e &&
207
- (this.Do.setSdkAuthenticationSignature(e),
210
+ this.Uo.jh() !== e &&
211
+ (this.Uo.setSdkAuthenticationSignature(e),
208
212
  (i = "Updated SDK authentication signature")),
209
213
  r.j.info(`Current user is already ${t}. ${i}`);
210
214
  }
211
215
  }
212
216
  requestImmediateDataFlush(t) {
213
- this.wu(), this._e.co();
214
- this.vu(
217
+ this.Au(), this._e.co();
218
+ this.qu(
215
219
  void 0,
216
220
  void 0,
217
221
  void 0,
@@ -226,38 +230,38 @@ export default class Rt {
226
230
  );
227
231
  }
228
232
  requestFeedRefresh() {
229
- this._e.co(), this.vu(!0);
233
+ this._e.co(), this.qu(!0);
230
234
  }
231
235
  $r(t, i) {
232
236
  this._e.co(),
233
237
  r.j.info("Requesting explicit trigger refresh."),
234
- this.vu(void 0, !0, void 0, t, i);
238
+ this.qu(void 0, !0, void 0, t, i);
235
239
  }
236
240
  $n(t, i) {
237
- const e = r.q.ju,
238
- o = { a: t, l: i },
239
- h = s.N(e, o);
240
- return h && r.j.info(`Logged alias ${t} with label ${i}`), h;
241
+ const e = r.q.Tu,
242
+ h = { a: t, l: i },
243
+ o = s.N(e, h);
244
+ return o && r.j.info(`Logged alias ${t} with label ${i}`), o;
241
245
  }
242
- Gn(i, e, o) {
246
+ Gn(i, e, h) {
243
247
  if (this.wt.hu(e))
244
248
  return (
245
249
  r.j.info(`Custom Attribute "${e}" is blocklisted, ignoring.`), new t()
246
250
  );
247
- const h = { key: e, value: o },
248
- n = s.N(i, h);
251
+ const o = { key: e, value: h },
252
+ n = s.N(i, o);
249
253
  if (n) {
250
- const t = "object" == typeof o ? JSON.stringify(o, null, 2) : o;
254
+ const t = "object" == typeof h ? JSON.stringify(h, null, 2) : h;
251
255
  r.j.info(`Logged custom attribute: ${e} with value: ${t}`);
252
256
  }
253
257
  return n;
254
258
  }
255
- setLastKnownLocation(t, i, e, o, h, n) {
259
+ setLastKnownLocation(t, i, e, h, o, n) {
256
260
  const u = { latitude: i, longitude: e };
257
- null != o && (u.altitude = o),
258
- null != h && (u.ll_accuracy = h),
261
+ null != h && (u.altitude = h),
262
+ null != o && (u.ll_accuracy = o),
259
263
  null != n && (u.alt_accuracy = n);
260
- const l = s.N(r.q.Su, u, t || void 0);
264
+ const l = s.N(r.q.Lu, u, t || void 0);
261
265
  return (
262
266
  l &&
263
267
  r.j.info(
@@ -268,40 +272,40 @@ export default class Rt {
268
272
  }
269
273
  vr(t, i) {
270
274
  const s = this._e.co();
271
- return new be(this.ft.getUserId(), r.q.$u, t, s, { cid: i });
275
+ return new be(this.ft.getUserId(), r.q.Mu, t, s, { cid: i });
272
276
  }
273
277
  pu() {
274
278
  const t = r.zt.Ft;
275
- new r.xt(t, r.j).setItem(t.Jt.Ja, 1, {
279
+ new r.xt(t, r.j).setItem(t.Jt.Na, 1, {
276
280
  baseUrl: this.baseUrl,
277
281
  data: { api_key: this.cn, device_id: this.fn.ce().id },
278
282
  userId: this.ft.getUserId(),
279
- sdkAuthEnabled: this.Do.wh(),
283
+ sdkAuthEnabled: this.Uo.wh(),
280
284
  });
281
285
  }
282
286
  yr(t) {
283
287
  for (const i of t)
284
- if (i.api_key === this.cn) this.gt.$a(i.events, i.attributes);
288
+ if (i.api_key === this.cn) this.gt.Qh(i.events, i.attributes);
285
289
  else {
286
290
  const t = r.zt.Ft;
287
291
  new r.xt(t, r.j).setItem(t.Jt.wr, r.Z.Y(), i);
288
292
  }
289
293
  }
290
- Zn(i, e, o) {
294
+ Zn(i, e, h) {
291
295
  if (this.wt.hu(i))
292
296
  return (
293
297
  r.j.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new t()
294
298
  );
295
- let h, n;
299
+ let o, n;
296
300
  return (
297
- null === e && null === o
298
- ? ((h = r.q.qu), (n = { key: i }))
299
- : ((h = r.q.Au), (n = { key: i, latitude: e, longitude: o })),
300
- s.N(h, n)
301
+ null === e && null === h
302
+ ? ((o = r.q.Pu), (n = { key: i }))
303
+ : ((o = r.q.Ru), (n = { key: i, latitude: e, longitude: h })),
304
+ s.N(o, n)
301
305
  );
302
306
  }
303
307
  au(t, i) {
304
308
  const e = { group_id: t, status: i };
305
- return s.N(r.q.Cu, e);
309
+ return s.N(r.q.Nu, e);
306
310
  }
307
311
  }
@@ -1,4 +1,4 @@
1
- import { isDate as Nt } from "../../util/code-utils.js";
1
+ import { isDate as yt } from "../../util/code-utils.js";
2
2
  import {
3
3
  convertMsToSeconds as h,
4
4
  dateFromUnixTimestamp as l,
@@ -33,13 +33,13 @@ export default class sr {
33
33
  return null != s && typeof s == typeof this._l && s > this._l;
34
34
  case sr.Il.Ll:
35
35
  return this.Al === sr.Rl.Ml
36
- ? null != s && Nt(s) && ts(s) <= this._l.valueOf()
36
+ ? null != s && yt(s) && ts(s) <= this._l.valueOf()
37
37
  : null != s && typeof s == typeof this._l && s >= this._l;
38
38
  case sr.Il.Pl:
39
39
  return null != s && typeof s == typeof this._l && s < this._l;
40
40
  case sr.Il.Ol:
41
41
  return this.Al === sr.Rl.Ml
42
- ? null != s && Nt(s) && ts(s) >= this._l.valueOf()
42
+ ? null != s && yt(s) && ts(s) >= this._l.valueOf()
43
43
  : null != s && typeof s == typeof this._l && s <= this._l;
44
44
  case sr.Il.Yl:
45
45
  return (
@@ -53,9 +53,9 @@ export default class sr {
53
53
  case sr.Il.$l:
54
54
  return null == s;
55
55
  case sr.Il.Ul:
56
- return null != s && Nt(s) && es(s) < this._l;
56
+ return null != s && yt(s) && es(s) < this._l;
57
57
  case sr.Il.Ql:
58
- return null != s && Nt(s) && es(s) > this._l;
58
+ return null != s && yt(s) && es(s) > this._l;
59
59
  case sr.Il.Eu:
60
60
  return (
61
61
  null == s ||
@@ -77,7 +77,7 @@ export default class sr {
77
77
  ss() {
78
78
  let t = this._l;
79
79
  return (
80
- Nt(this._l) && (t = h(t.valueOf())),
80
+ yt(this._l) && (t = h(t.valueOf())),
81
81
  { k: this.Tl, t: this.Al, c: this.comparator, v: t }
82
82
  );
83
83
  }
@@ -85,7 +85,7 @@ export default class sr {
85
85
  return new sr(t.k, t.t, t.c, t.v);
86
86
  }
87
87
  }
88
- (sr.Rl = { Tu: "boolean", _u: "number", Nu: "string", Ml: "date" }),
88
+ (sr.Rl = { _u: "boolean", Hu: "number", Iu: "string", Ml: "date" }),
89
89
  (sr.Il = {
90
90
  Xl: 1,
91
91
  Fl: 2,
@@ -12,8 +12,8 @@ export default class ri {
12
12
  constructor(e, t) {
13
13
  (this.type = e), (this.data = t), (this.type = e), (this.data = t);
14
14
  }
15
- sc(e, t) {
16
- return ri.cc[this.type] === e && (null == this.data || this.data.Bl(t));
15
+ ec(e, t) {
16
+ return ri.rc[this.type] === e && (null == this.data || this.data.Bl(t));
17
17
  }
18
18
  static Bu(e, t) {
19
19
  let s = null;
@@ -36,7 +36,7 @@ export default class ri {
36
36
  case ri.Wr.Rr:
37
37
  r = rs.fromJson(e.data);
38
38
  break;
39
- case ri.Wr.nc:
39
+ case ri.Wr.sc:
40
40
  r = is.fromJson(e.data);
41
41
  break;
42
42
  case ri.Wr.zr:
@@ -45,7 +45,7 @@ export default class ri {
45
45
  case ri.Wr.$e:
46
46
  r = Qt.fromJson(e.data);
47
47
  break;
48
- case ri.Wr.lc:
48
+ case ri.Wr.ac:
49
49
  r = Zt.fromJson(e.data);
50
50
  break;
51
51
  case ri.Wr.ro:
@@ -66,7 +66,7 @@ export default class ri {
66
66
  case ri.Wr.Rr:
67
67
  r = new rs(e.d);
68
68
  break;
69
- case ri.Wr.nc:
69
+ case ri.Wr.sc:
70
70
  (t = e.d || {}), (r = new is(t.id, Yt.Yn(t.pf || [])));
71
71
  break;
72
72
  case ri.Wr.zr:
@@ -75,7 +75,7 @@ export default class ri {
75
75
  case ri.Wr.$e:
76
76
  r = new Qt(e.d);
77
77
  break;
78
- case ri.Wr.lc:
78
+ case ri.Wr.ac:
79
79
  (t = e.d || {}), (r = new Zt(t.e, Yt.Yn(t.pf || [])));
80
80
  break;
81
81
  case ri.Wr.ro:
@@ -87,19 +87,19 @@ export default class ri {
87
87
  (ri.Wr = {
88
88
  OPEN: "open",
89
89
  Rr: "purchase",
90
- nc: "purchase_property",
90
+ sc: "purchase_property",
91
91
  zr: "push_click",
92
92
  $e: "custom_event",
93
- lc: "custom_event_property",
93
+ ac: "custom_event_property",
94
94
  ro: "iam_click",
95
95
  zs: "test",
96
96
  }),
97
- (ri.cc = {}),
98
- (ri.cc[ri.Wr.OPEN] = tt.OPEN),
99
- (ri.cc[ri.Wr.Rr] = tt.Rr),
100
- (ri.cc[ri.Wr.nc] = tt.Rr),
101
- (ri.cc[ri.Wr.zr] = tt.zr),
102
- (ri.cc[ri.Wr.$e] = tt.$e),
103
- (ri.cc[ri.Wr.lc] = tt.$e),
104
- (ri.cc[ri.Wr.ro] = tt.ro),
105
- (ri.cc[ri.Wr.zs] = tt.zs);
97
+ (ri.rc = {}),
98
+ (ri.rc[ri.Wr.OPEN] = tt.OPEN),
99
+ (ri.rc[ri.Wr.Rr] = tt.Rr),
100
+ (ri.rc[ri.Wr.sc] = tt.Rr),
101
+ (ri.rc[ri.Wr.zr] = tt.zr),
102
+ (ri.rc[ri.Wr.$e] = tt.$e),
103
+ (ri.rc[ri.Wr.ac] = tt.$e),
104
+ (ri.rc[ri.Wr.ro] = tt.ro),
105
+ (ri.rc[ri.Wr.zs] = tt.zs);
@@ -6,48 +6,48 @@ import r from "../../../shared-lib/braze-shared-lib.js";
6
6
  import ri from "./trigger-condition.js";
7
7
  import { validateValueIsFromEnum as H } from "../../util/code-utils.js";
8
8
  export default class mt {
9
- constructor(t, i = [], s, e, r = 0, h, l, o = 0, n = mt.Du, a, u, d) {
9
+ constructor(t, i = [], s, e, r = 0, h, l, o = 0, n = mt.Ju, a, u, d) {
10
10
  (this.id = t),
11
- (this.Pu = i),
11
+ (this.Vu = i),
12
12
  (this.startTime = s),
13
13
  (this.endTime = e),
14
14
  (this.priority = r),
15
15
  (this.type = h),
16
16
  (this.data = l),
17
- (this.Iu = o),
18
- (this.Mu = n),
17
+ (this.Gu = o),
18
+ (this.Ku = n),
19
19
  (this.sn = a),
20
- (this.Fu = u),
21
- (this.Hu = d),
20
+ (this.Ou = u),
21
+ (this.Qu = d),
22
22
  (this.id = t),
23
- (this.Pu = i || []),
23
+ (this.Vu = i || []),
24
24
  void 0 === s && (s = null),
25
25
  (this.startTime = s),
26
26
  void 0 === e && (e = null),
27
27
  (this.endTime = e),
28
28
  (this.priority = r || 0),
29
29
  (this.type = h),
30
- (this.Iu = o || 0),
31
- null == a && (a = 1e3 * (this.Iu + 30)),
30
+ (this.Gu = o || 0),
31
+ null == a && (a = 1e3 * (this.Gu + 30)),
32
32
  (this.sn = a),
33
33
  (this.data = l),
34
- null != n && (this.Mu = n),
35
- (this.Fu = u),
36
- (this.Hu = d || null);
34
+ null != n && (this.Ku = n),
35
+ (this.Ou = u),
36
+ (this.Qu = d || null);
37
37
  }
38
- Ju(t) {
38
+ Uu(t) {
39
39
  return (
40
- null == this.Hu || (this.Mu !== mt.Du && t - this.Hu >= 1e3 * this.Mu)
40
+ null == this.Qu || (this.Ku !== mt.Ju && t - this.Qu >= 1e3 * this.Ku)
41
41
  );
42
42
  }
43
- Lu(t) {
44
- this.Hu = t;
43
+ Wu(t) {
44
+ this.Qu = t;
45
45
  }
46
- Ru(t) {
47
- const i = t + 1e3 * this.Iu;
46
+ Xu(t) {
47
+ const i = t + 1e3 * this.Gu;
48
48
  return Math.max(i - new Date().valueOf(), 0);
49
49
  }
50
- Vu(t) {
50
+ Yu(t) {
51
51
  const i = new Date().valueOf() - t,
52
52
  s = null == t || isNaN(i) || null == this.sn || i < this.sn;
53
53
  return (
@@ -83,7 +83,7 @@ export default class mt {
83
83
  }
84
84
  ss() {
85
85
  const t = [];
86
- for (let i = 0; i < this.Pu.length; i++) t.push(this.Pu[i].ss());
86
+ for (let i = 0; i < this.Vu.length; i++) t.push(this.Vu[i].ss());
87
87
  return {
88
88
  i: this.id,
89
89
  c: t,
@@ -92,11 +92,11 @@ export default class mt {
92
92
  p: this.priority,
93
93
  t: this.type,
94
94
  da: this.data,
95
- d: this.Iu,
96
- r: this.Mu,
95
+ d: this.Gu,
96
+ r: this.Ku,
97
97
  tm: this.sn,
98
- ss: this.Fu,
99
- ld: this.Hu,
98
+ ss: this.Ou,
99
+ ld: this.Qu,
100
100
  };
101
101
  }
102
102
  static Yn(t) {
@@ -119,4 +119,4 @@ export default class mt {
119
119
  );
120
120
  }
121
121
  }
122
- (mt.Wr = { Vr: "inapp", Gu: "templated_iam" }), (mt.Du = -1);
122
+ (mt.Wr = { Vr: "inapp", Zu: "templated_iam" }), (mt.Ju = -1);