@braze/web-sdk 6.4.0 → 6.6.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 (155) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +11 -5
  3. package/package.json +1 -1
  4. package/shared-lib/encoding-utils.js +3 -3
  5. package/shared-lib/event-types.js +30 -30
  6. package/shared-lib/guid.js +3 -3
  7. package/shared-lib/indexed-db-adapter.js +58 -58
  8. package/shared-lib/logger.js +7 -7
  9. package/shared-lib/supported-options.js +17 -16
  10. package/src/Banner/banner-provider.js +95 -81
  11. package/src/Banner/banner.js +9 -9
  12. package/src/Banner/constants.js +4 -0
  13. package/src/Banner/display/banner-to-html.js +1 -1
  14. package/src/Banner/display/destroy-banner-html.js +3 -3
  15. package/src/Banner/display/detect-banner-impressions.js +14 -14
  16. package/src/Banner/get-all-banners.js +4 -4
  17. package/src/Banner/get-banner.js +5 -4
  18. package/src/Banner/log-banner-click.js +2 -2
  19. package/src/Banner/log-banner-impressions.js +6 -6
  20. package/src/Banner/request-banners-refresh.js +18 -20
  21. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  22. package/src/Banner/ui/insert-banner.js +17 -14
  23. package/src/Card/card-manager-factory.js +3 -3
  24. package/src/Card/card-manager.js +32 -32
  25. package/src/Card/constants.js +1 -0
  26. package/src/Card/display/card-display.js +11 -11
  27. package/src/Card/log-card-dismissal.js +2 -2
  28. package/src/Card/log-content-card-click.js +2 -2
  29. package/src/Card/log-content-card-impressions.js +5 -5
  30. package/src/Card/models/captioned-image.js +3 -3
  31. package/src/Card/models/card.js +16 -16
  32. package/src/Card/models/classic-card.js +3 -3
  33. package/src/Card/models/control-card.js +3 -3
  34. package/src/Card/models/image-only.js +3 -3
  35. package/src/Card/util/card-factory.js +6 -6
  36. package/src/ContentCards/content-cards-provider-factory.js +11 -11
  37. package/src/ContentCards/content-cards-provider.js +110 -96
  38. package/src/ContentCards/get-cached-content-cards.js +2 -2
  39. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  40. package/src/ContentCards/subscribe-to-content-cards-updates.js +5 -5
  41. package/src/ContentCards/ui/show-content-cards.js +5 -5
  42. package/src/Core/add-sdk-metadata.js +2 -2
  43. package/src/Core/change-user.js +4 -4
  44. package/src/Core/disable-sdk.js +9 -8
  45. package/src/Core/enable-sdk.js +5 -5
  46. package/src/Core/get-device-id.js +2 -2
  47. package/src/Core/handle-braze-action.js +3 -3
  48. package/src/Core/is-disabled.js +1 -1
  49. package/src/Core/log-custom-event.js +13 -13
  50. package/src/Core/log-purchase.js +10 -10
  51. package/src/Core/open-session.js +7 -7
  52. package/src/Core/set-sdk-authentication-signature.js +2 -2
  53. package/src/Core/wipe-data.js +6 -6
  54. package/src/DUST/dust-connection-core.js +23 -0
  55. package/src/DUST/dust-provider-factory.js +10 -8
  56. package/src/DUST/dust-provider.js +408 -176
  57. package/src/DUST/dust-shared-worker-code.js +2 -0
  58. package/src/DUST/dust-shared-worker-impl.js +240 -0
  59. package/src/DUST/dust-worker-bridge.js +136 -0
  60. package/src/DUST/index.js +10 -0
  61. package/src/DUST/subscribe-to-dust.js +13 -13
  62. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  63. package/src/FeatureFlags/feature-flag.js +6 -6
  64. package/src/FeatureFlags/feature-flags-provider-factory.js +9 -9
  65. package/src/FeatureFlags/feature-flags-provider.js +98 -84
  66. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  67. package/src/FeatureFlags/get-feature-flag.js +3 -3
  68. package/src/FeatureFlags/log-feature-flag-impression.js +7 -7
  69. package/src/FeatureFlags/refresh-feature-flags.js +2 -2
  70. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -4
  71. package/src/InAppMessage/constants.js +4 -0
  72. package/src/InAppMessage/defer-in-app-message.js +2 -2
  73. package/src/InAppMessage/display/get-animation-effect.js +1 -1
  74. package/src/InAppMessage/display/html-message-to-html.js +6 -6
  75. package/src/InAppMessage/display/in-app-message-to-html.js +40 -40
  76. package/src/InAppMessage/display/modal-utils.js +16 -16
  77. package/src/InAppMessage/get-deferred-in-app-message.js +2 -2
  78. package/src/InAppMessage/in-app-message-factory.js +4 -4
  79. package/src/InAppMessage/in-app-message-manager-factory.js +7 -7
  80. package/src/InAppMessage/in-app-message-manager.js +97 -97
  81. package/src/InAppMessage/log-in-app-message-button-click.js +14 -14
  82. package/src/InAppMessage/log-in-app-message-click.js +13 -13
  83. package/src/InAppMessage/log-in-app-message-html-click.js +11 -11
  84. package/src/InAppMessage/log-in-app-message-impression.js +8 -8
  85. package/src/InAppMessage/models/control-message.js +5 -5
  86. package/src/InAppMessage/models/full-screen-message.js +18 -18
  87. package/src/InAppMessage/models/html-message.js +19 -19
  88. package/src/InAppMessage/models/in-app-message-button.js +7 -7
  89. package/src/InAppMessage/models/in-app-message.js +121 -119
  90. package/src/InAppMessage/models/modal-message.js +18 -18
  91. package/src/InAppMessage/models/slide-up-message.js +23 -23
  92. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  93. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  94. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +5 -5
  95. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +8 -8
  96. package/src/InAppMessage/ui/show-in-app-message.js +34 -34
  97. package/src/Push/push-manager-factory.js +14 -14
  98. package/src/Push/push-manager.js +90 -90
  99. package/src/Push/request-push-permission.js +1 -1
  100. package/src/Push/unregister-push.js +1 -1
  101. package/src/Push/utils/push-utils.js +9 -9
  102. package/src/User/user-manager.js +32 -32
  103. package/src/User/user.js +71 -71
  104. package/src/common/constants.js +8 -11
  105. package/src/common/content-cards-display.js +32 -32
  106. package/src/common/event-logger.js +10 -10
  107. package/src/common/properties-base.js +16 -16
  108. package/src/l10n/l10n-manager-factory.js +11 -11
  109. package/src/l10n/l10n-manager.js +2 -2
  110. package/src/managers/auth-manager.js +14 -14
  111. package/src/managers/braze-instance.js +163 -159
  112. package/src/managers/device-manager.js +11 -11
  113. package/src/managers/network-manager.js +154 -154
  114. package/src/managers/server-config-manager.js +116 -88
  115. package/src/managers/session-manager.js +41 -41
  116. package/src/managers/storage-manager-factory.js +13 -13
  117. package/src/managers/storage-manager.js +130 -131
  118. package/src/managers/subscription-manager.js +12 -12
  119. package/src/managers/utils.js +1 -1
  120. package/src/models/backend-errors.js +5 -5
  121. package/src/models/braze-event.js +10 -10
  122. package/src/models/device.js +2 -2
  123. package/src/models/identifier.js +17 -17
  124. package/src/models/push-token.js +14 -14
  125. package/src/models/request-result.js +4 -4
  126. package/src/models/server-config.js +41 -37
  127. package/src/request-controller.js +163 -160
  128. package/src/triggers/models/custom-event-data.js +5 -5
  129. package/src/triggers/models/custom-event-property-data.js +6 -6
  130. package/src/triggers/models/filter-set.js +8 -8
  131. package/src/triggers/models/filter.js +7 -7
  132. package/src/triggers/models/in-app-message-click-data.js +13 -13
  133. package/src/triggers/models/purchase-data.js +2 -2
  134. package/src/triggers/models/purchase-property-data.js +6 -6
  135. package/src/triggers/models/push-click-data.js +6 -6
  136. package/src/triggers/models/trigger-condition.js +47 -47
  137. package/src/triggers/models/trigger-events.js +2 -2
  138. package/src/triggers/models/trigger.js +42 -42
  139. package/src/triggers/triggers-provider-factory.js +5 -5
  140. package/src/triggers/triggers-provider.js +66 -66
  141. package/src/ui/js/attach-css.js +3 -3
  142. package/src/ui/js/load-font-awesome.js +2 -2
  143. package/src/util/base-device-parser.js +8 -8
  144. package/src/util/braze-actions.js +5 -5
  145. package/src/util/browser-detector.js +33 -33
  146. package/src/util/client-hints-parser.js +10 -10
  147. package/src/util/component-utils.js +5 -5
  148. package/src/util/dom-utils.js +13 -13
  149. package/src/util/html-display-utils.js +7 -7
  150. package/src/util/key-codes.js +1 -1
  151. package/src/util/net.js +6 -6
  152. package/src/util/request-header-utils.js +26 -26
  153. package/src/util/user-agent-parser.js +20 -20
  154. package/src/util/validation-utils.js +16 -16
  155. package/src/util/window-utils.js +3 -3
