@burdenoff/microfe-subscriberbot 2026.1107.8 → 2026.1110.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (482) hide show
  1. package/dist/generated/global-operations.d.ts +4 -2
  2. package/dist/generated/global-types.d.ts +2 -22
  3. package/dist/generated/wspace-operations.d.ts +4 -2
  4. package/dist/generated/wspace-types.d.ts +4 -24
  5. package/dist/index.d.ts +0 -1
  6. package/dist/node_modules/clsx/dist/clsx.js +8 -7
  7. package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
  8. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +134 -151
  9. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
  10. package/dist/stories/Accessibility.stories.d.ts +2 -4
  11. package/dist/stories/EmptyState.stories.d.ts +0 -2
  12. package/dist/stories/MetricsCard.stories.d.ts +0 -2
  13. package/dist/stories/StatusBadge.stories.d.ts +0 -2
  14. package/dist/stories/pages/AgentDetailPage.stories.d.ts +0 -2
  15. package/dist/stories/pages/AgentNewPage.stories.d.ts +0 -2
  16. package/dist/stories/pages/AgentsListPage.stories.d.ts +0 -2
  17. package/dist/stories/pages/AssetVaultPage.stories.d.ts +0 -2
  18. package/dist/stories/pages/BankConnectionsPage.stories.d.ts +0 -2
  19. package/dist/stories/pages/DashboardPage.stories.d.ts +0 -2
  20. package/dist/stories/pages/DecisionDetailPage.stories.d.ts +0 -2
  21. package/dist/stories/pages/DecisionsPage.stories.d.ts +0 -2
  22. package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts +0 -2
  23. package/dist/stories/pages/InboxPage.stories.d.ts +0 -2
  24. package/dist/stories/pages/InboxReadState.stories.d.ts +1 -3
  25. package/dist/stories/pages/InsightsPage.stories.d.ts +0 -2
  26. package/dist/stories/pages/InvoicesPage.stories.d.ts +0 -2
  27. package/dist/stories/pages/NegotiationDetailPage.stories.d.ts +0 -2
  28. package/dist/stories/pages/NegotiationNewPage.stories.d.ts +0 -2
  29. package/dist/stories/pages/NegotiationsPage.stories.d.ts +0 -2
  30. package/dist/stories/pages/ProcurementDetailPage.stories.d.ts +0 -2
  31. package/dist/stories/pages/ProcurementNewPage.stories.d.ts +0 -2
  32. package/dist/stories/pages/ProcurementPage.stories.d.ts +0 -2
  33. package/dist/stories/pages/ProviderDetailPage.stories.d.ts +0 -2
  34. package/dist/stories/pages/ProviderNewPage.stories.d.ts +0 -2
  35. package/dist/stories/pages/ProvidersListPage.stories.d.ts +0 -2
  36. package/dist/stories/pages/RelationshipDetailPage.stories.d.ts +0 -2
  37. package/dist/stories/pages/RelationshipNewPage.stories.d.ts +0 -2
  38. package/dist/stories/pages/RelationshipsListPage.stories.d.ts +0 -2
  39. package/dist/stories/pages/RenewalsPage.stories.d.ts +0 -2
  40. package/dist/stories/pages/SavingsPage.stories.d.ts +0 -2
  41. package/dist/stories/pages/WorkflowBuilderPage.stories.d.ts +0 -2
  42. package/dist/stories/pages/WorkflowsPage.stories.d.ts +0 -2
  43. package/dist/stories/support/PageHarness.d.ts +0 -2
  44. package/dist/stories/support/bankingFixtures.d.ts +0 -2
  45. package/dist/stories/support/fixtures.d.ts +0 -2
  46. package/dist/stories/support/graphqlMock.d.ts +0 -2
  47. package/dist/stories/support/handlers.d.ts +0 -2
  48. package/dist/stories/support/negotiationFixtures.d.ts +0 -2
  49. package/dist/stories/support/phoneViewport.d.ts +0 -2
  50. package/dist/stories/support/play.d.ts +0 -2
  51. package/dist/stories/support/procurementFixtures.d.ts +0 -2
  52. package/dist/subscriberbot/SubscriberBotRoot.d.ts +0 -2
  53. package/dist/subscriberbot/SubscriberBotRoot.js +10 -7
  54. package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
  55. package/dist/subscriberbot/SubscriberBotRoutes.d.ts +0 -2
  56. package/dist/subscriberbot/SubscriberBotRoutes.js +1 -2
  57. package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
  58. package/dist/subscriberbot/admin/AdminDashboardPage.d.ts +0 -2
  59. package/dist/subscriberbot/admin/AdminDashboardPage.js +9 -10
  60. package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
  61. package/dist/subscriberbot/admin/AdminRoot.d.ts +0 -2
  62. package/dist/subscriberbot/admin/AdminRoot.js +2 -3
  63. package/dist/subscriberbot/admin/AdminRoot.js.map +1 -1
  64. package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts +0 -2
  65. package/dist/subscriberbot/admin/NegotiationDeskPanel.js +56 -57
  66. package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
  67. package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts +0 -2
  68. package/dist/subscriberbot/admin/ProcurementDeskPanel.js +107 -108
  69. package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
  70. package/dist/subscriberbot/admin/index.d.ts +0 -1
  71. package/dist/subscriberbot/admin/index.js +1 -1
  72. package/dist/subscriberbot/components/EmptyState.d.ts +0 -2
  73. package/dist/subscriberbot/components/EmptyState.js +1 -2
  74. package/dist/subscriberbot/components/EmptyState.js.map +1 -1
  75. package/dist/subscriberbot/components/MetricsCard.d.ts +0 -2
  76. package/dist/subscriberbot/components/MetricsCard.js +1 -2
  77. package/dist/subscriberbot/components/MetricsCard.js.map +1 -1
  78. package/dist/subscriberbot/components/Modal.d.ts +0 -2
  79. package/dist/subscriberbot/components/Modal.js +2 -3
  80. package/dist/subscriberbot/components/Modal.js.map +1 -1
  81. package/dist/subscriberbot/components/PageLayout.d.ts +0 -2
  82. package/dist/subscriberbot/components/PageLayout.js +1 -2
  83. package/dist/subscriberbot/components/PageLayout.js.map +1 -1
  84. package/dist/subscriberbot/components/PostureOptions.d.ts +1 -3
  85. package/dist/subscriberbot/components/PostureOptions.js +7 -8
  86. package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
  87. package/dist/subscriberbot/components/StateViews.d.ts +0 -2
  88. package/dist/subscriberbot/components/StateViews.js +1 -2
  89. package/dist/subscriberbot/components/StateViews.js.map +1 -1
  90. package/dist/subscriberbot/components/StatusBadge.d.ts +0 -2
  91. package/dist/subscriberbot/components/StatusBadge.js +2 -3
  92. package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
  93. package/dist/subscriberbot/components/decisions/DecisionBanners.d.ts +0 -2
  94. package/dist/subscriberbot/components/decisions/DecisionBanners.js +7 -8
  95. package/dist/subscriberbot/components/decisions/DecisionBanners.js.map +1 -1
  96. package/dist/subscriberbot/components/decisions/DecisionCard.d.ts +0 -2
  97. package/dist/subscriberbot/components/decisions/DecisionCard.js +65 -66
  98. package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
  99. package/dist/subscriberbot/components/decisions/decisionModel.d.ts +0 -2
  100. package/dist/subscriberbot/components/decisions/decisionModel.js +2 -3
  101. package/dist/subscriberbot/components/decisions/decisionModel.js.map +1 -1
  102. package/dist/subscriberbot/components/decisions/index.d.ts +0 -1
  103. package/dist/subscriberbot/components/decisions/index.js +4 -3
  104. package/dist/subscriberbot/components/index.d.ts +0 -1
  105. package/dist/subscriberbot/components/index.js +8 -7
  106. package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts +0 -2
  107. package/dist/subscriberbot/components/mobile/MobileDashboard.js +23 -24
  108. package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
  109. package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts +0 -2
  110. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +40 -49
  111. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
  112. package/dist/subscriberbot/components/mobile/MobileScreen.d.ts +0 -2
  113. package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -2
  114. package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
  115. package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts +0 -2
  116. package/dist/subscriberbot/components/mobile/RelationshipGlyph.js +1 -2
  117. package/dist/subscriberbot/components/mobile/RelationshipGlyph.js.map +1 -1
  118. package/dist/subscriberbot/components/mobile/index.d.ts +0 -1
  119. package/dist/subscriberbot/components/mobile/index.js +4 -3
  120. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.d.ts +0 -2
  121. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +1 -2
  122. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js.map +1 -1
  123. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts +0 -2
  124. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +4 -5
  125. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
  126. package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts +0 -2
  127. package/dist/subscriberbot/components/negotiations/OutcomeForm.js +4 -5
  128. package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
  129. package/dist/subscriberbot/components/negotiations/index.d.ts +0 -1
  130. package/dist/subscriberbot/components/negotiations/index.js +5 -4
  131. package/dist/subscriberbot/components/negotiations/labels.d.ts +0 -2
  132. package/dist/subscriberbot/components/negotiations/labels.js +1 -2
  133. package/dist/subscriberbot/components/negotiations/labels.js.map +1 -1
  134. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts +0 -2
  135. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +4 -5
  136. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
  137. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.d.ts +0 -2
  138. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +1 -2
  139. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js.map +1 -1
  140. package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts +0 -2
  141. package/dist/subscriberbot/components/procurement/ProcurementThread.js +4 -5
  142. package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
  143. package/dist/subscriberbot/components/procurement/index.d.ts +0 -1
  144. package/dist/subscriberbot/components/procurement/index.js +5 -4
  145. package/dist/subscriberbot/components/procurement/labels.d.ts +0 -2
  146. package/dist/subscriberbot/components/procurement/labels.js +1 -2
  147. package/dist/subscriberbot/components/procurement/labels.js.map +1 -1
  148. package/dist/subscriberbot/components/savings/SavingsCards.d.ts +0 -2
  149. package/dist/subscriberbot/components/savings/SavingsCards.js +90 -91
  150. package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
  151. package/dist/subscriberbot/components/savings/index.d.ts +0 -1
  152. package/dist/subscriberbot/components/savings/index.js +3 -2
  153. package/dist/subscriberbot/components/savings/savingsModel.d.ts +0 -2
  154. package/dist/subscriberbot/components/savings/savingsModel.js +2 -3
  155. package/dist/subscriberbot/components/savings/savingsModel.js.map +1 -1
  156. package/dist/subscriberbot/components/viz.d.ts +0 -2
  157. package/dist/subscriberbot/components/viz.js +2 -3
  158. package/dist/subscriberbot/components/viz.js.map +1 -1
  159. package/dist/subscriberbot/config/assistantUsecases.d.ts +0 -1
  160. package/dist/subscriberbot/context/SubscriberBotContext.d.ts +0 -2
  161. package/dist/subscriberbot/context/SubscriberBotContext.js +3 -3
  162. package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
  163. package/dist/subscriberbot/context/index.d.ts +0 -1
  164. package/dist/subscriberbot/context/index.js +1 -1
  165. package/dist/subscriberbot/hooks/index.d.ts +0 -1
  166. package/dist/subscriberbot/hooks/index.js +2 -2
  167. package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts +0 -2
  168. package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +2 -3
  169. package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -1
  170. package/dist/subscriberbot/hooks/useBankingApi.d.ts +0 -2
  171. package/dist/subscriberbot/hooks/useBankingApi.js +2 -3
  172. package/dist/subscriberbot/hooks/useBankingApi.js.map +1 -1
  173. package/dist/subscriberbot/hooks/useCompactViewport.d.ts +0 -1
  174. package/dist/subscriberbot/hooks/useCompactViewport.js +1 -2
  175. package/dist/subscriberbot/hooks/useCompactViewport.js.map +1 -1
  176. package/dist/subscriberbot/hooks/useFormError.d.ts +0 -1
  177. package/dist/subscriberbot/hooks/useFormError.js +1 -2
  178. package/dist/subscriberbot/hooks/useFormError.js.map +1 -1
  179. package/dist/subscriberbot/hooks/useFormatters.d.ts +0 -1
  180. package/dist/subscriberbot/hooks/useFormatters.js +1 -2
  181. package/dist/subscriberbot/hooks/useFormatters.js.map +1 -1
  182. package/dist/subscriberbot/hooks/useNegotiationApi.d.ts +0 -2
  183. package/dist/subscriberbot/hooks/useNegotiationApi.js +2 -3
  184. package/dist/subscriberbot/hooks/useNegotiationApi.js.map +1 -1
  185. package/dist/subscriberbot/hooks/useProcurementApi.d.ts +0 -2
  186. package/dist/subscriberbot/hooks/useProcurementApi.js +2 -3
  187. package/dist/subscriberbot/hooks/useProcurementApi.js.map +1 -1
  188. package/dist/subscriberbot/hooks/useRouteSelection.d.ts +0 -1
  189. package/dist/subscriberbot/hooks/useRouteSelection.js +3 -3
  190. package/dist/subscriberbot/hooks/useRouteSelection.js.map +1 -1
  191. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts +0 -2
  192. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +1 -2
  193. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  194. package/dist/subscriberbot/hooks/useTr.d.ts +0 -1
  195. package/dist/subscriberbot/hooks/useTr.js +1 -2
  196. package/dist/subscriberbot/hooks/useTr.js.map +1 -1
  197. package/dist/subscriberbot/index.d.ts +0 -1
  198. package/dist/subscriberbot/index.js +9 -8
  199. package/dist/subscriberbot/pages/AssetVaultPage.d.ts +0 -2
  200. package/dist/subscriberbot/pages/AssetVaultPage.js +34 -35
  201. package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
  202. package/dist/subscriberbot/pages/DashboardPage.d.ts +1 -2
  203. package/dist/subscriberbot/pages/DashboardPage.js +86 -87
  204. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  205. package/dist/subscriberbot/pages/InboxPage.d.ts +1 -2
  206. package/dist/subscriberbot/pages/InboxPage.js +194 -199
  207. package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
  208. package/dist/subscriberbot/pages/InsightsPage.d.ts +0 -2
  209. package/dist/subscriberbot/pages/InsightsPage.js +28 -29
  210. package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
  211. package/dist/subscriberbot/pages/InvoicesPage.d.ts +1 -2
  212. package/dist/subscriberbot/pages/InvoicesPage.js +179 -188
  213. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
  214. package/dist/subscriberbot/pages/RenewalsPage.d.ts +0 -2
  215. package/dist/subscriberbot/pages/RenewalsPage.js +293 -298
  216. package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
  217. package/dist/subscriberbot/pages/SavingsPage.d.ts +0 -2
  218. package/dist/subscriberbot/pages/SavingsPage.js +25 -26
  219. package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
  220. package/dist/subscriberbot/pages/WorkflowsPage.d.ts +1 -2
  221. package/dist/subscriberbot/pages/WorkflowsPage.js +67 -68
  222. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
  223. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +1 -2
  224. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +126 -127
  225. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
  226. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +1 -2
  227. package/dist/subscriberbot/pages/agents/AgentNewPage.js +10 -11
  228. package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
  229. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +1 -2
  230. package/dist/subscriberbot/pages/agents/AgentsListPage.js +23 -24
  231. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
  232. package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts +1 -2
  233. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +337 -359
  234. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
  235. package/dist/subscriberbot/pages/banking/ConnectBankModal.d.ts +1 -3
  236. package/dist/subscriberbot/pages/banking/ConnectBankModal.js +22 -27
  237. package/dist/subscriberbot/pages/banking/ConnectBankModal.js.map +1 -1
  238. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +1 -2
  239. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +25 -26
  240. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
  241. package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +1 -2
  242. package/dist/subscriberbot/pages/decisions/DecisionsPage.js +34 -35
  243. package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
  244. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts +1 -2
  245. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +125 -130
  246. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
  247. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +1 -2
  248. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +94 -95
  249. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
  250. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +1 -2
  251. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +15 -16
  252. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
  253. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +1 -2
  254. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +20 -21
  255. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
  256. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +1 -2
  257. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +86 -87
  258. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
  259. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +1 -2
  260. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +164 -165
  261. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
  262. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +1 -2
  263. package/dist/subscriberbot/pages/procurement/ProcurementPage.js +20 -21
  264. package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
  265. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +1 -2
  266. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +350 -351
  267. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
  268. package/dist/subscriberbot/pages/providers/ProviderInsights.d.ts +2 -3
  269. package/dist/subscriberbot/pages/providers/ProviderInsights.js +95 -96
  270. package/dist/subscriberbot/pages/providers/ProviderInsights.js.map +1 -1
  271. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +1 -2
  272. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +11 -12
  273. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
  274. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +1 -2
  275. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +62 -63
  276. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
  277. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +1 -2
  278. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +166 -172
  279. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  280. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +1 -2
  281. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +12 -13
  282. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
  283. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +1 -2
  284. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +21 -22
  285. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
  286. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts +1 -3
  287. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +242 -255
  288. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
  289. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +0 -2
  290. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +2 -3
  291. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
  292. package/dist/subscriberbot/services/createSandboxAssistantTransport.d.ts +0 -1
  293. package/dist/subscriberbot/services/createSandboxAssistantTransport.js +1 -2
  294. package/dist/subscriberbot/services/createSandboxAssistantTransport.js.map +1 -1
  295. package/dist/subscriberbot/store/index.d.ts +0 -1
  296. package/dist/subscriberbot/store/index.js +1 -1
  297. package/dist/subscriberbot/store/subscriberbotStore.d.ts +1 -3
  298. package/dist/subscriberbot/store/subscriberbotStore.js +1 -2
  299. package/dist/subscriberbot/store/subscriberbotStore.js.map +1 -1
  300. package/dist/subscriberbot/types/assistant.d.ts +0 -2
  301. package/dist/subscriberbot/types/banking.d.ts +0 -2
  302. package/dist/subscriberbot/types/index.d.ts +0 -2
  303. package/dist/subscriberbot/types/negotiation.d.ts +0 -2
  304. package/dist/subscriberbot/types/procurement.d.ts +0 -1
  305. package/dist/subscriberbot/utils/bankRedirectLink.d.ts +0 -2
  306. package/dist/subscriberbot/utils/bankRedirectLink.js +18 -19
  307. package/dist/subscriberbot/utils/bankRedirectLink.js.map +1 -1
  308. package/dist/subscriberbot/utils/chartScale.d.ts +0 -1
  309. package/dist/subscriberbot/utils/chartScale.js +1 -2
  310. package/dist/subscriberbot/utils/chartScale.js.map +1 -1
  311. package/dist/subscriberbot/utils/cn.d.ts +0 -2
  312. package/dist/subscriberbot/utils/cn.js +2 -3
  313. package/dist/subscriberbot/utils/cn.js.map +1 -1
  314. package/dist/subscriberbot/utils/formatters.d.ts +0 -1
  315. package/dist/subscriberbot/utils/formatters.js +4 -5
  316. package/dist/subscriberbot/utils/formatters.js.map +1 -1
  317. package/dist/subscriberbot/utils/index.d.ts +0 -1
  318. package/dist/subscriberbot/utils/navigation.d.ts +0 -1
  319. package/dist/subscriberbot/utils/navigation.js +1 -2
  320. package/dist/subscriberbot/utils/navigation.js.map +1 -1
  321. package/dist/subscriberbot/utils/pageContext.d.ts +0 -1
  322. package/dist/subscriberbot/utils/pageContext.js +3 -4
  323. package/dist/subscriberbot/utils/pageContext.js.map +1 -1
  324. package/dist/subscriberbot/utils/plaidLink.d.ts +0 -1
  325. package/dist/subscriberbot/utils/plaidLink.js +21 -22
  326. package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
  327. package/dist/subscriberbot/utils/portfolio.d.ts +0 -2
  328. package/dist/subscriberbot/utils/portfolio.js +5 -6
  329. package/dist/subscriberbot/utils/portfolio.js.map +1 -1
  330. package/dist/subscriberbot/utils/renewals.d.ts +0 -2
  331. package/dist/subscriberbot/utils/renewals.js +1 -2
  332. package/dist/subscriberbot/utils/renewals.js.map +1 -1
  333. package/package.json +73 -56
  334. package/dist/generated/global-operations.d.ts.map +0 -1
  335. package/dist/generated/global-types.d.ts.map +0 -1
  336. package/dist/generated/wspace-operations.d.ts.map +0 -1
  337. package/dist/generated/wspace-types.d.ts.map +0 -1
  338. package/dist/index.d.ts.map +0 -1
  339. package/dist/stories/Accessibility.stories.d.ts.map +0 -1
  340. package/dist/stories/EmptyState.stories.d.ts.map +0 -1
  341. package/dist/stories/MetricsCard.stories.d.ts.map +0 -1
  342. package/dist/stories/StatusBadge.stories.d.ts.map +0 -1
  343. package/dist/stories/pages/AgentDetailPage.stories.d.ts.map +0 -1
  344. package/dist/stories/pages/AgentNewPage.stories.d.ts.map +0 -1
  345. package/dist/stories/pages/AgentsListPage.stories.d.ts.map +0 -1
  346. package/dist/stories/pages/AssetVaultPage.stories.d.ts.map +0 -1
  347. package/dist/stories/pages/BankConnectionsPage.stories.d.ts.map +0 -1
  348. package/dist/stories/pages/DashboardPage.stories.d.ts.map +0 -1
  349. package/dist/stories/pages/DecisionDetailPage.stories.d.ts.map +0 -1
  350. package/dist/stories/pages/DecisionsPage.stories.d.ts.map +0 -1
  351. package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts.map +0 -1
  352. package/dist/stories/pages/InboxPage.stories.d.ts.map +0 -1
  353. package/dist/stories/pages/InboxReadState.stories.d.ts.map +0 -1
  354. package/dist/stories/pages/InsightsPage.stories.d.ts.map +0 -1
  355. package/dist/stories/pages/InvoicesPage.stories.d.ts.map +0 -1
  356. package/dist/stories/pages/NegotiationDetailPage.stories.d.ts.map +0 -1
  357. package/dist/stories/pages/NegotiationNewPage.stories.d.ts.map +0 -1
  358. package/dist/stories/pages/NegotiationsPage.stories.d.ts.map +0 -1
  359. package/dist/stories/pages/ProcurementDetailPage.stories.d.ts.map +0 -1
  360. package/dist/stories/pages/ProcurementNewPage.stories.d.ts.map +0 -1
  361. package/dist/stories/pages/ProcurementPage.stories.d.ts.map +0 -1
  362. package/dist/stories/pages/ProviderDetailPage.stories.d.ts.map +0 -1
  363. package/dist/stories/pages/ProviderNewPage.stories.d.ts.map +0 -1
  364. package/dist/stories/pages/ProvidersListPage.stories.d.ts.map +0 -1
  365. package/dist/stories/pages/RelationshipDetailPage.stories.d.ts.map +0 -1
  366. package/dist/stories/pages/RelationshipNewPage.stories.d.ts.map +0 -1
  367. package/dist/stories/pages/RelationshipsListPage.stories.d.ts.map +0 -1
  368. package/dist/stories/pages/RenewalsPage.stories.d.ts.map +0 -1
  369. package/dist/stories/pages/SavingsPage.stories.d.ts.map +0 -1
  370. package/dist/stories/pages/WorkflowBuilderPage.stories.d.ts.map +0 -1
  371. package/dist/stories/pages/WorkflowsPage.stories.d.ts.map +0 -1
  372. package/dist/stories/support/PageHarness.d.ts.map +0 -1
  373. package/dist/stories/support/bankingFixtures.d.ts.map +0 -1
  374. package/dist/stories/support/fixtures.d.ts.map +0 -1
  375. package/dist/stories/support/graphqlMock.d.ts.map +0 -1
  376. package/dist/stories/support/handlers.d.ts.map +0 -1
  377. package/dist/stories/support/negotiationFixtures.d.ts.map +0 -1
  378. package/dist/stories/support/phoneViewport.d.ts.map +0 -1
  379. package/dist/stories/support/play.d.ts.map +0 -1
  380. package/dist/stories/support/procurementFixtures.d.ts.map +0 -1
  381. package/dist/subscriberbot/SubscriberBotRoot.d.ts.map +0 -1
  382. package/dist/subscriberbot/SubscriberBotRoutes.d.ts.map +0 -1
  383. package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +0 -1
  384. package/dist/subscriberbot/admin/AdminRoot.d.ts.map +0 -1
  385. package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +0 -1
  386. package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +0 -1
  387. package/dist/subscriberbot/admin/index.d.ts.map +0 -1
  388. package/dist/subscriberbot/components/EmptyState.d.ts.map +0 -1
  389. package/dist/subscriberbot/components/MetricsCard.d.ts.map +0 -1
  390. package/dist/subscriberbot/components/Modal.d.ts.map +0 -1
  391. package/dist/subscriberbot/components/PageLayout.d.ts.map +0 -1
  392. package/dist/subscriberbot/components/PostureOptions.d.ts.map +0 -1
  393. package/dist/subscriberbot/components/StateViews.d.ts.map +0 -1
  394. package/dist/subscriberbot/components/StatusBadge.d.ts.map +0 -1
  395. package/dist/subscriberbot/components/decisions/DecisionBanners.d.ts.map +0 -1
  396. package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +0 -1
  397. package/dist/subscriberbot/components/decisions/decisionModel.d.ts.map +0 -1
  398. package/dist/subscriberbot/components/decisions/index.d.ts.map +0 -1
  399. package/dist/subscriberbot/components/index.d.ts.map +0 -1
  400. package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +0 -1
  401. package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +0 -1
  402. package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +0 -1
  403. package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts.map +0 -1
  404. package/dist/subscriberbot/components/mobile/index.d.ts.map +0 -1
  405. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.d.ts.map +0 -1
  406. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +0 -1
  407. package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +0 -1
  408. package/dist/subscriberbot/components/negotiations/index.d.ts.map +0 -1
  409. package/dist/subscriberbot/components/negotiations/labels.d.ts.map +0 -1
  410. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +0 -1
  411. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.d.ts.map +0 -1
  412. package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +0 -1
  413. package/dist/subscriberbot/components/procurement/index.d.ts.map +0 -1
  414. package/dist/subscriberbot/components/procurement/labels.d.ts.map +0 -1
  415. package/dist/subscriberbot/components/savings/SavingsCards.d.ts.map +0 -1
  416. package/dist/subscriberbot/components/savings/index.d.ts.map +0 -1
  417. package/dist/subscriberbot/components/savings/savingsModel.d.ts.map +0 -1
  418. package/dist/subscriberbot/components/viz.d.ts.map +0 -1
  419. package/dist/subscriberbot/config/assistantUsecases.d.ts.map +0 -1
  420. package/dist/subscriberbot/context/SubscriberBotContext.d.ts.map +0 -1
  421. package/dist/subscriberbot/context/index.d.ts.map +0 -1
  422. package/dist/subscriberbot/hooks/index.d.ts.map +0 -1
  423. package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts.map +0 -1
  424. package/dist/subscriberbot/hooks/useBankingApi.d.ts.map +0 -1
  425. package/dist/subscriberbot/hooks/useCompactViewport.d.ts.map +0 -1
  426. package/dist/subscriberbot/hooks/useFormError.d.ts.map +0 -1
  427. package/dist/subscriberbot/hooks/useFormatters.d.ts.map +0 -1
  428. package/dist/subscriberbot/hooks/useNegotiationApi.d.ts.map +0 -1
  429. package/dist/subscriberbot/hooks/useProcurementApi.d.ts.map +0 -1
  430. package/dist/subscriberbot/hooks/useRouteSelection.d.ts.map +0 -1
  431. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +0 -1
  432. package/dist/subscriberbot/hooks/useTr.d.ts.map +0 -1
  433. package/dist/subscriberbot/index.d.ts.map +0 -1
  434. package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +0 -1
  435. package/dist/subscriberbot/pages/DashboardPage.d.ts.map +0 -1
  436. package/dist/subscriberbot/pages/InboxPage.d.ts.map +0 -1
  437. package/dist/subscriberbot/pages/InsightsPage.d.ts.map +0 -1
  438. package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +0 -1
  439. package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +0 -1
  440. package/dist/subscriberbot/pages/SavingsPage.d.ts.map +0 -1
  441. package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +0 -1
  442. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +0 -1
  443. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +0 -1
  444. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +0 -1
  445. package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +0 -1
  446. package/dist/subscriberbot/pages/banking/ConnectBankModal.d.ts.map +0 -1
  447. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +0 -1
  448. package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +0 -1
  449. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts.map +0 -1
  450. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +0 -1
  451. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +0 -1
  452. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +0 -1
  453. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +0 -1
  454. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +0 -1
  455. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +0 -1
  456. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +0 -1
  457. package/dist/subscriberbot/pages/providers/ProviderInsights.d.ts.map +0 -1
  458. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +0 -1
  459. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +0 -1
  460. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +0 -1
  461. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +0 -1
  462. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +0 -1
  463. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +0 -1
  464. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +0 -1
  465. package/dist/subscriberbot/services/createSandboxAssistantTransport.d.ts.map +0 -1
  466. package/dist/subscriberbot/store/index.d.ts.map +0 -1
  467. package/dist/subscriberbot/store/subscriberbotStore.d.ts.map +0 -1
  468. package/dist/subscriberbot/types/assistant.d.ts.map +0 -1
  469. package/dist/subscriberbot/types/banking.d.ts.map +0 -1
  470. package/dist/subscriberbot/types/index.d.ts.map +0 -1
  471. package/dist/subscriberbot/types/negotiation.d.ts.map +0 -1
  472. package/dist/subscriberbot/types/procurement.d.ts.map +0 -1
  473. package/dist/subscriberbot/utils/bankRedirectLink.d.ts.map +0 -1
  474. package/dist/subscriberbot/utils/chartScale.d.ts.map +0 -1
  475. package/dist/subscriberbot/utils/cn.d.ts.map +0 -1
  476. package/dist/subscriberbot/utils/formatters.d.ts.map +0 -1
  477. package/dist/subscriberbot/utils/index.d.ts.map +0 -1
  478. package/dist/subscriberbot/utils/navigation.d.ts.map +0 -1
  479. package/dist/subscriberbot/utils/pageContext.d.ts.map +0 -1
  480. package/dist/subscriberbot/utils/plaidLink.d.ts.map +0 -1
  481. package/dist/subscriberbot/utils/portfolio.d.ts.map +0 -1
  482. package/dist/subscriberbot/utils/renewals.d.ts.map +0 -1
