@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,283 @@
1
- import b,{readResponseHeaders as C}from"../util/net.js";import y from"../common/base-provider.js";import e from"../managers/braze-instance.js";import ContentCards from"./content-cards.js";import{dateFromUnixTimestamp as h}from"../util/date-utils.js";import{isURIJavascriptOrData as j}from"../util/url-utils.js";import{newCardFromContentCardsJson as N,newCardFromSerializedValue as S}from"../Card/util/card-factory.js";import r from"../../shared-lib/braze-shared-lib.js";import{STORAGE_KEYS as o}from"../managers/storage-manager.js";import u from"../managers/subscription-manager.js";import s from"../common/event-logger.js";export default class v extends y{constructor(t,s,i,h,n){super(),this.v=t,this.h=s,this.gt=i,this.wt=h,this.vt=n,this.yt=new u,e.jt(this.yt),this.Ut=0,this.kt=0,this.zt();const o=r.xt.Ft;new r.qt(o,r.D).Jt(o.$t.Mt,(t=>{this.Bt(t)})),this.Gt=null}Ht(){return this.Kt}Qt(t){this.Kt=t}Vt(){return this.Wt}Xt(t){this.Wt=t}zt(){const t=this.h.I(o.q.Yt)||[],s=[];for(let i=0;i<t.length;i++){const e=S(t[i]);null!=e&&s.push(e)}this.Zt=this.Cs(this.ws(s,!1)),this.Ut=this.h.I(o.q.vs)||this.Ut,this.kt=this.h.I(o.q.ys)||this.kt}Ns(t,s,i,e){let h;if(s){h=[];for(const t of this.Zt)t.test&&h.push(t)}else h=this.Zt.slice();for(let i=0;i<t.length;i++){const e=t[i];let r=null;for(let t=0;t<this.Zt.length;t++)if(e.id===this.Zt[t].id){r=this.Zt[t];break}if(s){const t=N(e);null!=r&&r.viewed&&(t.viewed=!0),null!=t&&h.push(t)}else if(null==r){const t=N(e);null!=t&&h.push(t)}else{if(!r.ct(e))for(let t=0;t<h.length;t++)if(e.id===h[t].id){h.splice(t,1);break}}}this.Zt=this.Cs(this.ws(h,s)),this.Ss(),this.Ut=i||0,this.h.B(o.q.vs,this.Ut),this.kt=e||0,this.h.B(o.q.ys,this.kt)}Rs(t){if(this.Ts()&&null!=t&&t.cards){this.h.B(o.q._s,e.Ds());const s=t.full_sync;s||this.zt(),this.Ns(t.cards,s,t.last_full_sync_at,t.last_card_updated_at),this.yt.St(this.Us(!0))}}Fs(t){this.h.B(o.q.As,t)}Ls(t,i,e){const h=()=>{this.Is(i,e,!0)},n=C(t);let a,l;if(this.Js(),!n["retry-after"])return void this.Fs(0);if(a=n["retry-after"],isNaN(a)&&!isNaN(Date.parse(a)))l=Date.parse(a)-(new Date).getTime(),l<0&&h();else{if(isNaN(parseFloat(a))){const t="Received unexpected value for retry-after header in /sync response";return s.G(r.A.qs,{e:t+": "+a}),void this.Fs(0)}l=1e3*a}this.Gt=setTimeout((()=>{h()}),l);let c=this.h.I(o.q.As);c&&!isNaN(parseInt(c))||(c=0),this.Fs(parseInt(c)+1)}Bt(t){if(!this.Ts())return;this.zt();const s=this.Zt.slice(),i=this.v.getUserId();for(let e=0;e<t.length;e++)if(i===t[e].userId||null==i&&null==t[e].userId){const i=t[e].card;let h=null;for(let t=0;t<this.Zt.length;t++)if(i.id===this.Zt[t].id){h=this.Zt[t];break}if(null==h){const t=N(i);null!=t&&s.push(t)}else{if(!h.ct(i))for(let t=0;t<s.length;t++)if(i.id===s[t].id){s.splice(t,1);break}}}this.Zt=this.Cs(this.ws(s,!1)),this.Ss(),this.yt.St(this.Us(!0))}ws(t,s){const i=this.h.I(o.q.$)||{},e=this.h.I(o.q.O)||{},h=this.h.I(o.q.K)||{},r={},n={},a={};for(let s=0;s<t.length;s++)i[t[s].id]&&(t[s].clicked=!0,r[t[s].id]=!0),e[t[s].id]&&(t[s].viewed=!0,n[t[s].id]=!0),h[t[s].id]&&(t[s].dismissed=!0,a[t[s].id]=!0);return s&&(this.h.B(o.q.$,r),this.h.B(o.q.O,n),this.h.B(o.q.K,a)),t}Cs(t){const s=[],i=new Date,e=this.h.I(o.q.K)||{};let h=!1;for(let n=0;n<t.length;n++){const o=t[n].url;!this.wt&&o&&j(o)?r.D.error(`Card with url ${o} will not be displayed because Javascript URLs are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable this card.`):(null==t[n].expiresAt||t[n].expiresAt>=i)&&!t[n].dismissed?s.push(t[n]):(e[t[n].id]=!0,h=!0)}return h&&this.h.B(o.q.K,e),s}Ss(){const t=[];for(let s=0;s<this.Zt.length;s++)t.push(this.Zt[s].ss());this.h.B(o.q.Yt,t)}Js(){this.Gt&&(clearTimeout(this.Gt),this.Gt=null)}Is(t,s,i){if(i||(this.Js(),this.Fs(0)),!this.Ts())return void(this.Es||(this.Es=this.gt.Ms((()=>{this.Is(t,s)}))));const h=this.vt.Ps({},!0);this.h.I(o.q._s)!==e.Ds()&&this.$s(),h.last_full_sync_at=this.Ut,h.last_card_updated_at=this.kt;const r=this.vt.Bs(h,!0,i);this.vt.Gs(h,(()=>{b.Hs({url:this.vt.Ks()+"/content_cards/sync",data:h,headers:r,S:(i,e)=>{this.vt.Os(h,i,r)?(this.vt.Qs(),this.Ls(e,t,s),this.Rs(i),"function"==typeof t&&t()):"function"==typeof s&&s()},error:t=>{this.vt.Vs(t,"retrieving content cards"),"function"==typeof s&&s()}})}))}Us(t){t||this.zt();const s=this.Cs(this.Zt);s.sort(((t,s)=>t.pinned&&!s.pinned?-1:s.pinned&&!t.pinned?1:t.updated>s.updated?-1:s.updated>t.updated?1:0));let i=Math.max(this.kt||0,this.Ut||0);return 0===i&&(i=void 0),this.h.I(o.q.ys)===this.kt&&void 0===i&&(i=this.kt),new ContentCards(s,h(i))}Ws(t){return this.yt.ut(t)}$s(){this.Ut=0,this.kt=0,this.h.Xs(o.q.vs),this.h.Xs(o.q.ys)}changeUser(t){t||(this.Zt=[],this.yt.St(new ContentCards(this.Zt.slice(),null)),this.h.Xs(o.q.Yt),this.h.Xs(o.q.$),this.h.Xs(o.q.O),this.h.Xs(o.q.K)),this.$s()}clearData(t){this.Ut=0,this.kt=0,this.Zt=[],this.yt.St(new ContentCards(this.Zt.slice(),null)),t&&(this.h.Xs(o.q.Yt),this.h.Xs(o.q.$),this.h.Xs(o.q.O),this.h.Xs(o.q.K),this.h.Xs(o.q.vs),this.h.Xs(o.q.ys))}Ts(){return!!this.gt.Ys()||(0!==this.gt.Zs()&&this.ti(),!1)}ti(){this.yt.St(new ContentCards([],(new Date).valueOf())),this.h.Xs(o.q.Yt)}}
1
+ import b, { readResponseHeaders as C } from "../util/net.js";
2
+ import y from "../common/base-provider.js";
3
+ import e from "../managers/braze-instance.js";
4
+ import ContentCards from "./content-cards.js";
5
+ import { dateFromUnixTimestamp as h } from "../util/date-utils.js";
6
+ import { isURIJavascriptOrData as j } from "../util/url-utils.js";
7
+ import {
8
+ newCardFromContentCardsJson as N,
9
+ newCardFromSerializedValue as S
10
+ } from "../Card/util/card-factory.js";
11
+ import r from "../../shared-lib/braze-shared-lib.js";
12
+ import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
13
+ import u from "../managers/subscription-manager.js";
14
+ import s from "../common/event-logger.js";
15
+ export default class v extends y {
16
+ constructor(t, s, i, h, n) {
17
+ super(),
18
+ (this.v = t),
19
+ (this.h = s),
20
+ (this.gt = i),
21
+ (this.wt = h),
22
+ (this.vt = n),
23
+ (this.yt = new u()),
24
+ e.jt(this.yt),
25
+ (this.Ut = 0),
26
+ (this.kt = 0),
27
+ this.zt();
28
+ const o = r.xt.Ft;
29
+ new r.qt(o, r.D).Jt(o.$t.Mt, t => {
30
+ this.Bt(t);
31
+ }),
32
+ (this.Gt = null);
33
+ }
34
+ Ht() {
35
+ return this.Kt;
36
+ }
37
+ Qt(t) {
38
+ this.Kt = t;
39
+ }
40
+ Vt() {
41
+ return this.Wt;
42
+ }
43
+ Xt(t) {
44
+ this.Wt = t;
45
+ }
46
+ zt() {
47
+ const t = this.h.I(o.q.Yt) || [],
48
+ s = [];
49
+ for (let i = 0; i < t.length; i++) {
50
+ const e = S(t[i]);
51
+ null != e && s.push(e);
52
+ }
53
+ (this.Zt = this.Cs(this.ws(s, !1))),
54
+ (this.Ut = this.h.I(o.q.vs) || this.Ut),
55
+ (this.kt = this.h.I(o.q.ys) || this.kt);
56
+ }
57
+ Ns(t, s, i, e) {
58
+ let h;
59
+ if (s) {
60
+ h = [];
61
+ for (const t of this.Zt) t.test && h.push(t);
62
+ } else h = this.Zt.slice();
63
+ for (let i = 0; i < t.length; i++) {
64
+ const e = t[i];
65
+ let r = null;
66
+ for (let t = 0; t < this.Zt.length; t++)
67
+ if (e.id === this.Zt[t].id) {
68
+ r = this.Zt[t];
69
+ break;
70
+ }
71
+ if (s) {
72
+ const t = N(e);
73
+ null != r && r.viewed && (t.viewed = !0), null != t && h.push(t);
74
+ } else if (null == r) {
75
+ const t = N(e);
76
+ null != t && h.push(t);
77
+ } else {
78
+ if (!r.ct(e))
79
+ for (let t = 0; t < h.length; t++)
80
+ if (e.id === h[t].id) {
81
+ h.splice(t, 1);
82
+ break;
83
+ }
84
+ }
85
+ }
86
+ (this.Zt = this.Cs(this.ws(h, s))),
87
+ this.Ss(),
88
+ (this.Ut = i || 0),
89
+ this.h.B(o.q.vs, this.Ut),
90
+ (this.kt = e || 0),
91
+ this.h.B(o.q.ys, this.kt);
92
+ }
93
+ Rs(t) {
94
+ if (this.Ts() && null != t && t.cards) {
95
+ this.h.B(o.q._s, e.Ds());
96
+ const s = t.full_sync;
97
+ s || this.zt(),
98
+ this.Ns(t.cards, s, t.last_full_sync_at, t.last_card_updated_at),
99
+ this.yt.St(this.Us(!0));
100
+ }
101
+ }
102
+ Fs(t) {
103
+ this.h.B(o.q.As, t);
104
+ }
105
+ Ls(t, i, e) {
106
+ const h = () => {
107
+ this.Is(i, e, !0);
108
+ },
109
+ n = C(t);
110
+ let a, l;
111
+ if ((this.Js(), !n["retry-after"])) return void this.Fs(0);
112
+ if (((a = n["retry-after"]), isNaN(a) && !isNaN(Date.parse(a))))
113
+ (l = Date.parse(a) - new Date().getTime()), l < 0 && h();
114
+ else {
115
+ if (isNaN(parseFloat(a))) {
116
+ const t =
117
+ "Received unexpected value for retry-after header in /sync response";
118
+ return s.G(r.A.qs, { e: t + ": " + a }), void this.Fs(0);
119
+ }
120
+ l = 1e3 * a;
121
+ }
122
+ this.Gt = setTimeout(() => {
123
+ h();
124
+ }, l);
125
+ let c = this.h.I(o.q.As);
126
+ (c && !isNaN(parseInt(c))) || (c = 0), this.Fs(parseInt(c) + 1);
127
+ }
128
+ Bt(t) {
129
+ if (!this.Ts()) return;
130
+ this.zt();
131
+ const s = this.Zt.slice(),
132
+ i = this.v.getUserId();
133
+ for (let e = 0; e < t.length; e++)
134
+ if (i === t[e].userId || (null == i && null == t[e].userId)) {
135
+ const i = t[e].card;
136
+ let h = null;
137
+ for (let t = 0; t < this.Zt.length; t++)
138
+ if (i.id === this.Zt[t].id) {
139
+ h = this.Zt[t];
140
+ break;
141
+ }
142
+ if (null == h) {
143
+ const t = N(i);
144
+ null != t && s.push(t);
145
+ } else {
146
+ if (!h.ct(i))
147
+ for (let t = 0; t < s.length; t++)
148
+ if (i.id === s[t].id) {
149
+ s.splice(t, 1);
150
+ break;
151
+ }
152
+ }
153
+ }
154
+ (this.Zt = this.Cs(this.ws(s, !1))), this.Ss(), this.yt.St(this.Us(!0));
155
+ }
156
+ ws(t, s) {
157
+ const i = this.h.I(o.q.$) || {},
158
+ e = this.h.I(o.q.O) || {},
159
+ h = this.h.I(o.q.K) || {},
160
+ r = {},
161
+ n = {},
162
+ a = {};
163
+ for (let s = 0; s < t.length; s++)
164
+ i[t[s].id] && ((t[s].clicked = !0), (r[t[s].id] = !0)),
165
+ e[t[s].id] && ((t[s].viewed = !0), (n[t[s].id] = !0)),
166
+ h[t[s].id] && ((t[s].dismissed = !0), (a[t[s].id] = !0));
167
+ return s && (this.h.B(o.q.$, r), this.h.B(o.q.O, n), this.h.B(o.q.K, a)), t;
168
+ }
169
+ Cs(t) {
170
+ const s = [],
171
+ i = new Date(),
172
+ e = this.h.I(o.q.K) || {};
173
+ let h = !1;
174
+ for (let n = 0; n < t.length; n++) {
175
+ const o = t[n].url;
176
+ !this.wt && o && j(o)
177
+ ? r.D.error(
178
+ `Card with url ${o} will not be displayed because Javascript URLs are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable this card.`
179
+ )
180
+ : (null == t[n].expiresAt || t[n].expiresAt >= i) && !t[n].dismissed
181
+ ? s.push(t[n])
182
+ : ((e[t[n].id] = !0), (h = !0));
183
+ }
184
+ return h && this.h.B(o.q.K, e), s;
185
+ }
186
+ Ss() {
187
+ const t = [];
188
+ for (let s = 0; s < this.Zt.length; s++) t.push(this.Zt[s].ss());
189
+ this.h.B(o.q.Yt, t);
190
+ }
191
+ Js() {
192
+ this.Gt && (clearTimeout(this.Gt), (this.Gt = null));
193
+ }
194
+ Is(t, s, i) {
195
+ if ((i || (this.Js(), this.Fs(0)), !this.Ts()))
196
+ return void (
197
+ this.Es ||
198
+ (this.Es = this.gt.Ms(() => {
199
+ this.Is(t, s);
200
+ }))
201
+ );
202
+ const h = this.vt.Ps({}, !0);
203
+ this.h.I(o.q._s) !== e.Ds() && this.$s(),
204
+ (h.last_full_sync_at = this.Ut),
205
+ (h.last_card_updated_at = this.kt);
206
+ const r = this.vt.Bs(h, !0, !1, i);
207
+ this.vt.Gs(h, () => {
208
+ b.Hs({
209
+ url: this.vt.Ks() + "/content_cards/sync",
210
+ data: h,
211
+ headers: r,
212
+ S: (i, e) => {
213
+ this.vt.Os(h, i, r)
214
+ ? (this.vt.Qs(),
215
+ this.Ls(e, t, s),
216
+ this.Rs(i),
217
+ "function" == typeof t && t())
218
+ : "function" == typeof s && s();
219
+ },
220
+ error: t => {
221
+ this.vt.Vs(t, "retrieving content cards"),
222
+ "function" == typeof s && s();
223
+ }
224
+ });
225
+ });
226
+ }
227
+ Us(t) {
228
+ t || this.zt();
229
+ const s = this.Cs(this.Zt);
230
+ s.sort((t, s) =>
231
+ t.pinned && !s.pinned
232
+ ? -1
233
+ : s.pinned && !t.pinned
234
+ ? 1
235
+ : t.updated > s.updated
236
+ ? -1
237
+ : s.updated > t.updated
238
+ ? 1
239
+ : 0
240
+ );
241
+ let i = Math.max(this.kt || 0, this.Ut || 0);
242
+ return (
243
+ 0 === i && (i = void 0),
244
+ this.h.I(o.q.ys) === this.kt && void 0 === i && (i = this.kt),
245
+ new ContentCards(s, h(i))
246
+ );
247
+ }
248
+ Ws(t) {
249
+ return this.yt.ut(t);
250
+ }
251
+ $s() {
252
+ (this.Ut = 0), (this.kt = 0), this.h.Xs(o.q.vs), this.h.Xs(o.q.ys);
253
+ }
254
+ changeUser(t) {
255
+ t ||
256
+ ((this.Zt = []),
257
+ this.yt.St(new ContentCards(this.Zt.slice(), null)),
258
+ this.h.Xs(o.q.Yt),
259
+ this.h.Xs(o.q.$),
260
+ this.h.Xs(o.q.O),
261
+ this.h.Xs(o.q.K)),
262
+ this.$s();
263
+ }
264
+ clearData(t) {
265
+ (this.Ut = 0),
266
+ (this.kt = 0),
267
+ (this.Zt = []),
268
+ this.yt.St(new ContentCards(this.Zt.slice(), null)),
269
+ t &&
270
+ (this.h.Xs(o.q.Yt),
271
+ this.h.Xs(o.q.$),
272
+ this.h.Xs(o.q.O),
273
+ this.h.Xs(o.q.K),
274
+ this.h.Xs(o.q.vs),
275
+ this.h.Xs(o.q.ys));
276
+ }
277
+ Ts() {
278
+ return !!this.gt.Ys() || (0 !== this.gt.Zs() && this.ti(), !1);
279
+ }
280
+ ti() {
281
+ this.yt.St(new ContentCards([], new Date().valueOf())), this.h.Xs(o.q.Yt);
282
+ }
283
+ }
@@ -1 +1,24 @@
1
- import x from"../common/base-feed.js";import{logCardClick,logCardImpressions}from"../Card/index.js";import{requestContentCardsRefresh}from"./request-content-cards-refresh.js";export default class ContentCards extends x{constructor(r,e){super(r,e)}getUnviewedCardCount(){return super.getUnreadCardCount()}logCardImpressions(r){logCardImpressions(r,!0)}logCardClick(r){logCardClick(r,!0)}sr(){requestContentCardsRefresh()}dr(){return!0}}ContentCards.ur=6e4;
1
+ import x from "../common/base-feed.js";
2
+ import { logCardClick, logCardImpressions } from "../Card/index.js";
3
+ import { requestContentCardsRefresh } from "./request-content-cards-refresh.js";
4
+ export default class ContentCards extends x {
5
+ constructor(r, e) {
6
+ super(r, e);
7
+ }
8
+ getUnviewedCardCount() {
9
+ return super.getUnreadCardCount();
10
+ }
11
+ logCardImpressions(r) {
12
+ logCardImpressions(r, !0);
13
+ }
14
+ logCardClick(r) {
15
+ logCardClick(r, !0);
16
+ }
17
+ sr() {
18
+ requestContentCardsRefresh();
19
+ }
20
+ dr() {
21
+ return !0;
22
+ }
23
+ }
24
+ ContentCards.ur = 6e4;
@@ -1 +1,5 @@
1
- import g from"./content-cards-provider-factory.js";import e from"../managers/braze-instance.js";export function getCachedContentCards(){if(e.rr())return g.er().Us(!1)}
1
+ import g from "./content-cards-provider-factory.js";
2
+ import e from "../managers/braze-instance.js";
3
+ export function getCachedContentCards() {
4
+ if (e.rr()) return g.er().Us(!1);
5
+ }
@@ -1 +1,8 @@
1
- export{default as ContentCards}from"./content-cards.js";export{getCachedContentCards}from"./get-cached-content-cards.js";export{hideContentCards}from"./ui/hide-content-cards.js";export{logContentCardsDisplayed}from"./log-content-cards-displayed.js";export{requestContentCardsRefresh}from"./request-content-cards-refresh.js";export{showContentCards}from"./ui/show-content-cards.js";export{subscribeToContentCardsUpdates}from"./subscribe-to-content-cards-updates.js";export{toggleContentCards}from"./ui/toggle-content-cards.js";
1
+ export { default as ContentCards } from "./content-cards.js";
2
+ export { getCachedContentCards } from "./get-cached-content-cards.js";
3
+ export { hideContentCards } from "./ui/hide-content-cards.js";
4
+ export { logContentCardsDisplayed } from "./log-content-cards-displayed.js";
5
+ export { requestContentCardsRefresh } from "./request-content-cards-refresh.js";
6
+ export { showContentCards } from "./ui/show-content-cards.js";
7
+ export { subscribeToContentCardsUpdates } from "./subscribe-to-content-cards-updates.js";
8
+ export { toggleContentCards } from "./ui/toggle-content-cards.js";
@@ -1 +1,5 @@
1
- import e from"../managers/braze-instance.js";import{logDeprecationWarning as D}from"../util/deprecation-utils.js";export function logContentCardsDisplayed(){if(e.rr())return D("logContentCardsDisplayed","method"),!0}
1
+ import e from "../managers/braze-instance.js";
2
+ import { logDeprecationWarning as D } from "../util/deprecation-utils.js";
3
+ export function logContentCardsDisplayed() {
4
+ if (e.rr()) return D("logContentCardsDisplayed", "method"), !0;
5
+ }
@@ -1 +1,5 @@
1
- import e from"../managers/braze-instance.js";import g from"./content-cards-provider-factory.js";export function requestContentCardsRefresh(r,t){if(e.rr())return g.er().Is(r,t)}
1
+ import e from "../managers/braze-instance.js";
2
+ import g from "./content-cards-provider-factory.js";
3
+ export function requestContentCardsRefresh(r, t) {
4
+ if (e.rr()) return g.er().Is(r, t);
5
+ }
@@ -1 +1,14 @@
1
- import e from"../managers/braze-instance.js";import g from"./content-cards-provider-factory.js";export function subscribeToContentCardsUpdates(r){if(!e.rr())return;const t=g.er(),n=t.Ws(r);if(!t.Vt()){const r=e.mr().cr((()=>{t.Is()}));t.Xt(r)}return n}
1
+ import e from "../managers/braze-instance.js";
2
+ import g from "./content-cards-provider-factory.js";
3
+ export function subscribeToContentCardsUpdates(r) {
4
+ if (!e.rr()) return;
5
+ const t = g.er(),
6
+ n = t.Ws(r);
7
+ if (!t.Vt()) {
8
+ const r = e.mr().cr(() => {
9
+ t.Is();
10
+ });
11
+ t.Xt(r);
12
+ }
13
+ return n;
14
+ }
@@ -1 +1,8 @@
1
- import e from"../../managers/braze-instance.js";import{destroyFeedHtml as z}from"../../common/feed-display.js";export function hideContentCards(n){if(!e.rr())return;const o=document.querySelectorAll(".ab-feed");for(let e=0;e<o.length;e++)(null==n||null!=n&&o[e].parentNode===n)&&z(o[e])}
1
+ import e from "../../managers/braze-instance.js";
2
+ import { destroyFeedHtml as z } from "../../common/feed-display.js";
3
+ export function hideContentCards(n) {
4
+ if (!e.rr()) return;
5
+ const o = document.querySelectorAll(".ab-feed");
6
+ for (let e = 0; e < o.length; e++)
7
+ (null == n || (null != n && o[e].parentNode === n)) && z(o[e]);
8
+ }
@@ -1 +1,72 @@
1
- import e,{OPTIONS as T}from"../../managers/braze-instance.js";import{ContentCards,subscribeToContentCardsUpdates}from"../index.js";import g from"../content-cards-provider-factory.js";import{destroyFeedHtml as z,detectFeedImpressions as q,feedToHtml as I,LAST_REQUESTED_REFRESH_DATA_ATTRIBUTE as L,refreshFeed as M,registerFeedSubscriptionId as $,updateFeedCards as k}from"../../common/feed-display.js";import{setCardHeight as A}from"../../Card/display/card-display.js";import{setupFeedUI as B}from"../../ui/js/index.js";import r from"../../../shared-lib/braze-shared-lib.js";export function showContentCards(n,t){if(!e.rr())return;B();let o=!1;null==n&&(n=document.body,o=!0);const a=e.nn(T.tn)||e.nn(T.en)||!1;let i=g.er().Us(!1);"function"==typeof t&&k(i,t(i.cards.slice()),i.lastUpdated,null,a);const s=I(i,a),f=g.er();(null==i.lastUpdated||(new Date).valueOf()-i.lastUpdated.valueOf()>ContentCards.ur)&&(null==f.Ht()||(new Date).valueOf()-f.Ht()>ContentCards.ur)&&(r.D.info(`Cached content cards were older than max TTL of ${ContentCards.ur} ms, requesting an update from the server.`),M(i,s),f.Qt((new Date).valueOf()));const l=(new Date).valueOf(),c=subscribeToContentCardsUpdates((function(n){const e=s.querySelectorAll(".ab-refresh-button")[0];if(null!=e){let n=500;const t=parseInt(s.getAttribute(L));isNaN(t)?n-=(new Date).valueOf()-l:n-=(new Date).valueOf()-t,setTimeout((function(){e.className=e.className.replace(/fa-spin/g,"")}),Math.max(n,0))}let o=n.cards;"function"==typeof t&&(o=t(o.slice())),k(i,o,n.lastUpdated,s,a)}));$(c,s);const u=function(n){const t=n.querySelectorAll(".ab-feed");let e=null;for(let o=0;o<t.length;o++)t[o].parentNode===n&&(e=t[o]);null!=e?(z(e),e.parentNode.replaceChild(s,e)):n.appendChild(s),setTimeout((function(){s.className=s.className.replace("ab-hide","ab-show")}),0),o&&s.focus(),q(i,s),A(i.cards,n)};var m;null!=n?u(n):window.onload=(m=window.onload,function(){"function"==typeof m&&m(),u(document.body)})}
1
+ import e, { OPTIONS as T } from "../../managers/braze-instance.js";
2
+ import { ContentCards, subscribeToContentCardsUpdates } from "../index.js";
3
+ import g from "../content-cards-provider-factory.js";
4
+ import {
5
+ destroyFeedHtml as z,
6
+ detectFeedImpressions as q,
7
+ feedToHtml as I,
8
+ LAST_REQUESTED_REFRESH_DATA_ATTRIBUTE as L,
9
+ refreshFeed as M,
10
+ registerFeedSubscriptionId as $,
11
+ updateFeedCards as k
12
+ } from "../../common/feed-display.js";
13
+ import { setCardHeight as A } from "../../Card/display/card-display.js";
14
+ import { setupFeedUI as B } from "../../ui/js/index.js";
15
+ import r from "../../../shared-lib/braze-shared-lib.js";
16
+ export function showContentCards(n, t) {
17
+ if (!e.rr()) return;
18
+ B();
19
+ let o = !1;
20
+ null == n && ((n = document.body), (o = !0));
21
+ const a = e.nn(T.tn) || e.nn(T.en) || !1;
22
+ let i = g.er().Us(!1);
23
+ "function" == typeof t && k(i, t(i.cards.slice()), i.lastUpdated, null, a);
24
+ const s = I(i, a),
25
+ f = g.er();
26
+ (null == i.lastUpdated ||
27
+ new Date().valueOf() - i.lastUpdated.valueOf() > ContentCards.ur) &&
28
+ (null == f.Ht() || new Date().valueOf() - f.Ht() > ContentCards.ur) &&
29
+ (r.D.info(
30
+ `Cached content cards were older than max TTL of ${ContentCards.ur} ms, requesting an update from the server.`
31
+ ),
32
+ M(i, s),
33
+ f.Qt(new Date().valueOf()));
34
+ const l = new Date().valueOf(),
35
+ c = subscribeToContentCardsUpdates(function(n) {
36
+ const e = s.querySelectorAll(".ab-refresh-button")[0];
37
+ if (null != e) {
38
+ let n = 500;
39
+ const t = parseInt(s.getAttribute(L));
40
+ isNaN(t)
41
+ ? (n -= new Date().valueOf() - l)
42
+ : (n -= new Date().valueOf() - t),
43
+ setTimeout(function() {
44
+ e.className = e.className.replace(/fa-spin/g, "");
45
+ }, Math.max(n, 0));
46
+ }
47
+ let o = n.cards;
48
+ "function" == typeof t && (o = t(o.slice())),
49
+ k(i, o, n.lastUpdated, s, a);
50
+ });
51
+ $(c, s);
52
+ const u = function(n) {
53
+ const t = n.querySelectorAll(".ab-feed");
54
+ let e = null;
55
+ for (let o = 0; o < t.length; o++) t[o].parentNode === n && (e = t[o]);
56
+ null != e ? (z(e), e.parentNode.replaceChild(s, e)) : n.appendChild(s),
57
+ setTimeout(function() {
58
+ s.className = s.className.replace("ab-hide", "ab-show");
59
+ }, 0),
60
+ o && s.focus(),
61
+ q(i, s),
62
+ A(i.cards, n);
63
+ };
64
+ var m;
65
+ null != n
66
+ ? u(n)
67
+ : (window.onload =
68
+ ((m = window.onload),
69
+ function() {
70
+ "function" == typeof m && m(), u(document.body);
71
+ }));
72
+ }
@@ -1 +1,8 @@
1
- import e from"../../managers/braze-instance.js";import{hideContentCards,showContentCards}from"../index.js";export function toggleContentCards(n,o){e.rr()&&(document.querySelectorAll(".ab-feed").length>0?hideContentCards():showContentCards(n,o))}
1
+ import e from "../../managers/braze-instance.js";
2
+ import { hideContentCards, showContentCards } from "../index.js";
3
+ export function toggleContentCards(n, o) {
4
+ e.rr() &&
5
+ (document.querySelectorAll(".ab-feed").length > 0
6
+ ? hideContentCards()
7
+ : showContentCards(n, o));
8
+ }
@@ -1 +1,27 @@
1
- import K from"../managers/braze-instance.js";import BrazeSdkMetadata from"./braze-sdk-metadata.js";import{isArray as p,validateValueIsFromEnum as F}from"../util/code-utils.js";import r from"../../shared-lib/braze-shared-lib.js";export function addSdkMetadata(a){if(K.rr()){if(!p(a))return r.D.error("Cannot set SDK metadata because metadata is not an array."),!1;for(const t of a)if(!F(BrazeSdkMetadata,t,"sdkMetadata contained an invalid value.","BrazeSdkMetadata"))return!1;return K.nr().addSdkMetadata(a),!0}}
1
+ import K from "../managers/braze-instance.js";
2
+ import BrazeSdkMetadata from "./braze-sdk-metadata.js";
3
+ import {
4
+ isArray as p,
5
+ validateValueIsFromEnum as F
6
+ } from "../util/code-utils.js";
7
+ import r from "../../shared-lib/braze-shared-lib.js";
8
+ export function addSdkMetadata(a) {
9
+ if (K.rr()) {
10
+ if (!p(a))
11
+ return (
12
+ r.D.error("Cannot set SDK metadata because metadata is not an array."),
13
+ !1
14
+ );
15
+ for (const t of a)
16
+ if (
17
+ !F(
18
+ BrazeSdkMetadata,
19
+ t,
20
+ "sdkMetadata contained an invalid value.",
21
+ "BrazeSdkMetadata"
22
+ )
23
+ )
24
+ return !1;
25
+ return K.nr().addSdkMetadata(a), !0;
26
+ }
27
+ }
@@ -1 +1,10 @@
1
- export default{GOOGLE_TAG_MANAGER:"gg",MPARTICLE:"mp",SEGMENT:"sg",TEALIUM:"tl",MANUAL:"manu",NPM:"npm",CDN:"wcd",SHOPIFY:"shp"};
1
+ export default {
2
+ GOOGLE_TAG_MANAGER: "gg",
3
+ MPARTICLE: "mp",
4
+ SEGMENT: "sg",
5
+ TEALIUM: "tl",
6
+ MANUAL: "manu",
7
+ NPM: "npm",
8
+ CDN: "wcd",
9
+ SHOPIFY: "shp"
10
+ };
@@ -1 +1,19 @@
1
- import e from"../managers/braze-instance.js";import{getByteLength as U}from"../util/string-utils.js";import r from"../../shared-lib/braze-shared-lib.js";import{User}from"../User/index.js";import{validateStandardString as R}from"../util/validation-utils.js";export function changeUser(s,i){return!!e.rr()&&(null==s||0===s.length||s!=s?(r.D.error("changeUser requires a non-empty userId."),!1):U(s)>User.ee?(r.D.error(`Rejected user id "${s}" because it is longer than ${User.ee} bytes.`),!1):!(null!=i&&!R(i,"set signature for new user","signature"))&&void e.mr().changeUser(s.toString(),e.re(),i))}
1
+ import e from "../managers/braze-instance.js";
2
+ import { getByteLength as U } from "../util/string-utils.js";
3
+ import r from "../../shared-lib/braze-shared-lib.js";
4
+ import { User } from "../User/index.js";
5
+ import { validateStandardString as R } from "../util/validation-utils.js";
6
+ export function changeUser(s, i) {
7
+ return (
8
+ !!e.rr() &&
9
+ (null == s || 0 === s.length || s != s
10
+ ? (r.D.error("changeUser requires a non-empty userId."), !1)
11
+ : U(s) > User.ee
12
+ ? (r.D.error(
13
+ `Rejected user id "${s}" because it is longer than ${User.ee} bytes.`
14
+ ),
15
+ !1)
16
+ : !(null != i && !R(i, "set signature for new user", "signature")) &&
17
+ void e.mr().changeUser(s.toString(), e.re(), i))
18
+ );
19
+ }
@@ -1 +1,5 @@
1
- import e from"../managers/braze-instance.js";import r from"../../shared-lib/braze-shared-lib.js";export function destroy(){r.D.info("Destroying Braze instance"),e.destroy(!0)}
1
+ import e from "../managers/braze-instance.js";
2
+ import r from "../../shared-lib/braze-shared-lib.js";
3
+ export function destroy() {
4
+ r.D.info("Destroying Braze instance"), e.destroy(!0);
5
+ }
@@ -1 +1,9 @@
1
- export default{BROWSER:"browser",BROWSER_VERSION:"browserVersion",OS:"os",RESOLUTION:"resolution",LANGUAGE:"language",TIME_ZONE:"timeZone",USER_AGENT:"userAgent"};
1
+ export default {
2
+ BROWSER: "browser",
3
+ BROWSER_VERSION: "browserVersion",
4
+ OS: "os",
5
+ RESOLUTION: "resolution",
6
+ LANGUAGE: "language",
7
+ TIME_ZONE: "timeZone",
8
+ USER_AGENT: "userAgent"
9
+ };
@@ -1 +1,10 @@
1
- import e from"../managers/braze-instance.js";import r from"../../shared-lib/braze-shared-lib.js";import G,{STORAGE_KEYS as o}from"../managers/storage-manager.js";export function disableSDK(){null!=e.mr()&&e.mr().requestImmediateDataFlush();const n=new G.ne(null,!0);n.store(o.ae,"This-cookie-will-expire-in-"+n.ie());const a=r.xt.Ft;new r.qt(a,r.D).setItem(a.$t.oe,a.se,!0),e.destroy(!1),e.le(!0)}
1
+ import e from "../managers/braze-instance.js";
2
+ import r from "../../shared-lib/braze-shared-lib.js";
3
+ import G, { STORAGE_KEYS as o } from "../managers/storage-manager.js";
4
+ export function disableSDK() {
5
+ null != e.mr() && e.mr().requestImmediateDataFlush();
6
+ const n = new G.ne(null, !0);
7
+ n.store(o.ae, "This-cookie-will-expire-in-" + n.ie());
8
+ const a = r.xt.Ft;
9
+ new r.qt(a, r.D).setItem(a.$t.oe, a.se, !0), e.destroy(!1), e.le(!0);
10
+ }
@@ -1 +1,8 @@
1
- import e from"../managers/braze-instance.js";import r from"../../shared-lib/braze-shared-lib.js";import G,{STORAGE_KEYS as o}from"../managers/storage-manager.js";export function enableSDK(){new G.ne(null,!0).remove(o.ae);const a=r.xt.Ft;new r.qt(a,r.D).br(a.$t.oe,a.se),e.destroy(!1),e.le(!1)}
1
+ import e from "../managers/braze-instance.js";
2
+ import r from "../../shared-lib/braze-shared-lib.js";
3
+ import G, { STORAGE_KEYS as o } from "../managers/storage-manager.js";
4
+ export function enableSDK() {
5
+ new G.ne(null, !0).remove(o.ae);
6
+ const a = r.xt.Ft;
7
+ new r.qt(a, r.D).br(a.$t.oe, a.se), e.destroy(!1), e.le(!1);
8
+ }
@@ -1 +1,10 @@
1
- import e from"../managers/braze-instance.js";import r from"../../shared-lib/braze-shared-lib.js";export function getDeviceId(i){e.rr()&&(null==i&&r.D.error("getDeviceId must be supplied with a callback. e.g., braze.getDeviceId(function(deviceId) {console.log('the device id is ' + deviceId)})"),"function"==typeof i&&i(e.ce().te().id))}
1
+ import e from "../managers/braze-instance.js";
2
+ import r from "../../shared-lib/braze-shared-lib.js";
3
+ export function getDeviceId(i) {
4
+ e.rr() &&
5
+ (null == i &&
6
+ r.D.error(
7
+ "getDeviceId must be supplied with a callback. e.g., braze.getDeviceId(function(deviceId) {console.log('the device id is ' + deviceId)})"
8
+ ),
9
+ "function" == typeof i && i(e.ce().te().id));
10
+ }
@@ -1 +1,4 @@
1
- import e from"../managers/braze-instance.js";export function getUser(){if(e.rr())return e.gr()}
1
+ import e from "../managers/braze-instance.js";
2
+ export function getUser() {
3
+ if (e.rr()) return e.gr();
4
+ }