@braze/web-sdk 5.1.1 → 5.3.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 (99) hide show
  1. package/index.d.ts +65 -10
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +20 -20
  5. package/shared-lib/indexed-db-adapter.js +52 -52
  6. package/shared-lib/logger.js +7 -7
  7. package/shared-lib/supported-options.js +22 -21
  8. package/src/ContentCards/content-cards-provider.js +107 -135
  9. package/src/ContentCards/get-cached-content-cards.js +1 -1
  10. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  11. package/src/ContentCards/subscribe-to-content-cards-updates.js +2 -2
  12. package/src/ContentCards/ui/show-content-cards.js +1 -1
  13. package/src/FeatureFlags/feature-flag.js +41 -30
  14. package/src/FeatureFlags/feature-flags-provider.js +88 -84
  15. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  16. package/src/FeatureFlags/get-feature-flag.js +2 -2
  17. package/src/FeatureFlags/log-feature-flag-impression.js +3 -3
  18. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  19. package/src/Feed/feed-provider.js +24 -24
  20. package/src/Feed/get-cached-feed.js +1 -1
  21. package/src/Feed/log-feed-displayed.js +1 -1
  22. package/src/Feed/request-feed-refresh.js +1 -1
  23. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  24. package/src/Feed/ui/show-feed.js +1 -1
  25. package/src/InAppMessage/defer-in-app-message.js +1 -1
  26. package/src/InAppMessage/display/html-message-to-html.js +45 -42
  27. package/src/InAppMessage/display/in-app-message-to-html.js +22 -22
  28. package/src/InAppMessage/display/modal-utils.js +7 -7
  29. package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
  30. package/src/InAppMessage/in-app-message-factory.js +23 -21
  31. package/src/InAppMessage/in-app-message-manager.js +95 -112
  32. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  33. package/src/InAppMessage/log-in-app-message-click.js +3 -3
  34. package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
  35. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  36. package/src/InAppMessage/models/control-message.js +4 -2
  37. package/src/InAppMessage/models/full-screen-message.js +14 -11
  38. package/src/InAppMessage/models/html-message.js +11 -9
  39. package/src/InAppMessage/models/in-app-message-button.js +2 -2
  40. package/src/InAppMessage/models/in-app-message.js +127 -120
  41. package/src/InAppMessage/models/modal-message.js +14 -11
  42. package/src/InAppMessage/models/slide-up-message.js +46 -21
  43. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  44. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  45. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  46. package/src/InAppMessage/ui/show-in-app-message.js +37 -43
  47. package/src/InAppMessage/utils/in-app-message-utils.js +18 -1
  48. package/src/Push/push-manager-factory.js +4 -4
  49. package/src/Push/push-manager.js +118 -110
  50. package/src/Push/utils/push-utils.js +4 -4
  51. package/src/User/user-manager.js +4 -4
  52. package/src/User/user.js +19 -19
  53. package/src/common/base-feed.js +1 -1
  54. package/src/common/base-provider.js +1 -1
  55. package/src/common/constants.js +0 -2
  56. package/src/common/event-logger.js +2 -2
  57. package/src/common/feed-display.js +12 -12
  58. package/src/l10n/l10n-manager-factory.js +1 -1
  59. package/src/l10n/l10n-manager.js +4 -4
  60. package/src/managers/auth-manager.js +27 -27
  61. package/src/managers/braze-instance.js +119 -112
  62. package/src/managers/device-manager.js +19 -19
  63. package/src/managers/network-manager.js +215 -165
  64. package/src/managers/server-config-manager.js +46 -50
  65. package/src/managers/session-manager.js +21 -21
  66. package/src/managers/storage-manager-factory.js +1 -1
  67. package/src/managers/storage-manager.js +128 -125
  68. package/src/managers/utils.js +6 -0
  69. package/src/models/backend-errors.js +5 -5
  70. package/src/models/braze-event.js +19 -11
  71. package/src/models/device.js +3 -3
  72. package/src/models/identifier.js +34 -20
  73. package/src/models/push-token.js +4 -4
  74. package/src/models/server-config.js +24 -24
  75. package/src/request-controller.js +134 -124
  76. package/src/triggers/models/filter-set.js +2 -2
  77. package/src/triggers/models/filter.js +56 -56
  78. package/src/triggers/models/in-app-message-click-data.js +8 -8
  79. package/src/triggers/models/push-click-data.js +3 -3
  80. package/src/triggers/models/trigger-condition.js +30 -30
  81. package/src/triggers/models/trigger-events.js +1 -1
  82. package/src/triggers/models/trigger.js +36 -36
  83. package/src/triggers/triggers-provider-factory.js +2 -2
  84. package/src/triggers/triggers-provider.js +84 -95
  85. package/src/ui/js/attach-css.js +2 -2
  86. package/src/ui/js/load-font-awesome.js +1 -1
  87. package/src/util/base-device-parser.js +7 -7
  88. package/src/util/braze-actions.js +4 -4
  89. package/src/util/browser-detector.js +25 -24
  90. package/src/util/client-hints-parser.js +4 -4
  91. package/src/util/component-utils.js +2 -2
  92. package/src/util/device-constants.js +2 -2
  93. package/src/util/dom-utils.js +6 -6
  94. package/src/util/key-codes.js +1 -1
  95. package/src/util/net.js +4 -4
  96. package/src/util/request-header-utils.js +36 -37
  97. package/src/util/user-agent-parser.js +8 -8
  98. package/src/util/validation-utils.js +2 -0
  99. package/src/util/window-utils.js +3 -3
