@braze/web-sdk 6.11.0 → 6.12.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 (102) hide show
  1. package/index.d.ts +36 -5
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +4 -4
  4. package/shared-lib/indexed-db-adapter.js +51 -51
  5. package/shared-lib/logger.js +7 -7
  6. package/shared-lib/supported-options.js +9 -9
  7. package/src/DUST/dust-config-store.js +89 -0
  8. package/src/DUST/dust-connection-core.js +7 -21
  9. package/src/DUST/dust-message-dedup.js +33 -0
  10. package/src/DUST/dust-provider.js +367 -397
  11. package/src/DUST/dust-tab-identity.js +30 -0
  12. package/src/DUST/index.js +7 -9
  13. package/src/DUST/subscribe-to-dust.js +5 -5
  14. package/src/FeatureFlags/feature-flag-factory.js +4 -4
  15. package/src/FeatureFlags/feature-flag.js +5 -5
  16. package/src/FeatureFlags/feature-flags-provider-factory.js +8 -1
  17. package/src/FeatureFlags/feature-flags-provider.js +74 -74
  18. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  19. package/src/FeatureFlags/get-feature-flag.js +2 -2
  20. package/src/FeatureFlags/log-feature-flag-impression.js +3 -3
  21. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
  22. package/src/InAppMessage/defer-in-app-message.js +2 -2
  23. package/src/InAppMessage/display/get-animation-effect.js +1 -1
  24. package/src/InAppMessage/display/html-message-display-utils.js +4 -4
  25. package/src/InAppMessage/display/html-message-to-html.js +10 -10
  26. package/src/InAppMessage/display/in-app-message-to-html.js +42 -42
  27. package/src/InAppMessage/display/modal-utils.js +14 -14
  28. package/src/InAppMessage/get-deferred-in-app-message.js +2 -2
  29. package/src/InAppMessage/in-app-message-factory.js +6 -6
  30. package/src/InAppMessage/in-app-message-manager-factory.js +5 -5
  31. package/src/InAppMessage/in-app-message-manager.js +73 -73
  32. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  33. package/src/InAppMessage/log-in-app-message-click.js +2 -2
  34. package/src/InAppMessage/log-in-app-message-html-click.js +2 -2
  35. package/src/InAppMessage/log-in-app-message-impression.js +2 -2
  36. package/src/InAppMessage/models/full-screen-message.js +9 -9
  37. package/src/InAppMessage/models/html-message.js +4 -4
  38. package/src/InAppMessage/models/in-app-message-button.js +2 -2
  39. package/src/InAppMessage/models/in-app-message.js +52 -52
  40. package/src/InAppMessage/models/modal-message.js +7 -7
  41. package/src/InAppMessage/models/slide-up-message.js +11 -11
  42. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  43. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  44. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +5 -5
  45. package/src/InAppMessage/ui/show-in-app-message.js +36 -36
  46. package/src/Push/is-push-blocked.js +2 -2
  47. package/src/Push/is-push-permission-granted.js +2 -2
  48. package/src/Push/is-push-supported.js +2 -2
  49. package/src/Push/push-manager-factory.js +6 -6
  50. package/src/Push/push-manager.js +14 -14
  51. package/src/Push/unregister-push-token-on-server.js +3 -3
  52. package/src/Push/utils/push-utils.js +10 -10
  53. package/src/User/user.js +19 -19
  54. package/src/common/content-cards-display.js +21 -21
  55. package/src/common/event-logger.js +2 -2
  56. package/src/l10n/l10n-manager-factory.js +7 -7
  57. package/src/l10n/l10n-manager.js +5 -5
  58. package/src/managers/auth-manager.js +1 -1
  59. package/src/managers/braze-instance.js +41 -41
  60. package/src/managers/device-manager.js +22 -22
  61. package/src/managers/network-manager.js +108 -108
  62. package/src/managers/server-config-manager.js +83 -83
  63. package/src/managers/session-manager.js +6 -6
  64. package/src/managers/storage-manager-factory.js +4 -4
  65. package/src/managers/storage-manager.js +127 -125
  66. package/src/managers/subscription-manager.js +1 -1
  67. package/src/managers/utils.js +1 -1
  68. package/src/models/backend-errors.js +5 -5
  69. package/src/models/braze-event.js +7 -7
  70. package/src/models/device.js +3 -3
  71. package/src/models/identifier.js +3 -3
  72. package/src/models/push-token.js +3 -3
  73. package/src/models/server-config.js +31 -31
  74. package/src/request-controller.js +39 -39
  75. package/src/triggers/models/filter.js +58 -58
  76. package/src/triggers/models/in-app-message-click-data.js +4 -4
  77. package/src/triggers/models/push-click-data.js +2 -2
  78. package/src/triggers/models/trigger-condition.js +35 -35
  79. package/src/triggers/models/trigger.js +37 -37
  80. package/src/triggers/triggers-provider-factory.js +3 -3
  81. package/src/triggers/triggers-provider.js +50 -50
  82. package/src/types.js +2 -2
  83. package/src/ui/js/attach-css.js +1 -1
  84. package/src/ui/js/feed-css.js +2 -2
  85. package/src/ui/js/iam-css.js +2 -2
  86. package/src/util/base-device-parser.js +2 -2
  87. package/src/util/braze-actions.js +2 -2
  88. package/src/util/browser-detector.js +15 -15
  89. package/src/util/client-hints-parser.js +5 -5
  90. package/src/util/component-utils.js +4 -4
  91. package/src/util/dom-utils.js +5 -5
  92. package/src/util/ecommerce-event-validation.js +77 -48
  93. package/src/util/key-codes.js +1 -1
  94. package/src/util/net.js +4 -4
  95. package/src/util/request-header-utils.js +20 -20
  96. package/src/util/string-utils.js +5 -0
  97. package/src/util/user-agent-parser.js +18 -18
  98. package/src/util/validation-utils.js +4 -4
  99. package/src/util/window-utils.js +2 -2
  100. package/src/DUST/dust-shared-worker-code.js +0 -2
  101. package/src/DUST/dust-shared-worker-impl.js +0 -234
  102. package/src/DUST/dust-worker-bridge.js +0 -151
