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