@@ -1,18 +1,18 @@
1
- import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
2
- import { formatCurrency as t, formatDate as n, formatEnumLabel as r, formatIntervalSuffix as i } from "../../utils/formatters.js";
3
- import { useTr as a } from "../../hooks/useTr.js";
4
- import { cn as o } from "../../utils/cn.js";
5
- import { StatusBadge as s } from "../../components/StatusBadge.js";
6
- import { EmptyState as c } from "../../components/EmptyState.js";
7
- import { ErrorView as l, LoadingView as u, Section as d } from "../../components/StateViews.js";
8
- import { PriceHistoryChart as f } from "../../components/viz.js";
1
+ import { EmptyState as e } from "../../components/EmptyState.js";
2
+ import { ErrorView as t, LoadingView as n, Section as r } from "../../components/StateViews.js";
3
+ import { StatusBadge as i } from "../../components/StatusBadge.js";
9
4
  import "../../components/index.js";
10
- import { useProviderAlternatives as p, useProviderPriceHistory as m } from "../../hooks/useSubscriberBotApi.js";
5
+ import { useSubscriberBot as a } from "../../context/SubscriberBotContext.js";
6
+ import { useProviderAlternatives as o, useProviderPriceHistory as s } from "../../hooks/useSubscriberBotApi.js";
7
+ import { useTr as c } from "../../hooks/useTr.js";
8
+ import { PriceHistoryChart as l } from "../../components/viz.js";
9
+ import { formatCurrency as u, formatDate as d, formatEnumLabel as f, formatIntervalSuffix as p } from "../../utils/formatters.js";
10
+ import { cn as m } from "../../utils/cn.js";
11
11
  import { useMemo as h } from "react";
