@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
@@ -2,182 +2,196 @@ import { logger as E } from "../../shared-lib/index.js";
2
2
  import t from "../common/base-provider.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
5
- import u from "../managers/subscription-manager.js";
6
- import { randomInclusive as l } from "../util/math.js";
7
- import a from "../util/net.js";
5
+ import m from "../managers/subscription-manager.js";
6
+ import { randomInclusive as a } from "../util/math.js";
7
+ import {
8
+ REQUEST_BACKOFF_MAX_SLEEP_MS_DEFAULT as u,
9
+ REQUEST_BACKOFF_MIN_SLEEP_MS_DEFAULT as c,
10
+ REQUEST_BACKOFF_SCALE_FACTOR_DEFAULT as d,
11
+ } from "../common/constants.js";
12
+ import l from "../util/net.js";
8
13
  import {
9
14
  newFeatureFlagFromJson as at,
10
15
  newFeatureFlagFromSerializedValue as ht,
11
16
  } from "./feature-flag-factory.js";
12
17
  import h from "../util/request-header-utils.js";
13
- export default class nr extends t {
14
- constructor(t, s, e, i) {
18
+ export default class ar extends t {
19
+ constructor(t, s, i, e) {
15
20
  super(),
16
21
  (this.h = t),
17
- (this.B = s),
18
- (this.j = e),
19
- (this.C = i),
20
- (this.je = []),
21
- (this.ye = 0),
22
+ (this.j = s),
23
+ (this.B = i),
24
+ (this.C = e),
25
+ (this.Xr = []),
26
+ (this.Gr = 0),
22
27
  (this.h = t),
23
- (this.B = s),
24
- (this.j = e),
25
- (this.C = i),
26
- (this.Ce = null),
27
- (this.Re = new u()),
28
+ (this.j = s),
29
+ (this.B = i),
30
+ (this.C = e),
31
+ (this.Kr = null),
32
+ (this.Qr = new m()),
28
33
  (this.S = 10),
29
34
  (this.T = null),
30
35
  (this.I = null),
31
- r.q(this.Re);
36
+ r.q(this.Qr);
32
37
  }
33
38
  N(t) {
34
39
  var s;
35
40
  if (
36
- (null === (s = this.h) || void 0 === s ? void 0 : s.Te()) &&
41
+ (null === (s = this.h) || void 0 === s ? void 0 : s.Yr()) &&
37
42
  null != t &&
38
43
  t.feature_flags
39
44
  ) {
40
- this.je = [];
45
+ this.Xr = [];
41
46
  for (const s of t.feature_flags) {
42
47
  const t = at(s);
43
- t && this.je.push(t);
48
+ t && this.Xr.push(t);
44
49
  }
45
- (this.ye = new Date().getTime()), this.De(), this.Re.L(this.je);
50
+ (this.Gr = new Date().getTime()), this.Zr(), this.Qr.L(this.Xr);
46
51
  }
47
52
  }
48
- Ie() {
53
+ ho() {
49
54
  let t = {};
50
- this.j && (t = this.j.lt(s.ct.Se));
51
- const e = {};
55
+ this.B && (t = this.B.dt(s.ft.lo));
56
+ const i = {};
52
57
  for (const s in t) {
53
- const i = ht(t[s]);
54
- i && (e[i.id] = i);
58
+ const e = ht(t[s]);
59
+ e && (i[e.id] = e);
55
60
  }
56
- return e;
61
+ return i;
57
62
  }
58
- qe() {
63
+ do() {
59
64
  var t;
60
65
  return (
61
- (null === (t = this.j) || void 0 === t ? void 0 : t.lt(s.ct.Ne)) || {}
66
+ (null === (t = this.B) || void 0 === t ? void 0 : t.dt(s.ft.vo)) || {}
62
67
  );
63
68
  }
64
- ze(t) {
65
- this.j && this.j.ft(s.ct.Ne, t);
69
+ Fo(t) {
70
+ this.B && this.B.bt(s.ft.vo, t);
66
71
  }
67
- St(t) {
68
- return this.Re.wt(t);
72
+ It(t) {
73
+ return this.Qr.Rt(t);
69
74
  }
70
- refreshFeatureFlags(t, s, e = !1, i = !0) {
75
+ refreshFeatureFlags(t, s, i = !1, e = !0) {
71
76
  const r = () => {
72
- "function" == typeof s && s(), this.Re.L(this.je);
77
+ "function" == typeof s && s(), this.Qr.L(this.Xr);
73
78
  };
74
- if (!this.Ue(e))
79
+ if (!this.po(i))
75
80
  return (
76
- !this.Ce &&
81
+ !this.Kr &&
77
82
  this.h &&
78
- (this.Ce = this.h.$e(() => {
83
+ (this.Kr = this.h.jo(() => {
79
84
  this.refreshFeatureFlags(t, s);
80
85
  })),
81
86
  void r()
82
87
  );
83
- const o = this.B;
88
+ const o = this.j;
84
89
  if (!o) return void r();
85
- i && this.X();
90
+ e && this.X();
86
91
  const n = o.$({}, !0),
87
- u = o.A(n, h.H.ke);
88
- let f = !1;
92
+ f = o.A(n, h.H.wo);
93
+ let m = !1;
89
94
  o.J(
90
95
  n,
91
- (i = -1) => {
92
- const o = this.B;
96
+ (e = -1) => {
97
+ const o = this.j;
93
98
  if (!o) return void r();
94
- const c = new Date().valueOf();
95
- h.K(this.j, h.H.ke, c),
96
- -1 !== i && u.push(["X-Braze-Req-Tokens-Remaining", i.toString()]),
97
- a.O({
99
+ const v = new Date().valueOf();
100
+ h.K(this.B, h.H.wo, v),
101
+ -1 !== e && f.push(["X-Braze-Req-Tokens-Remaining", e.toString()]),
102
+ l.O({
98
103
  url: `${o.V()}/feature_flags/sync`,
99
- headers: u,
104
+ headers: f,
100
105
  data: n,
101
106
  W: (s) => {
102
- if (!o.Y(n, s, u)) return (f = !0), void r();
103
- o.Z(), this.N(s), (f = !1), "function" == typeof t && t();
107
+ if (!o.Y(n, s, f)) return (m = !0), void r();
108
+ o.Z(), this.N(s), (m = !1), "function" == typeof t && t();
104
109
  },
105
110
  error: (t) => {
106
- o._(t, "retrieving feature flags"), (f = !0), r();
111
+ o._(t, "retrieving feature flags"), (m = !0), r();
107
112
  },
108
- tt: (i, r) => {
109
- let a;
110
- if (f) {
111
- let t = this.T;
112
- (null == t || t < 1e3 * this.S) && (t = 1e3 * this.S),
113
- (a = Math.min(3e5, l(1e3 * this.S, 3 * t)));
113
+ tt: (e, r) => {
114
+ var n, l, f;
115
+ let v;
116
+ if (m) {
117
+ const t =
118
+ (null === (n = this.h) || void 0 === n ? void 0 : n.st()) ||
119
+ c,
120
+ s =
121
+ (null === (l = this.h) || void 0 === l ? void 0 : l.it()) ||
122
+ d,
123
+ i =
124
+ (null === (f = this.h) || void 0 === f ? void 0 : f.nt()) ||
125
+ u;
126
+ let e = this.T;
127
+ (null == e || e < t) && (e = t), (v = Math.min(i, a(t, e * s)));
114
128
  }
115
- o.st(
129
+ o.et(
116
130
  r,
117
131
  () => {
118
- this.refreshFeatureFlags(t, s, e, !0);
132
+ this.refreshFeatureFlags(t, s, i, !0);
119
133
  },
120
- h.H.ke,
121
- (t) => this.it(t),
134
+ h.H.wo,
135
+ (t) => this.rt(t),
122
136
  () => this.X(),
123
- a,
137
+ v,
124
138
  );
125
139
  },
126
140
  });
127
141
  },
128
- h.H.ke,
142
+ h.H.wo,
129
143
  s,
130
144
  );
131
145
  }
132
146
  X() {
133
147
  null != this.I && (clearTimeout(this.I), (this.I = null));
134
148
  }
135
- it(t) {
149
+ rt(t) {
136
150
  this.X(), (this.I = t);
137
151
  }
138
- Ue(t) {
152
+ po(t) {
139
153
  if (!this.h) return !1;
140
154
  if (!t) {
141
- const t = this.h.Be();
155
+ const t = this.h.yo();
142
156
  if (null == t) return !1;
143
157
  let s = !1;
144
158
  if (!isNaN(t)) {
145
159
  if (-1 === t) return E.info("Feature flag refreshes not allowed"), !1;
146
- s = new Date().getTime() >= (this.ye || 0) + 1e3 * t;
160
+ s = new Date().getTime() >= (this.Gr || 0) + 1e3 * t;
147
161
  }
148
162
  if (!s)
149
163
  return (
150
164
  E.info(`Feature flag refreshes were rate limited to ${t} seconds`), !1
151
165
  );
152
166
  }
153
- return this.h.Te();
167
+ return this.h.Yr();
154
168
  }
155
- Me() {
169
+ bo() {
156
170
  var t;
157
171
  return (
158
- (null === (t = this.j) || void 0 === t ? void 0 : t.lt(s.ct.Xe)) || null
172
+ (null === (t = this.B) || void 0 === t ? void 0 : t.dt(s.ft.Co)) || null
159
173
  );
160
174
  }
161
- _e() {
162
- var t, e;
163
- null === (t = this.j) ||
175
+ Ro() {
176
+ var t, i;
177
+ null === (t = this.B) ||
164
178
  void 0 === t ||
165
- t.ft(s.ct.Xe, null === (e = this.C) || void 0 === e ? void 0 : e.bt());
179
+ t.bt(s.ft.Co, null === (i = this.C) || void 0 === i ? void 0 : i.yt());
166
180
  }
167
- Ae() {
181
+ To() {
168
182
  var t;
169
- const s = null === (t = this.C) || void 0 === t ? void 0 : t.bt(),
170
- e = this.Me();
171
- return null == e || s === e;
183
+ const s = null === (t = this.C) || void 0 === t ? void 0 : t.yt(),
184
+ i = this.bo();
185
+ return null == i || s === i;
172
186
  }
173
- De() {
174
- if (!this.j) return;
187
+ Zr() {
188
+ if (!this.B) return;
175
189
  const t = {};
176
- for (const s of this.je) {
177
- const e = s.dt();
178
- t[s.id] = e;
190
+ for (const s of this.Xr) {
191
+ const i = s.gt();
192
+ t[s.id] = i;
179
193
  }
180
- this.j.ft(s.ct.Se, t), this.j.ft(s.ct.Ee, this.ye), this._e();
194
+ this.B.bt(s.ft.lo, t), this.B.bt(s.ft.Do, this.Gr), this.Ro();
181
195
  }
182
196
  changeUser() {
183
197
  this.X();
@@ -1,11 +1,11 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import ar from "./feature-flags-provider-factory.js";
2
+ import lr from "./feature-flags-provider-factory.js";
3
3
  export function getAllFeatureFlags() {
4
4
  if (!r.rr()) return;
5
5
  const t = [],
6
6
  e = r.l();
7
- if (e && !e.Te()) return t;
8
- const n = ar.o().Ie();
7
+ if (e && !e.Yr()) return t;
8
+ const n = lr.o().ho();
9
9
  for (const r in n) t.push(n[r]);
10
10
  return t;
11
11
  }
@@ -1,9 +1,9 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import ar from "./feature-flags-provider-factory.js";
2
+ import lr from "./feature-flags-provider-factory.js";
3
3
  export function getFeatureFlag(t) {
4
4
  if (!r.rr()) return;
5
5
  const e = r.l();
6
- if (e && !e.Te()) return null;
7
- const n = ar.o().Ie();
6
+ if (e && !e.Yr()) return null;
7
+ const n = lr.o().ho();
8
8
  return n[t] ? n[t] : null;
9
9
  }
@@ -1,17 +1,17 @@
1
- import { logger as E, EventTypes as m } from "../../shared-lib/index.js";
2
- import c from "../common/event-logger.js";
1
+ import { logger as E, EventTypes as f } from "../../shared-lib/index.js";
2
+ import v from "../common/event-logger.js";
3
3
  import r from "../managers/braze-instance.js";
4
- import ar from "./feature-flags-provider-factory.js";
4
+ import lr from "./feature-flags-provider-factory.js";
5
5
  export function logFeatureFlagImpression(e) {
6
6
  if (!r.rr()) return;
7
7
  if (!e) return !1;
8
8
  const t =
9
9
  "Not logging a feature flag impression. The feature flag was not part of any matching experiment.",
10
- o = ar.o().Ie();
10
+ o = lr.o().ho();
11
11
  if (!o[e]) return E.info(t), !1;
12
12
  const n = o[e].trackingString;
13
13
  if (!n) return E.info(t), !1;
14
- const i = ar.o().qe();
14
+ const i = lr.o().do();
15
15
  if (i[n])
16
16
  return (
17
17
  E.info(
@@ -19,7 +19,7 @@ export function logFeatureFlagImpression(e) {
19
19
  ),
20
20
  !1
21
21
  );
22
- (i[n] = !0), ar.o().ze(i);
22
+ (i[n] = !0), lr.o().Fo(i);
23
23
  const s = { fid: e, fts: n };
24
- return c.rt(m.Ir, s).W;
24
+ return v.lt(f.xo, s).W;
25
25
  }
@@ -1,7 +1,7 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import ar from "./feature-flags-provider-factory.js";
2
+ import lr from "./feature-flags-provider-factory.js";
3
3
  function fr(e, t, a = !1) {
4
- if (r.rr()) return ar.o().refreshFeatureFlags(e, t, a);
4
+ if (r.rr()) return lr.o().refreshFeatureFlags(e, t, a);
5
5
  }
6
6
  export function refreshFeatureFlags(r, e) {
7
7
  fr(r, e);
@@ -1,12 +1,12 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import ar from "./feature-flags-provider-factory.js";
2
+ import lr from "./feature-flags-provider-factory.js";
3
3
  import { getAllFeatureFlags } from "./get-all-feature-flags.js";
4
4
  export function subscribeToFeatureFlagsUpdates(t) {
5
5
  if (!r.rr()) return;
6
- const e = ar.o();
7
- if (e.Ae()) {
6
+ const e = lr.o();
7
+ if (e.To()) {
8
8
  const r = getAllFeatureFlags();
9
9
  r && "function" == typeof t && t(r);
10
10
  }
11
- return e.St(t);
11
+ return e.It(t);
12
12
  }
@@ -0,0 +1,4 @@
1
+ export const IamStrings = {
2
+ sS: "inAppMessage must be an InAppMessage object",
3
+ eS: "ab-pause-scrolling",
4
+ };
@@ -2,12 +2,12 @@ import InAppMessage from "./models/in-app-message.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  import ControlMessage from "./models/control-message.js";
4
4
  import { logger as E } from "../../shared-lib/index.js";
5
- import se from "./in-app-message-manager-factory.js";
5
+ import je from "./in-app-message-manager-factory.js";
6
6
  export function deferInAppMessage(e) {
7
7
  if (r.rr())
8
8
  return e instanceof ControlMessage
9
9
  ? (E.info("Not deferring since this is a ControlMessage."), !1)
10
10
  : e instanceof InAppMessage
11
- ? se.ea().Ge(e)
11
+ ? je.ra().jn(e)
12
12
  : (E.info("Not an instance of InAppMessage, ignoring."), !1);
13
13
  }
@@ -2,7 +2,7 @@ import FullScreenMessage from "../models/full-screen-message.js";
2
2
  import HtmlMessage from "../models/html-message.js";
3
3
  import ModalMessage from "../models/modal-message.js";
4
4
  import SlideUpMessage from "../models/slide-up-message.js";
5
- export default function me(e) {
5
+ export default function be(e) {
6
6
  let s = "";
7
7
  return (
8
8
  e.animateIn && (s += " ab-animate-in"),
@@ -15,10 +15,10 @@ export default function ct(t, e, o, s, n) {
15
15
  s.focus();
16
16
  const l = s.document.getElementsByTagName("head")[0];
17
17
  if (null != l) {
18
- if (t.Oe()) {
18
+ if (t.Mo()) {
19
19
  const e = document.createElement("style");
20
20
  (e.innerHTML = t.css || ""),
21
- (e.id = t.He() || ""),
21
+ (e.id = t.Oo() || ""),
22
22
  null != n && e.setAttribute("nonce", n),
23
23
  l.appendChild(e);
24
24
  }
@@ -42,7 +42,7 @@ export default function ct(t, e, o, s, n) {
42
42
  },
43
43
  );
44
44
  if (
45
- ((s.appboyBridge = r), (s.brazeBridge = r), t.Je !== InAppMessage.Le.Ke)
45
+ ((s.appboyBridge = r), (s.brazeBridge = r), t.ko !== InAppMessage.Eo.Bo)
46
46
  ) {
47
47
  const e = s.document.getElementsByTagName("a");
48
48
  for (let s = 0; s < e.length; s++) e[s].onclick = lt(t, i, e[s], o);
@@ -51,7 +51,7 @@ export default function ct(t, e, o, s, n) {
51
51
  }
52
52
  const c = s.document.body;
53
53
  if (null != c) {
54
- t.Pe() && (c.id = t.htmlId || "");
54
+ t._o() && (c.id = t.htmlId || "");
55
55
  const e = document.createElement("hidden");
56
56
  (e.onclick = r.closeMessage),
57
57
  (e.className = "ab-programmatic-close-button"),
@@ -67,8 +67,8 @@ export default function ct(t, e, o, s, n) {
67
67
  ) {
68
68
  const e = document.createElement("div");
69
69
  return (
70
- (e.className = "ab-ios-scroll-wrapper"), e.appendChild(i), (t.Qe = e), e
70
+ (e.className = "ab-ios-scroll-wrapper"), e.appendChild(i), (t.qo = e), e
71
71
  );
72
72
  }
73
- return (t.Qe = i), i;
73
+ return (t.qo = i), i;
74
74
  }
@@ -1,24 +1,24 @@
1
1
  import {
2
- addPassiveEventListener as J,
3
- buildSvg as oe,
4
- detectSwipe as H,
5
- DIRECTIONS as R,
2
+ addPassiveEventListener as S,
3
+ buildSvg as we,
4
+ detectSwipe as K,
5
+ DIRECTIONS as L,
6
6
  } from "../../util/dom-utils.js";
7
7
  import { createCloseButton as T } from "../../util/component-utils.js";
8
- import { isTransparent as te, toRgba as ae } from "../../util/color-utils.js";
8
+ import { isTransparent as ve, toRgba as ke } from "../../util/color-utils.js";
9
9
  import FullScreenMessage from "../models/full-screen-message.js";
10
10
  import HtmlMessage from "../models/html-message.js";
11
11
  import InAppMessage from "../models/in-app-message.js";
12
12
  import ModalMessage from "../models/modal-message.js";
13
13
  import SlideUpMessage from "../models/slide-up-message.js";
14
14
  import { logInAppMessageClick } from "../log-in-app-message-click.js";
15
- import { _handleBrazeAction as K } from "../../Core/handle-braze-action.js";
15
+ import { _handleBrazeAction as O } from "../../Core/handle-braze-action.js";
16
16
  import ct from "./html-message-to-html.js";
17
- import ne from "./modal-utils.js";
18
- import { logger as E, Guid as L } from "../../../shared-lib/index.js";
19
- import { KeyCodes as ie } from "../../util/key-codes.js";
20
- export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
21
- if (((e.Ve = document.activeElement), e instanceof HtmlMessage))
17
+ import xe from "./modal-utils.js";
18
+ import { logger as E, Guid as P } from "../../../shared-lib/index.js";
19
+ import { KeyCodes as Ce } from "../../util/key-codes.js";
20
+ export default function $e(e, o, t, a, n, i, s = document.body, m = "ltr") {
21
+ if (((e.$o = document.activeElement), e instanceof HtmlMessage))
22
22
  return ct(e, o, a, n, i);
23
23
  const l = (function (e, o, t, a, n, i = document.body, s = "ltr") {
24
24
  let m = null;
@@ -26,20 +26,20 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
26
26
  (l.dir = s),
27
27
  (l.className = "ab-in-app-message ab-start-hidden ab-background"),
28
28
  n && (l.style.zIndex = (n + 1).toString()),
29
- e.We() &&
29
+ e.zo() &&
30
30
  ((l.className += " ab-modal-interactions"),
31
31
  l.setAttribute("tabindex", "-1")),
32
- e.Oe() ||
33
- ((l.style.color = ae(e.textColor)),
34
- (l.style.backgroundColor = ae(e.backgroundColor)),
35
- te(e.backgroundColor) && (l.className += " ab-no-shadow"));
32
+ e.Mo() ||
33
+ ((l.style.color = ke(e.textColor)),
34
+ (l.style.backgroundColor = ke(e.backgroundColor)),
35
+ ve(e.backgroundColor) && (l.className += " ab-no-shadow"));
36
36
  const c = () => {
37
37
  -1 !== l.className.indexOf("ab-start-hidden") &&
38
38
  ((l.className = l.className.replace("ab-start-hidden", "")),
39
39
  document.querySelectorAll(".ab-iam-img-loading").length > 0
40
40
  ? t(
41
41
  `Cannot show in-app message ${e.message} because another message is being shown.`,
42
- InAppMessage.Ze.Ye,
42
+ InAppMessage.Ao.Lo,
43
43
  )
44
44
  : o(l));
45
45
  },
@@ -69,7 +69,7 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
69
69
  e.ll(l, () => {
70
70
  logInAppMessageClick(e),
71
71
  e.clickAction === InAppMessage.ClickAction.URI &&
72
- K(
72
+ O(
73
73
  e.uri || "",
74
74
  a || e.openTarget === InAppMessage.OpenTarget.BLANK,
75
75
  o,
@@ -80,12 +80,12 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
80
80
  );
81
81
  (l.onclick = o),
82
82
  l.addEventListener("keydown", (e) => {
83
- if (e.keyCode === ie.lo || e.keyCode === ie.do) return o(e);
83
+ if (e.keyCode === Ce.Go || e.keyCode === Ce.Ho) return o(e);
84
84
  });
85
85
  }
86
86
  const d = T(
87
87
  "Close Message",
88
- e.Oe() ? void 0 : ae(e.closeButtonColor),
88
+ e.Mo() ? void 0 : ke(e.closeButtonColor),
89
89
  () => {
90
90
  e.ll(l);
91
91
  },
@@ -96,7 +96,7 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
96
96
  (u.className = "ab-message-text"),
97
97
  (u.dir = s),
98
98
  u.setAttribute("role", "article");
99
- const b = (e.messageAlignment || e.bo).toLowerCase();
99
+ const b = (e.messageAlignment || e.Io).toLowerCase();
100
100
  u.className += " " + b + "-aligned";
101
101
  let f = !1;
102
102
  const p = document.createElement("div");
@@ -104,7 +104,7 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
104
104
  const o = document.createElement("img");
105
105
  if (
106
106
  (o.setAttribute("src", e.imageUrl),
107
- e.po(o),
107
+ e.Jo(o),
108
108
  0 === document.querySelectorAll(".ab-iam-img-loading").length)
109
109
  ) {
110
110
  f = !0;
@@ -131,9 +131,9 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
131
131
  p.className += " ab-icon-area";
132
132
  const o = document.createElement("span");
133
133
  (o.className = "ab-icon"),
134
- e.Oe() ||
135
- ((o.style.backgroundColor = ae(e.iconBackgroundColor)),
136
- (o.style.color = ae(e.iconColor)));
134
+ e.Mo() ||
135
+ ((o.style.backgroundColor = ke(e.iconBackgroundColor)),
136
+ (o.style.color = ke(e.iconColor)));
137
137
  const t = document.createElement("i");
138
138
  (t.className = "fa"),
139
139
  t.appendChild(document.createTextNode(e.icon)),
@@ -143,52 +143,52 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
143
143
  l.appendChild(p),
144
144
  (u.className += " ab-with-icon");
145
145
  }
146
- if ((J(u, "touchstart"), e.header && e.header.length > 0)) {
146
+ if ((S(u, "touchstart"), e.header && e.header.length > 0)) {
147
147
  const o = document.createElement("h1");
148
- (o.className = "ab-message-header"), (e.ho = L.oe()), (o.id = e.ho);
148
+ (o.className = "ab-message-header"), (e.Ko = P.se()), (o.id = e.Ko);
149
149
  const t = (
150
150
  e.headerAlignment || InAppMessage.TextAlignment.CENTER
151
151
  ).toLowerCase();
152
152
  (o.className += " " + t + "-aligned"),
153
- e.Oe() || (o.style.color = ae(e.headerTextColor)),
153
+ e.Mo() || (o.style.color = ke(e.headerTextColor)),
154
154
  o.appendChild(document.createTextNode(e.header)),
155
155
  u.appendChild(o);
156
156
  }
157
- const g = e.jo();
158
- return u.appendChild(g), l.appendChild(u), f || c(), (e.Qe = l), l;
157
+ const g = e.No();
158
+ return u.appendChild(g), l.appendChild(u), f || c(), (e.qo = l), l;
159
159
  })(e, o, t, a, n, s, m);
160
160
  if (e instanceof FullScreenMessage || e instanceof ModalMessage) {
161
161
  const o = e instanceof FullScreenMessage ? "ab-fullscreen" : "ab-modal";
162
162
  (l.className += ` ${o} ab-centered`),
163
- ne.wo(e, l, a),
164
- ne.vo(l),
165
- ne.ko(e.ho, l);
163
+ xe.Po(e, l, a),
164
+ xe.Qo(l),
165
+ xe.So(e.Ko, l);
166
166
  } else if (e instanceof SlideUpMessage) {
167
167
  (l.className += " ab-slideup"),
168
168
  l.setAttribute("tabindex", "0"),
169
169
  l.setAttribute("role", "alert");
170
170
  const o = l.getElementsByClassName("ab-close-button")[0];
171
171
  if (null != o) {
172
- const t = oe(
172
+ const t = we(
173
173
  "0 0 11.38 19.44",
174
174
  "M11.38 9.72l-9.33 9.72L0 17.3l7.27-7.58L0 2.14 2.05 0l9.33 9.72z",
175
- e.Oe() ? void 0 : ae(e.closeButtonColor),
175
+ e.Mo() ? void 0 : ke(e.closeButtonColor),
176
176
  );
177
177
  t.setAttribute("class", `ab-chevron ${m}`), o.appendChild(t);
178
178
  }
179
179
  let t, a;
180
- H(l, R.Zt, (e) => {
180
+ K(l, L.de, (e) => {
181
181
  (l.className += " ab-swiped-left"),
182
182
  null != o && null != o.onclick && o.onclick(e);
183
183
  }),
184
- H(l, R.ae, (e) => {
184
+ K(l, L.ce, (e) => {
185
185
  (l.className += " ab-swiped-right"),
186
186
  null != o && null != o.onclick && o.onclick(e);
187
187
  }),
188
188
  e.slideFrom === InAppMessage.SlideFrom.TOP
189
- ? ((t = R.xo), (a = " ab-swiped-up"))
190
- : ((t = R.Co), (a = " ab-swiped-down")),
191
- H(l, t, (e) => {
189
+ ? ((t = L.Uo), (a = " ab-swiped-up"))
190
+ : ((t = L.Vo), (a = " ab-swiped-down")),
191
+ K(l, t, (e) => {
192
192
  (l.className += a), null != o && null != o.onclick && o.onclick(e);
193
193
  });
194
194
  }