@aglyn/plugins-crm 1.0.0-beta.143

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 (669) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +7 -0
  3. package/package.json +57 -0
  4. package/src/index.d.ts +21 -0
  5. package/src/index.js +29 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/components/activity-list.d.ts +98 -0
  8. package/src/lib/components/activity-list.js +321 -0
  9. package/src/lib/components/activity-list.js.map +1 -0
  10. package/src/lib/components/activity-queries.d.ts +117 -0
  11. package/src/lib/components/activity-queries.js +198 -0
  12. package/src/lib/components/activity-queries.js.map +1 -0
  13. package/src/lib/components/add-to-list-button.d.ts +25 -0
  14. package/src/lib/components/add-to-list-button.js +64 -0
  15. package/src/lib/components/add-to-list-button.js.map +1 -0
  16. package/src/lib/components/add-to-list-dialog.d.ts +24 -0
  17. package/src/lib/components/add-to-list-dialog.js +327 -0
  18. package/src/lib/components/add-to-list-dialog.js.map +1 -0
  19. package/src/lib/components/assignment-rule-drawer.d.ts +43 -0
  20. package/src/lib/components/assignment-rule-drawer.js +293 -0
  21. package/src/lib/components/assignment-rule-drawer.js.map +1 -0
  22. package/src/lib/components/companies-bulk-bar.d.ts +29 -0
  23. package/src/lib/components/companies-bulk-bar.js +274 -0
  24. package/src/lib/components/companies-bulk-bar.js.map +1 -0
  25. package/src/lib/components/companies-section.d.ts +54 -0
  26. package/src/lib/components/companies-section.js +522 -0
  27. package/src/lib/components/companies-section.js.map +1 -0
  28. package/src/lib/components/company-contacts-card.d.ts +49 -0
  29. package/src/lib/components/company-contacts-card.js +435 -0
  30. package/src/lib/components/company-contacts-card.js.map +1 -0
  31. package/src/lib/components/company-deals-card.d.ts +20 -0
  32. package/src/lib/components/company-deals-card.js +38 -0
  33. package/src/lib/components/company-deals-card.js.map +1 -0
  34. package/src/lib/components/company-detail-page.d.ts +20 -0
  35. package/src/lib/components/company-detail-page.js +165 -0
  36. package/src/lib/components/company-detail-page.js.map +1 -0
  37. package/src/lib/components/company-edit-drawer.d.ts +65 -0
  38. package/src/lib/components/company-edit-drawer.js +433 -0
  39. package/src/lib/components/company-edit-drawer.js.map +1 -0
  40. package/src/lib/components/company-import-drawer.d.ts +42 -0
  41. package/src/lib/components/company-import-drawer.js +99 -0
  42. package/src/lib/components/company-import-drawer.js.map +1 -0
  43. package/src/lib/components/company-picker.d.ts +127 -0
  44. package/src/lib/components/company-picker.js +323 -0
  45. package/src/lib/components/company-picker.js.map +1 -0
  46. package/src/lib/components/company-properties-card.d.ts +47 -0
  47. package/src/lib/components/company-properties-card.js +289 -0
  48. package/src/lib/components/company-properties-card.js.map +1 -0
  49. package/src/lib/components/contact-address-fields.d.ts +29 -0
  50. package/src/lib/components/contact-address-fields.js +149 -0
  51. package/src/lib/components/contact-address-fields.js.map +1 -0
  52. package/src/lib/components/contact-associations-card.d.ts +72 -0
  53. package/src/lib/components/contact-associations-card.js +296 -0
  54. package/src/lib/components/contact-associations-card.js.map +1 -0
  55. package/src/lib/components/contact-custom-columns.d.ts +38 -0
  56. package/src/lib/components/contact-custom-columns.js +102 -0
  57. package/src/lib/components/contact-custom-columns.js.map +1 -0
  58. package/src/lib/components/contact-custom-fields-card.d.ts +39 -0
  59. package/src/lib/components/contact-custom-fields-card.js +204 -0
  60. package/src/lib/components/contact-custom-fields-card.js.map +1 -0
  61. package/src/lib/components/contact-deals-card.d.ts +20 -0
  62. package/src/lib/components/contact-deals-card.js +38 -0
  63. package/src/lib/components/contact-deals-card.js.map +1 -0
  64. package/src/lib/components/contact-detail-page.d.ts +46 -0
  65. package/src/lib/components/contact-detail-page.js +535 -0
  66. package/src/lib/components/contact-detail-page.js.map +1 -0
  67. package/src/lib/components/contact-duplicates-card.d.ts +42 -0
  68. package/src/lib/components/contact-duplicates-card.js +167 -0
  69. package/src/lib/components/contact-duplicates-card.js.map +1 -0
  70. package/src/lib/components/contact-field-drawer.d.ts +64 -0
  71. package/src/lib/components/contact-field-drawer.js +251 -0
  72. package/src/lib/components/contact-field-drawer.js.map +1 -0
  73. package/src/lib/components/contact-import-drawer.d.ts +46 -0
  74. package/src/lib/components/contact-import-drawer.js +149 -0
  75. package/src/lib/components/contact-import-drawer.js.map +1 -0
  76. package/src/lib/components/contact-known-by-card.d.ts +39 -0
  77. package/src/lib/components/contact-known-by-card.js +142 -0
  78. package/src/lib/components/contact-known-by-card.js.map +1 -0
  79. package/src/lib/components/contact-list-columns.d.ts +53 -0
  80. package/src/lib/components/contact-list-columns.js +288 -0
  81. package/src/lib/components/contact-list-columns.js.map +1 -0
  82. package/src/lib/components/contact-merge-dialog.d.ts +79 -0
  83. package/src/lib/components/contact-merge-dialog.js +405 -0
  84. package/src/lib/components/contact-merge-dialog.js.map +1 -0
  85. package/src/lib/components/contact-properties-card.d.ts +89 -0
  86. package/src/lib/components/contact-properties-card.js +492 -0
  87. package/src/lib/components/contact-properties-card.js.map +1 -0
  88. package/src/lib/components/contact-timeline-card.d.ts +68 -0
  89. package/src/lib/components/contact-timeline-card.js +435 -0
  90. package/src/lib/components/contact-timeline-card.js.map +1 -0
  91. package/src/lib/components/contacts-bulk-bar.d.ts +91 -0
  92. package/src/lib/components/contacts-bulk-bar.js +493 -0
  93. package/src/lib/components/contacts-bulk-bar.js.map +1 -0
  94. package/src/lib/components/contacts-section.d.ts +26 -0
  95. package/src/lib/components/contacts-section.js +1025 -0
  96. package/src/lib/components/contacts-section.js.map +1 -0
  97. package/src/lib/components/copy-capture-address-button.d.ts +33 -0
  98. package/src/lib/components/copy-capture-address-button.js +60 -0
  99. package/src/lib/components/copy-capture-address-button.js.map +1 -0
  100. package/src/lib/components/crm-attribution-zone.d.ts +38 -0
  101. package/src/lib/components/crm-attribution-zone.js +36 -0
  102. package/src/lib/components/crm-attribution-zone.js.map +1 -0
  103. package/src/lib/components/crm-booking-zone.d.ts +61 -0
  104. package/src/lib/components/crm-booking-zone.js +50 -0
  105. package/src/lib/components/crm-booking-zone.js.map +1 -0
  106. package/src/lib/components/crm-bulk-bar-frame.d.ts +47 -0
  107. package/src/lib/components/crm-bulk-bar-frame.js +137 -0
  108. package/src/lib/components/crm-bulk-bar-frame.js.map +1 -0
  109. package/src/lib/components/crm-call-actions.d.ts +65 -0
  110. package/src/lib/components/crm-call-actions.js +110 -0
  111. package/src/lib/components/crm-call-actions.js.map +1 -0
  112. package/src/lib/components/crm-column-menu.d.ts +21 -0
  113. package/src/lib/components/crm-column-menu.js +103 -0
  114. package/src/lib/components/crm-column-menu.js.map +1 -0
  115. package/src/lib/components/crm-console-page.d.ts +19 -0
  116. package/src/lib/components/crm-console-page.js +151 -0
  117. package/src/lib/components/crm-console-page.js.map +1 -0
  118. package/src/lib/components/crm-console-sections.d.ts +52 -0
  119. package/src/lib/components/crm-console-sections.js +83 -0
  120. package/src/lib/components/crm-console-sections.js.map +1 -0
  121. package/src/lib/components/crm-custom-field-control.d.ts +26 -0
  122. package/src/lib/components/crm-custom-field-control.js +131 -0
  123. package/src/lib/components/crm-custom-field-control.js.map +1 -0
  124. package/src/lib/components/crm-email-template-tools.d.ts +69 -0
  125. package/src/lib/components/crm-email-template-tools.js +240 -0
  126. package/src/lib/components/crm-email-template-tools.js.map +1 -0
  127. package/src/lib/components/crm-export-all-button.d.ts +39 -0
  128. package/src/lib/components/crm-export-all-button.js +98 -0
  129. package/src/lib/components/crm-export-all-button.js.map +1 -0
  130. package/src/lib/components/crm-filter-bar.d.ts +53 -0
  131. package/src/lib/components/crm-filter-bar.js +294 -0
  132. package/src/lib/components/crm-filter-bar.js.map +1 -0
  133. package/src/lib/components/crm-glance-card.d.ts +54 -0
  134. package/src/lib/components/crm-glance-card.js +219 -0
  135. package/src/lib/components/crm-glance-card.js.map +1 -0
  136. package/src/lib/components/crm-next-activity-column.d.ts +35 -0
  137. package/src/lib/components/crm-next-activity-column.js +100 -0
  138. package/src/lib/components/crm-next-activity-column.js.map +1 -0
  139. package/src/lib/components/crm-record-header.d.ts +97 -0
  140. package/src/lib/components/crm-record-header.js +160 -0
  141. package/src/lib/components/crm-record-header.js.map +1 -0
  142. package/src/lib/components/crm-record-insights-zone.d.ts +50 -0
  143. package/src/lib/components/crm-record-insights-zone.js +169 -0
  144. package/src/lib/components/crm-record-insights-zone.js.map +1 -0
  145. package/src/lib/components/crm-record-picker.d.ts +42 -0
  146. package/src/lib/components/crm-record-picker.js +104 -0
  147. package/src/lib/components/crm-record-picker.js.map +1 -0
  148. package/src/lib/components/crm-send-email-button.d.ts +39 -0
  149. package/src/lib/components/crm-send-email-button.js +81 -0
  150. package/src/lib/components/crm-send-email-button.js.map +1 -0
  151. package/src/lib/components/crm-send-email-dialog.d.ts +61 -0
  152. package/src/lib/components/crm-send-email-dialog.js +851 -0
  153. package/src/lib/components/crm-send-email-dialog.js.map +1 -0
  154. package/src/lib/components/crm-site-picker.d.ts +61 -0
  155. package/src/lib/components/crm-site-picker.js +99 -0
  156. package/src/lib/components/crm-site-picker.js.map +1 -0
  157. package/src/lib/components/crm-suite-lock.d.ts +29 -0
  158. package/src/lib/components/crm-suite-lock.js +114 -0
  159. package/src/lib/components/crm-suite-lock.js.map +1 -0
  160. package/src/lib/components/crm-tasks-due-card.d.ts +42 -0
  161. package/src/lib/components/crm-tasks-due-card.js +225 -0
  162. package/src/lib/components/crm-tasks-due-card.js.map +1 -0
  163. package/src/lib/components/crm-views-control.d.ts +65 -0
  164. package/src/lib/components/crm-views-control.js +518 -0
  165. package/src/lib/components/crm-views-control.js.map +1 -0
  166. package/src/lib/components/csv-import-drawer.d.ts +132 -0
  167. package/src/lib/components/csv-import-drawer.js +746 -0
  168. package/src/lib/components/csv-import-drawer.js.map +1 -0
  169. package/src/lib/components/deal-board.d.ts +70 -0
  170. package/src/lib/components/deal-board.js +478 -0
  171. package/src/lib/components/deal-board.js.map +1 -0
  172. package/src/lib/components/deal-detail-page.d.ts +18 -0
  173. package/src/lib/components/deal-detail-page.js +323 -0
  174. package/src/lib/components/deal-detail-page.js.map +1 -0
  175. package/src/lib/components/deal-edit-drawer.d.ts +59 -0
  176. package/src/lib/components/deal-edit-drawer.js +640 -0
  177. package/src/lib/components/deal-edit-drawer.js.map +1 -0
  178. package/src/lib/components/deal-import-drawer.d.ts +24 -0
  179. package/src/lib/components/deal-import-drawer.js +83 -0
  180. package/src/lib/components/deal-import-drawer.js.map +1 -0
  181. package/src/lib/components/deal-products-card.d.ts +48 -0
  182. package/src/lib/components/deal-products-card.js +614 -0
  183. package/src/lib/components/deal-products-card.js.map +1 -0
  184. package/src/lib/components/deal-properties-card.d.ts +29 -0
  185. package/src/lib/components/deal-properties-card.js +144 -0
  186. package/src/lib/components/deal-properties-card.js.map +1 -0
  187. package/src/lib/components/deal-stage-card.d.ts +24 -0
  188. package/src/lib/components/deal-stage-card.js +199 -0
  189. package/src/lib/components/deal-stage-card.js.map +1 -0
  190. package/src/lib/components/deals-bulk-bar.d.ts +31 -0
  191. package/src/lib/components/deals-bulk-bar.js +340 -0
  192. package/src/lib/components/deals-bulk-bar.js.map +1 -0
  193. package/src/lib/components/deals-section.d.ts +49 -0
  194. package/src/lib/components/deals-section.js +767 -0
  195. package/src/lib/components/deals-section.js.map +1 -0
  196. package/src/lib/components/email-capture-card.d.ts +42 -0
  197. package/src/lib/components/email-capture-card.js +134 -0
  198. package/src/lib/components/email-capture-card.js.map +1 -0
  199. package/src/lib/components/email-template-drawer.d.ts +33 -0
  200. package/src/lib/components/email-template-drawer.js +209 -0
  201. package/src/lib/components/email-template-drawer.js.map +1 -0
  202. package/src/lib/components/email-templates-card.d.ts +33 -0
  203. package/src/lib/components/email-templates-card.js +370 -0
  204. package/src/lib/components/email-templates-card.js.map +1 -0
  205. package/src/lib/components/erase-person-action.d.ts +92 -0
  206. package/src/lib/components/erase-person-action.js +261 -0
  207. package/src/lib/components/erase-person-action.js.map +1 -0
  208. package/src/lib/components/fields-section.d.ts +37 -0
  209. package/src/lib/components/fields-section.js +641 -0
  210. package/src/lib/components/fields-section.js.map +1 -0
  211. package/src/lib/components/form-contact-fields-card.d.ts +46 -0
  212. package/src/lib/components/form-contact-fields-card.js +253 -0
  213. package/src/lib/components/form-contact-fields-card.js.map +1 -0
  214. package/src/lib/components/insert-link-at-caret.d.ts +28 -0
  215. package/src/lib/components/insert-link-at-caret.js +37 -0
  216. package/src/lib/components/insert-link-at-caret.js.map +1 -0
  217. package/src/lib/components/lead-convert-dialog.d.ts +32 -0
  218. package/src/lib/components/lead-convert-dialog.js +493 -0
  219. package/src/lib/components/lead-convert-dialog.js.map +1 -0
  220. package/src/lib/components/lead-detail-page.d.ts +16 -0
  221. package/src/lib/components/lead-detail-page.js +163 -0
  222. package/src/lib/components/lead-detail-page.js.map +1 -0
  223. package/src/lib/components/lead-history-card.d.ts +32 -0
  224. package/src/lib/components/lead-history-card.js +165 -0
  225. package/src/lib/components/lead-history-card.js.map +1 -0
  226. package/src/lib/components/lead-import-drawer.d.ts +24 -0
  227. package/src/lib/components/lead-import-drawer.js +95 -0
  228. package/src/lib/components/lead-import-drawer.js.map +1 -0
  229. package/src/lib/components/lead-owner-select.d.ts +35 -0
  230. package/src/lib/components/lead-owner-select.js +91 -0
  231. package/src/lib/components/lead-owner-select.js.map +1 -0
  232. package/src/lib/components/lead-properties-card.d.ts +61 -0
  233. package/src/lib/components/lead-properties-card.js +395 -0
  234. package/src/lib/components/lead-properties-card.js.map +1 -0
  235. package/src/lib/components/lead-status-chip.d.ts +12 -0
  236. package/src/lib/components/lead-status-chip.js +43 -0
  237. package/src/lib/components/lead-status-chip.js.map +1 -0
  238. package/src/lib/components/lead-surfaces-note.d.ts +126 -0
  239. package/src/lib/components/lead-surfaces-note.js +262 -0
  240. package/src/lib/components/lead-surfaces-note.js.map +1 -0
  241. package/src/lib/components/lead-unqualify-dialog.d.ts +24 -0
  242. package/src/lib/components/lead-unqualify-dialog.js +125 -0
  243. package/src/lib/components/lead-unqualify-dialog.js.map +1 -0
  244. package/src/lib/components/leads-bulk-bar.d.ts +58 -0
  245. package/src/lib/components/leads-bulk-bar.js +307 -0
  246. package/src/lib/components/leads-bulk-bar.js.map +1 -0
  247. package/src/lib/components/leads-section.d.ts +23 -0
  248. package/src/lib/components/leads-section.js +664 -0
  249. package/src/lib/components/leads-section.js.map +1 -0
  250. package/src/lib/components/linked-deals-card.d.ts +32 -0
  251. package/src/lib/components/linked-deals-card.js +163 -0
  252. package/src/lib/components/linked-deals-card.js.map +1 -0
  253. package/src/lib/components/log-activity-dialog.d.ts +60 -0
  254. package/src/lib/components/log-activity-dialog.js +368 -0
  255. package/src/lib/components/log-activity-dialog.js.map +1 -0
  256. package/src/lib/components/lost-reason-dialog.d.ts +26 -0
  257. package/src/lib/components/lost-reason-dialog.js +95 -0
  258. package/src/lib/components/lost-reason-dialog.js.map +1 -0
  259. package/src/lib/components/new-contact-drawer.d.ts +78 -0
  260. package/src/lib/components/new-contact-drawer.js +343 -0
  261. package/src/lib/components/new-contact-drawer.js.map +1 -0
  262. package/src/lib/components/org-lead-surfaces-note.d.ts +57 -0
  263. package/src/lib/components/org-lead-surfaces-note.js +172 -0
  264. package/src/lib/components/org-lead-surfaces-note.js.map +1 -0
  265. package/src/lib/components/owner-avatar.d.ts +18 -0
  266. package/src/lib/components/owner-avatar.js +61 -0
  267. package/src/lib/components/owner-avatar.js.map +1 -0
  268. package/src/lib/components/pipeline-stages-dialog.d.ts +43 -0
  269. package/src/lib/components/pipeline-stages-dialog.js +339 -0
  270. package/src/lib/components/pipeline-stages-dialog.js.map +1 -0
  271. package/src/lib/components/pipelines-dialog.d.ts +55 -0
  272. package/src/lib/components/pipelines-dialog.js +517 -0
  273. package/src/lib/components/pipelines-dialog.js.map +1 -0
  274. package/src/lib/components/recent-activity-feed.d.ts +39 -0
  275. package/src/lib/components/recent-activity-feed.js +103 -0
  276. package/src/lib/components/recent-activity-feed.js.map +1 -0
  277. package/src/lib/components/recipes-card.d.ts +39 -0
  278. package/src/lib/components/recipes-card.js +485 -0
  279. package/src/lib/components/recipes-card.js.map +1 -0
  280. package/src/lib/components/record-activity-card.d.ts +26 -0
  281. package/src/lib/components/record-activity-card.js +121 -0
  282. package/src/lib/components/record-activity-card.js.map +1 -0
  283. package/src/lib/components/record-files-card.d.ts +67 -0
  284. package/src/lib/components/record-files-card.js +290 -0
  285. package/src/lib/components/record-files-card.js.map +1 -0
  286. package/src/lib/components/record-tasks-card.d.ts +32 -0
  287. package/src/lib/components/record-tasks-card.js +306 -0
  288. package/src/lib/components/record-tasks-card.js.map +1 -0
  289. package/src/lib/components/reports/activity-card.d.ts +57 -0
  290. package/src/lib/components/reports/activity-card.js +281 -0
  291. package/src/lib/components/reports/activity-card.js.map +1 -0
  292. package/src/lib/components/reports/closed-deals-card.d.ts +20 -0
  293. package/src/lib/components/reports/closed-deals-card.js +194 -0
  294. package/src/lib/components/reports/closed-deals-card.js.map +1 -0
  295. package/src/lib/components/reports/contacts-mix-card.d.ts +27 -0
  296. package/src/lib/components/reports/contacts-mix-card.js +161 -0
  297. package/src/lib/components/reports/contacts-mix-card.js.map +1 -0
  298. package/src/lib/components/reports/contacts-trend-card.d.ts +31 -0
  299. package/src/lib/components/reports/contacts-trend-card.js +144 -0
  300. package/src/lib/components/reports/contacts-trend-card.js.map +1 -0
  301. package/src/lib/components/reports/forecast-card.d.ts +22 -0
  302. package/src/lib/components/reports/forecast-card.js +251 -0
  303. package/src/lib/components/reports/forecast-card.js.map +1 -0
  304. package/src/lib/components/reports/lead-counts.d.ts +32 -0
  305. package/src/lib/components/reports/lead-counts.js +44 -0
  306. package/src/lib/components/reports/lead-counts.js.map +1 -0
  307. package/src/lib/components/reports/lead-funnel-card.d.ts +38 -0
  308. package/src/lib/components/reports/lead-funnel-card.js +375 -0
  309. package/src/lib/components/reports/lead-funnel-card.js.map +1 -0
  310. package/src/lib/components/reports/pipeline-card.d.ts +19 -0
  311. package/src/lib/components/reports/pipeline-card.js +338 -0
  312. package/src/lib/components/reports/pipeline-card.js.map +1 -0
  313. package/src/lib/components/reports/report-bar-chart.d.ts +39 -0
  314. package/src/lib/components/reports/report-bar-chart.js +133 -0
  315. package/src/lib/components/reports/report-bar-chart.js.map +1 -0
  316. package/src/lib/components/reports/report-breakdown.d.ts +32 -0
  317. package/src/lib/components/reports/report-breakdown.js +105 -0
  318. package/src/lib/components/reports/report-breakdown.js.map +1 -0
  319. package/src/lib/components/reports/report-export.d.ts +37 -0
  320. package/src/lib/components/reports/report-export.js +66 -0
  321. package/src/lib/components/reports/report-export.js.map +1 -0
  322. package/src/lib/components/reports/report-format.d.ts +36 -0
  323. package/src/lib/components/reports/report-format.js +43 -0
  324. package/src/lib/components/reports/report-format.js.map +1 -0
  325. package/src/lib/components/reports/report-scope.d.ts +81 -0
  326. package/src/lib/components/reports/report-scope.js +58 -0
  327. package/src/lib/components/reports/report-scope.js.map +1 -0
  328. package/src/lib/components/reports/report-stat-tile.d.ts +47 -0
  329. package/src/lib/components/reports/report-stat-tile.js +96 -0
  330. package/src/lib/components/reports/report-stat-tile.js.map +1 -0
  331. package/src/lib/components/reports/source-conversion-card.d.ts +28 -0
  332. package/src/lib/components/reports/source-conversion-card.js +205 -0
  333. package/src/lib/components/reports/source-conversion-card.js.map +1 -0
  334. package/src/lib/components/reports/tasks-card.d.ts +26 -0
  335. package/src/lib/components/reports/tasks-card.js +279 -0
  336. package/src/lib/components/reports/tasks-card.js.map +1 -0
  337. package/src/lib/components/reports/use-aggregate-read.d.ts +99 -0
  338. package/src/lib/components/reports/use-aggregate-read.js +195 -0
  339. package/src/lib/components/reports/use-aggregate-read.js.map +1 -0
  340. package/src/lib/components/reports/won-lost-by-owner-card.d.ts +30 -0
  341. package/src/lib/components/reports/won-lost-by-owner-card.js +168 -0
  342. package/src/lib/components/reports/won-lost-by-owner-card.js.map +1 -0
  343. package/src/lib/components/reports-section.d.ts +42 -0
  344. package/src/lib/components/reports-section.js +308 -0
  345. package/src/lib/components/reports-section.js.map +1 -0
  346. package/src/lib/components/sending-addresses-card.d.ts +49 -0
  347. package/src/lib/components/sending-addresses-card.js +262 -0
  348. package/src/lib/components/sending-addresses-card.js.map +1 -0
  349. package/src/lib/components/settings-section.d.ts +151 -0
  350. package/src/lib/components/settings-section.js +783 -0
  351. package/src/lib/components/settings-section.js.map +1 -0
  352. package/src/lib/components/task-cells.d.ts +51 -0
  353. package/src/lib/components/task-cells.js +139 -0
  354. package/src/lib/components/task-cells.js.map +1 -0
  355. package/src/lib/components/task-edit-drawer.d.ts +53 -0
  356. package/src/lib/components/task-edit-drawer.js +483 -0
  357. package/src/lib/components/task-edit-drawer.js.map +1 -0
  358. package/src/lib/components/task-import-drawer.d.ts +24 -0
  359. package/src/lib/components/task-import-drawer.js +82 -0
  360. package/src/lib/components/task-import-drawer.js.map +1 -0
  361. package/src/lib/components/task-snooze-menu.d.ts +65 -0
  362. package/src/lib/components/task-snooze-menu.js +207 -0
  363. package/src/lib/components/task-snooze-menu.js.map +1 -0
  364. package/src/lib/components/tasks-bulk-bar.d.ts +25 -0
  365. package/src/lib/components/tasks-bulk-bar.js +348 -0
  366. package/src/lib/components/tasks-bulk-bar.js.map +1 -0
  367. package/src/lib/components/tasks-calendar.d.ts +38 -0
  368. package/src/lib/components/tasks-calendar.js +228 -0
  369. package/src/lib/components/tasks-calendar.js.map +1 -0
  370. package/src/lib/components/tasks-section.d.ts +27 -0
  371. package/src/lib/components/tasks-section.js +579 -0
  372. package/src/lib/components/tasks-section.js.map +1 -0
  373. package/src/lib/components/use-contact-campaign-emails.d.ts +32 -0
  374. package/src/lib/components/use-contact-campaign-emails.js +83 -0
  375. package/src/lib/components/use-contact-campaign-emails.js.map +1 -0
  376. package/src/lib/components/use-crm-api.d.ts +44 -0
  377. package/src/lib/components/use-crm-api.js +84 -0
  378. package/src/lib/components/use-crm-api.js.map +1 -0
  379. package/src/lib/components/use-crm-inbound-address.d.ts +60 -0
  380. package/src/lib/components/use-crm-inbound-address.js +124 -0
  381. package/src/lib/components/use-crm-inbound-address.js.map +1 -0
  382. package/src/lib/components/use-emails-hub-path.d.ts +24 -0
  383. package/src/lib/components/use-emails-hub-path.js +59 -0
  384. package/src/lib/components/use-emails-hub-path.js.map +1 -0
  385. package/src/lib/components/use-member-email-aliases.d.ts +54 -0
  386. package/src/lib/components/use-member-email-aliases.js +186 -0
  387. package/src/lib/components/use-member-email-aliases.js.map +1 -0
  388. package/src/lib/components/use-org-members.d.ts +40 -0
  389. package/src/lib/components/use-org-members.js +100 -0
  390. package/src/lib/components/use-org-members.js.map +1 -0
  391. package/src/lib/constants/api-routes.d.ts +109 -0
  392. package/src/lib/constants/api-routes.js +74 -0
  393. package/src/lib/constants/api-routes.js.map +1 -0
  394. package/src/lib/constants/bundle-common.d.ts +14 -0
  395. package/src/lib/constants/bundle-common.js +14 -0
  396. package/src/lib/constants/bundle-common.js.map +1 -0
  397. package/src/lib/constants/company-filters.d.ts +18 -0
  398. package/src/lib/constants/company-filters.js +51 -0
  399. package/src/lib/constants/company-filters.js.map +1 -0
  400. package/src/lib/constants/contact-filters.d.ts +38 -0
  401. package/src/lib/constants/contact-filters.js +294 -0
  402. package/src/lib/constants/contact-filters.js.map +1 -0
  403. package/src/lib/hooks/use-contact-field-definitions.d.ts +48 -0
  404. package/src/lib/hooks/use-contact-field-definitions.js +72 -0
  405. package/src/lib/hooks/use-contact-field-definitions.js.map +1 -0
  406. package/src/lib/hooks/use-contact-update.d.ts +25 -0
  407. package/src/lib/hooks/use-contact-update.js +80 -0
  408. package/src/lib/hooks/use-contact-update.js.map +1 -0
  409. package/src/lib/hooks/use-crm-activity-logger.d.ts +73 -0
  410. package/src/lib/hooks/use-crm-activity-logger.js +101 -0
  411. package/src/lib/hooks/use-crm-activity-logger.js.map +1 -0
  412. package/src/lib/hooks/use-crm-bulk-apply.d.ts +52 -0
  413. package/src/lib/hooks/use-crm-bulk-apply.js +112 -0
  414. package/src/lib/hooks/use-crm-bulk-apply.js.map +1 -0
  415. package/src/lib/hooks/use-crm-default-view.d.ts +24 -0
  416. package/src/lib/hooks/use-crm-default-view.js +64 -0
  417. package/src/lib/hooks/use-crm-default-view.js.map +1 -0
  418. package/src/lib/hooks/use-crm-email-templates.d.ts +59 -0
  419. package/src/lib/hooks/use-crm-email-templates.js +103 -0
  420. package/src/lib/hooks/use-crm-email-templates.js.map +1 -0
  421. package/src/lib/hooks/use-crm-hub-path.d.ts +29 -0
  422. package/src/lib/hooks/use-crm-hub-path.js +41 -0
  423. package/src/lib/hooks/use-crm-hub-path.js.map +1 -0
  424. package/src/lib/hooks/use-crm-org-mount.d.ts +97 -0
  425. package/src/lib/hooks/use-crm-org-mount.js +215 -0
  426. package/src/lib/hooks/use-crm-org-mount.js.map +1 -0
  427. package/src/lib/hooks/use-crm-record-names.d.ts +52 -0
  428. package/src/lib/hooks/use-crm-record-names.js +126 -0
  429. package/src/lib/hooks/use-crm-record-names.js.map +1 -0
  430. package/src/lib/hooks/use-crm-records-quota.d.ts +68 -0
  431. package/src/lib/hooks/use-crm-records-quota.js +118 -0
  432. package/src/lib/hooks/use-crm-records-quota.js.map +1 -0
  433. package/src/lib/hooks/use-crm-saved-view.d.ts +96 -0
  434. package/src/lib/hooks/use-crm-saved-view.js +329 -0
  435. package/src/lib/hooks/use-crm-saved-view.js.map +1 -0
  436. package/src/lib/hooks/use-crm-scope.d.ts +117 -0
  437. package/src/lib/hooks/use-crm-scope.js +147 -0
  438. package/src/lib/hooks/use-crm-scope.js.map +1 -0
  439. package/src/lib/hooks/use-crm-tasks.d.ts +85 -0
  440. package/src/lib/hooks/use-crm-tasks.js +153 -0
  441. package/src/lib/hooks/use-crm-tasks.js.map +1 -0
  442. package/src/lib/hooks/use-crm-view-grid.d.ts +55 -0
  443. package/src/lib/hooks/use-crm-view-grid.js +170 -0
  444. package/src/lib/hooks/use-crm-view-grid.js.map +1 -0
  445. package/src/lib/hooks/use-crm-views.d.ts +42 -0
  446. package/src/lib/hooks/use-crm-views.js +84 -0
  447. package/src/lib/hooks/use-crm-views.js.map +1 -0
  448. package/src/lib/hooks/use-deal-stage-api.d.ts +69 -0
  449. package/src/lib/hooks/use-deal-stage-api.js +78 -0
  450. package/src/lib/hooks/use-deal-stage-api.js.map +1 -0
  451. package/src/lib/hooks/use-deals.d.ts +47 -0
  452. package/src/lib/hooks/use-deals.js +105 -0
  453. package/src/lib/hooks/use-deals.js.map +1 -0
  454. package/src/lib/hooks/use-org-leads.d.ts +53 -0
  455. package/src/lib/hooks/use-org-leads.js +114 -0
  456. package/src/lib/hooks/use-org-leads.js.map +1 -0
  457. package/src/lib/hooks/use-org-member-directory.d.ts +36 -0
  458. package/src/lib/hooks/use-org-member-directory.js +116 -0
  459. package/src/lib/hooks/use-org-member-directory.js.map +1 -0
  460. package/src/lib/hooks/use-org-member-options.d.ts +38 -0
  461. package/src/lib/hooks/use-org-member-options.js +131 -0
  462. package/src/lib/hooks/use-org-member-options.js.map +1 -0
  463. package/src/lib/hooks/use-pipeline.d.ts +71 -0
  464. package/src/lib/hooks/use-pipeline.js +159 -0
  465. package/src/lib/hooks/use-pipeline.js.map +1 -0
  466. package/src/lib/model/companies-bulk-writes.d.ts +40 -0
  467. package/src/lib/model/companies-bulk-writes.js +103 -0
  468. package/src/lib/model/companies-bulk-writes.js.map +1 -0
  469. package/src/lib/model/companies-csv.d.ts +36 -0
  470. package/src/lib/model/companies-csv.js +38 -0
  471. package/src/lib/model/companies-csv.js.map +1 -0
  472. package/src/lib/model/companies.d.ts +99 -0
  473. package/src/lib/model/companies.js +168 -0
  474. package/src/lib/model/companies.js.map +1 -0
  475. package/src/lib/model/company-delete-route.d.ts +43 -0
  476. package/src/lib/model/company-delete-route.js +31 -0
  477. package/src/lib/model/company-delete-route.js.map +1 -0
  478. package/src/lib/model/company-delete.d.ts +42 -0
  479. package/src/lib/model/company-delete.js +52 -0
  480. package/src/lib/model/company-delete.js.map +1 -0
  481. package/src/lib/model/contact-duplicates.d.ts +58 -0
  482. package/src/lib/model/contact-duplicates.js +67 -0
  483. package/src/lib/model/contact-duplicates.js.map +1 -0
  484. package/src/lib/model/contact-record.d.ts +113 -0
  485. package/src/lib/model/contact-record.js +70 -0
  486. package/src/lib/model/contact-record.js.map +1 -0
  487. package/src/lib/model/contact-update.d.ts +93 -0
  488. package/src/lib/model/contact-update.js +50 -0
  489. package/src/lib/model/contact-update.js.map +1 -0
  490. package/src/lib/model/contacts-bulk-writes.d.ts +173 -0
  491. package/src/lib/model/contacts-bulk-writes.js +196 -0
  492. package/src/lib/model/contacts-bulk-writes.js.map +1 -0
  493. package/src/lib/model/contacts-csv.d.ts +54 -0
  494. package/src/lib/model/contacts-csv.js +67 -0
  495. package/src/lib/model/contacts-csv.js.map +1 -0
  496. package/src/lib/model/contacts-list-seed.d.ts +51 -0
  497. package/src/lib/model/contacts-list-seed.js +63 -0
  498. package/src/lib/model/contacts-list-seed.js.map +1 -0
  499. package/src/lib/model/crm-activity-report.d.ts +27 -0
  500. package/src/lib/model/crm-activity-report.js +56 -0
  501. package/src/lib/model/crm-activity-report.js.map +1 -0
  502. package/src/lib/model/crm-api.d.ts +49 -0
  503. package/src/lib/model/crm-api.js +47 -0
  504. package/src/lib/model/crm-api.js.map +1 -0
  505. package/src/lib/model/crm-bulk-writes.d.ts +147 -0
  506. package/src/lib/model/crm-bulk-writes.js +207 -0
  507. package/src/lib/model/crm-bulk-writes.js.map +1 -0
  508. package/src/lib/model/crm-company-import.d.ts +154 -0
  509. package/src/lib/model/crm-company-import.js +331 -0
  510. package/src/lib/model/crm-company-import.js.map +1 -0
  511. package/src/lib/model/crm-custom-draft.d.ts +62 -0
  512. package/src/lib/model/crm-custom-draft.js +67 -0
  513. package/src/lib/model/crm-custom-draft.js.map +1 -0
  514. package/src/lib/model/crm-deal-import.d.ts +112 -0
  515. package/src/lib/model/crm-deal-import.js +263 -0
  516. package/src/lib/model/crm-deal-import.js.map +1 -0
  517. package/src/lib/model/crm-import.d.ts +244 -0
  518. package/src/lib/model/crm-import.js +466 -0
  519. package/src/lib/model/crm-import.js.map +1 -0
  520. package/src/lib/model/crm-lead-import.d.ts +105 -0
  521. package/src/lib/model/crm-lead-import.js +255 -0
  522. package/src/lib/model/crm-lead-import.js.map +1 -0
  523. package/src/lib/model/crm-record-routes.d.ts +21 -0
  524. package/src/lib/model/crm-record-routes.js +70 -0
  525. package/src/lib/model/crm-record-routes.js.map +1 -0
  526. package/src/lib/model/crm-routes.d.ts +101 -0
  527. package/src/lib/model/crm-routes.js +92 -0
  528. package/src/lib/model/crm-routes.js.map +1 -0
  529. package/src/lib/model/crm-task-import.d.ts +94 -0
  530. package/src/lib/model/crm-task-import.js +275 -0
  531. package/src/lib/model/crm-task-import.js.map +1 -0
  532. package/src/lib/model/crm-view-param.d.ts +43 -0
  533. package/src/lib/model/crm-view-param.js +49 -0
  534. package/src/lib/model/crm-view-param.js.map +1 -0
  535. package/src/lib/model/deal-board-model.d.ts +241 -0
  536. package/src/lib/model/deal-board-model.js +439 -0
  537. package/src/lib/model/deal-board-model.js.map +1 -0
  538. package/src/lib/model/deal-form-model.d.ts +114 -0
  539. package/src/lib/model/deal-form-model.js +218 -0
  540. package/src/lib/model/deal-form-model.js.map +1 -0
  541. package/src/lib/model/deals-csv.d.ts +32 -0
  542. package/src/lib/model/deals-csv.js +37 -0
  543. package/src/lib/model/deals-csv.js.map +1 -0
  544. package/src/lib/model/import-column-shapes.d.ts +36 -0
  545. package/src/lib/model/import-column-shapes.js +76 -0
  546. package/src/lib/model/import-column-shapes.js.map +1 -0
  547. package/src/lib/model/lead-company-suggestion.d.ts +61 -0
  548. package/src/lib/model/lead-company-suggestion.js +65 -0
  549. package/src/lib/model/lead-company-suggestion.js.map +1 -0
  550. package/src/lib/model/lead-filters.d.ts +29 -0
  551. package/src/lib/model/lead-filters.js +39 -0
  552. package/src/lib/model/lead-filters.js.map +1 -0
  553. package/src/lib/model/lead-surfaces.d.ts +58 -0
  554. package/src/lib/model/lead-surfaces.js +67 -0
  555. package/src/lib/model/lead-surfaces.js.map +1 -0
  556. package/src/lib/model/leads-csv.d.ts +40 -0
  557. package/src/lib/model/leads-csv.js +40 -0
  558. package/src/lib/model/leads-csv.js.map +1 -0
  559. package/src/lib/model/next-activity-api.d.ts +31 -0
  560. package/src/lib/model/next-activity-api.js +57 -0
  561. package/src/lib/model/next-activity-api.js.map +1 -0
  562. package/src/lib/model/next-activity.d.ts +64 -0
  563. package/src/lib/model/next-activity.js +47 -0
  564. package/src/lib/model/next-activity.js.map +1 -0
  565. package/src/lib/model/person-key-web.d.ts +43 -0
  566. package/src/lib/model/person-key-web.js +52 -0
  567. package/src/lib/model/person-key-web.js.map +1 -0
  568. package/src/lib/model/record-facts.d.ts +282 -0
  569. package/src/lib/model/record-facts.js +434 -0
  570. package/src/lib/model/record-facts.js.map +1 -0
  571. package/src/lib/model/task-api.d.ts +28 -0
  572. package/src/lib/model/task-api.js +57 -0
  573. package/src/lib/model/task-api.js.map +1 -0
  574. package/src/lib/model/task-calendar.d.ts +108 -0
  575. package/src/lib/model/task-calendar.js +139 -0
  576. package/src/lib/model/task-calendar.js.map +1 -0
  577. package/src/lib/model/task-routes.d.ts +177 -0
  578. package/src/lib/model/task-routes.js +197 -0
  579. package/src/lib/model/task-routes.js.map +1 -0
  580. package/src/lib/model/task-scope.d.ts +45 -0
  581. package/src/lib/model/task-scope.js +51 -0
  582. package/src/lib/model/task-scope.js.map +1 -0
  583. package/src/lib/model/task-views.d.ts +149 -0
  584. package/src/lib/model/task-views.js +286 -0
  585. package/src/lib/model/task-views.js.map +1 -0
  586. package/src/lib/model/tasks-csv.d.ts +28 -0
  587. package/src/lib/model/tasks-csv.js +28 -0
  588. package/src/lib/model/tasks-csv.js.map +1 -0
  589. package/src/lib/plugin.d.ts +32 -0
  590. package/src/lib/plugin.js +208 -0
  591. package/src/lib/plugin.js.map +1 -0
  592. package/src/lib/server/companies-import.d.ts +57 -0
  593. package/src/lib/server/companies-import.js +242 -0
  594. package/src/lib/server/companies-import.js.map +1 -0
  595. package/src/lib/server/company-delete.d.ts +59 -0
  596. package/src/lib/server/company-delete.js +146 -0
  597. package/src/lib/server/company-delete.js.map +1 -0
  598. package/src/lib/server/contact-email-history.d.ts +82 -0
  599. package/src/lib/server/contact-email-history.js +264 -0
  600. package/src/lib/server/contact-email-history.js.map +1 -0
  601. package/src/lib/server/contact-profile.d.ts +41 -0
  602. package/src/lib/server/contact-profile.js +45 -0
  603. package/src/lib/server/contact-profile.js.map +1 -0
  604. package/src/lib/server/contact-update.d.ts +92 -0
  605. package/src/lib/server/contact-update.js +512 -0
  606. package/src/lib/server/contact-update.js.map +1 -0
  607. package/src/lib/server/contacts-import.d.ts +73 -0
  608. package/src/lib/server/contacts-import.js +263 -0
  609. package/src/lib/server/contacts-import.js.map +1 -0
  610. package/src/lib/server/contacts-merge.d.ts +86 -0
  611. package/src/lib/server/contacts-merge.js +206 -0
  612. package/src/lib/server/contacts-merge.js.map +1 -0
  613. package/src/lib/server/deals-import.d.ts +76 -0
  614. package/src/lib/server/deals-import.js +246 -0
  615. package/src/lib/server/deals-import.js.map +1 -0
  616. package/src/lib/server/email-send.d.ts +119 -0
  617. package/src/lib/server/email-send.js +667 -0
  618. package/src/lib/server/email-send.js.map +1 -0
  619. package/src/lib/server/email-template-duplicate.d.ts +19 -0
  620. package/src/lib/server/email-template-duplicate.js +206 -0
  621. package/src/lib/server/email-template-duplicate.js.map +1 -0
  622. package/src/lib/server/erase-person.d.ts +108 -0
  623. package/src/lib/server/erase-person.js +309 -0
  624. package/src/lib/server/erase-person.js.map +1 -0
  625. package/src/lib/server/import-context.d.ts +85 -0
  626. package/src/lib/server/import-context.js +181 -0
  627. package/src/lib/server/import-context.js.map +1 -0
  628. package/src/lib/server/inbound-address.d.ts +61 -0
  629. package/src/lib/server/inbound-address.js +188 -0
  630. package/src/lib/server/inbound-address.js.map +1 -0
  631. package/src/lib/server/lead-convert.d.ts +78 -0
  632. package/src/lib/server/lead-convert.js +250 -0
  633. package/src/lib/server/lead-convert.js.map +1 -0
  634. package/src/lib/server/leads-import.d.ts +84 -0
  635. package/src/lib/server/leads-import.js +261 -0
  636. package/src/lib/server/leads-import.js.map +1 -0
  637. package/src/lib/server/next-activity-routes.d.ts +33 -0
  638. package/src/lib/server/next-activity-routes.js +110 -0
  639. package/src/lib/server/next-activity-routes.js.map +1 -0
  640. package/src/lib/server/org-activity.d.ts +61 -0
  641. package/src/lib/server/org-activity.js +120 -0
  642. package/src/lib/server/org-activity.js.map +1 -0
  643. package/src/lib/server/org-caller.d.ts +110 -0
  644. package/src/lib/server/org-caller.js +154 -0
  645. package/src/lib/server/org-caller.js.map +1 -0
  646. package/src/lib/server/recipe-routes.d.ts +75 -0
  647. package/src/lib/server/recipe-routes.js +442 -0
  648. package/src/lib/server/recipe-routes.js.map +1 -0
  649. package/src/lib/server/record-facts.d.ts +65 -0
  650. package/src/lib/server/record-facts.js +337 -0
  651. package/src/lib/server/record-facts.js.map +1 -0
  652. package/src/lib/server/record-timeline.d.ts +51 -0
  653. package/src/lib/server/record-timeline.js +215 -0
  654. package/src/lib/server/record-timeline.js.map +1 -0
  655. package/src/lib/server/suite-gate.d.ts +42 -0
  656. package/src/lib/server/suite-gate.js +87 -0
  657. package/src/lib/server/suite-gate.js.map +1 -0
  658. package/src/lib/server/task-routes.d.ts +132 -0
  659. package/src/lib/server/task-routes.js +699 -0
  660. package/src/lib/server/task-routes.js.map +1 -0
  661. package/src/lib/server/tasks-import.d.ts +54 -0
  662. package/src/lib/server/tasks-import.js +157 -0
  663. package/src/lib/server/tasks-import.js.map +1 -0
  664. package/src/lib/server-deal-stage.d.ts +88 -0
  665. package/src/lib/server-deal-stage.js +316 -0
  666. package/src/lib/server-deal-stage.js.map +1 -0
  667. package/src/lib/server.d.ts +149 -0
  668. package/src/lib/server.js +615 -0
  669. package/src/lib/server.js.map +1 -0
