@braze/web-sdk 6.7.1 → 6.8.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 (97) hide show
  1. package/index.d.ts +74 -27
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +2 -2
  4. package/shared-lib/event-types.js +13 -13
  5. package/shared-lib/indexed-db-adapter.js +3 -3
  6. package/shared-lib/logger.js +2 -2
  7. package/shared-lib/supported-options.js +8 -8
  8. package/src/Banner/log-banner-impressions.js +20 -11
  9. package/src/ContentCards/content-cards-provider-factory.js +13 -11
  10. package/src/ContentCards/content-cards-provider.js +4 -4
  11. package/src/ContentCards/get-cached-content-cards.js +2 -2
  12. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  13. package/src/ContentCards/subscribe-to-content-cards-updates.js +10 -10
  14. package/src/ContentCards/ui/show-content-cards.js +3 -3
  15. package/src/Core/change-user.js +2 -2
  16. package/src/Core/index.js +1 -0
  17. package/src/Core/log-ecommerce-event.js +29 -0
  18. package/src/Core/log-purchase.js +17 -192
  19. package/src/Core/open-session.js +6 -6
  20. package/src/Core/set-sdk-authentication-signature.js +1 -1
  21. package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
  22. package/src/DUST/dust-connection-core.js +1 -0
  23. package/src/DUST/dust-provider-factory.js +10 -10
  24. package/src/DUST/dust-provider.js +181 -158
  25. package/src/DUST/dust-shared-worker-code.js +1 -1
  26. package/src/DUST/dust-shared-worker-impl.js +93 -100
  27. package/src/DUST/dust-worker-bridge.js +27 -27
  28. package/src/DUST/subscribe-to-dust.js +7 -7
  29. package/src/InAppMessage/defer-in-app-message.js +1 -1
  30. package/src/InAppMessage/display/in-app-message-to-html.js +16 -16
  31. package/src/InAppMessage/display/modal-utils.js +2 -2
  32. package/src/InAppMessage/in-app-message-manager.js +64 -64
  33. package/src/InAppMessage/log-in-app-message-button-click.js +1 -1
  34. package/src/InAppMessage/log-in-app-message-click.js +1 -1
  35. package/src/InAppMessage/log-in-app-message-html-click.js +2 -2
  36. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  37. package/src/InAppMessage/models/full-screen-message.js +7 -7
  38. package/src/InAppMessage/models/html-message.js +1 -1
  39. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  40. package/src/InAppMessage/models/in-app-message.js +22 -22
  41. package/src/InAppMessage/models/modal-message.js +5 -5
  42. package/src/InAppMessage/models/slide-up-message.js +6 -6
  43. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  44. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  45. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  46. package/src/InAppMessage/ui/show-in-app-message.js +20 -20
  47. package/src/Push/push-manager-factory.js +2 -2
  48. package/src/Push/push-manager.js +8 -8
  49. package/src/Push/utils/push-utils.js +6 -6
  50. package/src/User/user-manager.js +5 -5
  51. package/src/User/user.js +8 -8
  52. package/src/common/constants.js +1 -0
  53. package/src/common/content-cards-display.js +2 -2
  54. package/src/l10n/l10n-manager-factory.js +1 -1
  55. package/src/l10n/l10n-manager.js +1 -1
  56. package/src/managers/braze-instance.js +21 -21
  57. package/src/managers/device-manager.js +6 -6
  58. package/src/managers/network-manager.js +93 -92
  59. package/src/managers/server-config-manager.js +68 -68
  60. package/src/managers/session-manager.js +2 -2
  61. package/src/managers/storage-manager-factory.js +4 -4
  62. package/src/managers/storage-manager.js +120 -120
  63. package/src/managers/subscription-manager.js +1 -1
  64. package/src/managers/utils.js +1 -1
  65. package/src/models/backend-errors.js +5 -5
  66. package/src/models/braze-event.js +3 -3
  67. package/src/models/device.js +1 -1
  68. package/src/models/identifier.js +3 -3
  69. package/src/models/push-token.js +5 -5
  70. package/src/models/server-config.js +27 -27
  71. package/src/request-controller.js +99 -99
  72. package/src/triggers/models/custom-event-data.js +4 -4
  73. package/src/triggers/models/custom-event-property-data.js +5 -5
  74. package/src/triggers/models/filter-set.js +2 -2
  75. package/src/triggers/models/filter.js +1 -1
  76. package/src/triggers/models/in-app-message-click-data.js +5 -5
  77. package/src/triggers/models/purchase-data.js +1 -1
  78. package/src/triggers/models/purchase-property-data.js +2 -2
  79. package/src/triggers/models/push-click-data.js +5 -5
  80. package/src/triggers/models/trigger-condition.js +42 -42
  81. package/src/triggers/models/trigger-events.js +2 -2
  82. package/src/triggers/models/trigger.js +10 -10
  83. package/src/triggers/triggers-provider-factory.js +1 -1
  84. package/src/triggers/triggers-provider.js +30 -30
  85. package/src/types.js +5 -1
  86. package/src/ui/js/attach-css.js +1 -1
  87. package/src/util/braze-actions.js +5 -5
  88. package/src/util/browser-detector.js +13 -13
  89. package/src/util/client-hints-parser.js +2 -2
  90. package/src/util/dom-utils.js +2 -2
  91. package/src/util/ecommerce-event-validation.js +326 -0
  92. package/src/util/iso-4217-currency-codes.js +176 -0
  93. package/src/util/net.js +3 -3
  94. package/src/util/request-header-utils.js +18 -18
  95. package/src/util/user-agent-parser.js +14 -14
  96. package/src/util/validation-utils.js +2 -2
  97. package/src/util/window-utils.js +2 -2
