@braze/web-sdk 6.8.0 → 6.10.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 (141) hide show
  1. package/index.d.ts +113 -21
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +20 -20
  4. package/shared-lib/indexed-db-adapter.js +64 -64
  5. package/shared-lib/logger.js +18 -18
  6. package/shared-lib/supported-options.js +8 -8
  7. package/src/Banner/banner-provider.js +67 -59
  8. package/src/Banner/banner.js +40 -19
  9. package/src/Banner/dismiss-banner.js +4 -0
  10. package/src/Banner/display/banner-to-html.js +10 -10
  11. package/src/Banner/display/destroy-banner-html.js +2 -2
  12. package/src/Banner/get-all-banners.js +6 -6
  13. package/src/Banner/get-banner.js +6 -6
  14. package/src/Banner/index.js +1 -0
  15. package/src/Banner/log-banner-click.js +7 -7
  16. package/src/Banner/log-banner-dismissal.js +7 -7
  17. package/src/Banner/log-banner-impressions.js +10 -10
  18. package/src/Banner/request-banners-refresh.js +8 -8
  19. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  20. package/src/Banner/ui/insert-banner.js +8 -8
  21. package/src/Card/card-manager.js +31 -31
  22. package/src/Card/log-card-dismissal.js +2 -2
  23. package/src/Card/log-content-card-click.js +2 -2
  24. package/src/Card/log-content-card-impressions.js +4 -4
  25. package/src/Card/models/captioned-image.js +15 -15
  26. package/src/Card/models/card.js +89 -89
  27. package/src/Card/models/classic-card.js +16 -16
  28. package/src/Card/models/control-card.js +7 -7
  29. package/src/Card/models/image-only.js +13 -13
  30. package/src/Card/util/card-factory.js +32 -32
  31. package/src/ContentCards/content-cards-provider.js +102 -102
  32. package/src/ContentCards/get-cached-content-cards.js +1 -1
  33. package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
  34. package/src/ContentCards/ui/show-content-cards.js +5 -5
  35. package/src/Core/add-sdk-metadata.js +2 -2
  36. package/src/Core/change-user.js +3 -3
  37. package/src/Core/destroy.js +2 -2
  38. package/src/Core/disable-sdk.js +4 -4
  39. package/src/Core/enable-sdk.js +4 -4
  40. package/src/Core/get-device-id.js +2 -2
  41. package/src/Core/handle-braze-action.js +5 -5
  42. package/src/Core/index.js +1 -0
  43. package/src/Core/log-custom-event.js +5 -5
  44. package/src/Core/log-ecommerce-event.js +5 -5
  45. package/src/Core/log-purchase.js +9 -9
  46. package/src/Core/logout.js +22 -0
  47. package/src/Core/open-session.js +7 -7
  48. package/src/Core/set-logger.js +2 -2
  49. package/src/Core/toggle-logging.js +2 -2
  50. package/src/Core/wipe-data.js +6 -6
  51. package/src/DUST/dust-provider.js +249 -240
  52. package/src/DUST/dust-shared-worker-code.js +1 -1
  53. package/src/DUST/dust-shared-worker-impl.js +15 -14
  54. package/src/DUST/dust-worker-bridge.js +50 -35
  55. package/src/DUST/subscribe-to-dust.js +7 -7
  56. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  57. package/src/FeatureFlags/feature-flag.js +3 -3
  58. package/src/FeatureFlags/feature-flags-provider.js +21 -21
  59. package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
  60. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
  61. package/src/InAppMessage/constants.js +3 -3
  62. package/src/InAppMessage/defer-in-app-message.js +4 -4
  63. package/src/InAppMessage/display/html-message-to-html.js +4 -4
  64. package/src/InAppMessage/display/in-app-message-to-html.js +16 -16
  65. package/src/InAppMessage/in-app-message-factory.js +36 -36
  66. package/src/InAppMessage/in-app-message-manager.js +78 -78
  67. package/src/InAppMessage/log-in-app-message-button-click.js +4 -4
  68. package/src/InAppMessage/log-in-app-message-click.js +3 -3
  69. package/src/InAppMessage/log-in-app-message-html-click.js +5 -5
  70. package/src/InAppMessage/log-in-app-message-impression.js +4 -4
  71. package/src/InAppMessage/models/control-message.js +4 -4
  72. package/src/InAppMessage/models/full-screen-message.js +4 -4
  73. package/src/InAppMessage/models/html-message.js +3 -3
  74. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  75. package/src/InAppMessage/models/in-app-message.js +12 -12
  76. package/src/InAppMessage/models/modal-message.js +4 -4
  77. package/src/InAppMessage/models/slide-up-message.js +4 -4
  78. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  79. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  80. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  81. package/src/InAppMessage/ui/show-in-app-message.js +14 -14
  82. package/src/Push/push-manager-factory.js +2 -2
  83. package/src/Push/push-manager.js +38 -38
  84. package/src/Push/unregister-push-token-on-server.js +35 -0
  85. package/src/Push/unregister-push.js +2 -1
  86. package/src/Push/utils/push-utils.js +6 -6
  87. package/src/User/user-manager.js +14 -14
  88. package/src/User/user.js +25 -25
  89. package/src/common/base-provider.js +1 -1
  90. package/src/common/content-cards-display.js +7 -7
  91. package/src/common/event-logger.js +3 -3
  92. package/src/common/properties-base.js +3 -3
  93. package/src/l10n/l10n-manager-factory.js +2 -2
  94. package/src/l10n/l10n-manager.js +4 -4
  95. package/src/managers/auth-manager.js +11 -11
  96. package/src/managers/braze-instance.js +56 -56
  97. package/src/managers/device-manager.js +10 -10
  98. package/src/managers/network-manager.js +103 -102
  99. package/src/managers/server-config-manager.js +112 -95
  100. package/src/managers/session-manager.js +20 -20
  101. package/src/managers/storage-manager-factory.js +9 -9
  102. package/src/managers/storage-manager.js +73 -73
  103. package/src/managers/subscription-manager.js +2 -2
  104. package/src/managers/utils.js +1 -1
  105. package/src/models/backend-errors.js +5 -5
  106. package/src/models/braze-event.js +1 -1
  107. package/src/models/device.js +1 -1
  108. package/src/models/identifier.js +2 -2
  109. package/src/models/push-token.js +6 -6
  110. package/src/models/request-result.js +1 -1
  111. package/src/models/server-config.js +42 -24
  112. package/src/request-controller.js +126 -126
  113. package/src/triggers/models/custom-event-data.js +4 -4
  114. package/src/triggers/models/custom-event-property-data.js +5 -5
  115. package/src/triggers/models/filter-set.js +2 -2
  116. package/src/triggers/models/filter.js +1 -1
  117. package/src/triggers/models/in-app-message-click-data.js +1 -1
  118. package/src/triggers/models/purchase-data.js +1 -1
  119. package/src/triggers/models/purchase-property-data.js +2 -2
  120. package/src/triggers/models/push-click-data.js +3 -3
  121. package/src/triggers/models/trigger-condition.js +36 -36
  122. package/src/triggers/models/trigger-events.js +1 -1
  123. package/src/triggers/models/trigger.js +33 -33
  124. package/src/triggers/triggers-provider-factory.js +1 -1
  125. package/src/triggers/triggers-provider.js +68 -68
  126. package/src/types.js +2 -2
  127. package/src/ui/js/attach-css.js +1 -1
  128. package/src/util/braze-actions.js +7 -7
  129. package/src/util/browser-detector.js +2 -2
  130. package/src/util/client-hints-parser.js +4 -4
  131. package/src/util/code-utils.js +2 -2
  132. package/src/util/deprecation-utils.js +2 -2
  133. package/src/util/dom-utils.js +7 -7
  134. package/src/util/ecommerce-event-validation.js +52 -35
  135. package/src/util/html-display-utils.js +11 -11
  136. package/src/util/net.js +4 -4
  137. package/src/util/request-header-utils.js +36 -35
  138. package/src/util/string-utils.js +2 -2
  139. package/src/util/user-agent-parser.js +2 -2
  140. package/src/util/validation-utils.js +12 -12
  141. package/src/util/window-utils.js +2 -2
