@braze/web-sdk 6.6.0 → 6.7.1

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 (152) hide show
  1. package/index.d.ts +253 -5
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +21 -20
  4. package/shared-lib/guid.js +3 -3
  5. package/shared-lib/indexed-db-adapter.js +70 -70
  6. package/shared-lib/logger.js +7 -7
  7. package/shared-lib/supported-options.js +26 -26
  8. package/src/Banner/banner-factory.js +11 -1
  9. package/src/Banner/banner-provider.js +244 -120
  10. package/src/Banner/banner.js +14 -12
  11. package/src/Banner/display/banner-to-html.js +23 -16
  12. package/src/Banner/display/detect-banner-impressions.js +13 -13
  13. package/src/Banner/get-all-banners.js +5 -5
  14. package/src/Banner/get-banner.js +4 -4
  15. package/src/Banner/log-banner-click.js +4 -4
  16. package/src/Banner/log-banner-dismissal.js +23 -0
  17. package/src/Banner/log-banner-impressions.js +7 -7
  18. package/src/Banner/request-banners-refresh.js +12 -16
  19. package/src/Banner/subscribe-to-banners-updates.js +6 -6
  20. package/src/Banner/ui/insert-banner.js +12 -12
  21. package/src/Card/card-manager-factory.js +5 -5
  22. package/src/Card/card-manager.js +33 -33
  23. package/src/Card/constants.js +1 -1
  24. package/src/Card/display/card-display.js +11 -11
  25. package/src/Card/log-card-dismissal.js +3 -3
  26. package/src/Card/log-content-card-click.js +3 -3
  27. package/src/Card/log-content-card-impressions.js +6 -6
  28. package/src/Card/models/captioned-image.js +21 -21
  29. package/src/Card/models/card.js +73 -73
  30. package/src/Card/models/classic-card.js +21 -21
  31. package/src/Card/models/control-card.js +11 -11
  32. package/src/Card/models/image-only.js +18 -18
  33. package/src/Card/util/card-factory.js +41 -41
  34. package/src/ContentCards/content-cards-provider-factory.js +12 -12
  35. package/src/ContentCards/content-cards-provider.js +151 -151
  36. package/src/ContentCards/content-cards.js +5 -5
  37. package/src/ContentCards/get-cached-content-cards.js +2 -2
  38. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  39. package/src/ContentCards/subscribe-to-content-cards-updates.js +6 -6
  40. package/src/ContentCards/ui/show-content-cards.js +10 -10
  41. package/src/Core/add-sdk-metadata.js +2 -2
  42. package/src/Core/change-user.js +6 -6
  43. package/src/Core/disable-sdk.js +9 -9
  44. package/src/Core/enable-sdk.js +5 -5
  45. package/src/Core/get-user.js +1 -1
  46. package/src/Core/handle-braze-action.js +3 -3
  47. package/src/Core/is-disabled.js +2 -2
  48. package/src/Core/log-custom-event.js +8 -8
  49. package/src/Core/log-purchase.js +5 -5
  50. package/src/Core/open-session.js +7 -7
  51. package/src/Core/set-sdk-authentication-signature.js +3 -3
  52. package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
  53. package/src/Core/wipe-data.js +6 -6
  54. package/src/DUST/dust-provider-factory.js +11 -11
  55. package/src/DUST/dust-provider.js +255 -255
  56. package/src/DUST/dust-shared-worker-impl.js +100 -100
  57. package/src/DUST/dust-worker-bridge.js +27 -27
  58. package/src/DUST/subscribe-to-dust.js +9 -9
  59. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  60. package/src/FeatureFlags/feature-flag.js +9 -9
  61. package/src/FeatureFlags/feature-flags-provider.js +86 -86
  62. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  63. package/src/FeatureFlags/get-feature-flag.js +2 -2
  64. package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
  65. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  66. package/src/InAppMessage/constants.js +83 -2
  67. package/src/InAppMessage/display/html-message-display-utils.js +15 -15
  68. package/src/InAppMessage/display/html-message-to-html.js +36 -37
  69. package/src/InAppMessage/display/in-app-message-to-html.js +44 -44
  70. package/src/InAppMessage/display/modal-utils.js +10 -14
  71. package/src/InAppMessage/in-app-message-factory.js +16 -20
  72. package/src/InAppMessage/in-app-message-manager.js +115 -116
  73. package/src/InAppMessage/log-in-app-message-button-click.js +8 -8
  74. package/src/InAppMessage/log-in-app-message-click.js +7 -7
  75. package/src/InAppMessage/log-in-app-message-html-click.js +8 -8
  76. package/src/InAppMessage/log-in-app-message-impression.js +5 -5
  77. package/src/InAppMessage/models/control-message.js +4 -4
  78. package/src/InAppMessage/models/full-screen-message.js +56 -49
  79. package/src/InAppMessage/models/html-message.js +31 -27
  80. package/src/InAppMessage/models/in-app-message-button.js +12 -12
  81. package/src/InAppMessage/models/in-app-message.js +202 -256
  82. package/src/InAppMessage/models/modal-message.js +55 -49
  83. package/src/InAppMessage/models/slide-up-message.js +57 -51
  84. package/src/InAppMessage/models/templated-in-app-message.js +10 -10
  85. package/src/InAppMessage/shared-types.js +1 -0
  86. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  87. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +5 -5
  88. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +3 -3
  89. package/src/InAppMessage/ui/show-in-app-message.js +43 -41
  90. package/src/Push/is-push-blocked.js +2 -2
  91. package/src/Push/is-push-permission-granted.js +2 -2
  92. package/src/Push/is-push-supported.js +2 -2
  93. package/src/Push/push-manager-factory.js +9 -9
  94. package/src/Push/push-manager.js +15 -15
  95. package/src/Push/utils/push-utils.js +15 -15
  96. package/src/User/user-manager.js +14 -14
  97. package/src/User/user.js +60 -59
  98. package/src/common/base-provider.js +1 -1
  99. package/src/common/constants.js +2 -1
  100. package/src/common/content-cards-display.js +38 -38
  101. package/src/common/event-logger.js +8 -8
  102. package/src/l10n/l10n-manager-factory.js +9 -9
  103. package/src/l10n/l10n-manager.js +2 -2
  104. package/src/managers/auth-manager.js +31 -31
  105. package/src/managers/braze-instance.js +197 -186
  106. package/src/managers/constants.js +1 -0
  107. package/src/managers/device-manager.js +25 -25
  108. package/src/managers/network-manager.js +155 -155
  109. package/src/managers/server-config-manager.js +106 -93
  110. package/src/managers/session-manager.js +37 -33
  111. package/src/managers/storage-manager-factory.js +33 -28
  112. package/src/managers/storage-manager.js +192 -170
  113. package/src/managers/subscription-manager.js +13 -13
  114. package/src/managers/utils.js +1 -1
  115. package/src/models/backend-errors.js +5 -5
  116. package/src/models/braze-event.js +13 -13
  117. package/src/models/device.js +3 -3
  118. package/src/models/identifier.js +12 -12
  119. package/src/models/push-token.js +9 -9
  120. package/src/models/request-result.js +4 -4
  121. package/src/models/server-config.js +29 -38
  122. package/src/request-controller.js +160 -164
  123. package/src/triggers/models/custom-event-data.js +7 -7
  124. package/src/triggers/models/custom-event-property-data.js +10 -10
  125. package/src/triggers/models/filter-set.js +12 -12
  126. package/src/triggers/models/filter.js +66 -66
  127. package/src/triggers/models/in-app-message-click-data.js +13 -13
  128. package/src/triggers/models/purchase-data.js +4 -4
  129. package/src/triggers/models/purchase-property-data.js +10 -10
  130. package/src/triggers/models/push-click-data.js +8 -8
  131. package/src/triggers/models/trigger-condition.js +58 -58
  132. package/src/triggers/models/trigger-events.js +3 -3
  133. package/src/triggers/models/trigger.js +44 -44
  134. package/src/triggers/triggers-provider-factory.js +5 -5
  135. package/src/triggers/triggers-provider.js +70 -70
  136. package/src/ui/js/attach-css.js +3 -3
  137. package/src/ui/js/feed-css.js +2 -2
  138. package/src/ui/js/iam-css.js +2 -2
  139. package/src/ui/js/load-font-awesome.js +2 -2
  140. package/src/util/base-device-parser.js +9 -9
  141. package/src/util/braze-actions.js +3 -3
  142. package/src/util/browser-detector.js +37 -37
  143. package/src/util/client-hints-parser.js +9 -9
  144. package/src/util/component-utils.js +3 -3
  145. package/src/util/dom-utils.js +2 -2
  146. package/src/util/html-display-utils.js +11 -11
  147. package/src/util/key-codes.js +1 -1
  148. package/src/util/net.js +8 -8
  149. package/src/util/request-header-utils.js +25 -25
  150. package/src/util/user-agent-parser.js +20 -20
  151. package/src/util/validation-utils.js +21 -21
  152. package/src/util/window-utils.js +3 -3
