@braze/web-sdk 6.0.0 → 6.2.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 (147) hide show
  1. package/index.d.ts +103 -33
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +22 -22
  5. package/shared-lib/guid.js +3 -3
  6. package/shared-lib/indexed-db-adapter.js +19 -19
  7. package/shared-lib/logger.js +18 -18
  8. package/shared-lib/supported-options.js +15 -15
  9. package/src/Banner/banner-factory.js +2 -1
  10. package/src/Banner/banner-provider-factory.js +7 -7
  11. package/src/Banner/banner-provider.js +92 -98
  12. package/src/Banner/banner.js +21 -18
  13. package/src/Banner/display/banner-to-html.js +9 -9
  14. package/src/Banner/display/destroy-banner-html.js +2 -2
  15. package/src/Banner/display/detect-banner-impressions.js +2 -2
  16. package/src/Banner/get-all-banners.js +5 -5
  17. package/src/Banner/get-banner.js +7 -7
  18. package/src/Banner/log-banner-click.js +7 -7
  19. package/src/Banner/log-banner-impressions.js +9 -9
  20. package/src/Banner/request-banners-refresh.js +16 -20
  21. package/src/Banner/subscribe-to-banners-updates.js +7 -7
  22. package/src/Banner/ui/insert-banner.js +6 -6
  23. package/src/Card/card-manager-factory.js +7 -7
  24. package/src/Card/card-manager.js +35 -35
  25. package/src/Card/display/card-display.js +11 -11
  26. package/src/Card/log-card-dismissal.js +4 -4
  27. package/src/Card/log-content-card-click.js +4 -4
  28. package/src/Card/log-content-card-impressions.js +6 -6
  29. package/src/Card/models/captioned-image.js +21 -21
  30. package/src/Card/models/card.js +68 -68
  31. package/src/Card/models/classic-card.js +21 -21
  32. package/src/Card/models/control-card.js +11 -11
  33. package/src/Card/models/image-only.js +18 -18
  34. package/src/Card/util/card-factory.js +35 -35
  35. package/src/ContentCards/content-cards-provider-factory.js +13 -13
  36. package/src/ContentCards/content-cards-provider.js +136 -136
  37. package/src/ContentCards/get-cached-content-cards.js +2 -2
  38. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  39. package/src/ContentCards/subscribe-to-content-cards-updates.js +6 -6
  40. package/src/ContentCards/ui/show-content-cards.js +7 -7
  41. package/src/Core/add-sdk-metadata.js +3 -3
  42. package/src/Core/change-user.js +7 -7
  43. package/src/Core/destroy.js +2 -2
  44. package/src/Core/disable-sdk.js +8 -8
  45. package/src/Core/enable-sdk.js +6 -6
  46. package/src/Core/get-device-id.js +4 -4
  47. package/src/Core/handle-braze-action.js +5 -5
  48. package/src/Core/is-disabled.js +1 -1
  49. package/src/Core/log-custom-event.js +10 -10
  50. package/src/Core/log-purchase.js +13 -13
  51. package/src/Core/open-session.js +10 -10
  52. package/src/Core/set-logger.js +2 -2
  53. package/src/Core/set-sdk-authentication-signature.js +2 -2
  54. package/src/Core/toggle-logging.js +2 -2
  55. package/src/Core/wipe-data.js +7 -7
  56. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  57. package/src/FeatureFlags/feature-flag.js +20 -71
  58. package/src/FeatureFlags/feature-flags-provider-factory.js +12 -12
  59. package/src/FeatureFlags/feature-flags-provider.js +87 -87
  60. package/src/FeatureFlags/get-all-feature-flags.js +4 -4
  61. package/src/FeatureFlags/get-feature-flag.js +4 -4
  62. package/src/FeatureFlags/log-feature-flag-impression.js +9 -9
  63. package/src/FeatureFlags/refresh-feature-flags.js +2 -2
  64. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -4
  65. package/src/InAppMessage/defer-in-app-message.js +4 -4
  66. package/src/InAppMessage/display/html-message-to-html.js +10 -10
  67. package/src/InAppMessage/display/in-app-message-to-html.js +28 -28
  68. package/src/InAppMessage/display/modal-utils.js +7 -7
  69. package/src/InAppMessage/in-app-message-factory.js +15 -15
  70. package/src/InAppMessage/in-app-message-manager-factory.js +5 -5
  71. package/src/InAppMessage/in-app-message-manager.js +100 -100
  72. package/src/InAppMessage/log-in-app-message-button-click.js +9 -9
  73. package/src/InAppMessage/log-in-app-message-click.js +6 -6
  74. package/src/InAppMessage/log-in-app-message-html-click.js +9 -9
  75. package/src/InAppMessage/log-in-app-message-impression.js +4 -4
  76. package/src/InAppMessage/models/control-message.js +4 -4
  77. package/src/InAppMessage/models/full-screen-message.js +35 -35
  78. package/src/InAppMessage/models/html-message.js +21 -21
  79. package/src/InAppMessage/models/in-app-message-button.js +5 -5
  80. package/src/InAppMessage/models/in-app-message.js +75 -75
  81. package/src/InAppMessage/models/modal-message.js +34 -34
  82. package/src/InAppMessage/models/slide-up-message.js +31 -31
  83. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  84. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  85. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  86. package/src/InAppMessage/ui/show-in-app-message.js +19 -19
  87. package/src/Push/push-manager-factory.js +9 -9
  88. package/src/Push/push-manager.js +118 -118
  89. package/src/Push/utils/push-utils.js +9 -9
  90. package/src/User/user-manager.js +20 -20
  91. package/src/User/user.js +44 -45
  92. package/src/common/base-provider.js +1 -1
  93. package/src/common/content-cards-display.js +18 -18
  94. package/src/common/event-logger.js +10 -10
  95. package/src/common/properties-base.js +56 -0
  96. package/src/l10n/l10n-manager-factory.js +7 -7
  97. package/src/l10n/l10n-manager.js +4 -4
  98. package/src/managers/auth-manager.js +32 -32
  99. package/src/managers/braze-instance.js +143 -143
  100. package/src/managers/device-manager.js +22 -22
  101. package/src/managers/network-manager.js +172 -168
  102. package/src/managers/server-config-manager.js +73 -73
  103. package/src/managers/session-manager.js +40 -40
  104. package/src/managers/storage-manager-factory.js +6 -6
  105. package/src/managers/storage-manager.js +97 -97
  106. package/src/managers/subscription-manager.js +12 -12
  107. package/src/managers/utils.js +1 -1
  108. package/src/models/backend-errors.js +5 -5
  109. package/src/models/braze-event.js +5 -5
  110. package/src/models/device.js +2 -2
  111. package/src/models/identifier.js +12 -12
  112. package/src/models/push-token.js +13 -13
  113. package/src/models/request-result.js +4 -4
  114. package/src/models/server-config.js +31 -31
  115. package/src/request-controller.js +159 -159
  116. package/src/triggers/models/custom-event-data.js +1 -1
  117. package/src/triggers/models/custom-event-property-data.js +2 -2
  118. package/src/triggers/models/filter-set.js +6 -6
  119. package/src/triggers/models/filter.js +26 -26
  120. package/src/triggers/models/in-app-message-click-data.js +1 -1
  121. package/src/triggers/models/purchase-data.js +1 -1
  122. package/src/triggers/models/purchase-property-data.js +2 -2
  123. package/src/triggers/models/push-click-data.js +1 -1
  124. package/src/triggers/models/trigger-condition.js +37 -37
  125. package/src/triggers/models/trigger-events.js +3 -3
  126. package/src/triggers/models/trigger.js +16 -16
  127. package/src/triggers/triggers-provider-factory.js +12 -12
  128. package/src/triggers/triggers-provider.js +61 -61
  129. package/src/ui/js/attach-css.js +1 -1
  130. package/src/ui/js/load-font-awesome.js +1 -1
  131. package/src/util/base-device-parser.js +1 -1
  132. package/src/util/braze-actions.js +6 -6
  133. package/src/util/browser-detector.js +22 -13
  134. package/src/util/client-hints-parser.js +6 -6
  135. package/src/util/code-utils.js +2 -2
  136. package/src/util/component-utils.js +1 -1
  137. package/src/util/deprecation-utils.js +2 -2
  138. package/src/util/device-constants.js +4 -4
  139. package/src/util/dom-utils.js +9 -9
  140. package/src/util/html-display-utils.js +7 -7
  141. package/src/util/key-codes.js +1 -1
  142. package/src/util/net.js +12 -12
  143. package/src/util/request-header-utils.js +22 -22
  144. package/src/util/string-utils.js +2 -2
  145. package/src/util/user-agent-parser.js +16 -16
  146. package/src/util/validation-utils.js +12 -12
  147. package/src/util/window-utils.js +2 -2
