@braze/web-sdk 6.12.0 → 6.13.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 (149) hide show
  1. package/index.d.ts +240 -3
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +18 -18
  4. package/shared-lib/indexed-db-adapter.js +58 -58
  5. package/shared-lib/logger.js +7 -7
  6. package/shared-lib/supported-options.js +25 -24
  7. package/src/ConversationalChat/automatically-manage-chat.js +5 -0
  8. package/src/ConversationalChat/chat-message-factory.js +25 -0
  9. package/src/ConversationalChat/chat-message.js +33 -0
  10. package/src/ConversationalChat/constants.js +1 -0
  11. package/src/ConversationalChat/conversational-chat-provider-factory.js +26 -0
  12. package/src/ConversationalChat/conversational-chat-provider.js +372 -0
  13. package/src/ConversationalChat/display/chat-widget-manager.js +113 -0
  14. package/src/ConversationalChat/display/chat-widget-to-html.js +58 -0
  15. package/src/ConversationalChat/get-chat-messages.js +7 -0
  16. package/src/ConversationalChat/index.js +12 -0
  17. package/src/ConversationalChat/is-chat-conversation-ended.js +7 -0
  18. package/src/ConversationalChat/is-chat-turn-errored.js +7 -0
  19. package/src/ConversationalChat/is-chat-turn-in-progress.js +7 -0
  20. package/src/ConversationalChat/register-chat-action-handler.js +10 -0
  21. package/src/ConversationalChat/reset-chat-conversation.js +5 -0
  22. package/src/ConversationalChat/retrieve-chat-config.js +7 -0
  23. package/src/ConversationalChat/send-chat-message.js +17 -0
  24. package/src/ConversationalChat/subscribe-to-chat-action.js +5 -0
  25. package/src/ConversationalChat/subscribe-to-chat-conversation-updated.js +5 -0
  26. package/src/ConversationalChat/subscribe-to-chat-message-received.js +5 -0
  27. package/src/ConversationalChat/trigger-chat-action.js +11 -0
  28. package/src/ConversationalChat/types.js +1 -0
  29. package/src/Core/add-sdk-metadata.js +5 -5
  30. package/src/Core/change-user.js +6 -6
  31. package/src/Core/disable-sdk.js +6 -6
  32. package/src/Core/enable-sdk.js +3 -3
  33. package/src/Core/get-device-id.js +2 -2
  34. package/src/Core/handle-braze-action.js +20 -13
  35. package/src/Core/is-disabled.js +1 -1
  36. package/src/Core/is-initialized.js +1 -1
  37. package/src/Core/log-custom-event.js +9 -9
  38. package/src/Core/log-ecommerce-event.js +4 -4
  39. package/src/Core/log-purchase.js +14 -14
  40. package/src/Core/open-session.js +8 -8
  41. package/src/Core/set-sdk-authentication-signature.js +3 -3
  42. package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
  43. package/src/Core/wipe-data.js +1 -1
  44. package/src/DUST/dust-config-store.js +35 -35
  45. package/src/DUST/dust-message-dedup.js +3 -3
  46. package/src/DUST/dust-provider-factory.js +10 -10
  47. package/src/DUST/dust-provider.js +234 -234
  48. package/src/DUST/subscribe-to-dust.js +7 -7
  49. package/src/FeatureFlags/feature-flag-factory.js +2 -2
  50. package/src/FeatureFlags/feature-flag.js +4 -4
  51. package/src/FeatureFlags/feature-flags-provider-factory.js +11 -11
  52. package/src/FeatureFlags/feature-flags-provider.js +38 -38
  53. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  54. package/src/FeatureFlags/get-feature-flag.js +3 -3
  55. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  56. package/src/FeatureFlags/refresh-feature-flags.js +5 -5
  57. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +3 -3
  58. package/src/InAppMessage/defer-in-app-message.js +1 -1
  59. package/src/InAppMessage/display/html-message-display-utils.js +4 -4
  60. package/src/InAppMessage/display/html-message-to-html.js +13 -13
  61. package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
  62. package/src/InAppMessage/display/modal-utils.js +7 -7
  63. package/src/InAppMessage/in-app-message-factory.js +6 -6
  64. package/src/InAppMessage/in-app-message-manager.js +92 -92
  65. package/src/InAppMessage/log-in-app-message-button-click.js +9 -9
  66. package/src/InAppMessage/log-in-app-message-click.js +7 -7
  67. package/src/InAppMessage/log-in-app-message-html-click.js +6 -6
  68. package/src/InAppMessage/log-in-app-message-impression.js +3 -3
  69. package/src/InAppMessage/models/full-screen-message.js +39 -39
  70. package/src/InAppMessage/models/html-message.js +20 -20
  71. package/src/InAppMessage/models/in-app-message-button.js +2 -2
  72. package/src/InAppMessage/models/in-app-message.js +102 -102
  73. package/src/InAppMessage/models/modal-message.js +38 -38
  74. package/src/InAppMessage/models/slide-up-message.js +34 -34
  75. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  76. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  77. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  78. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +3 -3
  79. package/src/InAppMessage/ui/show-in-app-message.js +27 -24
  80. package/src/Push/is-push-blocked.js +2 -2
  81. package/src/Push/is-push-permission-granted.js +2 -2
  82. package/src/Push/is-push-supported.js +2 -2
  83. package/src/Push/push-manager-factory.js +15 -15
  84. package/src/Push/push-manager.js +13 -13
  85. package/src/Push/register-push.js +2 -2
  86. package/src/Push/request-push-permission.js +2 -2
  87. package/src/Push/unregister-push-token-on-server.js +3 -3
  88. package/src/Push/unregister-push.js +3 -3
  89. package/src/Push/utils/push-utils.js +15 -15
  90. package/src/User/user-manager.js +9 -9
  91. package/src/User/user.js +50 -50
  92. package/src/common/constants.js +1 -1
  93. package/src/common/content-cards-display.js +22 -22
  94. package/src/common/event-logger.js +3 -3
  95. package/src/index.js +2 -9
  96. package/src/l10n/l10n-manager-factory.js +4 -4
  97. package/src/l10n/l10n-manager.js +6 -6
  98. package/src/managers/auth-manager.js +28 -28
  99. package/src/managers/braze-action-manager.js +14 -0
  100. package/src/managers/braze-instance.js +159 -151
  101. package/src/managers/device-manager.js +26 -26
  102. package/src/managers/network-manager.js +120 -120
  103. package/src/managers/server-config-manager.js +95 -86
  104. package/src/managers/session-manager.js +25 -25
  105. package/src/managers/storage-manager-factory.js +12 -12
  106. package/src/managers/storage-manager.js +129 -124
  107. package/src/managers/subscription-manager.js +8 -8
  108. package/src/models/backend-errors.js +5 -5
  109. package/src/models/braze-event.js +5 -5
  110. package/src/models/device.js +2 -2
  111. package/src/models/identifier.js +8 -8
  112. package/src/models/push-token.js +6 -6
  113. package/src/models/request-result.js +2 -2
  114. package/src/models/server-config.js +27 -27
  115. package/src/request-controller.js +117 -117
  116. package/src/standard-index.js +9 -0
  117. package/src/triggers/models/custom-event-data.js +4 -4
  118. package/src/triggers/models/custom-event-property-data.js +5 -5
  119. package/src/triggers/models/filter-set.js +5 -5
  120. package/src/triggers/models/filter.js +31 -31
  121. package/src/triggers/models/in-app-message-click-data.js +9 -9
  122. package/src/triggers/models/purchase-data.js +1 -1
  123. package/src/triggers/models/purchase-property-data.js +5 -5
  124. package/src/triggers/models/push-click-data.js +4 -4
  125. package/src/triggers/models/trigger-condition.js +35 -35
  126. package/src/triggers/models/trigger-events.js +3 -3
  127. package/src/triggers/models/trigger.js +36 -36
  128. package/src/triggers/triggers-provider-factory.js +5 -5
  129. package/src/triggers/triggers-provider.js +128 -128
  130. package/src/types.js +2 -2
  131. package/src/ui/js/attach-css.js +1 -1
  132. package/src/ui/js/chat-widget-css.js +11 -0
  133. package/src/ui/js/load-font-awesome.js +1 -1
  134. package/src/util/base-device-parser.js +7 -7
  135. package/src/util/braze-actions.js +5 -5
  136. package/src/util/browser-detector.js +41 -41
  137. package/src/util/client-hints-parser.js +10 -10
  138. package/src/util/component-utils.js +1 -1
  139. package/src/util/date-utils.js +2 -2
  140. package/src/util/device-constants.js +5 -5
  141. package/src/util/dom-utils.js +8 -8
  142. package/src/util/ecommerce-event-validation.js +13 -13
  143. package/src/util/html-display-utils.js +6 -6
  144. package/src/util/key-codes.js +1 -1
  145. package/src/util/net.js +82 -44
  146. package/src/util/request-header-utils.js +26 -24
  147. package/src/util/user-agent-parser.js +21 -21
  148. package/src/util/validation-utils.js +29 -21
  149. package/src/util/window-utils.js +3 -3