@@ -0,0 +1,308 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ 'use client';
17
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
18
+ import * as Aglyn from "@aglyn/aglyn";
19
+ import { mdiRefresh } from "@aglyn/shared-data-mdi";
20
+ import { MdiIcon } from "@aglyn/shared-ui-jsx";
21
+ import { CardColumns } from "@aglyn/shared-ui-jsx/components/card-columns";
22
+ import { Button, Stack, ToggleButton, ToggleButtonGroup, Typography } from "@mui/material";
23
+ import { getCountFromServer, query } from "firebase/firestore";
24
+ import { useCallback, useMemo, useState } from "react";
25
+ import { useFirestore } from "@aglyn/tenant-feature-instance";
26
+ import { useCrmScope } from "../hooks/use-crm-scope.js";
27
+ import { crmRoutes } from "../model/crm-routes.js";
28
+ import { ActivityCard } from "./reports/activity-card.js";
29
+ import { ClosedDealsCard } from "./reports/closed-deals-card.js";
30
+ import { ContactsMixCard } from "./reports/contacts-mix-card.js";
31
+ import { ContactsTrendCard } from "./reports/contacts-trend-card.js";
32
+ import { ForecastCard } from "./reports/forecast-card.js";
33
+ import { LeadFunnelCard } from "./reports/lead-funnel-card.js";
34
+ import { PipelineCard } from "./reports/pipeline-card.js";
35
+ import { SourceConversionCard } from "./reports/source-conversion-card.js";
36
+ import { WonLostByOwnerCard } from "./reports/won-lost-by-owner-card.js";
37
+ import { reportCacheKey, reportCachePrefix, scopedCollection, visibleToClause } from "./reports/report-scope.js";
38
+ import { TasksCard } from "./reports/tasks-card.js";
39
+ import { invalidateAggregateReads, useAggregateRead } from "./reports/use-aggregate-read.js";
40
+ /**
41
+ * `/crm/reports` — the CRM in aggregate (AGL-2604, AGL-2624).
42
+ *
43
+ * Nine cards, each reading its own collection: contacts over time, contacts
44
+ * by source and stage, which sources convert, this site's lead funnel, the
45
+ * open pipeline, what closed, who logged what, the forecast by close month
46
+ * (AGL-2620, over the pipeline card's own window), and the task load. This
47
+ * section resolves what they share and hands it down — see `CrmReportScope`
48
+ * — so that every card counts the same reader's records over the same
49
+ * clock. The lead funnel is the one card handed the site as well: leads live
50
+ * under the host, not the org.
51
+ *
52
+ * ## The period is a control, and the reads follow it
53
+ *
54
+ * Nothing on this page reads a year on mount. The picker names the period,
55
+ * the period sizes every read (one count per week of it, the deals closed
56
+ * within it), and the default is thirty days. The three cards that are
57
+ * stocks rather than flows — the open pipeline, its forecast, the open
58
+ * tasks — ignore the period because "what is open" has no period.
59
+ *
60
+ * ## Scoped like the list
61
+ *
62
+ * Every query carries `visibleTo array-contains-any` over the group's
63
+ * tokens, the predicate the rules evaluate, so a report can never count a
64
+ * record its reader could not open — and the total here is the reader's
65
+ * total, not the org's billable audience, which is the head-count the
66
+ * contacts list keeps for the quota.
67
+ *
68
+ * ## Read once a minute, not once an arrival
69
+ *
70
+ * Every read on this page is keyed by the scope and the period and kept
71
+ * for `AGGREGATE_READ_TTL_MS` — see `useAggregateRead` — so leaving to open
72
+ * a deal the report named and coming straight back costs nothing. Refresh
73
+ * forgets this reader's answers for this org and anchors the period again,
74
+ * which is what makes every card ask afresh.
75
+ */ export function ContactsReportsSection(props) {
76
+ var _ref;
77
+ const { hostId, org, basePath } = props;
78
+ const firestore = useFirestore();
79
+ // The org data root — null until the org lookup settles, and the page
80
+ // reads nothing until it does — and the controller this page is viewed
81
+ // as, resolved the way every CRM surface resolves them so the facet a
82
+ // stage is read from here is the facet the contacts list edits it in.
83
+ const { scope: dataScope, consentGroup, visibleTo } = useCrmScope({
84
+ hostId,
85
+ org
86
+ });
87
+ // `null` at the organization level (AGL-2630): no clause, and every card
88
+ // totals every site; the holder is then each contact's own.
89
+ const tokens = useMemo(()=>visibleTo ? [
90
+ ...visibleTo
91
+ ] : null, [
92
+ visibleTo
93
+ ]);
94
+ const groupId = (_ref = consentGroup == null ? void 0 : consentGroup.groupId) != null ? _ref : null;
95
+ const orgRecord = org != null ? org : null;
96
+ /*
97
+ * The period AND the moment it was chosen, as one value: the range is
98
+ * anchored when the reader picks, not re-derived from a moving `Date.now()`
99
+ * per render, which would rebuild every query on every pass.
100
+ */ const [view, setView] = useState(()=>({
101
+ period: '30d',
102
+ nowMs: Date.now()
103
+ }));
104
+ const range = useMemo(()=>Aglyn.crmReportRange(view.period, view.nowMs), [
105
+ view
106
+ ]);
107
+ const routes = useMemo(()=>crmRoutes(basePath != null ? basePath : ''), [
108
+ basePath
109
+ ]);
110
+ const refresh = useCallback(()=>{
111
+ if (dataScope) {
112
+ invalidateAggregateReads(reportCachePrefix({
113
+ scope: dataScope,
114
+ tokens,
115
+ groupId
116
+ }));
117
+ }
118
+ // A new anchor is what changes every card's dependencies, so each read
119
+ // runs again and — its key forgotten — reaches the server.
120
+ setView((current)=>({
121
+ period: current.period,
122
+ nowMs: Date.now()
123
+ }));
124
+ }, [
125
+ dataScope,
126
+ tokens,
127
+ groupId
128
+ ]);
129
+ const report = useMemo(()=>dataScope ? {
130
+ scope: dataScope,
131
+ tokens,
132
+ groupId,
133
+ org: orgRecord,
134
+ period: view.period,
135
+ range,
136
+ nowMs: view.nowMs,
137
+ routes
138
+ } : null, [
139
+ dataScope,
140
+ tokens,
141
+ groupId,
142
+ orgRecord,
143
+ view,
144
+ range,
145
+ routes
146
+ ]);
147
+ /**
148
+ * Every contact this reader may see, counted once for the two cards that
149
+ * quote it — the tile, and the sample notice that compares the read to it.
150
+ */ const totalContacts = useAggregateRead(()=>dataScope ? getCountFromServer(query(scopedCollection(firestore, dataScope, 'contacts'), ...visibleToClause(tokens))).then((snapshot)=>snapshot.data().count) : null, // The anchor is a dependency so Refresh re-asks; the key, which omits
151
+ // it, is what answers a reopened section from memory.
152
+ [
153
+ firestore,
154
+ dataScope,
155
+ tokens,
156
+ view.nowMs
157
+ ], report ? {
158
+ cacheKey: reportCacheKey(report, 'contacts:total')
159
+ } : {});
160
+ return /*#__PURE__*/ _jsxs(Stack, {
161
+ spacing: 2,
162
+ children: [
163
+ /*#__PURE__*/ _jsxs(Stack, {
164
+ direction: "row",
165
+ spacing: 2,
166
+ sx: {
167
+ alignItems: 'center',
168
+ justifyContent: 'space-between',
169
+ flexWrap: 'wrap'
170
+ },
171
+ children: [
172
+ /*#__PURE__*/ _jsx(Typography, {
173
+ variant: "h6",
174
+ component: "h2",
175
+ children: 'Reports'
176
+ }),
177
+ /*#__PURE__*/ _jsxs(Stack, {
178
+ direction: "row",
179
+ spacing: 1,
180
+ sx: {
181
+ alignItems: 'center',
182
+ flexWrap: 'wrap',
183
+ rowGap: 1
184
+ },
185
+ children: [
186
+ /*#__PURE__*/ _jsx(ToggleButtonGroup, {
187
+ exclusive: true,
188
+ size: "small",
189
+ color: "primary",
190
+ value: view.period,
191
+ onChange: (_event, next)=>{
192
+ if (next) {
193
+ setView({
194
+ period: next,
195
+ nowMs: Date.now()
196
+ });
197
+ }
198
+ },
199
+ "aria-label": "Report period",
200
+ children: Aglyn.CRM_REPORT_PERIODS.map((period)=>/*#__PURE__*/ _jsx(ToggleButton, {
201
+ value: period,
202
+ children: Aglyn.CRM_REPORT_PERIOD_LABELS[period]
203
+ }, period))
204
+ }),
205
+ /*#__PURE__*/ _jsx(Button, {
206
+ size: "small",
207
+ startIcon: /*#__PURE__*/ _jsx(MdiIcon, {
208
+ path: mdiRefresh.path,
209
+ size: 0.8
210
+ }),
211
+ disabled: !report,
212
+ onClick: refresh,
213
+ children: 'Refresh'
214
+ })
215
+ ]
216
+ })
217
+ ]
218
+ }),
219
+ report ? /*#__PURE__*/ _jsxs(_Fragment, {
220
+ children: [
221
+ /*#__PURE__*/ _jsx(CardColumns, {
222
+ spacing: 2,
223
+ items: [
224
+ {
225
+ key: 'trend',
226
+ children: /*#__PURE__*/ _jsx(ContactsTrendCard, {
227
+ report: report,
228
+ totalContacts: totalContacts
229
+ })
230
+ },
231
+ {
232
+ key: 'mix',
233
+ children: /*#__PURE__*/ _jsx(ContactsMixCard, {
234
+ report: report,
235
+ totalContacts: totalContacts
236
+ })
237
+ },
238
+ {
239
+ key: 'source-conversion',
240
+ children: /*#__PURE__*/ _jsx(SourceConversionCard, {
241
+ report: report
242
+ })
243
+ },
244
+ {
245
+ key: 'lead-funnel',
246
+ children: /*#__PURE__*/ _jsx(LeadFunnelCard, {
247
+ report: report,
248
+ hostId: hostId
249
+ })
250
+ },
251
+ {
252
+ key: 'pipeline',
253
+ children: /*#__PURE__*/ _jsx(PipelineCard, {
254
+ report: report
255
+ })
256
+ },
257
+ {
258
+ key: 'closed',
259
+ /*
260
+ One column item carrying two cards, because multicol picks
261
+ its own break: two consecutive items are only USUALLY
262
+ adjacent, and a card that is a footnote to the one above it
263
+ cannot be left to that. Won and lost by owner asks a second
264
+ question of the very rows Won and lost already read — the
265
+ same window under the same `closed:won` and `closed:lost`
266
+ keys — so it is read as that card's breakdown, and
267
+ `break-inside: avoid` keeps the pair whole in one column.
268
+ */ children: /*#__PURE__*/ _jsxs(Stack, {
269
+ spacing: 2,
270
+ children: [
271
+ /*#__PURE__*/ _jsx(ClosedDealsCard, {
272
+ report: report
273
+ }),
274
+ /*#__PURE__*/ _jsx(WonLostByOwnerCard, {
275
+ report: report
276
+ })
277
+ ]
278
+ })
279
+ }
280
+ ]
281
+ }),
282
+ /*#__PURE__*/ _jsxs(Stack, {
283
+ spacing: 2,
284
+ children: [
285
+ /*#__PURE__*/ _jsx(ActivityCard, {
286
+ report: report
287
+ }),
288
+ /*#__PURE__*/ _jsx(ForecastCard, {
289
+ report: report
290
+ }),
291
+ /*#__PURE__*/ _jsx(TasksCard, {
292
+ report: report
293
+ })
294
+ ]
295
+ })
296
+ ]
297
+ }) : /*#__PURE__*/ _jsx(Typography, {
298
+ variant: "body2",
299
+ color: "text.secondary",
300
+ children: 'Loading…'
301
+ })
302
+ ]
303
+ });
304
+ }
305
+ ContactsReportsSection.displayName = 'ContactsReportsSection';
306
+ export default ContactsReportsSection;
307
+
308
+ //# sourceMappingURL=reports-section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/reports-section.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport type { ConsolePluginPageProps } from '@aglyn/aglyn'\nimport { mdiRefresh } from '@aglyn/shared-data-mdi'\nimport {\n MdiIcon } from '@aglyn/shared-ui-jsx'\nimport { CardColumns } from '@aglyn/shared-ui-jsx/components/card-columns'\nimport {\n Button,\n Stack,\n ToggleButton,\n ToggleButtonGroup,\n Typography,\n} from '@mui/material'\nimport { getCountFromServer, query } from 'firebase/firestore'\nimport { useCallback, useMemo, useState } from 'react'\nimport { useFirestore } from '@aglyn/tenant-feature-instance'\nimport { useCrmScope } from '../hooks/use-crm-scope'\nimport { crmRoutes } from '../model/crm-routes'\nimport { ActivityCard } from './reports/activity-card'\nimport { ClosedDealsCard } from './reports/closed-deals-card'\nimport { ContactsMixCard } from './reports/contacts-mix-card'\nimport { ContactsTrendCard } from './reports/contacts-trend-card'\nimport { ForecastCard } from './reports/forecast-card'\nimport { LeadFunnelCard } from './reports/lead-funnel-card'\nimport { PipelineCard } from './reports/pipeline-card'\nimport { SourceConversionCard } from './reports/source-conversion-card'\nimport { WonLostByOwnerCard } from './reports/won-lost-by-owner-card'\nimport {\n type CrmReportScope,\n reportCacheKey,\n reportCachePrefix,\n scopedCollection,\n visibleToClause,\n} from './reports/report-scope'\nimport { TasksCard } from './reports/tasks-card'\nimport { invalidateAggregateReads, useAggregateRead } from './reports/use-aggregate-read'\n\n/**\n * `/crm/reports` — the CRM in aggregate (AGL-2604, AGL-2624).\n *\n * Nine cards, each reading its own collection: contacts over time, contacts\n * by source and stage, which sources convert, this site's lead funnel, the\n * open pipeline, what closed, who logged what, the forecast by close month\n * (AGL-2620, over the pipeline card's own window), and the task load. This\n * section resolves what they share and hands it down — see `CrmReportScope`\n * — so that every card counts the same reader's records over the same\n * clock. The lead funnel is the one card handed the site as well: leads live\n * under the host, not the org.\n *\n * ## The period is a control, and the reads follow it\n *\n * Nothing on this page reads a year on mount. The picker names the period,\n * the period sizes every read (one count per week of it, the deals closed\n * within it), and the default is thirty days. The three cards that are\n * stocks rather than flows — the open pipeline, its forecast, the open\n * tasks — ignore the period because \"what is open\" has no period.\n *\n * ## Scoped like the list\n *\n * Every query carries `visibleTo array-contains-any` over the group's\n * tokens, the predicate the rules evaluate, so a report can never count a\n * record its reader could not open — and the total here is the reader's\n * total, not the org's billable audience, which is the head-count the\n * contacts list keeps for the quota.\n *\n * ## Read once a minute, not once an arrival\n *\n * Every read on this page is keyed by the scope and the period and kept\n * for `AGGREGATE_READ_TTL_MS` — see `useAggregateRead` — so leaving to open\n * a deal the report named and coming straight back costs nothing. Refresh\n * forgets this reader's answers for this org and anchors the period again,\n * which is what makes every card ask afresh.\n */\nexport function ContactsReportsSection(props: ConsolePluginPageProps) {\n const { hostId, org, basePath } = props\n const firestore = useFirestore()\n // The org data root — null until the org lookup settles, and the page\n // reads nothing until it does — and the controller this page is viewed\n // as, resolved the way every CRM surface resolves them so the facet a\n // stage is read from here is the facet the contacts list edits it in.\n const { scope: dataScope, consentGroup, visibleTo } = useCrmScope({ hostId, org })\n // `null` at the organization level (AGL-2630): no clause, and every card\n // totals every site; the holder is then each contact's own.\n const tokens = useMemo(() => (visibleTo ? [...visibleTo] : null), [visibleTo])\n const groupId = consentGroup?.groupId ?? null\n const orgRecord = (org ?? null) as Record<string, unknown> | null\n /*\n * The period AND the moment it was chosen, as one value: the range is\n * anchored when the reader picks, not re-derived from a moving `Date.now()`\n * per render, which would rebuild every query on every pass.\n */\n const [view, setView] = useState<{\n period: Aglyn.CrmReportPeriod\n nowMs: number\n }>(() => ({ period: '30d', nowMs: Date.now() }))\n const range = useMemo(\n () => Aglyn.crmReportRange(view.period, view.nowMs),\n [view],\n )\n const routes = useMemo(() => crmRoutes(basePath ?? ''), [basePath])\n const refresh = useCallback(() => {\n if (dataScope) {\n invalidateAggregateReads(reportCachePrefix({ scope: dataScope, tokens, groupId }))\n }\n // A new anchor is what changes every card's dependencies, so each read\n // runs again and — its key forgotten — reaches the server.\n setView((current) => ({ period: current.period, nowMs: Date.now() }))\n }, [dataScope, tokens, groupId])\n\n const report = useMemo<CrmReportScope | null>(\n () =>\n dataScope\n ? {\n scope: dataScope,\n tokens,\n groupId,\n org: orgRecord,\n period: view.period,\n range,\n nowMs: view.nowMs,\n routes,\n }\n : null,\n [dataScope, tokens, groupId, orgRecord, view, range, routes],\n )\n\n /**\n * Every contact this reader may see, counted once for the two cards that\n * quote it — the tile, and the sample notice that compares the read to it.\n */\n const totalContacts = useAggregateRead<number>(\n () =>\n dataScope\n ? getCountFromServer(\n query(\n scopedCollection(firestore, dataScope, 'contacts'),\n ...visibleToClause(tokens),\n ),\n ).then((snapshot) => snapshot.data().count)\n : null,\n // The anchor is a dependency so Refresh re-asks; the key, which omits\n // it, is what answers a reopened section from memory.\n [firestore, dataScope, tokens, view.nowMs],\n report ? { cacheKey: reportCacheKey(report, 'contacts:total') } : {},\n )\n\n return (\n <Stack spacing={2}>\n <Stack\n direction=\"row\"\n spacing={2}\n sx={{\n alignItems: 'center',\n justifyContent: 'space-between',\n flexWrap: 'wrap',\n }}\n >\n <Typography variant=\"h6\" component=\"h2\">\n {'Reports'}\n </Typography>\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center', flexWrap: 'wrap', rowGap: 1 }}>\n <ToggleButtonGroup\n exclusive\n size=\"small\"\n color=\"primary\"\n value={view.period}\n onChange={(_event, next) => {\n if (next) {\n setView({ period: next as Aglyn.CrmReportPeriod, nowMs: Date.now() })\n }\n }}\n aria-label=\"Report period\"\n >\n {Aglyn.CRM_REPORT_PERIODS.map((period) => (\n <ToggleButton key={period} value={period}>\n {Aglyn.CRM_REPORT_PERIOD_LABELS[period]}\n </ToggleButton>\n ))}\n </ToggleButtonGroup>\n <Button\n size=\"small\"\n startIcon={<MdiIcon path={mdiRefresh.path} size={0.8} />}\n disabled={!report}\n onClick={refresh}\n >\n {'Refresh'}\n </Button>\n </Stack>\n </Stack>\n {report ? (\n <>\n {/*\n The same masonry the billing and staff pages use: columns as tall\n as their own contents, so a short card beside a tall one leaves no\n hole. Measured live before this changed — 271, 272 and 111 pixels\n of dead space down one report, and an odd card stranded with an\n empty column beside it.\n */}\n <CardColumns\n spacing={2}\n items={[\n {\n key: 'trend',\n children: (\n <ContactsTrendCard report={report} totalContacts={totalContacts} />\n ),\n },\n {\n key: 'mix',\n children: (\n <ContactsMixCard report={report} totalContacts={totalContacts} />\n ),\n },\n { key: 'source-conversion', children: <SourceConversionCard report={report} /> },\n { key: 'lead-funnel', children: <LeadFunnelCard report={report} hostId={hostId} /> },\n { key: 'pipeline', children: <PipelineCard report={report} /> },\n {\n key: 'closed',\n /*\n One column item carrying two cards, because multicol picks\n its own break: two consecutive items are only USUALLY\n adjacent, and a card that is a footnote to the one above it\n cannot be left to that. Won and lost by owner asks a second\n question of the very rows Won and lost already read — the\n same window under the same `closed:won` and `closed:lost`\n keys — so it is read as that card's breakdown, and\n `break-inside: avoid` keeps the pair whole in one column.\n */\n children: (\n <Stack spacing={2}>\n <ClosedDealsCard report={report} />\n <WonLostByOwnerCard report={report} />\n </Stack>\n ),\n },\n ]}\n />\n {/*\n Outside the columns: multicol cannot span, and these three read\n across the full width.\n */}\n <Stack spacing={2}>\n <ActivityCard report={report} />\n <ForecastCard report={report} />\n <TasksCard report={report} />\n </Stack>\n </>\n ) : (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Loading…'}\n </Typography>\n )}\n </Stack>\n )\n}\nContactsReportsSection.displayName = 'ContactsReportsSection'\n\nexport default ContactsReportsSection\n"],"names":["Aglyn","mdiRefresh","MdiIcon","CardColumns","Button","Stack","ToggleButton","ToggleButtonGroup","Typography","getCountFromServer","query","useCallback","useMemo","useState","useFirestore","useCrmScope","crmRoutes","ActivityCard","ClosedDealsCard","ContactsMixCard","ContactsTrendCard","ForecastCard","LeadFunnelCard","PipelineCard","SourceConversionCard","WonLostByOwnerCard","reportCacheKey","reportCachePrefix","scopedCollection","visibleToClause","TasksCard","invalidateAggregateReads","useAggregateRead","ContactsReportsSection","props","hostId","org","basePath","firestore","scope","dataScope","consentGroup","visibleTo","tokens","groupId","orgRecord","view","setView","period","nowMs","Date","now","range","crmReportRange","routes","refresh","current","report","totalContacts","then","snapshot","data","count","cacheKey","spacing","direction","sx","alignItems","justifyContent","flexWrap","variant","component","rowGap","exclusive","size","color","value","onChange","_event","next","aria-label","CRM_REPORT_PERIODS","map","CRM_REPORT_PERIOD_LABELS","startIcon","path","disabled","onClick","items","key","children","displayName"],"mappings":"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"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export interface SendingAddressesCardProps {
18
+ /** The workspace the list is kept in, or `null` until the scope resolves. */
19
+ orgId: string | null;
20
+ /** Whether the scope is known, so the list may be asked for. */
21
+ ready: boolean;
22
+ }
23
+ /** The one sentence that says what the list is for. */
24
+ export declare const SENDING_ADDRESSES_EXPLANATION = "Emails you send from these addresses and BCC to your capture address are filed under the person you wrote to.";
25
+ /** The state of an address whose confirmation email has gone out. */
26
+ export declare const VERIFICATION_SENT_LABEL = "Verification email sent";
27
+ /** The state of an address the member has confirmed. */
28
+ export declare const VERIFIED_LABEL = "Verified";
29
+ /**
30
+ * "Your sending addresses" — the signed-in member's own addresses in this
31
+ * workspace (AGL-2975), beside the Email capture card they are for.
32
+ *
33
+ * A member who sends outreach from an address they do not sign in with — a
34
+ * Gmail send-as alias on an outbound domain — adds it here. It is sent a
35
+ * verification email, and once the member opens that link while signed in
36
+ * the address is theirs: a message from it copied to the capture address is
37
+ * filed under the person it was written to, not under the alias. Until
38
+ * then the address does nothing, which is why its state is printed on the
39
+ * row rather than implied.
40
+ *
41
+ * The list is each member's own, so every member sees and edits only theirs,
42
+ * under a site or at the organization level alike. The verification link
43
+ * lands back on this page, and this card is what redeems it.
44
+ */
45
+ export declare function SendingAddressesCard(props: SendingAddressesCardProps): import("react").JSX.Element;
46
+ export declare namespace SendingAddressesCard {
47
+ var displayName: string;
48
+ }
49
+ export default SendingAddressesCard;
@@ -0,0 +1,262 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ 'use client';
17
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
+ import { pluginDocsHelp } from "@aglyn/aglyn";
19
+ import { MEMBER_EMAIL_ALIAS_CONFIRM_PARAM, MEMBER_EMAIL_ALIASES_MAX } from "@aglyn/aglyn/app-utils/member-email-aliases";
20
+ import { CardDisplay, useConfirmationContext } from "@aglyn/shared-ui-jsx";
21
+ import { useSnackbar } from "@aglyn/shared-ui-snackstack";
22
+ import { Box, Button, Chip, List, ListItem, ListItemText, Stack, TextField, Typography } from "@mui/material";
23
+ import { useEffect, useRef, useState } from "react";
24
+ import { useMemberEmailAliases } from "./use-member-email-aliases.js";
25
+ /** The one sentence that says what the list is for. */ export const SENDING_ADDRESSES_EXPLANATION = 'Emails you send from these addresses and BCC to your capture address are filed under the person you wrote to.';
26
+ /** The state of an address whose confirmation email has gone out. */ export const VERIFICATION_SENT_LABEL = 'Verification email sent';
27
+ /** The state of an address the member has confirmed. */ export const VERIFIED_LABEL = 'Verified';
28
+ /**
29
+ * "Your sending addresses" — the signed-in member's own addresses in this
30
+ * workspace (AGL-2975), beside the Email capture card they are for.
31
+ *
32
+ * A member who sends outreach from an address they do not sign in with — a
33
+ * Gmail send-as alias on an outbound domain — adds it here. It is sent a
34
+ * verification email, and once the member opens that link while signed in
35
+ * the address is theirs: a message from it copied to the capture address is
36
+ * filed under the person it was written to, not under the alias. Until
37
+ * then the address does nothing, which is why its state is printed on the
38
+ * row rather than implied.
39
+ *
40
+ * The list is each member's own, so every member sees and edits only theirs,
41
+ * under a site or at the organization level alike. The verification link
42
+ * lands back on this page, and this card is what redeems it.
43
+ */ export function SendingAddressesCard(props) {
44
+ const { orgId, ready } = props;
45
+ const enabled = ready && Boolean(orgId);
46
+ const aliases = useMemberEmailAliases(orgId, {
47
+ enabled
48
+ });
49
+ const { enqueueSnackbar } = useSnackbar();
50
+ const { confirm } = useConfirmationContext();
51
+ const [draft, setDraft] = useState('');
52
+ // The verification link, redeemed once. The token leaves the address bar
53
+ // at once, so a copied or bookmarked URL does not carry it around.
54
+ const redeemed = useRef(false);
55
+ const confirmAddress = aliases.confirm;
56
+ useEffect(()=>{
57
+ if (!enabled || redeemed.current || typeof window === 'undefined') return;
58
+ const params = new URLSearchParams(window.location.search);
59
+ const token = params.get(MEMBER_EMAIL_ALIAS_CONFIRM_PARAM);
60
+ if (!token) return;
61
+ redeemed.current = true;
62
+ params.delete(MEMBER_EMAIL_ALIAS_CONFIRM_PARAM);
63
+ const query = params.toString();
64
+ window.history.replaceState(window.history.state, '', `${window.location.pathname}${query ? `?${query}` : ''}${window.location.hash}`);
65
+ void confirmAddress(token).then((result)=>{
66
+ var _result_payload_address;
67
+ if (result.ok === false) {
68
+ enqueueSnackbar(result.error, {
69
+ variant: 'error',
70
+ allowDuplicate: true
71
+ });
72
+ return;
73
+ }
74
+ enqueueSnackbar(`${String((_result_payload_address = result.payload['address']) != null ? _result_payload_address : 'Address')} verified`, {
75
+ variant: 'success'
76
+ });
77
+ });
78
+ }, [
79
+ enabled,
80
+ confirmAddress,
81
+ enqueueSnackbar
82
+ ]);
83
+ const handleAdd = async ()=>{
84
+ const address = draft.trim();
85
+ if (!address) return;
86
+ const result = await aliases.add(address);
87
+ if (result.ok === false) {
88
+ enqueueSnackbar(result.error, {
89
+ variant: 'error',
90
+ allowDuplicate: true
91
+ });
92
+ return;
93
+ }
94
+ setDraft('');
95
+ enqueueSnackbar(VERIFICATION_SENT_LABEL, {
96
+ variant: 'success'
97
+ });
98
+ };
99
+ const handleResend = async (address)=>{
100
+ const result = await aliases.resend(address);
101
+ if (result.ok === false) {
102
+ enqueueSnackbar(result.error, {
103
+ variant: 'error',
104
+ allowDuplicate: true
105
+ });
106
+ return;
107
+ }
108
+ enqueueSnackbar(VERIFICATION_SENT_LABEL, {
109
+ variant: 'success'
110
+ });
111
+ };
112
+ const handleRemove = async (address, verified)=>{
113
+ if (verified) {
114
+ const confirmed = await confirm({
115
+ title: `Remove ${address}?`,
116
+ description: 'Email you send from it stops being filed as yours. Adding it again ' + 'sends a new verification email.',
117
+ confirmationText: 'Remove',
118
+ confirmationButtonProps: {
119
+ color: 'error'
120
+ }
121
+ }).then(()=>true).catch(()=>false);
122
+ if (!confirmed) return;
123
+ }
124
+ const result = await aliases.remove(address);
125
+ if (result.ok === false) {
126
+ enqueueSnackbar(result.error, {
127
+ variant: 'error',
128
+ allowDuplicate: true
129
+ });
130
+ return;
131
+ }
132
+ enqueueSnackbar('Address removed', {
133
+ variant: 'success',
134
+ persist: false
135
+ });
136
+ };
137
+ const atCap = aliases.aliases.length >= MEMBER_EMAIL_ALIASES_MAX;
138
+ const canEdit = enabled && aliases.status === 'ready' && !aliases.busy;
139
+ return /*#__PURE__*/ _jsx(CardDisplay, {
140
+ header: 'Your sending addresses',
141
+ help: pluginDocsHelp('crmSettings', {
142
+ anchor: '#your-sending-addresses'
143
+ }),
144
+ contentGutterX: true,
145
+ contentGutterY: true,
146
+ children: /*#__PURE__*/ _jsxs(Stack, {
147
+ spacing: 1.5,
148
+ sx: {
149
+ maxWidth: 560
150
+ },
151
+ children: [
152
+ /*#__PURE__*/ _jsx(Typography, {
153
+ variant: "body2",
154
+ color: "text.secondary",
155
+ children: SENDING_ADDRESSES_EXPLANATION
156
+ }),
157
+ aliases.signInEmail ? /*#__PURE__*/ _jsx(Typography, {
158
+ variant: "caption",
159
+ color: "text.secondary",
160
+ children: `You sign in as ${aliases.signInEmail}, which already counts as yours.`
161
+ }) : null,
162
+ aliases.status === 'error' ? /*#__PURE__*/ _jsx(Typography, {
163
+ variant: "body2",
164
+ color: "error",
165
+ children: aliases.error
166
+ }) : null,
167
+ aliases.aliases.length > 0 ? /*#__PURE__*/ _jsx(Box, {
168
+ sx: {
169
+ border: 1,
170
+ borderColor: 'divider',
171
+ borderRadius: 2,
172
+ overflow: 'hidden'
173
+ },
174
+ children: /*#__PURE__*/ _jsx(List, {
175
+ dense: true,
176
+ disablePadding: true,
177
+ "aria-label": "Your sending addresses",
178
+ children: aliases.aliases.map((row)=>/*#__PURE__*/ _jsx(ListItem, {
179
+ divider: true,
180
+ secondaryAction: /*#__PURE__*/ _jsxs(Stack, {
181
+ direction: "row",
182
+ spacing: 1,
183
+ sx: {
184
+ alignItems: 'center'
185
+ },
186
+ children: [
187
+ !row.verified ? /*#__PURE__*/ _jsx(Button, {
188
+ size: "small",
189
+ disabled: !canEdit,
190
+ "aria-label": `Resend the verification email to ${row.address}`,
191
+ onClick: ()=>void handleResend(row.address),
192
+ children: 'Resend'
193
+ }) : null,
194
+ /*#__PURE__*/ _jsx(Button, {
195
+ size: "small",
196
+ color: "error",
197
+ disabled: !canEdit,
198
+ "aria-label": `Remove ${row.address}`,
199
+ onClick: ()=>void handleRemove(row.address, row.verified),
200
+ children: 'Remove'
201
+ })
202
+ ]
203
+ }),
204
+ children: /*#__PURE__*/ _jsx(ListItemText, {
205
+ primary: row.address,
206
+ secondary: /*#__PURE__*/ _jsx(Chip, {
207
+ size: "small",
208
+ variant: "outlined",
209
+ color: row.verified ? 'success' : 'warning',
210
+ label: row.verified ? VERIFIED_LABEL : VERIFICATION_SENT_LABEL,
211
+ sx: {
212
+ mt: 0.5
213
+ }
214
+ }),
215
+ slotProps: {
216
+ secondary: {
217
+ component: 'div'
218
+ }
219
+ }
220
+ })
221
+ }, row.address))
222
+ })
223
+ }) : null,
224
+ /*#__PURE__*/ _jsxs(Stack, {
225
+ direction: "row",
226
+ spacing: 1,
227
+ sx: {
228
+ alignItems: 'flex-start'
229
+ },
230
+ children: [
231
+ /*#__PURE__*/ _jsx(TextField, {
232
+ size: "small",
233
+ fullWidth: true,
234
+ type: "email",
235
+ label: "Add an address you send from",
236
+ value: draft,
237
+ disabled: !canEdit || atCap,
238
+ onChange: (event)=>setDraft(event.target.value),
239
+ onKeyDown: (event)=>{
240
+ if (event.key === 'Enter') void handleAdd();
241
+ },
242
+ helperText: atCap ? `You can keep up to ${MEMBER_EMAIL_ALIASES_MAX} addresses.` : 'We email it a link. It counts once you open that link while signed in.'
243
+ }),
244
+ /*#__PURE__*/ _jsx(Button, {
245
+ variant: "outlined",
246
+ disabled: !canEdit || atCap || !draft.trim(),
247
+ onClick: ()=>void handleAdd(),
248
+ sx: {
249
+ mt: 0.25
250
+ },
251
+ children: 'Add'
252
+ })
253
+ ]
254
+ })
255
+ ]
256
+ })
257
+ });
258
+ }
259
+ SendingAddressesCard.displayName = 'SendingAddressesCard';
260
+ export default SendingAddressesCard;
261
+
262
+ //# sourceMappingURL=sending-addresses-card.js.map