@braze/web-sdk 5.6.0 → 5.7.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 (121) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +14 -4
  3. package/package.json +1 -1
  4. package/shared-lib/encoding-utils.js +1 -1
  5. package/shared-lib/event-types.js +20 -20
  6. package/shared-lib/indexed-db-adapter.js +15 -15
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +14 -14
  9. package/src/Banner/banner-provider.js +53 -50
  10. package/src/Banner/banner.js +1 -1
  11. package/src/Banner/get-all-banners.js +2 -2
  12. package/src/Banner/get-banner.js +2 -2
  13. package/src/Banner/log-banner-click.js +1 -1
  14. package/src/Banner/log-banner-impressions.js +4 -4
  15. package/src/Banner/request-banners-refresh.js +2 -2
  16. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  17. package/src/Card/card-manager.js +10 -10
  18. package/src/Card/models/captioned-image.js +1 -1
  19. package/src/Card/models/card.js +3 -3
  20. package/src/Card/models/classic-card.js +1 -1
  21. package/src/Card/models/control-card.js +1 -1
  22. package/src/Card/models/image-only.js +1 -1
  23. package/src/ContentCards/content-cards-provider.js +139 -180
  24. package/src/ContentCards/get-cached-content-cards.js +1 -1
  25. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  26. package/src/ContentCards/subscribe-to-content-cards-updates.js +10 -10
  27. package/src/ContentCards/ui/show-content-cards.js +3 -3
  28. package/src/Core/disable-sdk.js +3 -3
  29. package/src/Core/enable-sdk.js +3 -3
  30. package/src/Core/log-custom-event.js +3 -3
  31. package/src/Core/log-purchase.js +1 -1
  32. package/src/Core/open-session.js +6 -6
  33. package/src/Core/wipe-data.js +4 -4
  34. package/src/FeatureFlags/feature-flag.js +1 -1
  35. package/src/FeatureFlags/feature-flags-provider.js +81 -78
  36. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  37. package/src/FeatureFlags/get-feature-flag.js +2 -2
  38. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  39. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  40. package/src/Feed/feed-provider.js +34 -34
  41. package/src/Feed/get-cached-feed.js +1 -1
  42. package/src/Feed/request-feed-refresh.js +1 -1
  43. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  44. package/src/Feed/ui/show-feed.js +1 -1
  45. package/src/InAppMessage/defer-in-app-message.js +1 -1
  46. package/src/InAppMessage/display/html-message-to-html.js +9 -9
  47. package/src/InAppMessage/display/in-app-message-to-html.js +16 -16
  48. package/src/InAppMessage/display/modal-utils.js +5 -5
  49. package/src/InAppMessage/in-app-message-factory.js +4 -4
  50. package/src/InAppMessage/in-app-message-manager.js +115 -91
  51. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  52. package/src/InAppMessage/log-in-app-message-click.js +2 -2
  53. package/src/InAppMessage/log-in-app-message-html-click.js +4 -4
  54. package/src/InAppMessage/log-in-app-message-impression.js +2 -2
  55. package/src/InAppMessage/models/full-screen-message.js +5 -5
  56. package/src/InAppMessage/models/html-message.js +10 -10
  57. package/src/InAppMessage/models/in-app-message-button.js +5 -5
  58. package/src/InAppMessage/models/in-app-message.js +37 -37
  59. package/src/InAppMessage/models/modal-message.js +5 -5
  60. package/src/InAppMessage/models/slide-up-message.js +7 -7
  61. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  62. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  63. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  64. package/src/InAppMessage/ui/show-in-app-message.js +14 -14
  65. package/src/Push/is-push-blocked.js +2 -2
  66. package/src/Push/is-push-permission-granted.js +2 -2
  67. package/src/Push/is-push-supported.js +2 -2
  68. package/src/Push/push-manager.js +88 -88
  69. package/src/Push/utils/push-utils.js +12 -12
  70. package/src/User/user-manager.js +10 -10
  71. package/src/User/user.js +46 -34
  72. package/src/common/constants.js +1 -1
  73. package/src/common/event-logger.js +3 -3
  74. package/src/common/feed-display.js +10 -10
  75. package/src/l10n/l10n-manager.js +1 -1
  76. package/src/managers/auth-manager.js +10 -10
  77. package/src/managers/braze-instance.js +110 -110
  78. package/src/managers/device-manager.js +17 -17
  79. package/src/managers/network-manager.js +180 -143
  80. package/src/managers/server-config-manager.js +65 -65
  81. package/src/managers/session-manager.js +22 -22
  82. package/src/managers/storage-manager-factory.js +9 -9
  83. package/src/managers/storage-manager.js +134 -134
  84. package/src/managers/subscription-manager.js +8 -8
  85. package/src/managers/utils.js +1 -1
  86. package/src/models/backend-errors.js +5 -5
  87. package/src/models/braze-event.js +8 -8
  88. package/src/models/device.js +2 -2
  89. package/src/models/identifier.js +10 -10
  90. package/src/models/push-token.js +8 -8
  91. package/src/models/server-config.js +31 -31
  92. package/src/request-controller.js +158 -146
  93. package/src/triggers/models/custom-event-data.js +5 -5
  94. package/src/triggers/models/custom-event-property-data.js +6 -6
  95. package/src/triggers/models/filter-set.js +6 -6
  96. package/src/triggers/models/filter.js +16 -16
  97. package/src/triggers/models/in-app-message-click-data.js +2 -2
  98. package/src/triggers/models/purchase-data.js +2 -2
  99. package/src/triggers/models/purchase-property-data.js +4 -4
  100. package/src/triggers/models/push-click-data.js +2 -2
  101. package/src/triggers/models/trigger-condition.js +36 -36
  102. package/src/triggers/models/trigger-events.js +1 -1
  103. package/src/triggers/models/trigger.js +11 -11
  104. package/src/triggers/triggers-provider-factory.js +2 -2
  105. package/src/triggers/triggers-provider.js +37 -37
  106. package/src/ui/js/attach-css.js +1 -1
  107. package/src/ui/js/iam-css.js +1 -1
  108. package/src/ui/js/load-font-awesome.js +1 -1
  109. package/src/util/base-device-parser.js +1 -1
  110. package/src/util/braze-actions.js +4 -4
  111. package/src/util/browser-detector.js +11 -10
  112. package/src/util/client-hints-parser.js +3 -3
  113. package/src/util/component-utils.js +2 -2
  114. package/src/util/dom-utils.js +3 -3
  115. package/src/util/html-display-utils.js +1 -0
  116. package/src/util/key-codes.js +1 -1
  117. package/src/util/net.js +22 -23
  118. package/src/util/request-header-utils.js +23 -20
  119. package/src/util/user-agent-parser.js +14 -14
  120. package/src/util/validation-utils.js +14 -14
  121. package/src/util/window-utils.js +2 -2