@@ -3,9 +3,9 @@ import { logInAppMessageButtonClick } from "../log-in-app-message-button-click.j
3
3
  import { toRgba as ae } from "../../util/color-utils.js";
4
4
  import { addPassiveEventListener as F } from "../../util/dom-utils.js";
5
5
  import { KeyCodes as le } from "../../util/key-codes.js";
6
- import { IamClickAction as ce, IamOpenTarget as dt } from "../constants.js";
6
+ import { IamClickAction as ce, IamOpenTarget as bt } from "../constants.js";
7
7
  const ie = {
8
- Ho: (t) => {
8
+ Jo: (t) => {
9
9
  const o = t.querySelectorAll(".ab-close-button, .ab-message-button");
10
10
  let e;
11
11
  for (let t = 0; t < o.length; t++) (e = o[t]), (e.tabIndex = 0);
@@ -14,7 +14,7 @@ const ie = {
14
14
  s = o[o.length - 1];
15
15
  t.addEventListener("keydown", (o) => {
16
16
  const a = document.activeElement;
17
- o.keyCode === le.No &&
17
+ o.keyCode === le.Qo &&
18
18
  (o.shiftKey || (a !== s && a !== t)
19
19
  ? !o.shiftKey ||
20
20
  (a !== e && a !== t) ||
@@ -23,14 +23,14 @@ const ie = {
23
23
  });
24
24
  }
25
25
  },
26
- Io: (t, o) => {
26
+ Ko: (t, o) => {
27
27
  o.setAttribute("role", "dialog"),
28
28
  o.setAttribute("aria-modal", "true"),
29
29
  t
30
30
  ? o.setAttribute("aria-labelledby", t)
31
31
  : o.setAttribute("aria-label", "Modal Message");
32
32
  },
33
- Go: (t, o, e) => {
33
+ Io: (t, o, e) => {
34
34
  if (t.buttons && t.buttons.length > 0) {
35
35
  const s = document.createElement("div");
36
36
  (s.className = "ab-message-buttons"), o.appendChild(s);
@@ -40,7 +40,7 @@ const ie = {
40
40
  t.tl(o, () => {
41
41
  logInAppMessageButtonClick(s, t),
42
42
  s.clickAction === ce.URI &&
43
- Q(s.uri || "", e || t.openTarget === dt.BLANK, a);
43
+ Q(s.uri || "", e || t.openTarget === bt.BLANK, a);
44
44
  }),
45
45
  a.stopPropagation(),
46
46
  !1
@@ -54,7 +54,7 @@ const ie = {
54
54
  let n = e.text;
55
55
  "" === e.text && (n = " "),
56
56
  a.appendChild(document.createTextNode(n)),
57
- t.Mo() ||
57
+ t.Oo() ||
58
58
  ((a.style.backgroundColor = ae(e.backgroundColor)),
59
59
  (a.style.color = ae(e.textColor)),
60
60
  (a.style.borderColor = ae(e.borderColor))),
@@ -5,7 +5,7 @@ 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
7
  import { logger as b } from "../../shared-lib/index.js";
8
- import { IamServerTypes as gt } from "./constants.js";
8
+ import { IamServerTypes as Ot } from "./constants.js";
9
9
  export function newInAppMessageFromJson(e) {
10
10
  if (!e) return null;
11
11
  if (e.is_control) return ControlMessage.fromJson(e);
@@ -49,7 +49,7 @@ export function newInAppMessageFromJson(e) {
49
49
  D = e.language,
50
50
  E = e.image_alt;
51
51
  let G;
52
- if (o === gt.tE || o === gt.eE)
52
+ if (o === Ot.tE || o === Ot.eE)
53
53
  G = new ModalMessage(
54
54
  s,
55
55
  n,
@@ -82,7 +82,7 @@ export function newInAppMessageFromJson(e) {
82
82
  D,
83
83
  E,
84
84
  );
85
- else if (o === gt.oE)
85
+ else if (o === Ot.oE)
86
86
  G = new FullScreenMessage(
87
87
  s,
88
88
  n,
@@ -116,7 +116,7 @@ export function newInAppMessageFromJson(e) {
116
116
  D,
117
117
  E,
118
118
  );
119
- else if (o === gt.RE)
119
+ else if (o === Ot.RE)
120
120
  G = new SlideUpMessage(
121
121
  s,
122
122
  n,
@@ -144,7 +144,7 @@ export function newInAppMessageFromJson(e) {
144
144
  E,
145
145
  );
146
146
  else {
147
- if (o !== gt.ME && o !== gt.CE && o !== gt.DE)
147
+ if (o !== Ot.ME && o !== Ot.CE && o !== Ot.DE)
148
148
  return void b.error("Ignoring message with unknown type " + o);
149
149
  {
150
150
  const o = e.message_fields;
@@ -152,7 +152,7 @@ export function newInAppMessageFromJson(e) {
152
152
  (G.trusted = e.trusted || !1);
153
153
  }
154
154
  }
155
- return (G.Oo = o), G;
155
+ return (G.Bo = o), G;
156
156
  }
157
157
  export function buttonsFromSerializedInAppMessage(e) {
158
158
  const o = [];
@@ -5,28 +5,28 @@ import HtmlMessage from "./models/html-message.js";
5
5
  import InAppMessage from "./models/in-app-message.js";
6
6
  import InAppMessageButton from "./models/in-app-message-button.js";
7
7
  import v from "../common/event-logger.js";
8
- import { newInAppMessageFromJson as yt } from "./in-app-message-factory.js";
8
+ import { newInAppMessageFromJson as It } 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
11
  import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
12
12
  import f from "../managers/subscription-manager.js";
13
- import vt from "../triggers/models/trigger.js";
13
+ import Tt from "../triggers/models/trigger.js";
14
14
  import { BRAZE_ACTION_URI_REGEX as to } from "../util/validation-utils.js";
15
15
  import {
16
- containsPushPrimerBrazeAction as It,
17
- containsUnknownBrazeAction as At,
18
- getDecodedBrazeAction as eo,
19
- ineligibleBrazeActionURLErrorMessage as Mt,
20
- INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as Tt,
16
+ containsPushPrimerBrazeAction as Dt,
17
+ containsUnknownBrazeAction as St,
18
+ getDecodedBrazeAction as ro,
19
+ ineligibleBrazeActionURLErrorMessage as zt,
20
+ INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as Rt,
21
21
  } from "../util/braze-actions.js";
22
- import Dt from "../Push/utils/push-utils.js";
22
+ import _t from "../Push/utils/push-utils.js";
23
23
  import h from "../util/request-header-utils.js";
24
24
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
25
25
  import { FullScreenMessage, ModalMessage, SlideUpMessage } from "./index.js";
26
26
  import {
27
27
  IamClickAction as ce,
28
- IamServerTypes as gt,
29
- IamTiming as kt,
28
+ IamServerTypes as Ot,
29
+ IamTiming as qt,
30
30
  } from "./constants.js";
31
31
  export default class ea {
32
32
  constructor(t, e, s, i) {
@@ -38,31 +38,31 @@ export default class ea {
38
38
  (this.C = e),
39
39
  (this.j = s),
40
40
  (this.Ss = i),
41
- (this.In = new f()),
42
- r.S(this.In),
43
- (this.Tn = 1e3),
44
- (this.Dn = 6e4),
45
- (this.zn = null),
46
- (this.Bn = null),
47
- (this._n = null),
48
- (this.qn = {});
41
+ (this.So = new f()),
42
+ r.S(this.So),
43
+ (this.Xo = 1e3),
44
+ (this.Uo = 6e4),
45
+ (this.Vo = null),
46
+ (this.Wo = null),
47
+ (this.Yo = null),
48
+ (this.Zo = {});
49
49
  }
50
- Pn() {
51
- return this.In;
50
+ ta() {
51
+ return this.So;
52
52
  }
53
- En(t) {
54
- return this.In.Ut(t);
53
+ ia(t) {
54
+ return this.So.Ut(t);
55
55
  }
56
- Gn() {
57
- return this.zn;
56
+ oa() {
57
+ return this.Vo;
58
58
  }
59
- Nn(t) {
60
- this.zn = t;
59
+ la(t) {
60
+ this.Vo = t;
61
61
  }
62
62
  Dt(t, e, s, i) {
63
63
  const r = new L();
64
64
  let n;
65
- if (e === p.On || t instanceof ControlMessage) {
65
+ if (e === p.ua || t instanceof ControlMessage) {
66
66
  if (!t.js())
67
67
  return (
68
68
  b.info(
@@ -70,14 +70,14 @@ export default class ea {
70
70
  ),
71
71
  r
72
72
  );
73
- if (this.Xn(t.triggerId))
73
+ if (this.ma(t.triggerId))
74
74
  return (
75
75
  b.info(
76
76
  "An impression for this in-app message trigger has already been logged. Ignoring analytics event.",
77
77
  ),
78
78
  r
79
79
  );
80
- } else if (e === p.Hn || (t instanceof HtmlMessage && e === p.Jn)) {
80
+ } else if (e === p.pa || (t instanceof HtmlMessage && e === p.ha)) {
81
81
  if (!t.Yt(i))
82
82
  return (
83
83
  b.info(
@@ -90,7 +90,7 @@ export default class ea {
90
90
  (n =
91
91
  t instanceof ControlMessage
92
92
  ? { trigger_ids: [t.triggerId] }
93
- : this.Kn(t)),
93
+ : this.ca(t)),
94
94
  null == n
95
95
  ? r
96
96
  : (t.messageExtras && (n.message_extras = t.messageExtras),
@@ -98,7 +98,7 @@ export default class ea {
98
98
  v.Dt(e, n))
99
99
  );
100
100
  }
101
- Ln(t, e) {
101
+ ga(t, e) {
102
102
  const s = new L();
103
103
  if (!t.Yt())
104
104
  return (
@@ -107,34 +107,34 @@ export default class ea {
107
107
  ),
108
108
  s
109
109
  );
110
- const i = this.Kn(e);
110
+ const i = this.ca(e);
111
111
  return null == i
112
112
  ? s
113
- : t.id === InAppMessageButton.Qn
113
+ : t.id === InAppMessageButton.fa
114
114
  ? (b.info(
115
115
  "This in-app message button does not have a tracking id. Not logging event to Braze servers.",
116
116
  ),
117
117
  s)
118
- : (null != t.id && (i.bid = t.id), v.Dt(p.Jn, i));
118
+ : (null != t.id && (i.bid = t.id), v.Dt(p.ha, i));
119
119
  }
120
- Un(t) {
120
+ da(t) {
121
121
  const e = t.messageFields;
122
122
  return (null != e && e.is_push_primer) || !1;
123
123
  }
124
- Vn(t) {
124
+ ja(t) {
125
125
  if (!(t instanceof InAppMessage)) return;
126
126
  const e = (t) => {
127
127
  if (!t) return;
128
- const e = eo(t);
129
- if (At(e)) return Mt(Tt.Wn, "In-App Message");
130
- if (It(e)) {
131
- const t = Dt.Yn();
132
- if (!t.Zn) return Dt.So(t.reason, "In-App Message");
128
+ const e = ro(t);
129
+ if (St(e)) return zt(Rt.ya, "In-App Message");
130
+ if (Dt(e)) {
131
+ const t = _t.va();
132
+ if (!t.ba) return _t.Ia(t.reason, "In-App Message");
133
133
  }
134
134
  };
135
- if (this.Un(t)) {
136
- const t = Dt.Yn();
137
- if (!t.Zn) return Dt.So(t.reason, "In-App Message");
135
+ if (this.da(t)) {
136
+ const t = _t.va();
137
+ if (!t.ba) return _t.Ia(t.reason, "In-App Message");
138
138
  }
139
139
  const s = t.buttons || [];
140
140
  let i;
@@ -150,29 +150,29 @@ export default class ea {
150
150
  ? e(t.uri)
151
151
  : void 0;
152
152
  }
153
- Ro(t, e) {
154
- e !== this._n && this._o(), (this.Bn = t), (this._n = e);
153
+ Aa(t, e) {
154
+ e !== this.Yo && this.Ma(), (this.Wo = t), (this.Yo = e);
155
155
  }
156
- _o() {
157
- null != this.Bn &&
158
- (clearTimeout(this.Bn), (this.Bn = null), (this._n = null));
156
+ Ma() {
157
+ null != this.Wo &&
158
+ (clearTimeout(this.Wo), (this.Wo = null), (this.Yo = null));
159
159
  }
160
- Po(t, e, s, i) {
160
+ Ta(t, e, s, i) {
161
161
  const r = this.B;
162
162
  if (!r) return;
163
- this._n && t.triggerId !== this._n && (this._o(), h.Ji(this.j, h.it.Xo));
164
- const n = r.Qo(!1),
163
+ this.Yo && t.triggerId !== this.Yo && (this.Ma(), h.Ji(this.j, h.it.Da));
164
+ const n = r.ka(!1),
165
165
  o = r.Z(n);
166
166
  (o.template = { trigger_id: t.triggerId, trigger_event_type: e }),
167
- null != s && (o.template.data = s.Uo());
168
- const u = r.tt(o, h.it.Xo);
167
+ null != s && (o.template.data = s.wa());
168
+ const u = r.tt(o, h.it.Da);
169
169
  r.et(
170
170
  o,
171
171
  (r = -1) => {
172
172
  const n = this.B;
173
173
  if (!n) return;
174
174
  const m = new Date().valueOf();
175
- h.nt(this.j, h.it.Xo, m),
175
+ h.nt(this.j, h.it.Da, m),
176
176
  -1 !== r && u.push(["X-Braze-Req-Tokens-Remaining", r.toString()]);
177
177
  let p,
178
178
  c,
@@ -183,16 +183,16 @@ export default class ea {
183
183
  headers: u,
184
184
  lt: (e) => {
185
185
  if (!n.ut(o, e, u))
186
- return void ("function" == typeof t.Vo && t.Vo());
186
+ return void ("function" == typeof t.Sa && t.Sa());
187
187
  if ((n.ct(), null == e || null == e.templated_message)) return;
188
188
  const s = e.templated_message;
189
- if (s.type !== vt.Yo.Wo) return;
190
- const i = yt(s.data);
189
+ if (s.type !== Tt.Ba.za) return;
190
+ const i = It(s.data);
191
191
  if (null == i) return;
192
- const r = this.Vn(i);
192
+ const r = this.ja(i);
193
193
  if (r)
194
- return b.error(r), void ("function" == typeof t.Vo && t.Vo());
195
- "function" == typeof t.Zo && t.Zo(i);
194
+ return b.error(r), void ("function" == typeof t.Sa && t.Sa());
195
+ "function" == typeof t.Ra && t.Ra(i);
196
196
  },
197
197
  error: (e) => {
198
198
  (g = !0),
@@ -200,21 +200,21 @@ export default class ea {
200
200
  (c = `getting user personalization for message ${t.triggerId}.`);
201
201
  },
202
202
  ft: (r, o) => {
203
- if (new Date().valueOf() - t.ta < t.ia) {
203
+ if (new Date().valueOf() - t._a < t.qa) {
204
204
  let r = 0;
205
205
  if (g) {
206
- const e = Math.min(t.ia, this.Dn),
207
- s = this.Tn;
206
+ const e = Math.min(t.qa, this.Uo),
207
+ s = this.Xo;
208
208
  null == i && (i = s), (r = Math.min(e, a(s, 3 * i)));
209
209
  }
210
210
  n.yt(
211
211
  o,
212
212
  () => {
213
- this.Po(t, e, s, r);
213
+ this.Ta(t, e, s, r);
214
214
  },
215
- h.it.Xo,
216
- (e) => this.Ro(e, t.triggerId),
217
- () => this._o(),
215
+ h.it.Da,
216
+ (e) => this.Aa(e, t.triggerId),
217
+ () => this.Ma(),
218
218
  r,
219
219
  );
220
220
  }
@@ -222,19 +222,19 @@ export default class ea {
222
222
  },
223
223
  });
224
224
  },
225
- h.it.Xo,
225
+ h.it.Da,
226
226
  );
227
227
  }
228
- Xn(t) {
228
+ ma(t) {
229
229
  if (null == t || "" === t) return !1;
230
230
  const e = new Date().valueOf(),
231
- s = this.qn[t];
232
- return (null != s && e - s < kt.aE) || ((this.qn[t] = e), !1);
231
+ s = this.Zo[t];
232
+ return (null != s && e - s < qt.aE) || ((this.Zo[t] = e), !1);
233
233
  }
234
- oa() {
235
- this.qn = {};
234
+ xa() {
235
+ this.Zo = {};
236
236
  }
237
- Kn(t) {
237
+ ca(t) {
238
238
  if (null == t.triggerId)
239
239
  return (
240
240
  b.info(
@@ -245,40 +245,40 @@ export default class ea {
245
245
  const e = {};
246
246
  return null != t.triggerId && (e.trigger_ids = [t.triggerId]), e;
247
247
  }
248
- An(t) {
248
+ Mo(t) {
249
249
  return (
250
250
  !!this.j &&
251
251
  !(
252
252
  !(t && t instanceof InAppMessage && t.constructor !== InAppMessage) ||
253
253
  t instanceof ControlMessage
254
254
  ) &&
255
- this.j.Pt(s.It.la, t.qt())
255
+ this.j.Pt(s.It.Pa, t.qt())
256
256
  );
257
257
  }
258
258
  sa() {
259
259
  if (!this.j) return null;
260
- const t = this.j.St(s.It.la);
260
+ const t = this.j.St(s.It.Pa);
261
261
  if (!t) return null;
262
262
  let e;
263
263
  switch (t.type) {
264
- case gt.oE:
265
- e = FullScreenMessage.ua(t);
264
+ case Ot.oE:
265
+ e = FullScreenMessage.Ea(t);
266
266
  break;
267
- case gt.ME:
268
- case gt.CE:
269
- case gt.DE:
270
- e = HtmlMessage.ua(t);
267
+ case Ot.ME:
268
+ case Ot.CE:
269
+ case Ot.DE:
270
+ e = HtmlMessage.Ea(t);
271
271
  break;
272
- case gt.tE:
273
- case gt.eE:
274
- e = ModalMessage.ua(t);
272
+ case Ot.tE:
273
+ case Ot.eE:
274
+ e = ModalMessage.Ea(t);
275
275
  break;
276
- case gt.RE:
277
- e = SlideUpMessage.ua(t);
276
+ case Ot.RE:
277
+ e = SlideUpMessage.Ea(t);
278
278
  }
279
- return e && this.ma(), e;
279
+ return e && this.Ga(), e;
280
280
  }
281
- ma() {
282
- this.j && this.j.Vt(s.It.la);
281
+ Ga() {
282
+ this.j && this.j.Vt(s.It.Pa);
283
283
  }
284
284
  }
@@ -1,27 +1,27 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import { IamStrings as mr } from "./constants.js";
2
+ import { IamStrings as pr } 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 se from "./in-app-message-manager-factory.js";
6
6
  import { logger as b } from "../../shared-lib/index.js";
7
- import ot from "../triggers/models/trigger-events.js";
8
- import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
7
+ import gt from "../triggers/models/trigger-events.js";
8
+ import { TriggersProviderFactory as ft } 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
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 = se.ra().Ln(t, o);
14
+ if (!(o instanceof InAppMessage)) return b.error(pr.EE), !1;
15
+ const s = se.ra().ga(t, o);
16
16
  if (s.lt)
17
- for (let r = 0; r < s.Ce.length; r++)
18
- rt.o().Ee(
19
- ot.rm,
17
+ for (let r = 0; r < s.Ne.length; r++)
18
+ ft.o().Pe(
19
+ gt.rm,
20
20
  [
21
21
  o.triggerId,
22
22
  null === (e = t.id) || void 0 === e ? void 0 : e.toString(),
23
23
  ],
24
- s.Ce[r],
24
+ s.Ne[r],
25
25
  );
26
26
  return s.lt;
27
27
  }
@@ -2,18 +2,18 @@ import r from "../managers/braze-instance.js";
2
2
  import InAppMessage from "./models/in-app-message.js";
3
3
  import se from "./in-app-message-manager-factory.js";
4
4
  import { logInAppMessageImpression } from "./log-in-app-message-impression.js";
5
- import { IamStrings as mr } from "./constants.js";
5
+ import { IamStrings as pr } from "./constants.js";
6
6
  import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
7
- import ot from "../triggers/models/trigger-events.js";
8
- import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
7
+ import gt from "../triggers/models/trigger-events.js";
8
+ import { TriggersProviderFactory as ft } 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 b.error(mr.EE), !1;
12
- const e = se.ra().Dt(s, p.Hn);
11
+ if (!(s instanceof InAppMessage)) return b.error(pr.EE), !1;
12
+ const e = se.ra().Dt(s, p.pa);
13
13
  if (e) {
14
14
  s.sm() || logInAppMessageImpression(s);
15
- for (let r = 0; r < e.Ce.length; r++)
16
- rt.o().Ee(ot.rm, [s.triggerId], e.Ce[r]);
15
+ for (let r = 0; r < e.Ne.length; r++)
16
+ ft.o().Pe(gt.rm, [s.triggerId], e.Ne[r]);
17
17
  }
18
18
  return e.lt;
19
19
  }
@@ -2,8 +2,8 @@ import r from "../managers/braze-instance.js";
2
2
  import HtmlMessage from "./models/html-message.js";
3
3
  import se from "./in-app-message-manager-factory.js";
4
4
  import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
5
- import ot from "../triggers/models/trigger-events.js";
6
- import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
5
+ import gt from "../triggers/models/trigger-events.js";
6
+ import { TriggersProviderFactory as ft } 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))
@@ -13,11 +13,11 @@ export function logInAppMessageHtmlClick(e, t, s) {
13
13
  ),
14
14
  !1
15
15
  );
16
- let o = p.Hn;
17
- null != t && (o = p.Jn);
16
+ let o = p.pa;
17
+ null != t && (o = p.ha);
18
18
  const m = se.ra().Dt(e, o, t, s);
19
19
  if (m.lt)
20
- for (let r = 0; r < m.Ce.length; r++)
21
- rt.o().Ee(ot.rm, [e.triggerId, t], m.Ce[r]);
20
+ for (let r = 0; r < m.Ne.length; r++)
21
+ ft.o().Pe(gt.rm, [e.triggerId, t], m.Ne[r]);
22
22
  return m.lt;
23
23
  }
@@ -2,12 +2,12 @@ import r from "../managers/braze-instance.js";
2
2
  import ControlMessage from "./models/control-message.js";
3
3
  import InAppMessage from "./models/in-app-message.js";
4
4
  import se from "./in-app-message-manager-factory.js";
5
- import { IamStrings as mr } from "./constants.js";
5
+ import { IamStrings as pr } from "./constants.js";
6
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 b.error(mr.EE), !1;
11
- const o = s instanceof ControlMessage ? p.om : p.On;
10
+ return b.error(pr.EE), !1;
11
+ const o = s instanceof ControlMessage ? p.om : p.ua;
12
12
  return se.ra().Dt(s, o).lt;
13
13
  }
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  IamCropType as de,
3
- IamDismissType as pr,
3
+ IamDismissType as cr,
4
4
  IamOrientation as be,
5
- IamSerializationKeys as cr,
6
- IamServerTypes as gt,
5
+ IamSerializationKeys as jr,
6
+ IamServerTypes as Ot,
7
7
  IamTextAlignment as pe,
8
8
  } from "../constants.js";
9
- import { buttonsFromSerializedInAppMessage as ur } from "../in-app-message-factory.js";
9
+ import { buttonsFromSerializedInAppMessage as gr } from "../in-app-message-factory.js";
10
10
  import InAppMessage from "./in-app-message.js";
11
11
  export default class FullScreenMessage extends InAppMessage {
12
12
  constructor(
@@ -42,7 +42,7 @@ export default class FullScreenMessage extends InAppMessage {
42
42
  C,
43
43
  D,
44
44
  ) {
45
- (p = p || pr.MANUAL),
45
+ (p = p || cr.MANUAL),
46
46
  (k = k || be.PORTRAIT),
47
47
  super(
48
48
  r,
@@ -78,44 +78,44 @@ export default class FullScreenMessage extends InAppMessage {
78
78
  C,
79
79
  D,
80
80
  ),
81
- (this.qo = pe.CENTER);
81
+ (this.Ao = pe.CENTER);
82
82
  }
83
83
  qt() {
84
- return super.qt(gt.oE);
84
+ return super.qt(Ot.oE);
85
85
  }
86
- static ua(r) {
86
+ static Ea(r) {
87
87
  return new FullScreenMessage(
88
- r[cr.UE],
89
- r[cr.cE],
90
- r[cr.Is],
91
- r[cr.PE],
92
- r[cr.iE],
93
- r[cr.URI],
94
- r[cr.pE],
95
- r[cr.rE],
96
- r[cr.mE],
97
- r[cr.GE],
98
- r[cr.Bs],
99
- r[cr.xE],
100
- r[cr.HE],
101
- r[cr.FE],
102
- r[cr.BE],
103
- r[cr.bE],
104
- r[cr.gE],
105
- r[cr.lE],
106
- r[cr.YE],
107
- r[cr.hE],
108
- r[cr.KE],
109
- r[cr.WE],
110
- r[cr.XE],
111
- ur(r[cr.yE]),
112
- r[cr.dE],
113
- r[cr.uE],
114
- r[cr.fE],
115
- r[cr.CSS],
116
- r[cr.jE],
117
- r[cr.LANGUAGE],
118
- r[cr.Ns],
88
+ r[jr.UE],
89
+ r[jr.cE],
90
+ r[jr.Is],
91
+ r[jr.PE],
92
+ r[jr.iE],
93
+ r[jr.URI],
94
+ r[jr.pE],
95
+ r[jr.rE],
96
+ r[jr.mE],
97
+ r[jr.GE],
98
+ r[jr.Bs],
99
+ r[jr.xE],
100
+ r[jr.HE],
101
+ r[jr.FE],
102
+ r[jr.BE],
103
+ r[jr.bE],
104
+ r[jr.gE],
105
+ r[jr.lE],
106
+ r[jr.YE],
107
+ r[jr.hE],
108
+ r[jr.KE],
109
+ r[jr.WE],
110
+ r[jr.XE],
111
+ gr(r[jr.yE]),
112
+ r[jr.dE],
113
+ r[jr.uE],
114
+ r[jr.fE],
115
+ r[jr.CSS],
116
+ r[jr.jE],
117
+ r[jr.LANGUAGE],
118
+ r[jr.Ns],
119
119
  );
120
120
  }
121
121
  }