@braze/web-sdk 5.8.0 → 5.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/index.d.ts +1 -1
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +22 -22
  5. package/shared-lib/guid.js +1 -1
  6. package/shared-lib/indexed-db-adapter.js +18 -18
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +16 -16
  9. package/src/Banner/banner-provider.js +79 -79
  10. package/src/Banner/banner.js +9 -9
  11. package/src/Banner/display/banner-to-html.js +2 -2
  12. package/src/Banner/get-all-banners.js +2 -2
  13. package/src/Banner/get-banner.js +2 -2
  14. package/src/Banner/log-banner-click.js +2 -2
  15. package/src/Banner/log-banner-impressions.js +4 -4
  16. package/src/Banner/request-banners-refresh.js +1 -1
  17. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  18. package/src/Card/card-manager.js +35 -35
  19. package/src/Card/display/card-display.js +8 -8
  20. package/src/Card/log-card-click.js +1 -1
  21. package/src/Card/log-card-dismissal.js +1 -1
  22. package/src/Card/log-card-impressions.js +1 -1
  23. package/src/Card/models/captioned-image.js +21 -21
  24. package/src/Card/models/card.js +92 -92
  25. package/src/Card/models/classic-card.js +21 -21
  26. package/src/Card/models/control-card.js +11 -11
  27. package/src/Card/models/image-only.js +19 -19
  28. package/src/Card/util/card-factory.js +39 -39
  29. package/src/ContentCards/content-cards-provider.js +142 -142
  30. package/src/ContentCards/get-cached-content-cards.js +1 -1
  31. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  32. package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
  33. package/src/ContentCards/ui/show-content-cards.js +3 -3
  34. package/src/Core/disable-sdk.js +6 -6
  35. package/src/Core/enable-sdk.js +5 -5
  36. package/src/Core/get-device-id.js +2 -2
  37. package/src/Core/handle-braze-action.js +2 -2
  38. package/src/Core/is-disabled.js +2 -2
  39. package/src/Core/is-initialized.js +1 -1
  40. package/src/Core/log-custom-event.js +5 -5
  41. package/src/Core/log-purchase.js +4 -4
  42. package/src/Core/open-session.js +5 -5
  43. package/src/Core/wipe-data.js +2 -2
  44. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  45. package/src/FeatureFlags/feature-flag.js +15 -15
  46. package/src/FeatureFlags/feature-flags-provider.js +61 -61
  47. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  48. package/src/FeatureFlags/get-feature-flag.js +2 -2
  49. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  50. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  51. package/src/Feed/feed-provider.js +41 -41
  52. package/src/Feed/get-cached-feed.js +1 -1
  53. package/src/Feed/log-feed-displayed.js +1 -1
  54. package/src/Feed/request-feed-refresh.js +1 -1
  55. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  56. package/src/Feed/ui/show-feed.js +1 -1
  57. package/src/InAppMessage/defer-in-app-message.js +1 -1
  58. package/src/InAppMessage/display/html-message-to-html.js +6 -6
  59. package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
  60. package/src/InAppMessage/display/modal-utils.js +4 -4
  61. package/src/InAppMessage/in-app-message-factory.js +7 -7
  62. package/src/InAppMessage/in-app-message-manager.js +89 -89
  63. package/src/InAppMessage/log-in-app-message-button-click.js +6 -6
  64. package/src/InAppMessage/log-in-app-message-click.js +5 -5
  65. package/src/InAppMessage/log-in-app-message-html-click.js +7 -7
  66. package/src/InAppMessage/log-in-app-message-impression.js +2 -2
  67. package/src/InAppMessage/models/control-message.js +5 -5
  68. package/src/InAppMessage/models/full-screen-message.js +34 -34
  69. package/src/InAppMessage/models/html-message.js +20 -20
  70. package/src/InAppMessage/models/in-app-message-button.js +8 -8
  71. package/src/InAppMessage/models/in-app-message.js +80 -80
  72. package/src/InAppMessage/models/modal-message.js +33 -33
  73. package/src/InAppMessage/models/slide-up-message.js +29 -29
  74. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  75. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  76. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  77. package/src/InAppMessage/ui/show-in-app-message.js +12 -12
  78. package/src/Push/push-manager-factory.js +1 -1
  79. package/src/Push/push-manager.js +94 -94
  80. package/src/Push/utils/push-utils.js +4 -4
  81. package/src/User/user-manager.js +17 -17
  82. package/src/User/user.js +38 -38
  83. package/src/common/base-feed.js +1 -1
  84. package/src/common/base-provider.js +1 -1
  85. package/src/common/event-logger.js +5 -5
  86. package/src/common/feed-display.js +6 -6
  87. package/src/l10n/l10n-manager-factory.js +1 -1
  88. package/src/l10n/l10n-manager.js +1 -1
  89. package/src/managers/auth-manager.js +31 -31
  90. package/src/managers/braze-instance.js +125 -125
  91. package/src/managers/device-manager.js +24 -24
  92. package/src/managers/network-manager.js +149 -149
  93. package/src/managers/server-config-manager.js +84 -84
  94. package/src/managers/session-manager.js +27 -27
  95. package/src/managers/storage-manager-factory.js +12 -12
  96. package/src/managers/storage-manager.js +83 -83
  97. package/src/managers/subscription-manager.js +10 -10
  98. package/src/managers/utils.js +4 -4
  99. package/src/models/backend-errors.js +5 -5
  100. package/src/models/braze-event.js +4 -4
  101. package/src/models/device.js +2 -2
  102. package/src/models/identifier.js +3 -3
  103. package/src/models/push-token.js +8 -8
  104. package/src/models/request-result.js +3 -3
  105. package/src/models/server-config.js +31 -31
  106. package/src/request-controller.js +148 -148
  107. package/src/triggers/models/custom-event-data.js +1 -1
  108. package/src/triggers/models/custom-event-property-data.js +2 -2
  109. package/src/triggers/models/filter-set.js +4 -4
  110. package/src/triggers/models/filter.js +2 -2
  111. package/src/triggers/models/in-app-message-click-data.js +1 -1
  112. package/src/triggers/models/purchase-data.js +1 -1
  113. package/src/triggers/models/purchase-property-data.js +2 -2
  114. package/src/triggers/models/push-click-data.js +1 -1
  115. package/src/triggers/models/trigger-condition.js +32 -32
  116. package/src/triggers/models/trigger-events.js +2 -2
  117. package/src/triggers/models/trigger.js +11 -11
  118. package/src/triggers/triggers-provider-factory.js +2 -2
  119. package/src/triggers/triggers-provider.js +72 -72
  120. package/src/ui/js/attach-css.js +1 -1
  121. package/src/ui/js/load-font-awesome.js +1 -1
  122. package/src/util/base-device-parser.js +1 -1
  123. package/src/util/braze-actions.js +4 -4
  124. package/src/util/browser-detector.js +5 -5
  125. package/src/util/client-hints-parser.js +1 -1
  126. package/src/util/component-utils.js +1 -1
  127. package/src/util/dom-utils.js +4 -4
  128. package/src/util/html-display-utils.js +6 -6
  129. package/src/util/key-codes.js +1 -1
  130. package/src/util/net.js +6 -6
  131. package/src/util/request-header-utils.js +21 -21
  132. package/src/util/user-agent-parser.js +1 -1
  133. package/src/util/window-utils.js +1 -1
