@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 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/deals-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 {\n type ConsolePluginPageProps,\n type CrmDealStatus,\n dealStageById,\n filterByNextActivity,\n findOrgMember,\n isNoNextActivityClause,\n ORG_SCOPE_TOKEN,\n pluginDocsHelp,\n} from '@aglyn/aglyn'\nimport {\n mdiCogOutline,\n mdiPlus,\n mdiTableLarge,\n mdiViewColumnOutline,\n} from '@aglyn/shared-data-mdi'\nimport { CardDisplay, MdiIcon } from '@aglyn/shared-ui-jsx'\nimport { ListPagination } from '@aglyn/shared-ui-jsx/components/list-pagination.component'\nimport { ListTable } from '@aglyn/shared-ui-jsx/components/list-table.component'\nimport { useCrmSavedView } from '../hooks/use-crm-saved-view'\nimport { useCrmViewGrid } from '../hooks/use-crm-view-grid'\nimport { CRM_LIST_SLOTS, CrmColumnOrderProvider } from './crm-column-menu'\nimport { NoNextActivityToggle, nextActivityColumn } from './crm-next-activity-column'\nimport CrmViewsControl from './crm-views-control'\nimport EmptyStateComponent from '@aglyn/shared-ui-jsx/components/empty-state.component'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport {\n Alert,\n Button,\n Chip,\n CircularProgress,\n MenuItem,\n Stack,\n TextField,\n ToggleButton,\n ToggleButtonGroup,\n Typography,\n} from '@mui/material'\nimport type { GridColDef } from '@mui/x-data-grid'\nimport { useRouter } from 'next/navigation'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { useContactFieldDefinitions } from '../hooks/use-contact-field-definitions'\nimport { useCrmScope } from '../hooks/use-crm-scope'\nimport { useDealStageApi } from '../hooks/use-deal-stage-api'\nimport {\n BOARD_CLOSED_LIMIT,\n BOARD_OPEN_LIMIT,\n useDealsByStatus,\n usePagedDeals,\n} from '../hooks/use-deals'\nimport { useOrgMemberDirectory } from '../hooks/use-org-member-directory'\nimport { usePipeline } from '../hooks/use-pipeline'\nimport { downloadTextFile } from '../model/contacts-csv'\nimport { crmRoutes } from '../model/crm-routes'\nimport { type DealCsvOptions, dealsCsv } from '../model/deals-csv'\nimport {\n boardSummary,\n DEAL_STATUS_LABELS,\n type DealDoc,\n formatAmountByCurrency,\n formatMoney,\n} from '../model/deal-board-model'\nimport { customFieldColumns } from './contact-custom-columns'\nimport { DealBoard } from './deal-board'\nimport { DealEditDrawer } from './deal-edit-drawer'\nimport { DealImportButton } from './deal-import-drawer'\nimport DealsBulkBar from './deals-bulk-bar'\nimport { LostReasonDialog } from './lost-reason-dialog'\nimport { OwnerAvatar } from './owner-avatar'\nimport { PipelinesDialog } from './pipelines-dialog'\n\ntype View = 'board' | 'table'\ntype StatusFilter = CrmDealStatus | 'all'\n\n\n/** What a pipeline made at the organization level is stamped with — the org's own token. */\nconst ORG_PIPELINE_TOKENS: readonly string[] = [ORG_SCOPE_TOKEN]\n\n/**\n * `/crm/deals` — the pipeline (AGL-2598).\n *\n * ## Two views of one pipeline\n *\n * The BOARD is one pipeline's open deals, one column per open stage, read\n * in one bounded listener over `(visibleTo, pipelineId, status, updatedAt)`\n * and sorted into columns here — a listener per column would be five\n * subscriptions for one board. The TABLE is the same pipeline's deals,\n * paged by the query, with a status toggle; it is where the closed history\n * is found. The three figures above both come from the board's read, so\n * they describe what is in play whichever view is showing.\n *\n * ## Which pipeline\n *\n * The switcher in the header (AGL-2620) picks among the ACTIVE pipelines\n * and opens on the default; the board, the table, the figures and the New\n * deal drawer all follow it. It is section state rather than a route: a\n * pipeline is a lens on the section, and a saved view that names one\n * composes with it. **Pipelines** opens the dialog that creates, renames,\n * defaults, archives and — through it — edits the stages of each.\n *\n * ## Every move goes through the route\n *\n * A drag, a card's \"Move to\", \"Mark won\" and \"Mark lost\" all end in\n * `useDealStageApi`, never a Firestore write: the stage is the fact the\n * automations listen for, and only the server emits the event. The section\n * marks the card pending while the request runs and lets the listener land\n * it — see `DealBoard` for why a move is not applied optimistically.\n *\n * ## Creation is a button\n *\n * \"New deal\" opens a drawer; there is no form above the list. The drawer\n * writes client-direct against the rules, stamped with this console's scope.\n *\n * ## The table selects and exports (AGL-2621)\n *\n * The table's rows are selectable, and a selection raises `DealsBulkBar`\n * over it — whose stage moves go through the same `useDealStageApi` as a\n * drag. Export CSV beside the status toggle writes the page through\n * `dealsCsv()`, naming the pipeline, the stage and the owner; the bar\n * writes the same file over the selection.\n */\nexport function DealsSection(props: ConsolePluginPageProps) {\n const { hostId, org, basePath } = props\n const routes = crmRoutes(basePath ?? '')\n const router = useRouter()\n const { enqueueSnackbar } = useSnackbar()\n const scope = useCrmScope({ hostId, org })\n const pipelineState = usePipeline(scope.orgId, {\n hostId,\n org: (org ?? null) as Record<string, unknown> | null,\n })\n const { activePipelines } = pipelineState\n const [pipelineId, setPipelineId] = useState<string | null>(null)\n // The chosen pipeline while it is still active; else the default. A\n // pipeline archived from another tab falls back rather than leaving the\n // board on a pipeline the picker no longer lists.\n const pipeline =\n (pipelineId ? activePipelines.find((entry) => entry.$id === pipelineId) : null) ??\n pipelineState.pipeline\n const roster = useOrgMemberDirectory(scope.orgId)\n const api = useDealStageApi(hostId)\n const nowMs = useMemo(() => Date.now(), [])\n // The org's deal fields, for the table's optional columns (AGL-2661).\n const dealFields = useContactFieldDefinitions(scope.orgId, 'deal')\n\n const [view, setView] = useState<View>('board')\n const [closedExpanded, setClosedExpanded] = useState(false)\n /*\n * The table's status filter is the saved VIEW'S (AGL-2617): a view of\n * deals is a view of the table, and it holds the status beside the\n * columns and the sort. Opening one shows the table, because the board\n * has no columns to arrange and answers to the pipeline's stages alone.\n */\n const views = useCrmSavedView({\n section: 'deals',\n hostId,\n org,\n basePath: basePath ?? '',\n })\n const statusFilter: StatusFilter = useMemo(() => {\n const value = views.state.filters.find((clause) => clause.field === 'status')?.value\n return value === 'open' || value === 'won' || value === 'lost' ? value : 'all'\n }, [views.state.filters])\n // The status is the query's clause; the \"No next activity\" clause beside\n // it (AGL-2661) narrows the loaded page and survives a status change.\n const viewFilters = views.state.filters\n const setStatusFilter = useCallback(\n (next: StatusFilter) =>\n views.setFilters([\n ...(next === 'all' ? [] : [{ field: 'status', op: 'equals', value: next }]),\n ...viewFilters.filter(isNoNextActivityClause),\n ]),\n [views.setFilters, viewFilters],\n )\n useEffect(() => {\n if (views.currentId) setView('table')\n }, [views.currentId])\n\n // The board's read stays on in the table view too: it is what the summary\n // above both views is computed from, and it is already bounded.\n const open = useDealsByStatus(\n scope.orgId,\n scope.visibleTo,\n pipeline?.$id ?? null,\n 'open',\n BOARD_OPEN_LIMIT,\n )\n const closedPipelineId =\n view === 'board' && closedExpanded ? (pipeline?.$id ?? null) : null\n const won = useDealsByStatus(scope.orgId, scope.visibleTo, closedPipelineId, 'won', BOARD_CLOSED_LIMIT)\n const lost = useDealsByStatus(scope.orgId, scope.visibleTo, closedPipelineId, 'lost', BOARD_CLOSED_LIMIT)\n const paged = usePagedDeals(\n view === 'table' ? scope.orgId : null,\n scope.visibleTo,\n statusFilter,\n pipeline?.$id ?? null,\n )\n\n const summary = useMemo(() => boardSummary(open.data, pipeline), [open.data, pipeline])\n\n /*\n * MOVES IN FLIGHT. A card in this set is dimmed and cannot be dragged\n * again until the route answers; the listener is what moves it.\n */\n const [moving, setMoving] = useState<ReadonlySet<string>>(() => new Set())\n const track = useCallback(\n async (deal: DealDoc, request: () => Promise<unknown>, done: string) => {\n setMoving((current) => new Set(current).add(deal.$id))\n try {\n await request()\n enqueueSnackbar(done, { variant: 'success', persist: false })\n return true\n } catch (error) {\n enqueueSnackbar(\n error instanceof Error ? error.message : 'The deal could not be moved.',\n { variant: 'warning', allowDuplicate: true },\n )\n return false\n } finally {\n setMoving((current) => {\n const next = new Set(current)\n next.delete(deal.$id)\n return next\n })\n }\n },\n [enqueueSnackbar],\n )\n const handleMove = useCallback(\n (deal: DealDoc, stageId: string) => {\n const stage = dealStageById(pipeline, stageId)\n void track(\n deal,\n () => api.moveToStage(deal, stageId),\n `Moved to ${stage?.name ?? 'stage'}`,\n )\n },\n [api, pipeline, track],\n )\n const handleWon = useCallback(\n (deal: DealDoc) => void track(deal, () => api.markWon(deal), 'Deal won'),\n [api, track],\n )\n const [losing, setLosing] = useState<DealDoc | null>(null)\n const handleLost = useCallback((deal: DealDoc) => setLosing(deal), [])\n const confirmLost = useCallback(\n (reason: string) => {\n const deal = losing\n if (!deal) return\n setLosing(null)\n void track(deal, () => api.markLost(deal, reason), 'Deal marked lost')\n },\n [api, losing, track],\n )\n\n const openDeal = useCallback(\n (deal: DealDoc) => router.push(routes.deal(deal.$id)),\n [router, routes],\n )\n\n const [creating, setCreating] = useState(false)\n const [managingPipelines, setManagingPipelines] = useState(false)\n\n const [selectedIds, setSelectedIds] = useState<string[]>([])\n // A page or a status is a different set of rows; a selection made on\n // the last one would be a count over rows no longer on screen.\n useEffect(() => setSelectedIds([]), [statusFilter, paged.page])\n const csvOptions: DealCsvOptions = useMemo(\n () => ({\n pipelineName: (id) => pipelineState.pipelineById(id)?.name,\n stageName: (pipelineId, stageId) =>\n dealStageById(pipelineState.pipelineById(pipelineId), stageId)?.name,\n ownerEmail: (uid) => {\n const member = findOrgMember(roster.members, uid)\n return member?.email || member?.label || uid\n },\n }),\n [pipelineState, roster.members],\n )\n const handleExport = useCallback(() => {\n downloadTextFile('deals.csv', 'text/csv', dealsCsv(paged.rows, csvOptions))\n }, [paged.rows, csvOptions])\n\n const columns: GridColDef[] = useMemo(\n () => [\n {\n field: 'title',\n headerName: 'Deal',\n flex: 1.6,\n minWidth: 220,\n renderCell: ({ row }: { row: DealDoc }) => {\n const withWhom = [row.contactName, row.companyName].filter(Boolean).join(' · ')\n return (\n <Stack sx={{ justifyContent: 'center', lineHeight: 1.25 }}>\n <Typography variant=\"body2\" sx={{ lineHeight: 1.25 }}>\n {row.title || 'Untitled deal'}\n </Typography>\n {withWhom ? (\n <Typography variant=\"caption\" color=\"text.secondary\" noWrap sx={{ lineHeight: 1.25 }}>\n {withWhom}\n </Typography>\n ) : null}\n </Stack>\n )\n },\n },\n {\n field: 'stageId',\n headerName: 'Stage',\n flex: 0.9,\n minWidth: 140,\n valueGetter: (_value: unknown, row: DealDoc) =>\n dealStageById(pipelineState.pipelineById(row.pipelineId), row.stageId)?.name ??\n row.stageId,\n },\n {\n field: 'amountCents',\n headerName: 'Amount',\n flex: 0.8,\n minWidth: 120,\n align: 'right',\n headerAlign: 'right',\n valueGetter: (_value: unknown, row: DealDoc) => row.amountCents ?? null,\n renderCell: ({ row }: { row: DealDoc }) =>\n typeof row.amountCents === 'number' ? formatMoney(row.amountCents, row.currency) : '—',\n },\n {\n field: 'ownerUid',\n headerName: 'Owner',\n flex: 0.9,\n minWidth: 140,\n valueGetter: (_value: unknown, row: DealDoc) => roster.nameOf(row.ownerUid),\n renderCell: ({ row }: { row: DealDoc }) => {\n const label = roster.nameOf(row.ownerUid)\n return label ? (\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <OwnerAvatar label={label} size={22} />\n <Typography variant=\"body2\" noWrap>\n {label}\n </Typography>\n </Stack>\n ) : (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'—'}\n </Typography>\n )\n },\n },\n {\n field: 'expectedCloseAtMs',\n headerName: 'Expected close',\n flex: 0.8,\n minWidth: 130,\n type: 'date',\n valueGetter: (_value: unknown, row: DealDoc) =>\n typeof row.expectedCloseAtMs === 'number' ? new Date(row.expectedCloseAtMs) : null,\n renderCell: ({ row }: { row: DealDoc }) =>\n typeof row.expectedCloseAtMs === 'number'\n ? new Date(row.expectedCloseAtMs).toLocaleDateString()\n : '—',\n },\n {\n field: 'status',\n headerName: 'Status',\n flex: 0.6,\n minWidth: 100,\n renderCell: ({ row }: { row: DealDoc }) => (\n <Chip\n size=\"small\"\n label={DEAL_STATUS_LABELS[row.status] ?? row.status}\n color={row.status === 'won' ? 'success' : row.status === 'lost' ? 'default' : 'primary'}\n variant={row.status === 'open' ? 'outlined' : 'filled'}\n />\n ),\n },\n // When the earliest open task against the deal is due (AGL-2661).\n nextActivityColumn(nowMs),\n // The org's deal fields as optional columns (AGL-2661).\n ...customFieldColumns(dealFields.active),\n ],\n [pipelineState, roster, dealFields.active, nowMs],\n )\n const tableRows = useMemo(\n () => filterByNextActivity(paged.rows, viewFilters),\n [paged.rows, viewFilters],\n )\n /* The table's column and sort models are the view's (AGL-2617). */\n const grid = useCrmViewGrid(views, columns)\n\n const noOrg = scope.ready && !scope.orgId\n const pipelineLoading =\n !noOrg && (pipelineState.status === 'loading' || pipelineState.seeding || (!pipeline && pipelineState.status !== 'error'))\n\n return (\n <>\n <CardDisplay\n header={'Deals'}\n help={pluginDocsHelp('deals', { anchor: '#the-board-and-the-table' })}\n actions={\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n {activePipelines.length > 1 ? (\n <TextField\n select\n size=\"small\"\n label=\"Pipeline\"\n value={pipeline?.$id ?? ''}\n onChange={(event) => setPipelineId(event.target.value)}\n sx={{ minWidth: 160 }}\n slotProps={{ select: { 'aria-label': 'Pipeline' } }}\n >\n {activePipelines.map((entry) => (\n <MenuItem key={entry.$id} value={entry.$id}>\n {entry.name}\n </MenuItem>\n ))}\n </TextField>\n ) : null}\n <Button\n size=\"small\"\n startIcon={<MdiIcon path={mdiCogOutline.path} size={0.8} />}\n disabled={!scope.orgId || pipelineState.status === 'loading'}\n onClick={() => setManagingPipelines(true)}\n >\n {'Pipelines'}\n </Button>\n <Button\n size=\"small\"\n variant=\"contained\"\n startIcon={<MdiIcon path={mdiPlus.path} size={0.8} />}\n disabled={!pipeline || !scope.orgId}\n onClick={() => setCreating(true)}\n >\n {'New deal'}\n </Button>\n </Stack>\n }\n contentGutterX\n contentGutterY\n >\n <Stack spacing={2}>\n <Stack\n direction=\"row\"\n spacing={3}\n sx={{ alignItems: 'flex-end', flexWrap: 'wrap', rowGap: 1 }}\n >\n <Figure label=\"Open deals\" value={summary.openCount.toLocaleString()} />\n <Figure label=\"Pipeline value\" value={formatAmountByCurrency(summary.valueByCurrency)} />\n <Figure label=\"Weighted value\" value={formatAmountByCurrency(summary.weightedByCurrency)} />\n <Stack sx={{ flex: 1 }} />\n <ToggleButtonGroup\n exclusive\n size=\"small\"\n color=\"primary\"\n value={view}\n onChange={(_event, next) => {\n if (next) setView(next as View)\n }}\n aria-label=\"View\"\n >\n <ToggleButton value=\"board\" aria-label=\"Board\">\n <MdiIcon path={mdiViewColumnOutline.path} size={0.8} />\n <Typography variant=\"button\" sx={{ ml: 0.5 }}>\n {'Board'}\n </Typography>\n </ToggleButton>\n <ToggleButton value=\"table\" aria-label=\"Table\">\n <MdiIcon path={mdiTableLarge.path} size={0.8} />\n <Typography variant=\"button\" sx={{ ml: 0.5 }}>\n {'Table'}\n </Typography>\n </ToggleButton>\n </ToggleButtonGroup>\n </Stack>\n\n {noOrg ? (\n <Alert severity=\"info\">\n {'This site has no organization, so it has no pipeline.'}\n </Alert>\n ) : pipelineState.status === 'error' ? (\n <Alert severity=\"warning\">\n {'The pipeline could not be read. Deals need the \"Manage data\" permission.'}\n </Alert>\n ) : pipelineLoading ? (\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <CircularProgress size={18} />\n <Typography variant=\"body2\" color=\"text.secondary\">\n {pipelineState.seeding ? 'Setting up your Sales pipeline…' : 'Loading the pipeline…'}\n </Typography>\n </Stack>\n ) : view === 'board' && pipeline ? (\n <>\n {open.status === 'success' && open.data.length === 0 ? (\n <EmptyStateComponent\n compact\n label={'No open deals yet'}\n description={'A deal is a sale in progress, moved across the stages below as it advances.'}\n action={\n <Button\n size=\"small\"\n variant=\"contained\"\n startIcon={<MdiIcon path={mdiPlus.path} size={0.8} />}\n disabled={!pipeline || !scope.orgId}\n onClick={() => setCreating(true)}\n >\n {'New deal'}\n </Button>\n }\n />\n ) : null}\n <DealBoard\n pipeline={pipeline}\n deals={open.data}\n won={closedExpanded && won.status !== 'loading' ? won.data : null}\n lost={closedExpanded && lost.status !== 'loading' ? lost.data : null}\n closedExpanded={closedExpanded}\n onToggleClosed={() => setClosedExpanded((current) => !current)}\n labelFor={roster.nameOf}\n moving={moving}\n onOpen={openDeal}\n onMove={handleMove}\n onWon={handleWon}\n onLost={handleLost}\n nowMs={nowMs}\n />\n </>\n ) : (\n <Stack spacing={1.5}>\n {/* The view this table is showing, beside the status it narrows by (AGL-2617). */}\n <Stack\n direction=\"row\"\n spacing={2}\n sx={{ alignItems: 'center', flexWrap: 'wrap', rowGap: 1 }}\n >\n <CrmViewsControl controller={views} allLabel=\"All deals\" />\n <ToggleButtonGroup\n exclusive\n size=\"small\"\n value={statusFilter}\n onChange={(_event, next) => {\n if (next) setStatusFilter(next as StatusFilter)\n }}\n aria-label=\"Status\"\n >\n <ToggleButton value=\"all\">{'All'}</ToggleButton>\n <ToggleButton value=\"open\">{'Open'}</ToggleButton>\n <ToggleButton value=\"won\">{'Won'}</ToggleButton>\n <ToggleButton value=\"lost\">{'Lost'}</ToggleButton>\n </ToggleButtonGroup>\n <NoNextActivityToggle filters={viewFilters} onChange={views.setFilters} />\n <Stack sx={{ flex: 1 }} />\n <DealImportButton hostId={hostId} />\n <Button size=\"small\" onClick={handleExport} disabled={!paged.rows.length}>\n {'Export CSV'}\n </Button>\n </Stack>\n {paged.status === 'success' && paged.rows.length === 0 && paged.page === 0 ? (\n <EmptyStateComponent\n label={statusFilter === 'all' ? 'No deals yet' : `No ${statusFilter} deals`}\n description={\n statusFilter === 'all'\n ? 'A deal is a sale in progress, moved across the pipeline as it advances.'\n : undefined\n }\n action={\n statusFilter === 'all' ? (\n <Button\n size=\"small\"\n variant=\"contained\"\n startIcon={<MdiIcon path={mdiPlus.path} size={0.8} />}\n disabled={!pipeline || !scope.orgId}\n onClick={() => setCreating(true)}\n >\n {'New deal'}\n </Button>\n ) : undefined\n }\n />\n ) : (\n <>\n <DealsBulkBar\n hostId={hostId}\n scope={scope.scope}\n rows={tableRows}\n selected={selectedIds}\n onSelectedChange={setSelectedIds}\n pipelineById={pipelineState.pipelineById}\n roster={roster}\n api={api}\n csv={csvOptions}\n />\n <CrmColumnOrderProvider value={grid.columnOrder}>\n <ListTable\n rows={tableRows}\n columns={grid.columns}\n slots={CRM_LIST_SLOTS}\n selectable={{ selected: selectedIds, onChange: setSelectedIds }}\n onOpen={(_id, row) => openDeal(row as DealDoc)}\n // Columns and sort are the view's, controlled (AGL-2617).\n columnVisibilityModel={grid.columnVisibilityModel}\n onColumnVisibilityModelChange={grid.onColumnVisibilityModelChange}\n sortModel={grid.sortModel}\n onSortModelChange={grid.onSortModelChange}\n hideFooter\n />\n </CrmColumnOrderProvider>\n <ListPagination\n page={paged.page}\n pageSize={paged.pageSize}\n rowCount={paged.rows.length}\n hasMore={paged.hasMore}\n onPageChange={paged.setPage}\n onPageSizeChange={paged.setPageSize}\n />\n </>\n )}\n </Stack>\n )}\n </Stack>\n </CardDisplay>\n <DealEditDrawer\n open={creating}\n onClose={() => setCreating(false)}\n hostId={hostId}\n org={org}\n pipelines={activePipelines}\n defaultPipeline={pipeline}\n />\n <PipelinesDialog\n open={managingPipelines}\n onClose={() => setManagingPipelines(false)}\n orgId={scope.orgId ?? ''}\n // A pipeline made here is stamped the way the seeded default is\n // (`usePipeline`): the site's own tokens under a site; at the\n // organization level the org token, with the picked site as its\n // provenance (AGL-2630).\n hostId={scope.createHostId}\n pipelines={pipelineState.pipelines}\n fromCache={pipelineState.fromCache}\n unreadable={pipelineState.status === 'error'}\n visibleToTokens={scope.visibleTo}\n createTokens={scope.level === 'site' ? scope.createTokens : ORG_PIPELINE_TOKENS}\n />\n <LostReasonDialog\n open={Boolean(losing)}\n dealTitle={losing?.title ?? ''}\n onClose={() => setLosing(null)}\n onConfirm={confirmLost}\n />\n </>\n )\n}\nDealsSection.displayName = 'DealsSection'\n\nfunction Figure(props: { label: string; value: string }) {\n return (\n <Stack sx={{ lineHeight: 1.2 }}>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {props.label}\n </Typography>\n <Typography variant=\"h6\" component=\"span\">\n {props.value}\n </Typography>\n </Stack>\n )\n}\nFigure.displayName = 'Figure'\n\nexport default DealsSection\n"],"names":["dealStageById","filterByNextActivity","findOrgMember","isNoNextActivityClause","ORG_SCOPE_TOKEN","pluginDocsHelp","mdiCogOutline","mdiPlus","mdiTableLarge","mdiViewColumnOutline","CardDisplay","MdiIcon","ListPagination","ListTable","useCrmSavedView","useCrmViewGrid","CRM_LIST_SLOTS","CrmColumnOrderProvider","NoNextActivityToggle","nextActivityColumn","CrmViewsControl","EmptyStateComponent","useSnackbar","Alert","Button","Chip","CircularProgress","MenuItem","Stack","TextField","ToggleButton","ToggleButtonGroup","Typography","useRouter","useCallback","useEffect","useMemo","useState","useContactFieldDefinitions","useCrmScope","useDealStageApi","BOARD_CLOSED_LIMIT","BOARD_OPEN_LIMIT","useDealsByStatus","usePagedDeals","useOrgMemberDirectory","usePipeline","downloadTextFile","crmRoutes","dealsCsv","boardSummary","DEAL_STATUS_LABELS","formatAmountByCurrency","formatMoney","customFieldColumns","DealBoard","DealEditDrawer","DealImportButton","DealsBulkBar","LostReasonDialog","OwnerAvatar","PipelinesDialog","ORG_PIPELINE_TOKENS","DealsSection","props","pipelineId","scope","hostId","org","basePath","routes","router","enqueueSnackbar","pipelineState","orgId","activePipelines","setPipelineId","pipeline","find","entry","$id","roster","api","nowMs","Date","now","dealFields","view","setView","closedExpanded","setClosedExpanded","views","section","statusFilter","value","state","filters","clause","field","viewFilters","setStatusFilter","next","setFilters","op","filter","currentId","open","visibleTo","closedPipelineId","won","lost","paged","summary","data","moving","setMoving","Set","track","deal","request","done","current","add","variant","persist","error","Error","message","allowDuplicate","delete","handleMove","stageId","stage","moveToStage","name","handleWon","markWon","losing","setLosing","handleLost","confirmLost","reason","markLost","openDeal","push","creating","setCreating","managingPipelines","setManagingPipelines","selectedIds","setSelectedIds","page","csvOptions","pipelineName","id","pipelineById","stageName","ownerEmail","uid","member","members","email","label","handleExport","rows","columns","headerName","flex","minWidth","renderCell","row","withWhom","contactName","companyName","Boolean","join","sx","justifyContent","lineHeight","title","color","noWrap","valueGetter","_value","align","headerAlign","amountCents","currency","nameOf","ownerUid","direction","spacing","alignItems","size","type","expectedCloseAtMs","toLocaleDateString","status","active","tableRows","grid","noOrg","ready","pipelineLoading","seeding","header","help","anchor","actions","length","select","onChange","event","target","slotProps","map","startIcon","path","disabled","onClick","contentGutterX","contentGutterY","flexWrap","rowGap","Figure","openCount","toLocaleString","valueByCurrency","weightedByCurrency","exclusive","_event","aria-label","ml","severity","compact","description","action","deals","onToggleClosed","labelFor","onOpen","onMove","onWon","onLost","controller","allLabel","undefined","selected","onSelectedChange","csv","columnOrder","slots","selectable","_id","columnVisibilityModel","onColumnVisibilityModelChange","sortModel","onSortModelChange","hideFooter","pageSize","rowCount","hasMore","onPageChange","setPage","onPageSizeChange","setPageSize","onClose","pipelines","defaultPipeline","createHostId","fromCache","unreadable","visibleToTokens","createTokens","level","dealTitle","onConfirm","displayName","component"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SAGEA,aAAa,EACbC,oBAAoB,EACpBC,aAAa,EACbC,sBAAsB,EACtBC,eAAe,EACfC,cAAc,QACT,eAAc;AACrB,SACEC,aAAa,EACbC,OAAO,EACPC,aAAa,EACbC,oBAAoB,QACf,yBAAwB;AAC/B,SAASC,WAAW,EAAEC,OAAO,QAAQ,uBAAsB;AAC3D,SAASC,cAAc,QAAQ,4DAA2D;AAC1F,SAASC,SAAS,QAAQ,uDAAsD;AAChF,SAASC,eAAe,QAAQ,iCAA6B;AAC7D,SAASC,cAAc,QAAQ,gCAA4B;AAC3D,SAASC,cAAc,EAAEC,sBAAsB,QAAQ,uBAAmB;AAC1E,SAASC,oBAAoB,EAAEC,kBAAkB,QAAQ,gCAA4B;AACrF,OAAOC,qBAAqB,yBAAqB;AACjD,OAAOC,yBAAyB,wDAAuD;AACvF,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SACEC,KAAK,EACLC,MAAM,EACNC,IAAI,E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AAW2F,SAAQ;gBAAK2J,WAAU;0BAChCtN,MAAM8B,KAAK;;;;AAIpB;AACAkI,OAAOqD,WAAW,GAAG;AAErB,eAAetN,aAAY"}
@@ -0,0 +1,42 @@
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 EmailCaptureCardProps {
18
+ /** The site the section is read under, or `null` at the organization level. */
19
+ hostId: string | null;
20
+ /** Whether the reader may rotate the address — a workspace owner or admin. */
21
+ canManage: boolean;
22
+ /** Whether the scope and the role are known, so the address may be asked for. */
23
+ ready: boolean;
24
+ }
25
+ /** The accessible name of the rotate action. */
26
+ export declare const ROTATE_CAPTURE_ADDRESS_LABEL = "Rotate address";
27
+ /**
28
+ * "Email capture" — the workspace's one address for filing mail on
29
+ * records (AGL-2657), with Copy and Rotate.
30
+ *
31
+ * The address is the organization's, so the card reads the same under a
32
+ * site and at the organization level; what differs is only which route
33
+ * variant answers. Rotation is behind a confirmation because it is the
34
+ * one destructive act here: the old address goes quiet the moment the new
35
+ * token is written, and every mailbox rule that carried it stops filing
36
+ * without a word — the confirmation is where that word is said.
37
+ */
38
+ export declare function EmailCaptureCard(props: EmailCaptureCardProps): import("react").JSX.Element;
39
+ export declare namespace EmailCaptureCard {
40
+ var displayName: string;
41
+ }
42
+ export default EmailCaptureCard;
@@ -0,0 +1,134 @@
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 { CardDisplay, useConfirmationContext } from "@aglyn/shared-ui-jsx";
20
+ import { useSnackbar } from "@aglyn/shared-ui-snackstack";
21
+ import { Button, FormHelperText, InputAdornment, Stack, TextField, Typography } from "@mui/material";
22
+ import { CAPTURE_ADDRESS_HELPER, CopyCaptureAddressButton } from "./copy-capture-address-button.js";
23
+ import { useCrmInboundAddress } from "./use-crm-inbound-address.js";
24
+ /** The accessible name of the rotate action. */ export const ROTATE_CAPTURE_ADDRESS_LABEL = 'Rotate address';
25
+ /**
26
+ * "Email capture" — the workspace's one address for filing mail on
27
+ * records (AGL-2657), with Copy and Rotate.
28
+ *
29
+ * The address is the organization's, so the card reads the same under a
30
+ * site and at the organization level; what differs is only which route
31
+ * variant answers. Rotation is behind a confirmation because it is the
32
+ * one destructive act here: the old address goes quiet the moment the new
33
+ * token is written, and every mailbox rule that carried it stops filing
34
+ * without a word — the confirmation is where that word is said.
35
+ */ export function EmailCaptureCard(props) {
36
+ const { hostId, canManage, ready } = props;
37
+ const capture = useCrmInboundAddress(hostId, {
38
+ enabled: ready
39
+ });
40
+ const { confirm } = useConfirmationContext();
41
+ const { enqueueSnackbar } = useSnackbar();
42
+ const handleRotate = async ()=>{
43
+ const confirmed = await confirm({
44
+ title: 'Rotate the capture address?',
45
+ description: 'The current address stops filing mail the moment it is replaced, and ' + 'anything sent to it afterwards is dropped. Update every mailbox rule ' + 'and shortcut that carries it.',
46
+ confirmationText: ROTATE_CAPTURE_ADDRESS_LABEL,
47
+ confirmationButtonProps: {
48
+ color: 'error'
49
+ }
50
+ }).then(()=>true).catch(()=>false);
51
+ if (!confirmed) return;
52
+ const result = await capture.rotate();
53
+ if (result.ok === false) {
54
+ enqueueSnackbar(result.error, {
55
+ variant: 'error',
56
+ allowDuplicate: true
57
+ });
58
+ return;
59
+ }
60
+ enqueueSnackbar('Capture address rotated', {
61
+ variant: 'success',
62
+ persist: false
63
+ });
64
+ };
65
+ const canRotate = ready && canManage && capture.status === 'ready' && !capture.rotating;
66
+ return /*#__PURE__*/ _jsx(CardDisplay, {
67
+ header: 'Email capture',
68
+ help: pluginDocsHelp('crmSettings', {
69
+ anchor: '#email-capture'
70
+ }),
71
+ contentGutterX: true,
72
+ contentGutterY: true,
73
+ HeaderProps: {
74
+ action: /*#__PURE__*/ _jsx(Button, {
75
+ variant: "outlined",
76
+ disabled: !canRotate,
77
+ onClick: ()=>void handleRotate(),
78
+ children: ROTATE_CAPTURE_ADDRESS_LABEL
79
+ })
80
+ },
81
+ children: /*#__PURE__*/ _jsxs(Stack, {
82
+ spacing: 1,
83
+ children: [
84
+ /*#__PURE__*/ _jsx(Typography, {
85
+ variant: "body2",
86
+ color: "text.secondary",
87
+ children: 'One address for the whole workspace. A message forwarded or copied ' + 'to it is filed on the timeline of the contact or lead it was with; ' + 'the site the record belongs to is read off the record.'
88
+ }),
89
+ capture.status === 'ready' ? /*#__PURE__*/ _jsx(TextField, {
90
+ size: "small",
91
+ label: "Capture address",
92
+ value: capture.address,
93
+ slotProps: {
94
+ input: {
95
+ readOnly: true,
96
+ endAdornment: /*#__PURE__*/ _jsx(InputAdornment, {
97
+ position: "end",
98
+ children: /*#__PURE__*/ _jsx(CopyCaptureAddressButton, {
99
+ address: capture.address
100
+ })
101
+ })
102
+ },
103
+ inputLabel: {
104
+ shrink: true
105
+ }
106
+ },
107
+ sx: {
108
+ maxWidth: 520
109
+ }
110
+ }) : capture.status === 'error' ? /*#__PURE__*/ _jsx(Typography, {
111
+ variant: "body2",
112
+ color: "error",
113
+ children: capture.error
114
+ }) : /*#__PURE__*/ _jsx(Typography, {
115
+ variant: "body2",
116
+ color: "text.secondary",
117
+ children: 'Loading the address…'
118
+ }),
119
+ /*#__PURE__*/ _jsx(FormHelperText, {
120
+ children: `${CAPTURE_ADDRESS_HELPER} Only mail from or to somebody already in ` + 'the CRM is filed; anything else is dropped and noted in the ' + 'organization’s activity feed by its sender’s domain.'
121
+ }),
122
+ ready && !canManage ? /*#__PURE__*/ _jsx(Typography, {
123
+ variant: "caption",
124
+ color: "text.secondary",
125
+ children: 'Only a workspace owner or admin can rotate the address.'
126
+ }) : null
127
+ ]
128
+ })
129
+ });
130
+ }
131
+ EmailCaptureCard.displayName = 'EmailCaptureCard';
132
+ export default EmailCaptureCard;
133
+
134
+ //# sourceMappingURL=email-capture-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/email-capture-card.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\n'use client'\n\nimport { pluginDocsHelp } from '@aglyn/aglyn'\nimport { CardDisplay, useConfirmationContext } from '@aglyn/shared-ui-jsx'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport {\n Button,\n FormHelperText,\n InputAdornment,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport {\n CAPTURE_ADDRESS_HELPER,\n CopyCaptureAddressButton,\n} from './copy-capture-address-button'\nimport { useCrmInboundAddress } from './use-crm-inbound-address'\n\nexport interface EmailCaptureCardProps {\n /** The site the section is read under, or `null` at the organization level. */\n hostId: string | null\n /** Whether the reader may rotate the address — a workspace owner or admin. */\n canManage: boolean\n /** Whether the scope and the role are known, so the address may be asked for. */\n ready: boolean\n}\n\n/** The accessible name of the rotate action. */\nexport const ROTATE_CAPTURE_ADDRESS_LABEL = 'Rotate address'\n\n/**\n * \"Email capture\" — the workspace's one address for filing mail on\n * records (AGL-2657), with Copy and Rotate.\n *\n * The address is the organization's, so the card reads the same under a\n * site and at the organization level; what differs is only which route\n * variant answers. Rotation is behind a confirmation because it is the\n * one destructive act here: the old address goes quiet the moment the new\n * token is written, and every mailbox rule that carried it stops filing\n * without a word — the confirmation is where that word is said.\n */\nexport function EmailCaptureCard(props: EmailCaptureCardProps) {\n const { hostId, canManage, ready } = props\n const capture = useCrmInboundAddress(hostId, { enabled: ready })\n const { confirm } = useConfirmationContext()\n const { enqueueSnackbar } = useSnackbar()\n\n const handleRotate = async () => {\n const confirmed = await confirm({\n title: 'Rotate the capture address?',\n description:\n 'The current address stops filing mail the moment it is replaced, and ' +\n 'anything sent to it afterwards is dropped. Update every mailbox rule ' +\n 'and shortcut that carries it.',\n confirmationText: ROTATE_CAPTURE_ADDRESS_LABEL,\n confirmationButtonProps: { color: 'error' },\n })\n .then(() => true)\n .catch(() => false)\n if (!confirmed) return\n const result = await capture.rotate()\n if (result.ok === false) {\n enqueueSnackbar(result.error, { variant: 'error', allowDuplicate: true })\n return\n }\n enqueueSnackbar('Capture address rotated', { variant: 'success', persist: false })\n }\n\n const canRotate = ready && canManage && capture.status === 'ready' && !capture.rotating\n return (\n <CardDisplay\n header={'Email capture'}\n help={pluginDocsHelp('crmSettings', { anchor: '#email-capture' })}\n contentGutterX\n contentGutterY\n HeaderProps={{\n action: (\n <Button variant=\"outlined\" disabled={!canRotate} onClick={() => void handleRotate()}>\n {ROTATE_CAPTURE_ADDRESS_LABEL}\n </Button>\n ),\n }}\n >\n <Stack spacing={1}>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'One address for the whole workspace. A message forwarded or copied ' +\n 'to it is filed on the timeline of the contact or lead it was with; ' +\n 'the site the record belongs to is read off the record.'}\n </Typography>\n {capture.status === 'ready' ? (\n <TextField\n size=\"small\"\n label=\"Capture address\"\n value={capture.address}\n slotProps={{\n input: {\n readOnly: true,\n endAdornment: (\n <InputAdornment position=\"end\">\n <CopyCaptureAddressButton address={capture.address} />\n </InputAdornment>\n ),\n },\n inputLabel: { shrink: true },\n }}\n sx={{ maxWidth: 520 }}\n />\n ) : capture.status === 'error' ? (\n <Typography variant=\"body2\" color=\"error\">\n {capture.error}\n </Typography>\n ) : (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Loading the address…'}\n </Typography>\n )}\n <FormHelperText>\n {`${CAPTURE_ADDRESS_HELPER} Only mail from or to somebody already in ` +\n 'the CRM is filed; anything else is dropped and noted in the ' +\n 'organization’s activity feed by its sender’s domain.'}\n </FormHelperText>\n {ready && !canManage ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'Only a workspace owner or admin can rotate the address.'}\n </Typography>\n ) : null}\n </Stack>\n </CardDisplay>\n )\n}\nEmailCaptureCard.displayName = 'EmailCaptureCard'\n\nexport default EmailCaptureCard\n"],"names":["pluginDocsHelp","CardDisplay","useConfirmationContext","useSnackbar","Button","FormHelperText","InputAdornment","Stack","TextField","Typography","CAPTURE_ADDRESS_HELPER","CopyCaptureAddressButton","useCrmInboundAddress","ROTATE_CAPTURE_ADDRESS_LABEL","EmailCaptureCard","props","hostId","canManage","ready","capture","enabled","confirm","enqueueSnackbar","handleRotate","confirmed","title","description","confirmationText","confirmationButtonProps","color","then","catch","result","rotate","ok","error","variant","allowDuplicate","persist","canRotate","status","rotating","header","help","anchor","contentGutterX","contentGutterY","HeaderProps","action","disabled","onClick","spacing","size","label","value","address","slotProps","input","readOnly","endAdornment","position","inputLabel","shrink","sx","maxWidth","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;AAEA,SAASA,cAAc,QAAQ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,aAAa;YACXC,sBACE,KAAC5C;gBAAOgC,SAAQ;gBAAWa,UAAU,CAACV;gBAAWW,SAAS,IAAM,KAAK3B;0BAClEV;;QAGP;kBAEA,cAAA,MAACN;YAAM4C,SAAS;;8BACd,KAAC1C;oBAAW2B,SAAQ;oBAAQP,OAAM;8BAC/B,wEACC,wEACA;;gBAEHV,QAAQqB,MAAM,KAAK,wBAClB,KAAChC;oBACC4C,MAAK;oBACLC,OAAM;oBACNC,OAAOnC,QAAQoC,OAAO;oBACtBC,WAAW;wBACTC,OAAO;4BACLC,UAAU;4BACVC,4BACE,KAACrD;gCAAesD,UAAS;0CACvB,cAAA,KAACjD;oCAAyB4C,SAASpC,QAAQoC,OAAO;;;wBAGxD;wBACAM,YAAY;4BAAEC,QAAQ;wBAAK;oBAC7B;oBACAC,IAAI;wBAAEC,UAAU;oBAAI;qBAEpB7C,QAAQqB,MAAM,KAAK,wBACrB,KAAC/B;oBAAW2B,SAAQ;oBAAQP,OAAM;8BAC/BV,QAAQgB,KAAK;mCAGhB,KAAC1B;oBAAW2B,SAAQ;oBAAQP,OAAM;8BAC/B;;8BAGL,KAACxB;8BACE,GAAGK,uBAAuB,0CAA0C,CAAC,GACpE,iEACA;;gBAEHQ,SAAS,CAACD,0BACT,KAACR;oBAAW2B,SAAQ;oBAAUP,OAAM;8BACjC;qBAED;;;;AAIZ;AACAf,iBAAiBmD,WAAW,GAAG;AAE/B,eAAenD,iBAAgB"}
@@ -0,0 +1,33 @@
1
+ import { type CrmEmailTemplateKind, type CrmEmailTemplateRow, type CrmEmailTemplateVisibility } from '@aglyn/aglyn';
2
+ /** What the drawer hands back — the template's editable half. */
3
+ export interface EmailTemplateDraft {
4
+ name: string;
5
+ kind: CrmEmailTemplateKind;
6
+ visibility: CrmEmailTemplateVisibility;
7
+ /** `''` on a snippet. */
8
+ subject: string;
9
+ body: string;
10
+ }
11
+ export interface EmailTemplateDrawerProps {
12
+ open: boolean;
13
+ onClose: () => void;
14
+ /** The template being edited, or `null` to create one. */
15
+ template: CrmEmailTemplateRow | null;
16
+ /** Receives the draft; closing on success is the caller's job. */
17
+ onSubmit: (draft: EmailTemplateDraft) => Promise<void> | void;
18
+ }
19
+ /**
20
+ * The one form an email template or snippet is created and edited through
21
+ * (AGL-2658).
22
+ *
23
+ * A template has a subject; a snippet is a paragraph and has none, so the
24
+ * Subject field comes and goes with the kind. Both are plain text with
25
+ * merge fields, which the caption spells out in full because a rep writing
26
+ * a template is not on the record page where the Insert menu lives, and
27
+ * the fields are the whole point of writing one.
28
+ */
29
+ export declare function EmailTemplateDrawer(props: EmailTemplateDrawerProps): import("react").JSX.Element;
30
+ export declare namespace EmailTemplateDrawer {
31
+ var displayName: string;
32
+ }
33
+ export default EmailTemplateDrawer;
@@ -0,0 +1,209 @@
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 { CRM_EMAIL_BODY_MAX, CRM_EMAIL_SUBJECT_MAX, CRM_EMAIL_TEMPLATE_KIND_LABELS, CRM_EMAIL_TEMPLATE_KINDS, CRM_EMAIL_TEMPLATE_NAME_MAX, CRM_EMAIL_TEMPLATE_VISIBILITIES, CRM_EMAIL_TEMPLATE_VISIBILITY_LABELS, CRM_MERGE_FIELDS, crmMergeFieldToken, isCrmEmailTemplateKind, isCrmEmailTemplateVisibility } from "@aglyn/aglyn";
19
+ import { Button, Drawer, MenuItem, Stack, TextField, Typography } from "@mui/material";
20
+ import { useCallback, useEffect, useState } from "react";
21
+ /** The fields, as a caption lists them: `{{contact.firstName}}, …`. */ const FIELD_TOKENS = CRM_MERGE_FIELDS.map((field)=>crmMergeFieldToken(field.key)).join(', ');
22
+ /**
23
+ * The one form an email template or snippet is created and edited through
24
+ * (AGL-2658).
25
+ *
26
+ * A template has a subject; a snippet is a paragraph and has none, so the
27
+ * Subject field comes and goes with the kind. Both are plain text with
28
+ * merge fields, which the caption spells out in full because a rep writing
29
+ * a template is not on the record page where the Insert menu lives, and
30
+ * the fields are the whole point of writing one.
31
+ */ export function EmailTemplateDrawer(props) {
32
+ const { open, onClose, template, onSubmit } = props;
33
+ const editing = Boolean(template);
34
+ const [name, setName] = useState('');
35
+ const [kind, setKind] = useState('template');
36
+ const [visibility, setVisibility] = useState('shared');
37
+ const [subject, setSubject] = useState('');
38
+ const [body, setBody] = useState('');
39
+ const [busy, setBusy] = useState(false);
40
+ const [error, setError] = useState(null);
41
+ // Seeded on every open, from the template when there is one: a drawer
42
+ // that kept the previous draft would offer it as the next template.
43
+ useEffect(()=>{
44
+ var _ref, _ref1, _ref2, _ref3, _ref4;
45
+ if (!open) return;
46
+ setName((_ref = template == null ? void 0 : template.name) != null ? _ref : '');
47
+ setKind((_ref1 = template == null ? void 0 : template.kind) != null ? _ref1 : 'template');
48
+ setVisibility((_ref2 = template == null ? void 0 : template.visibility) != null ? _ref2 : 'shared');
49
+ setSubject((_ref3 = template == null ? void 0 : template.subject) != null ? _ref3 : '');
50
+ setBody((_ref4 = template == null ? void 0 : template.body) != null ? _ref4 : '');
51
+ setBusy(false);
52
+ setError(null);
53
+ }, [
54
+ open,
55
+ template
56
+ ]);
57
+ const canSubmit = !busy && name.trim().length > 0 && body.trim().length > 0;
58
+ const handleSubmit = useCallback(async ()=>{
59
+ if (!canSubmit) return;
60
+ setBusy(true);
61
+ setError(null);
62
+ try {
63
+ await onSubmit({
64
+ name: name.trim().slice(0, CRM_EMAIL_TEMPLATE_NAME_MAX),
65
+ kind,
66
+ visibility,
67
+ subject: kind === 'template' ? subject.trim().slice(0, CRM_EMAIL_SUBJECT_MAX) : '',
68
+ body: body.trim().slice(0, CRM_EMAIL_BODY_MAX)
69
+ });
70
+ } catch (caught) {
71
+ console.error(caught);
72
+ setError('Could not save the template. Try again.');
73
+ } finally{
74
+ setBusy(false);
75
+ }
76
+ }, [
77
+ canSubmit,
78
+ onSubmit,
79
+ name,
80
+ kind,
81
+ visibility,
82
+ subject,
83
+ body
84
+ ]);
85
+ return /*#__PURE__*/ _jsx(Drawer, {
86
+ anchor: "right",
87
+ open: open,
88
+ onClose: onClose,
89
+ children: /*#__PURE__*/ _jsxs(Stack, {
90
+ spacing: 2,
91
+ sx: {
92
+ width: 420,
93
+ maxWidth: '100vw',
94
+ p: 3
95
+ },
96
+ children: [
97
+ /*#__PURE__*/ _jsx(Typography, {
98
+ variant: "h6",
99
+ children: editing ? 'Edit template' : 'New template'
100
+ }),
101
+ /*#__PURE__*/ _jsx(TextField, {
102
+ size: "small",
103
+ label: "Name",
104
+ value: name,
105
+ onChange: (event)=>setName(event.target.value),
106
+ autoFocus: !editing,
107
+ slotProps: {
108
+ htmlInput: {
109
+ maxLength: CRM_EMAIL_TEMPLATE_NAME_MAX
110
+ }
111
+ },
112
+ fullWidth: true
113
+ }),
114
+ /*#__PURE__*/ _jsx(TextField, {
115
+ select: true,
116
+ size: "small",
117
+ label: "Kind",
118
+ value: kind,
119
+ onChange: (event)=>{
120
+ const next = event.target.value;
121
+ if (isCrmEmailTemplateKind(next)) setKind(next);
122
+ },
123
+ helperText: kind === 'template' ? 'Fills in the subject and the message of an email.' : 'A paragraph inserted where the cursor is.',
124
+ fullWidth: true,
125
+ children: CRM_EMAIL_TEMPLATE_KINDS.map((option)=>/*#__PURE__*/ _jsx(MenuItem, {
126
+ value: option,
127
+ children: CRM_EMAIL_TEMPLATE_KIND_LABELS[option]
128
+ }, option))
129
+ }),
130
+ /*#__PURE__*/ _jsx(TextField, {
131
+ select: true,
132
+ size: "small",
133
+ label: "Who it is for",
134
+ value: visibility,
135
+ onChange: (event)=>{
136
+ const next = event.target.value;
137
+ if (isCrmEmailTemplateVisibility(next)) setVisibility(next);
138
+ },
139
+ helperText: visibility === 'shared' ? 'Every CRM editor can use and change it.' : 'Listed for you alone.',
140
+ fullWidth: true,
141
+ children: CRM_EMAIL_TEMPLATE_VISIBILITIES.map((option)=>/*#__PURE__*/ _jsx(MenuItem, {
142
+ value: option,
143
+ children: CRM_EMAIL_TEMPLATE_VISIBILITY_LABELS[option]
144
+ }, option))
145
+ }),
146
+ kind === 'template' ? /*#__PURE__*/ _jsx(TextField, {
147
+ size: "small",
148
+ label: "Subject",
149
+ value: subject,
150
+ onChange: (event)=>setSubject(event.target.value),
151
+ helperText: "Optional. An email keeps its own subject when this is blank.",
152
+ slotProps: {
153
+ htmlInput: {
154
+ maxLength: CRM_EMAIL_SUBJECT_MAX
155
+ }
156
+ },
157
+ fullWidth: true
158
+ }) : null,
159
+ /*#__PURE__*/ _jsx(TextField, {
160
+ size: "small",
161
+ label: "Message",
162
+ value: body,
163
+ onChange: (event)=>setBody(event.target.value),
164
+ multiline: true,
165
+ minRows: 6,
166
+ helperText: "Plain text. A blank line starts a new paragraph.",
167
+ slotProps: {
168
+ htmlInput: {
169
+ maxLength: CRM_EMAIL_BODY_MAX
170
+ }
171
+ },
172
+ fullWidth: true
173
+ }),
174
+ /*#__PURE__*/ _jsx(Typography, {
175
+ variant: "caption",
176
+ color: "text.secondary",
177
+ children: `Merge fields are filled in from the record when the email is sent: ${FIELD_TOKENS}.`
178
+ }),
179
+ error ? /*#__PURE__*/ _jsx(Typography, {
180
+ variant: "body2",
181
+ color: "error",
182
+ children: error
183
+ }) : null,
184
+ /*#__PURE__*/ _jsxs(Stack, {
185
+ direction: "row",
186
+ spacing: 1,
187
+ children: [
188
+ /*#__PURE__*/ _jsx(Button, {
189
+ variant: "contained",
190
+ color: "primary",
191
+ disabled: !canSubmit,
192
+ onClick: handleSubmit,
193
+ children: editing ? 'Save' : 'Create template'
194
+ }),
195
+ /*#__PURE__*/ _jsx(Button, {
196
+ onClick: onClose,
197
+ disabled: busy,
198
+ children: 'Cancel'
199
+ })
200
+ ]
201
+ })
202
+ ]
203
+ })
204
+ });
205
+ }
206
+ EmailTemplateDrawer.displayName = 'EmailTemplateDrawer';
207
+ export default EmailTemplateDrawer;
208
+
209
+ //# sourceMappingURL=email-template-drawer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/email-template-drawer.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 {\n CRM_EMAIL_BODY_MAX,\n CRM_EMAIL_SUBJECT_MAX,\n CRM_EMAIL_TEMPLATE_KIND_LABELS,\n CRM_EMAIL_TEMPLATE_KINDS,\n CRM_EMAIL_TEMPLATE_NAME_MAX,\n CRM_EMAIL_TEMPLATE_VISIBILITIES,\n CRM_EMAIL_TEMPLATE_VISIBILITY_LABELS,\n CRM_MERGE_FIELDS,\n type CrmEmailTemplateKind,\n type CrmEmailTemplateRow,\n type CrmEmailTemplateVisibility,\n crmMergeFieldToken,\n isCrmEmailTemplateKind,\n isCrmEmailTemplateVisibility,\n} from '@aglyn/aglyn'\nimport {\n Button,\n Drawer,\n MenuItem,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport { useCallback, useEffect, useState } from 'react'\n\n/** What the drawer hands back — the template's editable half. */\nexport interface EmailTemplateDraft {\n name: string\n kind: CrmEmailTemplateKind\n visibility: CrmEmailTemplateVisibility\n /** `''` on a snippet. */\n subject: string\n body: string\n}\n\nexport interface EmailTemplateDrawerProps {\n open: boolean\n onClose: () => void\n /** The template being edited, or `null` to create one. */\n template: CrmEmailTemplateRow | null\n /** Receives the draft; closing on success is the caller's job. */\n onSubmit: (draft: EmailTemplateDraft) => Promise<void> | void\n}\n\n/** The fields, as a caption lists them: `{{contact.firstName}}, …`. */\nconst FIELD_TOKENS = CRM_MERGE_FIELDS.map((field) => crmMergeFieldToken(field.key)).join(', ')\n\n/**\n * The one form an email template or snippet is created and edited through\n * (AGL-2658).\n *\n * A template has a subject; a snippet is a paragraph and has none, so the\n * Subject field comes and goes with the kind. Both are plain text with\n * merge fields, which the caption spells out in full because a rep writing\n * a template is not on the record page where the Insert menu lives, and\n * the fields are the whole point of writing one.\n */\nexport function EmailTemplateDrawer(props: EmailTemplateDrawerProps) {\n const { open, onClose, template, onSubmit } = props\n const editing = Boolean(template)\n\n const [name, setName] = useState('')\n const [kind, setKind] = useState<CrmEmailTemplateKind>('template')\n const [visibility, setVisibility] = useState<CrmEmailTemplateVisibility>('shared')\n const [subject, setSubject] = useState('')\n const [body, setBody] = useState('')\n const [busy, setBusy] = useState(false)\n const [error, setError] = useState<string | null>(null)\n\n // Seeded on every open, from the template when there is one: a drawer\n // that kept the previous draft would offer it as the next template.\n useEffect(() => {\n if (!open) return\n setName(template?.name ?? '')\n setKind(template?.kind ?? 'template')\n setVisibility(template?.visibility ?? 'shared')\n setSubject(template?.subject ?? '')\n setBody(template?.body ?? '')\n setBusy(false)\n setError(null)\n }, [open, template])\n\n const canSubmit = !busy && name.trim().length > 0 && body.trim().length > 0\n\n const handleSubmit = useCallback(async () => {\n if (!canSubmit) return\n setBusy(true)\n setError(null)\n try {\n await onSubmit({\n name: name.trim().slice(0, CRM_EMAIL_TEMPLATE_NAME_MAX),\n kind,\n visibility,\n subject: kind === 'template' ? subject.trim().slice(0, CRM_EMAIL_SUBJECT_MAX) : '',\n body: body.trim().slice(0, CRM_EMAIL_BODY_MAX),\n })\n } catch (caught) {\n console.error(caught)\n setError('Could not save the template. Try again.')\n } finally {\n setBusy(false)\n }\n }, [canSubmit, onSubmit, name, kind, visibility, subject, body])\n\n return (\n <Drawer anchor=\"right\" open={open} onClose={onClose}>\n <Stack spacing={2} sx={{ width: 420, maxWidth: '100vw', p: 3 }}>\n <Typography variant=\"h6\">{editing ? 'Edit template' : 'New template'}</Typography>\n <TextField\n size=\"small\"\n label=\"Name\"\n value={name}\n onChange={(event) => setName(event.target.value)}\n autoFocus={!editing}\n slotProps={{ htmlInput: { maxLength: CRM_EMAIL_TEMPLATE_NAME_MAX } }}\n fullWidth\n />\n <TextField\n select\n size=\"small\"\n label=\"Kind\"\n value={kind}\n onChange={(event) => {\n const next = event.target.value\n if (isCrmEmailTemplateKind(next)) setKind(next)\n }}\n helperText={\n kind === 'template'\n ? 'Fills in the subject and the message of an email.'\n : 'A paragraph inserted where the cursor is.'\n }\n fullWidth\n >\n {CRM_EMAIL_TEMPLATE_KINDS.map((option) => (\n <MenuItem key={option} value={option}>\n {CRM_EMAIL_TEMPLATE_KIND_LABELS[option]}\n </MenuItem>\n ))}\n </TextField>\n <TextField\n select\n size=\"small\"\n label=\"Who it is for\"\n value={visibility}\n onChange={(event) => {\n const next = event.target.value\n if (isCrmEmailTemplateVisibility(next)) setVisibility(next)\n }}\n helperText={\n visibility === 'shared'\n ? 'Every CRM editor can use and change it.'\n : 'Listed for you alone.'\n }\n fullWidth\n >\n {CRM_EMAIL_TEMPLATE_VISIBILITIES.map((option) => (\n <MenuItem key={option} value={option}>\n {CRM_EMAIL_TEMPLATE_VISIBILITY_LABELS[option]}\n </MenuItem>\n ))}\n </TextField>\n {kind === 'template' ? (\n <TextField\n size=\"small\"\n label=\"Subject\"\n value={subject}\n onChange={(event) => setSubject(event.target.value)}\n helperText=\"Optional. An email keeps its own subject when this is blank.\"\n slotProps={{ htmlInput: { maxLength: CRM_EMAIL_SUBJECT_MAX } }}\n fullWidth\n />\n ) : null}\n <TextField\n size=\"small\"\n label=\"Message\"\n value={body}\n onChange={(event) => setBody(event.target.value)}\n multiline\n minRows={6}\n helperText=\"Plain text. A blank line starts a new paragraph.\"\n slotProps={{ htmlInput: { maxLength: CRM_EMAIL_BODY_MAX } }}\n fullWidth\n />\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`Merge fields are filled in from the record when the email is sent: ${FIELD_TOKENS}.`}\n </Typography>\n {error ? (\n <Typography variant=\"body2\" color=\"error\">\n {error}\n </Typography>\n ) : null}\n <Stack direction=\"row\" spacing={1}>\n <Button variant=\"contained\" color=\"primary\" disabled={!canSubmit} onClick={handleSubmit}>\n {editing ? 'Save' : 'Create template'}\n </Button>\n <Button onClick={onClose} disabled={busy}>\n {'Cancel'}\n </Button>\n </Stack>\n </Stack>\n </Drawer>\n )\n}\nEmailTemplateDrawer.displayName = 'EmailTemplateDrawer'\n\nexport default EmailTemplateDrawer\n"],"names":["CRM_EMAIL_BODY_MAX","CRM_EMAIL_SUBJECT_MAX","CRM_EMAIL_TEMPLATE_KIND_LABELS","CRM_EMAIL_TEMPLATE_KINDS","CRM_EMAIL_TEMPLATE_NAME_MAX","CRM_EMAIL_TEMPLATE_VISIBILITIES","CRM_EMAIL_TEMPLATE_VISIBILITY_LABELS","CRM_MERGE_FIELDS","crmMergeFieldToken","isCrmEmailTemplateKind","isCrmEmailTemplateVisibility","Button","Drawer","MenuItem","Stack","TextField","Typography","useCallback","useEffect","useState","FIELD_TOKENS","map","field","key","join","EmailTemplateDrawer","props","open","onClose","template","onSubmit","editing","Boolean","name","setName","kind","setKind","visibility","setVisibility","subject","setSubject","body","setBody","busy","setBusy","error","setError","canSubmit","trim","length","handleSubmit","slice","caught","console","anchor","spacing","sx","width","maxWidth","p","variant","size","label","value","onChange","event","target","autoFocus","slotProps","htmlInput","maxLength","fullWidth","select","next","helperText","option","multiline","minRows","color","direction","disabled","onClick","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SACEA,kBA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AAMiE,WAAU;oBAAMxB,SAAS;;sCAC9B,KAAC5C;4BAAOiD,SAAQ;4BAAYkB,OAAM;4BAAUE,UAAU,CAACjC;4BAAWkC,SAAS/B;sCACxEnB,UAAU,SAAS;;sCAEtB,KAACpB;4BAAOsE,SAASrD;4BAASoD,UAAUrC;sCACjC;;;;;;;AAMb;AACAlB,oBAAoByD,WAAW,GAAG;AAElC,eAAezD,oBAAmB"}
@@ -0,0 +1,33 @@
1
+ import { type AglynOrgBilling } from '@aglyn/aglyn';
2
+ export interface EmailTemplatesCardProps {
3
+ /** The site the section is read under, or `null` at the organization level. */
4
+ hostId: string | null;
5
+ org?: Partial<AglynOrgBilling> | null;
6
+ }
7
+ /**
8
+ * "Email templates" — the letters the team keeps for **Send email**
9
+ * (AGL-2658): every template and snippet this member can use, with a
10
+ * drawer to write one and a row menu to edit or delete it.
11
+ *
12
+ * ## Whose card this is
13
+ *
14
+ * Unlike the switches above it, which the org's owner or admin alone may
15
+ * move, this card is every CRM editor's: a template is working material,
16
+ * not policy. The rules gate the rest — a shared row is any editor's, a
17
+ * personal row its owner's — and a colleague's personal rows are not
18
+ * listed here at all, so every row on screen is one this member may
19
+ * change.
20
+ *
21
+ * ## Where a new template lands
22
+ *
23
+ * Under a site, in that site's scope; from the organization's own hub, in
24
+ * the org's — the same rule the send dialog's Save as template follows
25
+ * (`useCrmEmailTemplateScope`). A personal template is owned by its
26
+ * writer; switching one to shared drops the owner, and back to personal
27
+ * makes the member editing it the owner.
28
+ */
29
+ export declare function EmailTemplatesCard(props: EmailTemplatesCardProps): import("react").JSX.Element;
30
+ export declare namespace EmailTemplatesCard {
31
+ var displayName: string;
32
+ }
33
+ export default EmailTemplatesCard;