@@ -5,12 +5,12 @@ export default class ui {
5
5
  (this.Uu = i),
6
6
  (this.publicKey = s),
7
7
  (this.sc = l),
8
- (this.gd = h),
8
+ (this.ld = h),
9
9
  (this.endpoint = t || null),
10
10
  (this.Uu = i || null),
11
11
  (this.publicKey = s || null),
12
12
  (this.sc = l || null),
13
- (this.gd = h || null);
13
+ (this.ld = h || null);
14
14
  }
15
15
  qt() {
16
16
  return {
@@ -18,7 +18,7 @@ export default class ui {
18
18
  c: this.Uu,
19
19
  p: this.publicKey,
20
20
  u: this.sc,
21
- v: this.gd,
21
+ v: this.ld,
22
22
  };
23
23
  }
24
24
  static _u(t) {
@@ -1,8 +1,8 @@
1
1
  import {
2
- GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as mi,
3
- GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as fi,
2
+ GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as _i,
3
+ GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as bi,
4
4
  } from "../common/constants.js";
5
- export default class di {
5
+ export default class vi {
6
6
  constructor(
7
7
  t = 0,
8
8
  i = [],
@@ -12,52 +12,52 @@ export default class di {
12
12
  e = null,
13
13
  r = { enabled: !1 },
14
14
  n = { enabled: !1, refresh_rate_limit: void 0 },
15
- a = { enabled: !0, capacity: mi, refill_rate: fi, endpoint_overrides: {} },
15
+ a = { enabled: !0, capacity: _i, refill_rate: bi, endpoint_overrides: {} },
16
16
  o = null,
17
17
  u = null,
18
18
  c = null,
19
19
  d = null,
20
20
  m = null,
21
21
  ) {
22
- (this.dd = t),
23
- (this.Cd = i),
24
- (this.Ed = s),
25
- (this.wd = h),
26
- (this.Td = l),
27
- (this.gd = e),
28
- (this.bd = r),
29
- (this.Xr = n),
30
- (this.md = a),
22
+ (this.ed = t),
23
+ (this.vd = i),
24
+ (this.md = s),
25
+ (this.gd = h),
26
+ (this.fd = l),
27
+ (this.ld = e),
28
+ (this.ud = r),
29
+ (this.Rr = n),
30
+ (this.nd = a),
31
31
  (this.banners = o),
32
32
  (this.dust = u),
33
- (this.Sd = c),
34
- (this.Ld = d),
35
- (this.fd = m);
33
+ (this.Cd = c),
34
+ (this.wd = d),
35
+ (this.ad = m);
36
36
  }
37
37
  qt() {
38
38
  return {
39
- s: "6.11.0",
40
- l: this.dd,
41
- e: this.Cd,
42
- a: this.Ed,
43
- p: this.wd,
44
- m: this.Td,
45
- v: this.gd,
46
- c: this.bd,
47
- f: this.Xr,
48
- grl: this.md,
39
+ s: "6.12.0",
40
+ l: this.ed,
41
+ e: this.vd,
42
+ a: this.md,
43
+ p: this.gd,
44
+ m: this.fd,
45
+ v: this.ld,
46
+ c: this.ud,
47
+ f: this.Rr,
48
+ grl: this.nd,
49
49
  b: this.banners,
50
50
  d: this.dust,
51
- rb: this.Sd,
52
- mst: this.Ld,
53
- ch: this.fd,
51
+ rb: this.Cd,
52
+ mst: this.wd,
53
+ ch: this.ad,
54
54
  };
55
55
  }
56
56
  static _u(t) {
57
57
  let i = t.l;
58
58
  return (
59
- "6.11.0" !== t.s && (i = 0),
60
- new di(
59
+ "6.12.0" !== t.s && (i = 0),
60
+ new vi(
61
61
  i,
62
62
  t.e,
63
63
  t.a,
@@ -8,13 +8,13 @@ import v from "./common/event-logger.js";
8
8
  import { removeAllVisibleInAppMessages as gi } from "./InAppMessage/ui/remove-all-visible-in-app-messages.js";
9
9
  import { STORAGE_KEYS as s } from "./managers/storage-manager.js";
10
10
  import f from "./managers/subscription-manager.js";
11
- import Ie from "./models/braze-event.js";
11
+ import ve from "./models/braze-event.js";
12
12
  import L from "./models/request-result.js";
13
- import It from "./Push/utils/push-utils.js";
13
+ import Dt from "./Push/utils/push-utils.js";
14
14
  import { randomInclusive as a } from "./util/math.js";
15
15
  import l from "./util/net.js";
16
16
  import h from "./util/request-header-utils.js";
17
- export default class Kt {
17
+ export default class Zt {
18
18
  constructor(t, i, s, e, h, o, n, r, l, u) {
19
19
  (this.eu = t),
20
20
  (this.baseUrl = i),
@@ -29,7 +29,7 @@ export default class Kt {
29
29
  (this.eu = t),
30
30
  (this.baseUrl = i),
31
31
  (this.nc = 0),
32
- (this.TS = n.cS() || 0),
32
+ (this.fS = n.bS() || 0),
33
33
  (this.lc = null),
34
34
  (this.C = s),
35
35
  (this.tu = e),
@@ -61,12 +61,12 @@ export default class Kt {
61
61
  }
62
62
  bc(t = !1, i = !0, e, o, n, r = !1, u = !1, c = "sdk") {
63
63
  i && this.wc();
64
- const d = this.j.SS(),
65
- m = this.j.uS();
64
+ const d = this.j.gS(),
65
+ m = this.j.IS();
66
66
  let f = !1;
67
67
  const g = (t, r, u = -1) => {
68
68
  const c = new Date().valueOf();
69
- h.nt(this.j, h.it.pn, c),
69
+ h.nt(this.j, h.it.Cn, c),
70
70
  -1 !== u && r.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
71
71
  let d = !1;
72
72
  l.ot({
@@ -79,15 +79,15 @@ export default class Kt {
79
79
  (this.nc = Math.max(this.nc - 1, 0)),
80
80
  this.B.ut(t, i, r)
81
81
  ? (this.Gh.ct(),
82
- this.h.vd(i),
82
+ this.h.sd(i),
83
83
  (null != t.respond_with &&
84
84
  t.respond_with.user_id != this.Ss.getUserId()) ||
85
- (null != t.device && this.j.Pt(s.It.La, t.device),
85
+ (null != t.device && this.j.Pt(s.It.Aa, t.device),
86
86
  null != t.sdk_metadata &&
87
- (this.j.Pt(s.It.Qa, t.sdk_metadata),
88
- this.j.Pt(s.It.Va, this.C.$t())),
87
+ (this.j.Pt(s.It.Ka, t.sdk_metadata),
88
+ this.j.Pt(s.It.Pa, this.C.$t())),
89
89
  this.hc(i),
90
- h.Nl(this.j, h.it.pn, 1),
90
+ h.ql(this.j, h.it.Cn, 1),
91
91
  "function" == typeof e && e()))
92
92
  : i.auth_error && (d = !0);
93
93
  },
@@ -96,12 +96,12 @@ export default class Kt {
96
96
  null != t.respond_with &&
97
97
  t.respond_with.triggers &&
98
98
  (this.nc = Math.max(this.nc - 1, 0)),
99
- this.B.Za(t.events, t.attributes),
99
+ this.B.Ua(t.events, t.attributes),
100
100
  "function" == typeof o && o();
101
101
  },
102
102
  ft: (t, s) => {
103
103
  "function" == typeof n && n(!d);
104
- const e = this.B.$l(s);
104
+ const e = this.B.Bl(s);
105
105
  let o = 0;
106
106
  if (e)
107
107
  switch (e.type) {
@@ -113,7 +113,7 @@ export default class Kt {
113
113
  }
114
114
  if (i && !f) {
115
115
  if (d) {
116
- h.Ll(this.j, h.it.pn);
116
+ h.Sl(this.j, h.it.Cn);
117
117
  const t = this.h.vt(),
118
118
  i = this.h.gt(),
119
119
  s = this.h.bt();
@@ -121,7 +121,7 @@ export default class Kt {
121
121
  (null == e || e < t) && (e = t);
122
122
  const n = Math.min(s, a(t, e * i)) + o;
123
123
  this.kc(n);
124
- } else this.kc(Math.max(1e3 * this.TS, o));
124
+ } else this.kc(Math.max(1e3 * this.fS, o));
125
125
  f = !0;
126
126
  }
127
127
  },
@@ -133,9 +133,9 @@ export default class Kt {
133
133
  return void b.info(
134
134
  "Declining to flush data due to 50 consecutive authentication failures",
135
135
  );
136
- if (i && !this.B.bl(d, m, v))
136
+ if (i && !this.B.Za(d, m, v))
137
137
  return this.kc(), void ("function" == typeof n && n(!0));
138
- const w = this.B.ql(v, d, m, u, c);
138
+ const w = this.B.dl(v, d, m, u, c);
139
139
  v && this.nc++;
140
140
  let k = !1;
141
141
  if (w)
@@ -143,7 +143,7 @@ export default class Kt {
143
143
  this.B.et(
144
144
  t.requestData,
145
145
  (i) => g(t.requestData, t.headers, i),
146
- h.it.pn,
146
+ h.it.Cn,
147
147
  o,
148
148
  ),
149
149
  (k = !0);
@@ -157,7 +157,7 @@ export default class Kt {
157
157
  yc() {
158
158
  return this.nc > 0;
159
159
  }
160
- kc(t = 1e3 * this.TS) {
160
+ kc(t = 1e3 * this.fS) {
161
161
  this.mc ||
162
162
  (this.wc(),
163
163
  (this.cc = window.setTimeout(() => {
@@ -193,18 +193,18 @@ export default class Kt {
193
193
  }
194
194
  openSession() {
195
195
  const t = this.C.$t() !== this.C.el();
196
- t && (this.j.iS(s.Ou.Wh), this.j.iS(s.Ou.Cu)),
196
+ t && (this.j.hS(s.Ou.Wh), this.j.hS(s.Ou.Cu)),
197
197
  this.bc(!1, void 0, () => {
198
- t && (this.j.Vt(s.It.jo), this.j.Vt(s.It.At));
198
+ t && (this.j.Vt(s.It.Zr), this.j.Vt(s.It.At));
199
199
  }),
200
- this.Ua(),
200
+ this.Ea(),
201
201
  t &&
202
202
  import("./Push/push-manager-factory.js").then((t) => {
203
203
  if (this.mc) return;
204
204
  const i = t.default.ra();
205
205
  if (
206
206
  null != i &&
207
- (It.isPushPermissionGranted() || It.isPushBlocked())
207
+ (Dt.isPushPermissionGranted() || Dt.isPushBlocked())
208
208
  ) {
209
209
  const t = () => {
210
210
  i.lu()
@@ -226,13 +226,13 @@ export default class Kt {
226
226
  });
227
227
  }
228
228
  jc() {
229
- this.j.Vt(s.It.Fo), this.j.Vt(s.It.bi), this.j.Vt(s.It.fa);
229
+ this.j.Vt(s.It.Vr), this.j.Vt(s.It.bi), this.j.Vt(s.It.la);
230
230
  }
231
231
  Sc() {
232
- this.j.Vt(s.It.Ml),
233
- this.j.Vt(s.It.sS),
234
- this.j.Vt(s.It.Fl),
235
- this.j.Vt(s.It.Pl);
232
+ this.j.Vt(s.It.wl),
233
+ this.j.Vt(s.It.lS),
234
+ this.j.Vt(s.It.zl),
235
+ this.j.Vt(s.It.Xl);
236
236
  }
237
237
  changeUser(t, i, e) {
238
238
  const h = this.Ss.getUserId();
@@ -245,9 +245,9 @@ export default class Kt {
245
245
  e ? this.Gh.setSdkAuthenticationSignature(e) : this.Gh.jh();
246
246
  for (let t = 0; t < i.length; t++) i[t].changeUser(null == h);
247
247
  this.B.fo(),
248
- null != h && this.j.Vt(s.It.VE),
249
- this.j.Vt(s.It.La),
250
- this.j.Vt(s.It.oS),
248
+ null != h && this.j.Vt(s.It.rS),
249
+ this.j.Vt(s.It.Aa),
250
+ this.j.Vt(s.It.uS),
251
251
  this.Sc(),
252
252
  this.openSession(),
253
253
  b.info('Changed user to "' + t + '".');
@@ -283,7 +283,7 @@ export default class Kt {
283
283
  h = { a: t, l: i },
284
284
  o = v.Dt(e, h);
285
285
  return (
286
- o && (b.info(`Logged alias ${t} with label ${i}`), this.j.Pt(s.It.oS, h)),
286
+ o && (b.info(`Logged alias ${t} with label ${i}`), this.j.Pt(s.It.uS, h)),
287
287
  o
288
288
  );
289
289
  }
@@ -314,14 +314,14 @@ export default class Kt {
314
314
  }
315
315
  Fr(t, i) {
316
316
  const s = this.C.el();
317
- return new Ie(this.Ss.getUserId(), p.$c, t, s, { cid: i });
317
+ return new ve(this.Ss.getUserId(), p.$c, t, s, { cid: i });
318
318
  }
319
319
  qc(t, i) {
320
320
  return new et(t, i);
321
321
  }
322
- Ua() {
322
+ Ea() {
323
323
  const t = et._s.Xs;
324
- this.qc(t, b).setItem(t.Ws.pn, 1, {
324
+ this.qc(t, b).setItem(t.Ws.Cn, 1, {
325
325
  baseUrl: this.baseUrl,
326
326
  data: { api_key: this.eu, device_id: this.tu.ve().id },
327
327
  userId: this.Ss.getUserId(),
@@ -330,13 +330,13 @@ export default class Kt {
330
330
  }
331
331
  Dr(t) {
332
332
  for (const i of t)
333
- if (i.api_key === this.eu) this.B.Za(i.events, i.attributes);
333
+ if (i.api_key === this.eu) this.B.Ua(i.events, i.attributes);
334
334
  else {
335
335
  const t = et._s.Xs;
336
336
  new et(t, b).setItem(t.Ws.Br, V.de(), i);
337
337
  }
338
338
  }
339
- Ia(t, i, s) {
339
+ ya(t, i, s) {
340
340
  if (this.h.zu(t))
341
341
  return (
342
342
  b.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new L()
@@ -349,7 +349,7 @@ export default class Kt {
349
349
  v.Dt(e, h)
350
350
  );
351
351
  }
352
- Ca(t, i) {
352
+ va(t, i) {
353
353
  const s = { group_id: t, status: i };
354
354
  return v.Dt(p.Tc, s);
355
355
  }
@@ -7,61 +7,61 @@ import {
7
7
  } from "../../util/date-utils.js";
8
8
  export default class hr {
9
9
  constructor(t, s, e, i) {
10
- (this.tT = t),
11
- (this.sT = s),
10
+ (this.zE = t),
11
+ (this.kE = s),
12
12
  (this.comparator = e),
13
- (this.eT = i),
14
- (this.tT = t),
15
- (this.sT = s),
13
+ (this.vE = i),
14
+ (this.zE = t),
15
+ (this.kE = s),
16
16
  (this.comparator = e),
17
- (this.eT = i),
18
- this.sT === hr.lT.iT &&
19
- this.comparator !== hr.hT.rT &&
20
- this.comparator !== hr.hT.nT &&
21
- this.comparator !== hr.hT.uT &&
22
- this.comparator !== hr.hT.oT &&
23
- (this.eT = Y(this.eT));
17
+ (this.vE = i),
18
+ this.kE === hr.VE.JE &&
19
+ this.comparator !== hr.ZE.qE &&
20
+ this.comparator !== hr.ZE.$E &&
21
+ this.comparator !== hr.ZE.tT &&
22
+ this.comparator !== hr.ZE.sT &&
23
+ (this.vE = Y(this.vE));
24
24
  }
25
25
  zc(t) {
26
26
  let s = null;
27
- switch ((null != t && (s = t[this.tT]), this.comparator)) {
28
- case hr.hT.ET:
29
- return null != s && s.valueOf() === this.eT.valueOf();
30
- case hr.hT.aT:
31
- return null == s || s.valueOf() !== this.eT.valueOf();
32
- case hr.hT.TT:
33
- return null != s && typeof s == typeof this.eT && s > this.eT;
34
- case hr.hT.rT:
35
- return this.sT === hr.lT.iT
36
- ? null != s && Nt(s) && hs(s) <= this.eT.valueOf()
37
- : null != s && typeof s == typeof this.eT && s >= this.eT;
38
- case hr.hT.cT:
39
- return null != s && typeof s == typeof this.eT && s < this.eT;
40
- case hr.hT.nT:
41
- return this.sT === hr.lT.iT
42
- ? null != s && Nt(s) && hs(s) >= this.eT.valueOf()
43
- : null != s && typeof s == typeof this.eT && s <= this.eT;
44
- case hr.hT.AT:
27
+ switch ((null != t && (s = t[this.zE]), this.comparator)) {
28
+ case hr.ZE.eT:
29
+ return null != s && s.valueOf() === this.vE.valueOf();
30
+ case hr.ZE.iT:
31
+ return null == s || s.valueOf() !== this.vE.valueOf();
32
+ case hr.ZE.lT:
33
+ return null != s && typeof s == typeof this.vE && s > this.vE;
34
+ case hr.ZE.qE:
35
+ return this.kE === hr.VE.JE
36
+ ? null != s && Nt(s) && hs(s) <= this.vE.valueOf()
37
+ : null != s && typeof s == typeof this.vE && s >= this.vE;
38
+ case hr.ZE.rT:
39
+ return null != s && typeof s == typeof this.vE && s < this.vE;
40
+ case hr.ZE.$E:
41
+ return this.kE === hr.VE.JE
42
+ ? null != s && Nt(s) && hs(s) >= this.vE.valueOf()
43
+ : null != s && typeof s == typeof this.vE && s <= this.vE;
44
+ case hr.ZE.hT:
45
45
  return (
46
46
  null != s &&
47
47
  "string" == typeof s &&
48
- typeof s == typeof this.eT &&
49
- null != s.match(this.eT)
48
+ typeof s == typeof this.vE &&
49
+ null != s.match(this.vE)
50
50
  );
51
- case hr.hT._T:
51
+ case hr.ZE.nT:
52
52
  return null != s;
53
- case hr.hT.fT:
53
+ case hr.ZE.uT:
54
54
  return null == s;
55
- case hr.hT.uT:
56
- return null != s && Nt(s) && us(s) < this.eT;
57
- case hr.hT.oT:
58
- return null != s && Nt(s) && us(s) > this.eT;
59
- case hr.hT.pT:
55
+ case hr.ZE.tT:
56
+ return null != s && Nt(s) && us(s) < this.vE;
57
+ case hr.ZE.sT:
58
+ return null != s && Nt(s) && us(s) > this.vE;
59
+ case hr.ZE.oT:
60
60
  return (
61
61
  null == s ||
62
- typeof s != typeof this.eT ||
62
+ typeof s != typeof this.vE ||
63
63
  "string" != typeof s ||
64
- null == s.match(this.eT)
64
+ null == s.match(this.vE)
65
65
  );
66
66
  }
67
67
  return !1;
@@ -75,28 +75,28 @@ export default class hr {
75
75
  );
76
76
  }
77
77
  qt() {
78
- let t = this.eT;
78
+ let t = this.vE;
79
79
  return (
80
- Nt(this.eT) && (t = X(t.valueOf())),
81
- { k: this.tT, t: this.sT, c: this.comparator, v: t }
80
+ Nt(this.vE) && (t = X(t.valueOf())),
81
+ { k: this.zE, t: this.kE, c: this.comparator, v: t }
82
82
  );
83
83
  }
84
84
  static _u(t) {
85
85
  return new hr(t.k, t.t, t.c, t.v);
86
86
  }
87
87
  }
88
- (hr.lT = { yT: "boolean", ST: "number", NT: "string", iT: "date" }),
89
- (hr.hT = {
90
- ET: 1,
91
- aT: 2,
92
- TT: 3,
93
- rT: 4,
94
- cT: 5,
95
- nT: 6,
96
- AT: 10,
97
- _T: 11,
98
- fT: 12,
99
- uT: 15,
100
- oT: 16,
101
- pT: 17,
88
+ (hr.VE = { ET: "boolean", aT: "number", TT: "string", JE: "date" }),
89
+ (hr.ZE = {
90
+ eT: 1,
91
+ iT: 2,
92
+ lT: 3,
93
+ qE: 4,
94
+ rT: 5,
95
+ $E: 6,
96
+ hT: 10,
97
+ nT: 11,
98
+ uT: 12,
99
+ tT: 15,
100
+ sT: 16,
101
+ oT: 17,
102
102
  });
@@ -1,11 +1,11 @@
1
- import pi from "./trigger-condition.js";
2
- export default class bi {
1
+ import ji from "./trigger-condition.js";
2
+ export default class ki {
3
3
  constructor(t, i) {
4
4
  (this.if = t), (this.rf = i), (this.if = t), (this.rf = i);
5
5
  }
6
6
  zc(t) {
7
7
  if (null == this.if) return !1;
8
- const i = pi.sf(t[0], this.if);
8
+ const i = ji.sf(t[0], this.if);
9
9
  if (!i) return !1;
10
10
  let r = null == this.rf || 0 === this.rf.length;
11
11
  if (null != this.rf)
@@ -17,7 +17,7 @@ export default class bi {
17
17
  return i && r;
18
18
  }
19
19
  static fromJson(t) {
20
- return new bi(t ? t.id : null, t ? t.buttons : null);
20
+ return new ki(t ? t.id : null, t ? t.buttons : null);
21
21
  }
22
22
  qt() {
23
23
  return this.if;
@@ -1,10 +1,10 @@
1
- import pi from "./trigger-condition.js";
1
+ import ji from "./trigger-condition.js";
2
2
  export default class wr {
3
3
  constructor(t) {
4
4
  (this.if = t), (this.if = t);
5
5
  }
6
6
  zc(t) {
7
- return null == this.if || pi.sf(t[0], this.if);
7
+ return null == this.if || ji.sf(t[0], this.if);
8
8
  }
9
9
  static fromJson(t) {
10
10
  return new wr(t ? t.campaign_id : null);
@@ -1,26 +1,26 @@
1
1
  import es from "./custom-event-data.js";
2
2
  import ns from "./custom-event-property-data.js";
3
3
  import ls from "./filter-set.js";
4
- import bi from "./in-app-message-click-data.js";
4
+ import ki from "./in-app-message-click-data.js";
5
5
  import os from "./purchase-data.js";
6
6
  import fs from "./purchase-property-data.js";
7
7
  import wr from "./push-click-data.js";
8
8
  import ot from "./trigger-events.js";
9
9
  import { logger as b } from "../../../shared-lib/index.js";
10
- import { getErrorMessage as ai } from "../../util/error-utils.js";
11
- export default class pi {
10
+ import { getErrorMessage as ci } from "../../util/error-utils.js";
11
+ export default class ji {
12
12
  constructor(e, t) {
13
13
  (this.type = e), (this.data = t), (this.type = e), (this.data = t);
14
14
  }
15
15
  _c(e, t) {
16
- return pi.Ec[this.type] === e && (null == this.data || this.data.zc(t));
16
+ return ji.Ec[this.type] === e && (null == this.data || this.data.zc(t));
17
17
  }
18
18
  static sf(e, t) {
19
19
  let r = null;
20
20
  try {
21
21
  r = window.atob(e);
22
22
  } catch (t) {
23
- return b.info("Failed to unencode analytics id " + e + ": " + ai(t)), !1;
23
+ return b.info("Failed to unencode analytics id " + e + ": " + ci(t)), !1;
24
24
  }
25
25
  return t === r.split("_")[0];
26
26
  }
@@ -28,28 +28,28 @@ export default class pi {
28
28
  const t = e.type;
29
29
  let r = null;
30
30
  switch (t) {
31
- case pi.ma.OPEN:
32
- case pi.ma.Os:
31
+ case ji.Yo.OPEN:
32
+ case ji.Yo.Os:
33
33
  break;
34
- case pi.ma.qr:
34
+ case ji.Yo.qr:
35
35
  r = os.fromJson(e.data);
36
36
  break;
37
- case pi.ma.Pc:
37
+ case ji.Yo.Pc:
38
38
  r = fs.fromJson(e.data);
39
39
  break;
40
- case pi.ma.Sr:
40
+ case ji.Yo.Sr:
41
41
  r = wr.fromJson(e.data);
42
42
  break;
43
- case pi.ma.he:
43
+ case ji.Yo.he:
44
44
  r = es.fromJson(e.data);
45
45
  break;
46
- case pi.ma.Rc:
46
+ case ji.Yo.Rc:
47
47
  r = ns.fromJson(e.data);
48
48
  break;
49
- case pi.ma.rm:
50
- r = bi.fromJson(e.data);
49
+ case ji.Yo.rm:
50
+ r = ki.fromJson(e.data);
51
51
  }
52
- return new pi(t, r);
52
+ return new ji(t, r);
53
53
  }
54
54
  qt() {
55
55
  return { t: this.type, d: this.data ? this.data.qt() : null };
@@ -58,31 +58,31 @@ export default class pi {
58
58
  let t,
59
59
  r = null;
60
60
  switch (e.t) {
61
- case pi.ma.OPEN:
62
- case pi.ma.Os:
61
+ case ji.Yo.OPEN:
62
+ case ji.Yo.Os:
63
63
  break;
64
- case pi.ma.qr:
64
+ case ji.Yo.qr:
65
65
  r = new os(e.d);
66
66
  break;
67
- case pi.ma.Pc:
67
+ case ji.Yo.Pc:
68
68
  (t = e.d || {}), (r = new fs(t.id, ls._u(t.pf || [])));
69
69
  break;
70
- case pi.ma.Sr:
70
+ case ji.Yo.Sr:
71
71
  r = new wr(e.d);
72
72
  break;
73
- case pi.ma.he:
73
+ case ji.Yo.he:
74
74
  r = new es(e.d);
75
75
  break;
76
- case pi.ma.Rc:
76
+ case ji.Yo.Rc:
77
77
  (t = e.d || {}), (r = new ns(t.e, ls._u(t.pf || [])));
78
78
  break;
79
- case pi.ma.rm:
80
- r = new bi(e.d);
79
+ case ji.Yo.rm:
80
+ r = new ki(e.d);
81
81
  }
82
- return new pi(e.t, r);
82
+ return new ji(e.t, r);
83
83
  }
84
84
  }
85
- (pi.ma = {
85
+ (ji.Yo = {
86
86
  OPEN: "open",
87
87
  qr: "purchase",
88
88
  Pc: "purchase_property",
@@ -92,12 +92,12 @@ export default class pi {
92
92
  rm: "iam_click",
93
93
  Os: "test",
94
94
  }),
95
- (pi.Ec = {}),
96
- (pi.Ec[pi.ma.OPEN] = ot.OPEN),
97
- (pi.Ec[pi.ma.qr] = ot.qr),
98
- (pi.Ec[pi.ma.Pc] = ot.qr),
99
- (pi.Ec[pi.ma.Sr] = ot.Sr),
100
- (pi.Ec[pi.ma.he] = ot.he),
101
- (pi.Ec[pi.ma.Rc] = ot.he),
102
- (pi.Ec[pi.ma.rm] = ot.rm),
103
- (pi.Ec[pi.ma.Os] = ot.Os);
95
+ (ji.Ec = {}),
96
+ (ji.Ec[ji.Yo.OPEN] = ot.OPEN),
97
+ (ji.Ec[ji.Yo.qr] = ot.qr),
98
+ (ji.Ec[ji.Yo.Pc] = ot.qr),
99
+ (ji.Ec[ji.Yo.Sr] = ot.Sr),
100
+ (ji.Ec[ji.Yo.he] = ot.he),
101
+ (ji.Ec[ji.Yo.Rc] = ot.he),
102
+ (ji.Ec[ji.Yo.rm] = ot.rm),
103
+ (ji.Ec[ji.Yo.Os] = ot.Os);