@braze/web-sdk 5.0.0 → 5.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 (158) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +12 -5
  3. package/package.json +1 -1
  4. package/shared-lib/encoding-utils.js +3 -3
  5. package/shared-lib/event-types.js +29 -29
  6. package/shared-lib/guid.js +3 -3
  7. package/shared-lib/index.js +6 -0
  8. package/shared-lib/indexed-db-adapter.js +70 -70
  9. package/shared-lib/logger.js +18 -18
  10. package/shared-lib/supported-options.js +21 -21
  11. package/src/Card/card-manager.js +43 -45
  12. package/src/Card/display/card-display.js +60 -60
  13. package/src/Card/log-card-click.js +4 -4
  14. package/src/Card/log-card-dismissal.js +2 -3
  15. package/src/Card/log-card-impressions.js +7 -7
  16. package/src/Card/models/captioned-image.js +21 -21
  17. package/src/Card/models/card.js +73 -73
  18. package/src/Card/models/classic-card.js +21 -21
  19. package/src/Card/models/control-card.js +11 -11
  20. package/src/Card/models/image-only.js +19 -19
  21. package/src/Card/util/card-factory.js +68 -68
  22. package/src/ContentCards/content-cards-provider-factory.js +3 -3
  23. package/src/ContentCards/content-cards-provider.js +255 -245
  24. package/src/ContentCards/content-cards.js +2 -2
  25. package/src/ContentCards/get-cached-content-cards.js +1 -1
  26. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  27. package/src/ContentCards/subscribe-to-content-cards-updates.js +6 -6
  28. package/src/ContentCards/ui/hide-content-cards.js +1 -1
  29. package/src/ContentCards/ui/show-content-cards.js +24 -24
  30. package/src/ContentCards/ui/toggle-content-cards.js +1 -1
  31. package/src/Core/add-sdk-metadata.js +21 -19
  32. package/src/Core/change-user.js +10 -10
  33. package/src/Core/destroy.js +2 -2
  34. package/src/Core/disable-sdk.js +11 -11
  35. package/src/Core/enable-sdk.js +7 -7
  36. package/src/Core/get-device-id.js +6 -6
  37. package/src/Core/get-user.js +1 -1
  38. package/src/Core/handle-braze-action.js +41 -41
  39. package/src/Core/is-disabled.js +2 -2
  40. package/src/Core/log-custom-event.js +15 -15
  41. package/src/Core/log-purchase.js +31 -37
  42. package/src/Core/open-session.js +12 -12
  43. package/src/Core/remove-all-subscriptions.js +1 -1
  44. package/src/Core/remove-subscription.js +1 -1
  45. package/src/Core/request-immediate-data-flush.js +1 -1
  46. package/src/Core/set-logger.js +2 -2
  47. package/src/Core/set-sdk-authentication-signature.js +3 -3
  48. package/src/Core/subscribe-to-sdk-authentication-failures.js +6 -4
  49. package/src/Core/toggle-logging.js +2 -2
  50. package/src/Core/wipe-data.js +9 -9
  51. package/src/FeatureFlags/feature-flag-factory.js +12 -12
  52. package/src/FeatureFlags/feature-flag.js +10 -10
  53. package/src/FeatureFlags/feature-flags-provider-factory.js +3 -2
  54. package/src/FeatureFlags/feature-flags-provider.js +108 -80
  55. package/src/FeatureFlags/get-all-feature-flags.js +5 -5
  56. package/src/FeatureFlags/get-feature-flag.js +6 -6
  57. package/src/FeatureFlags/log-feature-flag-impression.js +15 -13
  58. package/src/FeatureFlags/refresh-feature-flags.js +1 -1
  59. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +7 -4
  60. package/src/Feed/feed-provider-factory.js +2 -2
  61. package/src/Feed/feed-provider.js +44 -44
  62. package/src/Feed/feed.js +1 -1
  63. package/src/Feed/get-cached-feed.js +1 -1
  64. package/src/Feed/log-feed-displayed.js +4 -4
  65. package/src/Feed/request-feed-refresh.js +1 -1
  66. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  67. package/src/Feed/ui/hide-feed.js +1 -1
  68. package/src/Feed/ui/show-feed.js +28 -28
  69. package/src/Feed/ui/toggle-feed.js +1 -1
  70. package/src/InAppMessage/defer-in-app-message.js +5 -5
  71. package/src/InAppMessage/display/html-message-to-html.js +54 -54
  72. package/src/InAppMessage/display/in-app-message-to-html.js +79 -79
  73. package/src/InAppMessage/display/modal-utils.js +8 -8
  74. package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
  75. package/src/InAppMessage/in-app-message-factory.js +49 -49
  76. package/src/InAppMessage/in-app-message-manager-factory.js +1 -1
  77. package/src/InAppMessage/in-app-message-manager.js +143 -138
  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 +12 -12
  81. package/src/InAppMessage/log-in-app-message-impression.js +6 -6
  82. package/src/InAppMessage/models/full-screen-message.js +33 -33
  83. package/src/InAppMessage/models/html-message.js +20 -20
  84. package/src/InAppMessage/models/in-app-message-button.js +6 -6
  85. package/src/InAppMessage/models/in-app-message.js +99 -99
  86. package/src/InAppMessage/models/modal-message.js +32 -32
  87. package/src/InAppMessage/models/slide-up-message.js +28 -28
  88. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  89. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  90. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +4 -4
  91. package/src/InAppMessage/ui/show-in-app-message.js +81 -81
  92. package/src/Push/is-push-blocked.js +1 -1
  93. package/src/Push/is-push-permission-granted.js +1 -1
  94. package/src/Push/is-push-supported.js +1 -1
  95. package/src/Push/push-manager-factory.js +5 -5
  96. package/src/Push/push-manager.js +176 -173
  97. package/src/Push/request-push-permission.js +1 -1
  98. package/src/Push/unregister-push.js +1 -1
  99. package/src/Push/utils/push-utils.js +4 -4
  100. package/src/User/user-manager.js +29 -29
  101. package/src/User/user.js +72 -74
  102. package/src/common/base-feed.js +7 -7
  103. package/src/common/base-provider.js +1 -1
  104. package/src/common/constants.js +2 -0
  105. package/src/common/event-logger.js +21 -18
  106. package/src/common/feed-display.js +44 -44
  107. package/src/l10n/l10n-manager-factory.js +3 -3
  108. package/src/l10n/l10n-manager.js +7 -7
  109. package/src/managers/auth-manager.js +32 -32
  110. package/src/managers/braze-instance.js +188 -189
  111. package/src/managers/device-manager.js +28 -28
  112. package/src/managers/network-manager.js +189 -138
  113. package/src/managers/server-config-manager.js +69 -53
  114. package/src/managers/session-manager.js +34 -30
  115. package/src/managers/storage-manager-factory.js +16 -16
  116. package/src/managers/storage-manager.js +210 -188
  117. package/src/managers/subscription-manager.js +12 -12
  118. package/src/models/backend-errors.js +5 -5
  119. package/src/models/braze-event.js +3 -3
  120. package/src/models/device.js +2 -2
  121. package/src/models/identifier.js +34 -14
  122. package/src/models/push-token.js +8 -8
  123. package/src/models/request-result.js +3 -3
  124. package/src/models/server-config.js +32 -23
  125. package/src/request-controller.js +187 -180
  126. package/src/triggers/models/custom-event-data.js +7 -7
  127. package/src/triggers/models/custom-event-property-data.js +10 -10
  128. package/src/triggers/models/filter-set.js +13 -13
  129. package/src/triggers/models/filter.js +45 -45
  130. package/src/triggers/models/in-app-message-click-data.js +12 -12
  131. package/src/triggers/models/purchase-data.js +2 -2
  132. package/src/triggers/models/purchase-property-data.js +10 -10
  133. package/src/triggers/models/push-click-data.js +7 -7
  134. package/src/triggers/models/trigger-condition.js +57 -59
  135. package/src/triggers/models/trigger-events.js +4 -4
  136. package/src/triggers/models/trigger.js +38 -38
  137. package/src/triggers/triggers-provider-factory.js +4 -4
  138. package/src/triggers/triggers-provider.js +127 -130
  139. package/src/ui/js/attach-css.js +2 -2
  140. package/src/ui/js/iam-css.js +1 -1
  141. package/src/ui/js/load-font-awesome.js +1 -1
  142. package/src/util/base-device-parser.js +3 -3
  143. package/src/util/braze-actions.js +35 -35
  144. package/src/util/browser-detector.js +21 -21
  145. package/src/util/client-hints-parser.js +8 -8
  146. package/src/util/code-utils.js +2 -2
  147. package/src/util/component-utils.js +1 -1
  148. package/src/util/deprecation-utils.js +4 -4
  149. package/src/util/device-constants.js +1 -1
  150. package/src/util/dom-utils.js +18 -18
  151. package/src/util/key-codes.js +1 -1
  152. package/src/util/net.js +18 -18
  153. package/src/util/request-header-utils.js +39 -37
  154. package/src/util/string-utils.js +10 -10
  155. package/src/util/user-agent-parser.js +18 -18
  156. package/src/util/validation-utils.js +37 -39
  157. package/src/util/window-utils.js +3 -3
  158. package/shared-lib/braze-shared-lib.js +0 -8