@@ -1,102 +1,102 @@
1
1
  import { isDate as Nt } from "../../util/code-utils.js";
2
2
  import {
3
3
  convertMsToSeconds as X,
4
- dateFromUnixTimestamp as V,
5
- secondsAgo as es,
6
- secondsInTheFuture as hs,
4
+ dateFromUnixTimestamp as Y,
5
+ secondsAgo as hs,
6
+ secondsInTheFuture as us,
7
7
  } from "../../util/date-utils.js";
8
- export default class cr {
8
+ export default class hr {
9
9
  constructor(t, s, e, i) {
10
- (this.yE = t),
11
- (this.HE = s),
10
+ (this.tT = t),
11
+ (this.sT = s),
12
12
  (this.comparator = e),
13
- (this.LE = i),
14
- (this.yE = t),
15
- (this.HE = s),
13
+ (this.eT = i),
14
+ (this.tT = t),
15
+ (this.sT = s),
16
16
  (this.comparator = e),
17
- (this.LE = i),
18
- this.HE === cr.XE.QE &&
19
- this.comparator !== cr.BE.wE &&
20
- this.comparator !== cr.BE.jE &&
21
- this.comparator !== cr.BE.zE &&
22
- this.comparator !== cr.BE.FE &&
23
- (this.LE = V(this.LE));
17
+ (this.eT = i),
18
+ this.sT === hr.lT.iT &&
19
+ this.comparator !== hr.hT.rT &&
20
+ this.comparator !== hr.hT.nT &&
21
+ this.comparator !== hr.hT.uT &&
22
+ this.comparator !== hr.hT.oT &&
23
+ (this.eT = Y(this.eT));
24
24
  }
25
- sf(t) {
25
+ Hc(t) {
26
26
  let s = null;
27
- switch ((null != t && (s = t[this.yE]), this.comparator)) {
28
- case cr.BE.kE:
29
- return null != s && s.valueOf() === this.LE.valueOf();
30
- case cr.BE.xE:
31
- return null == s || s.valueOf() !== this.LE.valueOf();
32
- case cr.BE.JE:
33
- return null != s && typeof s == typeof this.LE && s > this.LE;
34
- case cr.BE.wE:
35
- return this.HE === cr.XE.QE
36
- ? null != s && Nt(s) && es(s) <= this.LE.valueOf()
37
- : null != s && typeof s == typeof this.LE && s >= this.LE;
38
- case cr.BE.VE:
39
- return null != s && typeof s == typeof this.LE && s < this.LE;
40
- case cr.BE.jE:
41
- return this.HE === cr.XE.QE
42
- ? null != s && Nt(s) && es(s) >= this.LE.valueOf()
43
- : null != s && typeof s == typeof this.LE && s <= this.LE;
44
- case cr.BE.qE:
27
+ switch ((null != t && (s = t[this.tT]), this.comparator)) {
28
+ case hr.hT.ET:
29
+ return null != s && s.valueOf() === this.eT.valueOf();
30
+ case hr.hT.aT:
31
+ return null == s || s.valueOf() !== this.eT.valueOf();
32
+ case hr.hT.TT:
33
+ return null != s && typeof s == typeof this.eT && s > this.eT;
34
+ case hr.hT.rT:
35
+ return this.sT === hr.lT.iT
36
+ ? null != s && Nt(s) && hs(s) <= this.eT.valueOf()
37
+ : null != s && typeof s == typeof this.eT && s >= this.eT;
38
+ case hr.hT.cT:
39
+ return null != s && typeof s == typeof this.eT && s < this.eT;
40
+ case hr.hT.nT:
41
+ return this.sT === hr.lT.iT
42
+ ? null != s && Nt(s) && hs(s) >= this.eT.valueOf()
43
+ : null != s && typeof s == typeof this.eT && s <= this.eT;
44
+ case hr.hT.AT:
45
45
  return (
46
46
  null != s &&
47
47
  "string" == typeof s &&
48
- typeof s == typeof this.LE &&
49
- null != s.match(this.LE)
48
+ typeof s == typeof this.eT &&
49
+ null != s.match(this.eT)
50
50
  );
51
- case cr.BE.PE:
51
+ case hr.hT._T:
52
52
  return null != s;
53
- case cr.BE.WE:
53
+ case hr.hT.fT:
54
54
  return null == s;
55
- case cr.BE.zE:
56
- return null != s && Nt(s) && hs(s) < this.LE;
57
- case cr.BE.FE:
58
- return null != s && Nt(s) && hs(s) > this.LE;
59
- case cr.BE.ZE:
55
+ case hr.hT.uT:
56
+ return null != s && Nt(s) && us(s) < this.eT;
57
+ case hr.hT.oT:
58
+ return null != s && Nt(s) && us(s) > this.eT;
59
+ case hr.hT.pT:
60
60
  return (
61
61
  null == s ||
62
- typeof s != typeof this.LE ||
62
+ typeof s != typeof this.eT ||
63
63
  "string" != typeof s ||
64
- null == s.match(this.LE)
64
+ null == s.match(this.eT)
65
65
  );
66
66
  }
67
67
  return !1;
68
68
  }
69
69
  static fromJson(t) {
70
- return new cr(
70
+ return new hr(
71
71
  t.property_key,
72
72
  t.property_type,
73
73
  t.comparator,
74
74
  t.property_value,
75
75
  );
76
76
  }
77
- gt() {
78
- let t = this.LE;
77
+ qt() {
78
+ let t = this.eT;
79
79
  return (
80
- Nt(this.LE) && (t = X(t.valueOf())),
81
- { k: this.yE, t: this.HE, c: this.comparator, v: t }
80
+ Nt(this.eT) && (t = X(t.valueOf())),
81
+ { k: this.tT, t: this.sT, c: this.comparator, v: t }
82
82
  );
83
83
  }
84
84
  static _u(t) {
85
- return new cr(t.k, t.t, t.c, t.v);
85
+ return new hr(t.k, t.t, t.c, t.v);
86
86
  }
87
87
  }
88
- (cr.XE = { $E: "boolean", tT: "number", sT: "string", QE: "date" }),
89
- (cr.BE = {
90
- kE: 1,
91
- xE: 2,
92
- JE: 3,
93
- wE: 4,
94
- VE: 5,
95
- jE: 6,
96
- qE: 10,
97
- PE: 11,
98
- WE: 12,
99
- zE: 15,
100
- FE: 16,
101
- ZE: 17,
88
+ (hr.lT = { yT: "boolean", ST: "number", NT: "string", iT: "date" }),
89
+ (hr.hT = {
90
+ ET: 1,
91
+ aT: 2,
92
+ TT: 3,
93
+ rT: 4,
94
+ cT: 5,
95
+ nT: 6,
96
+ AT: 10,
97
+ _T: 11,
98
+ fT: 12,
99
+ uT: 15,
100
+ oT: 16,
101
+ pT: 17,
102
102
  });
@@ -1,25 +1,25 @@
1
- import fi from "./trigger-condition.js";
2
- export default class mi {
1
+ import gi from "./trigger-condition.js";
2
+ export default class pi {
3
3
  constructor(t, i) {
4
- (this.rf = t), (this.nf = i), (this.rf = t), (this.nf = i);
4
+ (this.if = t), (this.rf = i), (this.if = t), (this.rf = i);
5
5
  }
6
- sf(t) {
7
- if (null == this.rf) return !1;
8
- const i = fi.ef(t[0], this.rf);
6
+ Hc(t) {
7
+ if (null == this.if) return !1;
8
+ const i = gi.sf(t[0], this.if);
9
9
  if (!i) return !1;
10
- let r = null == this.nf || 0 === this.nf.length;
11
- if (null != this.nf)
12
- for (let i = 0; i < this.nf.length; i++)
13
- if (this.nf[i] === t[1]) {
10
+ let r = null == this.rf || 0 === this.rf.length;
11
+ if (null != this.rf)
12
+ for (let i = 0; i < this.rf.length; i++)
13
+ if (this.rf[i] === t[1]) {
14
14
  r = !0;
15
15
  break;
16
16
  }
17
17
  return i && r;
18
18
  }
19
19
  static fromJson(t) {
20
- return new mi(t ? t.id : null, t ? t.buttons : null);
20
+ return new pi(t ? t.id : null, t ? t.buttons : null);
21
21
  }
22
- gt() {
23
- return this.rf;
22
+ qt() {
23
+ return this.if;
24
24
  }
25
25
  }
@@ -1,14 +1,14 @@
1
- export default class ns {
1
+ export default class os {
2
2
  constructor(t) {
3
3
  (this.productId = t), (this.productId = t);
4
4
  }
5
- sf(t) {
5
+ Hc(t) {
6
6
  return null == this.productId || t[0] === this.productId;
7
7
  }
8
8
  static fromJson(t) {
9
- return new ns(t ? t.product_id : null);
9
+ return new os(t ? t.product_id : null);
10
10
  }
11
- gt() {
11
+ qt() {
12
12
  return this.productId;
13
13
  }
14
14
  }
@@ -1,21 +1,21 @@
1
- import is from "./filter-set.js";
2
- export default class us {
1
+ import ls from "./filter-set.js";
2
+ export default class fs {
3
3
  constructor(t, s) {
4
- (this.productId = t), (this.if = s), (this.productId = t), (this.if = s);
4
+ (this.productId = t), (this.tf = s), (this.productId = t), (this.tf = s);
5
5
  }
6
- sf(t) {
7
- if (null == this.productId || null == this.if) return !1;
6
+ Hc(t) {
7
+ if (null == this.productId || null == this.tf) return !1;
8
8
  const s = t[0],
9
9
  i = t[1];
10
- return s === this.productId && this.if.sf(i);
10
+ return s === this.productId && this.tf.Hc(i);
11
11
  }
12
12
  static fromJson(t) {
13
- return new us(
13
+ return new fs(
14
14
  t ? t.product_id : null,
15
- t ? is.fromJson(t.property_filters) : null,
15
+ t ? ls.fromJson(t.property_filters) : null,
16
16
  );
17
17
  }
18
- gt() {
19
- return { id: this.productId, pf: this.if ? this.if.gt() : null };
18
+ qt() {
19
+ return { id: this.productId, pf: this.tf ? this.tf.qt() : null };
20
20
  }
21
21
  }
@@ -1,15 +1,15 @@
1
- import fi from "./trigger-condition.js";
2
- export default class ur {
1
+ import gi from "./trigger-condition.js";
2
+ export default class dr {
3
3
  constructor(t) {
4
- (this.rf = t), (this.rf = t);
4
+ (this.if = t), (this.if = t);
5
5
  }
6
- sf(t) {
7
- return null == this.rf || fi.ef(t[0], this.rf);
6
+ Hc(t) {
7
+ return null == this.if || gi.sf(t[0], this.if);
8
8
  }
9
9
  static fromJson(t) {
10
- return new ur(t ? t.campaign_id : null);
10
+ return new dr(t ? t.campaign_id : null);
11
11
  }
12
- gt() {
13
- return this.rf;
12
+ qt() {
13
+ return this.if;
14
14
  }
15
15
  }
@@ -1,21 +1,21 @@
1
- import rs from "./custom-event-data.js";
2
- import ls from "./custom-event-property-data.js";
3
- import is from "./filter-set.js";
4
- import mi from "./in-app-message-click-data.js";
5
- import ns from "./purchase-data.js";
6
- import us from "./purchase-property-data.js";
7
- import ur from "./push-click-data.js";
1
+ import es from "./custom-event-data.js";
2
+ import ns from "./custom-event-property-data.js";
3
+ import ls from "./filter-set.js";
4
+ import pi from "./in-app-message-click-data.js";
5
+ import os from "./purchase-data.js";
6
+ import fs from "./purchase-property-data.js";
7
+ import dr from "./push-click-data.js";
8
8
  import ot from "./trigger-events.js";
9
9
  import { logger as E } from "../../../shared-lib/index.js";
10
10
  import { getErrorMessage as ai } from "../../util/error-utils.js";
11
- export default class fi {
11
+ export default class gi {
12
12
  constructor(e, t) {
13
13
  (this.type = e), (this.data = t), (this.type = e), (this.data = t);
14
14
  }
15
- km(e, t) {
16
- return fi._m[this.type] === e && (null == this.data || this.data.sf(t));
15
+ Vc(e, t) {
16
+ return gi.Yc[this.type] === e && (null == this.data || this.data.Hc(t));
17
17
  }
18
- static ef(e, t) {
18
+ static sf(e, t) {
19
19
  let r = null;
20
20
  try {
21
21
  r = window.atob(e);
@@ -28,76 +28,76 @@ export default class fi {
28
28
  const t = e.type;
29
29
  let r = null;
30
30
  switch (t) {
31
- case fi.Qn.OPEN:
32
- case fi.Qn.qs:
31
+ case gi.la.OPEN:
32
+ case gi.la.Ls:
33
33
  break;
34
- case fi.Qn.Rr:
35
- r = ns.fromJson(e.data);
34
+ case gi.la.Rr:
35
+ r = os.fromJson(e.data);
36
36
  break;
37
- case fi.Qn.bm:
38
- r = us.fromJson(e.data);
37
+ case gi.la.Qc:
38
+ r = fs.fromJson(e.data);
39
39
  break;
40
- case fi.Qn.wr:
41
- r = ur.fromJson(e.data);
40
+ case gi.la.Fr:
41
+ r = dr.fromJson(e.data);
42
42
  break;
43
- case fi.Qn.xe:
44
- r = rs.fromJson(e.data);
43
+ case gi.la.he:
44
+ r = es.fromJson(e.data);
45
45
  break;
46
- case fi.Qn.Em:
47
- r = ls.fromJson(e.data);
46
+ case gi.la.Xc:
47
+ r = ns.fromJson(e.data);
48
48
  break;
49
- case fi.Qn.rm:
50
- r = mi.fromJson(e.data);
49
+ case gi.la.rm:
50
+ r = pi.fromJson(e.data);
51
51
  }
52
- return new fi(t, r);
52
+ return new gi(t, r);
53
53
  }
54
- gt() {
55
- return { t: this.type, d: this.data ? this.data.gt() : null };
54
+ qt() {
55
+ return { t: this.type, d: this.data ? this.data.qt() : null };
56
56
  }
57
57
  static _u(e) {
58
58
  let t,
59
59
  r = null;
60
60
  switch (e.t) {
61
- case fi.Qn.OPEN:
62
- case fi.Qn.qs:
61
+ case gi.la.OPEN:
62
+ case gi.la.Ls:
63
63
  break;
64
- case fi.Qn.Rr:
65
- r = new ns(e.d);
64
+ case gi.la.Rr:
65
+ r = new os(e.d);
66
66
  break;
67
- case fi.Qn.bm:
68
- (t = e.d || {}), (r = new us(t.id, is._u(t.pf || [])));
67
+ case gi.la.Qc:
68
+ (t = e.d || {}), (r = new fs(t.id, ls._u(t.pf || [])));
69
69
  break;
70
- case fi.Qn.wr:
71
- r = new ur(e.d);
70
+ case gi.la.Fr:
71
+ r = new dr(e.d);
72
72
  break;
73
- case fi.Qn.xe:
74
- r = new rs(e.d);
73
+ case gi.la.he:
74
+ r = new es(e.d);
75
75
  break;
76
- case fi.Qn.Em:
77
- (t = e.d || {}), (r = new ls(t.e, is._u(t.pf || [])));
76
+ case gi.la.Xc:
77
+ (t = e.d || {}), (r = new ns(t.e, ls._u(t.pf || [])));
78
78
  break;
79
- case fi.Qn.rm:
80
- r = new mi(e.d);
79
+ case gi.la.rm:
80
+ r = new pi(e.d);
81
81
  }
82
- return new fi(e.t, r);
82
+ return new gi(e.t, r);
83
83
  }
84
84
  }
85
- (fi.Qn = {
85
+ (gi.la = {
86
86
  OPEN: "open",
87
87
  Rr: "purchase",
88
- bm: "purchase_property",
89
- wr: "push_click",
90
- xe: "custom_event",
91
- Em: "custom_event_property",
88
+ Qc: "purchase_property",
89
+ Fr: "push_click",
90
+ he: "custom_event",
91
+ Xc: "custom_event_property",
92
92
  rm: "iam_click",
93
- qs: "test",
93
+ Ls: "test",
94
94
  }),
95
- (fi._m = {}),
96
- (fi._m[fi.Qn.OPEN] = ot.OPEN),
97
- (fi._m[fi.Qn.Rr] = ot.Rr),
98
- (fi._m[fi.Qn.bm] = ot.Rr),
99
- (fi._m[fi.Qn.wr] = ot.wr),
100
- (fi._m[fi.Qn.xe] = ot.xe),
101
- (fi._m[fi.Qn.Em] = ot.xe),
102
- (fi._m[fi.Qn.rm] = ot.rm),
103
- (fi._m[fi.Qn.qs] = ot.qs);
95
+ (gi.Yc = {}),
96
+ (gi.Yc[gi.la.OPEN] = ot.OPEN),
97
+ (gi.Yc[gi.la.Rr] = ot.Rr),
98
+ (gi.Yc[gi.la.Qc] = ot.Rr),
99
+ (gi.Yc[gi.la.Fr] = ot.Fr),
100
+ (gi.Yc[gi.la.he] = ot.he),
101
+ (gi.Yc[gi.la.Xc] = ot.he),
102
+ (gi.Yc[gi.la.rm] = ot.rm),
103
+ (gi.Yc[gi.la.Ls] = ot.Ls);
@@ -1,8 +1,8 @@
1
1
  export default {
2
2
  OPEN: "open",
3
3
  Rr: "purchase",
4
- wr: "push_click",
5
- xe: "custom_event",
4
+ Fr: "push_click",
5
+ he: "custom_event",
6
6
  rm: "iam_click",
7
- qs: "test",
7
+ Ls: "test",
8
8
  };
@@ -1,59 +1,59 @@
1
1
  import {
2
- dateFromUnixTimestamp as V,
3
- rehydrateDateAfterJsonization as Y,
2
+ dateFromUnixTimestamp as Y,
3
+ rehydrateDateAfterJsonization as ee,
4
4
  } from "../../util/date-utils.js";
5
5
  import { logger as E } from "../../../shared-lib/index.js";
6
- import fi from "./trigger-condition.js";
6
+ import gi from "./trigger-condition.js";
7
7
  import { validateValueIsFromEnum as ta } from "../../util/code-utils.js";
8
- export default class pt {
9
- constructor(t, i = [], s, e, r = 0, h, l, o = 0, n = pt.Td, a, u, d) {
8
+ export default class gt {
9
+ constructor(t, i = [], s, e, r = 0, h, l, o = 0, n = gt.sd, a, u, d) {
10
10
  (this.id = t),
11
- (this.Pd = i),
11
+ (this.ed = i),
12
12
  (this.startTime = s),
13
13
  (this.endTime = e),
14
14
  (this.priority = r),
15
15
  (this.type = h),
16
16
  (this.data = l),
17
- (this.Ed = o),
18
- (this.Nd = n),
19
- (this.Wn = a),
20
- (this._d = u),
21
- (this.Id = d),
17
+ (this.hd = o),
18
+ (this.nd = n),
19
+ (this.ca = a),
20
+ (this.ad = u),
21
+ (this.ud = d),
22
22
  (this.id = t),
23
- (this.Pd = i || []),
23
+ (this.ed = i || []),
24
24
  void 0 === s && (s = null),
25
25
  (this.startTime = s),
26
26
  void 0 === e && (e = null),
27
27
  (this.endTime = e),
28
28
  (this.priority = r || 0),
29
29
  (this.type = h),
30
- (this.Ed = o || 0),
31
- null == a && (a = 1e3 * (this.Ed + 30)),
32
- (this.Wn = a),
30
+ (this.hd = o || 0),
31
+ null == a && (a = 1e3 * (this.hd + 30)),
32
+ (this.ca = a),
33
33
  (this.data = l),
34
- null != n && (this.Nd = n),
35
- (this._d = u),
36
- (this.Id = d || null);
34
+ null != n && (this.nd = n),
35
+ (this.ad = u),
36
+ (this.ud = d || null);
37
37
  }
38
- xd(t) {
38
+ dd(t) {
39
39
  return (
40
- null == this.Id || (this.Nd !== pt.Td && t - this.Id >= 1e3 * this.Nd)
40
+ null == this.ud || (this.nd !== gt.sd && t - this.ud >= 1e3 * this.nd)
41
41
  );
42
42
  }
43
- zd(t) {
44
- this.Id = t;
43
+ md(t) {
44
+ this.ud = t;
45
45
  }
46
- Md(t) {
47
- const i = t + 1e3 * this.Ed;
46
+ gd(t) {
47
+ const i = t + 1e3 * this.hd;
48
48
  return Math.max(i - new Date().valueOf(), 0);
49
49
  }
50
- Bd(t) {
50
+ fd(t) {
51
51
  const i = new Date().valueOf() - t,
52
- s = null == t || isNaN(i) || null == this.Wn || i < this.Wn;
52
+ s = null == t || isNaN(i) || null == this.ca || i < this.ca;
53
53
  return (
54
54
  s ||
55
55
  E.info(
56
- `Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.Wn}ms.`,
56
+ `Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.ca}ms.`,
57
57
  ),
58
58
  !s
59
59
  );
@@ -62,9 +62,9 @@ export default class pt {
62
62
  const i = t.id,
63
63
  s = [];
64
64
  for (let i = 0; i < t.trigger_condition.length; i++)
65
- s.push(fi.fromJson(t.trigger_condition[i]));
66
- const e = V(t.start_time),
67
- r = V(t.end_time),
65
+ s.push(gi.fromJson(t.trigger_condition[i]));
66
+ const e = Y(t.start_time),
67
+ r = Y(t.end_time),
68
68
  h = t.priority,
69
69
  l = t.type,
70
70
  o = t.delay,
@@ -73,17 +73,17 @@ export default class pt {
73
73
  u = t.data,
74
74
  d = t.min_seconds_since_last_trigger;
75
75
  return ta(
76
- pt.Qn,
76
+ gt.la,
77
77
  l,
78
78
  "Could not construct Trigger from server data",
79
79
  "Trigger.Types",
80
80
  )
81
- ? new pt(i, s, e, r, h, l, u, o, n, a, d)
81
+ ? new gt(i, s, e, r, h, l, u, o, n, a, d)
82
82
  : null;
83
83
  }
84
- gt() {
84
+ qt() {
85
85
  const t = [];
86
- for (let i = 0; i < this.Pd.length; i++) t.push(this.Pd[i].gt());
86
+ for (let i = 0; i < this.ed.length; i++) t.push(this.ed[i].qt());
87
87
  return {
88
88
  i: this.id,
89
89
  c: t,
@@ -92,22 +92,22 @@ export default class pt {
92
92
  p: this.priority,
93
93
  t: this.type,
94
94
  da: this.data,
95
- d: this.Ed,
96
- r: this.Nd,
97
- tm: this.Wn,
98
- ss: this._d,
99
- ld: this.Id,
95
+ d: this.hd,
96
+ r: this.nd,
97
+ tm: this.ca,
98
+ ss: this.ad,
99
+ ld: this.ud,
100
100
  };
101
101
  }
102
102
  static _u(t) {
103
103
  const i = [],
104
104
  s = t.c || [];
105
- for (let t = 0; t < s.length; t++) i.push(fi._u(s[t]));
106
- return new pt(
105
+ for (let t = 0; t < s.length; t++) i.push(gi._u(s[t]));
106
+ return new gt(
107
107
  t.i,
108
108
  i,
109
- Y(t.s),
110
- Y(t.e),
109
+ ee(t.s),
110
+ ee(t.e),
111
111
  t.p,
112
112
  t.t,
113
113
  t.da,
@@ -119,4 +119,4 @@ export default class pt {
119
119
  );
120
120
  }
121
121
  }
122
- (pt.Qn = { Ln: "inapp", Cd: "templated_iam" }), (pt.Td = -1);
122
+ (gt.la = { oa: "inapp", pd: "templated_iam" }), (gt.sd = -1);
@@ -1,6 +1,6 @@
1
1
  import je from "../InAppMessage/in-app-message-manager-factory.js";
2
- import r, { OPTIONS as D } from "../managers/braze-instance.js";
3
- import gr from "./triggers-provider.js";
2
+ import r, { OPTIONS as U } from "../managers/braze-instance.js";
3
+ import vr from "./triggers-provider.js";
4
4
  export const TriggersProviderFactory = {
5
5
  i: !1,
6
6
  provider: null,
@@ -11,10 +11,10 @@ export const TriggersProviderFactory = {
11
11
  ),
12
12
  rg: () => {
13
13
  if (!TriggersProviderFactory.provider) {
14
- const i = r.re(D.Xh);
15
- (TriggersProviderFactory.provider = new gr(
14
+ const i = r.er(U.Dh);
15
+ (TriggersProviderFactory.provider = new vr(
16
16
  null != i ? i : 30,
17
- je.ra().Tn(),
17
+ je.ra().Pn(),
18
18
  r.p(),
19
19
  r.nn(),
20
20
  je.ra(),