@metamask/notification-services-controller 0.4.0 → 0.5.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 (113) hide show
  1. package/CHANGELOG.md +19 -1
  2. package/dist/NotificationServicesController/NotificationServicesController.js +6 -6
  3. package/dist/NotificationServicesController/NotificationServicesController.mjs +5 -5
  4. package/dist/NotificationServicesController/constants/index.js +3 -3
  5. package/dist/NotificationServicesController/constants/index.mjs +2 -2
  6. package/dist/NotificationServicesController/constants/notification-schema.js +2 -2
  7. package/dist/NotificationServicesController/constants/notification-schema.mjs +1 -1
  8. package/dist/NotificationServicesController/index.js +11 -11
  9. package/dist/NotificationServicesController/index.mjs +10 -10
  10. package/dist/NotificationServicesController/processors/index.js +4 -4
  11. package/dist/NotificationServicesController/processors/index.mjs +3 -3
  12. package/dist/NotificationServicesController/processors/process-notifications.js +3 -3
  13. package/dist/NotificationServicesController/processors/process-notifications.mjs +2 -2
  14. package/dist/NotificationServicesController/services/feature-announcements.js +1 -1
  15. package/dist/NotificationServicesController/services/feature-announcements.mjs +1 -1
  16. package/dist/NotificationServicesController/services/onchain-notifications.js +4 -4
  17. package/dist/NotificationServicesController/services/onchain-notifications.mjs +3 -3
  18. package/dist/NotificationServicesController/ui/constants.js +3 -3
  19. package/dist/NotificationServicesController/ui/constants.mjs +2 -2
  20. package/dist/NotificationServicesController/ui/index.js +4 -4
  21. package/dist/NotificationServicesController/ui/index.mjs +3 -3
  22. package/dist/NotificationServicesController/utils/utils.js +3 -3
  23. package/dist/NotificationServicesController/utils/utils.mjs +2 -2
  24. package/dist/NotificationServicesPushController/NotificationServicesPushController.js +14 -14
  25. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +13 -13
  26. package/dist/NotificationServicesPushController/index.js +17 -17
  27. package/dist/NotificationServicesPushController/index.mjs +16 -16
  28. package/dist/NotificationServicesPushController/services/push/push-web.js +12 -12
  29. package/dist/NotificationServicesPushController/services/push/push-web.mjs +11 -11
  30. package/dist/NotificationServicesPushController/services/services.js +13 -13
  31. package/dist/NotificationServicesPushController/services/services.mjs +12 -12
  32. package/dist/NotificationServicesPushController/utils/get-notification-message.js +12 -12
  33. package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +11 -11
  34. package/dist/NotificationServicesPushController/utils/index.js +13 -13
  35. package/dist/NotificationServicesPushController/utils/index.mjs +12 -12
  36. package/dist/{chunk-ZHAD55AN.mjs → chunk-2P5WP5NT.mjs} +2 -2
  37. package/dist/{chunk-J4D2NH6Y.mjs → chunk-53F3SYYM.mjs} +2 -2
  38. package/dist/chunk-53F3SYYM.mjs.map +1 -0
  39. package/dist/{chunk-X42WN3FE.mjs → chunk-5FAAZCBK.mjs} +2 -2
  40. package/dist/{chunk-4HOEZMSV.js → chunk-6FLC6CJD.js} +4 -4
  41. package/dist/{chunk-YZYQYIKS.mjs → chunk-77QIITUL.mjs} +2 -2
  42. package/dist/{chunk-GNN2XQW4.mjs → chunk-7PWKQSM2.mjs} +9 -9
  43. package/dist/{chunk-YHVXD5WW.mjs → chunk-CGPMMFUQ.mjs} +2 -2
  44. package/dist/{chunk-RZXUP2M6.mjs → chunk-CWZQMK63.mjs} +4 -4
  45. package/dist/{chunk-CXWZLA5O.mjs → chunk-ER475D6V.mjs} +49 -34
  46. package/dist/chunk-ER475D6V.mjs.map +1 -0
  47. package/dist/{chunk-BUT7X5F2.js → chunk-HCDICNYK.js} +3 -3
  48. package/dist/{chunk-V6P5JEPT.js → chunk-HE3P5RM7.js} +2 -2
  49. package/dist/{chunk-V6P5JEPT.js.map → chunk-HE3P5RM7.js.map} +1 -1
  50. package/dist/{chunk-GDKHOBJT.js → chunk-HT6T5R4U.js} +3 -3
  51. package/dist/{chunk-2O32EME6.js → chunk-JIJXHO5V.js} +36 -30
  52. package/dist/chunk-JIJXHO5V.js.map +1 -0
  53. package/dist/{chunk-NOYP2T77.js → chunk-JW3TK3NU.js} +5 -5
  54. package/dist/{chunk-5CFEVEAV.js → chunk-KGLHGLER.js} +54 -39
  55. package/dist/chunk-KGLHGLER.js.map +1 -0
  56. package/dist/{chunk-5JDAO4ZC.mjs → chunk-LZMC2QML.mjs} +3 -3
  57. package/dist/{chunk-KCWTVLMK.mjs → chunk-MG5QDUDI.mjs} +2 -2
  58. package/dist/{chunk-DCADU5QI.mjs → chunk-MNBV5FJI.mjs} +2 -2
  59. package/dist/{chunk-H73GATCU.js → chunk-NIPCK74T.js} +8 -8
  60. package/dist/chunk-O45HYLIV.js +67 -0
  61. package/dist/{chunk-FN6GVBCU.mjs → chunk-OHFX4S6R.mjs} +2 -2
  62. package/dist/{chunk-QY4UST5V.js → chunk-OMBFVTP2.js} +10 -10
  63. package/dist/{chunk-KWTSMLND.js → chunk-PJMQ2XEG.js} +4 -4
  64. package/dist/{chunk-IG3KWCQU.js → chunk-QAOZN4AX.js} +7 -7
  65. package/dist/{chunk-5FUMSWDD.js → chunk-SGLVWM4N.js} +3 -3
  66. package/dist/{chunk-ABWWUGTE.js → chunk-UQ6MTYIR.js} +30 -30
  67. package/dist/{chunk-ENRKCWJ6.js → chunk-UZHUVXRM.js} +5 -5
  68. package/dist/{chunk-WGGW6VCR.mjs → chunk-VZMQIJMK.mjs} +2 -2
  69. package/dist/{chunk-XGHB2EF3.js → chunk-W7IP4LDB.js} +11 -11
  70. package/dist/{chunk-DFDFJ4DX.mjs → chunk-WE4RFGT7.mjs} +19 -13
  71. package/dist/chunk-WE4RFGT7.mjs.map +1 -0
  72. package/dist/{chunk-6GUOLD7O.mjs → chunk-WGBEAP2F.mjs} +2 -2
  73. package/dist/{chunk-ILPTPB4U.mjs → chunk-YUMIJSUD.mjs} +2 -2
  74. package/dist/index.js +17 -17
  75. package/dist/index.mjs +16 -16
  76. package/dist/tsconfig.build.tsbuildinfo +1 -1
  77. package/dist/types/NotificationServicesController/NotificationServicesController.d.ts +5 -1
  78. package/dist/types/NotificationServicesController/NotificationServicesController.d.ts.map +1 -1
  79. package/dist/types/NotificationServicesPushController/NotificationServicesPushController.d.ts +6 -1
  80. package/dist/types/NotificationServicesPushController/NotificationServicesPushController.d.ts.map +1 -1
  81. package/package.json +4 -4
  82. package/dist/chunk-2O32EME6.js.map +0 -1
  83. package/dist/chunk-5CFEVEAV.js.map +0 -1
  84. package/dist/chunk-CXWZLA5O.mjs.map +0 -1
  85. package/dist/chunk-DFDFJ4DX.mjs.map +0 -1
  86. package/dist/chunk-J4D2NH6Y.mjs.map +0 -1
  87. package/dist/chunk-QOG3RCXM.js +0 -67
  88. /package/dist/{chunk-ZHAD55AN.mjs.map → chunk-2P5WP5NT.mjs.map} +0 -0
  89. /package/dist/{chunk-X42WN3FE.mjs.map → chunk-5FAAZCBK.mjs.map} +0 -0
  90. /package/dist/{chunk-4HOEZMSV.js.map → chunk-6FLC6CJD.js.map} +0 -0
  91. /package/dist/{chunk-YZYQYIKS.mjs.map → chunk-77QIITUL.mjs.map} +0 -0
  92. /package/dist/{chunk-GNN2XQW4.mjs.map → chunk-7PWKQSM2.mjs.map} +0 -0
  93. /package/dist/{chunk-YHVXD5WW.mjs.map → chunk-CGPMMFUQ.mjs.map} +0 -0
  94. /package/dist/{chunk-RZXUP2M6.mjs.map → chunk-CWZQMK63.mjs.map} +0 -0
  95. /package/dist/{chunk-BUT7X5F2.js.map → chunk-HCDICNYK.js.map} +0 -0
  96. /package/dist/{chunk-GDKHOBJT.js.map → chunk-HT6T5R4U.js.map} +0 -0
  97. /package/dist/{chunk-NOYP2T77.js.map → chunk-JW3TK3NU.js.map} +0 -0
  98. /package/dist/{chunk-5JDAO4ZC.mjs.map → chunk-LZMC2QML.mjs.map} +0 -0
  99. /package/dist/{chunk-KCWTVLMK.mjs.map → chunk-MG5QDUDI.mjs.map} +0 -0
  100. /package/dist/{chunk-DCADU5QI.mjs.map → chunk-MNBV5FJI.mjs.map} +0 -0
  101. /package/dist/{chunk-H73GATCU.js.map → chunk-NIPCK74T.js.map} +0 -0
  102. /package/dist/{chunk-QOG3RCXM.js.map → chunk-O45HYLIV.js.map} +0 -0
  103. /package/dist/{chunk-FN6GVBCU.mjs.map → chunk-OHFX4S6R.mjs.map} +0 -0
  104. /package/dist/{chunk-QY4UST5V.js.map → chunk-OMBFVTP2.js.map} +0 -0
  105. /package/dist/{chunk-KWTSMLND.js.map → chunk-PJMQ2XEG.js.map} +0 -0
  106. /package/dist/{chunk-IG3KWCQU.js.map → chunk-QAOZN4AX.js.map} +0 -0
  107. /package/dist/{chunk-5FUMSWDD.js.map → chunk-SGLVWM4N.js.map} +0 -0
  108. /package/dist/{chunk-ABWWUGTE.js.map → chunk-UQ6MTYIR.js.map} +0 -0
  109. /package/dist/{chunk-ENRKCWJ6.js.map → chunk-UZHUVXRM.js.map} +0 -0
  110. /package/dist/{chunk-WGGW6VCR.mjs.map → chunk-VZMQIJMK.mjs.map} +0 -0
  111. /package/dist/{chunk-XGHB2EF3.js.map → chunk-W7IP4LDB.js.map} +0 -0
  112. /package/dist/{chunk-6GUOLD7O.mjs.map → chunk-WGBEAP2F.mjs.map} +0 -0
  113. /package/dist/{chunk-ILPTPB4U.mjs.map → chunk-YUMIJSUD.mjs.map} +0 -0
