@braze/web-sdk 4.3.0 → 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 +56 -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,170 @@
1
- import e,{OPTIONS as T}from"../../managers/braze-instance.js";import ControlMessage from"../models/control-message.js";import HtmlMessage from"../models/html-message.js";import InAppMessage from"../models/in-app-message.js";import SlideUpMessage from"../models/slide-up-message.js";import pe from"../in-app-message-manager-factory.js";import se from"../display/get-animation-effect.js";import ce from"../display/in-app-message-to-html.js";import{logInAppMessageImpression}from"../log-in-app-message-impression.js";import{ORIENTATION as le,WindowUtils as H}from"../../util/window-utils.js";import{isURIJavascriptOrData as j}from"../../util/url-utils.js";import{KeyCodes as at}from"../../util/key-codes.js";import{setupInAppMessageUI as ss}from"../../ui/js/index.js";import r from"../../../shared-lib/braze-shared-lib.js";import{toRgba as ne}from"../../util/color-utils.js";export function showInAppMessage(t,s,o){if(!e.rr())return;if(ss(),null==t)return!1;if(t instanceof ControlMessage)return r.D.info("User received control for a multivariate test, logging to Braze servers."),logInAppMessageImpression(t),!0;if(!(t instanceof InAppMessage))return!1;const i=pe.m();t.Hi();const n=t instanceof HtmlMessage;if(n&&!t.trusted&&!e.tr())return r.D.error('HTML in-app messages are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable these messages.'),i.qe(t.triggerId,InAppMessage.Oe.wi),!1;if(null==s&&(s=document.body),t.we()){if(s.querySelectorAll(".ab-modal-interactions").length>0)return r.D.info(`Cannot show in-app message ${t.message} because another message is being shown.`),i.qe(t.triggerId,InAppMessage.Oe.yi),!1}if(H.so()){const e=H.io();if(e===le.PORTRAIT&&t.orientation===InAppMessage.Orientation.LANDSCAPE||e===le.LANDSCAPE&&t.orientation===InAppMessage.Orientation.PORTRAIT){const s=e===le.PORTRAIT?"portrait":"landscape",o=t.orientation===InAppMessage.Orientation.PORTRAIT?"portrait":"landscape";return r.D.info(`Not showing ${o} in-app message ${t.message} because the screen is currently ${s}`),i.qe(t.triggerId,InAppMessage.Oe.xi),!1}}if(!e.tr()){let e=!1;if(t.buttons&&t.buttons.length>0){const s=t.buttons;for(let t=0;t<s.length;t++)if(s[t].clickAction===InAppMessage.ClickAction.URI){const o=s[t].uri;e=j(o)}}else t.clickAction===InAppMessage.ClickAction.URI&&(e=j(t.uri));if(e)return r.D.error('Javascript click actions are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable these actions.'),i.qe(t.triggerId,InAppMessage.Oe.wi),!1}const a=document.createElement("div");if(a.className="ab-iam-root v3",a.className+=se(t),a.setAttribute("role","complementary"),t.an()&&(a.id=t.htmlId),e.nn(T.no)&&(a.style.zIndex=e.nn(T.no)+1),s.appendChild(a),t.sn()){const s=document.createElement("style");s.innerHTML=t.css,s.id=t.rn(),null!=e.nn(T.ao)&&s.setAttribute("nonce",e.nn(T.ao)),document.getElementsByTagName("head")[0].appendChild(s)}const l=t instanceof SlideUpMessage,m=ce(t,(()=>{import("../../Feed/ui/show-feed.js").then((e=>e.showFeed()))}),(s=>{if(t.we()&&t.ll()){const o=document.createElement("div");if(o.className="ab-page-blocker",t.sn()||(o.style.backgroundColor=ne(t.frameColor)),e.nn(T.no)&&(o.style.zIndex=e.nn(T.no)),a.appendChild(o),!e.nn(T.Ui)){const e=(new Date).valueOf();o.onclick=o=>{(new Date).valueOf()-e>InAppMessage.Vi&&(t.on(s),o.stopPropagation())}}a.appendChild(s),s.focus(),t.Ri(a)}else if(l){const e=document.querySelectorAll(".ab-slideup");let o=null;for(let t=e.length-1;t>=0;t--)if(e[t]!==s){o=e[t];break}if(t.slideFrom===InAppMessage.SlideFrom.TOP){let e=0;null!=o&&(e=o.offsetTop+o.offsetHeight),s.style.top=Math.max(e,0)+"px"}else{let e=0;null!=o&&(e=(window.innerHeight||document.documentElement.clientHeight)-o.offsetTop),s.style.bottom=Math.max(e,0)+"px"}}else if(n&&!e.nn(T.Ui)){const e=t;s.contentWindow.addEventListener("keydown",(function(t){t.keyCode===at.Ci&&e.closeMessage()}))}logInAppMessageImpression(t),t.dismissType===InAppMessage.DismissType.AUTO_DISMISS&&setTimeout((()=>{a.contains(s)&&t.on(s)}),t.duration),"function"==typeof o&&o()}),e.nn(T.lo),e.nn(T.no),e.nn(T.ao));return(n||l)&&(a.appendChild(m),t.Ri(a)),!0}
1
+ import e, { OPTIONS as T } from "../../managers/braze-instance.js";
2
+ import ControlMessage from "../models/control-message.js";
3
+ import HtmlMessage from "../models/html-message.js";
4
+ import InAppMessage from "../models/in-app-message.js";
5
+ import SlideUpMessage from "../models/slide-up-message.js";
6
+ import pe from "../in-app-message-manager-factory.js";
7
+ import se from "../display/get-animation-effect.js";
8
+ import le from "../display/in-app-message-to-html.js";
9
+ import { logInAppMessageImpression } from "../log-in-app-message-impression.js";
10
+ import {
11
+ ORIENTATION as fe,
12
+ WindowUtils as H
13
+ } from "../../util/window-utils.js";
14
+ import { isURIJavascriptOrData as j } from "../../util/url-utils.js";
15
+ import { KeyCodes as at } from "../../util/key-codes.js";
16
+ import { setupInAppMessageUI as ss } from "../../ui/js/index.js";
17
+ import r from "../../../shared-lib/braze-shared-lib.js";
18
+ import { toRgba as me } from "../../util/color-utils.js";
19
+ export function showInAppMessage(t, s, o) {
20
+ if (!e.rr()) return;
21
+ if ((ss(), null == t)) return !1;
22
+ if (t instanceof ControlMessage)
23
+ return (
24
+ r.D.info(
25
+ "User received control for a multivariate test, logging to Braze servers."
26
+ ),
27
+ logInAppMessageImpression(t),
28
+ !0
29
+ );
30
+ if (!(t instanceof InAppMessage)) return !1;
31
+ const i = pe.m();
32
+ t.Ji();
33
+ const n = t instanceof HtmlMessage;
34
+ if (n && !t.trusted && !e.tr())
35
+ return (
36
+ r.D.error(
37
+ 'HTML in-app messages are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable these messages.'
38
+ ),
39
+ i.ni(t.triggerId, InAppMessage.li.ih),
40
+ !1
41
+ );
42
+ if ((null == s && (s = document.body), t.Me())) {
43
+ if (s.querySelectorAll(".ab-modal-interactions").length > 0)
44
+ return (
45
+ r.D.info(
46
+ `Cannot show in-app message ${t.message} because another message is being shown.`
47
+ ),
48
+ i.ni(t.triggerId, InAppMessage.li.eh),
49
+ !1
50
+ );
51
+ }
52
+ if (H.so()) {
53
+ const e = H.io();
54
+ if (
55
+ (e === fe.PORTRAIT &&
56
+ t.orientation === InAppMessage.Orientation.LANDSCAPE) ||
57
+ (e === fe.LANDSCAPE &&
58
+ t.orientation === InAppMessage.Orientation.PORTRAIT)
59
+ ) {
60
+ const s = e === fe.PORTRAIT ? "portrait" : "landscape",
61
+ o =
62
+ t.orientation === InAppMessage.Orientation.PORTRAIT
63
+ ? "portrait"
64
+ : "landscape";
65
+ return (
66
+ r.D.info(
67
+ `Not showing ${o} in-app message ${t.message} because the screen is currently ${s}`
68
+ ),
69
+ i.ni(t.triggerId, InAppMessage.li.hh),
70
+ !1
71
+ );
72
+ }
73
+ }
74
+ if (!e.tr()) {
75
+ let e = !1;
76
+ if (t.buttons && t.buttons.length > 0) {
77
+ const s = t.buttons;
78
+ for (let t = 0; t < s.length; t++)
79
+ if (s[t].clickAction === InAppMessage.ClickAction.URI) {
80
+ const o = s[t].uri;
81
+ e = j(o);
82
+ }
83
+ } else t.clickAction === InAppMessage.ClickAction.URI && (e = j(t.uri));
84
+ if (e)
85
+ return (
86
+ r.D.error(
87
+ 'Javascript click actions are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable these actions.'
88
+ ),
89
+ i.ni(t.triggerId, InAppMessage.li.ih),
90
+ !1
91
+ );
92
+ }
93
+ const a = document.createElement("div");
94
+ if (
95
+ ((a.className = "ab-iam-root v3"),
96
+ (a.className += se(t)),
97
+ a.setAttribute("role", "complementary"),
98
+ t.an() && (a.id = t.htmlId),
99
+ e.nn(T.no) && (a.style.zIndex = e.nn(T.no) + 1),
100
+ s.appendChild(a),
101
+ t.sn())
102
+ ) {
103
+ const s = document.createElement("style");
104
+ (s.innerHTML = t.css),
105
+ (s.id = t.rn()),
106
+ null != e.nn(T.ao) && s.setAttribute("nonce", e.nn(T.ao)),
107
+ document.getElementsByTagName("head")[0].appendChild(s);
108
+ }
109
+ const l = t instanceof SlideUpMessage,
110
+ m = le(
111
+ t,
112
+ () => {
113
+ import("../../Feed/ui/show-feed.js").then(e => e.showFeed());
114
+ },
115
+ s => {
116
+ if (t.Me() && t.ll()) {
117
+ const o = document.createElement("div");
118
+ if (
119
+ ((o.className = "ab-page-blocker"),
120
+ t.sn() || (o.style.backgroundColor = me(t.frameColor)),
121
+ e.nn(T.no) && (o.style.zIndex = e.nn(T.no)),
122
+ a.appendChild(o),
123
+ !e.nn(T.qi))
124
+ ) {
125
+ const e = new Date().valueOf();
126
+ o.onclick = o => {
127
+ new Date().valueOf() - e > InAppMessage.Eh &&
128
+ (t.on(s), o.stopPropagation());
129
+ };
130
+ }
131
+ a.appendChild(s), s.focus(), t.Yi(a);
132
+ } else if (l) {
133
+ const e = document.querySelectorAll(".ab-slideup");
134
+ let o = null;
135
+ for (let t = e.length - 1; t >= 0; t--)
136
+ if (e[t] !== s) {
137
+ o = e[t];
138
+ break;
139
+ }
140
+ if (t.slideFrom === InAppMessage.SlideFrom.TOP) {
141
+ let e = 0;
142
+ null != o && (e = o.offsetTop + o.offsetHeight),
143
+ (s.style.top = Math.max(e, 0) + "px");
144
+ } else {
145
+ let e = 0;
146
+ null != o &&
147
+ (e =
148
+ (window.innerHeight || document.documentElement.clientHeight) -
149
+ o.offsetTop),
150
+ (s.style.bottom = Math.max(e, 0) + "px");
151
+ }
152
+ } else if (n && !e.nn(T.qi)) {
153
+ const e = t;
154
+ s.contentWindow.addEventListener("keydown", function(t) {
155
+ t.keyCode === at.Vi && e.closeMessage();
156
+ });
157
+ }
158
+ logInAppMessageImpression(t),
159
+ t.dismissType === InAppMessage.DismissType.AUTO_DISMISS &&
160
+ setTimeout(() => {
161
+ a.contains(s) && t.on(s);
162
+ }, t.duration),
163
+ "function" == typeof o && o();
164
+ },
165
+ e.nn(T.lo),
166
+ e.nn(T.no),
167
+ e.nn(T.ao)
168
+ );
169
+ return (n || l) && (a.appendChild(m), t.Yi(a)), !0;
170
+ }
package/src/Push/index.js CHANGED
@@ -1 +1,5 @@
1
- export{isPushBlocked}from"./is-push-blocked.js";export{isPushPermissionGranted}from"./is-push-permission-granted.js";export{isPushSupported}from"./is-push-supported.js";export{requestPushPermission}from"./request-push-permission.js";export{unregisterPush}from"./unregister-push.js";
1
+ export { isPushBlocked } from "./is-push-blocked.js";
2
+ export { isPushPermissionGranted } from "./is-push-permission-granted.js";
3
+ export { isPushSupported } from "./is-push-supported.js";
4
+ export { requestPushPermission } from "./request-push-permission.js";
5
+ export { unregisterPush } from "./unregister-push.js";
@@ -1 +1,5 @@
1
- import e from"../managers/braze-instance.js";import ht from"./utils/push-utils.js";export function isPushBlocked(){if(e.rr())return ht.isPushBlocked()}
1
+ import e from "../managers/braze-instance.js";
2
+ import dt from "./utils/push-utils.js";
3
+ export function isPushBlocked() {
4
+ if (e.rr()) return dt.isPushBlocked();
5
+ }
@@ -1 +1,5 @@
1
- import e from"../managers/braze-instance.js";import ht from"./utils/push-utils.js";export function isPushPermissionGranted(){if(e.rr())return ht.isPushPermissionGranted()}
1
+ import e from "../managers/braze-instance.js";
2
+ import dt from "./utils/push-utils.js";
3
+ export function isPushPermissionGranted() {
4
+ if (e.rr()) return dt.isPushPermissionGranted();
5
+ }
@@ -1 +1,5 @@
1
- import e from"../managers/braze-instance.js";import ht from"./utils/push-utils.js";export function isPushSupported(){if(e.rr())return ht.isPushSupported()}
1
+ import e from "../managers/braze-instance.js";
2
+ import dt from "./utils/push-utils.js";
3
+ export function isPushSupported() {
4
+ if (e.rr()) return dt.isPushSupported();
5
+ }
@@ -1 +1,30 @@
1
- import e,{OPTIONS as T}from"../managers/braze-instance.js";import aa from"./push-manager.js";const ea={t:!1,pushManager:null,aa:()=>(ea.o(),ea.pushManager||(ea.pushManager=new aa(e.gr(),e.ea(),e.ce(),e.Ks(),e.nn(T.na),e.nn(T.ra),e.ir(),e.nn(T.ta),e.nn(T.ia),e.l())),ea.pushManager),o:()=>{ea.t||(e.u(ea),ea.t=!0)},destroy:()=>{ea.pushManager=null,ea.t=!1}};export default ea;
1
+ import e, { OPTIONS as T } from "../managers/braze-instance.js";
2
+ import aa from "./push-manager.js";
3
+ const ea = {
4
+ t: !1,
5
+ pushManager: null,
6
+ aa: () => (
7
+ ea.o(),
8
+ ea.pushManager ||
9
+ (ea.pushManager = new aa(
10
+ e.gr(),
11
+ e.ea(),
12
+ e.ce(),
13
+ e.Ks(),
14
+ e.nn(T.na),
15
+ e.nn(T.ra),
16
+ e.ir(),
17
+ e.nn(T.ta),
18
+ e.nn(T.ia),
19
+ e.l()
20
+ )),
21
+ ea.pushManager
22
+ ),
23
+ o: () => {
24
+ ea.t || (e.u(ea), (ea.t = !0));
25
+ },
26
+ destroy: () => {
27
+ (ea.pushManager = null), (ea.t = !1);
28
+ }
29
+ };
30
+ export default ea;
@@ -1 +1,360 @@
1
- import{isArray as p,isEqual as ii}from"../util/code-utils.js";import ei from"../models/push-token.js";import r from"../../shared-lib/braze-shared-lib.js";import{STORAGE_KEYS as o}from"../managers/storage-manager.js";import{User}from"../User/index.js";import{WindowUtils as H}from"../util/window-utils.js";import ht from"./utils/push-utils.js";export default class aa{constructor(i,e,t,s,r,n,o,u,a,h){this.qi=i,this.Ji=e,this.Qi=t,this.Zi=s+"/safari/"+e,this.Sr=r||"/service-worker.js",this._r=n,this.gt=o,this.Ur=u||!1,this.Wr=a||!1,this.h=h,this.Nr=ht.Ir(),this.Vr=ht.Cr()}Er(){return this.Wr}Or(i,e,t,s,n){i.unsubscribe().then((i=>{i?this.Br(e,t,s,n):(r.D.error("Failed to unsubscribe device from push."),"function"==typeof n&&n(!1))})).catch((i=>{r.D.error("Push unsubscription error: "+i),"function"==typeof n&&n(!1)}))}Mr(i,e,t){const s=(i=>{if("string"==typeof i)return i;if(0!==i.endpoint.indexOf("https://android.googleapis.com/gcm/send"))return i.endpoint;let e=i.endpoint;return i.Yr&&-1===i.endpoint.indexOf(i.Yr)&&(e=i.endpoint+"/"+i.Yr),e})(i);let r=null,n=null;if(null!=i.getKey)try{r=btoa(String.fromCharCode.apply(null,new Uint8Array(i.getKey("p256dh")))),n=btoa(String.fromCharCode.apply(null,new Uint8Array(i.getKey("auth"))))}catch(i){if("invalid arguments"!==i.message)throw i}const o=(i=>{let e;return i.options&&(e=i.options.applicationServerKey)&&e.byteLength&&e.byteLength>0?btoa(String.fromCharCode.apply(null,new Uint8Array(e))).replace(/\+/g,"-").replace(/\//g,"_"):null})(i);this.qi.Gr(s,t,r,n,o),s&&"function"==typeof e&&e(s,r,n)}Hr(){this.qi.Jr(!0)}Kr(i,e){this.qi.Jr(!1),r.D.info(i),"function"==typeof e&&e(!1)}Lr(i,e,t,s){if("default"===e.permission)try{window.safari.pushNotification.requestPermission(this.Zi,i,{api_key:this.Ji,device_id:this.Qi.te().id},(e=>{"granted"===e.permission&&this.qi.setPushNotificationSubscriptionType(User.NotificationSubscriptionTypes.OPTED_IN),this.Lr(i,e,t,s)}))}catch(i){this.Kr("Could not request permission for push: "+i,s)}else"denied"===e.permission?this.Kr("The user has blocked notifications from this site, or Safari push is not configured in the Braze dashboard.",s):"granted"===e.permission&&(r.D.info("Device successfully subscribed to push."),this.Mr(e.deviceToken,t,new Date))}Qr(i,e,t){const s=s=>{switch(s){case"granted":return void("function"==typeof i&&i());case"default":return void("function"==typeof e&&e());case"denied":return void("function"==typeof t&&t());default:r.D.error("Received unexpected permission result "+s)}};let n=!1;const o=window.Notification.requestPermission((i=>{n&&s(i)}));o?o.then((i=>{s(i)})):n=!0}Br(i,e,t,s){const n={userVisibleOnly:!0};null!=e&&(n.applicationServerKey=e),i.pushManager.subscribe(n).then((i=>{r.D.info("Device successfully subscribed to push."),this.Mr(i,t,new Date)})).catch((i=>{ht.isPushBlocked()?(r.D.info("Permission for push notifications was denied."),"function"==typeof s&&s(!1)):r.D.error("Push subscription failed: "+i)}))}Xr(){return this.Ur?navigator.serviceWorker.getRegistration():navigator.serviceWorker.register(this.Sr).then((()=>navigator.serviceWorker.ready.then((i=>(i&&"function"==typeof i.update&&i.update().catch((i=>{r.D.info("ServiceWorker update failed: "+i)})),i)))))}Zr(i){this.Ur||(i.unregister(),r.D.info("Service worker successfully unregistered."))}subscribe(i,e){if(ht.isPushSupported()){if(this.Nr){if(!this.Ur&&null!=window.location){let i=this.Sr;-1===i.indexOf(window.location.host)&&(i=window.location.host+i),-1===i.indexOf(window.location.protocol)&&(i=window.location.protocol+"//"+i);const e=i.substr(0,i.lastIndexOf("/")+1);if(0!==H.hn().indexOf(e))return void r.D.error("Cannot subscribe to push from a path higher than the service worker location (tried to subscribe from "+window.location.pathname+" but service worker is at "+i+")")}if(ht.isPushBlocked())return void this.Kr("Notifications from this site are blocked. This may be a temporary embargo or a permanent denial.",e);if(this.gt&&!this.gt.fn()&&0===this.gt.Zs())return r.D.info("Waiting for VAPID key from server config before subscribing to push."),void this.gt.dn((()=>{this.subscribe(i,e)}));const t=()=>{r.D.info("Permission for push notifications was denied."),"function"==typeof e&&e(!1)},s=()=>{let i="Permission for push notifications was ignored.";ht.isPushBlocked()&&(i+=" The browser has automatically blocked further permission requests for a period (probably 1 week)."),r.D.info(i),"function"==typeof e&&e(!0)},n=ht.isPushPermissionGranted(),u=()=>{n||this.qi.setPushNotificationSubscriptionType(User.NotificationSubscriptionTypes.OPTED_IN),this.Xr().then((t=>{if(null==t)return r.D.error("No service worker registration. Set the `manageServiceWorkerExternally` initialization option to false or ensure that your service worker is registered before calling registerPush."),void("function"==typeof e&&e());t.pushManager.getSubscription().then((s=>{let n=null;if(this.gt&&null!=this.gt.fn()&&(n=r.bn.pn(this.gt.fn())),s){let u=null,a=null;const h=this.h.I(o.q.gn);if(h&&!p(h)){let i;try{i=ei.yn(h).wn}catch(e){i=null}null==i||isNaN(i.getTime())||0===i.getTime()||(u=i,a=new Date(u),a.setMonth(u.getMonth()+6))}null!=n&&s.options&&s.options.applicationServerKey&&s.options.applicationServerKey.byteLength&&s.options.applicationServerKey.byteLength>0&&!ii(n,new Uint8Array(s.options.applicationServerKey))?(s.options.applicationServerKey.byteLength>12?r.D.info("Device was already subscribed to push using a different VAPID provider, creating new subscription."):r.D.info("Attempting to upgrade a gcm_sender_id-based push registration to VAPID - depending on the browser this may or may not result in the same gcm_sender_id-based subscription."),this.Or(s,t,n,i,e)):s.expirationTime&&new Date(s.expirationTime)<=(new Date).valueOf()?(r.D.info("Push subscription is expired, creating new subscription."),this.Or(s,t,n,i,e)):h&&p(h)?this.Or(s,t,n,i,e):null==a?(r.D.info("No push subscription creation date found, creating new subscription."),this.Or(s,t,n,i,e)):a<=(new Date).valueOf()?(r.D.info("Push subscription older than 6 months, creating new subscription."),this.Or(s,t,n,i,e)):(r.D.info("Device already subscribed to push, sending existing subscription to backend."),this.Mr(s,i,u))}else this.Br(t,n,i,e)})).catch((i=>{r.D.error("Error checking current push subscriptions: "+i)}))})).catch((i=>{r.D.error("ServiceWorker registration failed: "+i)}))};this.Qr(u,s,t)}else if(this.Vr){if(null==this._r||""===this._r)return void r.D.error("You must supply the safariWebsitePushId initialization option in order to use registerPush on Safari");const t=window.safari.pushNotification.permission(this._r);this.Lr(this._r,t,i,e)}}else r.D.info(this.vn)}unsubscribe(i,e){ht.isPushSupported()?this.Nr?navigator.serviceWorker.getRegistration().then((t=>{t?t.pushManager.getSubscription().then((s=>{s&&(this.Hr(),s.unsubscribe().then((s=>{s?(r.D.info("Device successfully unsubscribed from push."),"function"==typeof i&&i()):(r.D.error("Failed to unsubscribe device from push."),"function"==typeof e&&e()),this.Zr(t)})).catch((i=>{r.D.error("Push unsubscription error: "+i),"function"==typeof e&&e()})))})).catch((i=>{r.D.error("Error unsubscribing from push: "+i),"function"==typeof e&&e()})):(r.D.info("Device already unsubscribed from push."),"function"==typeof i&&i())})):this.Vr&&(this.Hr(),r.D.info("Device unsubscribed from push."),"function"==typeof i&&i()):r.D.info(this.vn)}}aa.vn="Push notifications are not supported in this browser.";
1
+ import { isArray as p, isEqual as ii } from "../util/code-utils.js";
2
+ import ei from "../models/push-token.js";
3
+ import r from "../../shared-lib/braze-shared-lib.js";
4
+ import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
5
+ import { User } from "../User/index.js";
6
+ import { WindowUtils as H } from "../util/window-utils.js";
7
+ import dt from "./utils/push-utils.js";
8
+ export default class aa {
9
+ constructor(i, e, t, s, r, n, o, u, a, h) {
10
+ (this.Sr = i),
11
+ (this._r = e),
12
+ (this.Ur = t),
13
+ (this.Wr = s + "/safari/" + e),
14
+ (this.Nr = r || "/service-worker.js"),
15
+ (this.Ir = n),
16
+ (this.gt = o),
17
+ (this.Vr = u || !1),
18
+ (this.Cr = a || !1),
19
+ (this.h = h),
20
+ (this.Er = dt.Or()),
21
+ (this.Br = dt.Mr());
22
+ }
23
+ Yr() {
24
+ return this.Cr;
25
+ }
26
+ Gr(i, e, t, s, n) {
27
+ i.unsubscribe()
28
+ .then(i => {
29
+ i
30
+ ? this.Hr(e, t, s, n)
31
+ : (r.D.error("Failed to unsubscribe device from push."),
32
+ "function" == typeof n && n(!1));
33
+ })
34
+ .catch(i => {
35
+ r.D.error("Push unsubscription error: " + i),
36
+ "function" == typeof n && n(!1);
37
+ });
38
+ }
39
+ Jr(i, e, t) {
40
+ const s = (i => {
41
+ if ("string" == typeof i) return i;
42
+ if (0 !== i.endpoint.indexOf("https://android.googleapis.com/gcm/send"))
43
+ return i.endpoint;
44
+ let e = i.endpoint;
45
+ return (
46
+ i.Kr &&
47
+ -1 === i.endpoint.indexOf(i.Kr) &&
48
+ (e = i.endpoint + "/" + i.Kr),
49
+ e
50
+ );
51
+ })(i);
52
+ let r = null,
53
+ n = null;
54
+ if (null != i.getKey)
55
+ try {
56
+ (r = btoa(
57
+ String.fromCharCode.apply(null, new Uint8Array(i.getKey("p256dh")))
58
+ )),
59
+ (n = btoa(
60
+ String.fromCharCode.apply(null, new Uint8Array(i.getKey("auth")))
61
+ ));
62
+ } catch (i) {
63
+ if ("invalid arguments" !== i.message) throw i;
64
+ }
65
+ const o = (i => {
66
+ let e;
67
+ return i.options &&
68
+ (e = i.options.applicationServerKey) &&
69
+ e.byteLength &&
70
+ e.byteLength > 0
71
+ ? btoa(String.fromCharCode.apply(null, new Uint8Array(e)))
72
+ .replace(/\+/g, "-")
73
+ .replace(/\//g, "_")
74
+ : null;
75
+ })(i);
76
+ this.Sr.Lr(s, t, r, n, o), s && "function" == typeof e && e(s, r, n);
77
+ }
78
+ Qr() {
79
+ this.Sr.Xr(!0);
80
+ }
81
+ Zr(i, e) {
82
+ this.Sr.Xr(!1), r.D.info(i), "function" == typeof e && e(!1);
83
+ }
84
+ hn(i, e, t, s) {
85
+ if ("default" === e.permission)
86
+ try {
87
+ window.safari.pushNotification.requestPermission(
88
+ this.Wr,
89
+ i,
90
+ { api_key: this._r, device_id: this.Ur.te().id },
91
+ e => {
92
+ "granted" === e.permission &&
93
+ this.Sr.setPushNotificationSubscriptionType(
94
+ User.NotificationSubscriptionTypes.OPTED_IN
95
+ ),
96
+ this.hn(i, e, t, s);
97
+ }
98
+ );
99
+ } catch (i) {
100
+ this.Zr("Could not request permission for push: " + i, s);
101
+ }
102
+ else
103
+ "denied" === e.permission
104
+ ? this.Zr(
105
+ "The user has blocked notifications from this site, or Safari push is not configured in the Braze dashboard.",
106
+ s
107
+ )
108
+ : "granted" === e.permission &&
109
+ (r.D.info("Device successfully subscribed to push."),
110
+ this.Jr(e.deviceToken, t, new Date()));
111
+ }
112
+ fn(i, e, t) {
113
+ const s = s => {
114
+ switch (s) {
115
+ case "granted":
116
+ return void ("function" == typeof i && i());
117
+ case "default":
118
+ return void ("function" == typeof e && e());
119
+ case "denied":
120
+ return void ("function" == typeof t && t());
121
+ default:
122
+ r.D.error("Received unexpected permission result " + s);
123
+ }
124
+ };
125
+ let n = !1;
126
+ const o = window.Notification.requestPermission(i => {
127
+ n && s(i);
128
+ });
129
+ o
130
+ ? o.then(i => {
131
+ s(i);
132
+ })
133
+ : (n = !0);
134
+ }
135
+ Hr(i, e, t, s) {
136
+ const n = { userVisibleOnly: !0 };
137
+ null != e && (n.applicationServerKey = e),
138
+ i.pushManager
139
+ .subscribe(n)
140
+ .then(i => {
141
+ r.D.info("Device successfully subscribed to push."),
142
+ this.Jr(i, t, new Date());
143
+ })
144
+ .catch(i => {
145
+ dt.isPushBlocked()
146
+ ? (r.D.info("Permission for push notifications was denied."),
147
+ "function" == typeof s && s(!1))
148
+ : r.D.error("Push subscription failed: " + i);
149
+ });
150
+ }
151
+ dn() {
152
+ return this.Vr
153
+ ? navigator.serviceWorker.getRegistration()
154
+ : navigator.serviceWorker.register(this.Nr).then(() =>
155
+ navigator.serviceWorker.ready.then(
156
+ i => (
157
+ i &&
158
+ "function" == typeof i.update &&
159
+ i.update().catch(i => {
160
+ r.D.info("ServiceWorker update failed: " + i);
161
+ }),
162
+ i
163
+ )
164
+ )
165
+ );
166
+ }
167
+ pn(i) {
168
+ this.Vr ||
169
+ (i.unregister(), r.D.info("Service worker successfully unregistered."));
170
+ }
171
+ subscribe(i, e) {
172
+ if (dt.isPushSupported()) {
173
+ if (this.Er) {
174
+ if (!this.Vr && null != window.location) {
175
+ let i = this.Nr;
176
+ -1 === i.indexOf(window.location.host) &&
177
+ (i = window.location.host + i),
178
+ -1 === i.indexOf(window.location.protocol) &&
179
+ (i = window.location.protocol + "//" + i);
180
+ const e = i.substr(0, i.lastIndexOf("/") + 1);
181
+ if (0 !== H.bn().indexOf(e))
182
+ return void r.D.error(
183
+ "Cannot subscribe to push from a path higher than the service worker location (tried to subscribe from " +
184
+ window.location.pathname +
185
+ " but service worker is at " +
186
+ i +
187
+ ")"
188
+ );
189
+ }
190
+ if (dt.isPushBlocked())
191
+ return void this.Zr(
192
+ "Notifications from this site are blocked. This may be a temporary embargo or a permanent denial.",
193
+ e
194
+ );
195
+ if (this.gt && !this.gt.gn() && 0 === this.gt.Zs())
196
+ return (
197
+ r.D.info(
198
+ "Waiting for VAPID key from server config before subscribing to push."
199
+ ),
200
+ void this.gt.wn(() => {
201
+ this.subscribe(i, e);
202
+ })
203
+ );
204
+ const t = () => {
205
+ r.D.info("Permission for push notifications was denied."),
206
+ "function" == typeof e && e(!1);
207
+ },
208
+ s = () => {
209
+ let i = "Permission for push notifications was ignored.";
210
+ dt.isPushBlocked() &&
211
+ (i +=
212
+ " The browser has automatically blocked further permission requests for a period (probably 1 week)."),
213
+ r.D.info(i),
214
+ "function" == typeof e && e(!0);
215
+ },
216
+ n = dt.isPushPermissionGranted(),
217
+ u = () => {
218
+ n ||
219
+ this.Sr.setPushNotificationSubscriptionType(
220
+ User.NotificationSubscriptionTypes.OPTED_IN
221
+ ),
222
+ this.dn()
223
+ .then(t => {
224
+ if (null == t)
225
+ return (
226
+ r.D.error(
227
+ "No service worker registration. Set the `manageServiceWorkerExternally` initialization option to false or ensure that your service worker is registered before calling registerPush."
228
+ ),
229
+ void ("function" == typeof e && e())
230
+ );
231
+ t.pushManager
232
+ .getSubscription()
233
+ .then(s => {
234
+ let n = null;
235
+ if (
236
+ (this.gt &&
237
+ null != this.gt.gn() &&
238
+ (n = r.vn.yn(this.gt.gn())),
239
+ s)
240
+ ) {
241
+ let u = null,
242
+ a = null;
243
+ const h = this.h.I(o.q.kn);
244
+ if (h && !p(h)) {
245
+ let i;
246
+ try {
247
+ i = ei.Dn(h).Pn;
248
+ } catch (e) {
249
+ i = null;
250
+ }
251
+ null == i ||
252
+ isNaN(i.getTime()) ||
253
+ 0 === i.getTime() ||
254
+ ((u = i),
255
+ (a = new Date(u)),
256
+ a.setMonth(u.getMonth() + 6));
257
+ }
258
+ null != n &&
259
+ s.options &&
260
+ s.options.applicationServerKey &&
261
+ s.options.applicationServerKey.byteLength &&
262
+ s.options.applicationServerKey.byteLength > 0 &&
263
+ !ii(n, new Uint8Array(s.options.applicationServerKey))
264
+ ? (s.options.applicationServerKey.byteLength > 12
265
+ ? r.D.info(
266
+ "Device was already subscribed to push using a different VAPID provider, creating new subscription."
267
+ )
268
+ : r.D.info(
269
+ "Attempting to upgrade a gcm_sender_id-based push registration to VAPID - depending on the browser this may or may not result in the same gcm_sender_id-based subscription."
270
+ ),
271
+ this.Gr(s, t, n, i, e))
272
+ : s.expirationTime &&
273
+ new Date(s.expirationTime) <= new Date().valueOf()
274
+ ? (r.D.info(
275
+ "Push subscription is expired, creating new subscription."
276
+ ),
277
+ this.Gr(s, t, n, i, e))
278
+ : h && p(h)
279
+ ? this.Gr(s, t, n, i, e)
280
+ : null == a
281
+ ? (r.D.info(
282
+ "No push subscription creation date found, creating new subscription."
283
+ ),
284
+ this.Gr(s, t, n, i, e))
285
+ : a <= new Date().valueOf()
286
+ ? (r.D.info(
287
+ "Push subscription older than 6 months, creating new subscription."
288
+ ),
289
+ this.Gr(s, t, n, i, e))
290
+ : (r.D.info(
291
+ "Device already subscribed to push, sending existing subscription to backend."
292
+ ),
293
+ this.Jr(s, i, u));
294
+ } else this.Hr(t, n, i, e);
295
+ })
296
+ .catch(i => {
297
+ r.D.error(
298
+ "Error checking current push subscriptions: " + i
299
+ );
300
+ });
301
+ })
302
+ .catch(i => {
303
+ r.D.error("ServiceWorker registration failed: " + i);
304
+ });
305
+ };
306
+ this.fn(u, s, t);
307
+ } else if (this.Br) {
308
+ if (null == this.Ir || "" === this.Ir)
309
+ return void r.D.error(
310
+ "You must supply the safariWebsitePushId initialization option in order to use registerPush on Safari"
311
+ );
312
+ const t = window.safari.pushNotification.permission(this.Ir);
313
+ this.hn(this.Ir, t, i, e);
314
+ }
315
+ } else r.D.info(this.Sn);
316
+ }
317
+ unsubscribe(i, e) {
318
+ dt.isPushSupported()
319
+ ? this.Er
320
+ ? navigator.serviceWorker.getRegistration().then(t => {
321
+ t
322
+ ? t.pushManager
323
+ .getSubscription()
324
+ .then(s => {
325
+ s &&
326
+ (this.Qr(),
327
+ s
328
+ .unsubscribe()
329
+ .then(s => {
330
+ s
331
+ ? (r.D.info(
332
+ "Device successfully unsubscribed from push."
333
+ ),
334
+ "function" == typeof i && i())
335
+ : (r.D.error(
336
+ "Failed to unsubscribe device from push."
337
+ ),
338
+ "function" == typeof e && e()),
339
+ this.pn(t);
340
+ })
341
+ .catch(i => {
342
+ r.D.error("Push unsubscription error: " + i),
343
+ "function" == typeof e && e();
344
+ }));
345
+ })
346
+ .catch(i => {
347
+ r.D.error("Error unsubscribing from push: " + i),
348
+ "function" == typeof e && e();
349
+ })
350
+ : (r.D.info("Device already unsubscribed from push."),
351
+ "function" == typeof i && i());
352
+ })
353
+ : this.Br &&
354
+ (this.Qr(),
355
+ r.D.info("Device unsubscribed from push."),
356
+ "function" == typeof i && i())
357
+ : r.D.info(this.Sn);
358
+ }
359
+ }
360
+ aa.Sn = "Push notifications are not supported in this browser.";
@@ -1 +1,8 @@
1
- import e from"../managers/braze-instance.js";import ea from"./push-manager-factory.js";export function requestPushPermission(r,n){if(e.rr())return ea.aa().subscribe(((n,o,t)=>{e.mr().requestImmediateDataFlush(),"function"==typeof r&&r(n,o,t)}),n)}
1
+ import e from "../managers/braze-instance.js";
2
+ import ea from "./push-manager-factory.js";
3
+ export function requestPushPermission(r, n) {
4
+ if (e.rr())
5
+ return ea.aa().subscribe((n, o, t) => {
6
+ e.mr().requestImmediateDataFlush(), "function" == typeof r && r(n, o, t);
7
+ }, n);
8
+ }
@@ -1 +1,5 @@
1
- import e from"../managers/braze-instance.js";import ea from"./push-manager-factory.js";export function unregisterPush(r,n){if(e.rr())return ea.aa().unsubscribe(r,n)}
1
+ import e from "../managers/braze-instance.js";
2
+ import ea from "./push-manager-factory.js";
3
+ export function unregisterPush(r, n) {
4
+ if (e.rr()) return ea.aa().unsubscribe(r, n);
5
+ }