@braze/web-sdk 4.2.1 → 4.4.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 (178) hide show
  1. package/index.d.ts +57 -6
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +8 -1
  4. package/shared-lib/encoding-utils.js +12 -1
  5. package/shared-lib/event-types.js +32 -1
  6. package/shared-lib/guid.js +10 -1
  7. package/shared-lib/indexed-db-adapter.js +315 -1
  8. package/shared-lib/logger.js +38 -1
  9. package/shared-lib/supported-options.js +26 -1
  10. package/src/Card/card-manager-factory.js +14 -1
  11. package/src/Card/card-manager.js +72 -1
  12. package/src/Card/display/card-display.js +134 -1
  13. package/src/Card/index.js +5 -1
  14. package/src/Card/log-card-click.js +11 -1
  15. package/src/Card/log-card-dismissal.js +11 -1
  16. package/src/Card/log-card-impressions.js +13 -1
  17. package/src/Card/log-content-card-impressions.js +4 -1
  18. package/src/Card/models/banner.js +30 -1
  19. package/src/Card/models/captioned-image.js +32 -1
  20. package/src/Card/models/card.js +174 -1
  21. package/src/Card/models/classic-card.js +32 -1
  22. package/src/Card/models/control-card.js +38 -1
  23. package/src/Card/models/index.js +5 -1
  24. package/src/Card/util/card-factory.js +104 -1
  25. package/src/ContentCards/content-cards-provider-factory.js +20 -1
  26. package/src/ContentCards/content-cards-provider.js +283 -1
  27. package/src/ContentCards/content-cards.js +24 -1
  28. package/src/ContentCards/get-cached-content-cards.js +5 -1
  29. package/src/ContentCards/index.js +8 -1
  30. package/src/ContentCards/log-content-cards-displayed.js +5 -1
  31. package/src/ContentCards/request-content-cards-refresh.js +5 -1
  32. package/src/ContentCards/subscribe-to-content-cards-updates.js +14 -1
  33. package/src/ContentCards/ui/hide-content-cards.js +8 -1
  34. package/src/ContentCards/ui/show-content-cards.js +72 -1
  35. package/src/ContentCards/ui/toggle-content-cards.js +8 -1
  36. package/src/Core/add-sdk-metadata.js +27 -1
  37. package/src/Core/braze-sdk-metadata.js +10 -1
  38. package/src/Core/change-user.js +19 -1
  39. package/src/Core/destroy.js +5 -1
  40. package/src/Core/device-properties.js +9 -1
  41. package/src/Core/disable-sdk.js +10 -1
  42. package/src/Core/enable-sdk.js +8 -1
  43. package/src/Core/get-device-id.js +10 -1
  44. package/src/Core/get-user.js +4 -1
  45. package/src/Core/handle-braze-action.js +64 -1
  46. package/src/Core/index.js +23 -1
  47. package/src/Core/initialize.js +4 -1
  48. package/src/Core/is-disabled.js +4 -1
  49. package/src/Core/log-custom-event.js +36 -1
  50. package/src/Core/log-purchase.js +245 -1
  51. package/src/Core/open-session.js +23 -1
  52. package/src/Core/remove-all-subscriptions.js +4 -1
  53. package/src/Core/remove-subscription.js +4 -1
  54. package/src/Core/request-immediate-data-flush.js +4 -1
  55. package/src/Core/set-logger.js +4 -1
  56. package/src/Core/set-sdk-authentication-signature.js +9 -1
  57. package/src/Core/subscribe-to-sdk-authentication-failures.js +4 -1
  58. package/src/Core/toggle-logging.js +4 -1
  59. package/src/Core/wipe-data.js +15 -1
  60. package/src/FeatureFlags/feature-flag-factory.js +14 -0
  61. package/src/FeatureFlags/feature-flag.js +16 -0
  62. package/src/FeatureFlags/feature-flags-provider-factory.js +19 -0
  63. package/src/FeatureFlags/feature-flags-provider.js +94 -0
  64. package/src/FeatureFlags/get-all-feature-flags.js +12 -0
  65. package/src/FeatureFlags/get-feature-flag.js +12 -0
  66. package/src/FeatureFlags/index.js +4 -0
  67. package/src/FeatureFlags/refresh-feature-flags.js +9 -0
  68. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +6 -0
  69. package/src/Feed/feed-provider-factory.js +18 -1
  70. package/src/Feed/feed-provider.js +79 -1
  71. package/src/Feed/feed.js +20 -1
  72. package/src/Feed/get-cached-feed.js +5 -1
  73. package/src/Feed/index.js +8 -1
  74. package/src/Feed/log-feed-displayed.js +5 -1
  75. package/src/Feed/request-feed-refresh.js +5 -1
  76. package/src/Feed/subscribe-to-feed-updates.js +5 -1
  77. package/src/Feed/ui/hide-feed.js +7 -1
  78. package/src/Feed/ui/show-feed.js +89 -1
  79. package/src/Feed/ui/toggle-feed.js +8 -1
  80. package/src/InAppMessage/display/get-animation-effect.js +19 -1
  81. package/src/InAppMessage/display/html-message-to-html.js +223 -1
  82. package/src/InAppMessage/display/in-app-message-to-html.js +152 -1
  83. package/src/InAppMessage/display/modal-utils.js +68 -1
  84. package/src/InAppMessage/in-app-message-factory.js +145 -1
  85. package/src/InAppMessage/in-app-message-manager-factory.js +16 -1
  86. package/src/InAppMessage/in-app-message-manager.js +189 -1
  87. package/src/InAppMessage/index.js +14 -1
  88. package/src/InAppMessage/log-in-app-message-button-click.js +19 -1
  89. package/src/InAppMessage/log-in-app-message-click.js +16 -1
  90. package/src/InAppMessage/log-in-app-message-html-click.js +23 -1
  91. package/src/InAppMessage/log-in-app-message-impression.js +13 -1
  92. package/src/InAppMessage/models/control-message.js +8 -1
  93. package/src/InAppMessage/models/full-screen-message.js +71 -1
  94. package/src/InAppMessage/models/html-message.js +54 -1
  95. package/src/InAppMessage/models/in-app-message-button.js +40 -1
  96. package/src/InAppMessage/models/in-app-message.js +267 -1
  97. package/src/InAppMessage/models/modal-message.js +68 -1
  98. package/src/InAppMessage/models/slide-up-message.js +58 -1
  99. package/src/InAppMessage/models/templated-in-app-message.js +14 -1
  100. package/src/InAppMessage/subscribe-to-in-app-message.js +10 -1
  101. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +15 -1
  102. package/src/InAppMessage/ui/show-in-app-message.js +170 -1
  103. package/src/Push/index.js +5 -1
  104. package/src/Push/is-push-blocked.js +5 -1
  105. package/src/Push/is-push-permission-granted.js +5 -1
  106. package/src/Push/is-push-supported.js +5 -1
  107. package/src/Push/push-manager-factory.js +30 -1
  108. package/src/Push/push-manager.js +360 -1
  109. package/src/Push/request-push-permission.js +8 -1
  110. package/src/Push/unregister-push.js +5 -1
  111. package/src/Push/utils/push-utils.js +34 -1
  112. package/src/User/index.js +1 -1
  113. package/src/User/user-manager.js +70 -1
  114. package/src/User/user.js +278 -1
  115. package/src/common/base-feed.js +25 -1
  116. package/src/common/base-provider.js +6 -1
  117. package/src/common/constants.js +5 -1
  118. package/src/common/event-logger.js +24 -1
  119. package/src/common/feed-display.js +200 -1
  120. package/src/common/translations.js +148 -1
  121. package/src/index.js +9 -1
  122. package/src/l10n/l10n-manager-factory.js +22 -1
  123. package/src/l10n/l10n-manager.js +21 -1
  124. package/src/managers/auth-manager.js +48 -1
  125. package/src/managers/braze-instance.js +307 -1
  126. package/src/managers/device-manager.js +80 -1
  127. package/src/managers/network-manager.js +219 -1
  128. package/src/managers/server-config-manager.js +88 -1
  129. package/src/managers/session-manager.js +68 -1
  130. package/src/managers/storage-manager-factory.js +35 -1
  131. package/src/managers/storage-manager.js +394 -1
  132. package/src/managers/subscription-manager.js +25 -1
  133. package/src/models/backend-errors.js +8 -1
  134. package/src/models/braze-event.js +41 -1
  135. package/src/models/braze-sdk-metadata.js +10 -1
  136. package/src/models/device.js +26 -1
  137. package/src/models/identifier.js +20 -1
  138. package/src/models/push-token.js +22 -1
  139. package/src/models/request-result.js +8 -1
  140. package/src/models/server-config.js +32 -1
  141. package/src/request-controller.js +288 -1
  142. package/src/triggers/models/custom-event-data.js +14 -1
  143. package/src/triggers/models/custom-event-property-data.js +21 -1
  144. package/src/triggers/models/filter-set.js +55 -1
  145. package/src/triggers/models/filter.js +98 -1
  146. package/src/triggers/models/in-app-message-click-data.js +25 -1
  147. package/src/triggers/models/purchase-data.js +14 -1
  148. package/src/triggers/models/purchase-property-data.js +21 -1
  149. package/src/triggers/models/push-click-data.js +15 -1
  150. package/src/triggers/models/trigger-condition.js +109 -1
  151. package/src/triggers/models/trigger-events.js +8 -1
  152. package/src/triggers/models/trigger.js +110 -1
  153. package/src/triggers/triggers-provider-factory.js +30 -1
  154. package/src/triggers/triggers-provider.js +307 -1
  155. package/src/ui/js/attach-css.js +12 -1
  156. package/src/ui/js/feed-css.js +12 -1
  157. package/src/ui/js/iam-css.js +12 -1
  158. package/src/ui/js/index.js +3 -1
  159. package/src/ui/js/load-font-awesome.js +13 -1
  160. package/src/util/base-device-parser.js +14 -1
  161. package/src/util/braze-actions.js +79 -1
  162. package/src/util/browser-detector.js +85 -1
  163. package/src/util/client-hints-parser.js +60 -1
  164. package/src/util/code-utils.js +92 -1
  165. package/src/util/color-utils.js +23 -1
  166. package/src/util/component-utils.js +26 -1
  167. package/src/util/date-utils.js +27 -1
  168. package/src/util/deprecation-utils.js +5 -1
  169. package/src/util/device-constants.js +14 -1
  170. package/src/util/dom-utils.js +87 -1
  171. package/src/util/key-codes.js +1 -1
  172. package/src/util/math.js +5 -1
  173. package/src/util/net.js +75 -1
  174. package/src/util/string-utils.js +22 -1
  175. package/src/util/url-utils.js +23 -1
  176. package/src/util/user-agent-parser.js +85 -1
  177. package/src/util/validation-utils.js +136 -1
  178. package/src/util/window-utils.js +35 -1