@@ -2,10 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkQOG3RCXMjs = require('./chunk-QOG3RCXM.js');
5
+ var _chunkO45HYLIVjs = require('./chunk-O45HYLIV.js');
6
6
 
7
7
 
8
- var _chunkV6P5JEPTjs = require('./chunk-V6P5JEPT.js');
8
+ var _chunkHE3P5RM7js = require('./chunk-HE3P5RM7.js');
9
9
 
10
10
 
11
11
  var _chunkIGY2S5BCjs = require('./chunk-IGY2S5BC.js');
@@ -13,13 +13,13 @@ var _chunkIGY2S5BCjs = require('./chunk-IGY2S5BC.js');
13
13
  // src/NotificationServicesController/ui/index.ts
14
14
  var ui_exports = {};
15
15
  _chunkIGY2S5BCjs.__export.call(void 0, ui_exports, {
16
- NOTIFICATION_CHAINS_ID: () => _chunkV6P5JEPTjs.NOTIFICATION_CHAINS_ID,
17
- NOTIFICATION_NETWORK_CURRENCY_NAME: () => _chunkQOG3RCXMjs.NOTIFICATION_NETWORK_CURRENCY_NAME,
18
- NOTIFICATION_NETWORK_CURRENCY_SYMBOL: () => _chunkQOG3RCXMjs.NOTIFICATION_NETWORK_CURRENCY_SYMBOL,
19
- SUPPORTED_NOTIFICATION_BLOCK_EXPLORERS: () => _chunkQOG3RCXMjs.SUPPORTED_NOTIFICATION_BLOCK_EXPLORERS
16
+ NOTIFICATION_CHAINS_ID: () => _chunkHE3P5RM7js.NOTIFICATION_CHAINS_ID,
17
+ NOTIFICATION_NETWORK_CURRENCY_NAME: () => _chunkO45HYLIVjs.NOTIFICATION_NETWORK_CURRENCY_NAME,
18
+ NOTIFICATION_NETWORK_CURRENCY_SYMBOL: () => _chunkO45HYLIVjs.NOTIFICATION_NETWORK_CURRENCY_SYMBOL,
19
+ SUPPORTED_NOTIFICATION_BLOCK_EXPLORERS: () => _chunkO45HYLIVjs.SUPPORTED_NOTIFICATION_BLOCK_EXPLORERS
20
20
  });
21
21
 
22
22
 
23
23
 
24
24
  exports.ui_exports = ui_exports;
25
- //# sourceMappingURL=chunk-IG3KWCQU.js.map
25
+ //# sourceMappingURL=chunk-QAOZN4AX.js.map
@@ -7,10 +7,10 @@ var _chunkLYEXYTOIjs = require('./chunk-LYEXYTOI.js');
7
7
  var _chunk52CALMRAjs = require('./chunk-52CALMRA.js');
8
8
 
9
9
 
10
- var _chunkV6P5JEPTjs = require('./chunk-V6P5JEPT.js');
10
+ var _chunkHE3P5RM7js = require('./chunk-HE3P5RM7.js');
11
11
 
12
12
  // src/NotificationServicesController/processors/process-notifications.ts
13
- var isOnChainNotification = (n) => Object.values(_chunkV6P5JEPTjs.TRIGGER_TYPES).includes(n.type);
13
+ var isOnChainNotification = (n) => Object.values(_chunkHE3P5RM7js.TRIGGER_TYPES).includes(n.type);
14
14
  var isFeatureAnnouncement = (n) => n.type === "features_announcement" /* FEATURES_ANNOUNCEMENT */;