@@ -1,12 +1,12 @@
1
- export default class xt {
1
+ export default class zt {
2
2
  constructor(s) {
3
3
  (this.id = s), (this.id = s);
4
4
  }
5
- Gr() {
5
+ Ir() {
6
6
  const s = {};
7
7
  return (
8
8
  null != this.browser && (s.browser = this.browser),
9
- null != this.Da && (s.browser_version = this.Da),
9
+ null != this.Ia && (s.browser_version = this.Ia),
10
10
  null != this.os && (s.os_version = this.os),
11
11
  null != this.resolution && (s.resolution = this.resolution),
12
12
  null != this.language && (s.locale = this.language),
@@ -2,38 +2,52 @@ import { Guid as p, logger as r } from "../../shared-lib/index.js";
2
2
  import { isArray as j } from "../util/code-utils.js";
3
3
  import { getErrorMessage as si } from "../util/error-utils.js";
4
4
  export default class _t {
5
- constructor(t, i, r) {
5
+ constructor(t, e, i) {
6
6
  (this.eu = t),
7
7
  null == t && (t = p.W()),
8
- !r || isNaN(r) ? (this.vl = new Date().valueOf()) : (this.vl = r),
8
+ !i || isNaN(i) ? (this.Dl = new Date().valueOf()) : (this.Dl = i),
9
9
  (this.eu = t),
10
- (this.Hl = new Date().valueOf()),
11
- (this.zl = i);
10
+ (this.Wl = new Date().valueOf()),
11
+ (this.Hl = e);
12
12
  }
13
13
  Y() {
14
- return `g:${this.eu}|e:${this.zl}|c:${this.vl}|l:${this.Hl}`;
14
+ return `g:${encodeURIComponent(this.eu)}|e:${this.Hl}|c:${this.Dl}|l:${
15
+ this.Wl
16
+ }`;
15
17
  }
16
- static En(t) {
17
- let i;
18
- if ("string" == typeof t) {
19
- const e = t.split("|");
20
- if (!j(e) || 4 !== e.length) return null;
18
+ static hE(t) {
19
+ if ("string" != typeof t) return null;
20
+ const e = t.lastIndexOf("|e:"),
21
+ i = t.substring(0, e),
22
+ r = i.split("g:")[1];
23
+ let n;
24
+ return (
25
+ (n = /[|:]/.test(r) ? encodeURIComponent(r) : r),
26
+ (t = t.replace(i, `g:${n}`))
27
+ );
28
+ }
29
+ static qn(t) {
30
+ let e;
31
+ if ("string" == typeof t)
21
32
  try {
22
- const t = (t) => t.split(":")[1],
23
- r = (i) => {
24
- const r = parseInt(t(i));
25
- if (!isNaN(r)) return r;
33
+ const i = t.split("|");
34
+ if (!j(i) || 4 !== i.length) return null;
35
+ const r = (t) => t.split(":")[1],
36
+ n = (t) => {
37
+ const e = parseInt(r(t));
38
+ if (!isNaN(e)) return e;
26
39
  };
27
- (i = new _t(t(e[0]), r(e[1]), r(e[2]))), (i.Hl = r(e[3]));
28
- } catch (i) {
40
+ (e = new _t(decodeURIComponent(r(i[0])), n(i[1]), n(i[2]))),
41
+ (e.Wl = n(i[3]));
42
+ } catch (e) {
29
43
  r.info(
30
- `Unable to parse cookie string ${t}, failed with error: ${si(i)}`,
44
+ `Unable to parse cookie string ${t}, failed with error: ${si(e)}`,
31
45
  );
32
46
  }
33
- } else {
47
+ else {
34
48
  if (null == t || null == t.g) return null;
35
- (i = new _t(t.g, t.e, t.c)), (i.Hl = t.l);
49
+ (e = new _t(t.g, t.e, t.c)), (e.Wl = t.l);
36
50
  }
37
- return i;
51
+ return e;
38
52
  }
39
53
  }
@@ -2,12 +2,12 @@ import { rehydrateDateAfterJsonization as w } from "../util/date-utils.js";
2
2
  export default class ti {
3
3
  constructor(t, i, s, l, h) {
4
4
  (this.endpoint = t),
5
- (this.Cn = i),
5
+ (this.Vn = i),
6
6
  (this.publicKey = s),
7
7
  (this.Vl = l),
8
8
  (this.cl = h),
9
9
  (this.endpoint = t || null),
10
- (this.Cn = i || null),
10
+ (this.Vn = i || null),
11
11
  (this.publicKey = s || null),
12
12
  (this.Vl = l || null),
13
13
  (this.cl = h || null);
@@ -15,13 +15,13 @@ export default class ti {
15
15
  Y() {
16
16
  return {
17
17
  e: this.endpoint,
18
- c: this.Cn,
18
+ c: this.Vn,
19
19
  p: this.publicKey,
20
20
  u: this.Vl,
21
21
  v: this.cl,
22
22
  };
23
23
  }
24
- static En(t) {
24
+ static qn(t) {
25
25
  return new ti(t.e, w(t.c), t.p, t.u, t.v);
26
26
  }
27
27
  }
@@ -2,56 +2,56 @@ import {
2
2
  GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as Qt,
3
3
  GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as Yt,
4
4
  } from "../common/constants.js";
5
- export default class Gt {
5
+ export default class Ht {
6
6
  constructor(
7
7
  t = 0,
8
8
  i = [],
9
9
  s = [],
10
10
  h = [],
11
11
  e = null,
12
- l = null,
13
- r = { enabled: !1 },
12
+ r = null,
13
+ l = { enabled: !1 },
14
14
  a = { enabled: !1, refresh_rate_limit: void 0 },
15
- n = { enabled: !0, capacity: Qt, refill_rate: Yt },
15
+ n = { enabled: !0, capacity: Qt, refill_rate: Yt, endpoint_overrides: {} },
16
16
  ) {
17
- (this.ol = t),
17
+ (this.hl = t),
18
18
  (this.gl = i),
19
19
  (this.fl = s),
20
20
  (this.bl = h),
21
- (this.Cl = e),
22
- (this.cl = l),
23
- (this.ml = r),
24
- (this.mi = a),
25
- (this.al = n),
26
- (this.ol = t),
21
+ (this.Rl = e),
22
+ (this.cl = r),
23
+ (this.ml = l),
24
+ (this.hi = a),
25
+ (this.ol = n),
26
+ (this.hl = t),
27
27
  (this.gl = i),
28
28
  (this.fl = s),
29
29
  (this.bl = h),
30
- (this.Cl = e),
31
- (this.cl = l),
32
- (this.ml = r),
33
- (this.mi = a),
34
- (this.al = n);
30
+ (this.Rl = e),
31
+ (this.cl = r),
32
+ (this.ml = l),
33
+ (this.hi = a),
34
+ (this.ol = n);
35
35
  }
36
36
  Y() {
37
37
  return {
38
- s: "5.1.1",
39
- l: this.ol,
38
+ s: "5.3.0",
39
+ l: this.hl,
40
40
  e: this.gl,
41
41
  a: this.fl,
42
42
  p: this.bl,
43
- m: this.Cl,
43
+ m: this.Rl,
44
44
  v: this.cl,
45
45
  c: this.ml,
46
- f: this.mi,
47
- grl: this.al,
46
+ f: this.hi,
47
+ grl: this.ol,
48
48
  };
49
49
  }
50
- static En(t) {
50
+ static qn(t) {
51
51
  let i = t.l;
52
52
  return (
53
- "5.1.1" !== t.s && (i = 0),
54
- new Gt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl)
53
+ "5.3.0" !== t.s && (i = 0),
54
+ new Ht(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl)
55
55
  );
56
56
  }
57
57
  }
@@ -1,7 +1,7 @@
1
1
  import C from "./util/net.js";
2
2
  import ue from "./models/braze-event.js";
3
3
  import s from "./common/event-logger.js";
4
- import { randomInclusive as k } from "./util/math.js";
4
+ import { randomInclusive as U } from "./util/math.js";
5
5
  import t from "./models/request-result.js";
6
6
  import {
7
7
  logger as r,
@@ -12,173 +12,180 @@ import {
12
12
  import { STORAGE_KEYS as o } from "./managers/storage-manager.js";
13
13
  import T from "./managers/subscription-manager.js";
14
14
  import vt from "./Push/utils/push-utils.js";
15
- import S from "./util/request-header-utils.js";
15
+ import D from "./util/request-header-utils.js";
16
16
  export default class Lt {
17
17
  constructor(t, i, s, e, h, o, n, r, u, l) {
18
- (this.an = t),
18
+ (this.rn = t),
19
19
  (this.baseUrl = i),
20
- (this.di = s),
21
- (this.hn = e),
20
+ (this.ri = s),
21
+ (this.on = e),
22
22
  (this.wt = h),
23
23
  (this.yt = o),
24
24
  (this.u = n),
25
- (this.bu = r),
26
- (this.Go = u),
25
+ (this.wu = r),
26
+ (this.zo = u),
27
27
  (this.qt = l),
28
- (this.an = t),
28
+ (this.rn = t),
29
29
  (this.baseUrl = i),
30
- (this.wu = 0),
31
- (this.gE = n.RE() || 0),
32
- (this.ku = null),
33
- (this.di = s),
34
- (this.hn = e),
30
+ (this.yu = 0),
31
+ (this.fE = n.dE() || 0),
32
+ (this.ju = null),
33
+ (this.ri = s),
34
+ (this.on = e),
35
35
  (this.wt = h),
36
36
  (this.yt = o),
37
37
  (this.u = n),
38
- (this.Go = u),
38
+ (this.zo = u),
39
39
  (this.qt = l),
40
- (this.bu = r),
41
- (this.yu = new T()),
42
- (this.ju = null),
43
- (this.Su = 50),
44
- (this.Au = !1);
40
+ (this.wu = r),
41
+ (this.Su = new T()),
42
+ (this.$u = null),
43
+ (this.Cu = 50),
44
+ (this.Fu = !1);
45
45
  }
46
- $u(t, i) {
47
- return !t && !i && this.Go.Hh() >= this.Su;
46
+ Lu(t, i) {
47
+ return !t && !i && this.zo.Gh() >= this.Cu;
48
48
  }
49
- Cu(t) {
50
- let s = this.di.El();
49
+ Mu(t) {
50
+ let s = this.ri.Gl();
51
51
  if (t.length > 0) {
52
52
  const e = this.wt.getUserId();
53
53
  for (const h of t) {
54
54
  const t = (!h.userId && !e) || h.userId === e;
55
- h.type === i.kl && t && (s = !0);
55
+ h.type === i.ql && t && (s = !0);
56
56
  }
57
57
  }
58
58
  return s;
59
59
  }
60
- Du(t = !1, i = !1, s = !0, e, h, n, u = !1, l = !1) {
61
- s && this.Fu();
62
- const a = this.u.TE(),
63
- c = this.u.AE();
60
+ Pu(t = !1, i = !1, s = !0, e, h, n, u = !1, l = !1) {
61
+ s && this.xu();
62
+ const a = this.u.AE(),
63
+ c = this.u.OE();
64
64
  let d = !1;
65
- const f = (t, i) => {
66
- let r = !1;
67
- S.Os(this.u, S.Gs.Qa, new Date().valueOf()),
68
- C.Qs({
65
+ const m = (t, i, r = -1) => {
66
+ let u = !1;
67
+ const l = new Date().valueOf();
68
+ D._s(this.u, D.Ps.$a, l),
69
+ -1 !== r && i.push(["X-Braze-Req-Tokens-Remaining", r.toString()]),
70
+ C.Gs({
69
71
  url: this.baseUrl + "/data/",
70
72
  data: t,
71
73
  headers: i,
72
74
  L: (s) => {
73
75
  null != t.respond_with &&
74
76
  t.respond_with.triggers &&
75
- (this.wu = Math.max(this.wu - 1, 0)),
76
- this.qt.Ws(t, s, i)
77
- ? (this.Go.Xs(),
78
- this.yt.ul(s),
77
+ (this.yu = Math.max(this.yu - 1, 0)),
78
+ this.qt.Ks(t, s, i)
79
+ ? (this.zo.Os(),
80
+ this.yt.al(s),
79
81
  (null != t.respond_with &&
80
82
  t.respond_with.user_id != this.wt.getUserId()) ||
81
- (null != t.device && this.u.k(o.C.Ja, t.device),
83
+ (null != t.device && this.u.k(o.C.Ca, t.device),
82
84
  null != t.sdk_metadata &&
83
- (this.u.k(o.C.Na, t.sdk_metadata),
84
- this.u.k(o.C.$a, this.di.ki())),
85
- this.bu(s),
86
- S.Ys(this.u, S.Gs.Qa, 1),
85
+ (this.u.k(o.C.Yh, t.sdk_metadata),
86
+ this.u.k(o.C.Jh, this.ri.Si())),
87
+ this.wu(s),
88
+ D.Qs(this.u, D.Ps.$a, 1),
87
89
  "function" == typeof e && e()))
88
- : s.auth_error && (r = !0);
90
+ : s.auth_error && (u = !0);
89
91
  },
90
92
  error: () => {
91
93
  null != t.respond_with &&
92
94
  t.respond_with.triggers &&
93
- (this.wu = Math.max(this.wu - 1, 0)),
94
- this.qt.Ea(t.events, t.attributes),
95
+ (this.yu = Math.max(this.yu - 1, 0)),
96
+ this.qt.Qh(t.events, t.attributes),
95
97
  "function" == typeof h && h();
96
98
  },
97
- ti: (t) => {
99
+ Ws: (t) => {
98
100
  if (("function" == typeof n && n(t), s && !d)) {
99
- if (t && !r) this.Tu();
101
+ if (t && !u) this.Iu();
100
102
  else {
101
- S.si(this.u, S.Gs.Qa);
102
- let t = this.ku;
103
- (null == t || t < 1e3 * this.gE) && (t = 1e3 * this.gE),
104
- this.Tu(Math.min(3e5, k(1e3 * this.gE, 3 * t)));
103
+ D.Ys(this.u, D.Ps.$a);
104
+ let t = this.ju;
105
+ (null == t || t < 1e3 * this.fE) && (t = 1e3 * this.fE),
106
+ this.Iu(Math.min(3e5, U(1e3 * this.fE, 3 * t)));
105
107
  }
106
108
  d = !0;
107
109
  }
108
110
  },
109
111
  });
110
112
  },
111
- m = this.Cu(a),
112
- g = i || m;
113
- if (this.$u(u, m))
113
+ f = this.Mu(a),
114
+ g = i || f;
115
+ if (this.Lu(u, f))
114
116
  return void r.info(
115
117
  "Declining to flush data due to 50 consecutive authentication failures",
116
118
  );
117
- if (s && !this.qt.Wa(a, c, t, g))
118
- return this.Tu(), void ("function" == typeof n && n(!0));
119
- const v = this.qt.Ya(t, g, a, c, l);
120
- g && this.wu++;
119
+ if (s && !this.qt.Na(a, c, t, g))
120
+ return this.Iu(), void ("function" == typeof n && n(!0));
121
+ const v = this.qt.Xa(t, g, a, c, l);
122
+ g && this.yu++;
121
123
  let p = !1;
122
124
  if (v)
123
125
  for (const t of v)
124
- this.qt.Hs(t.requestData, () => f(t.requestData, t.headers), S.ii.Qa),
126
+ this.qt.Xs(
127
+ t.requestData,
128
+ (i) => m(t.requestData, t.headers, i),
129
+ D.Ps.$a,
130
+ h,
131
+ ),
125
132
  (p = !0);
126
- this.Go.fh() && s && !p
127
- ? this.Tu()
128
- : m && (r.info("Invoking new session subscriptions"), this.yu.Dt());
133
+ this.zo.Fh() && s && !p
134
+ ? this.Iu()
135
+ : f && (r.info("Invoking new session subscriptions"), this.Su.Dt());
129
136
  }
130
- Lu() {
131
- return this.wu > 0;
137
+ Nu() {
138
+ return this.yu > 0;
132
139
  }
133
- Tu(t = 1e3 * this.gE) {
134
- this.Au ||
135
- (this.Fu(),
136
- (this.ju = window.setTimeout(() => {
140
+ Iu(t = 1e3 * this.fE) {
141
+ this.Fu ||
142
+ (this.xu(),
143
+ (this.$u = window.setTimeout(() => {
137
144
  if (document.hidden) {
138
145
  const t = "visibilitychange",
139
146
  i = () => {
140
147
  document.hidden ||
141
- (document.removeEventListener(t, i, !1), this.Du());
148
+ (document.removeEventListener(t, i, !1), this.Pu());
142
149
  };
143
150
  document.addEventListener(t, i, !1);
144
- } else this.Du();
151
+ } else this.Pu();
145
152
  }, t)),
146
- (this.ku = t));
153
+ (this.ju = t));
147
154
  }
148
- Fu() {
149
- null != this.ju && (clearTimeout(this.ju), (this.ju = null));
155
+ xu() {
156
+ null != this.$u && (clearTimeout(this.$u), (this.$u = null));
150
157
  }
151
158
  initialize() {
152
- (this.Au = !1), this.Tu();
159
+ (this.Fu = !1), this.Iu();
153
160
  }
154
161
  destroy() {
155
- this.yu.removeAllSubscriptions(),
156
- this.Go.Bh(),
157
- this.Fu(),
158
- (this.Au = !0),
159
- this.Du(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
160
- (this.ju = null);
162
+ this.Su.removeAllSubscriptions(),
163
+ this.zo.yh(),
164
+ this.xu(),
165
+ (this.Fu = !0),
166
+ this.Pu(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
167
+ (this.$u = null);
161
168
  }
162
169
  mr(t) {
163
- return this.yu.It(t);
170
+ return this.Su.It(t);
164
171
  }
165
172
  openSession() {
166
- const t = this.di.ki() !== this.di.xo();
167
- t && (this.u.uE(o.iu.Ta), this.u.uE(o.iu.su)),
168
- this.Du(void 0, !1, void 0, () => {
169
- this.u.hi(o.C.Ii);
173
+ const t = this.ri.Si() !== this.ri.wo();
174
+ t && (this.u.cE(o.iu.Uo), this.u.cE(o.iu.su)),
175
+ this.Pu(void 0, !1, void 0, () => {
176
+ this.u.ti(o.C.vi);
170
177
  }),
171
- this.Jn(),
178
+ this.Mn(),
172
179
  t &&
173
180
  import("./Push/push-manager-factory.js").then((t) => {
174
- if (this.Au) return;
181
+ if (this.Fu) return;
175
182
  const i = t.default.m();
176
183
  if (
177
184
  null != i &&
178
185
  (vt.isPushPermissionGranted() || vt.isPushBlocked())
179
186
  ) {
180
187
  const t = () => {
181
- i.vn()
188
+ i.mn()
182
189
  ? r.info(
183
190
  "Push token maintenance is disabled, not refreshing token for backend.",
184
191
  )
@@ -188,7 +195,7 @@ export default class Lt {
188
195
  s && t();
189
196
  },
190
197
  e = () => {
191
- const i = this.u.j(o.C.zn);
198
+ const i = this.u.j(o.C.In);
192
199
  (null == i || i) && t();
193
200
  },
194
201
  h = A.Yt.Qt;
@@ -196,35 +203,36 @@ export default class Lt {
196
203
  }
197
204
  });
198
205
  }
199
- Mu() {
200
- this.u.hi(o.C.Ti), this.u.hi(o.C.Cs), this.u.hi(o.C.Wr);
206
+ Ou() {
207
+ this.u.ti(o.C.gi), this.u.ti(o.C.ws), this.u.ti(o.C.Cr);
201
208
  }
202
209
  changeUser(t, i, s) {
203
210
  const e = this.wt.getUserId();
204
211
  if (e !== t) {
205
- this.di.ql(),
206
- this.Mu(),
207
- null != e && this.Du(void 0, !1, void 0, void 0, void 0),
212
+ this.ri.yl(),
213
+ this.Ou(),
214
+ null != e && this.Pu(void 0, !1, void 0, void 0, void 0),
208
215
  this.wt.ou(t),
209
- s ? this.Go.setSdkAuthenticationSignature(s) : this.Go.qh();
216
+ s ? this.zo.setSdkAuthenticationSignature(s) : this.zo.xh();
210
217
  for (let t = 0; t < i.length; t++) i[t].changeUser(null == e);
211
- null != e && this.u.hi(o.C.J),
212
- this.u.hi(o.C.Ja),
213
- this.u.hi(o.C.ai),
218
+ null != e && this.u.ti(o.C.J),
219
+ this.u.ti(o.C.Ca),
220
+ this.u.ti(o.C.nE),
221
+ this.u.ti(o.C._E),
214
222
  this.openSession(),
215
223
  r.info('Changed user to "' + t + '".');
216
224
  } else {
217
225
  let i = "Doing nothing.";
218
226
  s &&
219
- this.Go.wh() !== s &&
220
- (this.Go.setSdkAuthenticationSignature(s),
227
+ this.zo.kh() !== s &&
228
+ (this.zo.setSdkAuthenticationSignature(s),
221
229
  (i = "Updated SDK authentication signature")),
222
230
  r.info(`Current user is already ${t}. ${i}`);
223
231
  }
224
232
  }
225
233
  requestImmediateDataFlush(t) {
226
- this.Fu(), this.di.xo();
227
- this.Du(
234
+ this.xu(), this.ri.wo();
235
+ this.Pu(
228
236
  void 0,
229
237
  void 0,
230
238
  void 0,
@@ -237,20 +245,22 @@ export default class Lt {
237
245
  );
238
246
  }
239
247
  requestFeedRefresh() {
240
- this.di.xo(), this.Du(!0);
248
+ this.ri.wo(), this.Pu(!0);
241
249
  }
242
250
  $r(t, i) {
243
- this.di.xo(),
251
+ this.ri.wo(),
244
252
  r.info("Requesting explicit trigger refresh."),
245
- this.Du(void 0, !0, void 0, t, i);
253
+ this.Pu(void 0, !0, void 0, t, i);
246
254
  }
247
- Fn(t, e) {
248
- const h = i.Pu,
249
- o = { a: t, l: e },
250
- n = s.q(h, o);
251
- return n && r.info(`Logged alias ${t} with label ${e}`), n;
255
+ Cn(t, e) {
256
+ const h = i.zu,
257
+ n = { a: t, l: e },
258
+ u = s.q(h, n);
259
+ return (
260
+ u && (r.info(`Logged alias ${t} with label ${e}`), this.u.k(o.C._E, n)), u
261
+ );
252
262
  }
253
- Bn(i, e, h) {
263
+ Fn(i, e, h) {
254
264
  if (this.yt.hu(e))
255
265
  return (
256
266
  r.info(`Custom Attribute "${e}" is blocklisted, ignoring.`), new t()
@@ -268,7 +278,7 @@ export default class Lt {
268
278
  null != o && (l.altitude = o),
269
279
  null != n && (l.ll_accuracy = n),
270
280
  null != u && (l.alt_accuracy = u);
271
- const a = s.q(i.xu, l, t || void 0);
281
+ const a = s.q(i.Uu, l, t || void 0);
272
282
  return (
273
283
  a &&
274
284
  r.info(`Set user last known location as ${JSON.stringify(l, null, 2)}`),
@@ -276,30 +286,30 @@ export default class Lt {
276
286
  );
277
287
  }
278
288
  kr(t, s) {
279
- const e = this.di.xo();
280
- return new ue(this.wt.getUserId(), i.Iu, t, e, { cid: s });
289
+ const e = this.ri.wo();
290
+ return new ue(this.wt.getUserId(), i._u, t, e, { cid: s });
281
291
  }
282
- Nu(t, i) {
292
+ Bu(t, i) {
283
293
  return new A(t, i);
284
294
  }
285
- Jn() {
295
+ Mn() {
286
296
  const t = A.Yt.Qt;
287
- this.Nu(t, r).setItem(t.ss.Qa, 1, {
297
+ this.Bu(t, r).setItem(t.ss.$a, 1, {
288
298
  baseUrl: this.baseUrl,
289
- data: { api_key: this.an, device_id: this.hn.ce().id },
299
+ data: { api_key: this.rn, device_id: this.on.ce().id },
290
300
  userId: this.wt.getUserId(),
291
- sdkAuthEnabled: this.Go.fh(),
301
+ sdkAuthEnabled: this.zo.Fh(),
292
302
  });
293
303
  }
294
304
  yr(t) {
295
305
  for (const i of t)
296
- if (i.api_key === this.an) this.qt.Ea(i.events, i.attributes);
306
+ if (i.api_key === this.rn) this.qt.Qh(i.events, i.attributes);
297
307
  else {
298
308
  const t = A.Yt.Qt;
299
309
  new A(t, r).setItem(t.ss.wr, p.W(), i);
300
310
  }
301
311
  }
302
- Kn(e, h, o) {
312
+ Gn(e, h, o) {
303
313
  if (this.yt.hu(e))
304
314
  return (
305
315
  r.info(`Custom Attribute "${e}" is blocklisted, ignoring.`), new t()
@@ -307,13 +317,13 @@ export default class Lt {
307
317
  let n, u;
308
318
  return (
309
319
  null === h && null === o
310
- ? ((n = i.Ou), (u = { key: e }))
311
- : ((n = i.Uu), (u = { key: e, latitude: h, longitude: o })),
320
+ ? ((n = i.Eu), (u = { key: e }))
321
+ : ((n = i.Ju), (u = { key: e, latitude: h, longitude: o })),
312
322
  s.q(n, u)
313
323
  );
314
324
  }
315
- Mn(t, e) {
325
+ Hn(t, e) {
316
326
  const h = { group_id: t, status: e };
317
- return s.q(i._u, h);
327
+ return s.q(i.Ku, h);
318
328
  }
319
329
  }
@@ -42,12 +42,12 @@ export default class ts {
42
42
  }
43
43
  return t;
44
44
  }
45
- static En(t) {
45
+ static qn(t) {
46
46
  const r = [];
47
47
  for (let e = 0; e < t.length; e++) {
48
48
  const o = [],
49
49
  s = t[e];
50
- for (let t = 0; t < s.length; t++) o.push(lr.En(s[t]));
50
+ for (let t = 0; t < s.length; t++) o.push(lr.qn(s[t]));
51
51
  r.push(o);
52
52
  }
53
53
  return new ts(r);