@@ -1 +1,21 @@
1
- import Bt from"./filter-set.js";export default class Qt{constructor(t,s){this.productId=t,this.Bl=s}zl(t){if(null==this.productId||null==this.Bl)return!1;const s=t[0],i=t[1];return s===this.productId&&this.Bl.zl(i)}static fromJson(t){return new Qt(t?t.product_id:null,t?Bt.fromJson(t.property_filters):null)}ss(){return{id:this.productId,pf:this.Bl.ss()}}}
1
+ import kt from "./filter-set.js";
2
+ export default class Xt {
3
+ constructor(t, s) {
4
+ (this.productId = t), (this.Hl = s);
5
+ }
6
+ Gl(t) {
7
+ if (null == this.productId || null == this.Hl) return !1;
8
+ const s = t[0],
9
+ i = t[1];
10
+ return s === this.productId && this.Hl.Gl(i);
11
+ }
12
+ static fromJson(t) {
13
+ return new Xt(
14
+ t ? t.product_id : null,
15
+ t ? kt.fromJson(t.property_filters) : null
16
+ );
17
+ }
18
+ ss() {
19
+ return { id: this.productId, pf: this.Hl.ss() };
20
+ }
21
+ }
@@ -1 +1,15 @@
1
- import Ft from"./trigger-condition.js";export default class Wt{constructor(t){this.Wl=t}zl(t){return null==this.Wl||Ft.Zl(t[0],this.Wl)}static fromJson(t){return new Wt(t?t.campaign_id:null)}ss(){return this.Wl}}
1
+ import Kt from "./trigger-condition.js";
2
+ export default class Yt {
3
+ constructor(t) {
4
+ this.fu = t;
5
+ }
6
+ Gl(t) {
7
+ return null == this.fu || Kt.du(t[0], this.fu);
8
+ }
9
+ static fromJson(t) {
10
+ return new Yt(t ? t.campaign_id : null);
11
+ }
12
+ ss() {
13
+ return this.fu;
14
+ }
15
+ }
@@ -1 +1,109 @@
1
- import xt from"./custom-event-data.js";import Mt from"./custom-event-property-data.js";import Bt from"./filter-set.js";import Gt from"./in-app-message-click-data.js";import Kt from"./purchase-data.js";import Qt from"./purchase-property-data.js";import Wt from"./push-click-data.js";import V from"./trigger-events.js";import r from"../../../shared-lib/braze-shared-lib.js";export default class Ft{constructor(e,t){this.type=e,this.data=t}qa(e,t){return Ft.$a[this.type]===e&&(null==this.data||this.data.zl(t))}static Zl(e,t){let a=null;try{a=window.atob(e)}catch(t){return r.D.info("Failed to unencode analytics id "+e+": "+t.message),!1}return t===a.split("_")[0]}static fromJson(e){const t=e.type;let r;switch(t){case Ft.ec.OPEN:r=null;break;case Ft.ec.Rr:r=Kt.fromJson(e.data);break;case Ft.ec.tc:r=Qt.fromJson(e.data);break;case Ft.ec.vr:r=Wt.fromJson(e.data);break;case Ft.ec.be:r=xt.fromJson(e.data);break;case Ft.ec.rc:r=Mt.fromJson(e.data);break;case Ft.ec.Ar:r=Gt.fromJson(e.data);break;case Ft.ec.ks:r=null}return new Ft(t,r)}ss(){return{t:this.type,d:this.data?this.data.ss():null}}static yn(e){let t,r;switch(e.t){case Ft.ec.OPEN:t=null;break;case Ft.ec.Rr:t=new Kt(e.d);break;case Ft.ec.tc:r=e.d||{},t=new Qt(r.id,Bt.yn(r.pf||[]));break;case Ft.ec.vr:t=new Wt(e.d);break;case Ft.ec.be:t=new xt(e.d);break;case Ft.ec.rc:r=e.d||{},t=new Mt(r.e,Bt.yn(r.pf||[]));break;case Ft.ec.Ar:t=new Gt(e.d);break;case Ft.ec.ks:t=null}return new Ft(e.t,t)}}Ft.ec={OPEN:"open",Rr:"purchase",tc:"purchase_property",vr:"push_click",be:"custom_event",rc:"custom_event_property",Ar:"iam_click",ks:"test"},Ft.$a={},Ft.$a[Ft.ec.OPEN]=V.OPEN,Ft.$a[Ft.ec.Rr]=V.Rr,Ft.$a[Ft.ec.tc]=V.Rr,Ft.$a[Ft.ec.vr]=V.vr,Ft.$a[Ft.ec.be]=V.be,Ft.$a[Ft.ec.rc]=V.be,Ft.$a[Ft.ec.Ar]=V.Ar,Ft.$a[Ft.ec.ks]=V.ks;
1
+ import xt from "./custom-event-data.js";
2
+ import Dt from "./custom-event-property-data.js";
3
+ import kt from "./filter-set.js";
4
+ import Qt from "./in-app-message-click-data.js";
5
+ import Wt from "./purchase-data.js";
6
+ import Xt from "./purchase-property-data.js";
7
+ import Yt from "./push-click-data.js";
8
+ import V from "./trigger-events.js";
9
+ import r from "../../../shared-lib/braze-shared-lib.js";
10
+ export default class Kt {
11
+ constructor(e, t) {
12
+ (this.type = e), (this.data = t);
13
+ }
14
+ ec(e, t) {
15
+ return Kt.tc[this.type] === e && (null == this.data || this.data.Gl(t));
16
+ }
17
+ static du(e, t) {
18
+ let a = null;
19
+ try {
20
+ a = window.atob(e);
21
+ } catch (t) {
22
+ return (
23
+ r.D.info("Failed to unencode analytics id " + e + ": " + t.message), !1
24
+ );
25
+ }
26
+ return t === a.split("_")[0];
27
+ }
28
+ static fromJson(e) {
29
+ const t = e.type;
30
+ let r;
31
+ switch (t) {
32
+ case Kt.rc.OPEN:
33
+ r = null;
34
+ break;
35
+ case Kt.rc.Rr:
36
+ r = Wt.fromJson(e.data);
37
+ break;
38
+ case Kt.rc.ac:
39
+ r = Xt.fromJson(e.data);
40
+ break;
41
+ case Kt.rc.vr:
42
+ r = Yt.fromJson(e.data);
43
+ break;
44
+ case Kt.rc.be:
45
+ r = xt.fromJson(e.data);
46
+ break;
47
+ case Kt.rc.sc:
48
+ r = Dt.fromJson(e.data);
49
+ break;
50
+ case Kt.rc.Ar:
51
+ r = Qt.fromJson(e.data);
52
+ break;
53
+ case Kt.rc.ks:
54
+ r = null;
55
+ }
56
+ return new Kt(t, r);
57
+ }
58
+ ss() {
59
+ return { t: this.type, d: this.data ? this.data.ss() : null };
60
+ }
61
+ static Dn(e) {
62
+ let t, r;
63
+ switch (e.t) {
64
+ case Kt.rc.OPEN:
65
+ t = null;
66
+ break;
67
+ case Kt.rc.Rr:
68
+ t = new Wt(e.d);
69
+ break;
70
+ case Kt.rc.ac:
71
+ (r = e.d || {}), (t = new Xt(r.id, kt.Dn(r.pf || [])));
72
+ break;
73
+ case Kt.rc.vr:
74
+ t = new Yt(e.d);
75
+ break;
76
+ case Kt.rc.be:
77
+ t = new xt(e.d);
78
+ break;
79
+ case Kt.rc.sc:
80
+ (r = e.d || {}), (t = new Dt(r.e, kt.Dn(r.pf || [])));
81
+ break;
82
+ case Kt.rc.Ar:
83
+ t = new Qt(e.d);
84
+ break;
85
+ case Kt.rc.ks:
86
+ t = null;
87
+ }
88
+ return new Kt(e.t, t);
89
+ }
90
+ }
91
+ (Kt.rc = {
92
+ OPEN: "open",
93
+ Rr: "purchase",
94
+ ac: "purchase_property",
95
+ vr: "push_click",
96
+ be: "custom_event",
97
+ sc: "custom_event_property",
98
+ Ar: "iam_click",
99
+ ks: "test"
100
+ }),
101
+ (Kt.tc = {}),
102
+ (Kt.tc[Kt.rc.OPEN] = V.OPEN),
103
+ (Kt.tc[Kt.rc.Rr] = V.Rr),
104
+ (Kt.tc[Kt.rc.ac] = V.Rr),
105
+ (Kt.tc[Kt.rc.vr] = V.vr),
106
+ (Kt.tc[Kt.rc.be] = V.be),
107
+ (Kt.tc[Kt.rc.sc] = V.be),
108
+ (Kt.tc[Kt.rc.Ar] = V.Ar),
109
+ (Kt.tc[Kt.rc.ks] = V.ks);
@@ -1 +1,8 @@
1
- export default{OPEN:"open",Rr:"purchase",vr:"push_click",be:"custom_event",Ar:"iam_click",ks:"test"};
1
+ export default {
2
+ OPEN: "open",
3
+ Rr: "purchase",
4
+ vr: "push_click",
5
+ be: "custom_event",
6
+ Ar: "iam_click",
7
+ ks: "test"
8
+ };
@@ -1 +1,110 @@
1
- import{dateFromUnixTimestamp as h,rehydrateDateAfterJsonization as w}from"../../util/date-utils.js";import r from"../../../shared-lib/braze-shared-lib.js";import Ft from"./trigger-condition.js";import{validateValueIsFromEnum as F}from"../../util/code-utils.js";export default class ut{constructor(t,i,s,e,r,l,o,n,h,a,u,d){this.id=t,this.Th=i||[],void 0===s&&(s=null),this.startTime=s,void 0===e&&(e=null),this.endTime=e,this.priority=r||0,this.type=l,this.Ph=n||0,null==a&&(a=1e3*(this.Ph+30)),this.vi=a,this.data=o,null==h&&(h=ut.yh),this.Ah=h,this.Ih=u,this.$h=d||null}Mh(t){return null==this.$h||this.Ah!==ut.yh&&t-this.$h>=1e3*this.Ah}Bh(t){this.$h=t}Jh(t){const i=t+1e3*this.Ph;return Math.max(i-(new Date).valueOf(),0)}Lh(t){const i=(new Date).valueOf()-t,s=null==t||isNaN(i)||null==this.vi||i<this.vi;return s||r.D.info(`Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.vi}ms.`),!s}static fromJson(t){const i=t.id,s=[];for(let i=0;i<t.trigger_condition.length;i++)s.push(Ft.fromJson(t.trigger_condition[i]));const e=h(t.start_time),r=h(t.end_time),l=t.priority,o=t.type,n=t.delay,a=t.re_eligibility,u=t.timeout,d=t.data,m=t.min_seconds_since_last_trigger;return F(ut.gi,o,"Could not construct Trigger from server data","Trigger.Types")?new ut(i,s,e,r,l,o,d,n,a,u,m):null}ss(){const t=[];for(let i=0;i<this.Th.length;i++)t.push(this.Th[i].ss());return{i:this.id,c:t,s:this.startTime,e:this.endTime,p:this.priority,t:this.type,da:this.data,d:this.Ph,r:this.Ah,tm:this.vi,ss:this.Ih,ld:this.$h}}static yn(t){const i=[];for(let s=0;s<t.c.length;s++)i.push(Ft.yn(t.c[s]));return new ut(t.i,i,w(t.s),w(t.e),t.p,t.t,t.da,t.d,t.r,t.tm,t.ss,t.ld)}}ut.yh=-1,ut.gi={mi:"inapp",Rh:"templated_iam"};
1
+ import {
2
+ dateFromUnixTimestamp as h,
3
+ rehydrateDateAfterJsonization as w
4
+ } from "../../util/date-utils.js";
5
+ import r from "../../../shared-lib/braze-shared-lib.js";
6
+ import Kt from "./trigger-condition.js";
7
+ import { validateValueIsFromEnum as F } from "../../util/code-utils.js";
8
+ export default class mt {
9
+ constructor(t, i, s, e, r, l, o, n, h, a, u, d) {
10
+ (this.id = t),
11
+ (this.Ph = i || []),
12
+ void 0 === s && (s = null),
13
+ (this.startTime = s),
14
+ void 0 === e && (e = null),
15
+ (this.endTime = e),
16
+ (this.priority = r || 0),
17
+ (this.type = l),
18
+ (this.$h = n || 0),
19
+ null == a && (a = 1e3 * (this.$h + 30)),
20
+ (this.$i = a),
21
+ (this.data = o),
22
+ null == h && (h = mt.Jh),
23
+ (this.Vh = h),
24
+ (this.qh = u),
25
+ (this.Kh = d || null);
26
+ }
27
+ Wh(t) {
28
+ return (
29
+ null == this.Kh || (this.Vh !== mt.Jh && t - this.Kh >= 1e3 * this.Vh)
30
+ );
31
+ }
32
+ Yh(t) {
33
+ this.Kh = t;
34
+ }
35
+ Zh(t) {
36
+ const i = t + 1e3 * this.$h;
37
+ return Math.max(i - new Date().valueOf(), 0);
38
+ }
39
+ gu(t) {
40
+ const i = new Date().valueOf() - t,
41
+ s = null == t || isNaN(i) || null == this.$i || i < this.$i;
42
+ return (
43
+ s ||
44
+ r.D.info(
45
+ `Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.$i}ms.`
46
+ ),
47
+ !s
48
+ );
49
+ }
50
+ static fromJson(t) {
51
+ const i = t.id,
52
+ s = [];
53
+ for (let i = 0; i < t.trigger_condition.length; i++)
54
+ s.push(Kt.fromJson(t.trigger_condition[i]));
55
+ const e = h(t.start_time),
56
+ r = h(t.end_time),
57
+ l = t.priority,
58
+ o = t.type,
59
+ n = t.delay,
60
+ a = t.re_eligibility,
61
+ u = t.timeout,
62
+ d = t.data,
63
+ m = t.min_seconds_since_last_trigger;
64
+ return F(
65
+ mt._i,
66
+ o,
67
+ "Could not construct Trigger from server data",
68
+ "Trigger.Types"
69
+ )
70
+ ? new mt(i, s, e, r, l, o, d, n, a, u, m)
71
+ : null;
72
+ }
73
+ ss() {
74
+ const t = [];
75
+ for (let i = 0; i < this.Ph.length; i++) t.push(this.Ph[i].ss());
76
+ return {
77
+ i: this.id,
78
+ c: t,
79
+ s: this.startTime,
80
+ e: this.endTime,
81
+ p: this.priority,
82
+ t: this.type,
83
+ da: this.data,
84
+ d: this.$h,
85
+ r: this.Vh,
86
+ tm: this.$i,
87
+ ss: this.qh,
88
+ ld: this.Kh
89
+ };
90
+ }
91
+ static Dn(t) {
92
+ const i = [];
93
+ for (let s = 0; s < t.c.length; s++) i.push(Kt.Dn(t.c[s]));
94
+ return new mt(
95
+ t.i,
96
+ i,
97
+ w(t.s),
98
+ w(t.e),
99
+ t.p,
100
+ t.t,
101
+ t.da,
102
+ t.d,
103
+ t.r,
104
+ t.tm,
105
+ t.ss,
106
+ t.ld
107
+ );
108
+ }
109
+ }
110
+ (mt.Jh = -1), (mt._i = { Ti: "inapp", pu: "templated_iam" });
@@ -1 +1,30 @@
1
- import pe from"../InAppMessage/in-app-message-manager-factory.js";import e,{OPTIONS as T}from"../managers/braze-instance.js";import ir from"./triggers-provider.js";export const TriggersProviderFactory={t:!1,provider:null,er:()=>(TriggersProviderFactory.init(),TriggersProviderFactory.provider),rg:()=>{if(!TriggersProviderFactory.provider){const r=e.nn(T.ho);TriggersProviderFactory.provider=new ir(null!=r?r:30,pe.m().Be(),e.l(),e.mr(),pe.m()),e.ar(TriggersProviderFactory.provider)}},init:()=>{TriggersProviderFactory.t||(TriggersProviderFactory.rg(),e.u(TriggersProviderFactory),TriggersProviderFactory.t=!0)},destroy:()=>{TriggersProviderFactory.provider=null,TriggersProviderFactory.t=!1}};
1
+ import pe from "../InAppMessage/in-app-message-manager-factory.js";
2
+ import e, { OPTIONS as T } from "../managers/braze-instance.js";
3
+ import gr from "./triggers-provider.js";
4
+ export const TriggersProviderFactory = {
5
+ t: !1,
6
+ provider: null,
7
+ er: () => (TriggersProviderFactory.init(), TriggersProviderFactory.provider),
8
+ rg: () => {
9
+ if (!TriggersProviderFactory.provider) {
10
+ const r = e.nn(T.Io);
11
+ (TriggersProviderFactory.provider = new gr(
12
+ null != r ? r : 30,
13
+ pe.m().Ve(),
14
+ e.l(),
15
+ e.mr(),
16
+ pe.m()
17
+ )),
18
+ e.ar(TriggersProviderFactory.provider);
19
+ }
20
+ },
21
+ init: () => {
22
+ TriggersProviderFactory.t ||
23
+ (TriggersProviderFactory.rg(),
24
+ e.u(TriggersProviderFactory),
25
+ (TriggersProviderFactory.t = !0));
26
+ },
27
+ destroy: () => {
28
+ (TriggersProviderFactory.provider = null), (TriggersProviderFactory.t = !1);
29
+ }
30
+ };
@@ -1 +1,307 @@
1
- import y from"../common/base-provider.js";import{newInAppMessageFromJson as it}from"../InAppMessage/in-app-message-factory.js";import ue from"../models/braze-event.js";import{InAppMessage}from"../InAppMessage/index.js";import{isArray as p,isEqual as ii,validateValueIsFromEnum as F}from"../util/code-utils.js";import{STORAGE_KEYS as o}from"../managers/storage-manager.js";import ft from"../InAppMessage/models/templated-in-app-message.js";import ut from"./models/trigger.js";import V from"./models/trigger-events.js";import r from"../../shared-lib/braze-shared-lib.js";export default class ir extends y{constructor(t,i,s,e,r){super(),this.Oh=t,this.yt=i,this.h=s,this.si=e,this.Uh=r,this.Kh=[],this.Qh=[],this.Vh=null,this.Xh={},this.Yh={},this.Zh(),this.tg()}ig(){this.Vh=this.h.I(o.q.Ya)||this.Vh,this.Xh=this.h.I(o.q.Da)||this.Xh,this.Yh=this.h.I(o.q.Ka)||this.Yh;for(let t=0;t<this.sg.length;t++){const i=this.sg[t];null!=this.Yh[i.id]&&i.Bh(this.Yh[i.id])}}Zh(){this.eg=this.h.I(o.q.Ia)||0;const t=this.h.I(o.q.ba)||[],i=[];for(let s=0;s<t.length;s++)i.push(ut.yn(t[s]));this.sg=i,this.ig()}tg(){const t=this,i=function(i,s,e,r,h){return function(){t.hg(i,s,e,r,h)}},s={};for(let t=0;t<this.sg.length;t++)s[this.sg[t].id]=this.sg[t];let e=!1;for(let t=0;t<this.sg.length;t++){const r=this.sg[t];if(null!=this.Xh[r.id]){const t=this.Xh[r.id],h=[];for(let e=0;e<t.length;e++){const o=t[e],n=r.Jh(o.di);if(n>0){let t,e;h.push(o),null!=o.og&&(t=o.og),null!=o.ng&&ue.Ma(o.ng)&&(e=ue.yn(o.ng));const l=[];if(p(o.lg))for(let t=0;t<o.lg.length;t++){const i=s[o.lg[t]];null!=i&&l.push(i)}this.Qh.push(setTimeout(i(r,o.di,t,e,l),n))}}this.Xh[r.id].length>h.length&&(this.Xh[r.id]=h,e=!0,0===this.Xh[r.id].length&&delete this.Xh[r.id])}}e&&this.h.B(o.q.Da,this.Xh)}ag(){const t=[];for(let i=0;i<this.sg.length;i++)t.push(this.sg[i].ss());this.eg=(new Date).valueOf(),this.h.B(o.q.ba,t),this.h.B(o.q.Ia,this.eg)}gg(){(this.h.I(o.q.Ia)||0)>this.eg?this.Zh():this.ig()}Rs(t){let i=!1;if(null!=t&&t.triggers){this.ig();const s={},e={};this.sg=[];for(let r=0;r<t.triggers.length;r++){const h=ut.fromJson(t.triggers[r]);null!=this.Yh[h.id]&&(h.Bh(this.Yh[h.id]),s[h.id]=this.Yh[h.id]),null!=this.Xh[h.id]&&(e[h.id]=this.Xh[h.id]);for(let t=0;t<h.Th.length;t++)if(h.Th[t].qa(V.ks,null)){i=!0;break}null!=h&&this.sg.push(h)}ii(this.Yh,s)||(this.Yh=s,this.h.B(o.q.Ka,this.Yh)),ii(this.Xh,e)||(this.Xh=e,this.h.B(o.q.Da,this.Xh)),this.ag(),i&&(r.D.info("Trigger with test condition found, firing test."),this.je(V.ks)),this.je(V.OPEN);const h=this.Kh;this.Kh=[];for(let t=0;t<h.length;t++)this.je.apply(this,h[t])}}async hg(t,i,s,e,h){const o=e=>{this.ig();const h=(new Date).valueOf();if(!t.Lh(i))return!1===navigator.onLine&&t.type===ut.gi.mi&&e.imageUrl?(r.D.info(`Not showing ${t.type} trigger action ${t.id} due to offline state.`),void this.Uh.qe(t.id,InAppMessage.Oe.Ki)):void(t.Mh(h)&&this.fg(t,h,s)?(this.yt.St([e]),this.cg(t,h)):r.D.info(`Not displaying trigger ${t.id} because display time fell outside of the acceptable time window.`));t.type===ut.gi.Rh?this.Uh.qe(t.id,InAppMessage.Oe.ui):this.Uh.qe(t.id,InAppMessage.Oe.Yi)},n=()=>{this.ig();const o=h.pop();if(null!=o)if(this.ug(o,i,s,e,h),o.Lh(i)){let t=`Server aborted in-app message display, but the timeout on fallback trigger ${o.id} has already elapsed.`;h.length>0&&(t+=" Continuing to fall back."),r.D.info(t),this.Uh.qe(o.id,InAppMessage.Oe.Yi),n()}else{r.D.info(`Server aborted in-app message display. Falling back to lower priority ${o.type} trigger action ${t.id}.`);const n=1e3*o.Ph-((new Date).valueOf()-i);n>0?this.Qh.push(setTimeout((()=>{this.hg(o,i,s,e,h)}),n)):this.hg(o,i,s,e,h)}};switch(t.type){case ut.gi.mi:const h=it(t.data);if(null==h){r.D.error(`Could not parse trigger data for trigger ${t.id}, ignoring.`),this.Uh.qe(t.id,InAppMessage.Oe.ci);break}let l=this.Uh.Ve(h);if(l){r.D.error(l),n();break}o(h);break;case ut.gi.Rh:const a=ft.fromJson(t.data,o,n,i,t.vi);if(null==a){r.D.error(`Could not parse trigger data for trigger ${t.id}, ignoring.`),this.Uh.qe(t.id,InAppMessage.Oe.ci);break}this.Uh.Ze(a,s,e);break;default:r.D.error(`Trigger ${t.id} was of unexpected type ${t.type}, ignoring.`),this.Uh.qe(t.id,InAppMessage.Oe.ci)}}je(t,i,s){if(!F(V,t,"Cannot fire trigger action.","TriggerEvents"))return;if(this.si.bl())return r.D.info("Trigger sync is currently in progress, awaiting sync completion before firing trigger event."),void this.Kh.push(arguments);this.gg();const e=(new Date).valueOf(),h=e-this.Vh;let o=!0,n=!0;const l=[];for(let s=0;s<this.sg.length;s++){const r=this.sg[s],h=e+1e3*r.Ph;if(r.Mh(h)&&(null==r.startTime||r.startTime<=e)&&(null==r.endTime||r.endTime>=e)){let s=!1;for(let e=0;e<r.Th.length;e++)if(r.Th[e].qa(t,i)){s=!0;break}s&&(o=!1,this.fg(r,h,t)&&(n=!1,l.push(r)))}}if(o)return void r.D.info(`Trigger event ${t} did not match any trigger conditions.`);if(n)return void r.D.info(`Ignoring ${t} trigger event because a trigger was displayed ${h/1e3}s ago.`);l.sort(((t,i)=>t.priority-i.priority));const a=l.pop();null!=a&&(r.D.info(`Firing ${a.type} trigger action ${a.id} from trigger event ${t}.`),this.ug(a,e,t,s,l),0===a.Ph?this.hg(a,e,t,s,l):this.Qh.push(setTimeout((()=>{this.hg(a,e,t,s,l)}),1e3*a.Ph)))}changeUser(t){if(this.sg=[],this.h.Xs(o.q.ba),!t){this.Kh=[],this.Vh=null,this.Yh={},this.Xh={};for(let t=0;t<this.Qh.length;t++)clearTimeout(this.Qh[t]);this.Qh=[],this.h.Xs(o.q.Ya),this.h.Xs(o.q.Ka),this.h.Xs(o.q.Da)}}clearData(){this.sg=[],this.Vh=null,this.Yh={},this.Xh={};for(let t=0;t<this.Qh.length;t++)clearTimeout(this.Qh[t]);this.Qh=[]}fg(t,i,s){if(null==this.Vh)return!0;if(s===V.ks)return r.D.info("Ignoring minimum interval between trigger because it is a test type."),!0;let e=t.Ih;return null==e&&(e=this.Oh),i-this.Vh>=1e3*e}ug(t,i,s,e,r){this.ig(),this.Xh[t.id]=this.Xh[t.id]||[];const h={};let n;h.di=i,h.og=s,null!=e&&(n=e.ss()),h.ng=n;const l=[];for(let t=0;t<r.length;t++)l.push(r[t].id);h.lg=l,this.Xh[t.id].push(h),this.h.B(o.q.Da,this.Xh)}cg(t,i){this.ig(),t.Bh(i),this.Vh=i,this.h.B(o.q.Ya,i),this.Yh[t.id]=i,this.h.B(o.q.Ka,this.Yh)}}
1
+ import y from "../common/base-provider.js";
2
+ import { newInAppMessageFromJson as lt } from "../InAppMessage/in-app-message-factory.js";
3
+ import ue from "../models/braze-event.js";
4
+ import { InAppMessage } from "../InAppMessage/index.js";
5
+ import {
6
+ isArray as p,
7
+ isEqual as ii,
8
+ validateValueIsFromEnum as F
9
+ } from "../util/code-utils.js";
10
+ import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
11
+ import wt from "../InAppMessage/models/templated-in-app-message.js";
12
+ import mt from "./models/trigger.js";
13
+ import V from "./models/trigger-events.js";
14
+ import r from "../../shared-lib/braze-shared-lib.js";
15
+ export default class gr extends y {
16
+ constructor(t, i, s, e, r) {
17
+ super(),
18
+ (this.tg = t),
19
+ (this.yt = i),
20
+ (this.h = s),
21
+ (this.si = e),
22
+ (this.ig = r),
23
+ (this.sg = []),
24
+ (this.eg = []),
25
+ (this.hg = null),
26
+ (this.og = {}),
27
+ (this.ng = {}),
28
+ this.ag(),
29
+ this.lg();
30
+ }
31
+ gg() {
32
+ (this.hg = this.h.I(o.q.Na) || this.hg),
33
+ (this.og = this.h.I(o.q.va) || this.og),
34
+ (this.ng = this.h.I(o.q.Ga) || this.ng);
35
+ for (let t = 0; t < this.cg.length; t++) {
36
+ const i = this.cg[t];
37
+ null != this.ng[i.id] && i.Yh(this.ng[i.id]);
38
+ }
39
+ }
40
+ ag() {
41
+ this.fg = this.h.I(o.q.Da) || 0;
42
+ const t = this.h.I(o.q.Ya) || [],
43
+ i = [];
44
+ for (let s = 0; s < t.length; s++) i.push(mt.Dn(t[s]));
45
+ (this.cg = i), this.gg();
46
+ }
47
+ lg() {
48
+ const t = this,
49
+ i = function(i, s, e, r, h) {
50
+ return function() {
51
+ t.ug(i, s, e, r, h);
52
+ };
53
+ },
54
+ s = {};
55
+ for (let t = 0; t < this.cg.length; t++) s[this.cg[t].id] = this.cg[t];
56
+ let e = !1;
57
+ for (let t = 0; t < this.cg.length; t++) {
58
+ const r = this.cg[t];
59
+ if (null != this.og[r.id]) {
60
+ const t = this.og[r.id],
61
+ h = [];
62
+ for (let e = 0; e < t.length; e++) {
63
+ const o = t[e],
64
+ n = r.Zh(o.Si);
65
+ if (n > 0) {
66
+ let t, e;
67
+ h.push(o),
68
+ null != o.dg && (t = o.dg),
69
+ null != o.mg && ue.Fa(o.mg) && (e = ue.Dn(o.mg));
70
+ const a = [];
71
+ if (p(o.pg))
72
+ for (let t = 0; t < o.pg.length; t++) {
73
+ const i = s[o.pg[t]];
74
+ null != i && a.push(i);
75
+ }
76
+ this.eg.push(setTimeout(i(r, o.Si, t, e, a), n));
77
+ }
78
+ }
79
+ this.og[r.id].length > h.length &&
80
+ ((this.og[r.id] = h),
81
+ (e = !0),
82
+ 0 === this.og[r.id].length && delete this.og[r.id]);
83
+ }
84
+ }
85
+ e && this.h.B(o.q.va, this.og);
86
+ }
87
+ bg() {
88
+ const t = [];
89
+ for (let i = 0; i < this.cg.length; i++) t.push(this.cg[i].ss());
90
+ (this.fg = new Date().valueOf()),
91
+ this.h.B(o.q.Ya, t),
92
+ this.h.B(o.q.Da, this.fg);
93
+ }
94
+ Tg() {
95
+ (this.h.I(o.q.Da) || 0) > this.fg ? this.ag() : this.gg();
96
+ }
97
+ Rs(t) {
98
+ let i = !1;
99
+ if (null != t && t.triggers) {
100
+ this.gg();
101
+ const s = {},
102
+ e = {};
103
+ this.cg = [];
104
+ for (let r = 0; r < t.triggers.length; r++) {
105
+ const h = mt.fromJson(t.triggers[r]);
106
+ null != this.ng[h.id] &&
107
+ (h.Yh(this.ng[h.id]), (s[h.id] = this.ng[h.id])),
108
+ null != this.og[h.id] && (e[h.id] = this.og[h.id]);
109
+ for (let t = 0; t < h.Ph.length; t++)
110
+ if (h.Ph[t].ec(V.ks, null)) {
111
+ i = !0;
112
+ break;
113
+ }
114
+ null != h && this.cg.push(h);
115
+ }
116
+ ii(this.ng, s) || ((this.ng = s), this.h.B(o.q.Ga, this.ng)),
117
+ ii(this.og, e) || ((this.og = e), this.h.B(o.q.va, this.og)),
118
+ this.bg(),
119
+ i &&
120
+ (r.D.info("Trigger with test condition found, firing test."),
121
+ this.je(V.ks)),
122
+ this.je(V.OPEN);
123
+ const h = this.sg;
124
+ this.sg = [];
125
+ for (let t = 0; t < h.length; t++) this.je.apply(this, h[t]);
126
+ }
127
+ }
128
+ async ug(t, i, s, e, h) {
129
+ const o = e => {
130
+ this.gg();
131
+ const h = new Date().valueOf();
132
+ if (!t.gu(i))
133
+ return !1 === navigator.onLine && t.type === mt._i.Ti && e.imageUrl
134
+ ? (r.D.info(
135
+ `Not showing ${t.type} trigger action ${t.id} due to offline state.`
136
+ ),
137
+ void this.ig.ni(t.id, InAppMessage.li.nh))
138
+ : void (t.Wh(h) && this.yg(t, h, s)
139
+ ? 0 === this.yt.bu()
140
+ ? r.D.info(
141
+ `Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`
142
+ )
143
+ : (this.yt.St([e]), this.vg(t, h))
144
+ : r.D.info(
145
+ `Not displaying trigger ${t.id} because display time fell outside of the acceptable time window.`
146
+ ));
147
+ t.type === mt._i.pu
148
+ ? this.ig.ni(t.id, InAppMessage.li.zi)
149
+ : this.ig.ni(t.id, InAppMessage.li.rh);
150
+ },
151
+ n = () => {
152
+ this.gg();
153
+ const o = h.pop();
154
+ if (null != o)
155
+ if ((this.wg(o, i, s, e, h), o.gu(i))) {
156
+ let t = `Server aborted in-app message display, but the timeout on fallback trigger ${o.id} has already elapsed.`;
157
+ h.length > 0 && (t += " Continuing to fall back."),
158
+ r.D.info(t),
159
+ this.ig.ni(o.id, InAppMessage.li.rh),
160
+ n();
161
+ } else {
162
+ r.D.info(
163
+ `Server aborted in-app message display. Falling back to lower priority ${o.type} trigger action ${t.id}.`
164
+ );
165
+ const n = 1e3 * o.$h - (new Date().valueOf() - i);
166
+ n > 0
167
+ ? this.eg.push(
168
+ setTimeout(() => {
169
+ this.ug(o, i, s, e, h);
170
+ }, n)
171
+ )
172
+ : this.ug(o, i, s, e, h);
173
+ }
174
+ };
175
+ switch (t.type) {
176
+ case mt._i.Ti:
177
+ const h = lt(t.data);
178
+ if (null == h) {
179
+ r.D.error(
180
+ `Could not parse trigger data for trigger ${t.id}, ignoring.`
181
+ ),
182
+ this.ig.ni(t.id, InAppMessage.li.ki);
183
+ break;
184
+ }
185
+ let a = this.ig.vi(h);
186
+ if (a) {
187
+ r.D.error(a), n();
188
+ break;
189
+ }
190
+ o(h);
191
+ break;
192
+ case mt._i.pu:
193
+ const l = wt.fromJson(t.data, o, n, i, t.$i);
194
+ if (null == l) {
195
+ r.D.error(
196
+ `Could not parse trigger data for trigger ${t.id}, ignoring.`
197
+ ),
198
+ this.ig.ni(t.id, InAppMessage.li.ki);
199
+ break;
200
+ }
201
+ this.ig.Ii(l, s, e);
202
+ break;
203
+ default:
204
+ r.D.error(
205
+ `Trigger ${t.id} was of unexpected type ${t.type}, ignoring.`
206
+ ),
207
+ this.ig.ni(t.id, InAppMessage.li.ki);
208
+ }
209
+ }
210
+ je(t, i, s) {
211
+ if (!F(V, t, "Cannot fire trigger action.", "TriggerEvents")) return;
212
+ if (this.si.Rl())
213
+ return (
214
+ r.D.info(
215
+ "Trigger sync is currently in progress, awaiting sync completion before firing trigger event."
216
+ ),
217
+ void this.sg.push(arguments)
218
+ );
219
+ this.Tg();
220
+ const e = new Date().valueOf(),
221
+ h = e - this.hg;
222
+ let o = !0,
223
+ n = !0;
224
+ const a = [];
225
+ for (let s = 0; s < this.cg.length; s++) {
226
+ const r = this.cg[s],
227
+ h = e + 1e3 * r.$h;
228
+ if (
229
+ r.Wh(h) &&
230
+ (null == r.startTime || r.startTime <= e) &&
231
+ (null == r.endTime || r.endTime >= e)
232
+ ) {
233
+ let s = !1;
234
+ for (let e = 0; e < r.Ph.length; e++)
235
+ if (r.Ph[e].ec(t, i)) {
236
+ s = !0;
237
+ break;
238
+ }
239
+ s && ((o = !1), this.yg(r, h, t) && ((n = !1), a.push(r)));
240
+ }
241
+ }
242
+ if (o)
243
+ return void r.D.info(
244
+ `Trigger event ${t} did not match any trigger conditions.`
245
+ );
246
+ if (n)
247
+ return void r.D.info(
248
+ `Ignoring ${t} trigger event because a trigger was displayed ${h /
249
+ 1e3}s ago.`
250
+ );
251
+ a.sort((t, i) => t.priority - i.priority);
252
+ const l = a.pop();
253
+ null != l &&
254
+ (r.D.info(
255
+ `Firing ${l.type} trigger action ${l.id} from trigger event ${t}.`
256
+ ),
257
+ this.wg(l, e, t, s, a),
258
+ 0 === l.$h
259
+ ? this.ug(l, e, t, s, a)
260
+ : this.eg.push(
261
+ setTimeout(() => {
262
+ this.ug(l, e, t, s, a);
263
+ }, 1e3 * l.$h)
264
+ ));
265
+ }
266
+ changeUser(t) {
267
+ if (((this.cg = []), this.h.Xs(o.q.Ya), !t)) {
268
+ (this.sg = []), (this.hg = null), (this.ng = {}), (this.og = {});
269
+ for (let t = 0; t < this.eg.length; t++) clearTimeout(this.eg[t]);
270
+ (this.eg = []), this.h.Xs(o.q.Na), this.h.Xs(o.q.Ga), this.h.Xs(o.q.va);
271
+ }
272
+ }
273
+ clearData() {
274
+ (this.cg = []), (this.hg = null), (this.ng = {}), (this.og = {});
275
+ for (let t = 0; t < this.eg.length; t++) clearTimeout(this.eg[t]);
276
+ this.eg = [];
277
+ }
278
+ yg(t, i, s) {
279
+ if (null == this.hg) return !0;
280
+ if (s === V.ks)
281
+ return (
282
+ r.D.info(
283
+ "Ignoring minimum interval between trigger because it is a test type."
284
+ ),
285
+ !0
286
+ );
287
+ let e = t.qh;
288
+ return null == e && (e = this.tg), i - this.hg >= 1e3 * e;
289
+ }
290
+ wg(t, i, s, e, r) {
291
+ this.gg(), (this.og[t.id] = this.og[t.id] || []);
292
+ const h = {};
293
+ let n;
294
+ (h.Si = i), (h.dg = s), null != e && (n = e.ss()), (h.mg = n);
295
+ const a = [];
296
+ for (let t = 0; t < r.length; t++) a.push(r[t].id);
297
+ (h.pg = a), this.og[t.id].push(h), this.h.B(o.q.va, this.og);
298
+ }
299
+ vg(t, i) {
300
+ this.gg(),
301
+ t.Yh(i),
302
+ (this.hg = i),
303
+ this.h.B(o.q.Na, i),
304
+ (this.ng[t.id] = i),
305
+ this.h.B(o.q.Ga, this.ng);
306
+ }
307
+ }
@@ -1 +1,12 @@
1
- import e,{OPTIONS as T}from"../../managers/braze-instance.js";export function attachCSS(n,t,o){const c=n||document.querySelector("head"),s=`ab-${t}-css-definitions-${"4.2.1".replace(/\./g,"-")}`,a=c.ownerDocument||document;if(null==a.getElementById(s)){const n=a.createElement("style");n.innerHTML=o,n.id=s;const t=e.nn(T.ao);null!=t&&n.setAttribute("nonce",t),c.appendChild(n)}}
1
+ import e, { OPTIONS as T } from "../../managers/braze-instance.js";
2
+ export function attachCSS(n, t, o) {
3
+ const c = n || document.querySelector("head"),
4
+ s = `ab-${t}-css-definitions-${"4.4.0".replace(/\./g, "-")}`,
5
+ a = c.ownerDocument || document;
6
+ if (null == a.getElementById(s)) {
7
+ const n = a.createElement("style");
8
+ (n.innerHTML = o), (n.id = s);
9
+ const t = e.nn(T.ao);
10
+ null != t && n.setAttribute("nonce", t), c.appendChild(n);
11
+ }
12
+ }