15
15
  function processNotification(notification, readNotifications = []) {
16
16
  const exhaustedAllCases = (_) => {
@@ -45,4 +45,4 @@ function safeProcessNotification(notification, readNotifications = []) {
45
45
 
46
46
 
47
47
  exports.processNotification = processNotification; exports.safeProcessNotification = safeProcessNotification;
48
- //# sourceMappingURL=chunk-5FUMSWDD.js.map
48
+ //# sourceMappingURL=chunk-SGLVWM4N.js.map
@@ -3,21 +3,21 @@
3
3
  var _chunk232HZSEVjs = require('./chunk-232HZSEV.js');
4
4
 
5
5
 
6
- var _chunkIG3KWCQUjs = require('./chunk-IG3KWCQU.js');
6
+ var _chunkQAOZN4AXjs = require('./chunk-QAOZN4AX.js');
7
7
 
8
8
 
9
- var _chunkQY4UST5Vjs = require('./chunk-QY4UST5V.js');
9
+ var _chunkOMBFVTP2js = require('./chunk-OMBFVTP2.js');
10
10
 
11
11
 
12
- var _chunkKWTSMLNDjs = require('./chunk-KWTSMLND.js');
12
+ var _chunkPJMQ2XEGjs = require('./chunk-PJMQ2XEG.js');
13
13
 
14
14
 
15
15
 
16
- var _chunk2O32EME6js = require('./chunk-2O32EME6.js');
16
+ var _chunkJIJXHO5Vjs = require('./chunk-JIJXHO5V.js');
17
17
 
18
18
 
19
19
 
20
- var _chunk5FUMSWDDjs = require('./chunk-5FUMSWDD.js');
20
+ var _chunkSGLVWM4Njs = require('./chunk-SGLVWM4N.js');
21
21
 
22
22
 
23
23
  var _chunkLYEXYTOIjs = require('./chunk-LYEXYTOI.js');
@@ -32,10 +32,10 @@ var _chunk52CALMRAjs = require('./chunk-52CALMRA.js');
32
32
 
33
33
 
34
34
 
35
- var _chunkH73GATCUjs = require('./chunk-H73GATCU.js');
35
+ var _chunkNIPCK74Tjs = require('./chunk-NIPCK74T.js');
36
36
 
37
37
 
38
- var _chunkNOYP2T77js = require('./chunk-NOYP2T77.js');
38
+ var _chunkJW3TK3NUjs = require('./chunk-JW3TK3NU.js');
39
39
 
40
40
 
41
41
 
@@ -45,7 +45,7 @@ var _chunkNOYP2T77js = require('./chunk-NOYP2T77.js');
45
45
 
46
46
 
47
47
 
48
- var _chunkV6P5JEPTjs = require('./chunk-V6P5JEPT.js');
48
+ var _chunkHE3P5RM7js = require('./chunk-HE3P5RM7.js');
49
49
 
50
50
 
51
51
 
@@ -57,29 +57,29 @@ var _chunkIGY2S5BCjs = require('./chunk-IGY2S5BC.js');
57
57
  // src/NotificationServicesController/index.ts
58
58
  var NotificationServicesController_exports = {};
59
59
  _chunkIGY2S5BCjs.__export.call(void 0, NotificationServicesController_exports, {
60
- CHAIN_SYMBOLS: () => _chunkV6P5JEPTjs.CHAIN_SYMBOLS,
61
- Constants: () => _chunkQY4UST5Vjs.constants_exports,
62
- Controller: () => _chunk2O32EME6js.NotificationServicesController,
60
+ CHAIN_SYMBOLS: () => _chunkHE3P5RM7js.CHAIN_SYMBOLS,
61
+ Constants: () => _chunkOMBFVTP2js.constants_exports,
62
+ Controller: () => _chunkJIJXHO5Vjs.NotificationServicesController,
63
63
  Mocks: () => fixtures_exports,
64
- NOTIFICATION_CHAINS: () => _chunkV6P5JEPTjs.NOTIFICATION_CHAINS,
65
- NOTIFICATION_CHAINS_ID: () => _chunkV6P5JEPTjs.NOTIFICATION_CHAINS_ID,
66
- Processors: () => _chunkKWTSMLNDjs.processors_exports,
67
- SUPPORTED_CHAINS: () => _chunkV6P5JEPTjs.SUPPORTED_CHAINS,
68
- TRIGGERS: () => _chunkV6P5JEPTjs.TRIGGERS,
69
- TRIGGER_TYPES: () => _chunkV6P5JEPTjs.TRIGGER_TYPES,
70
- TRIGGER_TYPES_GROUPS: () => _chunkV6P5JEPTjs.TRIGGER_TYPES_GROUPS,
71
- TRIGGER_TYPES_WALLET_SET: () => _chunkV6P5JEPTjs.TRIGGER_TYPES_WALLET_SET,
64
+ NOTIFICATION_CHAINS: () => _chunkHE3P5RM7js.NOTIFICATION_CHAINS,
65
+ NOTIFICATION_CHAINS_ID: () => _chunkHE3P5RM7js.NOTIFICATION_CHAINS_ID,
66
+ Processors: () => _chunkPJMQ2XEGjs.processors_exports,
67
+ SUPPORTED_CHAINS: () => _chunkHE3P5RM7js.SUPPORTED_CHAINS,
68
+ TRIGGERS: () => _chunkHE3P5RM7js.TRIGGERS,
69
+ TRIGGER_TYPES: () => _chunkHE3P5RM7js.TRIGGER_TYPES,
70
+ TRIGGER_TYPES_GROUPS: () => _chunkHE3P5RM7js.TRIGGER_TYPES_GROUPS,
71
+ TRIGGER_TYPES_WALLET_SET: () => _chunkHE3P5RM7js.TRIGGER_TYPES_WALLET_SET,
72
72
  Types: () => _chunk232HZSEVjs.types_exports,
73
- UI: () => _chunkIG3KWCQUjs.ui_exports,
73
+ UI: () => _chunkQAOZN4AXjs.ui_exports,
74
74
  USER_STORAGE_VERSION: () => _chunkTLX5QQK5js.USER_STORAGE_VERSION,
75
75
  USER_STORAGE_VERSION_KEY: () => _chunkTLX5QQK5js.USER_STORAGE_VERSION_KEY,
76
76
  default: () => NotificationServicesController_default,
77
- defaultState: () => _chunk2O32EME6js.defaultState,
77
+ defaultState: () => _chunkJIJXHO5Vjs.defaultState,
78
78
  isFeatureAnnouncementRead: () => _chunk52CALMRAjs.isFeatureAnnouncementRead,
79
79
  processFeatureAnnouncement: () => _chunk52CALMRAjs.processFeatureAnnouncement,
80
- processNotification: () => _chunk5FUMSWDDjs.processNotification,
80
+ processNotification: () => _chunkSGLVWM4Njs.processNotification,
81
81
  processOnChainNotification: () => _chunkLYEXYTOIjs.processOnChainNotification,
82
- safeProcessNotification: () => _chunk5FUMSWDDjs.safeProcessNotification
82
+ safeProcessNotification: () => _chunkSGLVWM4Njs.safeProcessNotification
83
83
  });
84
84
 
85
85
  // src/NotificationServicesController/__fixtures__/index.ts
@@ -375,7 +375,7 @@ function createMockUserStorageWithTriggers(triggers) {
375
375
  return userStorage;
376
376
  }
377
377
  function createMockFullUserStorage(props = {}) {
378
- return _chunkNOYP2T77js.initializeUserStorage.call(void 0,
378
+ return _chunkJW3TK3NUjs.initializeUserStorage.call(void 0,
379
379
  [{ address: props.address ?? MOCK_USER_STORAGE_ACCOUNT }],
380
380
  props.triggersEnabled ?? true
381
381
  );
@@ -932,14 +932,14 @@ var getMockFeatureAnnouncementResponse = () => {
932
932
  };
933
933
  var getMockBatchCreateTriggersResponse = () => {
934
934
  return {
935
- url: _chunkH73GATCUjs.TRIGGER_API_BATCH_ENDPOINT,
935
+ url: _chunkNIPCK74Tjs.TRIGGER_API_BATCH_ENDPOINT,
936
936
  requestMethod: "POST",
937
937
  response: null
938
938
  };
939
939
  };
940
940
  var getMockBatchDeleteTriggersResponse = () => {
941
941
  return {
942
- url: _chunkH73GATCUjs.TRIGGER_API_BATCH_ENDPOINT,
942
+ url: _chunkNIPCK74Tjs.TRIGGER_API_BATCH_ENDPOINT,
943
943
  requestMethod: "DELETE",
944
944
  response: null
945
945
  };
@@ -947,21 +947,21 @@ var getMockBatchDeleteTriggersResponse = () => {
947
947
  var MOCK_RAW_ON_CHAIN_NOTIFICATIONS = createMockRawOnChainNotifications();
948
948
  var getMockListNotificationsResponse = () => {
949
949
  return {
950
- url: _chunkH73GATCUjs.NOTIFICATION_API_LIST_ENDPOINT,
950
+ url: _chunkNIPCK74Tjs.NOTIFICATION_API_LIST_ENDPOINT,
951
951
  requestMethod: "POST",
952
952
  response: MOCK_RAW_ON_CHAIN_NOTIFICATIONS
953
953
  };
954
954
  };
955
955
  var getMockMarkNotificationsAsReadResponse = () => {
956
956
  return {
957
- url: _chunkH73GATCUjs.NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT,
957
+ url: _chunkNIPCK74Tjs.NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT,
958
958
  requestMethod: "POST",
959
959
  response: null
960
960
  };
961
961
  };
962
962
 
963
963
  // src/NotificationServicesController/index.ts
964
- var NotificationServicesController2 = _chunk2O32EME6js.NotificationServicesController;
964
+ var NotificationServicesController2 = _chunkJIJXHO5Vjs.NotificationServicesController;
965
965
  var NotificationServicesController_default = NotificationServicesController2;
966
966
 
967
967
 
@@ -969,4 +969,4 @@ var NotificationServicesController_default = NotificationServicesController2;
969
969
 
970
970
 
971
971
  exports.fixtures_exports = fixtures_exports; exports.NotificationServicesController_default = NotificationServicesController_default; exports.NotificationServicesController_exports = NotificationServicesController_exports;
972
- //# sourceMappingURL=chunk-ABWWUGTE.js.map
972
+ //# sourceMappingURL=chunk-UQ6MTYIR.js.map
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkBUT7X5F2js = require('./chunk-BUT7X5F2.js');
5
+ var _chunkHCDICNYKjs = require('./chunk-HCDICNYK.js');
6
6
 
7
7
 
8
8
 
@@ -17,15 +17,15 @@ var _chunkIGY2S5BCjs = require('./chunk-IGY2S5BC.js');
17
17
  var utils_exports = {};
18
18
  _chunkIGY2S5BCjs.__export.call(void 0, utils_exports, {
19
19
  calcTokenAmount: () => _chunkEJ52BDLBjs.calcTokenAmount,
20
- createOnChainPushNotificationMessage: () => _chunkBUT7X5F2js.createOnChainPushNotificationMessage,
21
- createOnChainPushNotificationMessages: () => _chunkBUT7X5F2js.createOnChainPushNotificationMessages,
20
+ createOnChainPushNotificationMessage: () => _chunkHCDICNYKjs.createOnChainPushNotificationMessage,
21
+ createOnChainPushNotificationMessages: () => _chunkHCDICNYKjs.createOnChainPushNotificationMessages,
22
22
  formatAmount: () => _chunkEJ52BDLBjs.formatAmount,
23
23
  getAmount: () => _chunkEJ52BDLBjs.getAmount,
24
24
  getLeadingZeroCount: () => _chunkEJ52BDLBjs.getLeadingZeroCount,
25
- isOnChainNotification: () => _chunkBUT7X5F2js.isOnChainNotification
25
+ isOnChainNotification: () => _chunkHCDICNYKjs.isOnChainNotification
26
26
  });
27
27
 
28
28
 
29
29
 
30
30
  exports.utils_exports = utils_exports;
31
- //# sourceMappingURL=chunk-ENRKCWJ6.js.map
31
+ //# sourceMappingURL=chunk-UZHUVXRM.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  listenToPushNotificationsClicked,
3
3
  listenToPushNotificationsReceived
4
- } from "./chunk-YHVXD5WW.mjs";
4
+ } from "./chunk-CGPMMFUQ.mjs";
5
5
  import {
6
6
  REGISTRATION_TOKENS_ENDPOINT
7
7
  } from "./chunk-IKWNHNJQ.mjs";
@@ -146,4 +146,4 @@ export {
146
146
  updateTriggerPushNotifications,
147
147
  listenToPushNotifications
148
148
  };
149
- //# sourceMappingURL=chunk-WGGW6VCR.mjs.map
149
+ //# sourceMappingURL=chunk-VZMQIJMK.mjs.map
@@ -3,12 +3,12 @@
3
3
  var _chunk7LWR54U7js = require('./chunk-7LWR54U7.js');
4
4
 
5
5
 
6
- var _chunkENRKCWJ6js = require('./chunk-ENRKCWJ6.js');
6
+ var _chunkUZHUVXRMjs = require('./chunk-UZHUVXRM.js');
7
7
 
8
8
 
9
9
 
10
10
 
11
- var _chunkBUT7X5F2js = require('./chunk-BUT7X5F2.js');
11
+ var _chunkHCDICNYKjs = require('./chunk-HCDICNYK.js');
12
12
 
13
13
 
14
14
 
@@ -18,7 +18,7 @@ var _chunkEJ52BDLBjs = require('./chunk-EJ52BDLB.js');
18
18
 
19
19
 
20
20
 
21
- var _chunk5CFEVEAVjs = require('./chunk-5CFEVEAV.js');
21
+ var _chunkKGLHGLERjs = require('./chunk-KGLHGLER.js');
22
22
 
23
23
 
24
24
  var _chunkB25TJ7KSjs = require('./chunk-B25TJ7KS.js');
@@ -29,19 +29,19 @@ var _chunkIGY2S5BCjs = require('./chunk-IGY2S5BC.js');
29
29
  // src/NotificationServicesPushController/index.ts
30
30
  var NotificationServicesPushController_exports = {};
31
31
  _chunkIGY2S5BCjs.__export.call(void 0, NotificationServicesPushController_exports, {
32
- Controller: () => _chunk5CFEVEAVjs.NotificationServicesPushController,
32
+ Controller: () => _chunkKGLHGLERjs.NotificationServicesPushController,
33
33
  Mocks: () => fixtures_exports,
34
34
  Types: () => _chunk7LWR54U7js.types_exports,
35
- Utils: () => _chunkENRKCWJ6js.utils_exports,
35
+ Utils: () => _chunkUZHUVXRMjs.utils_exports,
36
36
  calcTokenAmount: () => _chunkEJ52BDLBjs.calcTokenAmount,
37
- createOnChainPushNotificationMessage: () => _chunkBUT7X5F2js.createOnChainPushNotificationMessage,
38
- createOnChainPushNotificationMessages: () => _chunkBUT7X5F2js.createOnChainPushNotificationMessages,
37
+ createOnChainPushNotificationMessage: () => _chunkHCDICNYKjs.createOnChainPushNotificationMessage,
38
+ createOnChainPushNotificationMessages: () => _chunkHCDICNYKjs.createOnChainPushNotificationMessages,
39
39
  default: () => NotificationServicesPushController_default,
40
- defaultState: () => _chunk5CFEVEAVjs.defaultState,
40
+ defaultState: () => _chunkKGLHGLERjs.defaultState,
41
41
  formatAmount: () => _chunkEJ52BDLBjs.formatAmount,
42
42
  getAmount: () => _chunkEJ52BDLBjs.getAmount,
43
43
  getLeadingZeroCount: () => _chunkEJ52BDLBjs.getLeadingZeroCount,
44
- isOnChainNotification: () => _chunkBUT7X5F2js.isOnChainNotification
44
+ isOnChainNotification: () => _chunkHCDICNYKjs.isOnChainNotification
45
45
  });
46
46
 
47
47
  // src/NotificationServicesPushController/__fixtures__/index.ts
@@ -107,7 +107,7 @@ var getMockDeleteFCMRegistrationTokenResponse = () => {
107
107
  };
108
108
 
109
109
  // src/NotificationServicesPushController/index.ts
110
- var NotificationServicesPushController2 = _chunk5CFEVEAVjs.NotificationServicesPushController;
110
+ var NotificationServicesPushController2 = _chunkKGLHGLERjs.NotificationServicesPushController;
111
111
  var NotificationServicesPushController_default = NotificationServicesPushController2;
112
112
 
113
113
 
@@ -115,4 +115,4 @@ var NotificationServicesPushController_default = NotificationServicesPushControl
115
115
 
116
116
 
117
117
  exports.fixtures_exports = fixtures_exports; exports.NotificationServicesPushController_default = NotificationServicesPushController_default; exports.NotificationServicesPushController_exports = NotificationServicesPushController_exports;
118
- //# sourceMappingURL=chunk-XGHB2EF3.js.map
118
+ //# sourceMappingURL=chunk-W7IP4LDB.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  safeProcessNotification
3
- } from "./chunk-KCWTVLMK.mjs";
3
+ } from "./chunk-MG5QDUDI.mjs";
4
4
  import {
5
5
  getFeatureAnnouncementNotifications
6
6
  } from "./chunk-C62SK2KY.mjs";
@@ -9,7 +9,7 @@ import {
9
9
  deleteOnChainTriggers,
10
10
  getOnChainNotifications,
11
11
  markNotificationsAsRead
12
- } from "./chunk-FN6GVBCU.mjs";
12
+ } from "./chunk-OHFX4S6R.mjs";
13
13
  import {
14
14
  checkAccountsPresence,
15
15
  getAllUUIDs,
@@ -17,7 +17,7 @@ import {
17
17
  initializeUserStorage,
18
18
  traverseUserStorageTriggers,
19
19
  upsertAddressTriggers
20
- } from "./chunk-ILPTPB4U.mjs";
20
+ } from "./chunk-YUMIJSUD.mjs";
21
21
  import {
22
22
  USER_STORAGE_VERSION_KEY
23
23
  } from "./chunk-6ZDVTRRT.mjs";
@@ -224,6 +224,11 @@ var NotificationServicesController = class extends BaseController {
224
224
  }
225
225
  });
