@braze/web-sdk 5.2.0 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/index.d.ts +54 -5
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +14 -14
  4. package/shared-lib/indexed-db-adapter.js +51 -51
  5. package/shared-lib/logger.js +7 -7
  6. package/shared-lib/supported-options.js +7 -7
  7. package/src/ContentCards/content-cards-provider.js +107 -135
  8. package/src/ContentCards/get-cached-content-cards.js +1 -1
  9. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  10. package/src/ContentCards/subscribe-to-content-cards-updates.js +2 -2
  11. package/src/ContentCards/ui/show-content-cards.js +1 -1
  12. package/src/FeatureFlags/feature-flag.js +41 -30
  13. package/src/FeatureFlags/feature-flags-provider.js +88 -84
  14. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  15. package/src/FeatureFlags/get-feature-flag.js +2 -2
  16. package/src/FeatureFlags/log-feature-flag-impression.js +3 -3
  17. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  18. package/src/Feed/feed-provider.js +24 -24
  19. package/src/Feed/get-cached-feed.js +1 -1
  20. package/src/Feed/log-feed-displayed.js +1 -1
  21. package/src/Feed/request-feed-refresh.js +1 -1
  22. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  23. package/src/Feed/ui/show-feed.js +1 -1
  24. package/src/InAppMessage/defer-in-app-message.js +1 -1
  25. package/src/InAppMessage/display/html-message-to-html.js +9 -9
  26. package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
  27. package/src/InAppMessage/display/modal-utils.js +5 -5
  28. package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
  29. package/src/InAppMessage/in-app-message-factory.js +4 -4
  30. package/src/InAppMessage/in-app-message-manager.js +78 -75
  31. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  32. package/src/InAppMessage/log-in-app-message-click.js +3 -3
  33. package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
  34. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  35. package/src/InAppMessage/models/full-screen-message.js +12 -12
  36. package/src/InAppMessage/models/html-message.js +9 -9
  37. package/src/InAppMessage/models/in-app-message-button.js +2 -2
  38. package/src/InAppMessage/models/in-app-message.js +84 -82
  39. package/src/InAppMessage/models/modal-message.js +12 -12
  40. package/src/InAppMessage/models/slide-up-message.js +17 -17
  41. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  42. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  43. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  44. package/src/InAppMessage/ui/show-in-app-message.js +17 -17
  45. package/src/Push/push-manager-factory.js +6 -6
  46. package/src/Push/push-manager.js +1 -1
  47. package/src/Push/utils/push-utils.js +1 -1
  48. package/src/User/user.js +12 -12
  49. package/src/common/base-provider.js +1 -1
  50. package/src/common/constants.js +0 -2
  51. package/src/common/event-logger.js +2 -2
  52. package/src/common/feed-display.js +1 -1
  53. package/src/managers/auth-manager.js +3 -3
  54. package/src/managers/braze-instance.js +73 -73
  55. package/src/managers/device-manager.js +15 -15
  56. package/src/managers/network-manager.js +190 -145
  57. package/src/managers/server-config-manager.js +43 -47
  58. package/src/managers/session-manager.js +21 -21
  59. package/src/managers/storage-manager-factory.js +1 -1
  60. package/src/managers/storage-manager.js +107 -107
  61. package/src/managers/utils.js +1 -1
  62. package/src/models/backend-errors.js +5 -5
  63. package/src/models/braze-event.js +6 -6
  64. package/src/models/device.js +2 -2
  65. package/src/models/identifier.js +8 -8
  66. package/src/models/server-config.js +25 -25
  67. package/src/request-controller.js +115 -108
  68. package/src/triggers/models/custom-event-data.js +2 -2
  69. package/src/triggers/models/custom-event-property-data.js +4 -4
  70. package/src/triggers/models/filter-set.js +3 -3
  71. package/src/triggers/models/filter.js +55 -55
  72. package/src/triggers/models/in-app-message-click-data.js +8 -8
  73. package/src/triggers/models/purchase-data.js +2 -2
  74. package/src/triggers/models/purchase-property-data.js +4 -4
  75. package/src/triggers/models/push-click-data.js +3 -3
  76. package/src/triggers/models/trigger-condition.js +40 -40
  77. package/src/triggers/models/trigger-events.js +1 -1
  78. package/src/triggers/models/trigger.js +31 -31
  79. package/src/triggers/triggers-provider-factory.js +1 -1
  80. package/src/triggers/triggers-provider.js +40 -40
  81. package/src/ui/js/attach-css.js +2 -2
  82. package/src/util/base-device-parser.js +7 -7
  83. package/src/util/braze-actions.js +4 -4
  84. package/src/util/browser-detector.js +23 -23
  85. package/src/util/client-hints-parser.js +4 -4
  86. package/src/util/dom-utils.js +6 -6
  87. package/src/util/net.js +4 -4
  88. package/src/util/request-header-utils.js +36 -37
  89. package/src/util/user-agent-parser.js +7 -7
  90. package/src/util/window-utils.js +1 -1