@@ -1,93 +1,93 @@
1
- import a from "./util/net.js";
2
- import ue from "./models/braze-event.js";
3
- import c from "./common/event-logger.js";
4
- import { randomInclusive as l } from "./util/math.js";
5
- import G from "./models/request-result.js";
1
+ import l from "./util/net.js";
2
+ import De from "./models/braze-event.js";
3
+ import v from "./common/event-logger.js";
4
+ import { randomInclusive as a } from "./util/math.js";
5
+ import H from "./models/request-result.js";
6
6
  import {
7
7
  logger as E,
8
- IndexedDBAdapter as it,
9
- Guid as L,
10
- EventTypes as m,
8
+ IndexedDBAdapter as et,
9
+ Guid as P,
10
+ EventTypes as f,
11
11
  } from "../shared-lib/index.js";
12
12
  import { STORAGE_KEYS as s } from "./managers/storage-manager.js";
13
- import u from "./managers/subscription-manager.js";
13
+ import m from "./managers/subscription-manager.js";
14
14
  import vt from "./Push/utils/push-utils.js";
15
15
  import h from "./util/request-header-utils.js";
16
- import { removeAllVisibleInAppMessages as oi } from "./InAppMessage/ui/remove-all-visible-in-app-messages.js";
16
+ import { removeAllVisibleInAppMessages as di } from "./InAppMessage/ui/remove-all-visible-in-app-messages.js";
17
17
  export default class Wt {
18
- constructor(t, i, s, e, h, n, o, r, l, a) {
19
- (this.Pn = t),
18
+ constructor(t, i, s, e, h, n, o, r, l, u) {
19
+ (this.tu = t),
20
20
  (this.baseUrl = i),
21
21
  (this.C = s),
22
- (this.Dn = e),
23
- (this.Cs = h),
22
+ (this.eu = e),
23
+ (this.vs = h),
24
24
  (this.h = n),
25
- (this.j = o),
26
- (this.fc = r),
27
- (this.La = l),
28
- (this.B = a),
29
- (this.Pn = t),
25
+ (this.B = o),
26
+ (this.$c = r),
27
+ (this.al = l),
28
+ (this.j = u),
29
+ (this.tu = t),
30
30
  (this.baseUrl = i),
31
- (this.vc = 0),
31
+ (this.sd = 0),
32
32
  (this.bE = o.dE() || 0),
33
- (this.bc = null),
33
+ (this.hd = null),
34
34
  (this.C = s),
35
- (this.Dn = e),
36
- (this.Cs = h),
35
+ (this.eu = e),
36
+ (this.vs = h),
37
37
  (this.h = n),
38
- (this.j = o),
39
- (this.La = l),
40
- (this.B = a),
41
- (this.fc = r),
42
- (this.wc = new u()),
43
- (this.kc = null),
44
- (this.yc = 50),
45
- (this.jc = !1),
46
- (this.Sc = !1);
38
+ (this.B = o),
39
+ (this.al = l),
40
+ (this.j = u),
41
+ (this.$c = r),
42
+ (this.nd = new m()),
43
+ (this.rd = null),
44
+ (this.ld = 50),
45
+ (this.ud = !1),
46
+ (this.ad = !1);
47
47
  }
48
- Ac(t, i) {
49
- return !t && !i && this.La.Jh() >= this.yc;
48
+ md(t, i) {
49
+ return !t && !i && this.al.Jh() >= this.ld;
50
50
  }
51
- Dc(t) {
52
- let i = this.C.Ul();
51
+ fd(t) {
52
+ let i = this.C.am();
53
53
  if (t.length > 0) {
54
- const s = this.Cs.getUserId();
54
+ const s = this.vs.getUserId();
55
55
  for (const e of t) {
56
56
  const t = (!e.userId && !s) || e.userId === s;
57
- e.type === m.sm && t && (i = !0);
57
+ e.type === f.Sm && t && (i = !0);
58
58
  }
59
59
  }
60
60
  return i;
61
61
  }
62
- $c(t = !1, i = !0, e, n, o, r = !1, u = !1) {
63
- i && this.qc();
64
- const c = this.j.RE(),
65
- d = this.j.IE();
62
+ gd(t = !1, i = !0, e, n, o, r = !1, u = !1) {
63
+ i && this.pd();
64
+ const c = this.B.RE(),
65
+ d = this.B.IE();
66
66
  let m = !1;
67
67
  const f = (t, r, u = -1) => {
68
68
  const c = new Date().valueOf();
69
- h.K(this.j, h.H.Yi, c),
69
+ h.K(this.B, h.H._e, c),
70
70
  -1 !== u && r.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
71
71
  let d = !1;
72
- a.O({
72
+ l.O({
73
73
  url: this.baseUrl + "/data/",
74
74
  data: t,
75
75
  headers: r,
76
76
  W: (i) => {
77
77
  null != t.respond_with &&
78
78
  t.respond_with.triggers &&
79
- (this.vc = Math.max(this.vc - 1, 0)),
80
- this.B.Y(t, i, r)
81
- ? (this.La.Z(),
82
- this.h.Nl(i),
79
+ (this.sd = Math.max(this.sd - 1, 0)),
80
+ this.j.Y(t, i, r)
81
+ ? (this.al.Z(),
82
+ this.h.Nc(i),
83
83
  (null != t.respond_with &&
84
- t.respond_with.user_id != this.Cs.getUserId()) ||
85
- (null != t.device && this.j.ft(s.ct.ac, t.device),
84
+ t.respond_with.user_id != this.vs.getUserId()) ||
85
+ (null != t.device && this.B.bt(s.ft.ac, t.device),
86
86
  null != t.sdk_metadata &&
87
- (this.j.ft(s.ct.ku, t.sdk_metadata),
88
- this.j.ft(s.ct.wu, this.C.bt())),
89
- this.fc(i),
90
- h.Wu(this.j, h.H.Yi, 1),
87
+ (this.B.bt(s.ft.Tl, t.sdk_metadata),
88
+ this.B.bt(s.ft.kl, this.C.yt())),
89
+ this.$c(i),
90
+ h.Hl(this.B, h.H._e, 1),
91
91
  "function" == typeof e && e()))
92
92
  : i.auth_error && (d = !0);
93
93
  },
@@ -95,13 +95,13 @@ export default class Wt {
95
95
  (d = !0),
96
96
  null != t.respond_with &&
97
97
  t.respond_with.triggers &&
98
- (this.vc = Math.max(this.vc - 1, 0)),
99
- this.B.Bu(t.events, t.attributes),
98
+ (this.sd = Math.max(this.sd - 1, 0)),
99
+ this.j.yl(t.events, t.attributes),
100
100
  "function" == typeof n && n();
101
101
  },
102
102
  tt: (t, s) => {
103
103
  "function" == typeof o && o(!d);
104
- const e = this.B.il(s);
104
+ const e = this.j.Zl(s);
105
105
  let n = 0;
106
106
  if (e)
107
107
  switch (e.type) {
@@ -113,97 +113,100 @@ export default class Wt {
113
113
  }
114
114
  if (i && !m) {
115
115
  if (d) {
116
- h.sl(this.j, h.H.Yi);
117
- let t = this.bc;
118
- (null == t || t < 1e3 * this.bE) && (t = 1e3 * this.bE);
119
- const i = Math.min(3e5, l(1e3 * this.bE, 3 * t)) + n;
120
- this.Cc(i);
121
- } else this.Cc(Math.max(1e3 * this.bE, n));
116
+ h.hc(this.B, h.H._e);
117
+ const t = this.h.st(),
118
+ i = this.h.it(),
119
+ s = this.h.nt();
120
+ let e = this.hd;
121
+ (null == e || e < t) && (e = t);
122
+ const o = Math.min(s, a(t, e * i)) + n;
123
+ this.vd(o);
124
+ } else this.vd(Math.max(1e3 * this.bE, n));
122
125
  m = !0;
123
126
  }
124
127
  },
125
128
  });
126
129
  },
127
- g = this.Dc(c),
130
+ g = this.fd(c),
128
131
  p = t || g;
129
- if (this.Ac(r, g))
132
+ if (this.md(r, g))
130
133
  return void E.info(
131
134
  "Declining to flush data due to 50 consecutive authentication failures",
132
135
  );
133
- if (i && !this.B.Fu(c, d, p))
134
- return this.Cc(), void ("function" == typeof o && o(!0));
135
- const v = this.B.Ku(p, c, d, u);
136
- p && this.vc++;
136
+ if (i && !this.j.$l(c, d, p))
137
+ return this.vd(), void ("function" == typeof o && o(!0));
138
+ const v = this.j.Xl(p, c, d, u);
139
+ p && this.sd++;
137
140
  let b = !1;
138
141
  if (v)
139
142
  for (const t of v)
140
- this.B.J(
143
+ this.j.J(
141
144
  t.requestData,
142
145
  (i) => f(t.requestData, t.headers, i),
143
- h.H.Yi,
146
+ h.H._e,
144
147
  n,
145
148
  ),
146
149
  (b = !0);
147
- this.La.wh() && i && !b
148
- ? this.Cc()
150
+ this.al.wh() && i && !b
151
+ ? this.vd()
149
152
  : g &&
150
153
  (E.info("Invoking new session subscriptions"),
151
- this.wc.L(),
152
- (this.Sc = !0));
154
+ this.nd.L(),
155
+ (this.ad = !0));
153
156
  }
154
- Mc() {
155
- return this.vc > 0;
157
+ bd() {
158
+ return this.sd > 0;
156
159
  }
157
- Cc(t = 1e3 * this.bE) {
158
- this.jc ||
159
- (this.qc(),
160
- (this.kc = window.setTimeout(() => {
160
+ vd(t = 1e3 * this.bE) {
161
+ this.ud ||
162
+ (this.pd(),
163
+ (this.rd = window.setTimeout(() => {
161
164
  if (document.hidden) {
162
165
  const t = "visibilitychange",
163
166
  i = () => {
164
167
  document.hidden ||
165
- (document.removeEventListener(t, i, !1), this.$c());
168
+ (document.removeEventListener(t, i, !1), this.gd());
166
169
  };
167
170
  document.addEventListener(t, i, !1);
168
- } else this.$c();
171
+ } else this.gd();
169
172
  }, t)),
170
- (this.bc = t));
173
+ (this.hd = t));
171
174
  }
172
- qc() {
173
- null != this.kc && (clearTimeout(this.kc), (this.kc = null));
175
+ pd() {
176
+ null != this.rd && (clearTimeout(this.rd), (this.rd = null));
174
177
  }
175
178
  initialize() {
176
- (this.jc = !1), this.Cc();
179
+ (this.ud = !1), this.vd();
177
180
  }
178
181
  destroy() {
179
- this.wc.removeAllSubscriptions(),
180
- this.La.Gh(),
181
- this.qc(),
182
- (this.jc = !0),
183
- this.$c(void 0, !1, void 0, void 0, void 0, void 0, !0),
184
- (this.kc = null),
185
- (this.Sc = !1);
182
+ this.nd.removeAllSubscriptions(),
183
+ this.al.Gh(),
184
+ this.pd(),
185
+ (this.ud = !0),
186
+ this.gd(void 0, !1, void 0, void 0, void 0, void 0, !0),
187
+ (this.rd = null),
188
+ (this.ad = !1);
186
189
  }
187
190
  rn(t) {
188
- return this.Sc ? (t(), null) : this.wc.wt(t);
191
+ return this.ad ? (t(), null) : this.nd.Rt(t);
189
192
  }
190
193
  openSession() {
191
- const t = this.C.bt() !== this.C.Fo();
192
- t && (this.j.hE(s.iu.Oa), this.j.hE(s.iu.su)),
193
- this.$c(!1, void 0, () => {
194
- t && (this.j.Nt(s.ct.Ne), this.j.Nt(s.ct.It));
194
+ const t = this.C.yt() !== this.C.el();
195
+ t && (this.B.hE(s.Ou.il), this.B.hE(s.Ou.Cu)),
196
+ this.gd(!1, void 0, () => {
197
+ t && (this.B.zt(s.ft.vo), this.B.zt(s.ft.Dt));
195
198
  }),
196
- this.Au(),
199
+ this.Va(),
197
200
  t &&
198
201
  import("./Push/push-manager-factory.js").then((t) => {
199
- if (this.jc) return;
200
- const i = t.default.ea();
202
+ if (this.ud) return;
203
+ const i = t.default.ra();
201
204
  if (
202
205
  null != i &&
203
206
  (vt.isPushPermissionGranted() || vt.isPushBlocked())
204
207
  ) {
205
208
  const t = () => {
206
- i.Rn()
209
+ i.du()
207
210
  ? E.info(
208
211
  "Push token maintenance is disabled, not refreshing token for backend.",
209
212
  )
@@ -213,56 +216,56 @@ export default class Wt {
213
216
  s && t();
214
217
  },
215
218
  h = () => {
216
- const i = this.j.lt(s.ct.Wo);
219
+ const i = this.B.dt(s.ft.Uu);
217
220
  (null == i || i) && t();
218
221
  },
219
- n = it.Us.Rs;
220
- new it(n, E).kr(n.Fs.cu, e, h);
222
+ n = et.Us.Rs;
223
+ new et(n, E).kr(n.Fs.Fu, e, h);
221
224
  }
222
225
  });
223
226
  }
224
- Tc() {
225
- this.j.Nt(s.ct.Se), this.j.Nt(s.ct.Ps), this.j.Nt(s.ct.yn);
227
+ wd() {
228
+ this.B.zt(s.ft.lo), this.B.zt(s.ft.Ps), this.B.zt(s.ft.Yn);
226
229
  }
227
- Lc() {
230
+ kd() {
228
231
  var t, i;
229
- this.j.Nt(s.ct.tl), this.j.Nt(s.ct.SE);
232
+ this.B.zt(s.ft.Ql), this.B.zt(s.ft.lE);
230
233
  const e = h.H;
231
234
  for (const i in e) {
232
235
  const s = e[i];
233
- this.B.al(s, null === (t = this.h) || void 0 === t ? void 0 : t.bl(s));
236
+ this.j.dc(s, null === (t = this.h) || void 0 === t ? void 0 : t.Tc(s));
234
237
  }
235
- this.B.rl(null === (i = this.h) || void 0 === i ? void 0 : i.Rl());
238
+ this.j.uc(null === (i = this.h) || void 0 === i ? void 0 : i.Ac());
236
239
  }
237
240
  changeUser(t, i, e) {
238
- const h = this.Cs.getUserId();
241
+ const h = this.vs.getUserId();
239
242
  if (h !== t) {
240
- this.C.tm(),
241
- this.Tc(),
242
- oi(),
243
- null != h && this.$c(void 0, !1, void 0, void 0, void 0),
244
- this.Cs.ou(t),
245
- e ? this.La.setSdkAuthenticationSignature(e) : this.La.yh();
243
+ this.C.jm(),
244
+ this.wd(),
245
+ di(),
246
+ null != h && this.gd(void 0, !1, void 0, void 0, void 0),
247
+ this.vs.Ju(t),
248
+ e ? this.al.setSdkAuthenticationSignature(e) : this.al.yh();
246
249
  for (let t = 0; t < i.length; t++) i[t].changeUser(null == h);
247
- this.B.fo(),
248
- null != h && this.j.Nt(s.ct.rE),
249
- this.j.Nt(s.ct.ac),
250
- this.j.Nt(s.ct.uE),
251
- this.Lc(),
250
+ this.j.fo(),
251
+ null != h && this.B.zt(s.ft.rE),
252
+ this.B.zt(s.ft.ac),
253
+ this.B.zt(s.ft.uE),
254
+ this.kd(),
252
255
  this.openSession(),
253
256
  E.info('Changed user to "' + t + '".');
254
257
  } else {
255
258
  let i = "Doing nothing.";
256
259
  e &&
257
- this.La.jh() !== e &&
258
- (this.La.setSdkAuthenticationSignature(e),
260
+ this.al.jh() !== e &&
261
+ (this.al.setSdkAuthenticationSignature(e),
259
262
  (i = "Updated SDK authentication signature")),
260
263
  E.info(`Current user is already ${t}. ${i}`);
261
264
  }
262
265
  }
263
266
  requestImmediateDataFlush(t) {
264
- this.qc(), this.C.Fo();
265
- this.$c(
267
+ this.pd(), this.C.el();
268
+ this.gd(
266
269
  void 0,
267
270
  void 0,
268
271
  void 0,
@@ -274,26 +277,26 @@ export default class Wt {
274
277
  );
275
278
  }
276
279
  yr(t, i) {
277
- this.C.Fo(),
280
+ this.C.el(),
278
281
  E.info("Requesting explicit trigger refresh."),
279
- this.$c(!0, void 0, t, i);
282
+ this.gd(!0, void 0, t, i);
280
283
  }
281
- du(t, i) {
282
- const e = m.Rc,
284
+ Gu(t, i) {
285
+ const e = f.yd,
283
286
  h = { a: t, l: i },
284
- n = c.rt(e, h);
287
+ n = v.lt(e, h);
285
288
  return (
286
- n && (E.info(`Logged alias ${t} with label ${i}`), this.j.ft(s.ct.uE, h)),
289
+ n && (E.info(`Logged alias ${t} with label ${i}`), this.B.bt(s.ft.uE, h)),
287
290
  n
288
291
  );
289
292
  }
290
- bu(t, i, s) {
291
- if (this.h.hu(i))
293
+ Mu(t, i, s) {
294
+ if (this.h.qu(i))
292
295
  return (
293
- E.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new G()
296
+ E.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new H()
294
297
  );
295
298
  const e = { key: i, value: s },
296
- h = c.rt(t, e);
299
+ h = v.lt(t, e);
297
300
  if (h) {
298
301
  const t = "object" == typeof s ? JSON.stringify(s, null, 2) : s;
299
302
  E.info(`Logged custom attribute: ${i} with value: ${t}`);
@@ -305,7 +308,7 @@ export default class Wt {
305
308
  null != e && (o.altitude = e),
306
309
  null != h && (o.ll_accuracy = h),
307
310
  null != n && (o.alt_accuracy = n);
308
- const r = c.rt(m.Fc, o, t || void 0);
311
+ const r = v.lt(f.jd, o, t || void 0);
309
312
  return (
310
313
  r &&
311
314
  E.info(`Set user last known location as ${JSON.stringify(o, null, 2)}`),
@@ -313,44 +316,44 @@ export default class Wt {
313
316
  );
314
317
  }
315
318
  $r(t, i) {
316
- const s = this.C.Fo();
317
- return new ue(this.Cs.getUserId(), m.Ic, t, s, { cid: i });
319
+ const s = this.C.el();
320
+ return new De(this.vs.getUserId(), f.Sd, t, s, { cid: i });
318
321
  }
319
- Pc(t, i) {
320
- return new it(t, i);
322
+ Ad(t, i) {
323
+ return new et(t, i);
321
324
  }
322
- Au() {
323
- const t = it.Us.Rs;
324
- this.Pc(t, E).setItem(t.Fs.Yi, 1, {
325
+ Va() {
326
+ const t = et.Us.Rs;
327
+ this.Ad(t, E).setItem(t.Fs._e, 1, {
325
328
  baseUrl: this.baseUrl,
326
- data: { api_key: this.Pn, device_id: this.Dn.fe().id },
327
- userId: this.Cs.getUserId(),
328
- sdkAuthEnabled: this.La.wh(),
329
+ data: { api_key: this.tu, device_id: this.eu.ve().id },
330
+ userId: this.vs.getUserId(),
331
+ sdkAuthEnabled: this.al.wh(),
329
332
  });
330
333
  }
331
334
  Fr(t) {
332
335
  for (const i of t)
333
- if (i.api_key === this.Pn) this.B.Bu(i.events, i.attributes);
336
+ if (i.api_key === this.tu) this.j.yl(i.events, i.attributes);
334
337
  else {
335
- const t = it.Us.Rs;
336
- new it(t, E).setItem(t.Fs.zr, L.oe(), i);
338
+ const t = et.Us.Rs;
339
+ new et(t, E).setItem(t.Fs.zr, P.se(), i);
337
340
  }
338
341
  }
339
- Iu(t, i, s) {
340
- if (this.h.hu(t))
342
+ Ra(t, i, s) {
343
+ if (this.h.qu(t))
341
344
  return (
342
- E.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new G()
345
+ E.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new H()
343
346
  );
344
347
  let e, h;
345
348
  return (
346
349
  null === i && null === s
347
- ? ((e = m.xc), (h = { key: t }))
348
- : ((e = m.Nc), (h = { key: t, latitude: i, longitude: s })),
349
- c.rt(e, h)
350
+ ? ((e = f.Dd), (h = { key: t }))
351
+ : ((e = f.$d), (h = { key: t, latitude: i, longitude: s })),
352
+ v.lt(e, h)
350
353
  );
351
354
  }
352
- Cu(t, i) {
355
+ Pa(t, i) {
353
356
  const s = { group_id: t, status: i };
354
- return c.rt(m.Oc, s);
357
+ return v.lt(f.qd, s);
355
358
  }
356
359
  }
@@ -1,14 +1,14 @@
1
1
  export default class rs {
2
2
  constructor(t) {
3
- (this.zc = t), (this.zc = t);
3
+ (this.tf = t), (this.tf = t);
4
4
  }
5
- Bc(t) {
6
- return null == this.zc || this.zc === t[0];
5
+ sf(t) {
6
+ return null == this.tf || this.tf === t[0];
7
7
  }
8
8
  static fromJson(t) {
9
9
  return new rs(t ? t.event_name : null);
10
10
  }
11
- dt() {
12
- return this.zc;
11
+ gt() {
12
+ return this.tf;
13
13
  }
14
14
  }
@@ -1,13 +1,13 @@
1
1
  import is from "./filter-set.js";
2
2
  export default class ls {
3
3
  constructor(t, s) {
4
- (this.zc = t), (this.tf = s), (this.zc = t), (this.tf = s);
4
+ (this.tf = t), (this.if = s), (this.tf = t), (this.if = s);
5
5
  }
6
- Bc(t) {
7
- if (null == this.zc || null == this.tf) return !1;
6
+ sf(t) {
7
+ if (null == this.tf || null == this.if) return !1;
8
8
  const s = t[0],
9
9
  i = t[1];
10
- return s === this.zc && this.tf.Bc(i);
10
+ return s === this.tf && this.if.sf(i);
11
11
  }
12
12
  static fromJson(t) {
13
13
  return new ls(
@@ -15,7 +15,7 @@ export default class ls {
15
15
  t ? is.fromJson(t.property_filters) : null,
16
16
  );
17
17
  }
18
- dt() {
19
- return { e: this.zc, pf: this.tf ? this.tf.dt() : null };
18
+ gt() {
19
+ return { e: this.tf, pf: this.if ? this.if.gt() : null };
20
20
  }
21
21
  }
@@ -1,16 +1,16 @@
1
1
  import cr from "./filter.js";
2
- import { isArray as z } from "../../util/code-utils.js";
2
+ import { isArray as R } from "../../util/code-utils.js";
3
3
  export default class is {
4
4
  constructor(t) {
5
5
  (this.filters = t), (this.filters = t);
6
6
  }
7
- Bc(t) {
7
+ sf(t) {
8
8
  let r = !0;
9
9
  for (let e = 0; e < this.filters.length; e++) {
10
10
  const o = this.filters[e];
11
11
  let s = !1;
12
12
  for (let r = 0; r < o.length; r++)
13
- if (o[r].Bc(t)) {
13
+ if (o[r].sf(t)) {
14
14
  s = !0;
15
15
  break;
16
16
  }
@@ -22,7 +22,7 @@ export default class is {
22
22
  return r;
23
23
  }
24
24
  static fromJson(t) {
25
- if (null == t || !z(t)) return null;
25
+ if (null == t || !R(t)) return null;
26
26
  const r = [];
27
27
  for (let e = 0; e < t.length; e++) {
28
28
  const o = [],
@@ -32,22 +32,22 @@ export default class is {
32
32
  }
33
33
  return new is(r);
34
34
  }
35
- dt() {
35
+ gt() {
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].dt());
40
+ for (let t = 0; t < e.length; t++) o.push(e[t].gt());
41
41
  t.push(o);
42
42
  }
43
43
  return t;
44
44
  }
45
- static Vo(t) {
45
+ static _u(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(cr.Vo(s[t]));
50
+ for (let t = 0; t < s.length; t++) o.push(cr._u(s[t]));
51
51
  r.push(o);
52
52
  }
53
53
  return new is(r);
@@ -1,7 +1,7 @@
1
1
  import { isDate as Nt } from "../../util/code-utils.js";
2
2
  import {
3
- convertMsToSeconds as P,
4
- dateFromUnixTimestamp as X,
3
+ convertMsToSeconds as X,
4
+ dateFromUnixTimestamp as V,
5
5
  secondsAgo as es,
6
6
  secondsInTheFuture as hs,
7
7
  } from "../../util/date-utils.js";
@@ -20,9 +20,9 @@ export default class cr {
20
20
  this.comparator !== cr.BE.jE &&
21
21
  this.comparator !== cr.BE.zE &&
22
22
  this.comparator !== cr.BE.FE &&
23
- (this.LE = X(this.LE));
23
+ (this.LE = V(this.LE));
24
24
  }
25
- Bc(t) {
25
+ sf(t) {
26
26
  let s = null;
27
27
  switch ((null != t && (s = t[this.yE]), this.comparator)) {
28
28
  case cr.BE.kE:
@@ -74,14 +74,14 @@ export default class cr {
74
74
  t.property_value,
75
75
  );
76
76
  }
77
- dt() {
77
+ gt() {
78
78
  let t = this.LE;
79
79
  return (
80
- Nt(this.LE) && (t = P(t.valueOf())),
80
+ Nt(this.LE) && (t = X(t.valueOf())),
81
81
  { k: this.yE, t: this.HE, c: this.comparator, v: t }
82
82
  );
83
83
  }
84
- static Vo(t) {
84
+ static _u(t) {
85
85
  return new cr(t.k, t.t, t.c, t.v);
86
86
  }
87
87
  }