@braze/web-sdk 4.10.1 → 4.10.2

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 (203) hide show
  1. package/index.d.ts +9 -9
  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 +34 -1
  6. package/shared-lib/guid.js +10 -1
  7. package/shared-lib/index.js +6 -0
  8. package/shared-lib/indexed-db-adapter.js +352 -1
  9. package/shared-lib/logger.js +38 -1
  10. package/shared-lib/supported-options.js +27 -1
  11. package/shared-lib/types.js +1 -1
  12. package/src/Card/card-manager-factory.js +14 -1
  13. package/src/Card/card-manager.js +78 -1
  14. package/src/Card/display/card-display.js +138 -1
  15. package/src/Card/index.js +6 -1
  16. package/src/Card/log-card-click.js +11 -1
  17. package/src/Card/log-card-dismissal.js +11 -1
  18. package/src/Card/log-card-impressions.js +13 -1
  19. package/src/Card/log-content-card-click.js +4 -1
  20. package/src/Card/log-content-card-impressions.js +4 -1
  21. package/src/Card/models/banner.js +31 -1
  22. package/src/Card/models/captioned-image.js +33 -1
  23. package/src/Card/models/card.js +196 -1
  24. package/src/Card/models/classic-card.js +32 -1
  25. package/src/Card/models/control-card.js +23 -1
  26. package/src/Card/models/image-only.js +32 -1
  27. package/src/Card/models/index.js +6 -1
  28. package/src/Card/types.js +1 -1
  29. package/src/Card/util/card-factory.js +104 -1
  30. package/src/ContentCards/content-cards-provider-factory.js +20 -1
  31. package/src/ContentCards/content-cards-provider.js +391 -1
  32. package/src/ContentCards/content-cards.js +24 -1
  33. package/src/ContentCards/get-cached-content-cards.js +5 -1
  34. package/src/ContentCards/index.js +8 -1
  35. package/src/ContentCards/log-content-cards-displayed.js +5 -1
  36. package/src/ContentCards/request-content-cards-refresh.js +5 -1
  37. package/src/ContentCards/subscribe-to-content-cards-updates.js +17 -1
  38. package/src/ContentCards/types.js +1 -1
  39. package/src/ContentCards/ui/hide-content-cards.js +8 -1
  40. package/src/ContentCards/ui/show-content-cards.js +77 -1
  41. package/src/ContentCards/ui/toggle-content-cards.js +8 -1
  42. package/src/Core/add-sdk-metadata.js +26 -1
  43. package/src/Core/braze-sdk-metadata.js +10 -1
  44. package/src/Core/change-user.js +17 -1
  45. package/src/Core/destroy.js +5 -1
  46. package/src/Core/device-properties.js +9 -1
  47. package/src/Core/disable-sdk.js +15 -1
  48. package/src/Core/enable-sdk.js +11 -1
  49. package/src/Core/get-device-id.js +13 -1
  50. package/src/Core/get-user.js +4 -1
  51. package/src/Core/handle-braze-action.js +87 -1
  52. package/src/Core/index.js +23 -1
  53. package/src/Core/initialize.js +4 -1
  54. package/src/Core/is-disabled.js +4 -1
  55. package/src/Core/log-custom-event.js +38 -1
  56. package/src/Core/log-purchase.js +245 -1
  57. package/src/Core/open-session.js +25 -1
  58. package/src/Core/remove-all-subscriptions.js +4 -1
  59. package/src/Core/remove-subscription.js +4 -1
  60. package/src/Core/request-immediate-data-flush.js +6 -1
  61. package/src/Core/set-logger.js +4 -1
  62. package/src/Core/set-sdk-authentication-signature.js +8 -1
  63. package/src/Core/subscribe-to-sdk-authentication-failures.js +6 -1
  64. package/src/Core/toggle-logging.js +4 -1
  65. package/src/Core/types.js +1 -1
  66. package/src/Core/wipe-data.js +16 -1
  67. package/src/FeatureFlags/feature-flag-factory.js +24 -1
  68. package/src/FeatureFlags/feature-flag.js +64 -1
  69. package/src/FeatureFlags/feature-flags-provider-factory.js +19 -1
  70. package/src/FeatureFlags/feature-flags-provider.js +145 -1
  71. package/src/FeatureFlags/get-all-feature-flags.js +12 -1
  72. package/src/FeatureFlags/get-feature-flag.js +12 -1
  73. package/src/FeatureFlags/index.js +6 -1
  74. package/src/FeatureFlags/log-feature-flag-impression.js +23 -1
  75. package/src/FeatureFlags/refresh-feature-flags.js +9 -1
  76. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +9 -1
  77. package/src/FeatureFlags/types.js +1 -1
  78. package/src/Feed/feed-provider-factory.js +18 -1
  79. package/src/Feed/feed-provider.js +90 -1
  80. package/src/Feed/feed.js +20 -1
  81. package/src/Feed/get-cached-feed.js +5 -1
  82. package/src/Feed/index.js +8 -1
  83. package/src/Feed/log-feed-displayed.js +7 -1
  84. package/src/Feed/request-feed-refresh.js +5 -1
  85. package/src/Feed/subscribe-to-feed-updates.js +5 -1
  86. package/src/Feed/types.js +1 -1
  87. package/src/Feed/ui/hide-feed.js +7 -1
  88. package/src/Feed/ui/show-feed.js +96 -1
  89. package/src/Feed/ui/toggle-feed.js +8 -1
  90. package/src/InAppMessage/defer-in-app-message.js +13 -1
  91. package/src/InAppMessage/display/get-animation-effect.js +19 -1
  92. package/src/InAppMessage/display/html-message-to-html.js +244 -1
  93. package/src/InAppMessage/display/in-app-message-to-html.js +188 -1
  94. package/src/InAppMessage/display/modal-utils.js +73 -1
  95. package/src/InAppMessage/get-deferred-in-app-message.js +5 -1
  96. package/src/InAppMessage/in-app-message-factory.js +166 -1
  97. package/src/InAppMessage/in-app-message-manager-factory.js +16 -1
  98. package/src/InAppMessage/in-app-message-manager.js +248 -1
  99. package/src/InAppMessage/index.js +16 -1
  100. package/src/InAppMessage/log-in-app-message-button-click.js +27 -1
  101. package/src/InAppMessage/log-in-app-message-click.js +19 -1
  102. package/src/InAppMessage/log-in-app-message-html-click.js +23 -1
  103. package/src/InAppMessage/log-in-app-message-impression.js +13 -1
  104. package/src/InAppMessage/models/control-message.js +11 -1
  105. package/src/InAppMessage/models/full-screen-message.js +105 -1
  106. package/src/InAppMessage/models/html-message.js +68 -1
  107. package/src/InAppMessage/models/in-app-message-button.js +47 -1
  108. package/src/InAppMessage/models/in-app-message.js +382 -1
  109. package/src/InAppMessage/models/modal-message.js +101 -1
  110. package/src/InAppMessage/models/slide-up-message.js +84 -1
  111. package/src/InAppMessage/models/templated-in-app-message.js +19 -1
  112. package/src/InAppMessage/subscribe-to-in-app-message.js +10 -1
  113. package/src/InAppMessage/types.js +1 -1
  114. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +15 -1
  115. package/src/InAppMessage/ui/show-in-app-message.js +181 -1
  116. package/src/InAppMessage/utils/in-app-message-utils.js +1 -1
  117. package/src/Push/index.js +5 -1
  118. package/src/Push/is-push-blocked.js +5 -1
  119. package/src/Push/is-push-permission-granted.js +5 -1
  120. package/src/Push/is-push-supported.js +5 -1
  121. package/src/Push/push-manager-factory.js +30 -1
  122. package/src/Push/push-manager.js +387 -1
  123. package/src/Push/request-push-permission.js +9 -1
  124. package/src/Push/types.js +1 -1
  125. package/src/Push/unregister-push.js +5 -1
  126. package/src/Push/utils/push-utils.js +36 -1
  127. package/src/User/index.js +1 -1
  128. package/src/User/types.js +1 -1
  129. package/src/User/user-manager.js +73 -1
  130. package/src/User/user.js +302 -1
  131. package/src/common/base-feed.js +28 -1
  132. package/src/common/base-provider.js +6 -1
  133. package/src/common/constants.js +14 -1
  134. package/src/common/event-logger.js +31 -1
  135. package/src/common/feed-display.js +210 -1
  136. package/src/common/translations.js +148 -1
  137. package/src/common/types.js +1 -1
  138. package/src/index.js +9 -1
  139. package/src/l10n/l10n-manager-factory.js +22 -1
  140. package/src/l10n/l10n-manager.js +25 -1
  141. package/src/l10n/types.js +1 -1
  142. package/src/managers/auth-manager.js +51 -1
  143. package/src/managers/braze-instance.js +331 -1
  144. package/src/managers/device-manager.js +85 -1
  145. package/src/managers/network-manager.js +256 -1
  146. package/src/managers/server-config-manager.js +108 -1
  147. package/src/managers/session-manager.js +75 -1
  148. package/src/managers/storage-manager-factory.js +42 -1
  149. package/src/managers/storage-manager.js +419 -1
  150. package/src/managers/subscription-manager.js +28 -1
  151. package/src/managers/types.js +1 -1
  152. package/src/models/backend-errors.js +8 -1
  153. package/src/models/braze-event.js +47 -1
  154. package/src/models/braze-sdk-metadata.js +10 -1
  155. package/src/models/device.js +18 -1
  156. package/src/models/identifier.js +19 -1
  157. package/src/models/push-token.js +27 -1
  158. package/src/models/request-result.js +8 -1
  159. package/src/models/server-config.js +48 -1
  160. package/src/models/types.js +1 -1
  161. package/src/request-controller.js +311 -1
  162. package/src/triggers/models/custom-event-data.js +14 -1
  163. package/src/triggers/models/custom-event-property-data.js +21 -1
  164. package/src/triggers/models/filter-set.js +55 -1
  165. package/src/triggers/models/filter.js +102 -1
  166. package/src/triggers/models/in-app-message-click-data.js +25 -1
  167. package/src/triggers/models/purchase-data.js +14 -1
  168. package/src/triggers/models/purchase-property-data.js +21 -1
  169. package/src/triggers/models/push-click-data.js +15 -1
  170. package/src/triggers/models/trigger-condition.js +105 -1
  171. package/src/triggers/models/trigger-events.js +8 -1
  172. package/src/triggers/models/trigger.js +122 -1
  173. package/src/triggers/triggers-provider-factory.js +34 -1
  174. package/src/triggers/triggers-provider.js +326 -1
  175. package/src/triggers/types.js +1 -1
  176. package/src/types.js +1 -1
  177. package/src/ui/js/attach-css.js +13 -1
  178. package/src/ui/js/feed-css.js +12 -1
  179. package/src/ui/js/iam-css.js +12 -1
  180. package/src/ui/js/index.js +3 -1
  181. package/src/ui/js/load-font-awesome.js +13 -1
  182. package/src/util/base-device-parser.js +14 -1
  183. package/src/util/braze-actions.js +84 -1
  184. package/src/util/browser-detector.js +84 -1
  185. package/src/util/client-hints-parser.js +66 -1
  186. package/src/util/code-utils.js +100 -1
  187. package/src/util/color-utils.js +29 -1
  188. package/src/util/component-utils.js +26 -1
  189. package/src/util/date-utils.js +28 -1
  190. package/src/util/deprecation-utils.js +5 -1
  191. package/src/util/device-constants.js +14 -1
  192. package/src/util/dom-utils.js +91 -1
  193. package/src/util/error-utils.js +2 -1
  194. package/src/util/key-codes.js +1 -1
  195. package/src/util/math.js +5 -1
  196. package/src/util/net.js +71 -1
  197. package/src/util/request-header-utils.js +46 -1
  198. package/src/util/string-utils.js +22 -1
  199. package/src/util/types.js +1 -1
  200. package/src/util/url-utils.js +20 -1
  201. package/src/util/user-agent-parser.js +85 -1
  202. package/src/util/validation-utils.js +217 -1
  203. package/src/util/window-utils.js +34 -1