@@ -1,43 +1,43 @@
1
1
  import { isArray as z, isEqual as ii } from "../util/code-utils.js";
2
2
  import ti from "../models/push-token.js";
3
3
  import { logger as N, EncodingUtils as ei } from "../../shared-lib/index.js";
4
- import { STORAGE_KEYS as t } from "../managers/storage-manager.js";
4
+ import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
5
5
  import { User } from "../User/index.js";
6
6
  import vt from "./utils/push-utils.js";
7
7
  import { getErrorMessage as si } from "../util/error-utils.js";
8
8
  export default class na {
9
9
  constructor(i, t, e, s, r, n, o, u, a, h, c) {
10
- (this.hn = i),
11
- (this.cn = t),
12
- (this.fn = e),
13
- (this.dn = r),
14
- (this.bn = n),
15
- (this.yn = o),
10
+ (this.on = i),
11
+ (this.un = t),
12
+ (this.an = e),
13
+ (this.hn = r),
14
+ (this.cn = n),
15
+ (this.fn = o),
16
16
  (this.B = u),
17
- (this.mn = a),
18
- (this.gn = h),
17
+ (this.ln = a),
18
+ (this.dn = h),
19
19
  (this.C = c),
20
- (this.hn = i),
21
- (this.cn = t),
22
- (this.fn = e),
23
- (this.vn = s + "/safari/" + t),
24
- (this.dn = r || "/service-worker.js"),
25
- (this.yn = o),
20
+ (this.on = i),
21
+ (this.un = t),
22
+ (this.an = e),
23
+ (this.pn = s + "/safari/" + t),
24
+ (this.hn = r || "/service-worker.js"),
25
+ (this.fn = o),
26
26
  (this.B = u),
27
- (this.mn = a || !1),
28
- (this.gn = h || !1),
27
+ (this.ln = a || !1),
28
+ (this.dn = h || !1),
29
29
  (this.C = c),
30
- (this.wn = vt.kn()),
31
- (this.Pn = vt.Dn());
30
+ (this.bn = vt.yn()),
31
+ (this.mn = vt.gn());
32
32
  }
33
- Sn() {
34
- return this.gn;
33
+ vn() {
34
+ return this.dn;
35
35
  }
36
- An(i, t, e, s, r) {
36
+ wn(i, t, e, s, r) {
37
37
  i.unsubscribe()
38
38
  .then((i) => {
39
39
  i
40
- ? this.jn(t, e, s, r)
40
+ ? this.kn(t, e, s, r)
41
41
  : (N.error("Failed to unsubscribe device from push."),
42
42
  "function" == typeof r && r(!1));
43
43
  })
@@ -46,7 +46,7 @@ export default class na {
46
46
  "function" == typeof r && r(!1);
47
47
  });
48
48
  }
49
- xn(i, t, e) {
49
+ Pn(i, t, e) {
50
50
  var s;
51
51
  const r = ((i) => {
52
52
  if ("string" == typeof i) return i;
@@ -55,9 +55,9 @@ export default class na {
55
55
  let t = i.endpoint;
56
56
  const e = i;
57
57
  return (
58
- e.Nn &&
59
- -1 === i.endpoint.indexOf(e.Nn) &&
60
- (t = i.endpoint + "/" + e.Nn),
58
+ e.Dn &&
59
+ -1 === i.endpoint.indexOf(e.Dn) &&
60
+ (t = i.endpoint + "/" + e.Dn),
61
61
  t
62
62
  );
63
63
  })(i);
@@ -84,53 +84,53 @@ export default class na {
84
84
  .replace(/\//g, "_")
85
85
  : null;
86
86
  })(u);
87
- null === (s = this.hn) || void 0 === s || s.Un(r, t, n, o, a),
87
+ null === (s = this.on) || void 0 === s || s.Sn(r, t, n, o, a),
88
88
  r && "function" == typeof e && e(r, n, o);
89
89
  }
90
- Wn() {
90
+ An() {
91
91
  var i;
92
- null === (i = this.hn) || void 0 === i || i._n(!0);
92
+ null === (i = this.on) || void 0 === i || i.jn(!0);
93
93
  }
94
- Tn(i, t) {
94
+ xn(i, t) {
95
95
  var e;
96
- null === (e = this.hn) || void 0 === e || e._n(!1),
96
+ null === (e = this.on) || void 0 === e || e.jn(!1),
97
97
  N.info(i),
98
98
  "function" == typeof t && t(!1);
99
99
  }
100
- In(i, t, e, s) {
100
+ Nn(i, t, e, s) {
101
101
  var r;
102
102
  if ("default" === t.permission)
103
103
  try {
104
104
  window.safari.pushNotification.requestPermission(
105
- this.vn,
105
+ this.pn,
106
106
  i,
107
107
  {
108
- api_key: this.cn,
108
+ api_key: this.un,
109
109
  device_id:
110
- (null === (r = this.fn) || void 0 === r ? void 0 : r.de().id) ||
110
+ (null === (r = this.an) || void 0 === r ? void 0 : r.ve().id) ||
111
111
  "",
112
112
  },
113
113
  (t) => {
114
114
  "granted" === t.permission &&
115
- this.hn &&
116
- this.hn.setPushNotificationSubscriptionType(
115
+ this.on &&
116
+ this.on.setPushNotificationSubscriptionType(
117
117
  User.NotificationSubscriptionTypes.OPTED_IN,
118
118
  ),
119
- this.In(i, t, e, s);
119
+ this.Nn(i, t, e, s);
120
120
  },
121
121
  );
122
122
  } catch (i) {
123
- this.Tn("Could not request permission for push: " + i, s);
123
+ this.xn("Could not request permission for push: " + i, s);
124
124
  }
125
125
  else
126
126
  "denied" === t.permission
127
- ? this.Tn(
127
+ ? this.xn(
128
128
  "The user has blocked notifications from this site, or Safari push is not configured in the Braze dashboard.",
129
129
  s,
130
130
  )
131
131
  : "granted" === t.permission &&
132
132
  (N.info("Device successfully subscribed to push."),
133
- this.xn(t.deviceToken, new Date(), e));
133
+ this.Pn(t.deviceToken, new Date(), e));
134
134
  }
135
135
  requestPermission(i, t, e) {
136
136
  const s = (s) => {
@@ -159,14 +159,14 @@ export default class na {
159
159
  : (r = !0);
160
160
  }
161
161
  }
162
- jn(i, t, e, s) {
162
+ kn(i, t, e, s) {
163
163
  const r = { userVisibleOnly: !0 };
164
164
  null != t && (r.applicationServerKey = t),
165
165
  i.pushManager
166
166
  .subscribe(r)
167
167
  .then((i) => {
168
168
  N.info("Device successfully subscribed to push."),
169
- this.xn(i, new Date(), e);
169
+ this.Pn(i, new Date(), e);
170
170
  })
171
171
  .catch((i) => {
172
172
  vt.isPushBlocked()
@@ -176,10 +176,10 @@ export default class na {
176
176
  "function" == typeof s && s(!0));
177
177
  });
178
178
  }
179
- Vn() {
180
- if (this.mn) return navigator.serviceWorker.getRegistration(this.dn);
181
- const i = this.bn ? { scope: this.bn } : void 0;
182
- return navigator.serviceWorker.register(this.dn, i).then(() =>
179
+ Un() {
180
+ if (this.ln) return navigator.serviceWorker.getRegistration(this.hn);
181
+ const i = this.cn ? { scope: this.cn } : void 0;
182
+ return navigator.serviceWorker.register(this.hn, i).then(() =>
183
183
  navigator.serviceWorker.ready.then(
184
184
  (i) => (
185
185
  i &&
@@ -192,38 +192,38 @@ export default class na {
192
192
  ),
193
193
  );
194
194
  }
195
- qn(i) {
196
- this.mn ||
195
+ Wn(i) {
196
+ this.ln ||
197
197
  (i.unregister(), N.info("Service worker successfully unregistered."));
198
198
  }
199
- subscribe(i, e) {
199
+ subscribe(i, t) {
200
200
  if (!vt.isPushSupported())
201
- return N.info(na.zn), void ("function" == typeof e && e(!1));
202
- if (this.wn) {
203
- if (!this.mn && null != window.location) {
204
- let i = this.dn;
201
+ return N.info(na._n), void ("function" == typeof t && t(!1));
202
+ if (this.bn) {
203
+ if (!this.ln && null != window.location) {
204
+ let i = this.hn;
205
205
  -1 === i.indexOf(window.location.host) &&
206
206
  (i = window.location.host + i),
207
207
  -1 === i.indexOf(window.location.protocol) &&
208
208
  (i = window.location.protocol + "//" + i);
209
209
  }
210
210
  if (vt.isPushBlocked())
211
- return void this.Tn(
211
+ return void this.xn(
212
212
  "Notifications from this site are blocked. This may be a temporary embargo or a permanent denial.",
213
- e,
213
+ t,
214
214
  );
215
- if (this.B && !this.B.En() && 0 === this.B.Us())
215
+ if (this.B && !this.B.Tn() && 0 === this.B.Et())
216
216
  return (
217
217
  N.info(
218
218
  "Waiting for VAPID key from server config before subscribing to push.",
219
219
  ),
220
- void this.B.Rn(() => {
221
- this.subscribe(i, e);
220
+ void this.B.In(() => {
221
+ this.subscribe(i, t);
222
222
  })
223
223
  );
224
- const s = () => {
224
+ const e = () => {
225
225
  N.info("Permission for push notifications was denied."),
226
- "function" == typeof e && e(!1);
226
+ "function" == typeof t && t(!1);
227
227
  },
228
228
  r = () => {
229
229
  let i = "Permission for push notifications was ignored.";
@@ -231,25 +231,25 @@ export default class na {
231
231
  (i +=
232
232
  " The browser has automatically blocked further permission requests for a period (probably 1 week)."),
233
233
  N.info(i),
234
- "function" == typeof e && e(!0);
234
+ "function" == typeof t && t(!0);
235
235
  },
236
236
  n = vt.isPushPermissionGranted(),
237
237
  o = () => {
238
238
  !n &&
239
- this.hn &&
240
- this.hn.setPushNotificationSubscriptionType(
239
+ this.on &&
240
+ this.on.setPushNotificationSubscriptionType(
241
241
  User.NotificationSubscriptionTypes.OPTED_IN,
242
242
  ),
243
- this.Vn()
244
- .then((s) => {
245
- if (null == s)
243
+ this.Un()
244
+ .then((e) => {
245
+ if (null == e)
246
246
  return (
247
247
  N.error(
248
248
  "No service worker registration. Set the `manageServiceWorkerExternally` initialization option to false or ensure that your service worker is registered before calling registerPush.",
249
249
  ),
250
- void ("function" == typeof e && e(!0))
250
+ void ("function" == typeof t && t(!0))
251
251
  );
252
- s.pushManager
252
+ e.pushManager
253
253
  .getSubscription()
254
254
  .then((r) => {
255
255
  var n;
@@ -258,16 +258,16 @@ export default class na {
258
258
  (null !=
259
259
  (null === (n = this.B) || void 0 === n
260
260
  ? void 0
261
- : n.En()) && (o = ei.Cn(this.B.En())),
261
+ : n.Tn()) && (o = ei.Vn(this.B.Tn())),
262
262
  r)
263
263
  ) {
264
264
  let n,
265
265
  u = null,
266
266
  a = null;
267
- if ((this.C && (n = this.C.vs(t.gs.Fn)), n && !z(n))) {
267
+ if ((this.C && (n = this.C.ft(s.gt.qn)), n && !z(n))) {
268
268
  let i;
269
269
  try {
270
- i = ti.Bn(n).On;
270
+ i = ti.En(n).zn;
271
271
  } catch (t) {
272
272
  i = null;
273
273
  }
@@ -291,31 +291,31 @@ export default class na {
291
291
  : N.info(
292
292
  "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.",
293
293
  ),
294
- this.An(r, s, o, i, e))
294
+ this.wn(r, e, o, i, t))
295
295
  : r.expirationTime &&
296
296
  new Date(r.expirationTime).valueOf() <=
297
297
  new Date().valueOf()
298
298
  ? (N.info(
299
299
  "Push subscription is expired, creating new subscription.",
300
300
  ),
301
- this.An(r, s, o, i, e))
301
+ this.wn(r, e, o, i, t))
302
302
  : n && z(n)
303
- ? this.An(r, s, o, i, e)
303
+ ? this.wn(r, e, o, i, t)
304
304
  : null == a
305
305
  ? (N.info(
306
306
  "No push subscription creation date found, creating new subscription.",
307
307
  ),
308
- this.An(r, s, o, i, e))
308
+ this.wn(r, e, o, i, t))
309
309
  : a.valueOf() <= new Date().valueOf()
310
310
  ? (N.info(
311
311
  "Push subscription older than 6 months, creating new subscription.",
312
312
  ),
313
- this.An(r, s, o, i, e))
313
+ this.wn(r, e, o, i, t))
314
314
  : (N.info(
315
315
  "Device already subscribed to push, sending existing subscription to backend.",
316
316
  ),
317
- this.xn(r, u, i));
318
- } else this.jn(s, o, i, e);
317
+ this.Pn(r, u, i));
318
+ } else this.kn(e, o, i, t);
319
319
  })
320
320
  .catch((i) => {
321
321
  N.error("Error checking current push subscriptions: " + i);
@@ -325,30 +325,30 @@ export default class na {
325
325
  N.error("ServiceWorker registration failed: " + i);
326
326
  });
327
327
  };
328
- this.requestPermission(o, r, s);
329
- } else if (this.Pn) {
330
- if (null == this.yn || "" === this.yn)
328
+ this.requestPermission(o, r, e);
329
+ } else if (this.mn) {
330
+ if (null == this.fn || "" === this.fn)
331
331
  return (
332
332
  N.error(
333
333
  "You must supply the safariWebsitePushId initialization option in order to use registerPush on Safari",
334
334
  ),
335
- void ("function" == typeof e && e(!0))
335
+ void ("function" == typeof t && t(!0))
336
336
  );
337
- const t = window.safari.pushNotification.permission(this.yn);
338
- this.In(this.yn, t, i, e);
337
+ const e = window.safari.pushNotification.permission(this.fn);
338
+ this.Nn(this.fn, e, i, t);
339
339
  }
340
340
  }
341
341
  unsubscribe(i, t) {
342
342
  if (!vt.isPushSupported())
343
- return N.info(na.zn), void ("function" == typeof t && t());
344
- this.wn
345
- ? navigator.serviceWorker.getRegistration(this.dn).then((e) => {
343
+ return N.info(na._n), void ("function" == typeof t && t());
344
+ this.bn
345
+ ? navigator.serviceWorker.getRegistration(this.hn).then((e) => {
346
346
  e
347
347
  ? e.pushManager
348
348
  .getSubscription()
349
349
  .then((s) => {
350
350
  s
351
- ? (this.Wn(),
351
+ ? (this.An(),
352
352
  s
353
353
  .unsubscribe()
354
354
  .then((s) => {
@@ -361,7 +361,7 @@ export default class na {
361
361
  "Failed to unsubscribe device from push.",
362
362
  ),
363
363
  "function" == typeof t && t()),
364
- this.qn(e);
364
+ this.Wn(e);
365
365
  })
366
366
  .catch((i) => {
367
367
  N.error("Push unsubscription error: " + i),
@@ -377,10 +377,10 @@ export default class na {
377
377
  : (N.info("Device already unsubscribed from push."),
378
378
  "function" == typeof i && i());
379
379
  })
380
- : this.Pn &&
381
- (this.Wn(),
380
+ : this.mn &&
381
+ (this.An(),
382
382
  N.info("Device unsubscribed from push."),
383
383
  "function" == typeof i && i());
384
384
  }
385
385
  }
386
- na.zn = "Push notifications are not supported in this browser.";
386
+ na._n = "Push notifications are not supported in this browser.";
@@ -1,15 +1,15 @@
1
1
  const vt = {
2
- kn: () =>
2
+ yn: () =>
3
3
  "serviceWorker" in navigator &&
4
4
  "undefined" != typeof ServiceWorkerRegistration &&
5
5
  "showNotification" in ServiceWorkerRegistration.prototype &&
6
6
  "PushManager" in window,
7
- Dn: () =>
7
+ gn: () =>
8
8
  "safari" in window &&
9
9
  "pushNotification" in window.safari &&
10
10
  "function" == typeof window.safari.pushNotification.permission &&
11
11
  "function" == typeof window.safari.pushNotification.requestPermission,
12
- isPushSupported: () => vt.kn() || vt.Dn(),
12
+ isPushSupported: () => vt.yn() || vt.gn(),
13
13
  isPushBlocked: () => {
14
14
  const i =
15
15
  vt.isPushSupported() &&
@@ -28,7 +28,7 @@ const vt = {
28
28
  null != window.Notification &&
29
29
  null != window.Notification.permission &&
30
30
  "granted" === window.Notification.permission,
31
- Nr: () =>
31
+ wr: () =>
32
32
  !vt.isPushBlocked() &&
33
33
  vt.isPushSupported() &&
34
34
  !vt.isPushPermissionGranted(),
@@ -2,26 +2,26 @@ import _t from "../models/identifier.js";
2
2
  import { getByteLength as er } from "../util/string-utils.js";
3
3
  import ti from "../models/push-token.js";
4
4
  import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js";
5
- import { STORAGE_KEYS as t } from "../managers/storage-manager.js";
5
+ import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
6
6
  import { User } from "../User/index.js";
7
7
  export default class bt {
8
8
  constructor(t, s) {
9
9
  (this.B = t), (this.C = s), (this.B = t), (this.C = s);
10
10
  }
11
11
  getUserId() {
12
- const s = this.C.tu(t.iu.su);
13
- if (null == s) return null;
14
- let i = s.eu,
12
+ const t = this.C.tu(s.iu.su);
13
+ if (null == t) return null;
14
+ let i = t.eu,
15
15
  e = er(i);
16
16
  if (e > User.ur) {
17
17
  for (; e > User.ur; ) (i = i.slice(0, i.length - 1)), (e = er(i));
18
- (s.eu = i), this.C.uu(t.iu.su, s);
18
+ (t.eu = i), this.C.uu(s.iu.su, t);
19
19
  }
20
20
  return i;
21
21
  }
22
- ou(s) {
22
+ ou(t) {
23
23
  const i = null == this.getUserId();
24
- this.C.uu(t.iu.su, new _t(s)), i && this.C.ru(s);
24
+ this.C.uu(s.iu.su, new _t(t)), i && this.C.ru(t);
25
25
  }
26
26
  setCustomUserAttribute(t, s) {
27
27
  if (this.B.hu(t))
@@ -47,27 +47,27 @@ export default class bt {
47
47
  u
48
48
  );
49
49
  }
50
- Un(s, i, e, u, o) {
51
- this.nu("push_token", s, !1, !0),
50
+ Sn(t, i, e, u, o) {
51
+ this.nu("push_token", t, !1, !0),
52
52
  this.nu("custom_push_public_key", e, !1, !0),
53
53
  this.nu("custom_push_user_auth", u, !1, !0),
54
54
  this.nu("custom_push_vapid_public_key", o, !1, !0);
55
- const r = tt._s.Xs,
55
+ const r = tt.Ls.Fs,
56
56
  h = new tt(r, N),
57
- n = new ti(s, i, e, u, o);
58
- this.C.Bs(t.gs.Fn, n.bs()), h.setItem(r.Ks.cu, r.te, !0);
57
+ n = new ti(t, i, e, u, o);
58
+ this.C.Bt(s.gt.qn, n.bt()), h.setItem(r.Ms.cu, r.be, !0);
59
59
  }
60
- _n(s) {
60
+ jn(t) {
61
61
  if (
62
62
  (this.nu("push_token", null, !1, !0),
63
63
  this.nu("custom_push_public_key", null, !1, !0),
64
64
  this.nu("custom_push_user_auth", null, !1, !0),
65
65
  this.nu("custom_push_vapid_public_key", null, !1, !0),
66
- s)
66
+ t)
67
67
  ) {
68
- const s = tt._s.Xs,
69
- i = new tt(s, N);
70
- this.C.Bs(t.gs.Fn, !1), i.setItem(s.Ks.cu, s.te, !1);
68
+ const t = tt.Ls.Fs,
69
+ i = new tt(t, N);
70
+ this.C.Bt(s.gt.qn, !1), i.setItem(t.Ms.cu, t.be, !1);
71
71
  }
72
72
  }
73
73
  }