@burdenoff/microfe-notification 2026.1029.2 → 2026.1109.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 (218) hide show
  1. package/dist/AdminNotificationRoot.d.ts +33 -0
  2. package/dist/AdminNotificationRoot.js +9 -6
  3. package/dist/AdminNotificationRoot.js.map +1 -1
  4. package/dist/AdminNotificationRoutes.d.ts +1 -0
  5. package/dist/AdminNotificationRoutes.js +22 -23
  6. package/dist/AdminNotificationRoutes.js.map +1 -1
  7. package/dist/NotificationRoot.d.ts +29 -0
  8. package/dist/NotificationRoot.js +9 -6
  9. package/dist/NotificationRoot.js.map +1 -1
  10. package/dist/NotificationRoutes.d.ts +18 -0
  11. package/dist/NotificationRoutes.js +1 -2
  12. package/dist/NotificationRoutes.js.map +1 -1
  13. package/dist/UserNotificationRoot.d.ts +32 -0
  14. package/dist/UserNotificationRoot.js +9 -6
  15. package/dist/UserNotificationRoot.js.map +1 -1
  16. package/dist/UserNotificationRoutes.d.ts +16 -0
  17. package/dist/UserNotificationRoutes.js +9 -10
  18. package/dist/UserNotificationRoutes.js.map +1 -1
  19. package/dist/components/FeatureDisabledPage.d.ts +6 -0
  20. package/dist/components/FeatureDisabledPage.js +1 -2
  21. package/dist/components/FeatureDisabledPage.js.map +1 -1
  22. package/dist/components/NotificationBell.d.ts +13 -0
  23. package/dist/components/NotificationBell.js +6 -7
  24. package/dist/components/NotificationBell.js.map +1 -1
  25. package/dist/components/NotificationCard.d.ts +18 -0
  26. package/dist/components/NotificationCard.js +10 -11
  27. package/dist/components/NotificationCard.js.map +1 -1
  28. package/dist/components/NotificationPanel.d.ts +10 -0
  29. package/dist/components/NotificationPanel.js +5 -6
  30. package/dist/components/NotificationPanel.js.map +1 -1
  31. package/dist/components/RecipientSelector.d.ts +32 -0
  32. package/dist/components/RecipientSelector.js +2 -3
  33. package/dist/components/RecipientSelector.js.map +1 -1
  34. package/dist/components/TemplatePreview.d.ts +21 -0
  35. package/dist/components/TemplatePreview.js +3 -4
  36. package/dist/components/TemplatePreview.js.map +1 -1
  37. package/dist/components/VariableInserter.d.ts +11 -0
  38. package/dist/components/index.d.ts +3 -0
  39. package/dist/components/index.js +4 -3
  40. package/dist/constants/permissions.d.ts +23 -0
  41. package/dist/constants/permissions.js +1 -2
  42. package/dist/constants/permissions.js.map +1 -1
  43. package/dist/dev/main.d.ts +0 -0
  44. package/dist/generated/global-operations.d.ts +2119 -0
  45. package/dist/generated/global-operations.js +80 -69
  46. package/dist/generated/global-operations.js.map +1 -1
  47. package/dist/generated/global-types.d.ts +23507 -0
  48. package/dist/generated/wspace-operations.d.ts +4 -0
  49. package/dist/generated/wspace-types.d.ts +57831 -0
  50. package/dist/graphql/global-client.d.ts +32 -0
  51. package/dist/graphql/global-client.js +23 -30
  52. package/dist/graphql/global-client.js.map +1 -1
  53. package/dist/hooks/index.d.ts +7 -0
  54. package/dist/hooks/index.js +7 -6
  55. package/dist/hooks/useNotificationAdmin.d.ts +46 -0
  56. package/dist/hooks/useNotificationAdmin.js +18 -17
  57. package/dist/hooks/useNotificationAdmin.js.map +1 -1
  58. package/dist/hooks/useNotificationAnalytics.d.ts +65 -0
  59. package/dist/hooks/useNotificationAnalytics.js +1 -2
  60. package/dist/hooks/useNotificationAnalytics.js.map +1 -1
  61. package/dist/hooks/useNotificationPreferences.d.ts +10 -0
  62. package/dist/hooks/useNotificationPreferences.js +7 -7
  63. package/dist/hooks/useNotificationPreferences.js.map +1 -1
  64. package/dist/hooks/useNotificationTemplates.d.ts +131 -0
  65. package/dist/hooks/useNotificationTemplates.js +1 -2
  66. package/dist/hooks/useNotificationTemplates.js.map +1 -1
  67. package/dist/hooks/useNotificationTopics.d.ts +35 -0
  68. package/dist/hooks/useNotificationTopics.js +22 -22
  69. package/dist/hooks/useNotificationTopics.js.map +1 -1
  70. package/dist/hooks/useNotifications.d.ts +39 -0
  71. package/dist/hooks/useNotifications.js +6 -4
  72. package/dist/hooks/useNotifications.js.map +1 -1
  73. package/dist/hooks/useSendNotification.d.ts +158 -0
  74. package/dist/hooks/useSendNotification.js +12 -10
  75. package/dist/hooks/useSendNotification.js.map +1 -1
  76. package/dist/hooks/useUserSearch.d.ts +26 -0
  77. package/dist/hooks/useUserSearch.js +8 -10
  78. package/dist/hooks/useUserSearch.js.map +1 -1
  79. package/dist/index.d.ts +36 -0
  80. package/dist/index.js +8 -8
  81. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +1 -2
  82. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -1
  83. package/dist/node_modules/@apollo/client/errors/utils.js +1 -2
  84. package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -1
  85. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +7 -8
  86. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -1
  87. package/dist/node_modules/@apollo/client/link/subscriptions/index.js +9 -10
  88. package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -1
  89. package/dist/node_modules/@apollo/client/link/utils/createOperation.js +5 -6
  90. package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -1
  91. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -1
  92. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -1
  93. package/dist/node_modules/@apollo/client/utilities/graphql/print.js +4 -5
  94. package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -1
  95. package/dist/node_modules/@apollo/client/utilities/internal/caches.js +1 -2
  96. package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -1
  97. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +1 -2
  98. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -1
  99. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +2 -3
  100. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +1 -1
  101. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +1 -2
  102. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +1 -1
  103. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +1 -2
  104. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -1
  105. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +1 -2
  106. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -1
  107. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +1 -2
  108. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -1
  109. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +1 -2
  110. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -1
  111. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +1 -2
  112. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -1
  113. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +1 -2
  114. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -1
  115. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +1 -2
  116. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -1
  117. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +1 -2
  118. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -1
  119. package/dist/node_modules/@apollo/client/utilities/invariant/index.js +2 -3
  120. package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -1
  121. package/dist/node_modules/@apollo/client/version.js +2 -3
  122. package/dist/node_modules/@apollo/client/version.js.map +1 -1
  123. package/dist/node_modules/@wry/caches/lib/weak.js +1 -2
  124. package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -1
  125. package/dist/node_modules/@wry/trie/lib/index.js +2 -3
  126. package/dist/node_modules/@wry/trie/lib/index.js.map +1 -1
  127. package/dist/node_modules/graphql-ws/dist/client.js +76 -69
  128. package/dist/node_modules/graphql-ws/dist/client.js.map +1 -1
  129. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +2 -3
  130. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +1 -1
  131. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +2 -3
  132. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +1 -1
  133. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +41 -42
  134. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -1
  135. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +14 -15
  136. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -1
  137. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +21 -18
  138. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -1
  139. package/dist/node_modules/rxjs/dist/esm5/internal/config.js +1 -2
  140. package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -1
  141. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +1 -2
  142. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -1
  143. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +2 -3
  144. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -1
  145. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +1 -2
  146. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -1
  147. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +1 -2
  148. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -1
  149. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +1 -2
  150. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -1
  151. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +1 -2
  152. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -1
  153. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +1 -2
  154. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -1
  155. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +1 -2
  156. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -1
  157. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +1 -2
  158. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -1
  159. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +1 -2
  160. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -1
  161. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +1 -2
  162. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -1
  163. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +1 -2
  164. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -1
  165. package/dist/node_modules/{rxjs/node_modules/tslib → tslib}/tslib.es6.js +1 -2
  166. package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
  167. package/dist/pages/CreateNotificationPage.d.ts +5 -0
  168. package/dist/pages/CreateNotificationPage.js +18 -19
  169. package/dist/pages/CreateNotificationPage.js.map +1 -1
  170. package/dist/pages/NotificationCenterPage.d.ts +6 -0
  171. package/dist/pages/NotificationCenterPage.js +13 -14
  172. package/dist/pages/NotificationCenterPage.js.map +1 -1
  173. package/dist/pages/NotificationHistoryAdminPage.d.ts +2 -0
  174. package/dist/pages/NotificationHistoryAdminPage.js +7 -8
  175. package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
  176. package/dist/pages/NotificationHistoryPage.d.ts +2 -0
  177. package/dist/pages/NotificationHistoryPage.js +13 -14
  178. package/dist/pages/NotificationHistoryPage.js.map +1 -1
  179. package/dist/pages/NotificationLandingPage.d.ts +10 -0
  180. package/dist/pages/NotificationLandingPage.js +5 -6
  181. package/dist/pages/NotificationLandingPage.js.map +1 -1
  182. package/dist/pages/NotificationPreferencesPage.d.ts +1 -0
  183. package/dist/pages/NotificationPreferencesPage.js +14 -15
  184. package/dist/pages/NotificationPreferencesPage.js.map +1 -1
  185. package/dist/pages/NotificationTemplatesPage.d.ts +7 -0
  186. package/dist/pages/NotificationTemplatesPage.js +25 -23
  187. package/dist/pages/NotificationTemplatesPage.js.map +1 -1
  188. package/dist/pages/NotificationTopicsPage.d.ts +1 -0
  189. package/dist/pages/NotificationTopicsPage.js +6 -7
  190. package/dist/pages/NotificationTopicsPage.js.map +1 -1
  191. package/dist/pages/TemplateEditorPage.d.ts +12 -0
  192. package/dist/pages/TemplateEditorPage.js +294 -285
  193. package/dist/pages/TemplateEditorPage.js.map +1 -1
  194. package/dist/providers/NotificationProvider.d.ts +11 -0
  195. package/dist/providers/NotificationProvider.js +1 -2
  196. package/dist/providers/NotificationProvider.js.map +1 -1
  197. package/dist/shared/hooks/useTr.d.ts +13 -0
  198. package/dist/shared/hooks/useTr.js +1 -2
  199. package/dist/shared/hooks/useTr.js.map +1 -1
  200. package/dist/store/notificationStore.d.ts +30 -0
  201. package/dist/store/notificationStore.js +1 -2
  202. package/dist/store/notificationStore.js.map +1 -1
  203. package/dist/test/happydom.d.ts +1 -0
  204. package/dist/translations/en.d.ts +468 -0
  205. package/dist/types/index.d.ts +249 -0
  206. package/dist/utils/inAppNavigation.d.ts +37 -0
  207. package/dist/utils/inAppNavigation.js +2 -3
  208. package/dist/utils/inAppNavigation.js.map +1 -1
  209. package/dist/utils/index.d.ts +68 -0
  210. package/dist/utils/index.js +1 -2
  211. package/dist/utils/index.js.map +1 -1
  212. package/dist/utils/nativeBridge.d.ts +2 -0
  213. package/dist/utils/nativeBridge.js +1 -2
  214. package/dist/utils/notificationHistoryExport.d.ts +12 -0
  215. package/dist/utils/notificationHistoryExport.js +1 -2
  216. package/dist/utils/notificationHistoryExport.js.map +1 -1
  217. package/package.json +66 -48
  218. package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js.map +0 -1
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Same-origin, in-app navigation for notification links.
3
+ *
4
+ * Mirrors `@burdenoff/fe-libs/src/shared/navigation/inAppPath` (used by the
5
+ * shell's notification bell), which is not part of fe-libs' public exports:
6
+ * the full Notification Center page and the bell must treat a link the same
7
+ * way — a link into this app (an agent, a run, a vibe) opens in the current
8
+ * tab, and only a link that leaves the app opens a new one.
9
+ */
10
+ /**
11
+ * True for a same-origin, in-app path: `/x`, `/x?y#z`. Refuses protocol-relative
12
+ * (`//host`, `/\host`), control characters, and anything that is not a rooted
13
+ * path, so a notification payload can never steer the page to another origin.
14
+ */
15
+ export declare function isSafeInAppPath(path: string): boolean;
16
+ /**
17
+ * The in-app path a link points at, or null when it leaves the app: a rooted
18
+ * path is taken as is; an absolute URL only when its origin is `origin`.
19
+ */
20
+ export declare function toInAppPath(url: string, origin: string): string | null;
21
+ /** The window members in-app navigation uses (a seam for tests). */
22
+ export interface InAppNavigationWindow {
23
+ location: {
24
+ origin: string;
25
+ };
26
+ history: {
27
+ pushState: (data: unknown, unused: string, url?: string | null) => void;
28
+ };
29
+ dispatchEvent: (event: Event) => boolean;
30
+ }
31
+ /**
32
+ * Navigate inside the app without a reload: push the path and announce it with
33
+ * `popstate`, which the shell's React Router browser history and its
34
+ * `ActiveContextProvider` both listen to. Returns false, and does nothing, when
35
+ * `url` leaves the app — the caller then opens it in a new tab.
36
+ */
37
+ export declare function navigateInApp(url: string, win?: InAppNavigationWindow | undefined): boolean;
@@ -1,4 +1,4 @@
1
- //#region src/utils/inAppNavigation.ts
1
+ // src/utils/inAppNavigation.ts
2
2
  function e(e) {
3
3
  if (typeof e != "string" || !e.startsWith("/") || e.startsWith("//") || e.startsWith("/\\")) return !1;
4
4
  for (let t = 0; t < e.length; t += 1) {
@@ -28,7 +28,6 @@ function n(e, n = globalThis.window) {
28
28
  let i = typeof PopStateEvent == "function" ? new PopStateEvent("popstate", { state: null }) : new Event("popstate");
29
29
  return n.dispatchEvent(i), !0;
30
30
  }
31
- //#endregion
32
- export { n as navigateInApp };
31
+ export { e as isSafeInAppPath, n as navigateInApp, t as toInAppPath };
33
32
 
34
33
  //# sourceMappingURL=inAppNavigation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inAppNavigation.js","names":[],"sources":["../../src/utils/inAppNavigation.ts"],"sourcesContent":["/**\n * Same-origin, in-app navigation for notification links.\n *\n * Mirrors `@burdenoff/fe-libs/src/shared/navigation/inAppPath` (used by the\n * shell's notification bell), which is not part of fe-libs' public exports:\n * the full Notification Center page and the bell must treat a link the same\n * way — a link into this app (an agent, a run, a vibe) opens in the current\n * tab, and only a link that leaves the app opens a new one.\n */\n\n/**\n * True for a same-origin, in-app path: `/x`, `/x?y#z`. Refuses protocol-relative\n * (`//host`, `/\\host`), control characters, and anything that is not a rooted\n * path, so a notification payload can never steer the page to another origin.\n */\nexport function isSafeInAppPath(path: string): boolean {\n if (typeof path !== 'string' || !path.startsWith('/')) return false;\n if (path.startsWith('//') || path.startsWith('/\\\\')) return false;\n for (let index = 0; index < path.length; index += 1) {\n const code = path.charCodeAt(index);\n if (code < 0x20 || code === 0x7f) return false;\n }\n return true;\n}\n\n/**\n * The in-app path a link points at, or null when it leaves the app: a rooted\n * path is taken as is; an absolute URL only when its origin is `origin`.\n */\nexport function toInAppPath(url: string, origin: string): string | null {\n if (typeof url !== 'string' || url.length === 0) return null;\n if (url.startsWith('/')) return isSafeInAppPath(url) ? url : null;\n let parsed: URL;\n try {\n parsed = new URL(url);\n } catch {\n return null;\n }\n if (parsed.origin !== origin) return null;\n const path = `${parsed.pathname || '/'}${parsed.search}${parsed.hash}`;\n return isSafeInAppPath(path) ? path : null;\n}\n\n/** The window members in-app navigation uses (a seam for tests). */\nexport interface InAppNavigationWindow {\n location: { origin: string };\n history: {\n pushState: (data: unknown, unused: string, url?: string | null) => void;\n };\n dispatchEvent: (event: Event) => boolean;\n}\n\n/**\n * Navigate inside the app without a reload: push the path and announce it with\n * `popstate`, which the shell's React Router browser history and its\n * `ActiveContextProvider` both listen to. Returns false, and does nothing, when\n * `url` leaves the app — the caller then opens it in a new tab.\n */\nexport function navigateInApp(\n url: string,\n win: InAppNavigationWindow | undefined = globalThis.window\n): boolean {\n if (!win) return false;\n const path = toInAppPath(url, win.location.origin);\n if (path === null) return false;\n win.history.pushState(null, '', path);\n const event =\n typeof PopStateEvent === 'function'\n ? new PopStateEvent('popstate', { state: null })\n : new Event('popstate');\n win.dispatchEvent(event);\n return true;\n}\n"],"mappings":";AAeA,SAAgB,EAAgB,GAAuB;AAErD,KADI,OAAO,KAAS,YAAY,CAAC,EAAK,WAAW,IAAI,IACjD,EAAK,WAAW,KAAK,IAAI,EAAK,WAAW,MAAM,CAAE,QAAO;AAC5D,MAAK,IAAI,IAAQ,GAAG,IAAQ,EAAK,QAAQ,KAAS,GAAG;EACnD,IAAM,IAAO,EAAK,WAAW,EAAM;AACnC,MAAI,IAAO,MAAQ,MAAS,IAAM,QAAO;;AAE3C,QAAO;;AAOT,SAAgB,EAAY,GAAa,GAA+B;AACtE,KAAI,OAAO,KAAQ,YAAY,EAAI,WAAW,EAAG,QAAO;AACxD,KAAI,EAAI,WAAW,IAAI,CAAE,QAAO,EAAgB,EAAI,GAAG,IAAM;CAC7D,IAAI;AACJ,KAAI;AACF,MAAS,IAAI,IAAI,EAAI;SACf;AACN,SAAO;;AAET,KAAI,EAAO,WAAW,EAAQ,QAAO;CACrC,IAAM,IAAO,GAAG,EAAO,YAAY,MAAM,EAAO,SAAS,EAAO;AAChE,QAAO,EAAgB,EAAK,GAAG,IAAO;;AAkBxC,SAAgB,EACd,GACA,IAAyC,WAAW,QAC3C;AACT,KAAI,CAAC,EAAK,QAAO;CACjB,IAAM,IAAO,EAAY,GAAK,EAAI,SAAS,OAAO;AAClD,KAAI,MAAS,KAAM,QAAO;AAC1B,GAAI,QAAQ,UAAU,MAAM,IAAI,EAAK;CACrC,IAAM,IACJ,OAAO,iBAAkB,aACrB,IAAI,cAAc,YAAY,EAAE,OAAO,MAAM,CAAC,GAC9C,IAAI,MAAM,WAAW;AAE3B,QADA,EAAI,cAAc,EAAM,EACjB"}
1
+ {"version":3,"file":"inAppNavigation.js","names":["isSafeInAppPath","path","index","code","toInAppPath","url","parsed","origin","navigateInApp","win","event"],"sources":["../../src/utils/inAppNavigation.ts"],"sourcesContent":["/**\n * Same-origin, in-app navigation for notification links.\n *\n * Mirrors `@burdenoff/fe-libs/src/shared/navigation/inAppPath` (used by the\n * shell's notification bell), which is not part of fe-libs' public exports:\n * the full Notification Center page and the bell must treat a link the same\n * way — a link into this app (an agent, a run, a vibe) opens in the current\n * tab, and only a link that leaves the app opens a new one.\n */\n\n/**\n * True for a same-origin, in-app path: `/x`, `/x?y#z`. Refuses protocol-relative\n * (`//host`, `/\\host`), control characters, and anything that is not a rooted\n * path, so a notification payload can never steer the page to another origin.\n */\nexport function isSafeInAppPath(path: string): boolean {\n if (typeof path !== 'string' || !path.startsWith('/')) return false;\n if (path.startsWith('//') || path.startsWith('/\\\\')) return false;\n for (let index = 0; index < path.length; index += 1) {\n const code = path.charCodeAt(index);\n if (code < 0x20 || code === 0x7f) return false;\n }\n return true;\n}\n\n/**\n * The in-app path a link points at, or null when it leaves the app: a rooted\n * path is taken as is; an absolute URL only when its origin is `origin`.\n */\nexport function toInAppPath(url: string, origin: string): string | null {\n if (typeof url !== 'string' || url.length === 0) return null;\n if (url.startsWith('/')) return isSafeInAppPath(url) ? url : null;\n let parsed: URL;\n try {\n parsed = new URL(url);\n } catch {\n return null;\n }\n if (parsed.origin !== origin) return null;\n const path = `${parsed.pathname || '/'}${parsed.search}${parsed.hash}`;\n return isSafeInAppPath(path) ? path : null;\n}\n\n/** The window members in-app navigation uses (a seam for tests). */\nexport interface InAppNavigationWindow {\n location: { origin: string };\n history: {\n pushState: (data: unknown, unused: string, url?: string | null) => void;\n };\n dispatchEvent: (event: Event) => boolean;\n}\n\n/**\n * Navigate inside the app without a reload: push the path and announce it with\n * `popstate`, which the shell's React Router browser history and its\n * `ActiveContextProvider` both listen to. Returns false, and does nothing, when\n * `url` leaves the app — the caller then opens it in a new tab.\n */\nexport function navigateInApp(\n url: string,\n win: InAppNavigationWindow | undefined = globalThis.window\n): boolean {\n if (!win) return false;\n const path = toInAppPath(url, win.location.origin);\n if (path === null) return false;\n win.history.pushState(null, '', path);\n const event =\n typeof PopStateEvent === 'function'\n ? new PopStateEvent('popstate', { state: null })\n : new Event('popstate');\n win.dispatchEvent(event);\n return true;\n}\n"],"mappings":";AAeA,SAAgBA,EAAgB,GAAuB;CAErD,IADI,OAAOC,KAAS,YAAY,CAACA,EAAK,WAAW,GAAG,KAChDA,EAAK,WAAW,IAAI,KAAKA,EAAK,WAAW,KAAK,GAAG,OAAO;CAC5D,KAAK,IAAIC,IAAQ,GAAGA,IAAQD,EAAK,QAAQ,KAAS,GAAG;EACnD,IAAME,IAAOF,EAAK,WAAWC,CAAK;EAClC,IAAIC,IAAO,MAAQA,MAAS,KAAM,OAAO;CAC3C;CACA,OAAO;AACT;AAMA,SAAgBC,EAAY,GAAa,GAA+B;CACtE,IAAI,OAAOC,KAAQ,YAAYA,EAAI,WAAW,GAAG,OAAO;CACxD,IAAIA,EAAI,WAAW,GAAG,GAAG,OAAOL,EAAgBK,CAAG,IAAIA,IAAM;CAC7D,IAAIC;CACJ,IAAI;EACF,IAAS,IAAI,IAAID,CAAG;CACtB,QAAQ;EACN,OAAO;CACT;CACA,IAAIC,EAAO,WAAWC,GAAQ,OAAO;CACrC,IAAMN,IAAO,GAAGK,EAAO,YAAY,MAAMA,EAAO,SAASA,EAAO;CAChE,OAAON,EAAgBC,CAAI,IAAIA,IAAO;AACxC;AAiBA,SAAgBO,EACd,GACA,IAAyC,WAAW,QAC3C;CACT,IAAI,CAACC,GAAK,OAAO;CACjB,IAAMR,IAAOG,EAAYC,GAAKI,EAAI,SAAS,MAAM;CACjD,IAAIR,MAAS,MAAM,OAAO;CAC1B,EAAI,QAAQ,UAAU,MAAM,IAAIA,CAAI;CACpC,IAAMS,IACJ,OAAO,iBAAkB,aACrB,IAAI,cAAc,YAAY,EAAE,OAAO,KAAK,CAAC,IAC7C,IAAI,MAAM,UAAU;CAE1B,OADAD,EAAI,cAAcC,CAAK,GAChB;AACT"}
@@ -0,0 +1,68 @@
1
+ import { Notification, NotificationFilter, NotificationPriority, NotificationType } from '../types';
2
+ /**
3
+ * Format a relative time string (e.g., "2 minutes ago", "1 hour ago").
4
+ * Pass an optional `tr` translator to localize the units.
5
+ */
6
+ export declare function formatRelativeTime(date: string | Date, tr?: (key: string, fallback: string, params?: Record<string, string | number>) => string): string;
7
+ /**
8
+ * Get priority color class name (for use with semantic tokens)
9
+ */
10
+ export declare function getPriorityColor(priority: NotificationPriority): string;
11
+ /**
12
+ * Get priority icon/indicator
13
+ */
14
+ export declare function getPriorityIcon(priority: NotificationPriority): string;
15
+ /**
16
+ * Get notification type label
17
+ */
18
+ export declare function getNotificationTypeLabel(type: NotificationType): string;
19
+ /**
20
+ * Get notification type icon
21
+ */
22
+ export declare function getNotificationTypeIcon(type: NotificationType): string;
23
+ /**
24
+ * Filter notifications based on criteria
25
+ */
26
+ export declare function filterNotifications(notifications: Notification[], filter: NotificationFilter): Notification[];
27
+ /**
28
+ * Sort notifications by created date (newest first)
29
+ */
30
+ export declare function sortNotificationsByDate(notifications: Notification[]): Notification[];
31
+ /**
32
+ * Group notifications by date (Today, Yesterday, This Week, etc.).
33
+ * Pass an optional `tr` translator to localize the group labels.
34
+ */
35
+ export declare function groupNotificationsByDate(notifications: Notification[], tr?: (key: string, fallback: string) => string): Record<string, Notification[]>;
36
+ /**
37
+ * Truncate text to a maximum length
38
+ */
39
+ export declare function truncateText(text: string, maxLength: number): string;
40
+ /**
41
+ * Validate template variable substitution
42
+ */
43
+ export declare function validateTemplateVariables(template: string, variables: Record<string, unknown>): {
44
+ isValid: boolean;
45
+ missingVariables: string[];
46
+ };
47
+ /**
48
+ * Substitute template variables
49
+ */
50
+ export declare function substituteTemplateVariables(template: string, variables: Record<string, unknown>): string;
51
+ /**
52
+ * Get delivery status color
53
+ */
54
+ export declare function getDeliveryStatusColor(status: 'PENDING' | 'SENT' | 'DELIVERED' | 'FAILED' | 'ARCHIVED'): string;
55
+ /**
56
+ * Calculate delivery rate percentage
57
+ */
58
+ export declare function calculateDeliveryRate(delivered: number, total: number): number;
59
+ /**
60
+ * Check whether a mutation error represents a gateway-level authorization
61
+ * failure (the RBAC gateway rejected the request because the actor lacks
62
+ * the required permission). Callers surface these with a friendly toast and
63
+ * refresh the permission cache to recover from stale client state.
64
+ *
65
+ * 401/UNAUTHENTICATED is handled separately by the shell's auth flow — this
66
+ * helper intentionally ignores it.
67
+ */
68
+ export declare function isPermissionError(err: unknown): boolean;
@@ -1,4 +1,4 @@
1
- //#region src/utils/index.ts
1
+ // src/utils/index.ts
2
2
  function e(e, t) {
3
3
  let n = /* @__PURE__ */ new Date(), r = new Date(e), i = n.getTime() - r.getTime(), a = Math.floor(i / 1e3), o = Math.floor(a / 60), s = Math.floor(o / 60), c = Math.floor(s / 24);
4
4
  return a < 60 ? t ? t("notifCommon.time.justNow", "just now") : "just now" : o < 60 ? o === 1 ? t ? t("notifCommon.time.minuteAgo", "a minute ago") : "a minute ago" : t ? t("notifCommon.time.minutesAgo", "{{count}} minutes ago", { count: o }) : `${o} minutes ago` : s < 24 ? s === 1 ? t ? t("notifCommon.time.hourAgo", "an hour ago") : "an hour ago" : t ? t("notifCommon.time.hoursAgo", "{{count}} hours ago", { count: s }) : `${s} hours ago` : c < 7 ? c === 1 ? t ? t("notifCommon.time.dayAgo", "a day ago") : "a day ago" : t ? t("notifCommon.time.daysAgo", "{{count}} days ago", { count: c }) : `${c} days ago` : r.toLocaleDateString();
@@ -123,7 +123,6 @@ function d(e) {
123
123
  let c = e.message, l = typeof c == "string" ? c.toLowerCase() : "";
124
124
  return l.includes("forbidden") || l.includes("permission denied");
125
125
  }
126
- //#endregion
127
126
  export { a as filterNotifications, e as formatRelativeTime, i as getNotificationTypeIcon, r as getNotificationTypeLabel, t as getPriorityColor, n as getPriorityIcon, s as groupNotificationsByDate, d as isPermissionError, o as sortNotificationsByDate, u as substituteTemplateVariables, c as truncateText, l as validateTemplateVariables };
128
127
 
129
128
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":["import type {\n Notification,\n NotificationFilter,\n NotificationPriority,\n NotificationType,\n} from '../types';\n\n/**\n * Format a relative time string (e.g., \"2 minutes ago\", \"1 hour ago\").\n * Pass an optional `tr` translator to localize the units.\n */\nexport function formatRelativeTime(\n date: string | Date,\n tr?: (key: string, fallback: string, params?: Record<string, string | number>) => string\n): string {\n const now = new Date();\n const past = new Date(date);\n const diffInMs = now.getTime() - past.getTime();\n const diffInSeconds = Math.floor(diffInMs / 1000);\n const diffInMinutes = Math.floor(diffInSeconds / 60);\n const diffInHours = Math.floor(diffInMinutes / 60);\n const diffInDays = Math.floor(diffInHours / 24);\n\n if (diffInSeconds < 60) {\n return tr ? tr('notifCommon.time.justNow', 'just now') : 'just now';\n } else if (diffInMinutes < 60) {\n if (diffInMinutes === 1) {\n return tr ? tr('notifCommon.time.minuteAgo', 'a minute ago') : 'a minute ago';\n }\n return tr\n ? tr('notifCommon.time.minutesAgo', '{{count}} minutes ago', { count: diffInMinutes })\n : `${diffInMinutes} minutes ago`;\n } else if (diffInHours < 24) {\n if (diffInHours === 1) {\n return tr ? tr('notifCommon.time.hourAgo', 'an hour ago') : 'an hour ago';\n }\n return tr\n ? tr('notifCommon.time.hoursAgo', '{{count}} hours ago', { count: diffInHours })\n : `${diffInHours} hours ago`;\n } else if (diffInDays < 7) {\n if (diffInDays === 1) {\n return tr ? tr('notifCommon.time.dayAgo', 'a day ago') : 'a day ago';\n }\n return tr\n ? tr('notifCommon.time.daysAgo', '{{count}} days ago', { count: diffInDays })\n : `${diffInDays} days ago`;\n } else {\n return past.toLocaleDateString();\n }\n}\n\n/**\n * Get priority color class name (for use with semantic tokens)\n */\nexport function getPriorityColor(priority: NotificationPriority): string {\n switch (priority) {\n case 'URGENT':\n return 'text-error-500';\n case 'HIGH':\n return 'text-warning-500';\n case 'NORMAL':\n return 'text-info-500';\n case 'LOW':\n return 'text-text-secondary';\n default:\n return 'text-text-secondary';\n }\n}\n\n/**\n * Get priority icon/indicator\n */\nexport function getPriorityIcon(priority: NotificationPriority): string {\n switch (priority) {\n case 'URGENT':\n return '🔴';\n case 'HIGH':\n return '🟠';\n case 'NORMAL':\n return '🟢';\n case 'LOW':\n return '⚪';\n default:\n return '⚪';\n }\n}\n\n/**\n * Get notification type label\n */\nexport function getNotificationTypeLabel(type: NotificationType): string {\n switch (type) {\n case 'TRANSACTIONAL':\n return 'Transactional';\n case 'MARKETING':\n return 'Marketing';\n case 'SYSTEM':\n return 'System';\n case 'ALERT':\n return 'Alert';\n default:\n return 'Unknown';\n }\n}\n\n/**\n * Get notification type icon\n */\nexport function getNotificationTypeIcon(type: NotificationType): string {\n switch (type) {\n case 'TRANSACTIONAL':\n return '📧';\n case 'MARKETING':\n return '📢';\n case 'SYSTEM':\n return '⚙️';\n case 'ALERT':\n return '🚨';\n default:\n return '🔔';\n }\n}\n\n/**\n * Filter notifications based on criteria\n */\nexport function filterNotifications(\n notifications: Notification[],\n filter: NotificationFilter\n): Notification[] {\n return notifications.filter((notification) => {\n // Search filter\n if (filter.search) {\n const searchLower = filter.search.toLowerCase();\n const titleMatch = notification.title.toLowerCase().includes(searchLower);\n const bodyMatch = notification.body.toLowerCase().includes(searchLower);\n if (!titleMatch && !bodyMatch) return false;\n }\n\n // Type filter\n if (filter.type !== 'ALL' && notification.type !== filter.type) {\n return false;\n }\n\n // Status filter\n if (filter.status !== 'ALL' && notification.status !== filter.status) {\n return false;\n }\n\n // Priority filter\n if (filter.priority !== 'ALL' && notification.priority !== filter.priority) {\n return false;\n }\n\n // Read/Unread filter\n if (filter.isRead !== null) {\n const isRead = !!notification.readAt;\n if (filter.isRead !== isRead) return false;\n }\n\n // Date range filter\n if (filter.dateRange.start || filter.dateRange.end) {\n const notificationDate = new Date(notification.createdAt);\n if (filter.dateRange.start && notificationDate < filter.dateRange.start) {\n return false;\n }\n if (filter.dateRange.end && notificationDate > filter.dateRange.end) {\n return false;\n }\n }\n\n return true;\n });\n}\n\n/**\n * Sort notifications by created date (newest first)\n */\nexport function sortNotificationsByDate(notifications: Notification[]): Notification[] {\n return [...notifications].sort((a, b) => {\n return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();\n });\n}\n\n/**\n * Group notifications by date (Today, Yesterday, This Week, etc.).\n * Pass an optional `tr` translator to localize the group labels.\n */\nexport function groupNotificationsByDate(\n notifications: Notification[],\n tr?: (key: string, fallback: string) => string\n): Record<string, Notification[]> {\n const now = new Date();\n const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());\n const yesterday = new Date(today);\n yesterday.setDate(yesterday.getDate() - 1);\n const thisWeekStart = new Date(today);\n thisWeekStart.setDate(thisWeekStart.getDate() - thisWeekStart.getDay());\n\n const labelToday = tr ? tr('notifCommon.dateGroup.today', 'Today') : 'Today';\n const labelYesterday = tr ? tr('notifCommon.dateGroup.yesterday', 'Yesterday') : 'Yesterday';\n const labelThisWeek = tr ? tr('notifCommon.dateGroup.thisWeek', 'This Week') : 'This Week';\n const labelEarlier = tr ? tr('notifCommon.dateGroup.earlier', 'Earlier') : 'Earlier';\n\n const groups: Record<string, Notification[]> = {\n [labelToday]: [],\n [labelYesterday]: [],\n [labelThisWeek]: [],\n [labelEarlier]: [],\n };\n\n notifications.forEach((notification) => {\n const notificationDate = new Date(notification.createdAt);\n const notificationDay = new Date(\n notificationDate.getFullYear(),\n notificationDate.getMonth(),\n notificationDate.getDate()\n );\n\n if (notificationDay.getTime() === today.getTime()) {\n groups[labelToday].push(notification);\n } else if (notificationDay.getTime() === yesterday.getTime()) {\n groups[labelYesterday].push(notification);\n } else if (notificationDay >= thisWeekStart) {\n groups[labelThisWeek].push(notification);\n } else {\n groups[labelEarlier].push(notification);\n }\n });\n\n // Remove empty groups\n Object.keys(groups).forEach((key) => {\n if (groups[key].length === 0) {\n delete groups[key];\n }\n });\n\n return groups;\n}\n\n/**\n * Truncate text to a maximum length\n */\nexport function truncateText(text: string, maxLength: number): string {\n if (text.length <= maxLength) return text;\n return text.slice(0, maxLength) + '...';\n}\n\n/**\n * Validate template variable substitution\n */\nexport function validateTemplateVariables(\n template: string,\n variables: Record<string, unknown>\n): { isValid: boolean; missingVariables: string[] } {\n const variableRegex = /\\{\\{([^}]+)\\}\\}/g;\n const matches = template.matchAll(variableRegex);\n const missingVariables: string[] = [];\n\n for (const match of matches) {\n const variableName = match[1].trim();\n if (!(variableName in variables)) {\n missingVariables.push(variableName);\n }\n }\n\n return {\n isValid: missingVariables.length === 0,\n missingVariables,\n };\n}\n\n/**\n * Substitute template variables\n */\nexport function substituteTemplateVariables(\n template: string,\n variables: Record<string, unknown>\n): string {\n return template.replace(/\\{\\{([^}]+)\\}\\}/g, (match, variableName) => {\n const trimmedName = variableName.trim();\n const value = variables[trimmedName];\n return value !== undefined ? String(value) : match;\n });\n}\n\n/**\n * Get delivery status color\n */\nexport function getDeliveryStatusColor(\n status: 'PENDING' | 'SENT' | 'DELIVERED' | 'FAILED' | 'ARCHIVED'\n): string {\n switch (status) {\n case 'DELIVERED':\n return 'text-success-500';\n case 'SENT':\n return 'text-info-500';\n case 'PENDING':\n return 'text-warning-500';\n case 'FAILED':\n return 'text-error-500';\n case 'ARCHIVED':\n return 'text-text-secondary';\n default:\n return 'text-text-secondary';\n }\n}\n\n/**\n * Calculate delivery rate percentage\n */\nexport function calculateDeliveryRate(delivered: number, total: number): number {\n if (total === 0) return 0;\n return Math.round((delivered / total) * 100);\n}\n\n/**\n * Check whether a mutation error represents a gateway-level authorization\n * failure (the RBAC gateway rejected the request because the actor lacks\n * the required permission). Callers surface these with a friendly toast and\n * refresh the permission cache to recover from stale client state.\n *\n * 401/UNAUTHENTICATED is handled separately by the shell's auth flow — this\n * helper intentionally ignores it.\n */\nexport function isPermissionError(err: unknown): boolean {\n if (!err) return false;\n\n type GqlErrorLike = { extensions?: Record<string, unknown> };\n\n const hasForbiddenCode = (errors: readonly GqlErrorLike[]): boolean => {\n for (const gqlErr of errors) {\n const code = typeof gqlErr.extensions?.code === 'string' ? gqlErr.extensions.code : '';\n const errorCode =\n typeof gqlErr.extensions?.errorCode === 'string' ? gqlErr.extensions.errorCode : '';\n if (code === 'FORBIDDEN' || errorCode === 'FORBIDDEN') return true;\n }\n return false;\n };\n\n // The gateway answers an @rbac denial with HTTP 403, which Apollo v4 raises\n // as a ServerError: a `statusCode` plus the GraphQL body in `bodyText`.\n const statusCode = (err as { statusCode?: unknown }).statusCode;\n if (statusCode === 403) return true;\n const bodyText = (err as { bodyText?: unknown }).bodyText;\n if (typeof bodyText === 'string' && bodyText.length > 0) {\n try {\n const parsed: unknown = JSON.parse(bodyText);\n const bodyErrors = (parsed as { errors?: unknown } | null)?.errors;\n if (Array.isArray(bodyErrors) && hasForbiddenCode(bodyErrors as GqlErrorLike[])) return true;\n } catch {\n // Not JSON; fall through to the other shapes.\n }\n }\n\n // Apollo v3 shape: `err.graphQLErrors[]`. Apollo v4 (what `global-client.ts` targets): `err.errors[]`.\n // Check both so the structured signal works regardless of which Apollo major we're on.\n const v3 = (err as { graphQLErrors?: GqlErrorLike[] }).graphQLErrors;\n if (Array.isArray(v3) && hasForbiddenCode(v3)) return true;\n const v4 = (err as { errors?: GqlErrorLike[] }).errors;\n if (Array.isArray(v4) && hasForbiddenCode(v4)) return true;\n\n // Non-Apollo shapes (fetch-wrapped errors, custom throws) may hang extensions off the error itself.\n const extensionsLike = (err as { extensions?: Record<string, unknown> }).extensions;\n const codeFromExtensions = typeof extensionsLike?.code === 'string' ? extensionsLike.code : '';\n const errorCodeFromExtensions =\n typeof extensionsLike?.errorCode === 'string' ? extensionsLike.errorCode : '';\n if (codeFromExtensions === 'FORBIDDEN' || errorCodeFromExtensions === 'FORBIDDEN') return true;\n\n // Last-resort message substring match. Gated on the absence of any structured error payload so\n // a notification title / template body containing \"forbidden\" doesn't trigger a false positive.\n if (extensionsLike || Array.isArray(v3) || Array.isArray(v4)) return false;\n const messageFromError = (err as { message?: unknown }).message;\n const message = typeof messageFromError === 'string' ? messageFromError.toLowerCase() : '';\n return message.includes('forbidden') || message.includes('permission denied');\n}\n"],"mappings":";AAWA,SAAgB,EACd,GACA,GACQ;CACR,IAAM,oBAAM,IAAI,MAAM,EAChB,IAAO,IAAI,KAAK,EAAK,EACrB,IAAW,EAAI,SAAS,GAAG,EAAK,SAAS,EACzC,IAAgB,KAAK,MAAM,IAAW,IAAK,EAC3C,IAAgB,KAAK,MAAM,IAAgB,GAAG,EAC9C,IAAc,KAAK,MAAM,IAAgB,GAAG,EAC5C,IAAa,KAAK,MAAM,IAAc,GAAG;AA0B7C,QAxBE,IAAgB,KACX,IAAK,EAAG,4BAA4B,WAAW,GAAG,aAChD,IAAgB,KACrB,MAAkB,IACb,IAAK,EAAG,8BAA8B,eAAe,GAAG,iBAE1D,IACH,EAAG,+BAA+B,yBAAyB,EAAE,OAAO,GAAe,CAAC,GACpF,GAAG,EAAc,gBACZ,IAAc,KACnB,MAAgB,IACX,IAAK,EAAG,4BAA4B,cAAc,GAAG,gBAEvD,IACH,EAAG,6BAA6B,uBAAuB,EAAE,OAAO,GAAa,CAAC,GAC9E,GAAG,EAAY,cACV,IAAa,IAClB,MAAe,IACV,IAAK,EAAG,2BAA2B,YAAY,GAAG,cAEpD,IACH,EAAG,4BAA4B,sBAAsB,EAAE,OAAO,GAAY,CAAC,GAC3E,GAAG,EAAW,aAEX,EAAK,oBAAoB;;AAOpC,SAAgB,EAAiB,GAAwC;AACvE,SAAQ,GAAR;EACE,KAAK,SACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,SACH,QAAO;EACT,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,IAAI,EAAiB,EAAG,CAAE,QAAO;CAGtD,IAAM,IAAkB,EAAiD,YACnE,IAAqB,OAAO,GAAgB,QAAS,WAAW,EAAe,OAAO,IACtF,IACJ,OAAO,GAAgB,aAAc,WAAW,EAAe,YAAY;AAC7E,KAAI,MAAuB,eAAe,MAA4B,YAAa,QAAO;AAI1F,KAAI,KAAkB,MAAM,QAAQ,EAAG,IAAI,MAAM,QAAQ,EAAG,CAAE,QAAO;CACrE,IAAM,IAAoB,EAA8B,SAClD,IAAU,OAAO,KAAqB,WAAW,EAAiB,aAAa,GAAG;AACxF,QAAO,EAAQ,SAAS,YAAY,IAAI,EAAQ,SAAS,oBAAoB"}
1
+ {"version":3,"file":"index.js","names":["formatRelativeTime","now","past","date","diffInMs","diffInSeconds","diffInMinutes","diffInHours","diffInDays","tr","getPriorityColor","priority","getPriorityIcon","getNotificationTypeLabel","type","getNotificationTypeIcon","filterNotifications","notifications","filter","searchLower","titleMatch","notification","bodyMatch","isRead","notificationDate","sortNotificationsByDate","b","a","groupNotificationsByDate","today","yesterday","thisWeekStart","labelToday","labelYesterday","labelThisWeek","labelEarlier","groups","notificationDay","key","truncateText","text","maxLength","validateTemplateVariables","matches","template","missingVariables","match","variableName","variables","substituteTemplateVariables","value","isPermissionError","err","hasForbiddenCode","gqlErr","errors","code","errorCode","bodyText","bodyErrors","v3","v4","extensionsLike","codeFromExtensions","errorCodeFromExtensions","messageFromError","message"],"sources":["../../src/utils/index.ts"],"sourcesContent":["import type {\n Notification,\n NotificationFilter,\n NotificationPriority,\n NotificationType,\n} from '../types';\n\n/**\n * Format a relative time string (e.g., \"2 minutes ago\", \"1 hour ago\").\n * Pass an optional `tr` translator to localize the units.\n */\nexport function formatRelativeTime(\n date: string | Date,\n tr?: (key: string, fallback: string, params?: Record<string, string | number>) => string\n): string {\n const now = new Date();\n const past = new Date(date);\n const diffInMs = now.getTime() - past.getTime();\n const diffInSeconds = Math.floor(diffInMs / 1000);\n const diffInMinutes = Math.floor(diffInSeconds / 60);\n const diffInHours = Math.floor(diffInMinutes / 60);\n const diffInDays = Math.floor(diffInHours / 24);\n\n if (diffInSeconds < 60) {\n return tr ? tr('notifCommon.time.justNow', 'just now') : 'just now';\n } else if (diffInMinutes < 60) {\n if (diffInMinutes === 1) {\n return tr ? tr('notifCommon.time.minuteAgo', 'a minute ago') : 'a minute ago';\n }\n return tr\n ? tr('notifCommon.time.minutesAgo', '{{count}} minutes ago', { count: diffInMinutes })\n : `${diffInMinutes} minutes ago`;\n } else if (diffInHours < 24) {\n if (diffInHours === 1) {\n return tr ? tr('notifCommon.time.hourAgo', 'an hour ago') : 'an hour ago';\n }\n return tr\n ? tr('notifCommon.time.hoursAgo', '{{count}} hours ago', { count: diffInHours })\n : `${diffInHours} hours ago`;\n } else if (diffInDays < 7) {\n if (diffInDays === 1) {\n return tr ? tr('notifCommon.time.dayAgo', 'a day ago') : 'a day ago';\n }\n return tr\n ? tr('notifCommon.time.daysAgo', '{{count}} days ago', { count: diffInDays })\n : `${diffInDays} days ago`;\n } else {\n return past.toLocaleDateString();\n }\n}\n\n/**\n * Get priority color class name (for use with semantic tokens)\n */\nexport function getPriorityColor(priority: NotificationPriority): string {\n switch (priority) {\n case 'URGENT':\n return 'text-error-500';\n case 'HIGH':\n return 'text-warning-500';\n case 'NORMAL':\n return 'text-info-500';\n case 'LOW':\n return 'text-text-secondary';\n default:\n return 'text-text-secondary';\n }\n}\n\n/**\n * Get priority icon/indicator\n */\nexport function getPriorityIcon(priority: NotificationPriority): string {\n switch (priority) {\n case 'URGENT':\n return '🔴';\n case 'HIGH':\n return '🟠';\n case 'NORMAL':\n return '🟢';\n case 'LOW':\n return '⚪';\n default:\n return '⚪';\n }\n}\n\n/**\n * Get notification type label\n */\nexport function getNotificationTypeLabel(type: NotificationType): string {\n switch (type) {\n case 'TRANSACTIONAL':\n return 'Transactional';\n case 'MARKETING':\n return 'Marketing';\n case 'SYSTEM':\n return 'System';\n case 'ALERT':\n return 'Alert';\n default:\n return 'Unknown';\n }\n}\n\n/**\n * Get notification type icon\n */\nexport function getNotificationTypeIcon(type: NotificationType): string {\n switch (type) {\n case 'TRANSACTIONAL':\n return '📧';\n case 'MARKETING':\n return '📢';\n case 'SYSTEM':\n return '⚙️';\n case 'ALERT':\n return '🚨';\n default:\n return '🔔';\n }\n}\n\n/**\n * Filter notifications based on criteria\n */\nexport function filterNotifications(\n notifications: Notification[],\n filter: NotificationFilter\n): Notification[] {\n return notifications.filter((notification) => {\n // Search filter\n if (filter.search) {\n const searchLower = filter.search.toLowerCase();\n const titleMatch = notification.title.toLowerCase().includes(searchLower);\n const bodyMatch = notification.body.toLowerCase().includes(searchLower);\n if (!titleMatch && !bodyMatch) return false;\n }\n\n // Type filter\n if (filter.type !== 'ALL' && notification.type !== filter.type) {\n return false;\n }\n\n // Status filter\n if (filter.status !== 'ALL' && notification.status !== filter.status) {\n return false;\n }\n\n // Priority filter\n if (filter.priority !== 'ALL' && notification.priority !== filter.priority) {\n return false;\n }\n\n // Read/Unread filter\n if (filter.isRead !== null) {\n const isRead = !!notification.readAt;\n if (filter.isRead !== isRead) return false;\n }\n\n // Date range filter\n if (filter.dateRange.start || filter.dateRange.end) {\n const notificationDate = new Date(notification.createdAt);\n if (filter.dateRange.start && notificationDate < filter.dateRange.start) {\n return false;\n }\n if (filter.dateRange.end && notificationDate > filter.dateRange.end) {\n return false;\n }\n }\n\n return true;\n });\n}\n\n/**\n * Sort notifications by created date (newest first)\n */\nexport function sortNotificationsByDate(notifications: Notification[]): Notification[] {\n return [...notifications].sort((a, b) => {\n return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();\n });\n}\n\n/**\n * Group notifications by date (Today, Yesterday, This Week, etc.).\n * Pass an optional `tr` translator to localize the group labels.\n */\nexport function groupNotificationsByDate(\n notifications: Notification[],\n tr?: (key: string, fallback: string) => string\n): Record<string, Notification[]> {\n const now = new Date();\n const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());\n const yesterday = new Date(today);\n yesterday.setDate(yesterday.getDate() - 1);\n const thisWeekStart = new Date(today);\n thisWeekStart.setDate(thisWeekStart.getDate() - thisWeekStart.getDay());\n\n const labelToday = tr ? tr('notifCommon.dateGroup.today', 'Today') : 'Today';\n const labelYesterday = tr ? tr('notifCommon.dateGroup.yesterday', 'Yesterday') : 'Yesterday';\n const labelThisWeek = tr ? tr('notifCommon.dateGroup.thisWeek', 'This Week') : 'This Week';\n const labelEarlier = tr ? tr('notifCommon.dateGroup.earlier', 'Earlier') : 'Earlier';\n\n const groups: Record<string, Notification[]> = {\n [labelToday]: [],\n [labelYesterday]: [],\n [labelThisWeek]: [],\n [labelEarlier]: [],\n };\n\n notifications.forEach((notification) => {\n const notificationDate = new Date(notification.createdAt);\n const notificationDay = new Date(\n notificationDate.getFullYear(),\n notificationDate.getMonth(),\n notificationDate.getDate()\n );\n\n if (notificationDay.getTime() === today.getTime()) {\n groups[labelToday].push(notification);\n } else if (notificationDay.getTime() === yesterday.getTime()) {\n groups[labelYesterday].push(notification);\n } else if (notificationDay >= thisWeekStart) {\n groups[labelThisWeek].push(notification);\n } else {\n groups[labelEarlier].push(notification);\n }\n });\n\n // Remove empty groups\n Object.keys(groups).forEach((key) => {\n if (groups[key].length === 0) {\n delete groups[key];\n }\n });\n\n return groups;\n}\n\n/**\n * Truncate text to a maximum length\n */\nexport function truncateText(text: string, maxLength: number): string {\n if (text.length <= maxLength) return text;\n return text.slice(0, maxLength) + '...';\n}\n\n/**\n * Validate template variable substitution\n */\nexport function validateTemplateVariables(\n template: string,\n variables: Record<string, unknown>\n): { isValid: boolean; missingVariables: string[] } {\n const variableRegex = /\\{\\{([^}]+)\\}\\}/g;\n const matches = template.matchAll(variableRegex);\n const missingVariables: string[] = [];\n\n for (const match of matches) {\n const variableName = match[1].trim();\n if (!(variableName in variables)) {\n missingVariables.push(variableName);\n }\n }\n\n return {\n isValid: missingVariables.length === 0,\n missingVariables,\n };\n}\n\n/**\n * Substitute template variables\n */\nexport function substituteTemplateVariables(\n template: string,\n variables: Record<string, unknown>\n): string {\n return template.replace(/\\{\\{([^}]+)\\}\\}/g, (match, variableName) => {\n const trimmedName = variableName.trim();\n const value = variables[trimmedName];\n return value !== undefined ? String(value) : match;\n });\n}\n\n/**\n * Get delivery status color\n */\nexport function getDeliveryStatusColor(\n status: 'PENDING' | 'SENT' | 'DELIVERED' | 'FAILED' | 'ARCHIVED'\n): string {\n switch (status) {\n case 'DELIVERED':\n return 'text-success-500';\n case 'SENT':\n return 'text-info-500';\n case 'PENDING':\n return 'text-warning-500';\n case 'FAILED':\n return 'text-error-500';\n case 'ARCHIVED':\n return 'text-text-secondary';\n default:\n return 'text-text-secondary';\n }\n}\n\n/**\n * Calculate delivery rate percentage\n */\nexport function calculateDeliveryRate(delivered: number, total: number): number {\n if (total === 0) return 0;\n return Math.round((delivered / total) * 100);\n}\n\n/**\n * Check whether a mutation error represents a gateway-level authorization\n * failure (the RBAC gateway rejected the request because the actor lacks\n * the required permission). Callers surface these with a friendly toast and\n * refresh the permission cache to recover from stale client state.\n *\n * 401/UNAUTHENTICATED is handled separately by the shell's auth flow — this\n * helper intentionally ignores it.\n */\nexport function isPermissionError(err: unknown): boolean {\n if (!err) return false;\n\n type GqlErrorLike = { extensions?: Record<string, unknown> };\n\n const hasForbiddenCode = (errors: readonly GqlErrorLike[]): boolean => {\n for (const gqlErr of errors) {\n const code = typeof gqlErr.extensions?.code === 'string' ? gqlErr.extensions.code : '';\n const errorCode =\n typeof gqlErr.extensions?.errorCode === 'string' ? gqlErr.extensions.errorCode : '';\n if (code === 'FORBIDDEN' || errorCode === 'FORBIDDEN') return true;\n }\n return false;\n };\n\n // The gateway answers an @rbac denial with HTTP 403, which Apollo v4 raises\n // as a ServerError: a `statusCode` plus the GraphQL body in `bodyText`.\n const statusCode = (err as { statusCode?: unknown }).statusCode;\n if (statusCode === 403) return true;\n const bodyText = (err as { bodyText?: unknown }).bodyText;\n if (typeof bodyText === 'string' && bodyText.length > 0) {\n try {\n const parsed: unknown = JSON.parse(bodyText);\n const bodyErrors = (parsed as { errors?: unknown } | null)?.errors;\n if (Array.isArray(bodyErrors) && hasForbiddenCode(bodyErrors as GqlErrorLike[])) return true;\n } catch {\n // Not JSON; fall through to the other shapes.\n }\n }\n\n // Apollo v3 shape: `err.graphQLErrors[]`. Apollo v4 (what `global-client.ts` targets): `err.errors[]`.\n // Check both so the structured signal works regardless of which Apollo major we're on.\n const v3 = (err as { graphQLErrors?: GqlErrorLike[] }).graphQLErrors;\n if (Array.isArray(v3) && hasForbiddenCode(v3)) return true;\n const v4 = (err as { errors?: GqlErrorLike[] }).errors;\n if (Array.isArray(v4) && hasForbiddenCode(v4)) return true;\n\n // Non-Apollo shapes (fetch-wrapped errors, custom throws) may hang extensions off the error itself.\n const extensionsLike = (err as { extensions?: Record<string, unknown> }).extensions;\n const codeFromExtensions = typeof extensionsLike?.code === 'string' ? extensionsLike.code : '';\n const errorCodeFromExtensions =\n typeof extensionsLike?.errorCode === 'string' ? extensionsLike.errorCode : '';\n if (codeFromExtensions === 'FORBIDDEN' || errorCodeFromExtensions === 'FORBIDDEN') return true;\n\n // Last-resort message substring match. Gated on the absence of any structured error payload so\n // a notification title / template body containing \"forbidden\" doesn't trigger a false positive.\n if (extensionsLike || Array.isArray(v3) || Array.isArray(v4)) return false;\n const messageFromError = (err as { message?: unknown }).message;\n const message = typeof messageFromError === 'string' ? messageFromError.toLowerCase() : '';\n return message.includes('forbidden') || message.includes('permission denied');\n}\n"],"mappings":";AAWA,SAAgBA,EACd,GACA,GACQ;CACR,IAAMC,oBAAM,IAAI,KAAK,GACfC,IAAO,IAAI,KAAKC,CAAI,GACpBC,IAAWH,EAAI,QAAQ,IAAIC,EAAK,QAAQ,GACxCG,IAAgB,KAAK,MAAMD,IAAW,GAAI,GAC1CE,IAAgB,KAAK,MAAMD,IAAgB,EAAE,GAC7CE,IAAc,KAAK,MAAMD,IAAgB,EAAE,GAC3CE,IAAa,KAAK,MAAMD,IAAc,EAAE;CA0B5C,OAxBE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eAAeC,MAA4B,aAAa,OAAO;CAI1F,IAAIF,KAAkB,MAAM,QAAQF,CAAE,KAAK,MAAM,QAAQC,CAAE,GAAG,OAAO;CACrE,IAAMI,IAAoBb,EAA8B,SAClDc,IAAU,OAAOD,KAAqB,WAAWA,EAAiB,YAAY,IAAI;CACxF,OAAOC,EAAQ,SAAS,WAAW,KAAKA,EAAQ,SAAS,mBAAmB;AAC9E"}
@@ -0,0 +1,2 @@
1
+ export { getPlatform, isNative, isIOS, isAndroid, isWeb, nativeImpact, nativeNotify, nativeToast, nativeConfirm, nativeCopyText, nativeShare, nativeOpenUrl, useNativePlatform, useSafeArea, useNativeKeyboard, useAppState, useDeviceInfo, useHaptics, useStatusBar, } from '@burdenoff/fe-libs/shared/native';
2
+ export type { BurdenoffNativePlatform, BurdenoffNativeBridge, SafeAreaInsets, DeviceInfo, HapticImpactStyle, HapticNotificationType, ToastDuration, ConfirmOptions, ShareOptions, AppState, StatusBarTheme, } from '@burdenoff/fe-libs/shared/native';
@@ -1,2 +1 @@
1
- import { nativeConfirm as e, nativeImpact as t, nativeNotify as n, nativeOpenUrl as r } from "@burdenoff/fe-libs/shared/native";
2
- export { e as nativeConfirm, t as nativeImpact, n as nativeNotify, r as nativeOpenUrl };
1
+ export { nativeConfirm, nativeImpact, nativeNotify, nativeOpenUrl } from "@burdenoff/fe-libs/shared/native";
@@ -0,0 +1,12 @@
1
+ export interface ExportableNotification {
2
+ id: string;
3
+ title: string;
4
+ body: string;
5
+ type: string;
6
+ priority: string;
7
+ status: string;
8
+ createdAt: string;
9
+ readAt?: string;
10
+ archivedAt?: string;
11
+ }
12
+ export declare function exportNotificationsAsCsv(tr: (key: string, fallback: string) => string, notifications: ExportableNotification[]): void;
@@ -1,4 +1,4 @@
1
- //#region src/utils/notificationHistoryExport.ts
1
+ // src/utils/notificationHistoryExport.ts
2
2
  function e(e, t) {
3
3
  let n = [
4
4
  e("notifications.csv.id", "ID"),
@@ -23,7 +23,6 @@ function e(e, t) {
23
23
  ].map(r).join(",")), a = [n.map(r).join(","), ...i].join("\n"), o = new Blob([a], { type: "text/csv;charset=utf-8;" }), s = URL.createObjectURL(o), c = document.createElement("a");
24
24
  c.href = s, c.download = `notifications-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, c.click(), URL.revokeObjectURL(s);
25
25
  }
26
- //#endregion
27
26
  export { e as exportNotificationsAsCsv };
28
27
 
29
28
  //# sourceMappingURL=notificationHistoryExport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notificationHistoryExport.js","names":[],"sources":["../../src/utils/notificationHistoryExport.ts"],"sourcesContent":["export interface ExportableNotification {\n id: string;\n title: string;\n body: string;\n type: string;\n priority: string;\n status: string;\n createdAt: string;\n readAt?: string;\n archivedAt?: string;\n}\n\nexport function exportNotificationsAsCsv(\n tr: (key: string, fallback: string) => string,\n notifications: ExportableNotification[]\n) {\n const headers = [\n tr('notifications.csv.id', 'ID'),\n tr('notifications.csv.title', 'Title'),\n tr('notifications.csv.body', 'Body'),\n tr('notifications.csv.type', 'Type'),\n tr('notifications.csv.priority', 'Priority'),\n tr('notifications.csv.status', 'Status'),\n tr('notifications.csv.createdAt', 'Created At'),\n tr('notifications.csv.readAt', 'Read At'),\n tr('notifications.csv.archivedAt', 'Archived At'),\n ];\n const escape = (v: string) => `\"${(v ?? '').replace(/\"/g, '\"\"')}\"`;\n const rows = notifications.map((n) =>\n [\n n.id,\n n.title,\n n.body,\n n.type,\n n.priority,\n n.status,\n n.createdAt,\n n.readAt ?? '',\n n.archivedAt ?? '',\n ]\n .map(escape)\n .join(',')\n );\n const csv = [headers.map(escape).join(','), ...rows].join('\\n');\n const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = `notifications-${new Date().toISOString().slice(0, 10)}.csv`;\n a.click();\n URL.revokeObjectURL(url);\n}\n"],"mappings":";AAYA,SAAgB,EACd,GACA,GACA;CACA,IAAM,IAAU;EACd,EAAG,wBAAwB,KAAK;EAChC,EAAG,2BAA2B,QAAQ;EACtC,EAAG,0BAA0B,OAAO;EACpC,EAAG,0BAA0B,OAAO;EACpC,EAAG,8BAA8B,WAAW;EAC5C,EAAG,4BAA4B,SAAS;EACxC,EAAG,+BAA+B,aAAa;EAC/C,EAAG,4BAA4B,UAAU;EACzC,EAAG,gCAAgC,cAAc;EAClD,EACK,KAAU,MAAc,KAAK,KAAK,IAAI,QAAQ,MAAM,OAAK,CAAC,IAC1D,IAAO,EAAc,KAAK,MAC9B;EACE,EAAE;EACF,EAAE;EACF,EAAE;EACF,EAAE;EACF,EAAE;EACF,EAAE;EACF,EAAE;EACF,EAAE,UAAU;EACZ,EAAE,cAAc;EACjB,CACE,IAAI,EAAO,CACX,KAAK,IAAI,CACb,EACK,IAAM,CAAC,EAAQ,IAAI,EAAO,CAAC,KAAK,IAAI,EAAE,GAAG,EAAK,CAAC,KAAK,KAAK,EACzD,IAAO,IAAI,KAAK,CAAC,EAAI,EAAE,EAAE,MAAM,2BAA2B,CAAC,EAC3D,IAAM,IAAI,gBAAgB,EAAK,EAC/B,IAAI,SAAS,cAAc,IAAI;AAIrC,CAHA,EAAE,OAAO,GACT,EAAE,WAAW,kCAAiB,IAAI,MAAM,EAAC,aAAa,CAAC,MAAM,GAAG,GAAG,CAAC,OACpE,EAAE,OAAO,EACT,IAAI,gBAAgB,EAAI"}
1
+ {"version":3,"file":"notificationHistoryExport.js","names":["exportNotificationsAsCsv","headers","tr","escape","v","rows","notifications","n","csv","blob","url","a"],"sources":["../../src/utils/notificationHistoryExport.ts"],"sourcesContent":["export interface ExportableNotification {\n id: string;\n title: string;\n body: string;\n type: string;\n priority: string;\n status: string;\n createdAt: string;\n readAt?: string;\n archivedAt?: string;\n}\n\nexport function exportNotificationsAsCsv(\n tr: (key: string, fallback: string) => string,\n notifications: ExportableNotification[]\n) {\n const headers = [\n tr('notifications.csv.id', 'ID'),\n tr('notifications.csv.title', 'Title'),\n tr('notifications.csv.body', 'Body'),\n tr('notifications.csv.type', 'Type'),\n tr('notifications.csv.priority', 'Priority'),\n tr('notifications.csv.status', 'Status'),\n tr('notifications.csv.createdAt', 'Created At'),\n tr('notifications.csv.readAt', 'Read At'),\n tr('notifications.csv.archivedAt', 'Archived At'),\n ];\n const escape = (v: string) => `\"${(v ?? '').replace(/\"/g, '\"\"')}\"`;\n const rows = notifications.map((n) =>\n [\n n.id,\n n.title,\n n.body,\n n.type,\n n.priority,\n n.status,\n n.createdAt,\n n.readAt ?? '',\n n.archivedAt ?? '',\n ]\n .map(escape)\n .join(',')\n );\n const csv = [headers.map(escape).join(','), ...rows].join('\\n');\n const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = `notifications-${new Date().toISOString().slice(0, 10)}.csv`;\n a.click();\n URL.revokeObjectURL(url);\n}\n"],"mappings":";AAYA,SAAgBA,EACd,GACA,GACA;CACA,IAAMC,IAAU;EACdC,EAAG,wBAAwB,IAAI;EAC/BA,EAAG,2BAA2B,OAAO;EACrCA,EAAG,0BAA0B,MAAM;EACnCA,EAAG,0BAA0B,MAAM;EACnCA,EAAG,8BAA8B,UAAU;EAC3CA,EAAG,4BAA4B,QAAQ;EACvCA,EAAG,+BAA+B,YAAY;EAC9CA,EAAG,4BAA4B,SAAS;EACxCA,EAAG,gCAAgC,aAAa;CAClD,GACMC,KAAU,MAAc,KAAKC,KAAK,GAAA,CAAI,QAAQ,MAAM,MAAI,EAAE,IAC1DC,IAAOC,EAAc,KAAK,MAC9B;EACEC,EAAE;EACFA,EAAE;EACFA,EAAE;EACFA,EAAE;EACFA,EAAE;EACFA,EAAE;EACFA,EAAE;EACFA,EAAE,UAAU;EACZA,EAAE,cAAc;CAClB,CAAC,CACE,IAAIJ,CAAM,CAAC,CACX,KAAK,GAAG,CACb,GACMK,IAAM,CAACP,EAAQ,IAAIE,CAAM,CAAC,CAAC,KAAK,GAAG,GAAG,GAAGE,CAAI,CAAC,CAAC,KAAK,IAAI,GACxDI,IAAO,IAAI,KAAK,CAACD,CAAG,GAAG,EAAE,MAAM,0BAA0B,CAAC,GAC1DE,IAAM,IAAI,gBAAgBD,CAAI,GAC9BE,IAAI,SAAS,cAAc,GAAG;CAIpC,AAHA,EAAE,OAAOD,GACT,EAAE,WAAW,kCAAiB,IAAI,KAAK,EAAA,CAAE,YAAY,CAAC,CAAC,MAAM,GAAG,EAAE,EAAE,OACpEC,EAAE,MAAM,GACR,IAAI,gBAAgBD,CAAG;AACzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-notification",
3
- "version": "2026.1029.2",
3
+ "version": "2026.1109.1",
4
4
  "description": "Notification microfrontend for multi-channel notification management",
5
5
  "type": "module",
6
6
  "imports": {
@@ -22,68 +22,67 @@
22
22
  ],
23
23
  "scripts": {
24
24
  "dev": "vite --port 5150",
25
- "build": "tsc && bash scripts/build-limits.sh --gate vite build",
26
- "preview": "vite preview",
27
- "schema:pull": "graphql-codegen --project schema-wspace && graphql-codegen --project schema-global",
25
+ "build": "boff gate -- vite build && bun scripts/verify-dts.ts",
26
+ "build:fast": "MFE_DTS=0 boff gate -- vite build",
27
+ "verify:dts": "bun scripts/verify-dts.ts",
28
28
  "codegen": "graphql-codegen --project wspace && graphql-codegen --project global",
29
29
  "codegen:all": "bun run schema:pull && bun run codegen",
30
- "lint": "eslint src/",
31
- "lint:sanity": "if [ \"${CI:-}\" = \"true\" ]; then bun run lint; else bun run lint -- --cache --cache-location .eslintcache; fi",
32
- "format": "prettier --write \"src/**/*.{ts,tsx}\"",
33
- "type:check": "bash scripts/build-limits.sh tsc --noEmit",
34
- "sanity": "bash scripts/build-limits.sh --gate bash -c 'bun run codegen && bun run lint:sanity && bun run format && bun run type:check'",
35
- "switch:status": "bun scripts/deps-mode.ts status",
36
- "switch:remote": "bun scripts/deps-mode.ts remote",
37
- "switch:local": "bun scripts/deps-mode.ts local",
38
- "switch:check": "bun scripts/deps-mode.ts check",
30
+ "schema:pull": "graphql-codegen --project schema-wspace && graphql-codegen --project schema-global",
31
+ "lint": "eslint .",
32
+ "format": "bun fmt src",
33
+ "format:check": "bun fmt --check src",
34
+ "type:check": "boff gate -- bun check --no-pretty -b",
35
+ "test": "bun test --isolate",
36
+ "test:watch": "bun test --isolate --watch",
37
+ "test:coverage": "bun test --isolate --coverage",
38
+ "sanity": "boff sanity",
39
+ "sanity:force": "boff sanity --force",
40
+ "audit": "bun audit --audit-level=high",
39
41
  "prepare": "lefthook install || true",
40
- "format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
41
- "test": "bash scripts/build-limits.sh vitest run",
42
- "test:watch": "vitest",
43
- "test:coverage": "bash scripts/build-limits.sh vitest run --coverage"
42
+ "preview": "vite preview",
43
+ "switch:check": "boff deps-mode check",
44
+ "switch:local": "boff deps-mode local",
45
+ "switch:remote": "boff deps-mode remote",
46
+ "switch:status": "boff deps-mode status"
44
47
  },
45
48
  "peerDependencies": {
46
49
  "react": ">=18.0.0",
47
50
  "react-dom": ">=18.0.0",
48
- "react-router": "^8.3.0"
51
+ "react-router": "^8.5.1"
49
52
  },
50
53
  "dependencies": {
51
- "@apollo/client": "^4.0.9",
54
+ "@apollo/client": "^4.3.7",
52
55
  "@burdenoff/fe-libs": "2026.1012.2",
53
56
  "@types/lodash-es": "^4.17.12",
54
- "graphql": "^16.12.0",
55
- "graphql-ws": "^6.0.6",
56
- "lodash-es": "^4.17.23",
57
+ "graphql": "^16.15.0",
58
+ "graphql-ws": "^6.4.1",
59
+ "lodash-es": "^4.18.1",
57
60
  "lucide-react": "^0.468.0",
58
- "zustand": "^5.0.3"
61
+ "zustand": "^5.1.0"
59
62
  },
60
63
  "devDependencies": {
61
- "@eslint/js": "^9.39.1",
62
- "@graphql-codegen/add": "^5.0.0",
63
- "@graphql-codegen/cli": "^5.0.0",
64
- "@graphql-codegen/import-types-preset": "^3.0.0",
65
- "@graphql-codegen/schema-ast": "^4.0.0",
66
- "@graphql-codegen/typescript": "^4.0.0",
67
- "@graphql-codegen/typescript-operations": "^4.0.0",
68
- "@graphql-codegen/typescript-react-apollo": "^4.0.0",
64
+ "@burdenoff/toolchain": "2026.1107.14",
65
+ "@graphql-codegen/add": "7.1.1",
66
+ "@graphql-codegen/cli": "7.4.6",
67
+ "@graphql-codegen/import-types-preset": "4.0.1",
68
+ "@graphql-codegen/schema-ast": "6.1.1",
69
+ "@graphql-codegen/typescript": "6.1.2",
70
+ "@graphql-codegen/typescript-operations": "6.2.0",
71
+ "@graphql-codegen/typescript-react-apollo": "5.0.0",
72
+ "@happy-dom/global-registrator": "^21.0.4",
69
73
  "@testing-library/jest-dom": "^6.9.1",
70
- "@testing-library/react": "^16.3.2",
71
- "@testing-library/user-event": "^14.6.1",
72
- "@types/react": "^19.0.2",
73
- "@types/react-dom": "^19.0.2",
74
- "@vitejs/plugin-react": "^4.3.4",
75
- "@vitest/coverage-v8": "^4.1.2",
76
- "eslint": "^9.18.0",
77
- "eslint-plugin-react": "^7.37.5",
78
- "eslint-plugin-react-hooks": "^7.0.1",
79
- "jsdom": "^29.0.1",
80
- "lefthook": "^2.1.1",
81
- "prettier": "^3.4.2",
82
- "typescript": "^5.9.0",
83
- "typescript-eslint": "^8.46.0",
84
- "vite": "8.0.8",
85
- "vite-plugin-dts": "3.9.1",
86
- "vitest": "^4.1.2"
74
+ "@testing-library/react": "^16.3.3",
75
+ "@testing-library/user-event": "^14.6.8",
76
+ "@types/bun": "^1.4.4",
77
+ "@types/node": "^24.19.2",
78
+ "@types/react": "^19.3.0",
79
+ "@types/react-dom": "^19.3.0",
80
+ "@vitejs/plugin-react": "^6.3.0",
81
+ "eslint": "^9.39.5",
82
+ "lefthook": "^2.2.2",
83
+ "typescript": "6.0.3",
84
+ "unplugin-dts": "1.1.2",
85
+ "vite": "8.3.5"
87
86
  },
88
87
  "keywords": [
89
88
  "microfrontend",
@@ -113,5 +112,24 @@
113
112
  "picomatch": ">=2.3.2",
114
113
  "immutable": ">=3.8.3",
115
114
  "minimatch": ">=3.1.3"
115
+ },
116
+ "packageManager": "bun@1.4.4",
117
+ "engines": {
118
+ "bun": ">=1.4.4"
119
+ },
120
+ "boff": {
121
+ "type": "mfe",
122
+ "sanity": {
123
+ "formatPaths": [
124
+ "src"
125
+ ]
126
+ },
127
+ "scripts": {
128
+ "unmanaged": [
129
+ "test",
130
+ "test:watch",
131
+ "test:coverage"
132
+ ]
133
+ }
116
134
  }
117
135
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"tslib.es6.js","names":[],"sources":["../../../../../node_modules/rxjs/node_modules/tslib/tslib.es6.mjs"],"sourcesContent":["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n"],"x_google_ignoreList":[0],"mappings":";AAgBA,IAAI,IAAgB,SAAS,GAAG,GAAG;AAIjC,QAHA,IAAgB,OAAO,kBAClB,EAAE,WAAW,EAAE,EAAE,YAAY,SAAS,SAAU,GAAG,GAAG;AAAE,IAAE,YAAY;MACvE,SAAU,GAAG,GAAG;AAAE,OAAK,IAAI,KAAK,EAAG,CAAI,OAAO,UAAU,eAAe,KAAK,GAAG,EAAE,KAAE,EAAE,KAAK,EAAE;IACzF,EAAc,GAAG,EAAE;;AAG5B,SAAgB,EAAU,GAAG,GAAG;AAC9B,KAAI,OAAO,KAAM,cAAc,MAAM,KACjC,OAAU,UAAU,yBAAyB,OAAO,EAAE,GAAG,gCAAgC;AAC7F,GAAc,GAAG,EAAE;CACnB,SAAS,IAAK;AAAE,OAAK,cAAc;;AACnC,GAAE,YAAY,MAAM,OAAO,OAAO,OAAO,EAAE,IAAI,EAAG,YAAY,EAAE,WAAW,IAAI,GAAI;;AA4IrF,SAAgB,EAAS,GAAG;CAC1B,IAAI,IAAI,OAAO,UAAW,cAAc,OAAO,UAAU,IAAI,KAAK,EAAE,IAAI,IAAI;AAC5E,KAAI,EAAG,QAAO,EAAE,KAAK,EAAE;AACvB,KAAI,KAAK,OAAO,EAAE,UAAW,SAAU,QAAO,EAC1C,MAAM,WAAY;AAEd,SADI,KAAK,KAAK,EAAE,WAAQ,IAAI,KAAK,IAC1B;GAAE,OAAO,KAAK,EAAE;GAAM,MAAM,CAAC;GAAG;IAE9C;AACD,OAAU,UAAU,IAAI,4BAA4B,kCAA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