package/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  /*
2
- * Type definitions for @braze/web-sdk v4.10.1
2
+ * Type definitions for @braze/web-sdk v4.10.2
3
3
  * Project: https://github.com/braze-inc/braze-web-sdk
4
4
  * (c) Braze, Inc. 2023 - http://braze.com
5
5
  * License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
6
6
  */
7
7
 
8
8
  /* eslint-disable no-unused-vars, no-use-before-define */
9
- // declare module Braze {
9
+
10
10
  /**
11
11
  * Enum to represent the accepted SDK Metadata tags. See `addSdkMetadata` for more info.
12
12
  *
@@ -126,7 +126,7 @@ export class Card {
126
126
  /** Whether this card is a ControlCard. */
127
127
  isControl: boolean;
128
128
 
129
- // static fromContentCardsJson(jsonData: Record<string, unknown>): Card | undefined;
129
+
130
130
  }
131
131
 
132
132
  /**
@@ -729,7 +729,7 @@ export class InAppMessage {
729
729
  */
730
730
  subscribeToDismissedEvent(subscriber: () => void): string | null;
731
731
 
732
- // static fromJson(jsonData: Record<string, unknown>): InAppMessage | undefined;
732
+
733
733
  }
734
734
 
735
735
  export class FullScreenMessage extends InAppMessage {
@@ -2164,7 +2164,7 @@ export function openSession(): void;
2164
2164
  * - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
2165
2165
  *
2166
2166
  * ```
2167
- * self.importScripts('https://js.appboycdn.com/web-sdk/4.10/service-worker.js');
2167
+ * self.importScripts('https://js.appboycdn.com/web-sdk-develop/4.10/service-worker.js');
2168
2168
  * ```
2169
2169
  *
2170
2170
  * For more details, see [Our Product Documentation](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
@@ -2543,7 +2543,7 @@ export type InitializationOptions = {
2543
2543
  * lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
2544
2544
  * option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
2545
2545
  * `requestPushPermission`, and ensure that it contains Braze's service worker code, either with
2546
- * `self.importScripts('https://js.appboycdn.com/web-sdk/4.10/service-worker.js');` or by including the content
2546
+ * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/4.10/service-worker.js');` or by including the content
2547
2547
  * of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
2548
2548
  */
2549
2549
  manageServiceWorkerExternally?: boolean;
@@ -2596,7 +2596,7 @@ export type InitializationOptions = {
2596
2596
  */
2597
2597
  sessionTimeoutInSeconds?: number;
2598
2598
  };
2599
- // }
2600
2599
 
2601
- // export = Braze;
2602
- // export as namespace Braze;
2600
+
2601
+
2602
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braze/web-sdk",
3
- "version": "4.10.1",
3
+ "version": "4.10.2",
4
4
  "description": "Braze SDK for web sites and other JS platforms.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1 +1,8 @@
1
- import ve from"./encoding-utils.js";import{EventTypes as De,InternalEventTypes as Be}from"./event-types.js";import Ge from"./guid.js";import Oe from"./indexed-db-adapter.js";import Ue from"./logger.js";import ke from"./supported-options.js";const r={On:ve,q:De,Cr:Be,Z:Ge,xt:Oe,zt:Oe.ep,j:Ue,Yo:ke};export default r;
1
+ import ve from "./encoding-utils.js";
2
+ import { EventTypes as De, InternalEventTypes as Be } from "./event-types.js";
3
+ import Ge from "./guid.js";
4
+ import Oe from "./indexed-db-adapter.js";
5
+ import Ue from "./logger.js";
6
+ import ke from "./supported-options.js";
7
+ const r = { On: ve, q: De, Cr: Be, Z: Ge, xt: Oe, zt: Oe.ep, j: Ue, Yo: ke };
8
+ export default r;
@@ -1 +1,12 @@
1
- const ve={Fn:function(t){const r=(t+"=".repeat((4-t.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=atob(r),o=new Uint8Array(n.length);for(let t=0;t<n.length;++t)o[t]=n.charCodeAt(t);return o}};export default ve;
1
+ const ve = {
2
+ Fn: function (t) {
3
+ const r = (t + "=".repeat((4 - (t.length % 4)) % 4))
4
+ .replace(/\-/g, "+")
5
+ .replace(/_/g, "/"),
6
+ n = atob(r),
7
+ o = new Uint8Array(n.length);
8
+ for (let t = 0; t < n.length; ++t) o[t] = n.charCodeAt(t);
9
+ return o;
10
+ },
11
+ };
12
+ export default ve;
@@ -1 +1,34 @@
1
- const De={CustomEvent:"ce",Pr:"p",Mu:"pc",cc:"ca",Ka:"i",qs:"ie",P:"cci",T:"ccic",$:"ccc",H:"ccd",Wl:"ss",xl:"se",Vi:"si",Li:"sc",Qi:"sbc",Ki:"sfe",eo:"iec",Lu:"lr",Tu:"uae",R:"ci",B:"cc",Ru:"lcaa",Pu:"lcar",Xn:"inc",Jn:"add",Qn:"rem",Hn:"set",Kn:"ncam",Nu:"sgu",Fr:"ffi"},Be={Br:"feed_displayed",dc:"content_cards_displayed"};export{De as EventTypes,Be as InternalEventTypes};
1
+ const De = {
2
+ CustomEvent: "ce",
3
+ Pr: "p",
4
+ Mu: "pc",
5
+ cc: "ca",
6
+ Ka: "i",
7
+ qs: "ie",
8
+ P: "cci",
9
+ T: "ccic",
10
+ $: "ccc",
11
+ H: "ccd",
12
+ Wl: "ss",
13
+ xl: "se",
14
+ Vi: "si",
15
+ Li: "sc",
16
+ Qi: "sbc",
17
+ Ki: "sfe",
18
+ eo: "iec",
19
+ Lu: "lr",
20
+ Tu: "uae",
21
+ R: "ci",
22
+ B: "cc",
23
+ Ru: "lcaa",
24
+ Pu: "lcar",
25
+ Xn: "inc",
26
+ Jn: "add",
27
+ Qn: "rem",
28
+ Hn: "set",
29
+ Kn: "ncam",
30
+ Nu: "sgu",
31
+ Fr: "ffi",
32
+ },
33
+ Be = { Br: "feed_displayed", dc: "content_cards_displayed" };
34
+ export { De as EventTypes, Be as InternalEventTypes };
@@ -1 +1,10 @@
1
- const Ge={Y:function(){const t=(t=!1)=>{const n=(Math.random().toString(16)+"000000000").substr(2,8);return t?"-"+n.substr(0,4)+"-"+n.substr(4,4):n};return t()+t(!0)+t(!0)+t()}};export default Ge;
1
+ const Ge = {
2
+ Y: function () {
3
+ const t = (t = !1) => {
4
+ const n = (Math.random().toString(16) + "000000000").substr(2, 8);
5
+ return t ? "-" + n.substr(0, 4) + "-" + n.substr(4, 4) : n;
6
+ };
7
+ return t() + t(!0) + t(!0) + t();
8
+ },
9
+ };
10
+ export default Ge;
@@ -0,0 +1,6 @@
1
+ export { default as logger } from "./logger.js";
2
+ export { default as EncodingUtils } from "./encoding-utils.js";
3
+ export { EventTypes, InternalEventTypes } from "./event-types.js";
4
+ export { default as Guid } from "./guid.js";
5
+ export { default as IndexedDBAdapter } from "./indexed-db-adapter.js";
6
+ export { default as SupportedOptions } from "./supported-options.js";
@@ -1 +1,352 @@
1
- export default class Oe{constructor(t,e){this.database=t,this.j=e,this.parent="undefined"==typeof window?self:window,this.database=t,this.j=e}td(){if("indexedDB"in this.parent)return this.parent.indexedDB}isSupported(){var t;try{if(null==this.td())return!1;{const e=null===(t=this.td())||void 0===t?void 0:t.open("Braze IndexedDB Support Test");if(e&&(e.onupgradeneeded=()=>e.result.close(),e.onsuccess=()=>e.result.close()),"undefined"!=typeof window){const t=window,e=t.chrome||t.browser||t.ed;if(e&&e.runtime&&e.runtime.id)return this.j.info("Not using IndexedDB for storage because we are running inside an extension"),!1}return!0}}catch(t){return this.j.info("Not using IndexedDB for storage due to following error: "+t),!1}}nd(t,e){var n;const o=null===(n=this.td())||void 0===n?void 0:n.open(this.database.od,this.database.VERSION);if(null==o)return"function"==typeof e&&e(),!1;const i=this;return o.onupgradeneeded=t=>{var e;i.j.info("Upgrading indexedDB "+i.database.od+" to v"+i.database.VERSION+"...");const n=null===(e=t.target)||void 0===e?void 0:e.result;for(const t in i.database.Jt){const e=t;i.database.Jt.hasOwnProperty(t)&&!n.objectStoreNames.contains(i.database.Jt[e])&&n.createObjectStore(i.database.Jt[e])}},o.onsuccess=n=>{var o;const r=null===(o=n.target)||void 0===o?void 0:o.result;r.onversionchange=()=>{r.close(),"function"==typeof e&&e(),i.j.error("Needed to close the database unexpectedly because of an upgrade in another tab")},t(r)},o.onerror=t=>{var n;const o=t;return i.j.info("Could not open indexedDB "+i.database.od+" v"+i.database.VERSION+": "+(null===(n=o.target)||void 0===n?void 0:n.errorCode)),"function"==typeof e&&e(),!0},!0}setItem(t,e,n,o,i){if(!this.isSupported())return"function"==typeof i&&i(),!1;const r=this;return this.nd((d=>{if(!d.objectStoreNames.contains(t))return r.j.error("Could not store object "+e+" in "+t+" on indexedDB "+r.database.od+" - "+t+" is not a valid objectStore"),"function"==typeof i&&i(),void d.close();const s=d.transaction([t],"readwrite");s.oncomplete=()=>d.close();const u=s.objectStore(t).put(n,e);u.onerror=()=>{r.j.error("Could not store object "+e+" in "+t+" on indexedDB "+r.database.od),"function"==typeof i&&i()},u.onsuccess=()=>{"function"==typeof o&&o()}}),i)}getItem(t,e,n){if(!this.isSupported())return!1;const o=this;return this.nd((i=>{if(!i.objectStoreNames.contains(t))return o.j.error("Could not retrieve object "+e+" in "+t+" on indexedDB "+o.database.od+" - "+t+" is not a valid objectStore"),void i.close();const r=i.transaction([t],"readonly");r.oncomplete=()=>i.close();const d=r.objectStore(t).get(e);d.onerror=()=>{o.j.error("Could not retrieve object "+e+" in "+t+" on indexedDB "+o.database.od)},d.onsuccess=t=>{var e;const o=null===(e=t.target)||void 0===e?void 0:e.result;null!=o&&n(o)}}))}hr(t,e,n){if(!this.isSupported())return"function"==typeof n&&n(),!1;const o=this;return this.nd((i=>{if(!i.objectStoreNames.contains(t))return o.j.error("Could not retrieve last record from "+t+" on indexedDB "+o.database.od+" - "+t+" is not a valid objectStore"),"function"==typeof n&&n(),void i.close();const r=i.transaction([t],"readonly");r.oncomplete=()=>i.close();const d=r.objectStore(t).openCursor(null,"prev");d.onerror=()=>{o.j.error("Could not open cursor for "+t+" on indexedDB "+o.database.od),"function"==typeof n&&n()},d.onsuccess=t=>{var o;const i=null===(o=t.target)||void 0===o?void 0:o.result;null!=i&&null!=i.value&&null!=i.key?e(i.key,i.value):"function"==typeof n&&n()}}),n)}oe(t,e){if(!this.isSupported())return!1;const n=this;return this.nd((o=>{if(!o.objectStoreNames.contains(t))return n.j.error("Could not delete record "+e+" from "+t+" on indexedDB "+n.database.od+" - "+t+" is not a valid objectStore"),void o.close();const i=o.transaction([t],"readwrite");i.oncomplete=()=>o.close();i.objectStore(t).delete(e).onerror=()=>{n.j.error("Could not delete record "+e+" from "+t+" on indexedDB "+n.database.od)}}))}Mt(t,e){if(!this.isSupported())return!1;const n=this;return this.nd((o=>{if(!o.objectStoreNames.contains(t))return n.j.error("Could not retrieve objects from "+t+" on indexedDB "+n.database.od+" - "+t+" is not a valid objectStore"),void o.close();const i=o.transaction([t],"readwrite");i.oncomplete=()=>o.close();const r=i.objectStore(t),d=r.openCursor(),s=[];d.onerror=()=>{s.length>0?(n.j.info("Cursor closed midway through for "+t+" on indexedDB "+n.database.od),e(s)):n.j.error("Could not open cursor for "+t+" on indexedDB "+n.database.od)},d.onsuccess=t=>{var n;const o=null===(n=t.target)||void 0===n?void 0:n.result;if(null!=o){if(null!=o.value&&null!=o.key){r.delete(o.key).onsuccess=()=>{s.push(o.value)}}"function"==typeof o.continue&&o.continue()}else s.length>0&&e(s)}}))}clearData(){if(!this.isSupported())return!1;const t=[];for(const e in this.database.Jt){const n=e;this.database.Jt.hasOwnProperty(e)&&this.database.Jt[n]!==this.database.Jt.se&&t.push(this.database.Jt[n])}const e=this;return this.nd((function(n){const o=n.transaction(t,"readwrite");o.oncomplete=()=>n.close();for(let n=0;n<t.length;n++){const i=t[n];o.objectStore(i).clear().onerror=function(){e.j.error("Could not clear "+this.source.name+" on indexedDB "+e.database.od)}}o.onerror=function(){e.j.error("Could not clear object stores on indexedDB "+e.database.od)}}))}}Oe.ep={Ft:{od:"AppboyServiceWorkerAsyncStorage",VERSION:6,Jt:{Na:"data",kr:"pushClicks",cu:"pushSubscribed",dd:"fallbackDevice",qt:"cardUpdates",se:"optOut",wr:"pendingData",qh:"sdkAuthenticationSignature"},ie:1}};
1
+ export default class Oe {
2
+ constructor(t, e) {
3
+ (this.database = t),
4
+ (this.j = e),
5
+ (this.parent = "undefined" == typeof window ? self : window),
6
+ (this.database = t),
7
+ (this.j = e);
8
+ }
9
+ td() {
10
+ if ("indexedDB" in this.parent) return this.parent.indexedDB;
11
+ }
12
+ isSupported() {
13
+ var t;
14
+ try {
15
+ if (null == this.td()) return !1;
16
+ {
17
+ const e =
18
+ null === (t = this.td()) || void 0 === t
19
+ ? void 0
20
+ : t.open("Braze IndexedDB Support Test");
21
+ if (
22
+ (e &&
23
+ ((e.onupgradeneeded = () => e.result.close()),
24
+ (e.onsuccess = () => e.result.close())),
25
+ "undefined" != typeof window)
26
+ ) {
27
+ const t = window,
28
+ e = t.chrome || t.browser || t.ed;
29
+ if (e && e.runtime && e.runtime.id)
30
+ return (
31
+ this.j.info(
32
+ "Not using IndexedDB for storage because we are running inside an extension",
33
+ ),
34
+ !1
35
+ );
36
+ }
37
+ return !0;
38
+ }
39
+ } catch (t) {
40
+ return (
41
+ this.j.info(
42
+ "Not using IndexedDB for storage due to following error: " + t,
43
+ ),
44
+ !1
45
+ );
46
+ }
47
+ }
48
+ nd(t, e) {
49
+ var n;
50
+ const o =
51
+ null === (n = this.td()) || void 0 === n
52
+ ? void 0
53
+ : n.open(this.database.od, this.database.VERSION);
54
+ if (null == o) return "function" == typeof e && e(), !1;
55
+ const i = this;
56
+ return (
57
+ (o.onupgradeneeded = (t) => {
58
+ var e;
59
+ i.j.info(
60
+ "Upgrading indexedDB " +
61
+ i.database.od +
62
+ " to v" +
63
+ i.database.VERSION +
64
+ "...",
65
+ );
66
+ const n = null === (e = t.target) || void 0 === e ? void 0 : e.result;
67
+ for (const t in i.database.Jt) {
68
+ const e = t;
69
+ i.database.Jt.hasOwnProperty(t) &&
70
+ !n.objectStoreNames.contains(i.database.Jt[e]) &&
71
+ n.createObjectStore(i.database.Jt[e]);
72
+ }
73
+ }),
74
+ (o.onsuccess = (n) => {
75
+ var o;
76
+ const r = null === (o = n.target) || void 0 === o ? void 0 : o.result;
77
+ (r.onversionchange = () => {
78
+ r.close(),
79
+ "function" == typeof e && e(),
80
+ i.j.error(
81
+ "Needed to close the database unexpectedly because of an upgrade in another tab",
82
+ );
83
+ }),
84
+ t(r);
85
+ }),
86
+ (o.onerror = (t) => {
87
+ var n;
88
+ const o = t;
89
+ return (
90
+ i.j.info(
91
+ "Could not open indexedDB " +
92
+ i.database.od +
93
+ " v" +
94
+ i.database.VERSION +
95
+ ": " +
96
+ (null === (n = o.target) || void 0 === n ? void 0 : n.errorCode),
97
+ ),
98
+ "function" == typeof e && e(),
99
+ !0
100
+ );
101
+ }),
102
+ !0
103
+ );
104
+ }
105
+ setItem(t, e, n, o, i) {
106
+ if (!this.isSupported()) return "function" == typeof i && i(), !1;
107
+ const r = this;
108
+ return this.nd((d) => {
109
+ if (!d.objectStoreNames.contains(t))
110
+ return (
111
+ r.j.error(
112
+ "Could not store object " +
113
+ e +
114
+ " in " +
115
+ t +
116
+ " on indexedDB " +
117
+ r.database.od +
118
+ " - " +
119
+ t +
120
+ " is not a valid objectStore",
121
+ ),
122
+ "function" == typeof i && i(),
123
+ void d.close()
124
+ );
125
+ const s = d.transaction([t], "readwrite");
126
+ s.oncomplete = () => d.close();
127
+ const u = s.objectStore(t).put(n, e);
128
+ (u.onerror = () => {
129
+ r.j.error(
130
+ "Could not store object " +
131
+ e +
132
+ " in " +
133
+ t +
134
+ " on indexedDB " +
135
+ r.database.od,
136
+ ),
137
+ "function" == typeof i && i();
138
+ }),
139
+ (u.onsuccess = () => {
140
+ "function" == typeof o && o();
141
+ });
142
+ }, i);
143
+ }
144
+ getItem(t, e, n) {
145
+ if (!this.isSupported()) return !1;
146
+ const o = this;
147
+ return this.nd((i) => {
148
+ if (!i.objectStoreNames.contains(t))
149
+ return (
150
+ o.j.error(
151
+ "Could not retrieve object " +
152
+ e +
153
+ " in " +
154
+ t +
155
+ " on indexedDB " +
156
+ o.database.od +
157
+ " - " +
158
+ t +
159
+ " is not a valid objectStore",
160
+ ),
161
+ void i.close()
162
+ );
163
+ const r = i.transaction([t], "readonly");
164
+ r.oncomplete = () => i.close();
165
+ const d = r.objectStore(t).get(e);
166
+ (d.onerror = () => {
167
+ o.j.error(
168
+ "Could not retrieve object " +
169
+ e +
170
+ " in " +
171
+ t +
172
+ " on indexedDB " +
173
+ o.database.od,
174
+ );
175
+ }),
176
+ (d.onsuccess = (t) => {
177
+ var e;
178
+ const o = null === (e = t.target) || void 0 === e ? void 0 : e.result;
179
+ null != o && n(o);
180
+ });
181
+ });
182
+ }
183
+ hr(t, e, n) {
184
+ if (!this.isSupported()) return "function" == typeof n && n(), !1;
185
+ const o = this;
186
+ return this.nd((i) => {
187
+ if (!i.objectStoreNames.contains(t))
188
+ return (
189
+ o.j.error(
190
+ "Could not retrieve last record from " +
191
+ t +
192
+ " on indexedDB " +
193
+ o.database.od +
194
+ " - " +
195
+ t +
196
+ " is not a valid objectStore",
197
+ ),
198
+ "function" == typeof n && n(),
199
+ void i.close()
200
+ );
201
+ const r = i.transaction([t], "readonly");
202
+ r.oncomplete = () => i.close();
203
+ const d = r.objectStore(t).openCursor(null, "prev");
204
+ (d.onerror = () => {
205
+ o.j.error(
206
+ "Could not open cursor for " + t + " on indexedDB " + o.database.od,
207
+ ),
208
+ "function" == typeof n && n();
209
+ }),
210
+ (d.onsuccess = (t) => {
211
+ var o;
212
+ const i = null === (o = t.target) || void 0 === o ? void 0 : o.result;
213
+ null != i && null != i.value && null != i.key
214
+ ? e(i.key, i.value)
215
+ : "function" == typeof n && n();
216
+ });
217
+ }, n);
218
+ }
219
+ oe(t, e) {
220
+ if (!this.isSupported()) return !1;
221
+ const n = this;
222
+ return this.nd((o) => {
223
+ if (!o.objectStoreNames.contains(t))
224
+ return (
225
+ n.j.error(
226
+ "Could not delete record " +
227
+ e +
228
+ " from " +
229
+ t +
230
+ " on indexedDB " +
231
+ n.database.od +
232
+ " - " +
233
+ t +
234
+ " is not a valid objectStore",
235
+ ),
236
+ void o.close()
237
+ );
238
+ const i = o.transaction([t], "readwrite");
239
+ i.oncomplete = () => o.close();
240
+ i.objectStore(t).delete(e).onerror = () => {
241
+ n.j.error(
242
+ "Could not delete record " +
243
+ e +
244
+ " from " +
245
+ t +
246
+ " on indexedDB " +
247
+ n.database.od,
248
+ );
249
+ };
250
+ });
251
+ }
252
+ Mt(t, e) {
253
+ if (!this.isSupported()) return !1;
254
+ const n = this;
255
+ return this.nd((o) => {
256
+ if (!o.objectStoreNames.contains(t))
257
+ return (
258
+ n.j.error(
259
+ "Could not retrieve objects from " +
260
+ t +
261
+ " on indexedDB " +
262
+ n.database.od +
263
+ " - " +
264
+ t +
265
+ " is not a valid objectStore",
266
+ ),
267
+ void o.close()
268
+ );
269
+ const i = o.transaction([t], "readwrite");
270
+ i.oncomplete = () => o.close();
271
+ const r = i.objectStore(t),
272
+ d = r.openCursor(),
273
+ s = [];
274
+ (d.onerror = () => {
275
+ s.length > 0
276
+ ? (n.j.info(
277
+ "Cursor closed midway through for " +
278
+ t +
279
+ " on indexedDB " +
280
+ n.database.od,
281
+ ),
282
+ e(s))
283
+ : n.j.error(
284
+ "Could not open cursor for " +
285
+ t +
286
+ " on indexedDB " +
287
+ n.database.od,
288
+ );
289
+ }),
290
+ (d.onsuccess = (t) => {
291
+ var n;
292
+ const o = null === (n = t.target) || void 0 === n ? void 0 : n.result;
293
+ if (null != o) {
294
+ if (null != o.value && null != o.key) {
295
+ r.delete(o.key).onsuccess = () => {
296
+ s.push(o.value);
297
+ };
298
+ }
299
+ "function" == typeof o.continue && o.continue();
300
+ } else s.length > 0 && e(s);
301
+ });
302
+ });
303
+ }
304
+ clearData() {
305
+ if (!this.isSupported()) return !1;
306
+ const t = [];
307
+ for (const e in this.database.Jt) {
308
+ const n = e;
309
+ this.database.Jt.hasOwnProperty(e) &&
310
+ this.database.Jt[n] !== this.database.Jt.se &&
311
+ t.push(this.database.Jt[n]);
312
+ }
313
+ const e = this;
314
+ return this.nd(function (n) {
315
+ const o = n.transaction(t, "readwrite");
316
+ o.oncomplete = () => n.close();
317
+ for (let n = 0; n < t.length; n++) {
318
+ const i = t[n];
319
+ o.objectStore(i).clear().onerror = function () {
320
+ e.j.error(
321
+ "Could not clear " +
322
+ this.source.name +
323
+ " on indexedDB " +
324
+ e.database.od,
325
+ );
326
+ };
327
+ }
328
+ o.onerror = function () {
329
+ e.j.error(
330
+ "Could not clear object stores on indexedDB " + e.database.od,
331
+ );
332
+ };
333
+ });
334
+ }
335
+ }
336
+ Oe.ep = {
337
+ Ft: {
338
+ od: "AppboyServiceWorkerAsyncStorage",
339
+ VERSION: 6,
340
+ Jt: {
341
+ Na: "data",
342
+ kr: "pushClicks",
343
+ cu: "pushSubscribed",
344
+ dd: "fallbackDevice",
345
+ qt: "cardUpdates",
346
+ se: "optOut",
347
+ wr: "pendingData",
348
+ qh: "sdkAuthenticationSignature",
349
+ },
350
+ ie: 1,
351
+ },
352
+ };
@@ -1 +1,38 @@
1
- const Ue={init:function(n){void 0===n&&void 0!==Ue.zg||(Ue.zg=!!n),Ue.t||(Ue.t=!0)},destroy:function(){Ue.t=!1,Ue.zg=void 0,Ue.j=void 0},setLogger:function(n){"function"==typeof n?(Ue.init(),Ue.j=n):Ue.info("Ignoring setLogger call since logger is not a function")},toggleLogging:function(){Ue.init(),Ue.zg?(console.log("Disabling Braze logging"),Ue.zg=!1):(console.log("Enabled Braze logging"),Ue.zg=!0)},info:function(n){if(Ue.zg){const o="Braze: "+n;null!=Ue.j?Ue.j(o):console.log(o)}},warn:function(n){if(Ue.zg){const o="Braze SDK Warning: "+n+" (v4.10.1)";null!=Ue.j?Ue.j(o):console.warn(o)}},error:function(n){if(Ue.zg){const o="Braze SDK Error: "+n+" (v4.10.1)";null!=Ue.j?Ue.j(o):console.error(o)}}};export default Ue;
1
+ const Ue = {
2
+ init: function (n) {
3
+ (void 0 === n && void 0 !== Ue.zg) || (Ue.zg = !!n), Ue.t || (Ue.t = !0);
4
+ },
5
+ destroy: function () {
6
+ (Ue.t = !1), (Ue.zg = void 0), (Ue.j = void 0);
7
+ },
8
+ setLogger: function (n) {
9
+ "function" == typeof n
10
+ ? (Ue.init(), (Ue.j = n))
11
+ : Ue.info("Ignoring setLogger call since logger is not a function");
12
+ },
13
+ toggleLogging: function () {
14
+ Ue.init(),
15
+ Ue.zg
16
+ ? (console.log("Disabling Braze logging"), (Ue.zg = !1))
17
+ : (console.log("Enabled Braze logging"), (Ue.zg = !0));
18
+ },
19
+ info: function (n) {
20
+ if (Ue.zg) {
21
+ const o = "Braze: " + n;
22
+ null != Ue.j ? Ue.j(o) : console.log(o);
23
+ }
24
+ },
25
+ warn: function (n) {
26
+ if (Ue.zg) {
27
+ const o = "Braze SDK Warning: " + n + " (v4.10.2)";
28
+ null != Ue.j ? Ue.j(o) : console.warn(o);
29
+ }
30
+ },
31
+ error: function (n) {
32
+ if (Ue.zg) {
33
+ const o = "Braze SDK Error: " + n + " (v4.10.2)";
34
+ null != Ue.j ? Ue.j(o) : console.error(o);
35
+ }
36
+ },
37
+ };
38
+ export default Ue;
@@ -1 +1,27 @@
1
- export default{ho:"allowCrawlerActivity",Eo:"baseUrl",_o:"noCookies",Io:"devicePropertyAllowlist",Aa:"disablePushTokenMaintenance",Ao:"enableLogging",So:"enableSdkAuthentication",qa:"manageServiceWorkerExternally",No:"minimumIntervalBetweenTriggerActionsInSeconds",wo:"sessionTimeoutInSeconds",Oo:"appVersion",Po:"appVersionNumber",_a:"serviceWorkerLocation",ka:"safariWebsitePushId",Ba:"localization",po:"contentSecurityNonce",Ro:"enableHtmlInAppMessages",Co:"allowUserSuppliedJavascript",lo:"inAppMessageZIndex",fo:"openInAppMessagesInNewTab",en:"openNewsFeedCardsInNewTab",mh:"requireExplicitInAppMessageDismissal",Lo:"doNotLoadFontAwesome",Mo:"sdkFlavor",tn:"openCardsInNewTab"};
1
+ export default {
2
+ ho: "allowCrawlerActivity",
3
+ Eo: "baseUrl",
4
+ _o: "noCookies",
5
+ Io: "devicePropertyAllowlist",
6
+ Aa: "disablePushTokenMaintenance",
7
+ Ao: "enableLogging",
8
+ So: "enableSdkAuthentication",
9
+ qa: "manageServiceWorkerExternally",
10
+ No: "minimumIntervalBetweenTriggerActionsInSeconds",
11
+ wo: "sessionTimeoutInSeconds",
12
+ Oo: "appVersion",
13
+ Po: "appVersionNumber",
14
+ _a: "serviceWorkerLocation",
15
+ ka: "safariWebsitePushId",
16
+ Ba: "localization",
17
+ po: "contentSecurityNonce",
18
+ Ro: "enableHtmlInAppMessages",
19
+ Co: "allowUserSuppliedJavascript",
20
+ lo: "inAppMessageZIndex",
21
+ fo: "openInAppMessagesInNewTab",
22
+ en: "openNewsFeedCardsInNewTab",
23
+ mh: "requireExplicitInAppMessageDismissal",
24
+ Lo: "doNotLoadFontAwesome",
25
+ Mo: "sdkFlavor",
26
+ tn: "openCardsInNewTab",
27
+ };
@@ -1 +1 @@
1
- export{};
1
+ export {};
@@ -1 +1,14 @@
1
- import a from"./card-manager.js";import e from"../managers/braze-instance.js";const n={t:!1,i:null,m:()=>(n.o(),n.i||(n.i=new a(e.l())),n.i),o:()=>{n.t||(e.g(n),n.t=!0)},destroy:()=>{n.i=null,n.t=!1}};export default n;
1
+ import a from "./card-manager.js";
2
+ import e from "../managers/braze-instance.js";
3
+ const n = {
4
+ t: !1,
5
+ i: null,
6
+ m: () => (n.o(), n.i || (n.i = new a(e.l())), n.i),
7
+ o: () => {
8
+ n.t || (e.g(n), (n.t = !0));
9
+ },
10
+ destroy: () => {
11
+ (n.i = null), (n.t = !1);
12
+ },
13
+ };
14
+ export default n;