@@ -17,12 +17,12 @@ export default class gr extends y {
17
17
  (this.tg = t),
18
18
  (this.Jt = i),
19
19
  (this.u = s),
20
- (this.Ei = e),
20
+ (this.zi = e),
21
21
  (this.ig = r),
22
22
  (this.tg = t),
23
23
  (this.Jt = i),
24
24
  (this.u = s),
25
- (this.Ei = e),
25
+ (this.zi = e),
26
26
  (this.ig = r),
27
27
  (this.sg = []),
28
28
  (this.eg = []),
@@ -36,12 +36,12 @@ export default class gr extends y {
36
36
  }
37
37
  fg() {
38
38
  if (this.u) {
39
- (this.hg = this.u.j(o.C.aE) || this.hg),
40
- (this.ng = this.u.j(o.C.iE) || this.ng),
41
- (this.og = this.u.j(o.C.nE) || this.og);
39
+ (this.hg = this.u.j(o.C.iE) || this.hg),
40
+ (this.ng = this.u.j(o.C.EE) || this.ng),
41
+ (this.og = this.u.j(o.C.aE) || this.og);
42
42
  for (let t = 0; t < this.triggers.length; t++) {
43
43
  const i = this.triggers[t];
44
- i.id && null != this.og[i.id] && i.ed(this.og[i.id]);
44
+ i.id && null != this.og[i.id] && i.ad(this.og[i.id]);
45
45
  }
46
46
  }
47
47
  }
@@ -70,19 +70,19 @@ export default class gr extends y {
70
70
  h = [];
71
71
  for (let e = 0; e < t.length; e++) {
72
72
  const n = t[e],
73
- o = r.rd(n.Jr || 0);
73
+ o = r.ud(n.Gr || 0);
74
74
  if (o > 0) {
75
75
  let t, e;
76
76
  h.push(n),
77
77
  null != n.ug && (t = n.ug),
78
- null != n.dg && ue.AE(n.dg) && (e = ue.qn(n.dg));
78
+ null != n.dg && ue.RE(n.dg) && (e = ue.qn(n.dg));
79
79
  const l = [];
80
80
  if (n.pg && j(n.pg))
81
81
  for (let t = 0; t < n.pg.length; t++) {
82
82
  const i = s[n.pg[t]];
83
83
  null != i && l.push(i);
84
84
  }
85
- this.eg.push(window.setTimeout(i(r, n.Jr || 0, t, e, l), o));
85
+ this.eg.push(window.setTimeout(i(r, n.Gr || 0, t, e, l), o));
86
86
  }
87
87
  }
88
88
  this.ng[r.id].length > h.length &&
@@ -91,7 +91,7 @@ export default class gr extends y {
91
91
  0 === this.ng[r.id].length && delete this.ng[r.id]);
92
92
  }
93
93
  }
94
- e && this.u && this.u.k(o.C.iE, this.ng);
94
+ e && this.u && this.u.k(o.C.EE, this.ng);
95
95
  }