@@ -15,46 +15,46 @@ export default class ni {
15
15
  n = { enabled: !0, capacity: hi, refill_rate: li, endpoint_overrides: {} },
16
16
  o = null,
17
17
  ) {
18
- (this.bu = t),
19
- (this.Cu = i),
20
- (this.Eu = s),
21
- (this.wu = h),
22
- (this.Lu = e),
23
- (this.pu = l),
24
- (this.Ru = r),
25
- (this.De = a),
26
- (this.vu = n),
18
+ (this.ol = t),
19
+ (this.bl = i),
20
+ (this.fl = s),
21
+ (this.vl = h),
22
+ (this.Cl = e),
23
+ (this.dl = l),
24
+ (this.gl = r),
25
+ (this.he = a),
26
+ (this.ml = n),
27
27
  (this.banners = o),
28
- (this.bu = t),
29
- (this.Cu = i),
30
- (this.Eu = s),
31
- (this.wu = h),
32
- (this.Lu = e),
33
- (this.pu = l),
34
- (this.Ru = r),
35
- (this.De = a),
36
- (this.vu = n),
28
+ (this.ol = t),
29
+ (this.bl = i),
30
+ (this.fl = s),
31
+ (this.vl = h),
32
+ (this.Cl = e),
33
+ (this.dl = l),
34
+ (this.gl = r),
35
+ (this.he = a),
36
+ (this.ml = n),
37
37
  (this.banners = o);
38
38
  }