@@ -3,68 +3,68 @@ import e from "../managers/braze-instance.js";
3
3
  import Feed from "./feed.js";
4
4
  import {
5
5
  newCardFromFeedJson as ht,
6
- newCardFromSerializedValue as R,
6
+ newCardFromSerializedValue as D,
7
7
  } from "../Card/util/card-factory.js";
8
8
  import { rehydrateDateAfterJsonization as w } from "../util/date-utils.js";
9
- import { STORAGE_KEYS as i } from "../managers/storage-manager.js";
10
- import E from "../managers/subscription-manager.js";
9
+ import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
10
+ import T from "../managers/subscription-manager.js";
11
11
  export default class ee extends y {
12
12
  constructor(t, s) {
13
13
  super(),
14
14
  (this.u = t),
15
- (this.ki = s),
15
+ (this.Ei = s),
16
16
  (this.cards = []),
17
- (this.Ai = null),
17
+ (this.Gi = null),
18
18
  (this.u = t),
19
- (this.ki = s),
20
- (this.Bt = new E()),
21
- e.Ht(this.Bt),
22
- this.Yt();
19
+ (this.Ei = s),
20
+ (this.Jt = new T()),
21
+ e.$t(this.Jt),
22
+ this.Kt();
23
23
  }
24
- Yt() {
24
+ Kt() {
25
25
  let t = [];
26
- this.u && (t = this.u.v(i.k.Bi) || []);
26
+ this.u && (t = this.u.j(o.C.Hi) || []);
27
27
  const s = [];
28
28
  for (let i = 0; i < t.length; i++) {
29
- const e = R(t[i]);
29
+ const e = D(t[i]);
30
30
  null != e && s.push(e);
31
31
  }
32
- (this.cards = s), this.u && (this.Ai = w(this.u.v(i.k.Ei)));
32
+ (this.cards = s), this.u && (this.Gi = w(this.u.j(o.C.Ji)));
33
33
  }
34
- Gi(t) {
34
+ Ki(t) {
35
35
  const s = [];
36
- let e = null,
37
- r = {};
38
- this.u && (r = this.u.v(i.k.L) || {});
39
- const h = {};
40
- for (let i = 0; i < t.length; i++) {
41
- e = t[i];
42
- const o = ht(e);
36
+ let i = null,
37
+ e = {};
38
+ this.u && (e = this.u.j(o.C.J) || {});
39
+ const r = {};
40
+ for (let h = 0; h < t.length; h++) {
41
+ i = t[h];
42
+ const o = ht(i);
43
43
  if (null != o) {
44
44
  const t = o.id;
45
- t && r[t] && ((o.viewed = !0), (h[t] = !0)), s.push(o);
45
+ t && e[t] && ((o.viewed = !0), (r[t] = !0)), s.push(o);
46
46
  }
47
47
  }
48
48
  (this.cards = s),
49
- this.Ds(),
50
- (this.Ai = new Date()),
51
- this.u && (this.u.D(i.k.L, h), this.u.D(i.k.Ei, this.Ai));
49
+ this.js(),
50
+ (this.Gi = new Date()),
51
+ this.u && (this.u.k(o.C.J, r), this.u.k(o.C.Ji, this.Gi));
52
52
  }
53
- Ds() {
54
- if (!this.u) return;
55
- const t = [];
56
- for (let s = 0; s < this.cards.length; s++) t.push(this.cards[s].tt());
57
- this.u.D(i.k.Bi, t);
53
+ js() {
54
+ var t;
55
+ const s = [];
56
+ for (let t = 0; t < this.cards.length; t++) s.push(this.cards[t].Y());
57
+ null === (t = this.u) || void 0 === t || t.k(o.C.Hi, s);
58
58
  }
59
- Ss(t) {
59
+ Rs(t) {
60
60
  null != t &&
61
61
  t.feed &&
62
- (this.Yt(),
63
- this.Gi(t.feed),
64
- this.Bt.Dt(new Feed(this.cards.slice(), this.Ai)));
62
+ (this.Kt(),
63
+ this.Ki(t.feed),
64
+ this.Jt.Dt(new Feed(this.cards.slice(), this.Gi)));
65
65
  }
66
- Hi() {
67
- this.Yt();
66
+ Li() {
67
+ this.Kt();
68
68
  const t = [],
69
69
  s = new Date();
70
70
  for (let i = 0; i < this.cards.length; i++) {
@@ -72,19 +72,19 @@ export default class ee extends y {
72
72
  let r = !0;
73
73
  null != e && (r = e >= s), r && t.push(this.cards[i]);
74
74
  }
75
- return new Feed(t, this.Ai);
75
+ return new Feed(t, this.Gi);
76
76
  }
77
- xs() {
78
- this.ki && this.ki.requestFeedRefresh();
77
+ Fs() {
78
+ this.Ei && this.Ei.requestFeedRefresh();
79
79
  }
80
- ri(t) {
81
- return this.Bt.It(t);
80
+ ei(t) {
81
+ return this.Jt.It(t);
82
82
  }
83
83
  clearData(t) {
84
84
  null == t && (t = !1),
85
85
  (this.cards = []),
86
- (this.Ai = null),
87
- t && this.u && (this.u.ni(i.k.Bi), this.u.ni(i.k.Ei)),
88
- this.Bt.Dt(new Feed(this.cards.slice(), this.Ai));
86
+ (this.Gi = null),
87
+ t && this.u && (this.u.hi(o.C.Hi), this.u.hi(o.C.Ji)),
88
+ this.Jt.Dt(new Feed(this.cards.slice(), this.Gi));
89
89
  }
90
90
  }
package/src/Feed/feed.js CHANGED
@@ -14,7 +14,7 @@ export default class Feed extends x {
14
14
  sr() {
15
15
  requestFeedRefresh();
16
16
  }
17
- ur() {
17
+ dr() {
18
18
  return !1;
19
19
  }
20
20
  }
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import re from "./feed-provider-factory.js";
3
3
  export function getCachedFeed() {
4
- if (e.rr()) return re.er().Hi();
4
+ if (e.X()) return re.rr().Li();
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import e from "../managers/braze-instance.js";
2
- import r from "../../shared-lib/braze-shared-lib.js";
2
+ import { InternalEventTypes as or } from "../../shared-lib/index.js";
3
3
  export function logFeedDisplayed() {
4
- if (!e.rr()) return;
5
- const i = e.ar();
6
- return i ? i.qr(r.Cr.Br).O : void 0;
4
+ var r;
5
+ if (e.X())
6
+ return null === (r = e.nr()) || void 0 === r ? void 0 : r.qr(or.Br).L;
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import re from "./feed-provider-factory.js";
3
3
  export function requestFeedRefresh() {
4
- if (e.rr()) return re.er().xs();
4
+ if (e.X()) return re.rr().Fs();
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import re from "./feed-provider-factory.js";
3
3
  export function subscribeToFeedUpdates(r) {
4
- if (e.rr()) return re.er().ri(r);
4
+ if (e.X()) return re.rr().ei(r);
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import e from "../../managers/braze-instance.js";
2
2
  import { destroyFeedHtml as z } from "../../common/feed-display.js";
3
3
  export function destroyFeed() {
4
- if (!e.rr()) return;
4
+ if (!e.X()) return;
5
5
  const o = document.querySelectorAll(".ab-feed");
6
6
  for (let e = 0; e < o.length; e++) z(o[e]);
7
7
  }
@@ -5,49 +5,49 @@ import {
5
5
  feedToHtml as I,
6
6
  LAST_REQUESTED_REFRESH_DATA_ATTRIBUTE as M,
7
7
  refreshFeed as $,
8
- registerFeedSubscriptionId as k,
9
- updateFeedCards as A,
8
+ registerFeedSubscriptionId as B,
9
+ updateFeedCards as F,
10
10
  } from "../../common/feed-display.js";
11
11
  import { Feed, logFeedDisplayed, subscribeToFeedUpdates } from "../index.js";
12
12
  import re from "../feed-provider-factory.js";
13
13
  import { intersection as te } from "../../util/code-utils.js";
14
- import { setCardHeight as B } from "../../Card/display/card-display.js";
15
- import { setupFeedUI as F } from "../../ui/js/index.js";
16
- import r from "../../../shared-lib/braze-shared-lib.js";
14
+ import { setCardHeight as G } from "../../Card/display/card-display.js";
15
+ import { setupFeedUI as H } from "../../ui/js/index.js";
16
+ import { logger as r } from "../../../shared-lib/index.js";
17
17
  export function showFeed(t, n, o) {
18
- if (!e.rr()) return;
19
- F();
20
- const s = (e, t) => {
18
+ if (!e.X()) return;
19
+ H();
20
+ const i = (e, t) => {
21
21
  if (null == t) return e;
22
22
  const n = [];
23
23
  for (let e = 0; e < t.length; e++) n.push(t[e].toLowerCase());
24
24
  const o = [];
25
25
  for (let t = 0; t < e.length; t++) {
26
26
  const r = [],
27
- s = e[t].categories || [];
28
- for (let e = 0; e < s.length; e++) r.push(s[e].toLowerCase());
27
+ i = e[t].categories || [];
28
+ for (let e = 0; e < i.length; e++) r.push(i[e].toLowerCase());
29
29
  te(r, n).length > 0 && o.push(e[t]);
30
30
  }
31
31
  return o;
32
32
  },
33
- i = e.nn(L.tn) || e.nn(L.en) || !1;
33
+ s = e.nn(L.tn) || e.nn(L.en) || !1;
34
34
  let l = !1;
35
35
  null == t && ((t = document.body), (l = !0));
36
- let a,
37
- f = !1;
36
+ let f,
37
+ a = !1;
38
38
  null == n
39
- ? ((a = re.er().Hi()),
40
- A(a, s(a.cards, o), a.lastUpdated, null, i),
41
- (f = !0))
42
- : (a = new Feed(s(n, o), new Date()));
43
- const u = I(a, i, l);
44
- if (f) {
45
- (null == a.lastUpdated ||
46
- new Date().valueOf() - a.lastUpdated.valueOf() > Feed.mr) &&
47
- (r.j.info(
48
- `Cached feed was older than max TTL of ${Feed.mr} ms, requesting an update from the server.`,
39
+ ? ((f = re.rr().Li()),
40
+ F(f, i(f.cards, o), f.lastUpdated, null, s),
41
+ (a = !0))
42
+ : (f = new Feed(i(n, o), new Date()));
43
+ const u = I(f, s, l);
44
+ if (a) {
45
+ (null == f.lastUpdated ||
46
+ new Date().valueOf() - f.lastUpdated.valueOf() > Feed.ur) &&
47
+ (r.info(
48
+ `Cached feed was older than max TTL of ${Feed.ur} ms, requesting an update from the server.`,
49
49
  ),
50
- $(a, u));
50
+ $(f, u));
51
51
  const e = new Date().valueOf(),
52
52
  t = subscribeToFeedUpdates(function (t) {
53
53
  const n = u.querySelectorAll(".ab-refresh-button")[0];
@@ -66,9 +66,9 @@ export function showFeed(t, n, o) {
66
66
  Math.max(t, 0),
67
67
  );
68
68
  }
69
- A(a, s(t.cards, o), t.lastUpdated, u, i);
69
+ F(f, i(t.cards, o), t.lastUpdated, u, s);
70
70
  });
71
- k(t, u);
71
+ B(t, u);
72
72
  }
73
73
  const d = (e) => {
74
74
  const t = e.querySelectorAll(".ab-feed");
@@ -82,8 +82,8 @@ export function showFeed(t, n, o) {
82
82
  }, 0),
83
83
  l && u.focus(),
84
84
  logFeedDisplayed(),
85
- q(a, u),
86
- a && B(a.cards, e);
85
+ q(f, u),
86
+ f && G(f.cards, e);
87
87
  };
88
88
  var m;
89
89
  null != t
@@ -1,7 +1,7 @@
1
1
  import e from "../../managers/braze-instance.js";
2
2
  import { destroyFeed, showFeed } from "../index.js";
3
3
  export function toggleFeed(o, n, r) {
4
- e.rr() &&
4
+ e.X() &&
5
5
  (document.querySelectorAll(".ab-feed").length > 0
6
6
  ? destroyFeed()
7
7
  : showFeed(o, n, r));
@@ -1,13 +1,13 @@
1
1
  import InAppMessage from "./models/in-app-message.js";
2
2
  import e from "../managers/braze-instance.js";
3
3
  import ControlMessage from "./models/control-message.js";
4
- import r from "../../shared-lib/braze-shared-lib.js";
4
+ import { logger as r } from "../../shared-lib/index.js";
5
5
  import se from "./in-app-message-manager-factory.js";
6
6
  export function deferInAppMessage(s) {
7
- if (e.rr())
7
+ if (e.X())
8
8
  return s instanceof ControlMessage
9
- ? (r.j.info("Not deferring since this is a ControlMessage."), !1)
9
+ ? (r.info("Not deferring since this is a ControlMessage."), !1)
10
10
  : s instanceof InAppMessage
11
- ? se.m().he(s)
12
- : (r.j.info("Not an instance of InAppMessage, ignoring."), !1);
11
+ ? se.m().de(s)
12
+ : (r.info("Not an instance of InAppMessage, ignoring."), !1);
13
13
  }
@@ -1,47 +1,47 @@
1
- import Q from "../../util/browser-detector.js";
1
+ import X from "../../util/browser-detector.js";
2
2
  import { logInAppMessageHtmlClick } from "../log-in-app-message-html-click.js";
3
- import { getUser as Z } from "../../Core/get-user.js";
3
+ import { getUser as ro } from "../../Core/get-user.js";
4
4
  import { InAppMessage } from "../index.js";
5
- import { keys as oo } from "../../util/code-utils.js";
6
- import { OperatingSystems as V } from "../../util/device-constants.js";
5
+ import { keys as to } from "../../util/code-utils.js";
6
+ import { OperatingSystems as Y } from "../../util/device-constants.js";
7
7
  import { parseQueryStringKeyValues as ut } from "../../util/url-utils.js";
8
- import { WindowUtils as Y } from "../../util/window-utils.js";
8
+ import { WindowUtils as eo } from "../../util/window-utils.js";
9
9
  import e from "../../managers/braze-instance.js";
10
- import r from "../../../shared-lib/braze-shared-lib.js";
11
- import { BRAZE_MUST_BE_INITIALIZED_ERROR as P } from "../../common/constants.js";
10
+ import { logger as r } from "../../../shared-lib/index.js";
11
+ import { BRAZE_MUST_BE_INITIALIZED_ERROR as _ } from "../../common/constants.js";
12
12
  export default function ct(t, o, n, s, i, u) {
13
13
  const c = document.createElement("iframe");
14
14
  c.setAttribute("title", "Modal Message"),
15
15
  i && (c.style.zIndex = (i + 1).toString());
16
16
  const a = (e) => {
17
17
  const o = e.getAttribute("href"),
18
- r = e.onclick;
19
- return (n) => {
20
- if (null != r && "function" == typeof r && !1 === r.bind(e)(n)) return;
18
+ n = e.onclick;
19
+ return (r) => {
20
+ if (null != n && "function" == typeof n && !1 === n.bind(e)(r)) return;
21
21
  let i = ut(o).abButtonId;
22
22
  if (
23
23
  ((null != i && "" !== i) || (i = e.getAttribute("id") || void 0),
24
24
  null != o && "" !== o && 0 !== o.indexOf("#"))
25
25
  ) {
26
- const r =
26
+ const n =
27
27
  "blank" ===
28
28
  (e.getAttribute("target") || "").toLowerCase().replace("_", ""),
29
- u = s || t.openTarget === InAppMessage.OpenTarget.BLANK || r,
29
+ u = s || t.openTarget === InAppMessage.OpenTarget.BLANK || n,
30
30
  a = () => {
31
- logInAppMessageHtmlClick(t, i, o), Y.openUri(o, u, n);
31
+ logInAppMessageHtmlClick(t, i, o), eo.openUri(o, u, r);
32
32
  };
33
- u ? a() : t.ye(c, a);
33
+ u ? a() : t.he(c, a);
34
34
  } else logInAppMessageHtmlClick(t, i, o || void 0);
35
- return n.stopPropagation(), !1;
35
+ return r.stopPropagation(), !1;
36
36
  };
37
37
  },
38
38
  m = (t, e, o) => {
39
- const r = `([\\w]+)\\s*=\\s*document.createElement\\(['"]${o}['"]\\)`,
40
- n = t.match(new RegExp(r));
41
- if (n) {
42
- const o = `${n[1]}.setAttribute("nonce", "${e}")`;
43
- return `${t.slice(0, n.index + n[0].length)};${o};${t.slice(
44
- n.index + n[0].length,
39
+ const n = `([\\w]+)\\s*=\\s*document.createElement\\(['"]${o}['"]\\)`,
40
+ r = t.match(new RegExp(n));
41
+ if (r) {
42
+ const o = `${r[1]}.setAttribute("nonce", "${e}")`;
43
+ return `${t.slice(0, r.index + r[0].length)};${o};${t.slice(
44
+ r.index + r[0].length,
45
45
  )}`;
46
46
  }
47
47
  return null;
@@ -62,18 +62,18 @@ export default function ct(t, o, n, s, i, u) {
62
62
  ));
63
63
  const e = m(o[t].innerHTML, u, "script");
64
64
  e && (o[t].innerHTML = e);
65
- const r = m(o[t].innerHTML, u, "style");
66
- r && (o[t].innerHTML = r);
65
+ const n = m(o[t].innerHTML, u, "style");
66
+ n && (o[t].innerHTML = n);
67
67
  }
68
68
  }
69
69
  const i = c.contentWindow;
70
70
  i.focus(), i.document.write(s ? s.innerHTML : t.message || "");
71
71
  const l = i.document.getElementsByTagName("head")[0];
72
72
  if (null != l) {
73
- if (t.Ae()) {
73
+ if (t.be()) {
74
74
  const e = document.createElement("style");
75
75
  (e.innerHTML = t.css || ""),
76
- (e.id = t.Ce() || ""),
76
+ (e.id = t.ye() || ""),
77
77
  null != u && e.setAttribute("nonce", u),
78
78
  l.appendChild(e);
79
79
  }
@@ -84,7 +84,7 @@ export default function ct(t, o, n, s, i, u) {
84
84
  f && f.length > 0 && c.setAttribute("title", f[0].textContent || "");
85
85
  const d = {
86
86
  closeMessage: function () {
87
- t.ye(c);
87
+ t.he(c);
88
88
  },
89
89
  logClick: function () {
90
90
  logInAppMessageHtmlClick(t, ...arguments);
@@ -96,9 +96,9 @@ export default function ct(t, o, n, s, i, u) {
96
96
  return function () {
97
97
  const t = arguments;
98
98
  import("../../Push/request-push-permission.js").then((o) => {
99
- e.fe()
99
+ e.so()
100
100
  ? o.requestPushPermission(...Array.prototype.slice.call(t))
101
- : r.j.error(P);
101
+ : r.error(_);
102
102
  });
103
103
  };
104
104
  },
@@ -107,9 +107,9 @@ export default function ct(t, o, n, s, i, u) {
107
107
  const t = arguments;
108
108
  import("../../Core/request-immediate-data-flush.js").then(
109
109
  ({ requestImmediateDataFlush: requestImmediateDataFlush }) => {
110
- e.fe()
110
+ e.so()
111
111
  ? requestImmediateDataFlush(...Array.prototype.slice.call(t))
112
- : r.j.error(P);
112
+ : r.error(_);
113
113
  },
114
114
  );
115
115
  },
@@ -117,7 +117,7 @@ export default function ct(t, o, n, s, i, u) {
117
117
  const t = arguments;
118
118
  import("../../Core/log-custom-event.js").then(
119
119
  ({ logCustomEvent: logCustomEvent }) => {
120
- if (!e.fe()) return void r.j.error(P);
120
+ if (!e.so()) return void r.error(_);
121
121
  logCustomEvent(...Array.prototype.slice.call(t));
122
122
  },
123
123
  );
@@ -126,7 +126,7 @@ export default function ct(t, o, n, s, i, u) {
126
126
  const t = arguments;
127
127
  import("../../Core/log-purchase.js").then(
128
128
  ({ logPurchase: logPurchase }) => {
129
- if (!e.fe()) return void r.j.error(P);
129
+ if (!e.so()) return void r.error(_);
130
130
  logPurchase(...Array.prototype.slice.call(t));
131
131
  },
132
132
  );
@@ -135,9 +135,9 @@ export default function ct(t, o, n, s, i, u) {
135
135
  const t = arguments;
136
136
  import("../../Push/unregister-push.js").then(
137
137
  ({ unregisterPush: unregisterPush }) => {
138
- e.fe()
138
+ e.so()
139
139
  ? unregisterPush(...Array.prototype.slice.call(t))
140
- : r.j.error(P);
140
+ : r.error(_);
141
141
  },
142
142
  );
143
143
  },
@@ -146,19 +146,19 @@ export default function ct(t, o, n, s, i, u) {
146
146
  const t = arguments;
147
147
  import("../../Core/change-user.js").then(
148
148
  ({ changeUser: changeUser }) => {
149
- if (!e.fe()) return void r.j.error(P);
149
+ if (!e.so()) return void r.error(_);
150
150
  changeUser(...Array.prototype.slice.call(t));
151
151
  },
152
152
  );
153
153
  },
154
154
  },
155
- h = function (t) {
155
+ g = function (t) {
156
156
  return function () {
157
157
  p[t](...Array.prototype.slice.call(arguments));
158
158
  };
159
159
  };
160
- for (const t of oo(p)) d[t] = h(t);
161
- const b = [
160
+ for (const t of to(p)) d[t] = g(t);
161
+ const h = [
162
162
  "setFirstName",
163
163
  "setLastName",
164
164
  "setEmail",
@@ -179,14 +179,14 @@ export default function ct(t, o, n, s, i, u) {
179
179
  "addToSubscriptionGroup",
180
180
  "removeFromSubscriptionGroup",
181
181
  ],
182
- g = function (t) {
182
+ b = function (t) {
183
183
  return function () {
184
- const e = Z();
184
+ const e = ro();
185
185
  e && e[t](...Array.prototype.slice.call(arguments));
186
186
  };
187
187
  },
188
188
  y = {};
189
- for (let t = 0; t < b.length; t++) y[b[t]] = g(b[t]);
189
+ for (let t = 0; t < h.length; t++) y[h[t]] = b(h[t]);
190
190
  d.getUser = function () {
191
191
  return y;
192
192
  };
@@ -194,36 +194,36 @@ export default function ct(t, o, n, s, i, u) {
194
194
  j = function (e) {
195
195
  return function () {
196
196
  const o = arguments;
197
- t.ye(c, function () {
197
+ t.he(c, function () {
198
198
  A[e](...Array.prototype.slice.call(o));
199
199
  });
200
200
  };
201
201
  },
202
202
  C = d.display;
203
- for (const t of oo(A)) C[t] = j(t);
203
+ for (const t of to(A)) C[t] = j(t);
204
204
  const v = { registerAppboyPushMessages: requestPushPermission() },
205
- w = function (t) {
205
+ P = function (t) {
206
206
  return function () {
207
207
  v[t](...Array.prototype.slice.call(arguments));
208
208
  };
209
209
  },
210
- E = d.web;
211
- for (const t of oo(v)) E[t] = w(t);
210
+ w = d.web;
211
+ for (const t of to(v)) w[t] = P(t);
212
212
  if (
213
- ((i.appboyBridge = d), (i.brazeBridge = d), t.Pe !== InAppMessage.qe.Ee)
213
+ ((i.appboyBridge = d), (i.brazeBridge = d), t.Ae !== InAppMessage.Ce.je)
214
214
  ) {
215
215
  const t = i.document.getElementsByTagName("a");
216
216
  for (let e = 0; e < t.length; e++) t[e].onclick = a(t[e]);
217
217
  const e = i.document.getElementsByTagName("button");
218
218
  for (let t = 0; t < e.length; t++) e[t].onclick = a(e[t]);
219
219
  }
220
- const $ = i.document.body;
221
- if (null != $) {
222
- t.Ne() && ($.id = t.htmlId || "");
220
+ const E = i.document.body;
221
+ if (null != E) {
222
+ t.ve() && (E.id = t.htmlId || "");
223
223
  const e = document.createElement("hidden");
224
224
  (e.onclick = d.closeMessage),
225
225
  (e.className = "ab-programmatic-close-button"),
226
- $.appendChild(e);
226
+ E.appendChild(e);
227
227
  }
228
228
  i.dispatchEvent(new CustomEvent("ab.BridgeReady")),
229
229
  -1 !== c.className.indexOf("ab-start-hidden") &&
@@ -232,12 +232,12 @@ export default function ct(t, o, n, s, i, u) {
232
232
  }),
233
233
  (c.className =
234
234
  "ab-in-app-message ab-start-hidden ab-html-message ab-modal-interactions"),
235
- Q.OS === V.de)
235
+ X.OS === Y.io)
236
236
  ) {
237
237
  const e = document.createElement("div");
238
238
  return (
239
- (e.className = "ab-ios-scroll-wrapper"), e.appendChild(c), (t.Me = e), e
239
+ (e.className = "ab-ios-scroll-wrapper"), e.appendChild(c), (t.Pe = e), e
240
240
  );
241
241
  }
242
- return (t.Me = c), c;
242
+ return (t.Pe = c), c;
243
243
  }