@@ -5,17 +5,17 @@ export default class _t {
5
5
  constructor(t, e, i) {
6
6
  (this.eu = t),
7
7
  null == t && (t = G.Rt()),
8
- !i || isNaN(i) ? (this.Nl = new Date().valueOf()) : (this.Nl = i),
8
+ !i || isNaN(i) ? (this.zl = new Date().valueOf()) : (this.zl = i),
9
9
  (this.eu = t),
10
- (this.Al = new Date().valueOf()),
11
- (this.ql = e);
10
+ (this.Il = new Date().valueOf()),
11
+ (this.Al = e);
12
12
  }
13
- Bs() {
14
- return `g:${encodeURIComponent(this.eu)}|e:${this.ql}|c:${this.Nl}|l:${
15
- this.Al
13
+ bs() {
14
+ return `g:${encodeURIComponent(this.eu)}|e:${this.Al}|c:${this.zl}|l:${
15
+ this.Il
16
16
  }`;
17
17
  }
18
- static TE(t) {
18
+ static hE(t) {
19
19
  if ("string" != typeof t) return null;
20
20
  const e = t.lastIndexOf("|e:"),
21
21
  i = t.substring(0, e),
@@ -26,7 +26,7 @@ export default class _t {
26
26
  (t = t.replace(i, `g:${n}`))
27
27
  );
28
28
  }
29
- static Qn(t) {
29
+ static Yn(t) {
30
30
  let e;
31
31
  if ("string" == typeof t)
32
32
  try {
@@ -38,7 +38,7 @@ export default class _t {
38
38
  if (!isNaN(e)) return e;
39
39
  };
40
40
  (e = new _t(decodeURIComponent(r(i[0])), n(i[1]), n(i[2]))),
41
- (e.Al = n(i[3]));
41
+ (e.Il = n(i[3]));
42
42
  } catch (e) {
43
43
  N.info(
44
44
  `Unable to parse cookie string ${t}, failed with error: ${si(e)}`,
@@ -46,7 +46,7 @@ export default class _t {
46
46
  }
47
47
  else {
48
48
  if (null == t || null == t.g) return null;
49
- (e = new _t(t.g, t.e, t.c)), (e.Al = t.l);
49
+ (e = new _t(t.g, t.e, t.c)), (e.Il = t.l);
50
50
  }
51
51
  return e;
52
52
  }
@@ -2,26 +2,26 @@ import { rehydrateDateAfterJsonization as V } 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.Ln = i),
5
+ (this.Mn = i),
6
6
  (this.publicKey = s),
7
7
  (this.Vl = l),
8
- (this.El = h),
8
+ (this.vl = h),
9
9
  (this.endpoint = t || null),
10
- (this.Ln = i || null),
10
+ (this.Mn = i || null),
11
11
  (this.publicKey = s || null),
12
12
  (this.Vl = l || null),
13
- (this.El = h || null);
13
+ (this.vl = h || null);
14
14
  }
15
- Bs() {
15
+ bs() {
16
16
  return {
17
17
  e: this.endpoint,
18
- c: this.Ln,
18
+ c: this.Mn,
19
19
  p: this.publicKey,
20
20
  u: this.Vl,
21
- v: this.El,
21
+ v: this.vl,
22
22
  };
23
23
  }
24
- static Qn(t) {
24
+ static Yn(t) {
25
25
  return new ti(t.e, V(t.c), t.p, t.u, t.v);
26
26
  }
27
27
  }
@@ -15,46 +15,46 @@ export default class Jt {
15
15
  n = { enabled: !0, capacity: Zt, refill_rate: hi, endpoint_overrides: {} },
16
16
  o = { enabled: !1, max_placements: 0 },
17
17
  ) {
18
- (this.dl = t),
19
- (this.wl = i),
20
- (this.yl = s),
21
- (this.Ll = h),
22
- (this.Fl = e),
23
- (this.El = l),
24
- (this.vl = r),
25
- (this.Gi = a),
26
- (this.Cl = n),
18
+ (this.Rl = t),
19
+ (this.yl = i),
20
+ (this.Ll = s),
21
+ (this.Bl = h),
22
+ (this.Tl = e),
23
+ (this.vl = l),
24
+ (this.wl = r),
25
+ (this.je = a),
26
+ (this.El = n),
27
27
  (this.banners = o),
28
- (this.dl = t),
29
- (this.wl = i),
30
- (this.yl = s),
31
- (this.Ll = h),
32
- (this.Fl = e),
33
- (this.El = l),
34
- (this.vl = r),
35
- (this.Gi = a),
36
- (this.Cl = n),
28
+ (this.Rl = t),
29
+ (this.yl = i),
30
+ (this.Ll = s),
31
+ (this.Bl = h),
32
+ (this.Tl = e),
33
+ (this.vl = l),
34
+ (this.wl = r),
35
+ (this.je = a),
36
+ (this.El = n),
37
37
  (this.banners = o);
38
38
  }
39
- Bs() {
39
+ bs() {
40
40
  return {
41
- s: "5.6.0",
42
- l: this.dl,
43
- e: this.wl,
44
- a: this.yl,
45
- p: this.Ll,
46
- m: this.Fl,
47
- v: this.El,
48
- c: this.vl,
49
- f: this.Gi,
50
- grl: this.Cl,
41
+ s: "5.7.0",
42
+ l: this.Rl,
43
+ e: this.yl,
44
+ a: this.Ll,
45
+ p: this.Bl,
46
+ m: this.Tl,
47
+ v: this.vl,
48
+ c: this.wl,
49
+ f: this.je,
50
+ grl: this.El,
51
51
  b: this.banners,
52
52
  };
53
53
  }
54
- static Qn(t) {
54
+ static Yn(t) {
55
55
  let i = t.l;
56
56
  return (
57
- "5.6.0" !== t.s && (i = 0),
57
+ "5.7.0" !== t.s && (i = 0),
58
58
  new Jt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b)
59
59
  );
60
60
  }
@@ -5,187 +5,199 @@ import { randomInclusive as a } from "./util/math.js";
5
5
  import E from "./models/request-result.js";
6
6
  import {
7
7
  logger as N,
8
- IndexedDBAdapter as it,
8
+ IndexedDBAdapter as tt,
9
9
  Guid as G,
10
10
  EventTypes as d,
11
11
  } from "../shared-lib/index.js";
12
12
  import { STORAGE_KEYS as t } from "./managers/storage-manager.js";
13
13
  import u from "./managers/subscription-manager.js";
14
- import yt from "./Push/utils/push-utils.js";
14
+ import vt from "./Push/utils/push-utils.js";
15
15
  import h from "./util/request-header-utils.js";
16
16
  export default class Lt {
17
17
  constructor(t, i, s, e, h, o, n, r, l, a) {
18
- (this.yn = t),
18
+ (this.fn = t),
19
19
  (this.baseUrl = i),
20
20
  (this.T = s),
21
- (this.wn = e),
21
+ (this.dn = e),
22
22
  (this.As = h),
23
23
  (this.B = o),
24
24
  (this.C = n),
25
25
  (this.$l = r),
26
- (this.Yh = l),
26
+ (this.Qh = l),
27
27
  (this.S = a),
28
- (this.yn = t),
28
+ (this.fn = t),
29
29
  (this.baseUrl = i),
30
30
  (this.Pl = 0),
31
- (this.IE = n.OE() || 0),
32
- (this.Ol = null),
31
+ (this.dE = n.IE() || 0),
32
+ (this.Ul = null),
33
33
  (this.T = s),
34
- (this.wn = e),
34
+ (this.dn = e),
35
35
  (this.As = h),
36
36
  (this.B = o),
37
37
  (this.C = n),
38
- (this.Yh = l),
38
+ (this.Qh = l),
39
39
  (this.S = a),
40
40
  (this.$l = r),
41
- (this.Ul = new u()),
42
- (this._l = null),
43
- (this.Xl = 50),
44
- (this.Ql = !1);
41
+ (this._l = new u()),
42
+ (this.Xl = null),
43
+ (this.Ql = 50),
44
+ (this.Yl = !1);
45
45
  }
46
- Yl(t, i) {
47
- return !t && !i && this.Yh.Kh() >= this.Xl;
46
+ Zl(t, i) {
47
+ return !t && !i && this.Qh.Kh() >= this.Ql;
48
48
  }
49
- Zl(t) {
50
- let i = this.T.Hl();
49
+ sc(t) {
50
+ let i = this.T.Wl();
51
51
  if (t.length > 0) {
52
52
  const s = this.As.getUserId();
53
53
  for (const e of t) {
54
54
  const t = (!e.userId && !s) || e.userId === s;
55
- e.type === d.Jl && t && (i = !0);
55
+ e.type === d.Kl && t && (i = !0);
56
56
  }
57
57
  }
58
58
  return i;
59
59
  }
60
- sc(i = !1, s = !1, e = !0, o, n, r, u = !1, c = !1) {
61
- e && this.hc();
62
- const d = this.C.hE(),
63
- m = this.C.gE();
60
+ hc(i = !1, s = !1, e = !0, o, n, r, u = !1, c = !1) {
61
+ e && this.uc();
62
+ const d = this.C.AE(),
63
+ m = this.C.OE();
64
64
  let f = !1;
65
65
  const g = (i, s, u = -1) => {
66
- let c = !1;
67
- const d = new Date().valueOf();
68
- h.W(this.C, h.O.Xu, d),
69
- -1 !== u && s.push(["X-Braze-Req-Tokens-Remaining", u.toString()]),
70
- l.Y({
71
- url: this.baseUrl + "/data/",
72
- data: i,
73
- headers: s,
74
- ss: (e) => {
66
+ const c = new Date().valueOf();
67
+ h.W(this.C, h.O.zu, c),
68
+ -1 !== u && s.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
69
+ let d = !1;
70
+ l.Y({
71
+ url: this.baseUrl + "/data/",
72
+ data: i,
73
+ headers: s,
74
+ ss: (e) => {
75
+ null != i.respond_with &&
76
+ i.respond_with.triggers &&
77
+ (this.Pl = Math.max(this.Pl - 1, 0)),
78
+ this.S.ts(i, e, s)
79
+ ? (this.Qh.es(),
80
+ this.B.Cl(e),
81
+ (null != i.respond_with &&
82
+ i.respond_with.user_id != this.As.getUserId()) ||
83
+ (null != i.device && this.C.Bs(t.gs.$a, i.device),
84
+ null != i.sdk_metadata &&
85
+ (this.C.Bs(t.gs.qu, i.sdk_metadata),
86
+ this.C.Bs(t.gs.Au, this.T.Ss())),
87
+ this.$l(e),
88
+ h.Lu(this.C, h.O.zu, 1),
89
+ "function" == typeof o && o()))
90
+ : e.auth_error && (d = !0);
91
+ },
92
+ error: () => {
93
+ (d = !0),
75
94
  null != i.respond_with &&
76
95
  i.respond_with.triggers &&
77
96
  (this.Pl = Math.max(this.Pl - 1, 0)),
78
- this.S.ts(i, e, s)
79
- ? (this.Yh.es(),
80
- this.B.Rl(e),
81
- (null != i.respond_with &&
82
- i.respond_with.user_id != this.As.getUserId()) ||
83
- (null != i.device && this.C.js(t.bs.Xa, i.device),
84
- null != i.sdk_metadata &&
85
- (this.C.js(t.bs.qu, i.sdk_metadata),
86
- this.C.js(t.bs.Au, this.T.Ss())),
87
- this.$l(e),
88
- h.ns(this.C, h.O.Xu, 1),
89
- "function" == typeof o && o()))
90
- : e.auth_error && (c = !0);
91
- },
92
- error: () => {
93
- null != i.respond_with &&
94
- i.respond_with.triggers &&
95
- (this.Pl = Math.max(this.Pl - 1, 0)),
96
- this.S.Du(i.events, i.attributes),
97
- "function" == typeof n && n();
98
- },
99
- os: (t) => {
100
- if (("function" == typeof r && r(t), e && !f)) {
101
- if (t && !c) this.nc();
102
- else {
103
- h.hs(this.C, h.O.Xu);
104
- let t = this.Ol;
105
- (null == t || t < 1e3 * this.IE) && (t = 1e3 * this.IE),
106
- this.nc(Math.min(3e5, a(1e3 * this.IE, 3 * t)));
107
- }
108
- f = !0;
97
+ this.S.Du(i.events, i.attributes),
98
+ "function" == typeof n && n();
99
+ },
100
+ rs: (t, i) => {
101
+ "function" == typeof r && r(!d);
102
+ const s = this.S.Ou(i);
103
+ let o = 0;
104
+ if (s)
105
+ switch (s.type) {
106
+ case "date":
107
+ o = Math.max(s.value - new Date().valueOf(), 0);
108
+ break;
109
+ case "timestamp":
110
+ o = s.value;
109
111
  }
110
- },
111
- });
112
+ if (e && !f) {
113
+ if (d) {
114
+ h.Gu(this.C, h.O.zu);
115
+ let t = this.Ul;
116
+ (null == t || t < 1e3 * this.dE) && (t = 1e3 * this.dE);
117
+ const i = Math.min(3e5, a(1e3 * this.dE, 3 * t)) + o;
118
+ this.lc(i);
119
+ } else this.lc(Math.max(1e3 * this.dE, o));
120
+ f = !0;
121
+ }
122
+ },
123
+ });
112
124
  },
113
- v = this.Zl(d),
114
- p = s || v;
115
- if (this.Yl(u, v))
125
+ p = this.sc(d),
126
+ v = s || p;
127
+ if (this.Zl(u, p))
116
128
  return void N.info(
117
129
  "Declining to flush data due to 50 consecutive authentication failures",
118
130
  );
119
- if (e && !this.S.zu(d, m, i, p))
120
- return this.nc(), void ("function" == typeof r && r(!0));
121
- const b = this.S.ju(i, p, d, m, c);
122
- p && this.Pl++;
131
+ if (e && !this.S.Su(d, m, i, v))
132
+ return this.lc(), void ("function" == typeof r && r(!0));
133
+ const b = this.S.Bu(i, v, d, m, c);
134
+ v && this.Pl++;
123
135
  let w = !1;
124
136
  if (b)
125
137
  for (const t of b)
126
138
  this.S.V(
127
139
  t.requestData,
128
140
  (i) => g(t.requestData, t.headers, i),
129
- h.O.Xu,
141
+ h.O.zu,
130
142
  n,
131
143
  ),
132
144
  (w = !0);
133
- this.Yh.jh() && e && !w
134
- ? this.nc()
135
- : v && (N.info("Invoking new session subscriptions"), this.Ul.X());
145
+ this.Qh.jh() && e && !w
146
+ ? this.lc()
147
+ : p && (N.info("Invoking new session subscriptions"), this._l.X());
136
148
  }
137
- uc() {
149
+ cc() {
138
150
  return this.Pl > 0;
139
151
  }
140
- nc(t = 1e3 * this.IE) {
141
- this.Ql ||
142
- (this.hc(),
143
- (this._l = window.setTimeout(() => {
152
+ lc(t = 1e3 * this.dE) {
153
+ this.Yl ||
154
+ (this.uc(),
155
+ (this.Xl = window.setTimeout(() => {
144
156
  if (document.hidden) {
145
157
  const t = "visibilitychange",
146
158
  i = () => {
147
159
  document.hidden ||
148
- (document.removeEventListener(t, i, !1), this.sc());
160
+ (document.removeEventListener(t, i, !1), this.hc());
149
161
  };
150
162
  document.addEventListener(t, i, !1);
151
- } else this.sc();
163
+ } else this.hc();
152
164
  }, t)),
153
- (this.Ol = t));
165
+ (this.Ul = t));
154
166
  }
155
- hc() {
156
- null != this._l && (clearTimeout(this._l), (this._l = null));
167
+ uc() {
168
+ null != this.Xl && (clearTimeout(this.Xl), (this.Xl = null));
157
169
  }
158
170
  initialize() {
159
- (this.Ql = !1), this.nc();
171
+ (this.Yl = !1), this.lc();
160
172
  }
161
173
  destroy() {
162
- this.Ul.removeAllSubscriptions(),
163
- this.Yh.Hh(),
164
- this.hc(),
165
- (this.Ql = !0),
166
- this.sc(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
167
- (this._l = null);
174
+ this._l.removeAllSubscriptions(),
175
+ this.Qh.Hh(),
176
+ this.uc(),
177
+ (this.Yl = !0),
178
+ this.hc(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
179
+ (this.Xl = null);
168
180
  }
169
181
  rn(t) {
170
- return this.Ul.Ns(t);
182
+ return this._l.Fs(t);
171
183
  }
172
184
  openSession() {
173
- const i = this.T.Ss() !== this.T.qo();
174
- i && (this.C.cE(t.iu.Qo), this.C.cE(t.iu.su)),
175
- this.sc(void 0, !1, void 0, () => {
176
- this.C.Ls(t.bs.we);
185
+ const i = this.T.Ss() !== this.T.Eo();
186
+ i && (this.C.TE(t.iu.$h), this.C.TE(t.iu.su)),
187
+ this.hc(void 0, !1, void 0, () => {
188
+ this.C.Es(t.gs.$e);
177
189
  }),
178
- this.vu(),
190
+ this.bu(),
179
191
  i &&
180
192
  import("./Push/push-manager-factory.js").then((i) => {
181
- if (this.Ql) return;
193
+ if (this.Yl) return;
182
194
  const s = i.default.ea();
183
195
  if (
184
196
  null != s &&
185
- (yt.isPushPermissionGranted() || yt.isPushBlocked())
197
+ (vt.isPushPermissionGranted() || vt.isPushBlocked())
186
198
  ) {
187
199
  const i = () => {
188
- s.Tn()
200
+ s.jn()
189
201
  ? N.info(
190
202
  "Push token maintenance is disabled, not refreshing token for backend.",
191
203
  )
@@ -195,43 +207,43 @@ export default class Lt {
195
207
  s && i();
196
208
  },
197
209
  h = () => {
198
- const s = this.C.ps(t.bs.Kn);
210
+ const s = this.C.vs(t.gs.Bn);
199
211
  (null == s || s) && i();
200
212
  },
201
- o = it.Gs._s;
202
- new it(o, N).jr(o.Os.cu, e, h);
213
+ o = tt._s.Xs;
214
+ new tt(o, N).jr(o.Ks.cu, e, h);
203
215
  }
204
216
  });
205
217
  }
206
- lc() {
207
- this.C.Ls(t.bs.Yi), this.C.Ls(t.bs.wi), this.C.Ls(t.bs.cn);
218
+ dc() {
219
+ this.C.Es(t.gs.xe), this.C.Es(t.gs.di), this.C.Es(t.gs.on);
208
220
  }
209
221
  changeUser(i, s, e) {
210
222
  const h = this.As.getUserId();
211
223
  if (h !== i) {
212
- this.T.Kl(),
213
- this.lc(),
214
- null != h && this.sc(void 0, !1, void 0, void 0, void 0),
224
+ this.T.Ml(),
225
+ this.dc(),
226
+ null != h && this.hc(void 0, !1, void 0, void 0, void 0),
215
227
  this.As.ou(i),
216
- e ? this.Yh.setSdkAuthenticationSignature(e) : this.Yh.Bh();
228
+ e ? this.Qh.setSdkAuthenticationSignature(e) : this.Qh.Bh();
217
229
  for (let t = 0; t < s.length; t++) s[t].changeUser(null == h);
218
- null != h && this.C.Ls(t.bs.Ct),
219
- this.C.Ls(t.bs.Xa),
220
- this.C.Ls(t.bs.SE),
230
+ null != h && this.C.Es(t.gs.Ct),
231
+ this.C.Es(t.gs.$a),
232
+ this.C.Es(t.gs._E),
221
233
  this.openSession(),
222
234
  N.info('Changed user to "' + i + '".');
223
235
  } else {
224
236
  let t = "Doing nothing.";
225
237
  e &&
226
- this.Yh.xh() !== e &&
227
- (this.Yh.setSdkAuthenticationSignature(e),
238
+ this.Qh.xh() !== e &&
239
+ (this.Qh.setSdkAuthenticationSignature(e),
228
240
  (t = "Updated SDK authentication signature")),
229
241
  N.info(`Current user is already ${i}. ${t}`);
230
242
  }
231
243
  }
232
244
  requestImmediateDataFlush(t) {
233
- this.hc(), this.T.qo();
234
- this.sc(
245
+ this.uc(), this.T.Eo();
246
+ this.hc(
235
247
  void 0,
236
248
  void 0,
237
249
  void 0,
@@ -244,29 +256,29 @@ export default class Lt {
244
256
  );
245
257
  }
246
258
  requestFeedRefresh() {
247
- this.T.qo(), this.sc(!0);
259
+ this.T.Eo(), this.hc(!0);
248
260
  }
249
261
  vr(t, i) {
250
- this.T.qo(),
262
+ this.T.Eo(),
251
263
  N.info("Requesting explicit trigger refresh."),
252
- this.sc(void 0, !0, void 0, t, i);
264
+ this.hc(void 0, !0, void 0, t, i);
253
265
  }
254
- $n(i, s) {
255
- const e = d.cc,
266
+ Ln(i, s) {
267
+ const e = d.mc,
256
268
  h = { a: i, l: s },
257
- o = c.ds(e, h);
269
+ o = c.cs(e, h);
258
270
  return (
259
- o && (N.info(`Logged alias ${i} with label ${s}`), this.C.js(t.bs.SE, h)),
271
+ o && (N.info(`Logged alias ${i} with label ${s}`), this.C.Bs(t.gs._E, h)),
260
272
  o
261
273
  );
262
274
  }
263
- Zn(t, i, s) {
275
+ Gn(t, i, s) {
264
276
  if (this.B.hu(i))
265
277
  return (
266
278
  N.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new E()
267
279
  );
268
280
  const e = { key: i, value: s },
269
- h = c.ds(t, e);
281
+ h = c.cs(t, e);
270
282
  if (h) {
271
283
  const t = "object" == typeof s ? JSON.stringify(s, null, 2) : s;
272
284
  N.info(`Logged custom attribute: ${i} with value: ${t}`);
@@ -278,7 +290,7 @@ export default class Lt {
278
290
  null != e && (n.altitude = e),
279
291
  null != h && (n.ll_accuracy = h),
280
292
  null != o && (n.alt_accuracy = o);
281
- const r = c.ds(d.dc, n, t || void 0);
293
+ const r = c.cs(d.fc, n, t || void 0);
282
294
  return (
283
295
  r &&
284
296
  N.info(`Set user last known location as ${JSON.stringify(n, null, 2)}`),
@@ -286,30 +298,30 @@ export default class Lt {
286
298
  );
287
299
  }
288
300
  br(t, i) {
289
- const s = this.T.qo();
290
- return new ve(this.As.getUserId(), d.mc, t, s, { cid: i });
301
+ const s = this.T.Eo();
302
+ return new ve(this.As.getUserId(), d.gc, t, s, { cid: i });
291
303
  }
292
- fc(t, i) {
293
- return new it(t, i);
304
+ vc(t, i) {
305
+ return new tt(t, i);
294
306
  }
295
- vu() {
296
- const t = it.Gs._s;
297
- this.fc(t, N).setItem(t.Os.Xu, 1, {
307
+ bu() {
308
+ const t = tt._s.Xs;
309
+ this.vc(t, N).setItem(t.Ks.zu, 1, {
298
310
  baseUrl: this.baseUrl,
299
- data: { api_key: this.yn, device_id: this.wn.ce().id },
311
+ data: { api_key: this.fn, device_id: this.dn.ce().id },
300
312
  userId: this.As.getUserId(),
301
- sdkAuthEnabled: this.Yh.jh(),
313
+ sdkAuthEnabled: this.Qh.jh(),
302
314
  });
303
315
  }
304
316
  wr(t) {
305
317
  for (const i of t)
306
- if (i.api_key === this.yn) this.S.Du(i.events, i.attributes);
318
+ if (i.api_key === this.fn) this.S.Du(i.events, i.attributes);
307
319
  else {
308
- const t = it.Gs._s;
309
- new it(t, N).setItem(t.Os.$r, G.Rt(), i);
320
+ const t = tt._s.Xs;
321
+ new tt(t, N).setItem(t.Ks.$r, G.Rt(), i);
310
322
  }
311
323
  }
312
- gu(t, i, s) {
324
+ Zn(t, i, s) {
313
325
  if (this.B.hu(t))
314
326
  return (
315
327
  N.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new E()
@@ -317,13 +329,13 @@ export default class Lt {
317
329
  let e, h;
318
330
  return (
319
331
  null === i && null === s
320
- ? ((e = d.gc), (h = { key: t }))
321
- : ((e = d.vc), (h = { key: t, latitude: i, longitude: s })),
322
- c.ds(e, h)
332
+ ? ((e = d.bc), (h = { key: t }))
333
+ : ((e = d.wc), (h = { key: t, latitude: i, longitude: s })),
334
+ c.cs(e, h)
323
335
  );
324
336
  }
325
- yu(t, i) {
337
+ au(t, i) {
326
338
  const s = { group_id: t, status: i };
327
- return c.ds(d.bc, s);
339
+ return c.cs(d.kc, s);
328
340
  }
329
341
  }
@@ -1,14 +1,14 @@
1
1
  export default class ts {
2
2
  constructor(t) {
3
- (this.wc = t), (this.wc = t);
3
+ (this.xc = t), (this.xc = t);
4
4
  }
5
- xc(t) {
6
- return null == this.wc || this.wc === t[0];
5
+ yc(t) {
6
+ return null == this.xc || this.xc === t[0];
7
7
  }
8
8
  static fromJson(t) {
9
9
  return new ts(t ? t.event_name : null);
10
10
  }
11
- Bs() {
12
- return this.wc;
11
+ bs() {
12
+ return this.xc;
13
13
  }
14
14
  }