39
- bt() {
39
+ dt() {
40
40
  return {
41
- s: "6.0.0",
42
- l: this.bu,
43
- e: this.Cu,
44
- a: this.Eu,
45
- p: this.wu,
46
- m: this.Lu,
47
- v: this.pu,
48
- c: this.Ru,
49
- f: this.De,
50
- grl: this.vu,
41
+ s: "6.2.0",
42
+ l: this.ol,
43
+ e: this.bl,
44
+ a: this.fl,
45
+ p: this.vl,
46
+ m: this.Cl,
47
+ v: this.dl,
48
+ c: this.gl,
49
+ f: this.he,
50
+ grl: this.ml,
51
51
  b: this.banners,
52
52
  };
53
53
  }
54
- static zn(t) {
54
+ static qn(t) {
55
55
  let i = t.l;
56
56
  return (
57
- "6.0.0" !== t.s && (i = 0),
57
+ "6.2.0" !== t.s && (i = 0),
58
58
  new ni(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b)
59
59
  );
60
60
  }
@@ -1,13 +1,13 @@
1
- import l from "./util/net.js";
1
+ import a from "./util/net.js";
2
2
  import ue from "./models/braze-event.js";
3
3
  import c from "./common/event-logger.js";
4
- import { randomInclusive as a } from "./util/math.js";
5
- import G from "./models/request-result.js";
4
+ import { randomInclusive as l } from "./util/math.js";
5
+ import H from "./models/request-result.js";
6
6
  import {
7
- logger as N,
7
+ logger as E,
8
8
  IndexedDBAdapter as et,
9
- Guid as O,
10
- EventTypes as d,
9
+ Guid as P,
10
+ EventTypes as m,
11
11
  } from "../shared-lib/index.js";
12
12
  import { STORAGE_KEYS as s } from "./managers/storage-manager.js";
13
13
  import u from "./managers/subscription-manager.js";
@@ -15,78 +15,78 @@ import yt from "./Push/utils/push-utils.js";
15
15
  import h from "./util/request-header-utils.js";
16
16
  export default class Wt {
17
17
  constructor(t, i, s, e, h, n, o, r, l, a) {
18
- (this.on = t),
18
+ (this.sn = t),
19
19
  (this.baseUrl = i),
20
- (this.T = s),
21
- (this.un = e),
20
+ (this.C = s),
21
+ (this.on = e),
22
22
  (this.Cs = h),
23
- (this.B = n),
24
- (this.C = o),
25
- (this.$u = r),
26
- (this.Na = l),
27
- (this.S = a),
28
- (this.on = t),
23
+ (this.h = n),
24
+ (this.j = o),
25
+ (this.$l = r),
26
+ (this.Qh = l),
27
+ (this.B = a),
28
+ (this.sn = t),
29
29
  (this.baseUrl = i),
30
- (this.Tu = 0),
30
+ (this.Tl = 0),
31
31
  (this.fE = o.dE() || 0),
32
- (this.Mu = null),
33
- (this.T = s),
34
- (this.un = e),
32
+ (this.Ll = null),
33
+ (this.C = s),
34
+ (this.on = e),
35
35
  (this.Cs = h),
36
- (this.B = n),
37
- (this.C = o),
38
- (this.Na = l),
39
- (this.S = a),
40
- (this.$u = r),
41
- (this.Pu = new u()),
42
- (this.Ou = null),
43
- (this.Uu = 50),
44
- (this._u = !1),
45
- (this.Xu = !1);
36
+ (this.h = n),
37
+ (this.j = o),
38
+ (this.Qh = l),
39
+ (this.B = a),
40
+ (this.$l = r),
41
+ (this.Ml = new u()),
42
+ (this.Pl = null),
43
+ (this.Il = 50),
44
+ (this.Ol = !1),
45
+ (this.Ul = !1);
46
46
  }
47
- Qu(t, i) {
48
- return !t && !i && this.Na.Jh() >= this.Uu;
47
+ _l(t, i) {
48
+ return !t && !i && this.Qh.Hh() >= this.Il;
49
49
  }
50
- Yu(t) {
51
- let i = this.T.zu();
50
+ Jl(t) {
51
+ let i = this.C.zl();
52
52
  if (t.length > 0) {
53
53
  const s = this.Cs.getUserId();
54
54
  for (const e of t) {
55
55
  const t = (!e.userId && !s) || e.userId === s;
56
- e.type === d.Iu && t && (i = !0);
56
+ e.type === m.Al && t && (i = !0);
57
57
  }
58
58
  }
59
59
  return i;
60
60
  }
61
- Zu(t = !1, i = !0, e, n, o, r = !1, u = !1) {
62
- i && this.sc();
63
- const c = this.C.RE(),
64
- d = this.C.IE();
61
+ Kl(t = !1, i = !0, e, n, o, r = !1, u = !1) {
62
+ i && this.Xl();
63
+ const c = this.j.RE(),
64
+ d = this.j.IE();
65
65
  let m = !1;
66
66
  const f = (t, r, u = -1) => {
67
67
  const c = new Date().valueOf();
68
- h.W(this.C, h.O.gl, c),
68
+ h.K(this.j, h.H.Tu, c),
69
69
  -1 !== u && r.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
70
70
  let d = !1;
71
- l.Y({
71
+ a.O({
72
72
  url: this.baseUrl + "/data/",
73
73
  data: t,
74
74
  headers: r,
75
- tt: (i) => {
75
+ W: (i) => {
76
76
  null != t.respond_with &&
77
77
  t.respond_with.triggers &&
78
- (this.Tu = Math.max(this.Tu - 1, 0)),
79
- this.S.st(t, i, r)
80
- ? (this.Na.it(),
81
- this.B.fu(i),
78
+ (this.Tl = Math.max(this.Tl - 1, 0)),
79
+ this.B.Y(t, i, r)
80
+ ? (this.Qh.Z(),
81
+ this.h.cl(i),
82
82
  (null != t.respond_with &&
83
83
  t.respond_with.user_id != this.Cs.getUserId()) ||
84
- (null != t.device && this.C.Bt(s.gt.Za, t.device),
84
+ (null != t.device && this.j.ft(s.ct.Qa, t.device),
85
85
  null != t.sdk_metadata &&
86
- (this.C.Bt(s.gt.rl, t.sdk_metadata),
87
- this.C.Bt(s.gt.ol, this.T.St())),
88
- this.$u(i),
89
- h.yl(this.C, h.O.gl, 1),
86
+ (this.j.ft(s.ct.au, t.sdk_metadata),
87
+ this.j.ft(s.ct.du, this.C.bt())),
88
+ this.$l(i),
89
+ h.Bu(this.j, h.H.Tu, 1),
90
90
  "function" == typeof e && e()))
91
91
  : i.auth_error && (d = !0);
92
92
  },
@@ -94,13 +94,13 @@ export default class Wt {
94
94
  (d = !0),
95
95
  null != t.respond_with &&
96
96
  t.respond_with.triggers &&
97
- (this.Tu = Math.max(this.Tu - 1, 0)),
98
- this.S.al(t.events, t.attributes),
97
+ (this.Tl = Math.max(this.Tl - 1, 0)),
98
+ this.B.fu(t.events, t.attributes),
99
99
  "function" == typeof n && n();
100
100
  },
101
- nt: (t, s) => {
101
+ tt: (t, s) => {
102
102
  "function" == typeof o && o(!d);
103
- const e = this.S.Ml(s);
103
+ const e = this.B.Fu(s);
104
104
  let n = 0;
105
105
  if (e)
106
106
  switch (e.type) {
@@ -112,98 +112,98 @@ export default class Wt {
112
112
  }
113
113
  if (i && !m) {
114
114
  if (d) {
115
- h.$l(this.C, h.O.gl);
116
- let t = this.Mu;
115
+ h.Ku(this.j, h.H.Tu);
116
+ let t = this.Ll;
117
117
  (null == t || t < 1e3 * this.fE) && (t = 1e3 * this.fE);
118
- const i = Math.min(3e5, a(1e3 * this.fE, 3 * t)) + n;
119
- this.hc(i);
120
- } else this.hc(Math.max(1e3 * this.fE, n));
118
+ const i = Math.min(3e5, l(1e3 * this.fE, 3 * t)) + n;
119
+ this.Ql(i);
120
+ } else this.Ql(Math.max(1e3 * this.fE, n));
121
121
  m = !0;
122
122
  }
123
123
  },
124
124
  });
125
125
  },
126
- g = this.Yu(c),
126
+ g = this.Jl(c),
127
127
  v = t || g;
128
- if (this.Qu(r, g))
129
- return void N.info(
128
+ if (this._l(r, g))
129
+ return void E.info(
130
130
  "Declining to flush data due to 50 consecutive authentication failures",
131
131
  );
132
- if (i && !this.S.vl(c, d, v))
133
- return this.hc(), void ("function" == typeof o && o(!0));
134
- const p = this.S.Rl(v, c, d, u);
135
- v && this.Tu++;
132
+ if (i && !this.B.Au(c, d, v))
133
+ return this.Ql(), void ("function" == typeof o && o(!0));
134
+ const p = this.B.Du(v, c, d, u);
135
+ v && this.Tl++;
136
136
  let b = !1;
137
137
  if (p)
138
138
  for (const t of p)
139
- this.S.V(
139
+ this.B.J(
140
140
  t.requestData,
141
141
  (i) => f(t.requestData, t.headers, i),
142
- h.O.gl,
142
+ h.H.Tu,
143
143
  n,
144
144
  ),
145
145
  (b = !0);
146
- this.Na.wh() && i && !b
147
- ? this.hc()
146
+ this.Qh.fh() && i && !b
147
+ ? this.Ql()
148
148
  : g &&
149
- (N.info("Invoking new session subscriptions"),
150
- this.Pu.X(),
151
- (this.Xu = !0));
149
+ (E.info("Invoking new session subscriptions"),
150
+ this.Ml.L(),
151
+ (this.Ul = !0));
152
152
  }
153
- nc() {
154
- return this.Tu > 0;
153
+ Yl() {
154
+ return this.Tl > 0;
155
155
  }
156
- hc(t = 1e3 * this.fE) {
157
- this._u ||
158
- (this.sc(),
159
- (this.Ou = window.setTimeout(() => {
156
+ Ql(t = 1e3 * this.fE) {
157
+ this.Ol ||
158
+ (this.Xl(),
159
+ (this.Pl = window.setTimeout(() => {
160
160
  if (document.hidden) {
161
161
  const t = "visibilitychange",
162
162
  i = () => {
163
163
  document.hidden ||
164
- (document.removeEventListener(t, i, !1), this.Zu());
164
+ (document.removeEventListener(t, i, !1), this.Kl());
165
165
  };
166
166
  document.addEventListener(t, i, !1);
167
- } else this.Zu();
167
+ } else this.Kl();
168
168
  }, t)),
169
- (this.Mu = t));
169
+ (this.Ll = t));
170
170
  }
171
- sc() {
172
- null != this.Ou && (clearTimeout(this.Ou), (this.Ou = null));
171
+ Xl() {
172
+ null != this.Pl && (clearTimeout(this.Pl), (this.Pl = null));
173
173
  }
174
174
  initialize() {
175
- (this._u = !1), this.hc();
175
+ (this.Ol = !1), this.Ql();
176
176
  }
177
177
  destroy() {
178
- this.Pu.removeAllSubscriptions(),
179
- this.Na.Gh(),
180
- this.sc(),
181
- (this._u = !0),
182
- this.Zu(void 0, !1, void 0, void 0, void 0, void 0, !0),
183
- (this.Ou = null),
184
- (this.Xu = !1);
178
+ this.Ml.removeAllSubscriptions(),
179
+ this.Qh.Bh(),
180
+ this.Xl(),
181
+ (this.Ol = !0),
182
+ this.Kl(void 0, !1, void 0, void 0, void 0, void 0, !0),
183
+ (this.Pl = null),
184
+ (this.Ul = !1);
185
185
  }
186
186
  rn(t) {
187
- return this.Xu ? (t(), null) : this.Pu.Dt(t);
187
+ return this.Ul ? (t(), null) : this.Ml.wt(t);
188
188
  }
189
189
  openSession() {
190
- const t = this.T.St() !== this.T.Vo();
191
- t && (this.C.hE(s.iu.Qh), this.C.hE(s.iu.su)),
192
- this.Zu(!1, void 0, () => {
193
- this.C.Ut(s.gt.Ge);
190
+ const t = this.C.bt() !== this.C.qo();
191
+ t && (this.j.hE(s.iu.Jh), this.j.hE(s.iu.su)),
192
+ this.Kl(!1, void 0, () => {
193
+ this.j.Nt(s.ct.qe);
194
194
  }),
195
- this.Jn(),
195
+ this.zn(),
196
196
  t &&
197
197
  import("./Push/push-manager-factory.js").then((t) => {
198
- if (this._u) return;
198
+ if (this.Ol) return;
199
199
  const i = t.default.ea();
200
200
  if (
201
201
  null != i &&
202
202
  (yt.isPushPermissionGranted() || yt.isPushBlocked())
203
203
  ) {
204
204
  const t = () => {
205
- i.gn()
206
- ? N.info(
205
+ i.mn()
206
+ ? E.info(
207
207
  "Push token maintenance is disabled, not refreshing token for backend.",
208
208
  )
209
209
  : i.subscribe();
@@ -212,89 +212,89 @@ export default class Wt {
212
212
  s && t();
213
213
  },
214
214
  h = () => {
215
- const i = this.C.ft(s.gt.Vn);
215
+ const i = this.j.lt(s.ct.In);
216
216
  (null == i || i) && t();
217
217
  },
218
- n = et.Ds.Us;
219
- new et(n, N).jr(n.Ls.cu, e, h);
218
+ n = et.Us.Rs;
219
+ new et(n, E).jr(n.Fs.cu, e, h);
220
220
  }
221
221
  });
222
222
  }
223
- lc() {
224
- this.C.Ut(s.gt.Xe), this.C.Ut(s.gt.Xs), this.C.Ut(s.gt.Fr);
223
+ Zl() {
224
+ this.j.Nt(s.ct.Ie), this.j.Nt(s.ct.Ps), this.j.Nt(s.ct.Nr);
225
225
  }
226
- uc() {
226
+ hc() {
227
227
  var t, i;
228
- this.C.Ut(s.gt.zl), this.C.Ut(s.gt.SE);
229
- const e = h.O;
228
+ this.j.Nt(s.ct.Lu), this.j.Nt(s.ct.SE);
229
+ const e = h.H;
230
230
  for (const i in e) {
231
231
  const s = e[i];
232
- this.S.El(s, null === (t = this.B) || void 0 === t ? void 0 : t._l(s));
232
+ this.B.Uu(s, null === (t = this.h) || void 0 === t ? void 0 : t.Vu(s));
233
233
  }
234
- this.S.Xl(null === (i = this.B) || void 0 === i ? void 0 : i.Ol());
234
+ this.B.Iu(null === (i = this.h) || void 0 === i ? void 0 : i.Ju());
235
235
  }
236
236
  changeUser(t, i, e) {
237
237
  const h = this.Cs.getUserId();
238
238
  if (h !== t) {
239
- this.T.Ju(),
240
- this.lc(),
241
- null != h && this.Zu(void 0, !1, void 0, void 0, void 0),
239
+ this.C.Bl(),
240
+ this.Zl(),
241
+ null != h && this.Kl(void 0, !1, void 0, void 0, void 0),
242
242
  this.Cs.ou(t),
243
- e ? this.Na.setSdkAuthenticationSignature(e) : this.Na.yh();
243
+ e ? this.Qh.setSdkAuthenticationSignature(e) : this.Qh.qh();
244
244
  for (let t = 0; t < i.length; t++) i[t].changeUser(null == h);
245
- this.S.fo(),
246
- null != h && this.C.Ut(s.gt.rE),
247
- this.C.Ut(s.gt.Za),
248
- this.C.Ut(s.gt.uE),
249
- this.uc(),
245
+ this.B.fo(),
246
+ null != h && this.j.Nt(s.ct.rE),
247
+ this.j.Nt(s.ct.Qa),
248
+ this.j.Nt(s.ct.uE),
249
+ this.hc(),
250
250
  this.openSession(),
251
- N.info('Changed user to "' + t + '".');
251
+ E.info('Changed user to "' + t + '".');
252
252
  } else {
253
253
  let i = "Doing nothing.";
254
254
  e &&
255
- this.Na.jh() !== e &&
256
- (this.Na.setSdkAuthenticationSignature(e),
255
+ this.Qh.wh() !== e &&
256
+ (this.Qh.setSdkAuthenticationSignature(e),
257
257
  (i = "Updated SDK authentication signature")),
258
- N.info(`Current user is already ${t}. ${i}`);
258
+ E.info(`Current user is already ${t}. ${i}`);
259
259
  }
260
260
  }
261
261
  requestImmediateDataFlush(t) {
262
- this.sc(), this.T.Vo();
263
- this.Zu(
262
+ this.Xl(), this.C.qo();
263
+ this.Kl(
264
264
  void 0,
265
265
  void 0,
266
266
  void 0,
267
267
  () => {
268
- N.error("Failed to flush data, request will be retried automatically.");
268
+ E.error("Failed to flush data, request will be retried automatically.");
269
269
  },
270
270
  t,
271
271
  !0,
272
272
  );
273
273
  }
274
- vr(t, i) {
275
- this.T.Vo(),
276
- N.info("Requesting explicit trigger refresh."),
277
- this.Zu(!0, void 0, t, i);
274
+ $r(t, i) {
275
+ this.C.qo(),
276
+ E.info("Requesting explicit trigger refresh."),
277
+ this.Kl(!0, void 0, t, i);
278
278
  }
279
279
  En(t, i) {
280
- const e = d.cc,
280
+ const e = m.nc,
281
281
  h = { a: t, l: i },
282
- n = c.ut(e, h);
282
+ n = c.rt(e, h);
283
283
  return (
284
- n && (N.info(`Logged alias ${t} with label ${i}`), this.C.Bt(s.gt.uE, h)),
284
+ n && (E.info(`Logged alias ${t} with label ${i}`), this.j.ft(s.ct.uE, h)),
285
285
  n
286
286
  );
287
287
  }
288
288
  Ln(t, i, s) {
289
- if (this.B.hu(i))
289
+ if (this.h.hu(i))
290
290
  return (
291
- N.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new G()
291
+ E.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new H()
292
292
  );
293
293
  const e = { key: i, value: s },
294
- h = c.ut(t, e);
294
+ h = c.rt(t, e);
295
295
  if (h) {
296
296
  const t = "object" == typeof s ? JSON.stringify(s, null, 2) : s;
297
- N.info(`Logged custom attribute: ${i} with value: ${t}`);
297
+ E.info(`Logged custom attribute: ${i} with value: ${t}`);
298
298
  }
299
299
  return h;
300
300
  }
@@ -303,52 +303,52 @@ export default class Wt {
303
303
  null != e && (o.altitude = e),
304
304
  null != h && (o.ll_accuracy = h),
305
305
  null != n && (o.alt_accuracy = n);
306
- const r = c.ut(d.dc, o, t || void 0);
306
+ const r = c.rt(m.lc, o, t || void 0);
307
307
  return (
308
308
  r &&
309
- N.info(`Set user last known location as ${JSON.stringify(o, null, 2)}`),
309
+ E.info(`Set user last known location as ${JSON.stringify(o, null, 2)}`),
310
310
  r
311
311
  );
312
312
  }
313
- br(t, i) {
314
- const s = this.T.Vo();
315
- return new ue(this.Cs.getUserId(), d.mc, t, s, { cid: i });
313
+ kr(t, i) {
314
+ const s = this.C.qo();
315
+ return new ue(this.Cs.getUserId(), m.uc, t, s, { cid: i });
316
316
  }
317
- fc(t, i) {
317
+ cc(t, i) {
318
318
  return new et(t, i);
319
319
  }
320
- Jn() {
321
- const t = et.Ds.Us;
322
- this.fc(t, N).setItem(t.Ls.gl, 1, {
320
+ zn() {
321
+ const t = et.Us.Rs;
322
+ this.cc(t, E).setItem(t.Fs.Tu, 1, {
323
323
  baseUrl: this.baseUrl,
324
- data: { api_key: this.on, device_id: this.un.ve().id },
324
+ data: { api_key: this.sn, device_id: this.on.fe().id },
325
325
  userId: this.Cs.getUserId(),
326
- sdkAuthEnabled: this.Na.wh(),
326
+ sdkAuthEnabled: this.Qh.fh(),
327
327
  });
328
328
  }
329
- wr(t) {
329
+ yr(t) {
330
330
  for (const i of t)
331
- if (i.api_key === this.on) this.S.al(i.events, i.attributes);
331
+ if (i.api_key === this.sn) this.B.fu(i.events, i.attributes);
332
332
  else {
333
- const t = et.Ds.Us;
334
- new et(t, N).setItem(t.Ls.$r, O.ce(), i);
333
+ const t = et.Us.Rs;
334
+ new et(t, E).setItem(t.Fs.wr, P.oe(), i);
335
335
  }
336
336
  }
337
337
  Hn(t, i, s) {
338
- if (this.B.hu(t))
338
+ if (this.h.hu(t))
339
339
  return (
340
- N.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new G()
340
+ E.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new H()
341
341
  );
342
342
  let e, h;
343
343
  return (
344
344
  null === i && null === s
345
- ? ((e = d.gc), (h = { key: t }))
346
- : ((e = d.vc), (h = { key: t, latitude: i, longitude: s })),
347
- c.ut(e, h)
345
+ ? ((e = m.dc), (h = { key: t }))
346
+ : ((e = m.mc), (h = { key: t, latitude: i, longitude: s })),
347
+ c.rt(e, h)
348
348
  );
349
349
  }
350
350
  Kn(t, i) {
351
351
  const s = { group_id: t, status: i };
352
- return c.ut(d.bc, s);
352
+ return c.rt(m.fc, s);
353
353
  }
354
354
  }
@@ -8,7 +8,7 @@ export default class rs {
8
8
  static fromJson(t) {
9
9
  return new rs(t ? t.event_name : null);
10
10
  }
11
- bt() {
11
+ dt() {
12
12
  return this.wc;
13
13
  }
14
14
  }
@@ -15,7 +15,7 @@ export default class ls {
15
15
  t ? is.fromJson(t.property_filters) : null,
16
16
  );
17
17
  }
18
- bt() {
19
- return { e: this.wc, pf: this.tf ? this.tf.bt() : null };
18
+ dt() {
19
+ return { e: this.wc, pf: this.tf ? this.tf.dt() : null };
20
20
  }
21
21
  }
@@ -1,4 +1,4 @@
1
- import lr from "./filter.js";
1
+ import fr from "./filter.js";
2
2
  import { isArray as D } from "../../util/code-utils.js";
3
3
  export default class is {
4
4
  constructor(t) {
@@ -27,27 +27,27 @@ export default class is {
27
27
  for (let e = 0; e < t.length; e++) {
28
28
  const o = [],
29
29
  s = t[e];
30
- for (let t = 0; t < s.length; t++) o.push(lr.fromJson(s[t]));
30
+ for (let t = 0; t < s.length; t++) o.push(fr.fromJson(s[t]));
31
31
  r.push(o);
32
32
  }
33
33
  return new is(r);
34
34
  }
35
- bt() {
35
+ dt() {
36
36
  const t = [];
37
37
  for (let r = 0; r < this.filters.length; r++) {
38
38
  const e = this.filters[r],
39
39
  o = [];
40
- for (let t = 0; t < e.length; t++) o.push(e[t].bt());
40
+ for (let t = 0; t < e.length; t++) o.push(e[t].dt());
41
41
  t.push(o);
42
42
  }
43
43
  return t;
44
44
  }
45
- static zn(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.zn(s[t]));
50
+ for (let t = 0; t < s.length; t++) o.push(fr.qn(s[t]));
51
51
  r.push(o);
52
52
  }
53
53
  return new is(r);