226
226
  __privateAdd(this, _pushNotifications, {
227
+ subscribeToPushNotifications: async () => {
228
+ await this.messagingSystem.call(
229
+ "NotificationServicesPushController:subscribeToPushNotifications"
230
+ );
231
+ },
227
232
  enablePushNotifications: async (UUIDs) => {
228
233
  if (!__privateGet(this, _isPushIntegrated)) {
229
234
  return;
@@ -284,16 +289,17 @@ var NotificationServicesController = class extends BaseController {
284
289
  if (__privateGet(this, _isPushNotificationsSetup)) {
285
290
  return;
286
291
  }
287
- if (!__privateGet(this, _isUnlocked)) {
288
- return;
289
- }
290
- const storage = await __privateMethod(this, _getUserStorage, getUserStorage_fn).call(this);
291
- if (!storage) {
292
- return;
292
+ if (__privateGet(this, _isUnlocked)) {
293
+ const storage = await __privateMethod(this, _getUserStorage, getUserStorage_fn).call(this);
294
+ if (!storage) {
295
+ return;
296
+ }
297
+ const uuids = getAllUUIDs(storage);
298
+ await __privateGet(this, _pushNotifications).enablePushNotifications(uuids);
299
+ __privateSet(this, _isPushNotificationsSetup, true);
300
+ } else {
301
+ await __privateGet(this, _pushNotifications).subscribeToPushNotifications();
293
302
  }
294
- const uuids = getAllUUIDs(storage);
295
- await __privateGet(this, _pushNotifications).enablePushNotifications(uuids);
296
- __privateSet(this, _isPushNotificationsSetup, true);
297
303
  }
298
304
  });
299
305
  __privateAdd(this, _accounts, {
@@ -876,4 +882,4 @@ export {
876
882
  defaultState,
877
883
  NotificationServicesController
878
884
  };
879
- //# sourceMappingURL=chunk-DFDFJ4DX.mjs.map
885
+ //# sourceMappingURL=chunk-WE4RFGT7.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/NotificationServicesController/NotificationServicesController.ts"],"sourcesContent":["import type {\n RestrictedControllerMessenger,\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n StateMetadata,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport { toChecksumHexAddress } from '@metamask/controller-utils';\nimport type {\n KeyringControllerGetAccountsAction,\n KeyringControllerStateChangeEvent,\n KeyringControllerGetStateAction,\n KeyringControllerLockEvent,\n KeyringControllerUnlockEvent,\n} from '@metamask/keyring-controller';\nimport type {\n AuthenticationController,\n UserStorageController,\n} from '@metamask/profile-sync-controller';\nimport log from 'loglevel';\n\nimport { USER_STORAGE_VERSION_KEY } from './constants/constants';\nimport { TRIGGER_TYPES } from './constants/notification-schema';\nimport { safeProcessNotification } from './processors/process-notifications';\nimport * as FeatureNotifications from './services/feature-announcements';\nimport * as OnChainNotifications from './services/onchain-notifications';\nimport type {\n INotification,\n MarkAsReadNotificationsParam,\n NotificationUnion,\n} from './types/notification/notification';\nimport type { OnChainRawNotification } from './types/on-chain-notification/on-chain-notification';\nimport type { UserStorage } from './types/user-storage/user-storage';\nimport * as Utils from './utils/utils';\n\n// TODO: Fix Circular Type Dependencies\n// This indicates that control flow of messages is everywhere, lets orchestrate these better\nexport type NotificationServicesPushControllerEnablePushNotifications = {\n type: `NotificationServicesPushController:enablePushNotifications`;\n handler: (UUIDs: string[]) => Promise<void>;\n};\n\nexport type NotificationServicesPushControllerDisablePushNotifications = {\n type: `NotificationServicesPushController:disablePushNotifications`;\n handler: (UUIDs: string[]) => Promise<void>;\n};\n\nexport type NotificationServicesPushControllerUpdateTriggerPushNotifications = {\n type: `NotificationServicesPushController:updateTriggerPushNotifications`;\n handler: (UUIDs: string[]) => Promise<void>;\n};\n\nexport type NotificationServicesPushControllerSubscribeToNotifications = {\n type: `NotificationServicesPushController:subscribeToPushNotifications`;\n handler: () => Promise<void>;\n};\n\nexport type NotificationServicesPushControllerOnNewNotification = {\n type: `NotificationServicesPushController:onNewNotifications`;\n payload: [INotification];\n};\n\n// Unique name for the controller\nconst controllerName = 'NotificationServicesController';\n\n/**\n * State shape for NotificationServicesController\n */\nexport type NotificationServicesControllerState = {\n /**\n * We store and manage accounts that have been seen/visted through the\n * account subscription. This allows us to track and add notifications for new accounts and not previous accounts added.\n */\n subscriptionAccountsSeen: string[];\n\n /**\n * Flag that indicates if the metamask notifications feature has been seen\n */\n isMetamaskNotificationsFeatureSeen: boolean;\n\n /**\n * Flag that indicates if the metamask notifications are enabled\n */\n isNotificationServicesEnabled: boolean;\n\n /**\n * Flag that indicates if the feature announcements are enabled\n */\n isFeatureAnnouncementsEnabled: boolean;\n\n /**\n * List of metamask notifications\n */\n metamaskNotificationsList: INotification[];\n\n /**\n * List of read metamask notifications\n */\n metamaskNotificationsReadList: string[];\n /**\n * Flag that indicates that the creating notifications is in progress\n */\n isUpdatingMetamaskNotifications: boolean;\n /**\n * Flag that indicates that the fetching notifications is in progress\n * This is used to show a loading spinner in the UI\n * when fetching notifications\n */\n isFetchingMetamaskNotifications: boolean;\n /**\n * Flag that indicates that the updating notifications for a specific address is in progress\n */\n isUpdatingMetamaskNotificationsAccount: string[];\n /**\n * Flag that indicates that the checking accounts presence is in progress\n */\n isCheckingAccountsPresence: boolean;\n};\n\nconst metadata: StateMetadata<NotificationServicesControllerState> = {\n subscriptionAccountsSeen: {\n persist: true,\n anonymous: true,\n },\n\n isMetamaskNotificationsFeatureSeen: {\n persist: true,\n anonymous: false,\n },\n isNotificationServicesEnabled: {\n persist: true,\n anonymous: false,\n },\n isFeatureAnnouncementsEnabled: {\n persist: true,\n anonymous: false,\n },\n metamaskNotificationsList: {\n persist: true,\n anonymous: true,\n },\n metamaskNotificationsReadList: {\n persist: true,\n anonymous: true,\n },\n isUpdatingMetamaskNotifications: {\n persist: false,\n anonymous: false,\n },\n isFetchingMetamaskNotifications: {\n persist: false,\n anonymous: false,\n },\n isUpdatingMetamaskNotificationsAccount: {\n persist: false,\n anonymous: false,\n },\n isCheckingAccountsPresence: {\n persist: false,\n anonymous: false,\n },\n};\nexport const defaultState: NotificationServicesControllerState = {\n subscriptionAccountsSeen: [],\n isMetamaskNotificationsFeatureSeen: false,\n isNotificationServicesEnabled: false,\n isFeatureAnnouncementsEnabled: false,\n metamaskNotificationsList: [],\n metamaskNotificationsReadList: [],\n isUpdatingMetamaskNotifications: false,\n isFetchingMetamaskNotifications: false,\n isUpdatingMetamaskNotificationsAccount: [],\n isCheckingAccountsPresence: false,\n};\n\nexport type NotificationServicesControllerGetStateAction =\n ControllerGetStateAction<\n typeof controllerName,\n NotificationServicesControllerState\n >;\n\nexport type NotificationServicesControllerUpdateMetamaskNotificationsList = {\n type: `${typeof controllerName}:updateMetamaskNotificationsList`;\n handler: NotificationServicesController['updateMetamaskNotificationsList'];\n};\n\nexport type NotificationServicesControllerDisableNotificationServices = {\n type: `${typeof controllerName}:disableNotificationServices`;\n handler: NotificationServicesController['disableNotificationServices'];\n};\n\nexport type NotificationServicesControllerSelectIsNotificationServicesEnabled =\n {\n type: `${typeof controllerName}:selectIsNotificationServicesEnabled`;\n handler: NotificationServicesController['selectIsNotificationServicesEnabled'];\n };\n\n// Messenger Actions\nexport type Actions =\n | NotificationServicesControllerGetStateAction\n | NotificationServicesControllerUpdateMetamaskNotificationsList\n | NotificationServicesControllerDisableNotificationServices\n | NotificationServicesControllerSelectIsNotificationServicesEnabled;\n\n// Allowed Actions\nexport type AllowedActions =\n // Keyring Controller Requests\n | KeyringControllerGetAccountsAction\n | KeyringControllerGetStateAction\n // Auth Controller Requests\n | AuthenticationController.AuthenticationControllerGetBearerToken\n | AuthenticationController.AuthenticationControllerIsSignedIn\n // User Storage Controller Requests\n | UserStorageController.UserStorageControllerEnableProfileSyncing\n | UserStorageController.UserStorageControllerGetStorageKey\n | UserStorageController.UserStorageControllerPerformGetStorage\n | UserStorageController.UserStorageControllerPerformSetStorage\n // Push Notifications Controller Requests\n | NotificationServicesPushControllerEnablePushNotifications\n | NotificationServicesPushControllerDisablePushNotifications\n | NotificationServicesPushControllerUpdateTriggerPushNotifications\n | NotificationServicesPushControllerSubscribeToNotifications;\n\n// Events\nexport type NotificationServicesControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof controllerName,\n NotificationServicesControllerState\n >;\n\nexport type NotificationListUpdatedEvent = {\n type: `${typeof controllerName}:notificationsListUpdated`;\n payload: [INotification[]];\n};\n\nexport type MarkNotificationsAsReadEvent = {\n type: `${typeof controllerName}:markNotificationsAsRead`;\n payload: [INotification[]];\n};\n\n// Events\nexport type Events =\n | NotificationServicesControllerStateChangeEvent\n | NotificationListUpdatedEvent\n | MarkNotificationsAsReadEvent;\n\n// Allowed Events\nexport type AllowedEvents =\n // Keyring Events\n | KeyringControllerStateChangeEvent\n | KeyringControllerLockEvent\n | KeyringControllerUnlockEvent\n // Push Notification Events\n | NotificationServicesPushControllerOnNewNotification;\n\n// Type for the messenger of NotificationServicesController\nexport type NotificationServicesControllerMessenger =\n RestrictedControllerMessenger<\n typeof controllerName,\n Actions | AllowedActions,\n Events | AllowedEvents,\n AllowedActions['type'],\n AllowedEvents['type']\n >;\n\ntype FeatureAnnouncementEnv = {\n spaceId: string;\n accessToken: string;\n platform: 'extension' | 'mobile';\n};\n\n/**\n * Controller that enables wallet notifications and feature announcements\n */\nexport default class NotificationServicesController extends BaseController<\n typeof controllerName,\n NotificationServicesControllerState,\n NotificationServicesControllerMessenger\n> {\n // Temporary boolean as push notifications are not yet enabled on mobile\n #isPushIntegrated = true;\n\n // Flag to check is notifications have been setup when the browser/extension is initialized.\n // We want to re-initialize push notifications when the browser/extension is refreshed\n // To ensure we subscribe to the most up-to-date notifications\n #isPushNotificationsSetup = false;\n\n #isUnlocked = false;\n\n #keyringController = {\n setupLockedStateSubscriptions: (onUnlock: () => Promise<void>) => {\n const { isUnlocked } = this.messagingSystem.call(\n 'KeyringController:getState',\n );\n this.#isUnlocked = isUnlocked;\n\n this.messagingSystem.subscribe('KeyringController:unlock', () => {\n this.#isUnlocked = true;\n // messaging system cannot await promises\n // we don't need to wait for a result on this.\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n onUnlock();\n });\n\n this.messagingSystem.subscribe('KeyringController:lock', () => {\n this.#isUnlocked = false;\n });\n },\n };\n\n #auth = {\n getBearerToken: async () => {\n return await this.messagingSystem.call(\n 'AuthenticationController:getBearerToken',\n );\n },\n isSignedIn: () => {\n return this.messagingSystem.call('AuthenticationController:isSignedIn');\n },\n };\n\n #storage = {\n enableProfileSyncing: async () => {\n return await this.messagingSystem.call(\n 'UserStorageController:enableProfileSyncing',\n );\n },\n getStorageKey: () => {\n return this.messagingSystem.call('UserStorageController:getStorageKey');\n },\n getNotificationStorage: async () => {\n return await this.messagingSystem.call(\n 'UserStorageController:performGetStorage',\n 'notifications.notificationSettings',\n );\n },\n setNotificationStorage: async (state: string) => {\n return await this.messagingSystem.call(\n 'UserStorageController:performSetStorage',\n 'notifications.notificationSettings',\n state,\n );\n },\n };\n\n #pushNotifications = {\n subscribeToPushNotifications: async () => {\n await this.messagingSystem.call(\n 'NotificationServicesPushController:subscribeToPushNotifications',\n );\n },\n enablePushNotifications: async (UUIDs: string[]) => {\n if (!this.#isPushIntegrated) {\n return;\n }\n try {\n await this.messagingSystem.call(\n 'NotificationServicesPushController:enablePushNotifications',\n UUIDs,\n );\n } catch (e) {\n log.error('Silently failed to enable push notifications', e);\n }\n },\n disablePushNotifications: async (UUIDs: string[]) => {\n if (!this.#isPushIntegrated) {\n return;\n }\n try {\n await this.messagingSystem.call(\n 'NotificationServicesPushController:disablePushNotifications',\n UUIDs,\n );\n } catch (e) {\n log.error('Silently failed to disable push notifications', e);\n }\n },\n updatePushNotifications: async (UUIDs: string[]) => {\n if (!this.#isPushIntegrated) {\n return;\n }\n try {\n await this.messagingSystem.call(\n 'NotificationServicesPushController:updateTriggerPushNotifications',\n UUIDs,\n );\n } catch (e) {\n log.error('Silently failed to update push notifications', e);\n }\n },\n subscribe: () => {\n if (!this.#isPushIntegrated) {\n return;\n }\n this.messagingSystem.subscribe(\n 'NotificationServicesPushController:onNewNotifications',\n (notification) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.updateMetamaskNotificationsList(notification);\n },\n );\n },\n initializePushNotifications: async () => {\n if (!this.#isPushIntegrated) {\n return;\n }\n if (!this.state.isNotificationServicesEnabled) {\n return;\n }\n if (this.#isPushNotificationsSetup) {\n return;\n }\n\n // If wallet is unlocked, we can create a fresh push subscription\n // Otherwise we can subscribe to original subscription\n if (this.#isUnlocked) {\n const storage = await this.#getUserStorage();\n if (!storage) {\n return;\n }\n\n const uuids = Utils.getAllUUIDs(storage);\n await this.#pushNotifications.enablePushNotifications(uuids);\n this.#isPushNotificationsSetup = true;\n } else {\n await this.#pushNotifications.subscribeToPushNotifications();\n }\n },\n };\n\n #accounts = {\n /**\n * Used to get list of addresses from keyring (wallet addresses)\n *\n * @returns addresses removed, added, and latest list of addresses\n */\n listAccounts: async () => {\n // Get previous and current account sets\n const nonChecksumAccounts = await this.messagingSystem.call(\n 'KeyringController:getAccounts',\n );\n const accounts = nonChecksumAccounts.map((a) => toChecksumHexAddress(a));\n const currentAccountsSet = new Set(accounts);\n const prevAccountsSet = new Set(this.state.subscriptionAccountsSeen);\n\n // Invalid value you cannot have zero accounts\n // Only occurs when the Accounts controller is initializing.\n if (accounts.length === 0) {\n return {\n accountsAdded: [],\n accountsRemoved: [],\n accounts: [],\n };\n }\n\n // Calculate added and removed addresses\n const accountsAdded = accounts.filter((a) => !prevAccountsSet.has(a));\n const accountsRemoved = [...prevAccountsSet.values()].filter(\n (a) => !currentAccountsSet.has(a),\n );\n\n // Update accounts seen\n this.update((state) => {\n state.subscriptionAccountsSeen = [...prevAccountsSet, ...accountsAdded];\n });\n\n return {\n accountsAdded,\n accountsRemoved,\n accounts,\n };\n },\n\n /**\n * Initializes the cache/previous list. This is handy so we have an accurate in-mem state of the previous list of accounts.\n *\n * @returns result from list accounts\n */\n initialize: () => {\n return this.#accounts.listAccounts();\n },\n\n /**\n * Subscription to any state change in the keyring controller (aka wallet accounts).\n * We can call the `listAccounts` defined above to find out about any accounts added, removed\n * And call effects to subscribe/unsubscribe to notifications.\n */\n subscribe: () => {\n this.messagingSystem.subscribe(\n 'KeyringController:stateChange',\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n async () => {\n if (!this.state.isNotificationServicesEnabled) {\n return;\n }\n\n const { accountsAdded, accountsRemoved } =\n await this.#accounts.listAccounts();\n\n const promises: Promise<unknown>[] = [];\n if (accountsAdded.length > 0) {\n promises.push(this.updateOnChainTriggersByAccount(accountsAdded));\n }\n if (accountsRemoved.length > 0) {\n promises.push(this.deleteOnChainTriggersByAccount(accountsRemoved));\n }\n await Promise.all(promises);\n },\n );\n },\n };\n\n #featureAnnouncementEnv: FeatureAnnouncementEnv;\n\n /**\n * Creates a NotificationServicesController instance.\n *\n * @param args - The arguments to this function.\n * @param args.messenger - Messenger used to communicate with BaseV2 controller.\n * @param args.state - Initial state to set on this controller.\n * @param args.env - environment variables for a given controller.\n * @param args.env.featureAnnouncements - env variables for feature announcements.\n * @param args.env.isPushIntegrated - toggle push notifications on/off if client has integrated them.\n */\n constructor({\n messenger,\n state,\n env,\n }: {\n messenger: NotificationServicesControllerMessenger;\n state?: Partial<NotificationServicesControllerState>;\n env: {\n featureAnnouncements: FeatureAnnouncementEnv;\n isPushIntegrated?: boolean;\n };\n }) {\n super({\n messenger,\n metadata,\n name: controllerName,\n state: { ...defaultState, ...state },\n });\n\n this.#isPushIntegrated = env.isPushIntegrated ?? true;\n this.#featureAnnouncementEnv = env.featureAnnouncements;\n this.#registerMessageHandlers();\n this.#clearLoadingStates();\n\n this.#keyringController.setupLockedStateSubscriptions(\n this.#pushNotifications.initializePushNotifications,\n );\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.#accounts.initialize();\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.#pushNotifications.initializePushNotifications();\n this.#accounts.subscribe();\n this.#pushNotifications.subscribe();\n }\n\n #registerMessageHandlers(): void {\n this.messagingSystem.registerActionHandler(\n `${controllerName}:updateMetamaskNotificationsList`,\n this.updateMetamaskNotificationsList.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:disableNotificationServices`,\n this.disableNotificationServices.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:selectIsNotificationServicesEnabled`,\n this.selectIsNotificationServicesEnabled.bind(this),\n );\n }\n\n #clearLoadingStates(): void {\n this.update((state) => {\n state.isUpdatingMetamaskNotifications = false;\n state.isCheckingAccountsPresence = false;\n state.isFetchingMetamaskNotifications = false;\n state.isUpdatingMetamaskNotificationsAccount = [];\n });\n }\n\n #assertAuthEnabled() {\n if (!this.#auth.isSignedIn()) {\n this.update((state) => {\n state.isNotificationServicesEnabled = false;\n });\n throw new Error('User is not signed in.');\n }\n }\n\n async #getValidStorageKeyAndBearerToken() {\n this.#assertAuthEnabled();\n\n const bearerToken = await this.#auth.getBearerToken();\n const storageKey = await this.#storage.getStorageKey();\n\n if (!bearerToken || !storageKey) {\n throw new Error('Missing BearerToken or storage key');\n }\n\n return { bearerToken, storageKey };\n }\n\n #performEnableProfileSyncing = async () => {\n try {\n await this.#storage.enableProfileSyncing();\n } catch (e) {\n log.error('Failed to enable profile syncing', e);\n throw new Error('Failed to enable profile syncing');\n }\n };\n\n #assertUserStorage(\n storage: UserStorage | null,\n ): asserts storage is UserStorage {\n if (!storage) {\n throw new Error('User Storage does not exist');\n }\n }\n\n /**\n * Retrieves and parses the user storage from the storage key.\n *\n * This method attempts to retrieve the user storage using the specified storage key,\n * then parses the JSON string to an object. If the storage is not found or cannot be parsed,\n * it throws an error.\n *\n * @returns The parsed user storage object or null\n */\n async #getUserStorage(): Promise<UserStorage | null> {\n const userStorageString: string | null =\n await this.#storage.getNotificationStorage();\n\n if (!userStorageString) {\n return null;\n }\n\n try {\n const userStorage: UserStorage = JSON.parse(userStorageString);\n return userStorage;\n } catch (error) {\n log.error('Unable to parse User Storage');\n return null;\n }\n }\n\n /**\n * Retrieves the current enabled state of MetaMask notifications.\n *\n * This method directly returns the boolean value of `isMetamaskNotificationsEnabled`\n * from the controller's state, indicating whether MetaMask notifications are currently enabled.\n *\n * @returns The enabled state of MetaMask notifications.\n */\n public selectIsNotificationServicesEnabled(): boolean {\n return this.state.isNotificationServicesEnabled;\n }\n\n /**\n * Sets the state of notification creation process.\n *\n * This method updates the `isUpdatingMetamaskNotifications` state, which can be used to indicate\n * whether the notification creation process is currently active or not. This is useful\n * for UI elements that need to reflect the state of ongoing operations, such as loading\n * indicators or disabled buttons during processing.\n *\n * @param isUpdatingMetamaskNotifications - A boolean value representing the new state of the notification creation process.\n */\n #setIsUpdatingMetamaskNotifications(\n isUpdatingMetamaskNotifications: boolean,\n ) {\n this.update((state) => {\n state.isUpdatingMetamaskNotifications = isUpdatingMetamaskNotifications;\n });\n }\n\n /**\n * Updates the state to indicate whether fetching of MetaMask notifications is in progress.\n *\n * This method is used to set the `isFetchingMetamaskNotifications` state, which can be utilized\n * to show or hide loading indicators in the UI when notifications are being fetched.\n *\n * @param isFetchingMetamaskNotifications - A boolean value representing the fetching state.\n */\n #setIsFetchingMetamaskNotifications(\n isFetchingMetamaskNotifications: boolean,\n ) {\n this.update((state) => {\n state.isFetchingMetamaskNotifications = isFetchingMetamaskNotifications;\n });\n }\n\n /**\n * Updates the state to indicate that the checking of accounts presence is in progress.\n *\n * This method modifies the `isCheckingAccountsPresence` state, which can be used to manage UI elements\n * that depend on the status of account presence checks, such as displaying loading indicators or disabling\n * buttons while the check is ongoing.\n *\n * @param isCheckingAccountsPresence - A boolean value indicating whether the account presence check is currently active.\n */\n #setIsCheckingAccountsPresence(isCheckingAccountsPresence: boolean) {\n this.update((state) => {\n state.isCheckingAccountsPresence = isCheckingAccountsPresence;\n });\n }\n\n /**\n * Updates the state to indicate that account updates are in progress.\n * Removes duplicate accounts before updating the state.\n *\n * @param accounts - The accounts being updated.\n */\n #updateUpdatingAccountsState(accounts: string[]) {\n this.update((state) => {\n const uniqueAccounts = new Set([\n ...state.isUpdatingMetamaskNotificationsAccount,\n ...accounts,\n ]);\n state.isUpdatingMetamaskNotificationsAccount = Array.from(uniqueAccounts);\n });\n }\n\n /**\n * Clears the state indicating that account updates are complete.\n *\n * @param accounts - The accounts that have finished updating.\n */\n #clearUpdatingAccountsState(accounts: string[]) {\n this.update((state) => {\n state.isUpdatingMetamaskNotificationsAccount =\n state.isUpdatingMetamaskNotificationsAccount.filter(\n (existingAccount) => !accounts.includes(existingAccount),\n );\n });\n }\n\n public async checkAccountsPresence(\n accounts: string[],\n ): Promise<Record<string, boolean>> {\n try {\n this.#setIsCheckingAccountsPresence(true);\n\n // Retrieve user storage\n const userStorage = await this.#getUserStorage();\n this.#assertUserStorage(userStorage);\n\n const presence = Utils.checkAccountsPresence(userStorage, accounts);\n return presence;\n } catch (error) {\n log.error('Failed to check accounts presence', error);\n throw error;\n } finally {\n this.#setIsCheckingAccountsPresence(false);\n }\n }\n\n /**\n * Sets the enabled state of feature announcements.\n *\n * **Action** - used in the notification settings to enable/disable feature announcements.\n *\n * @param featureAnnouncementsEnabled - A boolean value indicating the desired enabled state of the feature announcements.\n * @async\n * @throws {Error} If fails to update\n */\n public async setFeatureAnnouncementsEnabled(\n featureAnnouncementsEnabled: boolean,\n ) {\n try {\n this.update((s) => {\n s.isFeatureAnnouncementsEnabled = featureAnnouncementsEnabled;\n });\n } catch (e) {\n log.error('Unable to toggle feature announcements', e);\n throw new Error('Unable to toggle feature announcements');\n }\n }\n\n /**\n * This creates/re-creates on-chain triggers defined in User Storage.\n *\n * **Action** - Used during Sign In / Enabling of notifications.\n *\n * @returns The updated or newly created user storage.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\n public async createOnChainTriggers(): Promise<UserStorage> {\n try {\n this.#setIsUpdatingMetamaskNotifications(true);\n\n await this.#performEnableProfileSyncing();\n\n const { bearerToken, storageKey } =\n await this.#getValidStorageKeyAndBearerToken();\n\n const { accounts } = await this.#accounts.listAccounts();\n\n let userStorage = await this.#getUserStorage();\n\n // If userStorage does not exist, create a new one\n // All the triggers created are set as: \"disabled\"\n if (userStorage?.[USER_STORAGE_VERSION_KEY] === undefined) {\n userStorage = Utils.initializeUserStorage(\n accounts.map((account) => ({ address: account })),\n false,\n );\n\n // Write the userStorage\n await this.#storage.setNotificationStorage(JSON.stringify(userStorage));\n }\n\n // Create the triggers\n const triggers = Utils.traverseUserStorageTriggers(userStorage);\n await OnChainNotifications.createOnChainTriggers(\n userStorage,\n storageKey,\n bearerToken,\n triggers,\n );\n\n // Create push notifications triggers\n const allUUIDS = Utils.getAllUUIDs(userStorage);\n await this.#pushNotifications.enablePushNotifications(allUUIDS);\n\n // Write the new userStorage (triggers are now \"enabled\")\n await this.#storage.setNotificationStorage(JSON.stringify(userStorage));\n\n // Update the state of the controller\n this.update((state) => {\n state.isNotificationServicesEnabled = true;\n state.isFeatureAnnouncementsEnabled = true;\n state.isMetamaskNotificationsFeatureSeen = true;\n });\n\n return userStorage;\n } catch (err) {\n log.error('Failed to create On Chain triggers', err);\n throw new Error('Failed to create On Chain triggers');\n } finally {\n this.#setIsUpdatingMetamaskNotifications(false);\n }\n }\n\n /**\n * Enables all MetaMask notifications for the user.\n * This is identical flow when initializing notifications for the first time.\n * 1. Enable Profile Syncing\n * 2. Get or Create Notification User Storage\n * 3. Upsert Triggers\n * 4. Update Push notifications\n *\n * @throws {Error} If there is an error during the process of enabling notifications.\n */\n public async enableMetamaskNotifications() {\n try {\n this.#setIsUpdatingMetamaskNotifications(true);\n await this.createOnChainTriggers();\n } catch (e) {\n log.error('Unable to enable notifications', e);\n throw new Error('Unable to enable notifications');\n } finally {\n this.#setIsUpdatingMetamaskNotifications(false);\n }\n }\n\n /**\n * Disables all MetaMask notifications for the user.\n * This method ensures that the user is authenticated, retrieves all linked accounts,\n * and disables on-chain triggers for each account. It also sets the global notification\n * settings for MetaMask, feature announcements to false.\n *\n * @throws {Error} If the user is not authenticated or if there is an error during the process.\n */\n public async disableNotificationServices() {\n try {\n this.#setIsUpdatingMetamaskNotifications(true);\n\n // Disable Push Notifications\n const userStorage = await this.#getUserStorage();\n this.#assertUserStorage(userStorage);\n const UUIDs = Utils.getAllUUIDs(userStorage);\n await this.#pushNotifications.disablePushNotifications(UUIDs);\n\n // Clear Notification States (toggles and list)\n this.update((state) => {\n state.isNotificationServicesEnabled = false;\n state.isFeatureAnnouncementsEnabled = false;\n state.metamaskNotificationsList = [];\n });\n } catch (e) {\n log.error('Unable to disable notifications', e);\n throw new Error('Unable to disable notifications');\n } finally {\n this.#setIsUpdatingMetamaskNotifications(false);\n }\n }\n\n /**\n * Deletes on-chain triggers associated with a specific account.\n * This method performs several key operations:\n * 1. Validates Auth & Storage\n * 2. Finds and deletes all triggers associated with the account\n * 3. Disables any related push notifications\n * 4. Updates Storage to reflect new state.\n *\n * **Action** - When a user disables notifications for a given account in settings.\n *\n * @param accounts - The account for which on-chain triggers are to be deleted.\n * @returns A promise that resolves to void or an object containing a success message.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\n public async deleteOnChainTriggersByAccount(\n accounts: string[],\n ): Promise<UserStorage> {\n try {\n this.#updateUpdatingAccountsState(accounts);\n // Get and Validate BearerToken and User Storage Key\n const { bearerToken, storageKey } =\n await this.#getValidStorageKeyAndBearerToken();\n\n // Get & Validate User Storage\n const userStorage = await this.#getUserStorage();\n this.#assertUserStorage(userStorage);\n\n // Get the UUIDs to delete\n const UUIDs = accounts\n .map((a) => Utils.getUUIDsForAccount(userStorage, a.toLowerCase()))\n .flat();\n\n if (UUIDs.length === 0) {\n return userStorage;\n }\n\n // Delete these UUIDs (Mutates User Storage)\n await OnChainNotifications.deleteOnChainTriggers(\n userStorage,\n storageKey,\n bearerToken,\n UUIDs,\n );\n\n // Delete these UUIDs from the push notifications\n await this.#pushNotifications.disablePushNotifications(UUIDs);\n\n // Update User Storage\n await this.#storage.setNotificationStorage(JSON.stringify(userStorage));\n return userStorage;\n } catch (err) {\n log.error('Failed to delete OnChain triggers', err);\n throw new Error('Failed to delete OnChain triggers');\n } finally {\n this.#clearUpdatingAccountsState(accounts);\n }\n }\n\n /**\n * Updates/Creates on-chain triggers for a specific account.\n *\n * This method performs several key operations:\n * 1. Validates Auth & Storage\n * 2. Finds and creates any missing triggers associated with the account\n * 3. Enables any related push notifications\n * 4. Updates Storage to reflect new state.\n *\n * **Action** - When a user enables notifications for an account\n *\n * @param accounts - List of accounts you want to update.\n * @returns A promise that resolves to the updated user storage.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\n public async updateOnChainTriggersByAccount(\n accounts: string[],\n ): Promise<UserStorage> {\n try {\n this.#updateUpdatingAccountsState(accounts);\n // Get and Validate BearerToken and User Storage Key\n const { bearerToken, storageKey } =\n await this.#getValidStorageKeyAndBearerToken();\n\n // Get & Validate User Storage\n const userStorage = await this.#getUserStorage();\n this.#assertUserStorage(userStorage);\n\n // Add any missing triggers\n accounts.forEach((a) => Utils.upsertAddressTriggers(a, userStorage));\n\n const newTriggers = Utils.traverseUserStorageTriggers(userStorage, {\n mapTrigger: (t) => {\n if (!t.enabled) {\n return t;\n }\n return undefined;\n },\n });\n\n // Create any missing triggers.\n if (newTriggers.length > 0) {\n // Write te updated userStorage (where triggers are disabled)\n await this.#storage.setNotificationStorage(JSON.stringify(userStorage));\n\n // Create the triggers\n const triggers = Utils.traverseUserStorageTriggers(userStorage, {\n mapTrigger: (t) => {\n if (\n accounts.some((a) => a.toLowerCase() === t.address.toLowerCase())\n ) {\n return t;\n }\n return undefined;\n },\n });\n await OnChainNotifications.createOnChainTriggers(\n userStorage,\n storageKey,\n bearerToken,\n triggers,\n );\n }\n\n // Update Push Notifications Triggers\n const UUIDs = Utils.getAllUUIDs(userStorage);\n await this.#pushNotifications.updatePushNotifications(UUIDs);\n\n // Update the userStorage (where triggers are enabled)\n await this.#storage.setNotificationStorage(JSON.stringify(userStorage));\n return userStorage;\n } catch (err) {\n log.error('Failed to update OnChain triggers', err);\n throw new Error('Failed to update OnChain triggers');\n } finally {\n this.#clearUpdatingAccountsState(accounts);\n }\n }\n\n /**\n * Fetches the list of metamask notifications.\n * This includes OnChain notifications and Feature Announcements.\n *\n * **Action** - When a user views the notification list page/dropdown\n *\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\n public async fetchAndUpdateMetamaskNotifications(): Promise<INotification[]> {\n try {\n this.#setIsFetchingMetamaskNotifications(true);\n\n // Raw Feature Notifications\n const rawFeatureAnnouncementNotifications = this.state\n .isFeatureAnnouncementsEnabled\n ? await FeatureNotifications.getFeatureAnnouncementNotifications(\n this.#featureAnnouncementEnv,\n ).catch(() => [])\n : [];\n\n // Raw On Chain Notifications\n const rawOnChainNotifications: OnChainRawNotification[] = [];\n const userStorage = await this.#storage\n .getNotificationStorage()\n .then((s) => s && (JSON.parse(s) as UserStorage))\n .catch(() => null);\n const bearerToken = await this.#auth.getBearerToken().catch(() => null);\n if (userStorage && bearerToken) {\n const notifications =\n await OnChainNotifications.getOnChainNotifications(\n userStorage,\n bearerToken,\n ).catch(() => []);\n\n rawOnChainNotifications.push(...notifications);\n }\n\n const readIds = this.state.metamaskNotificationsReadList;\n\n // Combined Notifications\n const isNotUndefined = <Item>(t?: Item): t is Item => Boolean(t);\n const processAndFilter = (ns: NotificationUnion[]) =>\n ns\n .map((n) => safeProcessNotification(n, readIds))\n .filter(isNotUndefined);\n\n const featureAnnouncementNotifications = processAndFilter(\n rawFeatureAnnouncementNotifications,\n );\n const onChainNotifications = processAndFilter(rawOnChainNotifications);\n\n const metamaskNotifications: INotification[] = [\n ...featureAnnouncementNotifications,\n ...onChainNotifications,\n ];\n metamaskNotifications.sort(\n (a, b) =>\n new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime(),\n );\n\n // Update State\n this.update((state) => {\n state.metamaskNotificationsList = metamaskNotifications;\n });\n\n this.messagingSystem.publish(\n `${controllerName}:notificationsListUpdated`,\n this.state.metamaskNotificationsList,\n );\n\n this.#setIsFetchingMetamaskNotifications(false);\n return metamaskNotifications;\n } catch (err) {\n this.#setIsFetchingMetamaskNotifications(false);\n log.error('Failed to fetch notifications', err);\n throw new Error('Failed to fetch notifications');\n }\n }\n\n /**\n * Marks specified metamask notifications as read.\n *\n * @param notifications - An array of notifications to be marked as read. Each notification should include its type and read status.\n * @returns A promise that resolves when the operation is complete.\n */\n public async markMetamaskNotificationsAsRead(\n notifications: MarkAsReadNotificationsParam,\n ): Promise<void> {\n let onchainNotificationIds: string[] = [];\n let featureAnnouncementNotificationIds: string[] = [];\n\n try {\n // Filter unread on/off chain notifications\n const onChainNotifications = notifications.filter(\n (notification) =>\n notification.type !== TRIGGER_TYPES.FEATURES_ANNOUNCEMENT &&\n !notification.isRead,\n );\n\n const featureAnnouncementNotifications = notifications.filter(\n (notification) =>\n notification.type === TRIGGER_TYPES.FEATURES_ANNOUNCEMENT &&\n !notification.isRead,\n );\n\n // Mark On-Chain Notifications as Read\n if (onChainNotifications.length > 0) {\n const bearerToken = await this.#auth.getBearerToken();\n\n if (bearerToken) {\n onchainNotificationIds = onChainNotifications.map(\n (notification) => notification.id,\n );\n await OnChainNotifications.markNotificationsAsRead(\n bearerToken,\n onchainNotificationIds,\n ).catch(() => {\n onchainNotificationIds = [];\n log.warn('Unable to mark onchain notifications as read');\n });\n }\n }\n\n // Mark Off-Chain notifications as Read\n if (featureAnnouncementNotifications.length > 0) {\n featureAnnouncementNotificationIds =\n featureAnnouncementNotifications.map(\n (notification) => notification.id,\n );\n }\n } catch (err) {\n log.warn('Something failed when marking notifications as read', err);\n }\n\n // Update the state (state is also used on counter & badge)\n this.update((state) => {\n const currentReadList = state.metamaskNotificationsReadList;\n const newReadIds = [...featureAnnouncementNotificationIds];\n state.metamaskNotificationsReadList = [\n ...new Set([...currentReadList, ...newReadIds]),\n ];\n\n state.metamaskNotificationsList = state.metamaskNotificationsList.map(\n (notification: INotification) => {\n if (\n newReadIds.includes(notification.id) ||\n onchainNotificationIds.includes(notification.id)\n ) {\n return { ...notification, isRead: true };\n }\n return notification;\n },\n );\n });\n\n this.messagingSystem.publish(\n `${controllerName}:markNotificationsAsRead`,\n this.state.metamaskNotificationsList,\n );\n }\n\n /**\n * Updates the list of MetaMask notifications by adding a new notification at the beginning of the list.\n * This method ensures that the most recent notification is displayed first in the UI.\n *\n * @param notification - The new notification object to be added to the list.\n * @returns A promise that resolves when the notification list has been successfully updated.\n */\n public async updateMetamaskNotificationsList(\n notification: INotification,\n ): Promise<void> {\n if (\n this.state.metamaskNotificationsList.some((n) => n.id === notification.id)\n ) {\n return;\n }\n\n const processedNotification = safeProcessNotification(notification);\n\n if (processedNotification) {\n this.update((state) => {\n const existingNotificationIds = new Set(\n state.metamaskNotificationsList.map((n) => n.id),\n );\n // Add the new notification only if its ID is not already present in the list\n if (!existingNotificationIds.has(notification.id)) {\n state.metamaskNotificationsList = [\n notification,\n ...state.metamaskNotificationsList,\n ];\n this.messagingSystem.publish(\n `${controllerName}:notificationsListUpdated`,\n state.metamaskNotificationsList,\n );\n }\n });\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AAYrC,OAAO,SAAS;AA4ChB,IAAM,iBAAiB;AAwDvB,IAAM,WAA+D;AAAA,EACnE,0BAA0B;AAAA,IACxB,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EAEA,oCAAoC;AAAA,IAClC,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,+BAA+B;AAA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C,MAAI,CAAC,mBAAmB;AACtB,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,cAA2B,KAAK,MAAM,iBAAiB;AAC7D,WAAO;AAAA,EACT,SAAS,OAAO;AACd,QAAI,MAAM,8BAA8B;AACxC,WAAO;AAAA,EACT;AACF;AAwBA;AAAA,wCAAmC,SACjC,iCACA;AACA,OAAK,OAAO,CAAC,UAAU;AACrB,UAAM,kCAAkC;AAAA,EAC1C,CAAC;AACH;AAUA;AAAA,wCAAmC,SACjC,iCACA;AACA,OAAK,OAAO,CAAC,UAAU;AACrB,UAAM,kCAAkC;AAAA,EAC1C,CAAC;AACH;AAWA;AAAA,mCAA8B,SAAC,4BAAqC;AAClE,OAAK,OAAO,CAAC,UAAU;AACrB,UAAM,6BAA6B;AAAA,EACrC,CAAC;AACH;AAQA;AAAA,iCAA4B,SAAC,UAAoB;AAC/C,OAAK,OAAO,CAAC,UAAU;AACrB,UAAM,iBAAiB,oBAAI,IAAI;AAAA,MAC7B,GAAG,MAAM;AAAA,MACT,GAAG;AAAA,IACL,CAAC;AACD,UAAM,yCAAyC,MAAM,KAAK,cAAc;AAAA,EAC1E,CAAC;AACH;AAOA;AAAA,gCAA2B,SAAC,UAAoB;AAC9C,OAAK,OAAO,CAAC,UAAU;AACrB,UAAM,yCACJ,MAAM,uCAAuC;AAAA,MAC3C,CAAC,oBAAoB,CAAC,SAAS,SAAS,eAAe;AAAA,IACzD;AAAA,EACJ,CAAC;AACH;","names":[]}
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-ODI2BTKS.mjs";
5
5
  import {
6
6
  constants_exports
7
- } from "./chunk-ZHAD55AN.mjs";
7
+ } from "./chunk-2P5WP5NT.mjs";
8
8
 
9
9
  // src/NotificationServicesPushController/utils/get-notification-message.ts
10
10
  var createOnChainPushNotificationMessages = (translationKeys) => {
@@ -204,4 +204,4 @@ export {
204
204
  isOnChainNotification,
205
205
  createOnChainPushNotificationMessage
206
206
  };
207
- //# sourceMappingURL=chunk-6GUOLD7O.mjs.map
207
+ //# sourceMappingURL=chunk-WGBEAP2F.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TRIGGERS
3
- } from "./chunk-J4D2NH6Y.mjs";
3
+ } from "./chunk-53F3SYYM.mjs";
4
4
  import {
5
5
  USER_STORAGE_VERSION,
6
6
  USER_STORAGE_VERSION_KEY
@@ -218,4 +218,4 @@ export {
218
218
  toggleUserStorageTriggerStatus,
219
219
  makeApiCall
220
220
  };
221
- //# sourceMappingURL=chunk-ILPTPB4U.mjs.map
221
+ //# sourceMappingURL=chunk-YUMIJSUD.mjs.map
package/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkXGHB2EF3js = require('./chunk-XGHB2EF3.js');
3
+ var _chunkW7IP4LDBjs = require('./chunk-W7IP4LDB.js');
4
4
  require('./chunk-7LWR54U7.js');
5
- require('./chunk-ENRKCWJ6.js');
6
- require('./chunk-BUT7X5F2.js');
5
+ require('./chunk-UZHUVXRM.js');
6
+ require('./chunk-HCDICNYK.js');
7
7
  require('./chunk-EJ52BDLB.js');
8
8
  require('./chunk-GETQWOTI.js');
9
- require('./chunk-5CFEVEAV.js');
10
- require('./chunk-4HOEZMSV.js');
11
- require('./chunk-GDKHOBJT.js');
9
+ require('./chunk-KGLHGLER.js');
10
+ require('./chunk-6FLC6CJD.js');
11
+ require('./chunk-HT6T5R4U.js');
12
12
  require('./chunk-B25TJ7KS.js');
13
13
 
14
14
 
15
- var _chunkABWWUGTEjs = require('./chunk-ABWWUGTE.js');
15
+ var _chunkUQ6MTYIRjs = require('./chunk-UQ6MTYIR.js');
16
16
  require('./chunk-232HZSEV.js');
17
17
  require('./chunk-XZEVRYUE.js');
18
18
  require('./chunk-3ZS2HAEG.js');
@@ -24,23 +24,23 @@ require('./chunk-WRYFIWNK.js');
24
24
  require('./chunk-V5HMYDWE.js');
25
25
  require('./chunk-ZBNBZN5H.js');
26
26
  require('./chunk-PROWNV4M.js');
27
- require('./chunk-IG3KWCQU.js');
28
- require('./chunk-QOG3RCXM.js');
29
- require('./chunk-QY4UST5V.js');
30
- require('./chunk-KWTSMLND.js');
31
- require('./chunk-2O32EME6.js');
32
- require('./chunk-5FUMSWDD.js');
27
+ require('./chunk-QAOZN4AX.js');
28
+ require('./chunk-O45HYLIV.js');
29
+ require('./chunk-OMBFVTP2.js');
30
+ require('./chunk-PJMQ2XEG.js');
31
+ require('./chunk-JIJXHO5V.js');
32
+ require('./chunk-SGLVWM4N.js');
33
33
  require('./chunk-LYEXYTOI.js');
34
34
  require('./chunk-LGXHJ24K.js');
35
35
  require('./chunk-52CALMRA.js');
36
- require('./chunk-H73GATCU.js');
37
- require('./chunk-NOYP2T77.js');
38
- require('./chunk-V6P5JEPT.js');
36
+ require('./chunk-NIPCK74T.js');
37
+ require('./chunk-JW3TK3NU.js');
38
+ require('./chunk-HE3P5RM7.js');
39
39
  require('./chunk-DT6SLUWJ.js');
40
40
  require('./chunk-TLX5QQK5.js');
41
41
  require('./chunk-IGY2S5BC.js');
42
42
 
43
43
 
44
44
 
45
- exports.NotificationServicesController = _chunkABWWUGTEjs.NotificationServicesController_exports; exports.NotificationServicesPushController = _chunkXGHB2EF3js.NotificationServicesPushController_exports;
45
+ exports.NotificationServicesController = _chunkUQ6MTYIRjs.NotificationServicesController_exports; exports.NotificationServicesPushController = _chunkW7IP4LDBjs.NotificationServicesPushController_exports;
46
46
  //# sourceMappingURL=index.js.map