12
12
  import { ArrowRight as g, Shuffle as _ } from "lucide-react";
13
13
  import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
14
14
  import { GlassCard as x } from "@burdenoff/fe-libs/ui";
15
- //#region src/subscriberbot/pages/providers/ProviderInsights.tsx
15
+ // src/subscriberbot/pages/providers/ProviderInsights.tsx
16
16
  var S = 6;
17
17
  function C(e) {
18
18
  return e === null || e === 0 ? "bg-bg-sunken text-text-secondary" : e > 0 ? "bg-status-error-bg-subtle text-status-error-text" : "bg-status-success-bg-subtle text-status-success-text";
@@ -20,35 +20,35 @@ function C(e) {
20
20
  function w(e) {
21
21
  return `${e > 0 ? "+" : ""}${e}%`;
22
22
  }
23
- function T(e, r) {
24
- let a = e.summary?.currency;
25
- if (!a) return [];
26
- let o = /* @__PURE__ */ new Map();
23
+ function T(e, t) {
24
+ let n = e.summary?.currency;
25
+ if (!n) return [];
26
+ let r = /* @__PURE__ */ new Map();
27
27
  for (let t of e.series) {
28
- if (t.source !== "RELATIONSHIP" || t.currency === a || !t.relationshipId) continue;
29
- let e = o.get(t.relationshipId) ?? [];
30
- e.push(...t.points.map((e) => e.observedAt)), o.set(t.relationshipId, e);
28
+ if (t.source !== "RELATIONSHIP" || t.currency === n || !t.relationshipId) continue;
29
+ let e = r.get(t.relationshipId) ?? [];
30
+ e.push(...t.points.map((e) => e.observedAt)), r.set(t.relationshipId, e);
31
31
  }
32
- return e.series.filter((e) => e.currency === a).map((e) => {
33
- let a = e.points.filter((t) => e.source !== "INVOICE" || t.monthlyAmount !== null).map((e) => ({
32
+ return e.series.filter((e) => e.currency === n).map((e) => {
33
+ let n = e.points.filter((t) => e.source !== "INVOICE" || t.monthlyAmount !== null).map((e) => ({
34
34
  at: e.observedAt,
35
35
  value: e.monthlyAmount,
36
- title: `${n(e.observedAt)} · ${t(e.amount, e.currency)}${i(e.interval)}`
36
+ title: `${d(e.observedAt)} · ${u(e.amount, e.currency)}${p(e.interval)}`
37
37
  }));
38
- if (e.source === "RELATIONSHIP" && e.relationshipId) for (let t of o.get(e.relationshipId) ?? []) a.push({
38
+ if (e.source === "RELATIONSHIP" && e.relationshipId) for (let t of r.get(e.relationshipId) ?? []) n.push({
39
39
  at: t,
40
40
  value: null
41
41
  });
42
42
  return {
43
43
  key: e.key,
44
- label: e.source === "INVOICE" ? r("providers.insights.invoiceSeries", "{{label}} (invoices)", { label: e.label.replace(/ \(invoices\)$/, "") }) : e.label,
44
+ label: e.source === "INVOICE" ? t("providers.insights.invoiceSeries", "{{label}} (invoices)", { label: e.label.replace(/ \(invoices\)$/, "") }) : e.label,
45
45
  mode: e.source === "INVOICE" ? "dots" : "step",
46
- points: a
46
+ points: n
47
47
  };
48
48
  }).filter((e) => e.points.some((e) => e.value !== null));
49
49
  }
50
- function E({ providerId: r }) {
51
- let s = a(), { navigateTo: p } = e(), { data: g, isLoading: _, isError: E, refetch: D } = m(r), O = h(() => g ? T(g, s) : [], [g, s]), k = h(() => g ? [...g.points].reverse().slice(0, S) : [], [g]), A = g?.summary ?? null, j = A?.currency ?? "USD", M = h(() => {
50
+ function E({ providerId: i }) {
51
+ let o = c(), { navigateTo: f } = a(), { data: g, isLoading: _, isError: E, refetch: D } = s(i), O = h(() => g ? T(g, o) : [], [g, o]), k = h(() => g ? [...g.points].reverse().slice(0, S) : [], [g]), A = g?.summary ?? null, j = A?.currency ?? "USD", M = h(() => {
52
52
  let e = /* @__PURE__ */ new Map();
53
53
  for (let t of g?.series ?? []) {
54
54
  let n = t.points[t.points.length - 1];
@@ -67,79 +67,79 @@ function E({ providerId: r }) {
67
67
  count: t.length
68
68
  };
69
69
  }, [g, j]);
70
- return /* @__PURE__ */ y(d, {
71
- title: s("providers.insights.priceHistoryTitle", "Your price history"),
72
- description: s("providers.insights.priceHistoryDescription", "What this workspace has paid this provider over time, per month"),
70
+ return /* @__PURE__ */ y(r, {
71
+ title: o("providers.insights.priceHistoryTitle", "Your price history"),
72
+ description: o("providers.insights.priceHistoryDescription", "What this workspace has paid this provider over time, per month"),
73
73
  children: /* @__PURE__ */ y(x, {
74
74
  treatment: "metric",
75
75
  className: "p-5",
76
76
  "data-testid": "provider-price-history",
77
- children: _ ? /* @__PURE__ */ y(u, {
77
+ children: _ ? /* @__PURE__ */ y(n, {
78
78
  className: "min-h-[10rem]",
79
- label: s("providers.insights.priceHistoryLoading", "Loading price history…")
80
- }) : E ? /* @__PURE__ */ y(l, {
79
+ label: o("providers.insights.priceHistoryLoading", "Loading price history…")
80
+ }) : E ? /* @__PURE__ */ y(t, {
81
81
  className: "min-h-[10rem]",
82
- title: s("providers.insights.priceHistoryErrorTitle", "Price history unavailable"),
83
- message: s("providers.insights.priceHistoryError", "Could not load what this workspace has paid this provider."),
82
+ title: o("providers.insights.priceHistoryErrorTitle", "Price history unavailable"),
83
+ message: o("providers.insights.priceHistoryError", "Could not load what this workspace has paid this provider."),
84
84
  onRetry: () => void D()
85
- }) : !g || !A ? /* @__PURE__ */ y(c, {
85
+ }) : !g || !A ? /* @__PURE__ */ y(e, {
86
86
  illustration: "empty-data",
87
- title: s("providers.insights.priceHistoryEmptyTitle", "No prices recorded yet"),
88
- description: s("providers.insights.priceHistoryEmpty", "Link a relationship to this provider and its price, and every later change, will be charted here.")
87
+ title: o("providers.insights.priceHistoryEmptyTitle", "No prices recorded yet"),
88
+ description: o("providers.insights.priceHistoryEmpty", "Link a relationship to this provider and its price, and every later change, will be charted here.")
89
89
  }) : /* @__PURE__ */ b(v, { children: [
90
90
  /* @__PURE__ */ b("div", {
91
91
  className: "flex flex-wrap items-start gap-x-8 gap-y-3",
92
92
  children: [
93
93
  /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
94
94
  className: "text-xs text-text-secondary",
95
- children: M && M.count > 1 ? s("providers.insights.latestMonthlyTotal", "Latest monthly price across {{count}} relationships", { count: M.count }) : s("providers.insights.latestMonthly", "Latest monthly price")
95
+ children: M && M.count > 1 ? o("providers.insights.latestMonthlyTotal", "Latest monthly price across {{count}} relationships", { count: M.count }) : o("providers.insights.latestMonthly", "Latest monthly price")
96
96
  }), /* @__PURE__ */ b("p", {
97
97
  className: "text-2xl font-bold tabular-nums text-text-primary",
98
- children: [M ? t(M.amount, j) : "—", /* @__PURE__ */ y("span", {
98
+ children: [M ? u(M.amount, j) : "—", /* @__PURE__ */ y("span", {
99
99
  className: "text-sm font-normal text-text-secondary",
100
100
  children: "/mo"
101
101
  })]
102
102
  })] }),
103
103
  /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
104
104
  className: "text-xs text-text-secondary",
105
- children: s("providers.insights.range", "Range paid")
105
+ children: o("providers.insights.range", "Range paid")
106
106
  }), /* @__PURE__ */ y("p", {
107
107
  className: "text-sm font-medium tabular-nums text-text-primary",
108
- children: A.minMonthlyAmount != null && A.maxMonthlyAmount != null ? `${t(A.minMonthlyAmount, j)} – ${t(A.maxMonthlyAmount, j)}` : "—"
108
+ children: A.minMonthlyAmount != null && A.maxMonthlyAmount != null ? `${u(A.minMonthlyAmount, j)} – ${u(A.maxMonthlyAmount, j)}` : "—"
109
109
  })] }),
110
110
  /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
111
111
  className: "text-xs text-text-secondary",
112
- children: s("providers.insights.priceChanges", "Price changes")
112
+ children: o("providers.insights.priceChanges", "Price changes")
113
113
  }), /* @__PURE__ */ y("p", {
114
114
  className: "text-sm font-medium tabular-nums text-text-primary",
115
115
  children: A.priceChangeCount
116
116
  })] }),
117
117
  A.latestChangePercent != null && /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
118
118
  className: "text-xs text-text-secondary",
119
- children: s("providers.insights.latestChange", "Latest change")
119
+ children: o("providers.insights.latestChange", "Latest change")
120
120
  }), /* @__PURE__ */ b("span", {
121
- className: o("mt-0.5 inline-block rounded-full px-2 py-0.5 text-xs font-medium tabular-nums", C(A.latestChangePercent)),
122
- children: [w(A.latestChangePercent), A.latestChangeAt && ` · ${n(A.latestChangeAt)}`]
121
+ className: m("mt-0.5 inline-block rounded-full px-2 py-0.5 text-xs font-medium tabular-nums", C(A.latestChangePercent)),
122
+ children: [w(A.latestChangePercent), A.latestChangeAt && ` · ${d(A.latestChangeAt)}`]
123
123
  })] })
124
124
  ]
125
125
  }),
126
- O.length > 0 ? /* @__PURE__ */ y(f, {
126
+ O.length > 0 ? /* @__PURE__ */ y(l, {
127
127
  className: "mt-4",
128
128
  series: O,
129
129
  now: /* @__PURE__ */ new Date(),
130
- ariaLabel: s("providers.insights.chartLabel", "Monthly price paid over time, in {{currency}}", { currency: j }),
131
- valueFormat: (e, n) => t(e, j, {
132
- minimumFractionDigits: n,
133
- maximumFractionDigits: n
130
+ ariaLabel: o("providers.insights.chartLabel", "Monthly price paid over time, in {{currency}}", { currency: j }),
131
+ valueFormat: (e, t) => u(e, j, {
132
+ minimumFractionDigits: t,
133
+ maximumFractionDigits: t
134
134
  }),
135
- dateFormat: (e) => n(e, {
135
+ dateFormat: (e) => d(e, {
136
136
  day: void 0,
137
137
  month: "short",
138
138
  year: "numeric"
139
139
  })
140
140
  }) : /* @__PURE__ */ y("p", {
141
141
  className: "mt-4 text-sm text-text-secondary",
142
- children: s("providers.insights.noRecurring", "These prices are not recurring, so there is no monthly trend to chart.")
142
+ children: o("providers.insights.noRecurring", "These prices are not recurring, so there is no monthly trend to chart.")
143
143
  }),
144
144
  /* @__PURE__ */ y("ul", {
145
145
  className: "mt-4 divide-y divide-border-subtle border-t border-border-subtle",
@@ -150,27 +150,27 @@ function E({ providerId: r }) {
150
150
  children: [
151
151
  /* @__PURE__ */ y("span", {
152
152
  className: "w-24 shrink-0 tabular-nums text-text-secondary",
153
- children: n(e.observedAt)
153
+ children: d(e.observedAt)
154
154
  }),
155
155
  e.relationshipId ? /* @__PURE__ */ y("button", {
156
156
  type: "button",
157
- onClick: () => p(`/relationships/${e.relationshipId}`),
157
+ onClick: () => f(`/relationships/${e.relationshipId}`),
158
158
  className: "truncate text-text-link hover:underline",
159
- children: e.label ?? s("providers.insights.untitled", "Untitled")
159
+ children: e.label ?? o("providers.insights.untitled", "Untitled")
160
160
  }) : /* @__PURE__ */ y("span", {
161
161
  className: "truncate text-text-primary",
162
- children: e.label ?? s("providers.insights.removedRelationship", "Removed relationship")
162
+ children: e.label ?? o("providers.insights.removedRelationship", "Removed relationship")
163
163
  }),
164
164
  /* @__PURE__ */ y("span", {
165
165
  className: "rounded-full bg-bg-sunken px-2 py-0.5 text-[11px] text-text-secondary",
166
- children: e.source === "INVOICE" ? s("providers.insights.sourceInvoice", "Invoice") : s("providers.insights.sourceRecorded", "Recorded price")
166
+ children: e.source === "INVOICE" ? o("providers.insights.sourceInvoice", "Invoice") : o("providers.insights.sourceRecorded", "Recorded price")
167
167
  })
168
168
  ]
169
169
  }), /* @__PURE__ */ b("span", {
170
170
  className: "font-medium tabular-nums text-text-primary",
171
- children: [t(e.amount, e.currency), /* @__PURE__ */ y("span", {
171
+ children: [u(e.amount, e.currency), /* @__PURE__ */ y("span", {
172
172
  className: "text-xs font-normal text-text-secondary",
173
- children: i(e.interval)
173
+ children: p(e.interval)
174
174
  })]
175
175
  })]
176
176
  }, e.id))
@@ -180,11 +180,11 @@ function E({ providerId: r }) {
180
180
  });
181
181
  }
182
182
  function D({ range: e }) {
183
- let n = a();
183
+ let t = c(), n = e.minMonthlyAmount === e.maxMonthlyAmount ? u(e.minMonthlyAmount, e.currency) : `${u(e.minMonthlyAmount, e.currency)} – ${u(e.maxMonthlyAmount, e.currency)}`;
184
184
  return /* @__PURE__ */ b("span", {
185
185
  className: "tabular-nums",
186
186
  children: [
187
- e.minMonthlyAmount === e.maxMonthlyAmount ? t(e.minMonthlyAmount, e.currency) : `${t(e.minMonthlyAmount, e.currency)} – ${t(e.maxMonthlyAmount, e.currency)}`,
187
+ n,
188
188
  /* @__PURE__ */ y("span", {
189
189
  className: "text-xs text-text-secondary",
190
190
  children: "/mo"
@@ -192,13 +192,13 @@ function D({ range: e }) {
192
192
  " ",
193
193
  /* @__PURE__ */ y("span", {
194
194
  className: "text-xs text-text-secondary",
195
- children: e.basis === "PLANS" ? n("providers.insights.basisPlans", "({{count}} plans)", { count: e.count }) : n("providers.insights.basisRelationships", "(what you pay)")
195
+ children: e.basis === "PLANS" ? t("providers.insights.basisPlans", "({{count}} plans)", { count: e.count }) : t("providers.insights.basisRelationships", "(what you pay)")
196
196
  })
197
197
  ]
198
198
  });
199
199
  }
200
- function O({ alt: n }) {
201
- let c = a(), { navigateTo: l } = e(), u = n.priceRanges[0];
200
+ function O({ alt: e }) {
201
+ let t = c(), { navigateTo: n } = a(), r = e.priceRanges[0];
202
202
  return /* @__PURE__ */ b("li", {
203
203
  className: "py-4 first:pt-0 last:pb-0",
204
204
  "data-testid": "provider-alternative",
@@ -208,45 +208,45 @@ function O({ alt: n }) {
208
208
  className: "min-w-0",
209
209
  children: [/* @__PURE__ */ b("button", {
210
210
  type: "button",
211
- onClick: () => l(`/providers/${n.providerId}`),
211
+ onClick: () => n(`/providers/${e.providerId}`),
212
212
  className: "inline-flex items-center gap-1 text-sm font-semibold text-text-link hover:underline",
213
213
  children: [
214
- n.name,
214
+ e.name,
215
215
  " ",
216
216
  /* @__PURE__ */ y(g, { className: "h-3.5 w-3.5" })
217
217
  ]
218
218
  }), /* @__PURE__ */ b("div", {
219
219
  className: "mt-1 flex flex-wrap items-center gap-1.5",
220
220
  children: [
221
- n.provider && /* @__PURE__ */ y(s, { status: n.provider.status }),
221
+ e.provider && /* @__PURE__ */ y(i, { status: e.provider.status }),
222
222
  /* @__PURE__ */ y("span", {
223
223
  className: "rounded-full border border-border-subtle px-2 py-0.5 text-[11px] font-medium text-text-secondary",
224
- children: n.matchReason === "CAPABILITY" ? c("providers.insights.matchCapability", "Same capability") : c("providers.insights.matchCategory", "Same category")
224
+ children: e.matchReason === "CAPABILITY" ? t("providers.insights.matchCapability", "Same capability") : t("providers.insights.matchCategory", "Same category")
225
225
  }),
226
- n.capabilities.map((e) => /* @__PURE__ */ y("span", {
227
- className: o("rounded-full px-2 py-0.5 text-[11px]", n.sharedCapabilities.includes(e) ? "bg-[var(--color-accent-soft)] font-medium text-text-primary" : "bg-bg-sunken text-text-secondary"),
228
- children: r(e.replace(/-/g, "_"))
229
- }, e))
226
+ e.capabilities.map((t) => /* @__PURE__ */ y("span", {
227
+ className: m("rounded-full px-2 py-0.5 text-[11px]", e.sharedCapabilities.includes(t) ? "bg-[var(--color-accent-soft)] font-medium text-text-primary" : "bg-bg-sunken text-text-secondary"),
228
+ children: f(t.replace(/-/g, "_"))
229
+ }, t))
230
230
  ]
231
231
  })]
232
232
  }), /* @__PURE__ */ b("div", {
233
233
  className: "text-right text-sm text-text-primary",
234
- children: [u ? /* @__PURE__ */ y(D, { range: u }) : /* @__PURE__ */ y("span", {
234
+ children: [r ? /* @__PURE__ */ y(D, { range: r }) : /* @__PURE__ */ y("span", {
235
235
  className: "text-text-secondary",
236
- children: c("providers.insights.noPrice", "No price on record")
236
+ children: t("providers.insights.noPrice", "No price on record")
237
237
  }), /* @__PURE__ */ y("p", {
238
238
  className: "mt-0.5 text-xs text-text-secondary",
239
- children: n.activeRelationshipCount > 0 ? c("providers.insights.inUse", "In use · {{active}} of {{tracked}} active", {
240
- active: n.activeRelationshipCount,
241
- tracked: n.trackedRelationshipCount
242
- }) : n.trackedRelationshipCount > 0 ? c("providers.insights.trackedOnly", "{{tracked}} tracked, none active", { tracked: n.trackedRelationshipCount }) : c("providers.insights.notUsed", "Not used in this workspace")
239
+ children: e.activeRelationshipCount > 0 ? t("providers.insights.inUse", "In use · {{active}} of {{tracked}} active", {
240
+ active: e.activeRelationshipCount,
241
+ tracked: e.trackedRelationshipCount
242
+ }) : e.trackedRelationshipCount > 0 ? t("providers.insights.trackedOnly", "{{tracked}} tracked, none active", { tracked: e.trackedRelationshipCount }) : t("providers.insights.notUsed", "Not used in this workspace")
243
243
  })]
244
244
  })]
245
- }), n.relationships.length > 0 && /* @__PURE__ */ y("ul", {
245
+ }), e.relationships.length > 0 && /* @__PURE__ */ y("ul", {
246
246
  className: "mt-2 flex flex-wrap gap-2",
247
- children: n.relationships.map((e) => /* @__PURE__ */ y("li", { children: /* @__PURE__ */ b("button", {
247
+ children: e.relationships.map((e) => /* @__PURE__ */ y("li", { children: /* @__PURE__ */ b("button", {
248
248
  type: "button",
249
- onClick: () => l(`/relationships/${e.id}`),
249
+ onClick: () => n(`/relationships/${e.id}`),
250
250
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-2 py-1 text-xs text-text-primary hover:bg-bg-sunken",
251
251
  children: [
252
252
  /* @__PURE__ */ y("span", {
@@ -255,42 +255,41 @@ function O({ alt: n }) {
255
255
  }),
256
256
  /* @__PURE__ */ b("span", {
257
257
  className: "tabular-nums text-text-secondary",
258
- children: [t(e.amount, e.currency), i(e.interval)]
258
+ children: [u(e.amount, e.currency), p(e.interval)]
259
259
  }),
260
- /* @__PURE__ */ y(s, { status: e.status })
260
+ /* @__PURE__ */ y(i, { status: e.status })
261
261
  ]
262
262
  }) }, e.id))
263
263
  })]
264
264
  });
265
265
  }
266
266
  function k({ providerId: e }) {
267
- let t = a(), { data: n, isLoading: r, isError: i, refetch: o } = p(e);
268
- return /* @__PURE__ */ y(d, {
269
- title: t("providers.insights.alternativesTitle", "Alternatives"),
270
- description: t("providers.insights.alternativesDescription", "Providers in your registry that cover the same need, the ones you already use first"),
267
+ let i = c(), { data: a, isLoading: s, isError: l, refetch: u } = o(e);
268
+ return /* @__PURE__ */ y(r, {
269
+ title: i("providers.insights.alternativesTitle", "Alternatives"),
270
+ description: i("providers.insights.alternativesDescription", "Providers in your registry that cover the same need, the ones you already use first"),
271
271
  children: /* @__PURE__ */ y(x, {
272
272
  treatment: "metric",
273
273
  className: "p-5",
274
274
  "data-testid": "provider-alternatives",
275
- children: r ? /* @__PURE__ */ y(u, {
275
+ children: s ? /* @__PURE__ */ y(n, {
276
276
  className: "min-h-[8rem]",
277
- label: t("providers.insights.alternativesLoading", "Finding alternatives…")
278
- }) : i ? /* @__PURE__ */ y(l, {
277
+ label: i("providers.insights.alternativesLoading", "Finding alternatives…")
278
+ }) : l ? /* @__PURE__ */ y(t, {
279
279
  className: "min-h-[8rem]",
280
- title: t("providers.insights.alternativesErrorTitle", "Alternatives unavailable"),
281
- message: t("providers.insights.alternativesError", "Could not look up alternative providers."),
282
- onRetry: () => void o()
283
- }) : !n || n.length === 0 ? /* @__PURE__ */ b("div", {
280
+ title: i("providers.insights.alternativesErrorTitle", "Alternatives unavailable"),
281
+ message: i("providers.insights.alternativesError", "Could not look up alternative providers."),
282
+ onRetry: () => void u()
283
+ }) : !a || a.length === 0 ? /* @__PURE__ */ b("div", {
284
284
  className: "flex items-start gap-3 text-sm text-text-secondary",
285
- children: [/* @__PURE__ */ y(_, { className: "mt-0.5 h-4 w-4 shrink-0" }), /* @__PURE__ */ y("p", { children: t("providers.insights.alternativesEmpty", "No comparable providers yet. Tag providers with capabilities (for example capability:design) or give them a specific category to see alternatives here.") })]
285
+ children: [/* @__PURE__ */ y(_, { className: "mt-0.5 h-4 w-4 shrink-0" }), /* @__PURE__ */ y("p", { children: i("providers.insights.alternativesEmpty", "No comparable providers yet. Tag providers with capabilities (for example capability:design) or give them a specific category to see alternatives here.") })]
286
286
  }) : /* @__PURE__ */ y("ul", {
287
287
  className: "divide-y divide-border-subtle",
288
- children: n.map((e) => /* @__PURE__ */ y(O, { alt: e }, e.providerId))
288
+ children: a.map((e) => /* @__PURE__ */ y(O, { alt: e }, e.providerId))
289
289
  })
290
290
  })
291
291
  });
292
292
  }
293
- //#endregion
294
293
  export { k as ProviderAlternatives, E as ProviderPaidPriceHistory };
295
294
 
296
295
  //# sourceMappingURL=ProviderInsights.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProviderInsights.js","names":[],"sources":["../../../../src/subscriberbot/pages/providers/ProviderInsights.tsx"],"sourcesContent":["/**\n * Provider insights for the provider detail page (BOFF-4003)\n * @module subscriberbot/pages/providers\n *\n * Two sections that turn the provider page into a renewal decision surface:\n *\n * - `ProviderPaidPriceHistory` charts what this workspace has paid the\n * provider over time (`subProviderPriceHistory`): every recorded price of a\n * relationship with it, plus the invoices charged against them.\n * - `ProviderAlternatives` lists registry providers that could replace it\n * (`subProviderAlternatives`), ranked by shared capability tags, then\n * category, with providers the workspace already uses first.\n *\n * Amounts in different currencies are never drawn on one chart: the chart\n * shows the currency the backend summary picked (the most observed one).\n */\n\nimport { useMemo } from 'react';\nimport { ArrowRight, Shuffle } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView, Section } from '../../components/StateViews';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { PriceHistoryChart, type PriceChartSeries } from '../../components';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useProviderAlternatives, useProviderPriceHistory } from '../../hooks/useSubscriberBotApi';\nimport { useTr } from '../../hooks/useTr';\nimport {\n formatCurrency,\n formatDate,\n formatEnumLabel,\n formatIntervalSuffix,\n} from '../../utils/formatters';\nimport { cn } from '../../utils/cn';\nimport type {\n SubPriceRange,\n SubProviderAlternative,\n SubProviderPriceHistory,\n SubProviderPriceSeries,\n} from '../../types';\n\n/** Points listed under the chart, newest first. */\nconst RECENT_POINTS = 6;\n\nfunction changeTone(percent: number | null): string {\n if (percent === null || percent === 0) return 'bg-bg-sunken text-text-secondary';\n return percent > 0\n ? 'bg-status-error-bg-subtle text-status-error-text'\n : 'bg-status-success-bg-subtle text-status-success-text';\n}\n\nfunction formatPercent(percent: number): string {\n return `${percent > 0 ? '+' : ''}${percent}%`;\n}\n\nfunction chartSeries(\n history: SubProviderPriceHistory,\n tr: ReturnType<typeof useTr>\n): PriceChartSeries[] {\n const currency = history.summary?.currency;\n if (!currency) return [];\n // A relationship's recorded prices are split per currency. When it moved to\n // another currency, that later price ends the displayed segment, exactly\n // like a non-recurring price does: the old currency's line must not run on.\n const otherCurrencyTimes = new Map<string, string[]>();\n for (const s of history.series) {\n if (s.source !== 'RELATIONSHIP' || s.currency === currency || !s.relationshipId) continue;\n const list = otherCurrencyTimes.get(s.relationshipId) ?? [];\n list.push(...s.points.map((p) => p.observedAt));\n otherCurrencyTimes.set(s.relationshipId, list);\n }\n return history.series\n .filter((s) => s.currency === currency)\n .map((s) => {\n // Recorded prices keep their non-recurring points (null value) so the\n // step line ends where a lifetime or usage-based price took over;\n // invoice dots without a monthly equivalent are simply not drawn.\n const points: PriceChartSeries['points'] = s.points\n .filter((p) => s.source !== 'INVOICE' || p.monthlyAmount !== null)\n .map((p) => ({\n at: p.observedAt,\n value: p.monthlyAmount,\n title: `${formatDate(p.observedAt)} · ${formatCurrency(p.amount, p.currency)}${formatIntervalSuffix(p.interval)}`,\n }));\n if (s.source === 'RELATIONSHIP' && s.relationshipId) {\n for (const at of otherCurrencyTimes.get(s.relationshipId) ?? []) {\n points.push({ at, value: null });\n }\n }\n return {\n key: s.key,\n label:\n s.source === 'INVOICE'\n ? tr('providers.insights.invoiceSeries', '{{label}} (invoices)', {\n label: s.label.replace(/ \\(invoices\\)$/, ''),\n })\n : s.label,\n mode: s.source === 'INVOICE' ? ('dots' as const) : ('step' as const),\n points,\n };\n })\n .filter((s) => s.points.some((p) => p.value !== null));\n}\n\n// ---------------------------------------------------------------------------\n// Price history — what this workspace has paid the provider\n// ---------------------------------------------------------------------------\nexport function ProviderPaidPriceHistory({ providerId }: { providerId: string }) {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const { data, isLoading, isError, refetch } = useProviderPriceHistory(providerId);\n\n const series = useMemo(() => (data ? chartSeries(data, tr) : []), [data, tr]);\n const recent = useMemo(\n () => (data ? [...data.points].reverse().slice(0, RECENT_POINTS) : []),\n [data]\n );\n const summary = data?.summary ?? null;\n const currency = summary?.currency ?? 'USD';\n // Every relationship tracked under this provider contributes its latest\n // recorded price, so the headline is the workspace's total per month rather\n // than whichever relationship happens to come first.\n const latestTotal = useMemo(() => {\n // Each relationship's current price is its latest recorded point across\n // every currency; only those now priced in the display currency count.\n const latestByRelationship = new Map<string, { at: string; series: SubProviderPriceSeries }>();\n for (const s of data?.series ?? []) {\n const last = s.points[s.points.length - 1];\n if (s.source !== 'RELATIONSHIP' || !last) continue;\n const key = s.relationshipId ?? s.key;\n const seen = latestByRelationship.get(key);\n if (!seen || Date.parse(last.observedAt) > Date.parse(seen.at))\n latestByRelationship.set(key, { at: last.observedAt, series: s });\n }\n const recorded = [...latestByRelationship.values()]\n .map((v) => v.series)\n .filter((s) => s.currency === currency && s.latestMonthlyAmount != null);\n if (recorded.length === 0) return null;\n const amount = recorded.reduce((sum, s) => sum + (s.latestMonthlyAmount ?? 0), 0);\n return { amount: Math.round(amount * 100) / 100, count: recorded.length };\n }, [data, currency]);\n\n return (\n <Section\n title={tr('providers.insights.priceHistoryTitle', 'Your price history')}\n description={tr(\n 'providers.insights.priceHistoryDescription',\n 'What this workspace has paid this provider over time, per month'\n )}\n >\n <GlassCard treatment=\"metric\" className=\"p-5\" data-testid=\"provider-price-history\">\n {isLoading ? (\n <LoadingView\n className=\"min-h-[10rem]\"\n label={tr('providers.insights.priceHistoryLoading', 'Loading price history…')}\n />\n ) : isError ? (\n <ErrorView\n className=\"min-h-[10rem]\"\n title={tr('providers.insights.priceHistoryErrorTitle', 'Price history unavailable')}\n message={tr(\n 'providers.insights.priceHistoryError',\n 'Could not load what this workspace has paid this provider.'\n )}\n onRetry={() => void refetch()}\n />\n ) : !data || !summary ? (\n <EmptyState\n illustration=\"empty-data\"\n title={tr('providers.insights.priceHistoryEmptyTitle', 'No prices recorded yet')}\n description={tr(\n 'providers.insights.priceHistoryEmpty',\n 'Link a relationship to this provider and its price, and every later change, will be charted here.'\n )}\n />\n ) : (\n <>\n <div className=\"flex flex-wrap items-start gap-x-8 gap-y-3\">\n <div>\n <p className=\"text-xs text-text-secondary\">\n {latestTotal && latestTotal.count > 1\n ? tr(\n 'providers.insights.latestMonthlyTotal',\n 'Latest monthly price across {{count}} relationships',\n { count: latestTotal.count }\n )\n : tr('providers.insights.latestMonthly', 'Latest monthly price')}\n </p>\n <p className=\"text-2xl font-bold tabular-nums text-text-primary\">\n {latestTotal ? formatCurrency(latestTotal.amount, currency) : '—'}\n <span className=\"text-sm font-normal text-text-secondary\">/mo</span>\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.range', 'Range paid')}\n </p>\n <p className=\"text-sm font-medium tabular-nums text-text-primary\">\n {summary.minMonthlyAmount != null && summary.maxMonthlyAmount != null\n ? `${formatCurrency(summary.minMonthlyAmount, currency)} – ${formatCurrency(summary.maxMonthlyAmount, currency)}`\n : '—'}\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.priceChanges', 'Price changes')}\n </p>\n <p className=\"text-sm font-medium tabular-nums text-text-primary\">\n {summary.priceChangeCount}\n </p>\n </div>\n {summary.latestChangePercent != null && (\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.latestChange', 'Latest change')}\n </p>\n <span\n className={cn(\n 'mt-0.5 inline-block rounded-full px-2 py-0.5 text-xs font-medium tabular-nums',\n changeTone(summary.latestChangePercent)\n )}\n >\n {formatPercent(summary.latestChangePercent)}\n {summary.latestChangeAt && ` · ${formatDate(summary.latestChangeAt)}`}\n </span>\n </div>\n )}\n </div>\n\n {series.length > 0 ? (\n <PriceHistoryChart\n className=\"mt-4\"\n series={series}\n now={new Date()}\n ariaLabel={tr(\n 'providers.insights.chartLabel',\n 'Monthly price paid over time, in {{currency}}',\n { currency }\n )}\n valueFormat={(n, digits) =>\n formatCurrency(n, currency, {\n minimumFractionDigits: digits,\n maximumFractionDigits: digits,\n })\n }\n dateFormat={(d) =>\n formatDate(d, { day: undefined, month: 'short', year: 'numeric' })\n }\n />\n ) : (\n <p className=\"mt-4 text-sm text-text-secondary\">\n {tr(\n 'providers.insights.noRecurring',\n 'These prices are not recurring, so there is no monthly trend to chart.'\n )}\n </p>\n )}\n\n <ul className=\"mt-4 divide-y divide-border-subtle border-t border-border-subtle\">\n {recent.map((point) => (\n <li\n key={point.id}\n className=\"flex flex-wrap items-center justify-between gap-2 py-2 text-sm\"\n >\n <span className=\"flex min-w-0 items-center gap-2\">\n <span className=\"w-24 shrink-0 tabular-nums text-text-secondary\">\n {formatDate(point.observedAt)}\n </span>\n {point.relationshipId ? (\n <button\n type=\"button\"\n onClick={() => navigateTo(`/relationships/${point.relationshipId}`)}\n className=\"truncate text-text-link hover:underline\"\n >\n {point.label ?? tr('providers.insights.untitled', 'Untitled')}\n </button>\n ) : (\n <span className=\"truncate text-text-primary\">\n {point.label ??\n tr('providers.insights.removedRelationship', 'Removed relationship')}\n </span>\n )}\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-[11px] text-text-secondary\">\n {point.source === 'INVOICE'\n ? tr('providers.insights.sourceInvoice', 'Invoice')\n : tr('providers.insights.sourceRecorded', 'Recorded price')}\n </span>\n </span>\n <span className=\"font-medium tabular-nums text-text-primary\">\n {formatCurrency(point.amount, point.currency)}\n <span className=\"text-xs font-normal text-text-secondary\">\n {formatIntervalSuffix(point.interval)}\n </span>\n </span>\n </li>\n ))}\n </ul>\n </>\n )}\n </GlassCard>\n </Section>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Alternatives — registry providers that could replace this one\n// ---------------------------------------------------------------------------\nfunction PriceRangeText({ range }: { range: SubPriceRange }) {\n const tr = useTr();\n const value =\n range.minMonthlyAmount === range.maxMonthlyAmount\n ? formatCurrency(range.minMonthlyAmount, range.currency)\n : `${formatCurrency(range.minMonthlyAmount, range.currency)} – ${formatCurrency(range.maxMonthlyAmount, range.currency)}`;\n return (\n <span className=\"tabular-nums\">\n {value}\n <span className=\"text-xs text-text-secondary\">/mo</span>{' '}\n <span className=\"text-xs text-text-secondary\">\n {range.basis === 'PLANS'\n ? tr('providers.insights.basisPlans', '({{count}} plans)', { count: range.count })\n : tr('providers.insights.basisRelationships', '(what you pay)')}\n </span>\n </span>\n );\n}\n\nfunction AlternativeRow({ alt }: { alt: SubProviderAlternative }) {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const range = alt.priceRanges[0];\n return (\n <li className=\"py-4 first:pt-0 last:pb-0\" data-testid=\"provider-alternative\">\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/providers/${alt.providerId}`)}\n className=\"inline-flex items-center gap-1 text-sm font-semibold text-text-link hover:underline\"\n >\n {alt.name} <ArrowRight className=\"h-3.5 w-3.5\" />\n </button>\n <div className=\"mt-1 flex flex-wrap items-center gap-1.5\">\n {alt.provider && <StatusBadge status={alt.provider.status} />}\n <span className=\"rounded-full border border-border-subtle px-2 py-0.5 text-[11px] font-medium text-text-secondary\">\n {alt.matchReason === 'CAPABILITY'\n ? tr('providers.insights.matchCapability', 'Same capability')\n : tr('providers.insights.matchCategory', 'Same category')}\n </span>\n {alt.capabilities.map((cap) => (\n <span\n key={cap}\n className={cn(\n 'rounded-full px-2 py-0.5 text-[11px]',\n alt.sharedCapabilities.includes(cap)\n ? 'bg-[var(--color-accent-soft)] font-medium text-text-primary'\n : 'bg-bg-sunken text-text-secondary'\n )}\n >\n {formatEnumLabel(cap.replace(/-/g, '_'))}\n </span>\n ))}\n </div>\n </div>\n <div className=\"text-right text-sm text-text-primary\">\n {range ? (\n <PriceRangeText range={range} />\n ) : (\n <span className=\"text-text-secondary\">\n {tr('providers.insights.noPrice', 'No price on record')}\n </span>\n )}\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {alt.activeRelationshipCount > 0\n ? tr('providers.insights.inUse', 'In use · {{active}} of {{tracked}} active', {\n active: alt.activeRelationshipCount,\n tracked: alt.trackedRelationshipCount,\n })\n : alt.trackedRelationshipCount > 0\n ? tr('providers.insights.trackedOnly', '{{tracked}} tracked, none active', {\n tracked: alt.trackedRelationshipCount,\n })\n : tr('providers.insights.notUsed', 'Not used in this workspace')}\n </p>\n </div>\n </div>\n {alt.relationships.length > 0 && (\n <ul className=\"mt-2 flex flex-wrap gap-2\">\n {alt.relationships.map((rel) => (\n <li key={rel.id}>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/relationships/${rel.id}`)}\n className=\"inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-2 py-1 text-xs text-text-primary hover:bg-bg-sunken\"\n >\n <span className=\"truncate\">{rel.label}</span>\n <span className=\"tabular-nums text-text-secondary\">\n {formatCurrency(rel.amount, rel.currency)}\n {formatIntervalSuffix(rel.interval)}\n </span>\n <StatusBadge status={rel.status} />\n </button>\n </li>\n ))}\n </ul>\n )}\n </li>\n );\n}\n\nexport function ProviderAlternatives({ providerId }: { providerId: string }) {\n const tr = useTr();\n const { data, isLoading, isError, refetch } = useProviderAlternatives(providerId);\n\n return (\n <Section\n title={tr('providers.insights.alternativesTitle', 'Alternatives')}\n description={tr(\n 'providers.insights.alternativesDescription',\n 'Providers in your registry that cover the same need, the ones you already use first'\n )}\n >\n <GlassCard treatment=\"metric\" className=\"p-5\" data-testid=\"provider-alternatives\">\n {isLoading ? (\n <LoadingView\n className=\"min-h-[8rem]\"\n label={tr('providers.insights.alternativesLoading', 'Finding alternatives…')}\n />\n ) : isError ? (\n <ErrorView\n className=\"min-h-[8rem]\"\n title={tr('providers.insights.alternativesErrorTitle', 'Alternatives unavailable')}\n message={tr(\n 'providers.insights.alternativesError',\n 'Could not look up alternative providers.'\n )}\n onRetry={() => void refetch()}\n />\n ) : !data || data.length === 0 ? (\n <div className=\"flex items-start gap-3 text-sm text-text-secondary\">\n <Shuffle className=\"mt-0.5 h-4 w-4 shrink-0\" />\n <p>\n {tr(\n 'providers.insights.alternativesEmpty',\n 'No comparable providers yet. Tag providers with capabilities (for example capability:design) or give them a specific category to see alternatives here.'\n )}\n </p>\n </div>\n ) : (\n <ul className=\"divide-y divide-border-subtle\">\n {data.map((alt) => (\n <AlternativeRow key={alt.providerId} alt={alt} />\n ))}\n </ul>\n )}\n </GlassCard>\n </Section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA0CA,IAAM,IAAgB;AAEtB,SAAS,EAAW,GAAgC;CAElD,OADI,MAAY,QAAQ,MAAY,IAAU,qCACvC,IAAU,IACb,qDACA;AACN;AAEA,SAAS,EAAc,GAAyB;CAC9C,OAAO,GAAG,IAAU,IAAI,MAAM,KAAK,EAAQ;AAC7C;AAEA,SAAS,EACP,GACA,GACoB;CACpB,IAAM,IAAW,EAAQ,SAAS;CAClC,IAAI,CAAC,GAAU,OAAO,CAAC;CAIvB,IAAM,oBAAqB,IAAI,IAAsB;CACrD,KAAK,IAAM,KAAK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M,eAAY;aACvD,IACC,kBAAC,GAAD;IACE,WAAU;IACV,OAAO,EAAG,0CAA0C,uBAAuB;GAC5E,CAAA,IACC,IACF,kBAAC,GAAD;IACE,WAAU;IACV,OAAO,EAAG,6CAA6C,0BAA0B;IACjF,SAAS,EACP,wCACA,0CACF;IACA,eAAe,KAAK,EAAQ;GAC7B,CAAA,IACC,CAAC,KAAQ,EAAK,WAAW,IAC3B,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD,EAAS,WAAU,0BAA2B,CAAA,GAC9C,kBAAC,KAAD,EAAA,UACG,EACC,wCACA,yJACF,EACC,CAAA,CACA;QAEL,kBAAC,MAAD;IAAI,WAAU;cACX,EAAK,KAAK,MACT,kBAAC,GAAD,EAA0C,OAAM,GAA3B,EAAI,UAAuB,CACjD;GACC,CAAA;EAEG,CAAA;CACJ,CAAA;AAEb"}
1
+ {"version":3,"file":"ProviderInsights.js","names":["EmptyState","_Fragment","EmptyState$1","Fragment$1","RECENT_POINTS","changeTone","percent","formatPercent","chartSeries","currency","history","otherCurrencyTimes","s","list","p","points","formatDate","formatCurrency","formatIntervalSuffix","at","tr","ProviderPaidPriceHistory","useTr","useSubscriberBot","useProviderPriceHistory","providerId","series","useMemo","data","recent","summary","latestTotal","latestByRelationship","last","key","seen","recorded","v","amount","sum","Section","GlassCard","isLoading","LoadingView","isError","ErrorView","refetch","cn","PriceHistoryChart","n","digits","d","point","navigateTo","PriceRangeText","value","range","AlternativeRow","alt","ArrowRight","StatusBadge","cap","formatEnumLabel","rel","ProviderAlternatives","useProviderAlternatives","Shuffle"],"sources":["../../../../src/subscriberbot/pages/providers/ProviderInsights.tsx"],"sourcesContent":["/**\n * Provider insights for the provider detail page (BOFF-4003)\n * @module subscriberbot/pages/providers\n *\n * Two sections that turn the provider page into a renewal decision surface:\n *\n * - `ProviderPaidPriceHistory` charts what this workspace has paid the\n * provider over time (`subProviderPriceHistory`): every recorded price of a\n * relationship with it, plus the invoices charged against them.\n * - `ProviderAlternatives` lists registry providers that could replace it\n * (`subProviderAlternatives`), ranked by shared capability tags, then\n * category, with providers the workspace already uses first.\n *\n * Amounts in different currencies are never drawn on one chart: the chart\n * shows the currency the backend summary picked (the most observed one).\n */\n\nimport { useMemo } from 'react';\nimport { ArrowRight, Shuffle } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView, Section } from '../../components/StateViews';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { PriceHistoryChart, type PriceChartSeries } from '../../components';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useProviderAlternatives, useProviderPriceHistory } from '../../hooks/useSubscriberBotApi';\nimport { useTr } from '../../hooks/useTr';\nimport {\n formatCurrency,\n formatDate,\n formatEnumLabel,\n formatIntervalSuffix,\n} from '../../utils/formatters';\nimport { cn } from '../../utils/cn';\nimport type {\n SubPriceRange,\n SubProviderAlternative,\n SubProviderPriceHistory,\n SubProviderPriceSeries,\n} from '../../types';\n\n/** Points listed under the chart, newest first. */\nconst RECENT_POINTS = 6;\n\nfunction changeTone(percent: number | null): string {\n if (percent === null || percent === 0) return 'bg-bg-sunken text-text-secondary';\n return percent > 0\n ? 'bg-status-error-bg-subtle text-status-error-text'\n : 'bg-status-success-bg-subtle text-status-success-text';\n}\n\nfunction formatPercent(percent: number): string {\n return `${percent > 0 ? '+' : ''}${percent}%`;\n}\n\nfunction chartSeries(\n history: SubProviderPriceHistory,\n tr: ReturnType<typeof useTr>\n): PriceChartSeries[] {\n const currency = history.summary?.currency;\n if (!currency) return [];\n // A relationship's recorded prices are split per currency. When it moved to\n // another currency, that later price ends the displayed segment, exactly\n // like a non-recurring price does: the old currency's line must not run on.\n const otherCurrencyTimes = new Map<string, string[]>();\n for (const s of history.series) {\n if (s.source !== 'RELATIONSHIP' || s.currency === currency || !s.relationshipId) continue;\n const list = otherCurrencyTimes.get(s.relationshipId) ?? [];\n list.push(...s.points.map((p) => p.observedAt));\n otherCurrencyTimes.set(s.relationshipId, list);\n }\n return history.series\n .filter((s) => s.currency === currency)\n .map((s) => {\n // Recorded prices keep their non-recurring points (null value) so the\n // step line ends where a lifetime or usage-based price took over;\n // invoice dots without a monthly equivalent are simply not drawn.\n const points: PriceChartSeries['points'] = s.points\n .filter((p) => s.source !== 'INVOICE' || p.monthlyAmount !== null)\n .map((p) => ({\n at: p.observedAt,\n value: p.monthlyAmount,\n title: `${formatDate(p.observedAt)} · ${formatCurrency(p.amount, p.currency)}${formatIntervalSuffix(p.interval)}`,\n }));\n if (s.source === 'RELATIONSHIP' && s.relationshipId) {\n for (const at of otherCurrencyTimes.get(s.relationshipId) ?? []) {\n points.push({ at, value: null });\n }\n }\n return {\n key: s.key,\n label:\n s.source === 'INVOICE'\n ? tr('providers.insights.invoiceSeries', '{{label}} (invoices)', {\n label: s.label.replace(/ \\(invoices\\)$/, ''),\n })\n : s.label,\n mode: s.source === 'INVOICE' ? ('dots' as const) : ('step' as const),\n points,\n };\n })\n .filter((s) => s.points.some((p) => p.value !== null));\n}\n\n// ---------------------------------------------------------------------------\n// Price history — what this workspace has paid the provider\n// ---------------------------------------------------------------------------\nexport function ProviderPaidPriceHistory({ providerId }: { providerId: string }) {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const { data, isLoading, isError, refetch } = useProviderPriceHistory(providerId);\n\n const series = useMemo(() => (data ? chartSeries(data, tr) : []), [data, tr]);\n const recent = useMemo(\n () => (data ? [...data.points].reverse().slice(0, RECENT_POINTS) : []),\n [data]\n );\n const summary = data?.summary ?? null;\n const currency = summary?.currency ?? 'USD';\n // Every relationship tracked under this provider contributes its latest\n // recorded price, so the headline is the workspace's total per month rather\n // than whichever relationship happens to come first.\n const latestTotal = useMemo(() => {\n // Each relationship's current price is its latest recorded point across\n // every currency; only those now priced in the display currency count.\n const latestByRelationship = new Map<string, { at: string; series: SubProviderPriceSeries }>();\n for (const s of data?.series ?? []) {\n const last = s.points[s.points.length - 1];\n if (s.source !== 'RELATIONSHIP' || !last) continue;\n const key = s.relationshipId ?? s.key;\n const seen = latestByRelationship.get(key);\n if (!seen || Date.parse(last.observedAt) > Date.parse(seen.at))\n latestByRelationship.set(key, { at: last.observedAt, series: s });\n }\n const recorded = [...latestByRelationship.values()]\n .map((v) => v.series)\n .filter((s) => s.currency === currency && s.latestMonthlyAmount != null);\n if (recorded.length === 0) return null;\n const amount = recorded.reduce((sum, s) => sum + (s.latestMonthlyAmount ?? 0), 0);\n return { amount: Math.round(amount * 100) / 100, count: recorded.length };\n }, [data, currency]);\n\n return (\n <Section\n title={tr('providers.insights.priceHistoryTitle', 'Your price history')}\n description={tr(\n 'providers.insights.priceHistoryDescription',\n 'What this workspace has paid this provider over time, per month'\n )}\n >\n <GlassCard treatment=\"metric\" className=\"p-5\" data-testid=\"provider-price-history\">\n {isLoading ? (\n <LoadingView\n className=\"min-h-[10rem]\"\n label={tr('providers.insights.priceHistoryLoading', 'Loading price history…')}\n />\n ) : isError ? (\n <ErrorView\n className=\"min-h-[10rem]\"\n title={tr('providers.insights.priceHistoryErrorTitle', 'Price history unavailable')}\n message={tr(\n 'providers.insights.priceHistoryError',\n 'Could not load what this workspace has paid this provider.'\n )}\n onRetry={() => void refetch()}\n />\n ) : !data || !summary ? (\n <EmptyState\n illustration=\"empty-data\"\n title={tr('providers.insights.priceHistoryEmptyTitle', 'No prices recorded yet')}\n description={tr(\n 'providers.insights.priceHistoryEmpty',\n 'Link a relationship to this provider and its price, and every later change, will be charted here.'\n )}\n />\n ) : (\n <>\n <div className=\"flex flex-wrap items-start gap-x-8 gap-y-3\">\n <div>\n <p className=\"text-xs text-text-secondary\">\n {latestTotal && latestTotal.count > 1\n ? tr(\n 'providers.insights.latestMonthlyTotal',\n 'Latest monthly price across {{count}} relationships',\n { count: latestTotal.count }\n )\n : tr('providers.insights.latestMonthly', 'Latest monthly price')}\n </p>\n <p className=\"text-2xl font-bold tabular-nums text-text-primary\">\n {latestTotal ? formatCurrency(latestTotal.amount, currency) : '—'}\n <span className=\"text-sm font-normal text-text-secondary\">/mo</span>\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.range', 'Range paid')}\n </p>\n <p className=\"text-sm font-medium tabular-nums text-text-primary\">\n {summary.minMonthlyAmount != null && summary.maxMonthlyAmount != null\n ? `${formatCurrency(summary.minMonthlyAmount, currency)} – ${formatCurrency(summary.maxMonthlyAmount, currency)}`\n : '—'}\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.priceChanges', 'Price changes')}\n </p>\n <p className=\"text-sm font-medium tabular-nums text-text-primary\">\n {summary.priceChangeCount}\n </p>\n </div>\n {summary.latestChangePercent != null && (\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.latestChange', 'Latest change')}\n </p>\n <span\n className={cn(\n 'mt-0.5 inline-block rounded-full px-2 py-0.5 text-xs font-medium tabular-nums',\n changeTone(summary.latestChangePercent)\n )}\n >\n {formatPercent(summary.latestChangePercent)}\n {summary.latestChangeAt && ` · ${formatDate(summary.latestChangeAt)}`}\n </span>\n </div>\n )}\n </div>\n\n {series.length > 0 ? (\n <PriceHistoryChart\n className=\"mt-4\"\n series={series}\n now={new Date()}\n ariaLabel={tr(\n 'providers.insights.chartLabel',\n 'Monthly price paid over time, in {{currency}}',\n { currency }\n )}\n valueFormat={(n, digits) =>\n formatCurrency(n, currency, {\n minimumFractionDigits: digits,\n maximumFractionDigits: digits,\n })\n }\n dateFormat={(d) =>\n formatDate(d, { day: undefined, month: 'short', year: 'numeric' })\n }\n />\n ) : (\n <p className=\"mt-4 text-sm text-text-secondary\">\n {tr(\n 'providers.insights.noRecurring',\n 'These prices are not recurring, so there is no monthly trend to chart.'\n )}\n </p>\n )}\n\n <ul className=\"mt-4 divide-y divide-border-subtle border-t border-border-subtle\">\n {recent.map((point) => (\n <li\n key={point.id}\n className=\"flex flex-wrap items-center justify-between gap-2 py-2 text-sm\"\n >\n <span className=\"flex min-w-0 items-center gap-2\">\n <span className=\"w-24 shrink-0 tabular-nums text-text-secondary\">\n {formatDate(point.observedAt)}\n </span>\n {point.relationshipId ? (\n <button\n type=\"button\"\n onClick={() => navigateTo(`/relationships/${point.relationshipId}`)}\n className=\"truncate text-text-link hover:underline\"\n >\n {point.label ?? tr('providers.insights.untitled', 'Untitled')}\n </button>\n ) : (\n <span className=\"truncate text-text-primary\">\n {point.label ??\n tr('providers.insights.removedRelationship', 'Removed relationship')}\n </span>\n )}\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-[11px] text-text-secondary\">\n {point.source === 'INVOICE'\n ? tr('providers.insights.sourceInvoice', 'Invoice')\n : tr('providers.insights.sourceRecorded', 'Recorded price')}\n </span>\n </span>\n <span className=\"font-medium tabular-nums text-text-primary\">\n {formatCurrency(point.amount, point.currency)}\n <span className=\"text-xs font-normal text-text-secondary\">\n {formatIntervalSuffix(point.interval)}\n </span>\n </span>\n </li>\n ))}\n </ul>\n </>\n )}\n </GlassCard>\n </Section>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Alternatives — registry providers that could replace this one\n// ---------------------------------------------------------------------------\nfunction PriceRangeText({ range }: { range: SubPriceRange }) {\n const tr = useTr();\n const value =\n range.minMonthlyAmount === range.maxMonthlyAmount\n ? formatCurrency(range.minMonthlyAmount, range.currency)\n : `${formatCurrency(range.minMonthlyAmount, range.currency)} – ${formatCurrency(range.maxMonthlyAmount, range.currency)}`;\n return (\n <span className=\"tabular-nums\">\n {value}\n <span className=\"text-xs text-text-secondary\">/mo</span>{' '}\n <span className=\"text-xs text-text-secondary\">\n {range.basis === 'PLANS'\n ? tr('providers.insights.basisPlans', '({{count}} plans)', { count: range.count })\n : tr('providers.insights.basisRelationships', '(what you pay)')}\n </span>\n </span>\n );\n}\n\nfunction AlternativeRow({ alt }: { alt: SubProviderAlternative }) {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const range = alt.priceRanges[0];\n return (\n <li className=\"py-4 first:pt-0 last:pb-0\" data-testid=\"provider-alternative\">\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/providers/${alt.providerId}`)}\n className=\"inline-flex items-center gap-1 text-sm font-semibold text-text-link hover:underline\"\n >\n {alt.name} <ArrowRight className=\"h-3.5 w-3.5\" />\n </button>\n <div className=\"mt-1 flex flex-wrap items-center gap-1.5\">\n {alt.provider && <StatusBadge status={alt.provider.status} />}\n <span className=\"rounded-full border border-border-subtle px-2 py-0.5 text-[11px] font-medium text-text-secondary\">\n {alt.matchReason === 'CAPABILITY'\n ? tr('providers.insights.matchCapability', 'Same capability')\n : tr('providers.insights.matchCategory', 'Same category')}\n </span>\n {alt.capabilities.map((cap) => (\n <span\n key={cap}\n className={cn(\n 'rounded-full px-2 py-0.5 text-[11px]',\n alt.sharedCapabilities.includes(cap)\n ? 'bg-[var(--color-accent-soft)] font-medium text-text-primary'\n : 'bg-bg-sunken text-text-secondary'\n )}\n >\n {formatEnumLabel(cap.replace(/-/g, '_'))}\n </span>\n ))}\n </div>\n </div>\n <div className=\"text-right text-sm text-text-primary\">\n {range ? (\n <PriceRangeText range={range} />\n ) : (\n <span className=\"text-text-secondary\">\n {tr('providers.insights.noPrice', 'No price on record')}\n </span>\n )}\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {alt.activeRelationshipCount > 0\n ? tr('providers.insights.inUse', 'In use · {{active}} of {{tracked}} active', {\n active: alt.activeRelationshipCount,\n tracked: alt.trackedRelationshipCount,\n })\n : alt.trackedRelationshipCount > 0\n ? tr('providers.insights.trackedOnly', '{{tracked}} tracked, none active', {\n tracked: alt.trackedRelationshipCount,\n })\n : tr('providers.insights.notUsed', 'Not used in this workspace')}\n </p>\n </div>\n </div>\n {alt.relationships.length > 0 && (\n <ul className=\"mt-2 flex flex-wrap gap-2\">\n {alt.relationships.map((rel) => (\n <li key={rel.id}>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/relationships/${rel.id}`)}\n className=\"inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-2 py-1 text-xs text-text-primary hover:bg-bg-sunken\"\n >\n <span className=\"truncate\">{rel.label}</span>\n <span className=\"tabular-nums text-text-secondary\">\n {formatCurrency(rel.amount, rel.currency)}\n {formatIntervalSuffix(rel.interval)}\n </span>\n <StatusBadge status={rel.status} />\n </button>\n </li>\n ))}\n </ul>\n )}\n </li>\n );\n}\n\nexport function ProviderAlternatives({ providerId }: { providerId: string }) {\n const tr = useTr();\n const { data, isLoading, isError, refetch } = useProviderAlternatives(providerId);\n\n return (\n <Section\n title={tr('providers.insights.alternativesTitle', 'Alternatives')}\n description={tr(\n 'providers.insights.alternativesDescription',\n 'Providers in your registry that cover the same need, the ones you already use first'\n )}\n >\n <GlassCard treatment=\"metric\" className=\"p-5\" data-testid=\"provider-alternatives\">\n {isLoading ? (\n <LoadingView\n className=\"min-h-[8rem]\"\n label={tr('providers.insights.alternativesLoading', 'Finding alternatives…')}\n />\n ) : isError ? (\n <ErrorView\n className=\"min-h-[8rem]\"\n title={tr('providers.insights.alternativesErrorTitle', 'Alternatives unavailable')}\n message={tr(\n 'providers.insights.alternativesError',\n 'Could not look up alternative providers.'\n )}\n onRetry={() => void refetch()}\n />\n ) : !data || data.length === 0 ? (\n <div className=\"flex items-start gap-3 text-sm text-text-secondary\">\n <Shuffle className=\"mt-0.5 h-4 w-4 shrink-0\" />\n <p>\n {tr(\n 'providers.insights.alternativesEmpty',\n 'No comparable providers yet. Tag providers with capabilities (for example capability:design) or give them a specific category to see alternatives here.'\n )}\n </p>\n </div>\n ) : (\n <ul className=\"divide-y divide-border-subtle\">\n {data.map((alt) => (\n <AlternativeRow key={alt.providerId} alt={alt} />\n ))}\n </ul>\n )}\n </GlassCard>\n </Section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA0CA,IAAMI,IAAgB;AAEtB,SAASC,EAAW,GAAgC;CAElD,OADIC,MAAY,QAAQA,MA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;IACA,eAAe,KAAK0B,EAAQ;GAC7B,CAAA,IACC,CAAClB,KAAQA,EAAK,WAAW,IAC3B,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAACsC,GAAD,EAAS,WAAU,0BAA2B,CAAA,GAC9C,kBAAC,KAAD,EAAA,UACG9C,EACC,wCACA,yJACF,EACC,CAAA,CACA;GAEL,CAAA,IAAA,kBAAC,MAAD;IAAI,WAAU;IACX,UAAAQ,EAAK,KAAK,MACT,kBAAC6B,GAAD,EAA0C,OAAM,GAA3BC,EAAI,UAAuB,CACjD;GACC,CAAA;EAEG,CAAA;CACJ,CAAA;AAEb"}
@@ -1,2 +1 @@
1
- export declare function ProviderNewPage(): import("react").JSX.Element;
2
- //# sourceMappingURL=ProviderNewPage.d.ts.map
1
+ export declare function ProviderNewPage(): import('react').JSX.Element;
@@ -1,15 +1,15 @@
1
- import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
2
- import { useTr as t } from "../../hooks/useTr.js";
3
- import { useFormatters as n } from "../../hooks/useFormatters.js";
4
- import { cn as r } from "../../utils/cn.js";
5
- import { PageLayout as i } from "../../components/PageLayout.js";
6
- import { useCreateProvider as a } from "../../hooks/useSubscriberBotApi.js";
7
- import { useFormError as o } from "../../hooks/useFormError.js";
1
+ import { useFormatters as e } from "../../hooks/useFormatters.js";
2
+ import { useFormError as t } from "../../hooks/useFormError.js";
3
+ import { PageLayout as n } from "../../components/PageLayout.js";
4
+ import { useSubscriberBot as r } from "../../context/SubscriberBotContext.js";
5
+ import { useCreateProvider as i } from "../../hooks/useSubscriberBotApi.js";
6
+ import { useTr as a } from "../../hooks/useTr.js";
7
+ import { cn as o } from "../../utils/cn.js";
8
8
  import { useState as s } from "react";
9
9
  import { ArrowLeft as c, Building2 as l, Sparkles as u } from "lucide-react";
10
10
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
11
11
  import { GlassCard as p, PagePurpose as m } from "@burdenoff/fe-libs/ui";
12
- //#region src/subscriberbot/pages/providers/ProviderNewPage.tsx
12
+ // src/subscriberbot/pages/providers/ProviderNewPage.tsx
13
13
  var h = [
14
14
  "SAAS",
15
15
  "AI_SERVICE",
@@ -46,8 +46,8 @@ var h = [
46
46
  OTHER: "providers.categories.other"
47
47
  }, _ = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", v = "mb-1 block text-xs font-medium text-text-secondary";
48
48
  function y() {
49
- let { formatEnumLabel: y } = n(), b = t(), { navigateTo: x } = e(), S = a(), [C, w] = s(""), [T, E] = s("SAAS"), [D, O] = s(""), [k, A] = s(""), [j, M] = s(""), [N, P] = s(""), [F, I] = s(""), [L, R, z, B] = o(), V = F.split(",").map((e) => e.trim()).filter(Boolean);
50
- return /* @__PURE__ */ f(i, {
49
+ let { formatEnumLabel: y } = e(), b = a(), { navigateTo: x } = r(), S = i(), [C, w] = s(""), [T, E] = s("SAAS"), [D, O] = s(""), [k, A] = s(""), [j, M] = s(""), [N, P] = s(""), [F, I] = s(""), [L, R, z, B] = t(), V = F.split(",").map((e) => e.trim()).filter(Boolean);
50
+ return /* @__PURE__ */ f(n, {
51
51
  title: b("providers.new.title", "Add provider"),
52
52
  description: b("providers.new.description", "Register a new provider in the registry"),
53
53
  actions: /* @__PURE__ */ f("button", {
@@ -131,7 +131,7 @@ function y() {
131
131
  type: "button",
132
132
  "aria-pressed": t,
133
133
  onClick: () => E(e),
134
- className: r("rounded-full border px-3 py-1.5 text-xs font-medium transition-colors", t ? "border-transparent bg-action-primary-bg text-action-primary-text" : "border-border-subtle bg-bg-surface text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
134
+ className: o("rounded-full border px-3 py-1.5 text-xs font-medium transition-colors", t ? "border-transparent bg-action-primary-bg text-action-primary-text" : "border-border-subtle bg-bg-surface text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
135
135
  children: b(g[e], y(e))
136
136
  }, e);
137
137
  })
@@ -291,7 +291,6 @@ function y() {
291
291
  })]
292
292
  });
293
293
  }
294
- //#endregion
295
294
  export { y as ProviderNewPage };
296
295
 
297
296
  //# sourceMappingURL=ProviderNewPage.js.map