@@ -14,7 +14,7 @@ import { logInAppMessageClick } from "../log-in-app-message-click.js";
14
14
  import { _handleBrazeAction as Q } from "../../Core/handle-braze-action.js";
15
15
  import ft from "./html-message-to-html.js";
16
16
  import xe from "./modal-utils.js";
17
- import { logger as E, Guid as V } from "../../../shared-lib/index.js";
17
+ import { logger as b, Guid as V } from "../../../shared-lib/index.js";
18
18
  import { KeyCodes as Ce } from "../../util/key-codes.js";
19
19
  import {
20
20
  IamClickAction as Le,
@@ -61,7 +61,7 @@ export default function Ge(e, o, t, a, n, i, s = document.body, m = "ltr") {
61
61
  m && (clearTimeout(m), (m = null)),
62
62
  o
63
63
  ? c()
64
- : E.error(
64
+ : b.error(
65
65
  `Cannot show in-app message ${e.message} because the image failed to load.`,
66
66
  ));
67
67
  };
@@ -98,18 +98,18 @@ export default function Ge(e, o, t, a, n, i, s = document.body, m = "ltr") {
98
98
  (u.className = "ab-message-text"),
99
99
  (u.dir = s),
100
100
  u.setAttribute("role", "article");
101
- const b = (e.messageAlignment || e.Go).toLowerCase();
102
- u.className += " " + b + "-aligned";
103
- let f = !1;
104
- const p = document.createElement("div");
105
- if (((p.className = "ab-image-area"), e.imageUrl)) {
101
+ const f = (e.messageAlignment || e.Go).toLowerCase();
102
+ u.className += " " + f + "-aligned";
103
+ let p = !1;
104
+ const g = document.createElement("div");
105
+ if (((g.className = "ab-image-area"), e.imageUrl)) {
106
106
  const o = document.createElement("img");
107
107
  if (
108
108
  (o.setAttribute("src", e.imageUrl),
109
109
  e.Ho(o),
110
110
  0 === document.querySelectorAll(".ab-iam-img-loading").length)
111
111
  ) {
112
- f = !0;
112
+ p = !0;
113
113
  const e = document.querySelectorAll(".ab-iam-root");
114
114
  e && e.length > 0 && e[0].classList.add("ab-iam-img-loading"),
115
115
  (m = window.setTimeout(() => {
@@ -126,11 +126,11 @@ export default function Ge(e, o, t, a, n, i, s = document.body, m = "ltr") {
126
126
  const e = document.createElement("div");
127
127
  (e.className = "ab-center-cropped-img"),
128
128
  e.appendChild(o),
129
- p.appendChild(e);
130
- } else p.appendChild(o);
131
- l.appendChild(p), (u.className += " ab-with-image");
129
+ g.appendChild(e);
130
+ } else g.appendChild(o);
131
+ l.appendChild(g), (u.className += " ab-with-image");
132
132
  } else if (e.icon) {
133
- p.className += " ab-icon-area";
133
+ g.className += " ab-icon-area";
134
134
  const o = document.createElement("span");
135
135
  (o.className = "ab-icon"),
136
136
  e.Mo() ||
@@ -141,8 +141,8 @@ export default function Ge(e, o, t, a, n, i, s = document.body, m = "ltr") {
141
141
  t.appendChild(document.createTextNode(e.icon)),
142
142
  t.setAttribute("aria-hidden", "true"),
143
143
  o.appendChild(t),
144
- p.appendChild(o),
145
- l.appendChild(p),
144
+ g.appendChild(o),
145
+ l.appendChild(g),
146
146
  (u.className += " ab-with-icon");
147
147
  }
148
148
  if ((F(u, "touchstart"), e.header && e.header.length > 0)) {
@@ -154,8 +154,8 @@ export default function Ge(e, o, t, a, n, i, s = document.body, m = "ltr") {
154
154
  o.appendChild(document.createTextNode(e.header)),
155
155
  u.appendChild(o);
156
156
  }
157
- const g = e.Ko();
158
- return u.appendChild(g), l.appendChild(u), f || c(), (e.Eo = l), l;
157
+ const h = e.Ko();
158
+ return u.appendChild(h), l.appendChild(u), p || c(), (e.Eo = 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";
@@ -4,7 +4,7 @@ import HtmlMessage from "./models/html-message.js";
4
4
  import InAppMessageButton from "./models/in-app-message-button.js";
5
5
  import ModalMessage from "./models/modal-message.js";
6
6
  import SlideUpMessage from "./models/slide-up-message.js";
7
- import { logger as E } from "../../shared-lib/index.js";
7
+ import { logger as b } from "../../shared-lib/index.js";
8
8
  import { IamServerTypes as dt } from "./constants.js";
9
9
  export function newInAppMessageFromJson(e) {
10
10
  if (!e) return null;
@@ -27,27 +27,27 @@ export function newInAppMessageFromJson(e) {
27
27
  g = e.icon_color,
28
28
  j = e.icon_bg_color,
29
29
  w = e.bg_color,
30
- b = e.text_color,
31
- h = e.close_btn_color,
32
- v = e.header,
33
- x = e.text_align_header,
34
- I = e.header_text_color,
35
- A = e.frame_color,
36
- F = [];
37
- let M = e.btns;
38
- null == M && (M = []);
39
- for (let e = 0; e < M.length; e++) F.push(InAppMessageButton.fromJson(M[e]));
40
- const k = e.crop_type,
41
- y = e.orientation,
42
- z = e.animate_in,
43
- J = e.animate_out;
44
- let S = e.html_id,
45
- q = e.css;
46
- (null != S && "" !== S && null != q && "" !== q) ||
47
- ((S = void 0), (q = void 0));
48
- const B = e.message_extras,
49
- C = e.language,
50
- D = e.image_alt;
30
+ h = e.text_color,
31
+ v = e.close_btn_color,
32
+ x = e.header,
33
+ I = e.text_align_header,
34
+ A = e.header_text_color,
35
+ F = e.frame_color,
36
+ M = [];
37
+ let k = e.btns;
38
+ null == k && (k = []);
39
+ for (let e = 0; e < k.length; e++) M.push(InAppMessageButton.fromJson(k[e]));
40
+ const y = e.crop_type,
41
+ z = e.orientation,
42
+ J = e.animate_in,
43
+ S = e.animate_out;
44
+ let q = e.html_id,
45
+ B = e.css;
46
+ (null != q && "" !== q && null != B && "" !== B) ||
47
+ ((q = void 0), (B = void 0));
48
+ const C = e.message_extras,
49
+ D = e.language,
50
+ E = e.image_alt;
51
51
  let G;
52
52
  if (o === dt.aE || o === dt.UE)
53
53
  G = new ModalMessage(
@@ -66,21 +66,21 @@ export function newInAppMessageFromJson(e) {
66
66
  g,
67
67
  j,
68
68
  w,
69
- b,
70
69
  h,
71
- z,
72
- J,
73
70
  v,
71
+ J,
72
+ S,
74
73
  x,
75
74
  I,
76
75
  A,
77
76
  F,
78
- k,
79
- S,
77
+ M,
78
+ y,
80
79
  q,
81
80
  B,
82
81
  C,
83
82
  D,
83
+ E,
84
84
  );
85
85
  else if (o === dt.cE)
86
86
  G = new FullScreenMessage(
@@ -99,22 +99,22 @@ export function newInAppMessageFromJson(e) {
99
99
  g,
100
100
  j,
101
101
  w,
102
- b,
103
102
  h,
104
- z,
105
- J,
106
103
  v,
104
+ J,
105
+ S,
107
106
  x,
108
107
  I,
109
108
  A,
110
109
  F,
111
- k,
110
+ M,
112
111
  y,
113
- S,
112
+ z,
114
113
  q,
115
114
  B,
116
115
  C,
117
116
  D,
117
+ E,
118
118
  );
119
119
  else if (o === dt.sE)
120
120
  G = new SlideUpMessage(
@@ -133,22 +133,22 @@ export function newInAppMessageFromJson(e) {
133
133
  g,
134
134
  j,
135
135
  w,
136
- b,
137
136
  h,
138
- z,
137
+ v,
139
138
  J,
140
139
  S,
141
140
  q,
142
141
  B,
143
142
  C,
144
143
  D,
144
+ E,
145
145
  );
146
146
  else {
147
147
  if (o !== dt.iE && o !== dt.PE && o !== dt.nE)
148
- return void E.error("Ignoring message with unknown type " + o);
148
+ return void b.error("Ignoring message with unknown type " + o);
149
149
  {
150
150
  const o = e.message_fields;
151
- (G = new HtmlMessage(s, r, m, p, u, z, J, A, S, q, o, B)),
151
+ (G = new HtmlMessage(s, r, m, p, u, J, S, F, q, B, o, C)),
152
152
  (G.trusted = e.trusted || !1);
153
153
  }
154
154
  }
@@ -8,7 +8,7 @@ import v from "../common/event-logger.js";
8
8
  import { newInAppMessageFromJson as pt } from "./in-app-message-factory.js";
9
9
  import { randomInclusive as a } from "../util/math.js";
10
10
  import L from "../models/request-result.js";
11
- import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
11
+ import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
12
12
  import f from "../managers/subscription-manager.js";
13
13
  import gt from "../triggers/models/trigger.js";
14
14
  import { BRAZE_ACTION_URI_REGEX as to } from "../util/validation-utils.js";
@@ -27,48 +27,48 @@ import { IamClickAction as Le, IamServerTypes as dt } from "./constants.js";
27
27
  export default class ea {
28
28
  constructor(t, e, s, i) {
29
29
  (this.B = t),
30
- (this.j = e),
31
- (this.C = s),
30
+ (this.C = e),
31
+ (this.j = s),
32
32
  (this.Ss = i),
33
33
  (this.B = t),
34
- (this.j = e),
35
- (this.C = s),
34
+ (this.C = e),
35
+ (this.j = s),
36
36
  (this.Ss = i),
37
37
  (this.In = new f()),
38
38
  r.S(this.In),
39
- (this.Bn = 1e3),
40
- (this._n = 6e4),
39
+ (this.An = 1e3),
40
+ (this.Dn = 6e4),
41
+ (this._n = null),
41
42
  (this.qn = null),
42
- (this.Pn = null),
43
- (this.En = null);
43
+ (this.xn = null);
44
44
  }
45
- Gn() {
45
+ Pn() {
46
46
  return this.In;
47
47
  }
48
- Nn(t) {
49
- return this.In.Kt(t);
48
+ En(t) {
49
+ return this.In.Ut(t);
50
50
  }
51
- Fn() {
52
- return this.qn;
51
+ Gn() {
52
+ return this._n;
53
53
  }
54
- On(t) {
55
- this.qn = t;
54
+ Nn(t) {
55
+ this._n = t;
56
56
  }
57
- wt(t, e, s, i) {
57
+ Dt(t, e, s, i) {
58
58
  const r = new L();
59
59
  let n;
60
- if (e === p.Xn || t instanceof ControlMessage) {
61
- if (!t.gs())
60
+ if (e === p.Fn || t instanceof ControlMessage) {
61
+ if (!t.js())
62
62
  return (
63
- E.info(
63
+ b.info(
64
64
  "This in-app message has already received an impression. Ignoring analytics event.",
65
65
  ),
66
66
  r
67
67
  );
68
- } else if (e === p.Hn || (t instanceof HtmlMessage && e === p.Jn)) {
69
- if (!t.ss(i))
68
+ } else if (e === p.On || (t instanceof HtmlMessage && e === p.Xn)) {
69
+ if (!t.Yt(i))
70
70
  return (
71
- E.info(
71
+ b.info(
72
72
  "This in-app message has already received a click. Ignoring analytics event.",
73
73
  ),
74
74
  r
@@ -78,51 +78,51 @@ export default class ea {
78
78
  (n =
79
79
  t instanceof ControlMessage
80
80
  ? { trigger_ids: [t.triggerId] }
81
- : this.Kn(t)),
81
+ : this.Hn(t)),
82
82
  null == n
83
83
  ? r
84
84
  : (t.messageExtras && (n.message_extras = t.messageExtras),
85
85
  null != s && (n.bid = s),
86
- v.wt(e, n))
86
+ v.Dt(e, n))
87
87
  );
88
88
  }
89
- Ln(t, e) {
89
+ Jn(t, e) {
90
90
  const s = new L();
91
- if (!t.ss())
91
+ if (!t.Yt())
92
92
  return (
93
- E.info(
93
+ b.info(
94
94
  "This in-app message button has already received a click. Ignoring analytics event.",
95
95
  ),
96
96
  s
97
97
  );
98
- const i = this.Kn(e);
98
+ const i = this.Hn(e);
99
99
  return null == i
100
100
  ? s
101
- : t.id === InAppMessageButton.Qn
102
- ? (E.info(
101
+ : t.id === InAppMessageButton.Kn
102
+ ? (b.info(
103
103
  "This in-app message button does not have a tracking id. Not logging event to Braze servers.",
104
104
  ),
105
105
  s)
106
- : (null != t.id && (i.bid = t.id), v.wt(p.Jn, i));
106
+ : (null != t.id && (i.bid = t.id), v.Dt(p.Xn, i));
107
107
  }
108
- Un(t) {
108
+ Ln(t) {
109
109
  const e = t.messageFields;
110
110
  return (null != e && e.is_push_primer) || !1;
111
111
  }
112
- Vn(t) {
112
+ Qn(t) {
113
113
  if (!(t instanceof InAppMessage)) return;
114
114
  const e = (t) => {
115
115
  if (!t) return;
116
116
  const e = eo(t);
117
- if (vt(e)) return yt(bt.Wn, "In-App Message");
117
+ if (vt(e)) return yt(bt.Un, "In-App Message");
118
118
  if (jt(e)) {
119
- const t = It.Yn();
120
- if (!t.Zn) return It._o(t.reason, "In-App Message");
119
+ const t = It.Vn();
120
+ if (!t.Wn) return It.Yn(t.reason, "In-App Message");
121
121
  }
122
122
  };
123
- if (this.Un(t)) {
124
- const t = It.Yn();
125
- if (!t.Zn) return It._o(t.reason, "In-App Message");
123
+ if (this.Ln(t)) {
124
+ const t = It.Vn();
125
+ if (!t.Wn) return It.Yn(t.reason, "In-App Message");
126
126
  }
127
127
  const s = t.buttons || [];
128
128
  let i;
@@ -138,29 +138,29 @@ export default class ea {
138
138
  ? e(t.uri)
139
139
  : void 0;
140
140
  }
141
- Xo(t, e) {
142
- e !== this.En && this.Yo(), (this.Pn = t), (this.En = e);
141
+ Zn(t, e) {
142
+ e !== this.xn && this._o(), (this.qn = t), (this.xn = e);
143
143
  }
144
- Yo() {
145
- null != this.Pn &&
146
- (clearTimeout(this.Pn), (this.Pn = null), (this.En = null));
144
+ _o() {
145
+ null != this.qn &&
146
+ (clearTimeout(this.qn), (this.qn = null), (this.xn = null));
147
147
  }
148
- Zo(t, e, s, i) {
148
+ Xo(t, e, s, i) {
149
149
  const r = this.B;
150
150
  if (!r) return;
151
- this.En && t.triggerId !== this.En && (this.Yo(), h.Li(this.C, h.it.ta));
152
- const n = r.ia(!1),
151
+ this.xn && t.triggerId !== this.xn && (this._o(), h.Ji(this.j, h.it.Yo));
152
+ const n = r.Zo(!1),
153
153
  o = r.Z(n);
154
154
  (o.template = { trigger_id: t.triggerId, trigger_event_type: e }),
155
- null != s && (o.template.data = s.oa());
156
- const u = r.tt(o, h.it.ta);
155
+ null != s && (o.template.data = s.ta());
156
+ const u = r.tt(o, h.it.Yo);
157
157
  r.et(
158
158
  o,
159
159
  (r = -1) => {
160
160
  const n = this.B;
161
161
  if (!n) return;
162
162
  const m = new Date().valueOf();
163
- h.nt(this.C, h.it.ta, m),
163
+ h.nt(this.j, h.it.Yo, m),
164
164
  -1 !== r && u.push(["X-Braze-Req-Tokens-Remaining", r.toString()]);
165
165
  let c,
166
166
  p,
@@ -171,16 +171,16 @@ export default class ea {
171
171
  headers: u,
172
172
  lt: (e) => {
173
173
  if (!n.ut(o, e, u))
174
- return void ("function" == typeof t.la && t.la());
174
+ return void ("function" == typeof t.ia && t.ia());
175
175
  if ((n.ct(), null == e || null == e.templated_message)) return;
176
176
  const s = e.templated_message;
177
- if (s.type !== gt.ma.ua) return;
177
+ if (s.type !== gt.la.oa) return;
178
178
  const i = pt(s.data);
179
179
  if (null == i) return;
180
- const r = this.Vn(i);
180
+ const r = this.Qn(i);
181
181
  if (r)
182
- return E.error(r), void ("function" == typeof t.la && t.la());
183
- "function" == typeof t.ca && t.ca(i);
182
+ return b.error(r), void ("function" == typeof t.ia && t.ia());
183
+ "function" == typeof t.ua && t.ua(i);
184
184
  },
185
185
  error: (e) => {
186
186
  (f = !0),
@@ -188,21 +188,21 @@ export default class ea {
188
188
  (p = `getting user personalization for message ${t.triggerId}.`);
189
189
  },
190
190
  ft: (r, o) => {
191
- if (new Date().valueOf() - t.pa < t.ha) {
191
+ if (new Date().valueOf() - t.ma < t.ca) {
192
192
  let r = 0;
193
193
  if (f) {
194
- const e = Math.min(t.ha, this._n),
195
- s = this.Bn;
194
+ const e = Math.min(t.ca, this.Dn),
195
+ s = this.An;
196
196
  null == i && (i = s), (r = Math.min(e, a(s, 3 * i)));
197
197
  }
198
198
  n.yt(
199
199
  o,
200
200
  () => {
201
- this.Zo(t, e, s, r);
201
+ this.Xo(t, e, s, r);
202
202
  },
203
- h.it.ta,
204
- (e) => this.Xo(e, t.triggerId),
205
- () => this.Yo(),
203
+ h.it.Yo,
204
+ (e) => this.Zn(e, t.triggerId),
205
+ () => this._o(),
206
206
  r,
207
207
  );
208
208
  }
@@ -210,13 +210,13 @@ export default class ea {
210
210
  },
211
211
  });
212
212
  },
213
- h.it.ta,
213
+ h.it.Yo,
214
214
  );
215
215
  }
216
- Kn(t) {
216
+ Hn(t) {
217
217
  if (null == t.triggerId)
218
218
  return (
219
- E.info(
219
+ b.info(
220
220
  "The in-app message has no analytics id. Not logging event to Braze servers.",
221
221
  ),
222
222
  null
@@ -224,40 +224,40 @@ export default class ea {
224
224
  const e = {};
225
225
  return null != t.triggerId && (e.trigger_ids = [t.triggerId]), e;
226
226
  }
227
- An(t) {
227
+ jn(t) {
228
228
  return (
229
- !!this.C &&
229
+ !!this.j &&
230
230
  !(
231
231
  !(t && t instanceof InAppMessage && t.constructor !== InAppMessage) ||
232
232
  t instanceof ControlMessage
233
233
  ) &&
234
- this.C.It(s.Tt.fa, t.qt())
234
+ this.j.Pt(s.It.pa, t.qt())
235
235
  );
236
236
  }
237
237
  sa() {
238
- if (!this.C) return null;
239
- const t = this.C.Rt(s.Tt.fa);
238
+ if (!this.j) return null;
239
+ const t = this.j.St(s.It.pa);
240
240
  if (!t) return null;
241
241
  let e;
242
242
  switch (t.type) {
243
243
  case dt.cE:
244
- e = FullScreenMessage.ga(t);
244
+ e = FullScreenMessage.ha(t);
245
245
  break;
246
246
  case dt.iE:
247
247
  case dt.PE:
248
248
  case dt.nE:
249
- e = HtmlMessage.ga(t);
249
+ e = HtmlMessage.ha(t);
250
250
  break;
251
251
  case dt.aE:
252
252
  case dt.UE:
253
- e = ModalMessage.ga(t);
253
+ e = ModalMessage.ha(t);
254
254
  break;
255
255
  case dt.sE:
256
- e = SlideUpMessage.ga(t);
256
+ e = SlideUpMessage.ha(t);
257
257
  }
258
- return e && this.da(), e;
258
+ return e && this.fa(), e;
259
259
  }
260
- da() {
261
- this.C && this.C.Qt(s.Tt.fa);
260
+ fa() {
261
+ this.j && this.j.Vt(s.It.pa);
262
262
  }
263
263
  }
@@ -3,16 +3,16 @@ import { IamStrings as mr } from "./constants.js";
3
3
  import InAppMessage from "./models/in-app-message.js";
4
4
  import InAppMessageButton from "./models/in-app-message-button.js";
5
5
  import je from "./in-app-message-manager-factory.js";
6
- import { logger as E } from "../../shared-lib/index.js";
6
+ import { logger as b } from "../../shared-lib/index.js";
7
7
  import ot from "../triggers/models/trigger-events.js";
8
8
  import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
9
9
  export function logInAppMessageButtonClick(t, o) {
10
10
  var e;
11
11
  if (!r.rr()) return !1;
12
12
  if (!(t instanceof InAppMessageButton))
13
- return E.error("button must be an InAppMessageButton object"), !1;
14
- if (!(o instanceof InAppMessage)) return E.error(mr.EE), !1;
15
- const s = je.ra().Ln(t, o);
13
+ return b.error("button must be an InAppMessageButton object"), !1;
14
+ if (!(o instanceof InAppMessage)) return b.error(mr.EE), !1;
15
+ const s = je.ra().Jn(t, o);
16
16
  if (s.lt)
17
17
  for (let r = 0; r < s.Ce.length; r++)
18
18
  rt.o().Ee(
@@ -3,13 +3,13 @@ import InAppMessage from "./models/in-app-message.js";
3
3
  import je from "./in-app-message-manager-factory.js";
4
4
  import { logInAppMessageImpression } from "./log-in-app-message-impression.js";
5
5
  import { IamStrings as mr } from "./constants.js";
6
- import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
6
+ import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
7
7
  import ot from "../triggers/models/trigger-events.js";
8
8
  import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
9
9
  export function logInAppMessageClick(s) {
10
10
  if (!r.rr()) return !1;
11
- if (!(s instanceof InAppMessage)) return E.error(mr.EE), !1;
12
- const e = je.ra().wt(s, p.Hn);
11
+ if (!(s instanceof InAppMessage)) return b.error(mr.EE), !1;
12
+ const e = je.ra().Dt(s, p.On);
13
13
  if (e) {
14
14
  s.sm() || logInAppMessageImpression(s);
15
15
  for (let r = 0; r < e.Ce.length; r++)
@@ -1,21 +1,21 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import HtmlMessage from "./models/html-message.js";
3
3
  import je from "./in-app-message-manager-factory.js";
4
- import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
4
+ import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
5
5
  import ot from "../triggers/models/trigger-events.js";
6
6
  import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
7
7
  export function logInAppMessageHtmlClick(e, t, s) {
8
8
  if (!r.rr()) return !1;
9
9
  if (!(e instanceof HtmlMessage))
10
10
  return (
11
- E.error(
11
+ b.error(
12
12
  "inAppMessage argument to logInAppMessageHtmlClick must be an HtmlMessage object.",
13
13
  ),
14
14
  !1
15
15
  );
16
- let o = p.Hn;
17
- null != t && (o = p.Jn);
18
- const m = je.ra().wt(e, o, t, s);
16
+ let o = p.On;
17
+ null != t && (o = p.Xn);
18
+ const m = je.ra().Dt(e, o, t, s);
19
19
  if (m.lt)
20
20
  for (let r = 0; r < m.Ce.length; r++)
21
21
  rt.o().Ee(ot.rm, [e.triggerId, t], m.Ce[r]);
@@ -3,11 +3,11 @@ import ControlMessage from "./models/control-message.js";
3
3
  import InAppMessage from "./models/in-app-message.js";
4
4
  import je from "./in-app-message-manager-factory.js";
5
5
  import { IamStrings as mr } from "./constants.js";
6
- import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
6
+ import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
7
7
  export function logInAppMessageImpression(s) {
8
8
  if (!r.rr()) return !1;
9
9
  if (!(s instanceof InAppMessage || s instanceof ControlMessage))
10
- return E.error(mr.EE), !1;
11
- const o = s instanceof ControlMessage ? p.om : p.Xn;
12
- return je.ra().wt(s, o).lt;
10
+ return b.error(mr.EE), !1;
11
+ const o = s instanceof ControlMessage ? p.om : p.Fn;
12
+ return je.ra().Dt(s, o).lt;
13
13
  }
@@ -6,15 +6,15 @@ export default class ControlMessage {
6
6
  (this.messageExtras = t),
7
7
  (this.extras = {}),
8
8
  (this.isControl = !0),
9
- (this.Zt = !1);
9
+ (this.hs = !1);
10
10
  }
11
11
  static fromJson(s) {
12
12
  return new ControlMessage(s.trigger_id, s.message_extras);
13
13
  }
14
- gs() {
15
- return !this.Zt && ((this.Zt = !0), !0);
14
+ js() {
15
+ return !this.hs && ((this.hs = !0), !0);
16
16
  }
17
17
  sm() {
18
- return this.Zt;
18
+ return this.hs;
19
19
  }
20
20
  }
@@ -83,11 +83,11 @@ export default class FullScreenMessage extends InAppMessage {
83
83
  qt() {
84
84
  return super.qt(dt.cE);
85
85
  }
86
- static ga(r) {
86
+ static ha(r) {
87
87
  return new FullScreenMessage(
88
88
  r[cr.rE],
89
89
  r[cr.mE],
90
- r[cr.Fs],
90
+ r[cr.Is],
91
91
  r[cr.FE],
92
92
  r[cr.HE],
93
93
  r[cr.URI],
@@ -95,7 +95,7 @@ export default class FullScreenMessage extends InAppMessage {
95
95
  r[cr.BE],
96
96
  r[cr.lE],
97
97
  r[cr.bE],
98
- r[cr.ys],
98
+ r[cr.Bs],
99
99
  r[cr.gE],
100
100
  r[cr.YE],
101
101
  r[cr.KE],
@@ -115,7 +115,7 @@ export default class FullScreenMessage extends InAppMessage {
115
115
  r[cr.CSS],
116
116
  r[cr.JE],
117
117
  r[cr.LANGUAGE],
118
- r[cr.Ks],
118
+ r[cr.Ns],
119
119
  );
120
120
  }
121
121
  }