96
96
  mg() {
97
97
  if (!this.u) return;
@@ -105,10 +105,10 @@ export default class gr extends y {
105
105
  if (!this.u) return;
106
106
  (this.u.j(o.C.oE) || 0) > this.lg ? this.ag() : this.fg();
107
107
  }
108
- Rs(t) {
108
+ Ns(t) {
109
109
  let i = !1;
110
110
  if (null != t && t.triggers) {
111
- this.ig.Yr(), this.fg();
111
+ this.ig.Lr(), this.fg();
112
112
  const s = {},
113
113
  e = {};
114
114
  this.triggers = [];
@@ -117,18 +117,18 @@ export default class gr extends y {
117
117
  if (h) {
118
118
  h.id &&
119
119
  null != this.og[h.id] &&
120
- (h.ed(this.og[h.id]), (s[h.id] = this.og[h.id])),
120
+ (h.ad(this.og[h.id]), (s[h.id] = this.og[h.id])),
121
121
  h.id && null != this.ng[h.id] && (e[h.id] = this.ng[h.id]);
122
- for (let t = 0; t < h.Ku.length; t++)
123
- if (h.Ku[t].sc(tt.kt, null)) {
122
+ for (let t = 0; t < h.sd.length; t++)
123
+ if (h.sd[t].sc(tt.kt, null)) {
124
124
  i = !0;
125
125
  break;
126
126
  }
127
127
  this.triggers.push(h);
128
128
  }
129
129
  }
130
- ii(this.og, s) || ((this.og = s), this.u && this.u.k(o.C.nE, this.og)),
131
- ii(this.ng, e) || ((this.ng = e), this.u && this.u.k(o.C.iE, this.ng)),
130
+ ii(this.og, s) || ((this.og = s), this.u && this.u.k(o.C.aE, this.og)),
131
+ ii(this.ng, e) || ((this.ng = e), this.u && this.u.k(o.C.EE, this.ng)),
132
132
  this.mg(),
133
133
  i &&
134
134
  (r.info("Trigger with test condition found, firing test."),
@@ -145,12 +145,12 @@ export default class gr extends y {
145
145
  const n = (e) => {
146
146
  this.fg();
147
147
  const h = new Date().valueOf();
148
- t.hd(i) ||
149
- (!1 === navigator.onLine && t.type === mt.Or.Cr && e.imageUrl
148
+ t.dd(i) ||
149
+ (!1 === navigator.onLine && t.type === mt._r.Br && e.imageUrl
150
150
  ? r.info(
151
151
  `Not showing ${t.type} trigger action ${t.id} due to offline state.`,
152
152
  )
153
- : t.sd(h) && this.wg(t, h, s)
153
+ : t.nd(h) && this.wg(t, h, s)
154
154
  ? 0 === this.Jt.ic()
155
155
  ? r.info(
156
156
  `Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`,
@@ -164,14 +164,14 @@ export default class gr extends y {
164
164
  this.fg();
165
165
  const n = h.pop();
166
166
  if (null != n)
167
- if ((this.Tg(n, i, s, e, h), n.hd(i))) {
167
+ if ((this.Tg(n, i, s, e, h), n.dd(i))) {
168
168
  let t = `Server aborted in-app message display, but the timeout on fallback trigger ${n.id} has already elapsed.`;
169
169
  h.length > 0 && (t += " Continuing to fall back."), r.info(t), o();
170
170
  } else {
171
171
  r.info(
172
172
  `Server aborted in-app message display. Falling back to lower priority ${n.type} trigger action ${t.id}.`,
173
173
  );
174
- const o = 1e3 * n.Wu - (new Date().valueOf() - i);
174
+ const o = 1e3 * n.ed - (new Date().valueOf() - i);
175
175
  o > 0
176
176
  ? this.eg.push(
177
177
  window.setTimeout(() => {
@@ -183,21 +183,21 @@ export default class gr extends y {
183
183
  };
184
184
  let l, a, g;
185
185
  switch (t.type) {
186
- case mt.Or.Cr:
186
+ case mt._r.Br:
187
187
  if (((l = pt(t.data)), null == l)) {
188
188
  r.error(
189
189
  `Could not parse trigger data for trigger ${t.id}, ignoring.`,
190
190
  );
191
191
  break;
192
192
  }
193
- if (((a = this.ig.Qi(l)), a)) {
193
+ if (((a = this.ig.Li(l)), a)) {
194
194
  r.error(a), o();
195
195
  break;
196
196
  }
197
197
  n(l);
198
198
  break;
199
- case mt.Or.od:
200
- if (((g = wt.fromJson(t.data, n, o, i, t.Kr || 0)), null == g)) {
199
+ case mt._r.md:
200
+ if (((g = wt.fromJson(t.data, n, o, i, t.Nr || 0)), null == g)) {
201
201
  r.error(
202
202
  `Could not parse trigger data for trigger ${t.id}, ignoring.`,
203
203
  );
@@ -211,7 +211,7 @@ export default class gr extends y {
211
211
  }
212
212
  fe(t, i = null, s) {
213
213
  if (!J(tt, t, "Cannot fire trigger action.", "TriggerEvents")) return;
214
- if (this.Ei && this.Ei.Tu())
214
+ if (this.zi && this.zi.Nu())
215
215
  return (
216
216
  r.info(
217
217
  "Trigger sync is currently in progress, awaiting sync completion before firing trigger event.",
@@ -226,15 +226,15 @@ export default class gr extends y {
226
226
  const l = [];
227
227
  for (let s = 0; s < this.triggers.length; s++) {
228
228
  const r = this.triggers[s],
229
- h = e + 1e3 * r.Wu;
229
+ h = e + 1e3 * r.ed;
230
230
  if (
231
- r.sd(h) &&
231
+ r.nd(h) &&
232
232
  (null == r.startTime || r.startTime.valueOf() <= e) &&
233
233
  (null == r.endTime || r.endTime.valueOf() >= e)
234
234
  ) {
235
235
  let s = !1;
236
- for (let e = 0; e < r.Ku.length; e++)
237
- if (r.Ku[e].sc(t, i)) {
236
+ for (let e = 0; e < r.sd.length; e++)
237
+ if (r.sd[e].sc(t, i)) {
238
238
  s = !0;
239
239
  break;
240
240
  }
@@ -258,20 +258,20 @@ export default class gr extends y {
258
258
  `Firing ${a.type} trigger action ${a.id} from trigger event ${t}.`,
259
259
  ),
260
260
  this.Tg(a, e, t, s, l),
261
- 0 === a.Wu
261
+ 0 === a.ed
262
262
  ? this.cg(a, e, t, s, l)
263
263
  : this.eg.push(
264
264
  window.setTimeout(() => {
265
265
  this.cg(a, e, t, s, l);
266
- }, 1e3 * a.Wu),
266
+ }, 1e3 * a.ed),
267
267
  ));
268
268
  }
269
269
  changeUser(t = !1) {
270
- if (((this.triggers = []), this.u && this.u.hi(o.C.rE), !t)) {
270
+ if (((this.triggers = []), this.u && this.u.ti(o.C.rE), !t)) {
271
271
  (this.sg = []), (this.hg = null), (this.og = {}), (this.ng = {});
272
272
  for (let t = 0; t < this.eg.length; t++) clearTimeout(this.eg[t]);
273
273
  (this.eg = []),
274
- this.u && (this.u.hi(o.C.aE), this.u.hi(o.C.nE), this.u.hi(o.C.iE));
274
+ this.u && (this.u.ti(o.C.iE), this.u.ti(o.C.aE), this.u.ti(o.C.EE));
275
275
  }
276
276
  }
277
277
  clearData() {
@@ -288,25 +288,25 @@ export default class gr extends y {
288
288
  ),
289
289
  !0
290
290
  );
291
- let e = t.Zu;
291
+ let e = t.hd;
292
292
  return null == e && (e = this.tg), i - this.hg >= 1e3 * e;
293
293
  }
294
294
  Tg(t, i, s, e, r) {
295
295
  this.fg(), t.id && (this.ng[t.id] = this.ng[t.id] || []);
296
296
  const h = {};
297
297
  let n;
298
- (h.Jr = i), (h.ug = s), null != e && (n = e.Y()), (h.dg = n);
298
+ (h.Gr = i), (h.ug = s), null != e && (n = e.Y()), (h.dg = n);
299
299
  const l = [];
300
300
  for (const t of r) t.id && l.push(t.id);
301
301
  (h.pg = l),
302
302
  t.id && this.ng[t.id].push(h),
303
- this.u && this.u.k(o.C.iE, this.ng);
303
+ this.u && this.u.k(o.C.EE, this.ng);
304
304
  }
305
305
  yg(t, i) {
306
306
  this.fg(),
307
- t.ed(i),
307
+ t.ad(i),
308
308
  (this.hg = i),
309
309
  t.id && (this.og[t.id] = i),
310
- this.u && (this.u.k(o.C.aE, i), this.u.k(o.C.nE, this.og));
310
+ this.u && (this.u.k(o.C.iE, i), this.u.k(o.C.aE, this.og));
311
311
  }
312
312
  }
@@ -1,13 +1,13 @@
1
1
  import e, { OPTIONS as L } from "../../managers/braze-instance.js";
2
2
  export function attachCSS(n, t, o) {
3
3
  const c = n || document.querySelector("head"),
4
- s = `ab-${t}-css-definitions-${"5.2.0".replace(/\./g, "-")}`;
4
+ s = `ab-${t}-css-definitions-${"5.3.0".replace(/\./g, "-")}`;
5
5
  if (!c) return;
6
6
  const a = c.ownerDocument || document;
7
7
  if (null == a.getElementById(s)) {
8
8
  const n = a.createElement("style");
9
9
  (n.innerHTML = o || ""), (n.id = s);
10
- const t = e.nn(L.ho);
10
+ const t = e.nn(L.bo);
11
11
  null != t && n.setAttribute("nonce", t), c.appendChild(n);
12
12
  }
13
13
  }
@@ -1,14 +1,14 @@
1
1
  import { isArray as j } from "./code-utils.js";
2
2
  export default class ge {
3
3
  constructor() {}
4
- tf() {}
5
4
  ef() {}
6
- Da(t) {}
7
- static rf(t, e) {
5
+ rf() {}
6
+ Ta(t) {}
7
+ static sf(t, e) {
8
8
  if (t && e)
9
- if (((t = t.toLowerCase()), j(e.if))) {
10
- for (let r = 0; r < e.if.length; r++)
11
- if (-1 !== t.indexOf(e.if[r].toLowerCase())) return e.identity;
12
- } else if (-1 !== t.indexOf(e.if.toLowerCase())) return e.identity;
9
+ if (((t = t.toLowerCase()), j(e.ff))) {
10
+ for (let r = 0; r < e.ff.length; r++)
11
+ if (-1 !== t.indexOf(e.ff[r].toLowerCase())) return e.identity;
12
+ } else if (-1 !== t.indexOf(e.ff.toLowerCase())) return e.identity;
13
13
  }
14
14
  }
@@ -25,14 +25,14 @@ export const BRAZE_ACTIONS = {
25
25
  properties: { type: "type", oo: "steps", eo: "args" },
26
26
  };
27
27
  export const INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES = {
28
- Vi: "unknownBrazeAction",
29
- Xi: "noPushPrompt",
28
+ Qi: "unknownBrazeAction",
29
+ Wi: "noPushPrompt",
30
30
  };
31
31
  export const ineligibleBrazeActionURLErrorMessage = (t, o) => {
32
32
  switch (t) {
33
- case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Vi:
33
+ case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Qi:
34
34
  return `${o} contains an unknown braze action type and will not be displayed.`;
35
- case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Xi:
35
+ case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Wi:
36
36
  return `${o} contains a push prompt braze action, but is not eligible for a push prompt. Ignoring.`;
37
37
  default:
38
38
  return "";
@@ -6,10 +6,10 @@ class ui {
6
6
  const t = navigator.userAgentData ? ai : oi;
7
7
  (this.Sg = new t()),
8
8
  (this.userAgent = navigator.userAgent),
9
- (this.browser = this.Sg.tf()),
10
- (this.version = this.Sg.ef()),
9
+ (this.browser = this.Sg.ef()),
10
+ (this.version = this.Sg.rf()),
11
11
  (this.OS = null),
12
- this.Da().then((t) => (this.OS = t));
12
+ this.Ta().then((t) => (this.OS = t));
13
13
  const i = navigator;
14
14
  (this.language = (
15
15
  i.userLanguage ||
@@ -18,18 +18,18 @@ class ui {
18
18
  i.systemLanguage ||
19
19
  ""
20
20
  ).toLowerCase()),
21
- (this.Qo = ui.vg(this.userAgent));
21
+ (this.Zo = ui.vg(this.userAgent));
22
22
  }
23
- dE() {
23
+ IE() {
24
24
  return this.browser === gi.Bg;
25
25
  }
26
- Fa() {
26
+ Oa() {
27
27
  return this.OS || null;
28
28
  }
29
- Da() {
29
+ Ta() {
30
30
  return this.OS
31
31
  ? Promise.resolve(this.OS)
32
- : this.Sg.Da(ui.kg).then((t) => ((this.OS = t), t));
32
+ : this.Sg.Ta(ui.kg).then((t) => ((this.OS = t), t));
33
33
  }
34
34
  static vg(t) {
35
35
  t = t.toLowerCase();
@@ -57,29 +57,29 @@ class ui {
57
57
  }
58
58
  }
59
59
  ui.kg = [
60
- { string: navigator.platform, if: "Win", identity: Y.Og },
61
- { string: navigator.platform, if: "Mac", identity: Y.Pg },
62
- { string: navigator.platform, if: "BlackBerry", identity: "BlackBerry" },
63
- { string: navigator.platform, if: "FreeBSD", identity: "FreeBSD" },
64
- { string: navigator.platform, if: "OpenBSD", identity: "OpenBSD" },
65
- { string: navigator.platform, if: "Nintendo", identity: "Nintendo" },
66
- { string: navigator.platform, if: "SunOS", identity: "SunOS" },
67
- { string: navigator.platform, if: "PlayStation", identity: "PlayStation" },
68
- { string: navigator.platform, if: "X11", identity: "X11" },
60
+ { string: navigator.platform, ff: "Win", identity: Y.Og },
61
+ { string: navigator.platform, ff: "Mac", identity: Y.Pg },
62
+ { string: navigator.platform, ff: "BlackBerry", identity: "BlackBerry" },
63
+ { string: navigator.platform, ff: "FreeBSD", identity: "FreeBSD" },
64
+ { string: navigator.platform, ff: "OpenBSD", identity: "OpenBSD" },
65
+ { string: navigator.platform, ff: "Nintendo", identity: "Nintendo" },
66
+ { string: navigator.platform, ff: "SunOS", identity: "SunOS" },
67
+ { string: navigator.platform, ff: "PlayStation", identity: "PlayStation" },
68
+ { string: navigator.platform, ff: "X11", identity: "X11" },
69
69
  {
70
70
  string: navigator.userAgent,
71
- if: ["iPhone", "iPad", "iPod"],
71
+ ff: ["iPhone", "iPad", "iPod"],
72
72
  identity: Y.io,
73
73
  },
74
- { string: navigator.platform, if: "Pike v", identity: Y.io },
75
- { string: navigator.userAgent, if: ["Web0S"], identity: "WebOS" },
74
+ { string: navigator.platform, ff: "Pike v", identity: Y.io },
75
+ { string: navigator.userAgent, ff: ["Web0S"], identity: "WebOS" },
76
76
  {
77
77
  string: navigator.platform,
78
- if: ["Linux armv7l", "Android"],
78
+ ff: ["Linux armv7l", "Android"],
79
79
  identity: Y.xg,
80
80
  },
81
- { string: navigator.userAgent, if: ["Android"], identity: Y.xg },
82
- { string: navigator.platform, if: "Linux", identity: "Linux" },
81
+ { string: navigator.userAgent, ff: ["Android"], identity: Y.xg },
82
+ { string: navigator.platform, ff: "Linux", identity: "Linux" },
83
83
  ];
84
84
  const X = new ui();
85
85
  export { X as default, ui as BrowserDetector };
@@ -15,17 +15,17 @@ export default class ai extends ge {
15
15
  }
16
16
  this.OS = null;
17
17
  }
18
- tf() {
18
+ ef() {
19
19
  return this.browser;
20
20
  }
21
- ef() {
21
+ rf() {
22
22
  return this.version;
23
23
  }
24
- Da(t) {
24
+ Ta(t) {
25
25
  if (this.OS) return Promise.resolve(this.OS);
26
26
  const s = (s) => {
27
27
  for (let r = 0; r < t.length; r++) {
28
- const i = ai.rf(s, t[r]);
28
+ const i = ai.sf(s, t[r]);
29
29
  if (i) return (this.OS = i), this.OS;
30
30
  }
31
31
  return s;
@@ -18,8 +18,8 @@ export function _isInView(t, n = !1, e = !1, s = !1) {
18
18
  !s)
19
19
  );
20
20
  }
21
- export const DOMUtils = { dc: null, co: _isInView };
22
- export const DIRECTIONS = { De: "up", Ee: "down", U: "left", V: "right" };
21
+ export const DOMUtils = { dc: null, po: _isInView };
22
+ export const DIRECTIONS = { Re: "up", Se: "down", U: "left", V: "right" };
23
23
  export function supportsPassive() {
24
24
  if (null == DOMUtils.dc) {
25
25
  DOMUtils.dc = !1;
@@ -41,10 +41,10 @@ export function addPassiveEventListener(t, n, e = () => {}) {
41
41
  t.addEventListener(n, e, !!supportsPassive() && { passive: !0 });
42
42
  }
43
43
  export function topIsInView(t) {
44
- return DOMUtils.co(t, !0, !1, !1);
44
+ return DOMUtils.po(t, !0, !1, !1);
45
45
  }
46
46
  export function bottomIsInView(t) {
47
- return DOMUtils.co(t, !1, !0, !1);
47
+ return DOMUtils.po(t, !1, !0, !1);
48
48
  }
49
49
  export function clickElement(t) {
50
50
  if (t.onclick) {
@@ -69,9 +69,9 @@ export function detectSwipe(t, n, e) {
69
69
  (i = null))
70
70
  : Math.abs(u) >= 25 &&
71
71
  (((u > 0 &&
72
- n === DIRECTIONS.De &&
72
+ n === DIRECTIONS.Re &&
73
73
  t.scrollTop === t.scrollHeight - t.offsetHeight) ||
74
- (u < 0 && n === DIRECTIONS.Ee && 0 === t.scrollTop)) &&
74
+ (u < 0 && n === DIRECTIONS.Se && 0 === t.scrollTop)) &&
75
75
  e(o),
76
76
  (s = null),
77
77
  (i = null));
package/src/util/net.js CHANGED
@@ -2,7 +2,7 @@ import { logger as r } from "../../shared-lib/index.js";
2
2
  import qt from "../models/backend-errors.js";
3
3
  import { getErrorMessage as si } from "./error-utils.js";
4
4
  const C = {
5
- Qs: (t) => {
5
+ Gs: (t) => {
6
6
  let e, o;
7
7
  try {
8
8
  const n = () => {
@@ -13,7 +13,7 @@ const C = {
13
13
  e = new XMLHttpRequest();
14
14
  const i = () => {
15
15
  "function" == typeof t.error && t.error(e.status),
16
- "function" == typeof t.ti && t.ti(!1);
16
+ "function" == typeof t.Ws && t.Ws(!1);
17
17
  };
18
18
  (e.onload = () => {
19
19
  let o = !1;
@@ -28,14 +28,14 @@ const C = {
28
28
  (r = e.getAllResponseHeaders());
29
29
  } catch (o) {
30
30
  const n = {
31
- error: "" === e.responseText ? qt.Ra : qt.Ba,
31
+ error: "" === e.responseText ? qt.Zh : qt.Ra,
32
32
  response: e.responseText,
33
33
  };
34
34
  (0, t.L)(n, r);
35
35
  }
36
36
  o && t.L(o, r);
37
37
  }
38
- "function" == typeof t.ti && t.ti(!0);
38
+ "function" == typeof t.Ws && t.Ws(!0);
39
39
  } else i();
40
40
  }),
41
41
  (e.onerror = () => {
@@ -1,48 +1,47 @@
1
1
  import { REQUEST_ATTEMPT_DEFAULT as Ae } from "../common/constants.js";
2
2
  import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
3
- const S = {
4
- Gs: { La: "d", Bs: "cc", qi: "ff", _r: "t" },
5
- ii: {
6
- La: "/data",
7
- Bs: "/content_cards/sync",
8
- qi: "/feature_flags/sync",
9
- _r: "/template",
10
- },
11
- mc: (e) => (null == e ? void 0 : e.j(o.C.EE)),
12
- Ac: (e) => (null == e ? void 0 : e.j(o.C.lE)),
13
- Tc: (e, t) => {
14
- null == e || e.k(o.C.EE, t);
15
- },
16
- Rc: (e, t) => {
17
- null == e || e.k(o.C.lE, t);
18
- },
19
- Wa: (e, t) => {
20
- if (!e || !t) return -1;
21
- const s = S.mc(e);
3
+ const D = {
4
+ Ps: {
5
+ $a: "data",
6
+ Bs: "content_cards/sync",
7
+ bi: "feature_flags/sync",
8
+ Mr: "template",
9
+ },
10
+ qu: (t) => (null == t ? void 0 : t.j(o.C.lE)),
11
+ sm: (t) => (null == t ? void 0 : t.j(o.C.SE)),
12
+ nm: (t, e) => {
13
+ null == t || t.k(o.C.lE, e);
14
+ },
15
+ um: (t, e) => {
16
+ null == t || t.k(o.C.SE, e);
17
+ },
18
+ Pa: (t, e) => {
19
+ if (!t || !e) return -1;
20
+ const s = D.qu(t);
22
21
  if (null == s) return -1;
23
- const n = s[t];
22
+ const n = s[e];
24
23
  return null == n || isNaN(n) ? -1 : n;
25
24
  },
26
- Ya: (e, t) => {
25
+ Ua: (t, e) => {
27
26
  let s = Ae;
28
- if (!e || !t) return s;
29
- const n = S.Ac(e);
30
- return null == n ? s : ((s = n[t]), null == s || isNaN(s) ? Ae : s);
27
+ if (!t || !e) return s;
28
+ const n = D.sm(t);
29
+ return null == n ? s : ((s = n[e]), null == s || isNaN(s) ? Ae : s);
31
30
  },
32
- Os: (e, t, s) => {
33
- if (!e || !t) return;
34
- let n = S.mc(e);
35
- null == n && (n = {}), (n[t] = s), S.Tc(e, n);
31
+ _s: (t, e, s) => {
32
+ if (!t || !e) return;
33
+ let n = D.qu(t);
34
+ null == n && (n = {}), (n[e] = s), D.nm(t, n);
36
35
  },
37
- Ys: (e, t, s) => {
38
- if (!e || !t) return;
39
- let n = S.Ac(e);
40
- null == n && (n = {}), (n[t] = s), S.Rc(e, n);
36
+ Qs: (t, e, s) => {
37
+ if (!t || !e) return;
38
+ let n = D.sm(t);
39
+ null == n && (n = {}), (n[e] = s), D.um(t, n);
41
40
  },
42
- si: (e, t) => {
43
- if (!e || !t) return;
44
- const s = S.Ya(e, t);
45
- S.Ys(e, t, s + 1);
41
+ Ys: (t, e) => {
42
+ if (!t || !e) return;
43
+ const s = D.Ua(t, e);
44
+ D.Qs(t, e, s + 1);
46
45
  },
47
46
  };
48
- export default S;
47
+ export default D;
@@ -2,18 +2,18 @@ import ge from "./base-device-parser.js";
2
2
  import { Browsers as gi, OperatingSystems as Y } from "./device-constants.js";
3
3
  export default class oi extends ge {
4
4
  constructor() {
5
- super(), (this.nd = oi.hc(navigator.userAgent || ""));
6
- }
7
- tf() {
8
- return this.nd[0] || "Unknown Browser";
5
+ super(), (this.fd = oi.hc(navigator.userAgent || ""));
9
6
  }
10
7
  ef() {
11
- return this.nd[1] || "Unknown Version";
8
+ return this.fd[0] || "Unknown Browser";
9
+ }
10
+ rf() {
11
+ return this.fd[1] || "Unknown Version";
12
12
  }
13
- Da(r) {
13
+ Ta(r) {
14
14
  for (let n = 0; n < r.length; n++) {
15
15
  const e = r[n].string;
16
- let i = oi.rf(e, r[n]);
16
+ let i = oi.sf(e, r[n]);
17
17
  if (i)
18
18
  return (
19
19
  i === Y.Pg && navigator.maxTouchPoints > 1 && (i = Y.io),
@@ -29,6 +29,6 @@ export function _getCurrentUrl() {
29
29
  export const WindowUtils = {
30
30
  openUri: _openUri,
31
31
  fo: _isPhone,
32
- jo: _getOrientation,
32
+ co: _getOrientation,
33
33
  Un: _getCurrentUrl,
34
34
  };