@@ -1,26 +1,26 @@
1
1
  import es from "./custom-event-data.js";
2
2
  import ns from "./custom-event-property-data.js";
3
3
  import ls from "./filter-set.js";
4
- import pi from "./in-app-message-click-data.js";
4
+ import bi from "./in-app-message-click-data.js";
5
5
  import os from "./purchase-data.js";
6
6
  import fs from "./purchase-property-data.js";
7
- import dr from "./push-click-data.js";
7
+ import jr from "./push-click-data.js";
8
8
  import ot from "./trigger-events.js";
9
9
  import { logger as E } from "../../../shared-lib/index.js";
10
- import { getErrorMessage as ai } from "../../util/error-utils.js";
11
- export default class gi {
10
+ import { getErrorMessage as hi } from "../../util/error-utils.js";
11
+ export default class pi {
12
12
  constructor(e, t) {
13
13
  (this.type = e), (this.data = t), (this.type = e), (this.data = t);
14
14
  }
15
15
  Vc(e, t) {
16
- return gi.Yc[this.type] === e && (null == this.data || this.data.Hc(t));
16
+ return pi.Yc[this.type] === e && (null == this.data || this.data.Qc(t));
17
17
  }
18
18
  static sf(e, t) {
19
19
  let r = null;
20
20
  try {
21
21
  r = window.atob(e);
22
22
  } catch (t) {
23
- return E.info("Failed to unencode analytics id " + e + ": " + ai(t)), !1;
23
+ return E.info("Failed to unencode analytics id " + e + ": " + hi(t)), !1;
24
24
  }
25
25
  return t === r.split("_")[0];
26
26
  }
@@ -28,28 +28,28 @@ export default class gi {
28
28
  const t = e.type;
29
29
  let r = null;
30
30
  switch (t) {
31
- case gi.la.OPEN:
32
- case gi.la.Ls:
31
+ case pi.ma.OPEN:
32
+ case pi.ma.Ls:
33
33
  break;
34
- case gi.la.Rr:
34
+ case pi.ma.qr:
35
35
  r = os.fromJson(e.data);
36
36
  break;
37
- case gi.la.Qc:
37
+ case pi.ma.Zc:
38
38
  r = fs.fromJson(e.data);
39
39
  break;
40
- case gi.la.Fr:
41
- r = dr.fromJson(e.data);
40
+ case pi.ma.Sr:
41
+ r = jr.fromJson(e.data);
42
42
  break;
43
- case gi.la.he:
43
+ case pi.ma.he:
44
44
  r = es.fromJson(e.data);
45
45
  break;
46
- case gi.la.Xc:
46
+ case pi.ma.km:
47
47
  r = ns.fromJson(e.data);
48
48
  break;
49
- case gi.la.rm:
50
- r = pi.fromJson(e.data);
49
+ case pi.ma.rm:
50
+ r = bi.fromJson(e.data);
51
51
  }
52
- return new gi(t, r);
52
+ return new pi(t, r);
53
53
  }
54
54
  qt() {
55
55
  return { t: this.type, d: this.data ? this.data.qt() : null };
@@ -58,46 +58,46 @@ export default class gi {
58
58
  let t,
59
59
  r = null;
60
60
  switch (e.t) {
61
- case gi.la.OPEN:
62
- case gi.la.Ls:
61
+ case pi.ma.OPEN:
62
+ case pi.ma.Ls:
63
63
  break;
64
- case gi.la.Rr:
64
+ case pi.ma.qr:
65
65
  r = new os(e.d);
66
66
  break;
67
- case gi.la.Qc:
67
+ case pi.ma.Zc:
68
68
  (t = e.d || {}), (r = new fs(t.id, ls._u(t.pf || [])));
69
69
  break;
70
- case gi.la.Fr:
71
- r = new dr(e.d);
70
+ case pi.ma.Sr:
71
+ r = new jr(e.d);
72
72
  break;
73
- case gi.la.he:
73
+ case pi.ma.he:
74
74
  r = new es(e.d);
75
75
  break;
76
- case gi.la.Xc:
76
+ case pi.ma.km:
77
77
  (t = e.d || {}), (r = new ns(t.e, ls._u(t.pf || [])));
78
78
  break;
79
- case gi.la.rm:
80
- r = new pi(e.d);
79
+ case pi.ma.rm:
80
+ r = new bi(e.d);
81
81
  }
82
- return new gi(e.t, r);
82
+ return new pi(e.t, r);
83
83
  }
84
84
  }
85
- (gi.la = {
85
+ (pi.ma = {
86
86
  OPEN: "open",
87
- Rr: "purchase",
88
- Qc: "purchase_property",
89
- Fr: "push_click",
87
+ qr: "purchase",
88
+ Zc: "purchase_property",
89
+ Sr: "push_click",
90
90
  he: "custom_event",
91
- Xc: "custom_event_property",
91
+ km: "custom_event_property",
92
92
  rm: "iam_click",
93
93
  Ls: "test",
94
94
  }),
95
- (gi.Yc = {}),
96
- (gi.Yc[gi.la.OPEN] = ot.OPEN),
97
- (gi.Yc[gi.la.Rr] = ot.Rr),
98
- (gi.Yc[gi.la.Qc] = ot.Rr),
99
- (gi.Yc[gi.la.Fr] = ot.Fr),
100
- (gi.Yc[gi.la.he] = ot.he),
101
- (gi.Yc[gi.la.Xc] = ot.he),
102
- (gi.Yc[gi.la.rm] = ot.rm),
103
- (gi.Yc[gi.la.Ls] = ot.Ls);
95
+ (pi.Yc = {}),
96
+ (pi.Yc[pi.ma.OPEN] = ot.OPEN),
97
+ (pi.Yc[pi.ma.qr] = ot.qr),
98
+ (pi.Yc[pi.ma.Zc] = ot.qr),
99
+ (pi.Yc[pi.ma.Sr] = ot.Sr),
100
+ (pi.Yc[pi.ma.he] = ot.he),
101
+ (pi.Yc[pi.ma.km] = ot.he),
102
+ (pi.Yc[pi.ma.rm] = ot.rm),
103
+ (pi.Yc[pi.ma.Ls] = ot.Ls);
@@ -1,7 +1,7 @@
1
1
  export default {
2
2
  OPEN: "open",
3
- Rr: "purchase",
4
- Fr: "push_click",
3
+ qr: "purchase",
4
+ Sr: "push_click",
5
5
  he: "custom_event",
6
6
  rm: "iam_click",
7
7
  Ls: "test",
@@ -3,7 +3,7 @@ import {
3
3
  rehydrateDateAfterJsonization as ee,
4
4
  } from "../../util/date-utils.js";
5
5
  import { logger as E } from "../../../shared-lib/index.js";
6
- import gi from "./trigger-condition.js";
6
+ import pi from "./trigger-condition.js";
7
7
  import { validateValueIsFromEnum as ta } from "../../util/code-utils.js";
8
8
  export default class gt {
9
9
  constructor(t, i = [], s, e, r = 0, h, l, o = 0, n = gt.sd, a, u, d) {
@@ -16,7 +16,7 @@ export default class gt {
16
16
  (this.data = l),
17
17
  (this.hd = o),
18
18
  (this.nd = n),
19
- (this.ca = a),
19
+ (this.ha = a),
20
20
  (this.ad = u),
21
21
  (this.ud = d),
22
22
  (this.id = t),
@@ -29,7 +29,7 @@ export default class gt {
29
29
  (this.type = h),
30
30
  (this.hd = o || 0),
31
31
  null == a && (a = 1e3 * (this.hd + 30)),
32
- (this.ca = a),
32
+ (this.ha = a),
33
33
  (this.data = l),
34
34
  null != n && (this.nd = n),
35
35
  (this.ad = u),
@@ -49,11 +49,11 @@ export default class gt {
49
49
  }
50
50
  fd(t) {
51
51
  const i = new Date().valueOf() - t,
52
- s = null == t || isNaN(i) || null == this.ca || i < this.ca;
52
+ s = null == t || isNaN(i) || null == this.ha || i < this.ha;
53
53
  return (
54
54
  s ||
55
55
  E.info(
56
- `Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.ca}ms.`,
56
+ `Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.ha}ms.`,
57
57
  ),
58
58
  !s
59
59
  );
@@ -62,7 +62,7 @@ export default class gt {
62
62
  const i = t.id,
63
63
  s = [];
64
64
  for (let i = 0; i < t.trigger_condition.length; i++)
65
- s.push(gi.fromJson(t.trigger_condition[i]));
65
+ s.push(pi.fromJson(t.trigger_condition[i]));
66
66
  const e = Y(t.start_time),
67
67
  r = Y(t.end_time),
68
68
  h = t.priority,
@@ -73,7 +73,7 @@ export default class gt {
73
73
  u = t.data,
74
74
  d = t.min_seconds_since_last_trigger;
75
75
  return ta(
76
- gt.la,
76
+ gt.ma,
77
77
  l,
78
78
  "Could not construct Trigger from server data",
79
79
  "Trigger.Types",
@@ -94,7 +94,7 @@ export default class gt {
94
94
  da: this.data,
95
95
  d: this.hd,
96
96
  r: this.nd,
97
- tm: this.ca,
97
+ tm: this.ha,
98
98
  ss: this.ad,
99
99
  ld: this.ud,
100
100
  };
@@ -102,7 +102,7 @@ export default class gt {
102
102
  static _u(t) {
103
103
  const i = [],
104
104
  s = t.c || [];
105
- for (let t = 0; t < s.length; t++) i.push(gi._u(s[t]));
105
+ for (let t = 0; t < s.length; t++) i.push(pi._u(s[t]));
106
106
  return new gt(
107
107
  t.i,
108
108
  i,
@@ -119,4 +119,4 @@ export default class gt {
119
119
  );
120
120
  }
121
121
  }
122
- (gt.la = { oa: "inapp", pd: "templated_iam" }), (gt.sd = -1);
122
+ (gt.ma = { ua: "inapp", pd: "templated_iam" }), (gt.sd = -1);
@@ -14,7 +14,7 @@ export const TriggersProviderFactory = {
14
14
  const i = r.er(U.Dh);
15
15
  (TriggersProviderFactory.provider = new vr(
16
16
  null != i ? i : 30,
17
- je.ra().Pn(),
17
+ je.ra().Gn(),
18
18
  r.p(),
19
19
  r.nn(),
20
20
  je.ra(),
@@ -3,7 +3,7 @@ import { newInAppMessageFromJson as pt } from "../InAppMessage/in-app-message-fa
3
3
  import Ie from "../models/braze-event.js";
4
4
  import {
5
5
  isArray as g,
6
- isEqual as ni,
6
+ isEqual as oi,
7
7
  validateValueIsFromEnum as ta,
8
8
  } from "../util/code-utils.js";
9
9
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
@@ -36,9 +36,9 @@ export default class vr extends t {
36
36
  }
37
37
  fg() {
38
38
  if (this.C) {
39
- (this.hg = this.C.Rt(s.Tt.oS) || this.hg),
40
- (this.ng = this.C.Rt(s.Tt.nS) || this.ng),
41
- (this.og = this.C.Rt(s.Tt.rS) || this.og);
39
+ (this.hg = this.C.Rt(s.Tt.nS) || this.hg),
40
+ (this.ng = this.C.Rt(s.Tt.aS) || this.ng),
41
+ (this.og = this.C.Rt(s.Tt.oS) || this.og);
42
42
  for (let t = 0; t < this.triggers.length; t++) {
43
43
  const i = this.triggers[t];
44
44
  i.id && null != this.og[i.id] && i.md(this.og[i.id]);
@@ -47,8 +47,8 @@ export default class vr extends t {
47
47
  }
48
48
  ag() {
49
49
  if (!this.C) return;
50
- this.lg = this.C.Rt(s.Tt.sS) || 0;
51
- const t = this.C.Rt(s.Tt.eS) || [],
50
+ this.lg = this.C.Rt(s.Tt.rS) || 0;
51
+ const t = this.C.Rt(s.Tt.sS) || [],
52
52
  i = [];
53
53
  for (let s = 0; s < t.length; s++) i.push(gt._u(t[s]));
54
54
  (this.triggers = i), this.fg();
@@ -70,19 +70,19 @@ export default class vr extends t {
70
70
  h = [];
71
71
  for (let r = 0; r < t.length; r++) {
72
72
  const n = t[r],
73
- o = s.gd(n.ma || 0);
73
+ o = s.gd(n.pa || 0);
74
74
  if (o > 0) {
75
75
  let t, r;
76
76
  h.push(n),
77
77
  null != n.ug && (t = n.ug),
78
- null != n.dg && Ie.hS(n.dg) && (r = Ie._u(n.dg));
78
+ null != n.dg && Ie.AS(n.dg) && (r = Ie._u(n.dg));
79
79
  const l = [];
80
80
  if (n.pg && g(n.pg))
81
81
  for (let t = 0; t < n.pg.length; t++) {
82
82
  const i = e[n.pg[t]];
83
83
  null != i && l.push(i);
84
84
  }
85
- this.eg.push(window.setTimeout(i(s, n.ma || 0, t, r, l), o));
85
+ this.eg.push(window.setTimeout(i(s, n.pa || 0, t, r, l), o));
86
86
  }
87
87
  }
88
88
  this.ng[s.id].length > h.length &&
@@ -91,7 +91,7 @@ export default class vr extends t {
91
91
  0 === this.ng[s.id].length && delete this.ng[s.id]);
92
92
  }
93
93
  }
94
- r && this.C && this.C.It(s.Tt.nS, this.ng);
94
+ r && this.C && this.C.It(s.Tt.aS, this.ng);
95
95
  }
96
96
  mg() {
97
97
  if (!this.C) return;
@@ -99,17 +99,17 @@ export default class vr extends t {
99
99
  for (let i = 0; i < this.triggers.length; i++)
100
100
  t.push(this.triggers[i].qt());
101
101
  (this.lg = new Date().valueOf()),
102
- this.C.It(s.Tt.eS, t),
103
- this.C.It(s.Tt.sS, this.lg);
102
+ this.C.It(s.Tt.sS, t),
103
+ this.C.It(s.Tt.rS, this.lg);
104
104
  }
105
105
  bg() {
106
106
  if (!this.C) return;
107
- (this.C.Rt(s.Tt.sS) || 0) > this.lg ? this.ag() : this.fg();
107
+ (this.C.Rt(s.Tt.rS) || 0) > this.lg ? this.ag() : this.fg();
108
108
  }
109
109
  I(t) {
110
110
  let i = !1;
111
111
  if (null != t && t.triggers) {
112
- this.ig.fa(), this.fg();
112
+ this.ig.da(), this.fg();
113
113
  const e = {},
114
114
  r = {};
115
115
  this.triggers = [];
@@ -128,9 +128,9 @@ export default class vr extends t {
128
128
  this.triggers.push(h);
129
129
  }
130
130
  }
131
- ni(this.og, e) || ((this.og = e), this.C && this.C.It(s.Tt.rS, this.og)),
132
- ni(this.ng, r) ||
133
- ((this.ng = r), this.C && this.C.It(s.Tt.nS, this.ng)),
131
+ oi(this.og, e) || ((this.og = e), this.C && this.C.It(s.Tt.oS, this.og)),
132
+ oi(this.ng, r) ||
133
+ ((this.ng = r), this.C && this.C.It(s.Tt.aS, this.ng)),
134
134
  this.mg(),
135
135
  i &&
136
136
  (E.info("Trigger with test condition found, firing test."),
@@ -148,12 +148,12 @@ export default class vr extends t {
148
148
  this.fg();
149
149
  const r = new Date().valueOf();
150
150
  t.fd(i) ||
151
- (!1 === navigator.onLine && t.type === gt.la.oa && e.imageUrl
151
+ (!1 === navigator.onLine && t.type === gt.ma.ua && e.imageUrl
152
152
  ? E.info(
153
153
  `Not showing ${t.type} trigger action ${t.id} due to offline state.`,
154
154
  )
155
155
  : t.dd(r) && this.wg(t, r, s)
156
- ? 0 === this.Rs.Le()
156
+ ? 0 === this.Rs.Ke()
157
157
  ? E.info(
158
158
  `Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`,
159
159
  )
@@ -185,27 +185,27 @@ export default class vr extends t {
185
185
  };
186
186
  let o, l, a;
187
187
  switch (t.type) {
188
- case gt.la.oa:
188
+ case gt.ma.ua:
189
189
  if (((o = pt(t.data)), null == o)) {
190
190
  E.error(
191
191
  `Could not parse trigger data for trigger ${t.id}, ignoring.`,
192
192
  );
193
193
  break;
194
194
  }
195
- if (((l = this.ig.Qn(o)), l)) {
195
+ if (((l = this.ig.Vn(o)), l)) {
196
196
  E.error(l), n();
197
197
  break;
198
198
  }
199
199
  h(o);
200
200
  break;
201
- case gt.la.pd:
202
- if (((a = Jt.fromJson(t.data, h, n, i, t.ca || 0)), null == a)) {
201
+ case gt.ma.pd:
202
+ if (((a = Jt.fromJson(t.data, h, n, i, t.ha || 0)), null == a)) {
203
203
  E.error(
204
204
  `Could not parse trigger data for trigger ${t.id}, ignoring.`,
205
205
  );
206
206
  break;
207
207
  }
208
- this.ig.Xo(a, s, e);
208
+ this.ig.Zo(a, s, e);
209
209
  break;
210
210
  default:
211
211
  E.error(`Trigger ${t.id} was of unexpected type ${t.type}, ignoring.`);
@@ -213,7 +213,7 @@ export default class vr extends t {
213
213
  }
214
214
  Ee(t, i = null, s) {
215
215
  if (!ta(ot, t, "Cannot fire trigger action.", "TriggerEvents")) return;
216
- if (this.Ru && this.Ru.Ic())
216
+ if (this.Ru && this.Ru.Pc())
217
217
  return (
218
218
  E.info(
219
219
  "Trigger sync is currently in progress, awaiting sync completion before firing trigger event.",
@@ -269,11 +269,11 @@ export default class vr extends t {
269
269
  ));
270
270
  }
271
271
  changeUser(t = !1) {
272
- if (((this.triggers = []), this.C && this.C.Qt(s.Tt.eS), !t)) {
272
+ if (((this.triggers = []), this.C && this.C.Qt(s.Tt.sS), !t)) {
273
273
  (this.sg = []), (this.hg = null), (this.og = {}), (this.ng = {});
274
274
  for (let t = 0; t < this.eg.length; t++) clearTimeout(this.eg[t]);
275
275
  (this.eg = []),
276
- this.C && (this.C.Qt(s.Tt.oS), this.C.Qt(s.Tt.rS), this.C.Qt(s.Tt.nS));
276
+ this.C && (this.C.Qt(s.Tt.nS), this.C.Qt(s.Tt.oS), this.C.Qt(s.Tt.aS));
277
277
  }
278
278
  }
279
279
  clearData() {
@@ -297,18 +297,18 @@ export default class vr extends t {
297
297
  this.fg(), t.id && (this.ng[t.id] = this.ng[t.id] || []);
298
298
  const n = {};
299
299
  let o;
300
- (n.ma = i), (n.ug = e), null != r && (o = r.qt()), (n.dg = o);
300
+ (n.pa = i), (n.ug = e), null != r && (o = r.qt()), (n.dg = o);
301
301
  const l = [];
302
302
  for (const t of h) t.id && l.push(t.id);
303
303
  (n.pg = l),
304
304
  t.id && this.ng[t.id].push(n),
305
- this.C && this.C.It(s.Tt.nS, this.ng);
305
+ this.C && this.C.It(s.Tt.aS, this.ng);
306
306
  }
307
307
  yg(t, i) {
308
308
  this.fg(),
309
309
  t.md(i),
310
310
  (this.hg = i),
311
311
  t.id && (this.og[t.id] = i),
312
- this.C && (this.C.It(s.Tt.oS, i), this.C.It(s.Tt.rS, this.og));
312
+ this.C && (this.C.It(s.Tt.nS, i), this.C.It(s.Tt.oS, this.og));
313
313
  }
314
314
  }
package/src/types.js CHANGED
@@ -1 +1,5 @@
1
- export {};
1
+ export const CartUpdatedActions = {
2
+ REPLACE: "replace",
3
+ Ed: "add",
4
+ Ad: "remove",
5
+ };
@@ -1,7 +1,7 @@
1
1
  import r, { OPTIONS as U } from "../../managers/braze-instance.js";
2
2
  export function attachCSS(n, t, o) {
3
3
  const c = n || document.querySelector("head"),
4
- e = `ab-${t}-css-definitions-${"6.7.1".replace(/\./g, "-")}`;
4
+ e = `ab-${t}-css-definitions-${"6.8.0".replace(/\./g, "-")}`;
5
5
  if (!c) return;
6
6
  const s = c.ownerDocument || document;
7
7
  if (null == s.getElementById(e)) {
@@ -1,5 +1,5 @@
1
1
  import { logger as E } from "../../shared-lib/index.js";
2
- import { getErrorMessage as ai } from "./error-utils.js";
2
+ import { getErrorMessage as hi } from "./error-utils.js";
3
3
  import { decodeBrazeActions as uo } from "./string-utils.js";
4
4
  import {
5
5
  BRAZE_ACTION_URI_REGEX as to,
@@ -25,11 +25,11 @@ export const BRAZE_ACTIONS = {
25
25
  properties: { type: "type", eo: "steps", so: "args" },
26
26
  };
27
27
  export const INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES = {
28
- Un: "unknownBrazeAction",
29
- Zc: "noPushPrompt",
28
+ Wn: "unknownBrazeAction",
29
+ cp: "noPushPrompt",
30
30
  };
31
31
  export const ineligibleBrazeActionURLErrorMessage = (t, o) =>
32
- t === INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Un
32
+ t === INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Wn
33
33
  ? `${o} contains an unknown braze action type and will not be displayed.`
34
34
  : "";
35
35
  export function getDecodedBrazeAction(t) {
@@ -46,7 +46,7 @@ export function getDecodedBrazeAction(t) {
46
46
  ? JSON.parse(e)
47
47
  : void E.error(`Failed to decode base64 encoded brazeAction: ${n}`);
48
48
  } catch (o) {
49
- return void E.error(`Failed to process brazeAction URL ${t} : ${ai(o)}`);
49
+ return void E.error(`Failed to process brazeAction URL ${t} : ${hi(o)}`);
50
50
  }
51
51
  }
52
52
  function po(t, o) {
@@ -1,13 +1,13 @@
1
1
  import Si from "./client-hints-parser.js";
2
- import bi from "./user-agent-parser.js";
3
- import { Browsers as vi, OperatingSystems as so } from "./device-constants.js";
4
- class yi {
2
+ import vi from "./user-agent-parser.js";
3
+ import { Browsers as yi, OperatingSystems as so } from "./device-constants.js";
4
+ class xi {
5
5
  constructor() {
6
6
  let t;
7
7
  (t =
8
- navigator.userAgent.toLowerCase().includes(vi.Sg.toLowerCase()) ||
8
+ navigator.userAgent.toLowerCase().includes(yi.Sg.toLowerCase()) ||
9
9
  !navigator.userAgentData
10
- ? bi
10
+ ? vi
11
11
  : Si),
12
12
  (this.vg = new t()),
13
13
  (this.userAgent = navigator.userAgent),
@@ -23,18 +23,18 @@ class yi {
23
23
  i.systemLanguage ||
24
24
  ""
25
25
  ).toLowerCase()),
26
- (this.il = yi.xg(this.userAgent));
26
+ (this.il = xi.xg(this.userAgent));
27
27
  }
28
- IS() {
29
- return this.browser === vi.Bg;
28
+ bS() {
29
+ return this.browser === yi.Bg;
30
30
  }
31
- Aa() {
31
+ Ha() {
32
32
  return this.OS || null;
33
33
  }
34
34
  Fa() {
35
35
  return this.OS
36
36
  ? Promise.resolve(this.OS)
37
- : this.vg.Fa(yi.Og).then((t) => ((this.OS = t), t));
37
+ : this.vg.Fa(xi.Og).then((t) => ((this.OS = t), t));
38
38
  }
39
39
  static xg(t) {
40
40
  t = t.toLowerCase();
@@ -63,7 +63,7 @@ class yi {
63
63
  return !1;
64
64
  }
65
65
  }
66
- yi.Og = [
66
+ xi.Og = [
67
67
  { string: navigator.platform, cf: "Win", identity: so.kg },
68
68
  { string: navigator.platform, cf: "Mac", identity: so.Pg },
69
69
  { string: navigator.platform, cf: "BlackBerry", identity: "BlackBerry" },
@@ -91,5 +91,5 @@ yi.Og = [
91
91
  { string: navigator.userAgent, cf: ["Android"], identity: so.Dg },
92
92
  { string: navigator.platform, cf: "Linux", identity: "Linux" },
93
93
  ];
94
- const ro = new yi();
95
- export { ro as default, yi as BrowserDetector };
94
+ const ro = new xi();
95
+ export { ro as default, xi as BrowserDetector };
@@ -1,5 +1,5 @@
1
1
  import Ve from "./base-device-parser.js";
2
- import { Browsers as vi } from "./device-constants.js";
2
+ import { Browsers as yi } from "./device-constants.js";
3
3
  export default class Si extends Ve {
4
4
  constructor() {
5
5
  if (
@@ -41,7 +41,7 @@ export default class Si extends Ve {
41
41
  s = this.userAgentData.brands;
42
42
  if (s && s.length)
43
43
  for (const r of s) {
44
- const s = this.uf(vi),
44
+ const s = this.uf(yi),
45
45
  i = r.brand.match(s);
46
46
  if (i && i.length > 0) {
47
47
  (t.browser = i[0]), (t.version = r.version);
@@ -1,5 +1,5 @@
1
1
  import { logger as E } from "../../shared-lib/index.js";
2
- import { getErrorMessage as ai } from "./error-utils.js";
2
+ import { getErrorMessage as hi } from "./error-utils.js";
3
3
  export function _isInView(t, n = !1, e = !1, s = !1) {
4
4
  if (null == t) return !1;
5
5
  (n = n || !1), (e = e || !1);
@@ -32,7 +32,7 @@ export function supportsPassive() {
32
32
  window.addEventListener("testPassive", () => {}, t),
33
33
  window.removeEventListener("testPassive", () => {}, t);
34
34
  } catch (t) {
35
- E.error(ai(t));
35
+ E.error(hi(t));
36
36
  }
37
37
  }
38
38
  return DOMUtils.lp;