@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,18 @@
1
+ export interface OwnerAvatarProps {
2
+ /** The owner's name, or their uid when the roster cannot name them. */
3
+ label: string;
4
+ size?: number;
5
+ }
6
+ /**
7
+ * A deal owner as a small lettered circle, on a board card or a table row.
8
+ *
9
+ * No photo: the roster route hands back names and emails and not avatars,
10
+ * and a card that fetched a photo per owner would be a request per card.
11
+ * The tooltip carries the full name, so the initials are never the only
12
+ * thing that identifies somebody.
13
+ */
14
+ export declare function OwnerAvatar(props: OwnerAvatarProps): import("react").JSX.Element;
15
+ export declare namespace OwnerAvatar {
16
+ var displayName: string;
17
+ }
18
+ export default OwnerAvatar;
@@ -0,0 +1,61 @@
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 } from "react/jsx-runtime";
18
+ import { Avatar, Tooltip } from "@mui/material";
19
+ import { hueFor, initialsFor } from "../model/deal-board-model.js";
20
+ /**
21
+ * The theme colors an owner's avatar is drawn in, chosen by hashing the
22
+ * label so one person keeps one color everywhere. Palette tokens rather
23
+ * than a computed hue: every one of these is a color the theme already
24
+ * guarantees legible white text on.
25
+ */ const OWNER_COLORS = [
26
+ 'primary.main',
27
+ 'secondary.main',
28
+ 'tertiary.main',
29
+ 'info.main',
30
+ 'success.main',
31
+ 'warning.main'
32
+ ];
33
+ /**
34
+ * A deal owner as a small lettered circle, on a board card or a table row.
35
+ *
36
+ * No photo: the roster route hands back names and emails and not avatars,
37
+ * and a card that fetched a photo per owner would be a request per card.
38
+ * The tooltip carries the full name, so the initials are never the only
39
+ * thing that identifies somebody.
40
+ */ export function OwnerAvatar(props) {
41
+ const { label, size = 24 } = props;
42
+ if (!label) return null;
43
+ const color = OWNER_COLORS[hueFor(label) % OWNER_COLORS.length];
44
+ return /*#__PURE__*/ _jsx(Tooltip, {
45
+ title: label,
46
+ children: /*#__PURE__*/ _jsx(Avatar, {
47
+ sx: {
48
+ width: size,
49
+ height: size,
50
+ typography: 'caption',
51
+ fontWeight: 'medium',
52
+ bgcolor: color
53
+ },
54
+ children: initialsFor(label)
55
+ })
56
+ });
57
+ }
58
+ OwnerAvatar.displayName = 'OwnerAvatar';
59
+ export default OwnerAvatar;
60
+
61
+ //# sourceMappingURL=owner-avatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/owner-avatar.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 { Avatar, Tooltip } from '@mui/material'\nimport { hueFor, initialsFor } from '../model/deal-board-model'\n\n/**\n * The theme colors an owner's avatar is drawn in, chosen by hashing the\n * label so one person keeps one color everywhere. Palette tokens rather\n * than a computed hue: every one of these is a color the theme already\n * guarantees legible white text on.\n */\nconst OWNER_COLORS = [\n 'primary.main',\n 'secondary.main',\n 'tertiary.main',\n 'info.main',\n 'success.main',\n 'warning.main',\n] as const\n\nexport interface OwnerAvatarProps {\n /** The owner's name, or their uid when the roster cannot name them. */\n label: string\n size?: number\n}\n\n/**\n * A deal owner as a small lettered circle, on a board card or a table row.\n *\n * No photo: the roster route hands back names and emails and not avatars,\n * and a card that fetched a photo per owner would be a request per card.\n * The tooltip carries the full name, so the initials are never the only\n * thing that identifies somebody.\n */\nexport function OwnerAvatar(props: OwnerAvatarProps) {\n const { label, size = 24 } = props\n if (!label) return null\n const color = OWNER_COLORS[hueFor(label) % OWNER_COLORS.length]\n return (\n <Tooltip title={label}>\n <Avatar\n sx={{\n width: size,\n height: size,\n typography: 'caption',\n fontWeight: 'medium',\n bgcolor: color,\n }}\n >\n {initialsFor(label)}\n </Avatar>\n </Tooltip>\n )\n}\nOwnerAvatar.displayName = 'OwnerAvatar'\n\nexport default OwnerAvatar\n"],"names":["Avatar","Tooltip","hueFor","initialsFor","OWNER_COLORS","OwnerAvatar","props","label","size","color","length","title","sx","width","height","typography","fontWeight","bgcolor","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SAASA,MAAM,EAAEC,OAAO,QAAQ,gBAAe;AAC/C,SAASC,MAAM,EAAEC,WAAW,QAAQ,+BAA2B;AAE/D;;;;;CAKC,GACD,MAAMC,eAAe;IACnB;IACA;IACA;IACA;IACA;IACA;CACD;AAQD;;;;;;;CAOC,GACD,OAAO,SAASC,YAAYC,KAAuB;IACjD,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAE,EAAE,GAAGF;IAC7B,IAAI,CAACC,OAAO,OAAO;IACnB,MAAME,QAAQL,YAAY,CAACF,OAAOK,SAASH,aAAaM,MAAM,CAAC;IAC/D,qBACE,KAACT;QAAQU,OAAOJ;kBACd,cAAA,KAACP;YACCY,IAAI;gBACFC,OAAOL;gBACPM,QAAQN;gBACRO,YAAY;gBACZC,YAAY;gBACZC,SAASR;YACX;sBAECN,YAAYI;;;AAIrB;AACAF,YAAYa,WAAW,GAAG;AAE1B,eAAeb,YAAW"}
@@ -0,0 +1,43 @@
1
+ import { type PipelineDoc } from '../model/deal-board-model';
2
+ export interface PipelineStagesDialogProps {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ orgId: string;
6
+ pipeline: PipelineDoc | null;
7
+ /** The listener's verdict on the pipeline row the draft is seeded from. */
8
+ fromCache: boolean;
9
+ unreadable: boolean;
10
+ /** The scope tokens the deal count is filtered by — the viewer's own. */
11
+ /** The reader's tokens, or `null` at the organization level — no clause (AGL-2630). */
12
+ visibleToTokens: readonly string[] | null;
13
+ }
14
+ /**
15
+ * The pipeline's stages, edited as one draft and saved as one write.
16
+ *
17
+ * ## One document, one save
18
+ *
19
+ * The stages live as an array on the pipeline document, so every edit here
20
+ * is a local change to a copy and the Save button writes the whole array
21
+ * back. A per-row write would be a pipeline that is half renamed when the
22
+ * network drops, and — because the board draws columns from this array —
23
+ * a board that redraws between every keystroke for everybody looking at it.
24
+ *
25
+ * ## A stage with deals in it stays
26
+ *
27
+ * Removing a stage is the one edit that can strand data: every deal in it
28
+ * would point at a stage id the pipeline no longer has, sit in no column,
29
+ * and be worth nothing to the forecast. So the remove button first asks the
30
+ * server how many deals are in the stage — an aggregate count over the same
31
+ * scoped query the board reads — and refuses with that number when it is
32
+ * not zero. The count is taken at the moment of the click rather than held
33
+ * from when the dialog opened, because a deal can be dragged in from the
34
+ * board in another tab meanwhile.
35
+ *
36
+ * Won and Lost cannot be removed or reordered; their probabilities are
37
+ * fixed by what they mean.
38
+ */
39
+ export declare function PipelineStagesDialog(props: PipelineStagesDialogProps): import("react").JSX.Element;
40
+ export declare namespace PipelineStagesDialog {
41
+ var displayName: string;
42
+ }
43
+ export default PipelineStagesDialog;
@@ -0,0 +1,339 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ 'use client';
17
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
18
+ import { CRM_COLLECTIONS } from "@aglyn/aglyn";
19
+ import { mdiArrowDown, mdiArrowUp, mdiDeleteOutline } from "@aglyn/shared-data-mdi";
20
+ import { MdiIcon } from "@aglyn/shared-ui-jsx";
21
+ import { useSnackbar } from "@aglyn/shared-ui-snackstack";
22
+ import { useFirestore, writeGuardedBySeed } from "@aglyn/tenant-feature-instance";
23
+ import { Button, Chip, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, Stack, TextField, Tooltip, Typography } from "@mui/material";
24
+ import { collection, doc, getCountFromServer, query, updateDoc, where } from "firebase/firestore";
25
+ import { useCallback, useEffect, useState } from "react";
26
+ import { crmVisibleToClause } from "../hooks/use-crm-scope.js";
27
+ import { addStage, moveStage, removeStage, renameStage, setStageProbability, sortedStages, stageRemovalRefusal, stagesProblem } from "../model/deal-board-model.js";
28
+ /**
29
+ * The pipeline's stages, edited as one draft and saved as one write.
30
+ *
31
+ * ## One document, one save
32
+ *
33
+ * The stages live as an array on the pipeline document, so every edit here
34
+ * is a local change to a copy and the Save button writes the whole array
35
+ * back. A per-row write would be a pipeline that is half renamed when the
36
+ * network drops, and — because the board draws columns from this array —
37
+ * a board that redraws between every keystroke for everybody looking at it.
38
+ *
39
+ * ## A stage with deals in it stays
40
+ *
41
+ * Removing a stage is the one edit that can strand data: every deal in it
42
+ * would point at a stage id the pipeline no longer has, sit in no column,
43
+ * and be worth nothing to the forecast. So the remove button first asks the
44
+ * server how many deals are in the stage — an aggregate count over the same
45
+ * scoped query the board reads — and refuses with that number when it is
46
+ * not zero. The count is taken at the moment of the click rather than held
47
+ * from when the dialog opened, because a deal can be dragged in from the
48
+ * board in another tab meanwhile.
49
+ *
50
+ * Won and Lost cannot be removed or reordered; their probabilities are
51
+ * fixed by what they mean.
52
+ */ export function PipelineStagesDialog(props) {
53
+ const { open, onClose, orgId, pipeline, fromCache, unreadable, visibleToTokens } = props;
54
+ const firestore = useFirestore();
55
+ const { enqueueSnackbar } = useSnackbar();
56
+ const [stages, setStages] = useState([]);
57
+ const [newName, setNewName] = useState('');
58
+ const [busy, setBusy] = useState(false);
59
+ const [counting, setCounting] = useState(null);
60
+ // Re-seeded on every open, so the draft starts from the stored stages
61
+ // rather than from whatever the last session left unsaved.
62
+ useEffect(()=>{
63
+ if (!open) return;
64
+ setStages(sortedStages(pipeline));
65
+ setNewName('');
66
+ }, [
67
+ open,
68
+ pipeline
69
+ ]);
70
+ const handleRemove = useCallback(async (stageId)=>{
71
+ if (!pipeline) return;
72
+ setCounting(stageId);
73
+ try {
74
+ const snapshot = await getCountFromServer(query(collection(firestore, 'orgs', orgId, CRM_COLLECTIONS.deals), ...crmVisibleToClause(visibleToTokens), where('pipelineId', '==', pipeline.$id), where('stageId', '==', stageId)));
75
+ const refusal = stageRemovalRefusal(stages, stageId, snapshot.data().count);
76
+ if (refusal) {
77
+ enqueueSnackbar(refusal, {
78
+ variant: 'warning',
79
+ persist: false
80
+ });
81
+ return;
82
+ }
83
+ setStages((current)=>removeStage(current, stageId));
84
+ } catch (error) {
85
+ console.error(error);
86
+ enqueueSnackbar('The deals in this stage could not be counted, so it stays.', {
87
+ variant: 'error',
88
+ allowDuplicate: true
89
+ });
90
+ } finally{
91
+ setCounting(null);
92
+ }
93
+ }, [
94
+ firestore,
95
+ orgId,
96
+ pipeline,
97
+ visibleToTokens,
98
+ stages,
99
+ enqueueSnackbar
100
+ ]);
101
+ const problem = stagesProblem(stages);
102
+ const handleSave = useCallback(async ()=>{
103
+ if (!pipeline || problem) return;
104
+ setBusy(true);
105
+ try {
106
+ const verdict = await writeGuardedBySeed({
107
+ subject: 'pipeline',
108
+ unreadable,
109
+ fromCache
110
+ }, async ()=>{
111
+ await updateDoc(doc(firestore, 'orgs', orgId, CRM_COLLECTIONS.pipelines, pipeline.$id), {
112
+ stages,
113
+ updatedAt: new Date()
114
+ });
115
+ });
116
+ if (!verdict.ok) {
117
+ enqueueSnackbar(verdict.message, {
118
+ variant: 'warning',
119
+ persist: false
120
+ });
121
+ return;
122
+ }
123
+ enqueueSnackbar('Stages saved', {
124
+ variant: 'success',
125
+ persist: false
126
+ });
127
+ onClose();
128
+ } catch (error) {
129
+ console.error(error);
130
+ enqueueSnackbar('An error has occurred', {
131
+ variant: 'error',
132
+ allowDuplicate: true
133
+ });
134
+ } finally{
135
+ setBusy(false);
136
+ }
137
+ }, [
138
+ firestore,
139
+ orgId,
140
+ pipeline,
141
+ problem,
142
+ stages,
143
+ unreadable,
144
+ fromCache,
145
+ enqueueSnackbar,
146
+ onClose
147
+ ]);
148
+ const openCount = stages.filter((stage)=>stage.kind === 'open').length;
149
+ return /*#__PURE__*/ _jsxs(Dialog, {
150
+ open: open,
151
+ onClose: busy ? undefined : onClose,
152
+ fullWidth: true,
153
+ maxWidth: "sm",
154
+ children: [
155
+ /*#__PURE__*/ _jsx(DialogTitle, {
156
+ children: pipeline ? `${pipeline.name} stages` : 'Stages'
157
+ }),
158
+ /*#__PURE__*/ _jsx(DialogContent, {
159
+ children: /*#__PURE__*/ _jsxs(Stack, {
160
+ spacing: 2,
161
+ sx: {
162
+ pt: 1
163
+ },
164
+ children: [
165
+ /*#__PURE__*/ _jsx(Typography, {
166
+ variant: "body2",
167
+ color: "text.secondary",
168
+ children: 'The probability is the chance a deal in that stage closes, which ' + 'is what the weighted value multiplies by. Won is always 100% and ' + 'Lost always 0%.'
169
+ }),
170
+ stages.map((stage, index)=>{
171
+ const isOpen = stage.kind === 'open';
172
+ const first = index === 0;
173
+ const lastOpen = index === openCount - 1;
174
+ return /*#__PURE__*/ _jsxs(Stack, {
175
+ direction: "row",
176
+ spacing: 1,
177
+ sx: {
178
+ alignItems: 'center'
179
+ },
180
+ children: [
181
+ /*#__PURE__*/ _jsx(TextField, {
182
+ size: "small",
183
+ label: "Stage",
184
+ value: stage.name,
185
+ onChange: (event)=>setStages((current)=>renameStage(current, stage.id, event.target.value)),
186
+ sx: {
187
+ flex: 1
188
+ },
189
+ slotProps: {
190
+ htmlInput: {
191
+ maxLength: 60
192
+ }
193
+ }
194
+ }),
195
+ /*#__PURE__*/ _jsx(TextField, {
196
+ size: "small",
197
+ label: "Probability",
198
+ type: "number",
199
+ value: stage.probability,
200
+ disabled: !isOpen,
201
+ onChange: (event)=>setStages((current)=>setStageProbability(current, stage.id, event.target.value)),
202
+ sx: {
203
+ width: 120
204
+ },
205
+ slotProps: {
206
+ htmlInput: {
207
+ min: 0,
208
+ max: 100,
209
+ step: 5
210
+ },
211
+ input: {
212
+ endAdornment: '%'
213
+ }
214
+ }
215
+ }),
216
+ isOpen ? /*#__PURE__*/ _jsxs(_Fragment, {
217
+ children: [
218
+ /*#__PURE__*/ _jsx(Tooltip, {
219
+ title: "Move up",
220
+ children: /*#__PURE__*/ _jsx("span", {
221
+ children: /*#__PURE__*/ _jsx(IconButton, {
222
+ size: "small",
223
+ disabled: first,
224
+ onClick: ()=>setStages((current)=>moveStage(current, stage.id, 'up')),
225
+ children: /*#__PURE__*/ _jsx(MdiIcon, {
226
+ path: mdiArrowUp.path,
227
+ size: 0.8
228
+ })
229
+ })
230
+ })
231
+ }),
232
+ /*#__PURE__*/ _jsx(Tooltip, {
233
+ title: "Move down",
234
+ children: /*#__PURE__*/ _jsx("span", {
235
+ children: /*#__PURE__*/ _jsx(IconButton, {
236
+ size: "small",
237
+ disabled: lastOpen,
238
+ onClick: ()=>setStages((current)=>moveStage(current, stage.id, 'down')),
239
+ children: /*#__PURE__*/ _jsx(MdiIcon, {
240
+ path: mdiArrowDown.path,
241
+ size: 0.8
242
+ })
243
+ })
244
+ })
245
+ }),
246
+ /*#__PURE__*/ _jsx(Tooltip, {
247
+ title: "Remove stage",
248
+ children: /*#__PURE__*/ _jsx("span", {
249
+ children: /*#__PURE__*/ _jsx(IconButton, {
250
+ size: "small",
251
+ color: "error",
252
+ disabled: counting === stage.id || busy,
253
+ onClick: ()=>void handleRemove(stage.id),
254
+ children: /*#__PURE__*/ _jsx(MdiIcon, {
255
+ path: mdiDeleteOutline.path,
256
+ size: 0.8
257
+ })
258
+ })
259
+ })
260
+ })
261
+ ]
262
+ }) : /*#__PURE__*/ _jsx(Chip, {
263
+ size: "small",
264
+ label: stage.kind === 'won' ? 'Won' : 'Lost',
265
+ color: stage.kind === 'won' ? 'success' : 'default',
266
+ sx: {
267
+ minWidth: 120
268
+ }
269
+ })
270
+ ]
271
+ }, stage.id);
272
+ }),
273
+ /*#__PURE__*/ _jsxs(Stack, {
274
+ direction: "row",
275
+ spacing: 1,
276
+ sx: {
277
+ alignItems: 'center'
278
+ },
279
+ children: [
280
+ /*#__PURE__*/ _jsx(TextField, {
281
+ size: "small",
282
+ label: "New stage",
283
+ value: newName,
284
+ onChange: (event)=>setNewName(event.target.value),
285
+ onKeyDown: (event)=>{
286
+ if (event.key !== 'Enter' || !newName.trim()) return;
287
+ event.preventDefault();
288
+ setStages((current)=>addStage(current, newName));
289
+ setNewName('');
290
+ },
291
+ sx: {
292
+ flex: 1
293
+ },
294
+ slotProps: {
295
+ htmlInput: {
296
+ maxLength: 60
297
+ }
298
+ }
299
+ }),
300
+ /*#__PURE__*/ _jsx(Button, {
301
+ disabled: !newName.trim(),
302
+ onClick: ()=>{
303
+ setStages((current)=>addStage(current, newName));
304
+ setNewName('');
305
+ },
306
+ children: 'Add stage'
307
+ })
308
+ ]
309
+ }),
310
+ problem ? /*#__PURE__*/ _jsx(Typography, {
311
+ variant: "caption",
312
+ color: "error",
313
+ children: problem
314
+ }) : null
315
+ ]
316
+ })
317
+ }),
318
+ /*#__PURE__*/ _jsxs(DialogActions, {
319
+ children: [
320
+ /*#__PURE__*/ _jsx(Button, {
321
+ onClick: onClose,
322
+ disabled: busy,
323
+ children: 'Cancel'
324
+ }),
325
+ /*#__PURE__*/ _jsx(Button, {
326
+ variant: "contained",
327
+ disabled: busy || !pipeline || Boolean(problem),
328
+ onClick: ()=>void handleSave(),
329
+ children: 'Save stages'
330
+ })
331
+ ]
332
+ })
333
+ ]
334
+ });
335
+ }
336
+ PipelineStagesDialog.displayName = 'PipelineStagesDialog';
337
+ export default PipelineStagesDialog;
338
+
339
+ //# sourceMappingURL=pipeline-stages-dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/pipeline-stages-dialog.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 { CRM_COLLECTIONS, type CrmDealStage } from '@aglyn/aglyn'\nimport {\n mdiArrowDown,\n mdiArrowUp,\n mdiDeleteOutline,\n} from '@aglyn/shared-data-mdi'\nimport { MdiIcon } from '@aglyn/shared-ui-jsx'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport { useFirestore, writeGuardedBySeed } from '@aglyn/tenant-feature-instance'\nimport {\n Button,\n Chip,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n Stack,\n TextField,\n Tooltip,\n Typography,\n} from '@mui/material'\nimport {\n collection,\n doc,\n getCountFromServer,\n query,\n updateDoc,\n where,\n} from 'firebase/firestore'\nimport { useCallback, useEffect, useState } from 'react'\nimport { crmVisibleToClause } from '../hooks/use-crm-scope'\nimport {\n addStage,\n moveStage,\n type PipelineDoc,\n removeStage,\n renameStage,\n setStageProbability,\n sortedStages,\n stageRemovalRefusal,\n stagesProblem,\n} from '../model/deal-board-model'\n\nexport interface PipelineStagesDialogProps {\n open: boolean\n onClose: () => void\n orgId: string\n pipeline: PipelineDoc | null\n /** The listener's verdict on the pipeline row the draft is seeded from. */\n fromCache: boolean\n unreadable: boolean\n /** The scope tokens the deal count is filtered by — the viewer's own. */\n /** The reader's tokens, or `null` at the organization level — no clause (AGL-2630). */\n visibleToTokens: readonly string[] | null\n}\n\n/**\n * The pipeline's stages, edited as one draft and saved as one write.\n *\n * ## One document, one save\n *\n * The stages live as an array on the pipeline document, so every edit here\n * is a local change to a copy and the Save button writes the whole array\n * back. A per-row write would be a pipeline that is half renamed when the\n * network drops, and — because the board draws columns from this array —\n * a board that redraws between every keystroke for everybody looking at it.\n *\n * ## A stage with deals in it stays\n *\n * Removing a stage is the one edit that can strand data: every deal in it\n * would point at a stage id the pipeline no longer has, sit in no column,\n * and be worth nothing to the forecast. So the remove button first asks the\n * server how many deals are in the stage — an aggregate count over the same\n * scoped query the board reads — and refuses with that number when it is\n * not zero. The count is taken at the moment of the click rather than held\n * from when the dialog opened, because a deal can be dragged in from the\n * board in another tab meanwhile.\n *\n * Won and Lost cannot be removed or reordered; their probabilities are\n * fixed by what they mean.\n */\nexport function PipelineStagesDialog(props: PipelineStagesDialogProps) {\n const { open, onClose, orgId, pipeline, fromCache, unreadable, visibleToTokens } =\n props\n const firestore = useFirestore()\n const { enqueueSnackbar } = useSnackbar()\n const [stages, setStages] = useState<CrmDealStage[]>([])\n const [newName, setNewName] = useState('')\n const [busy, setBusy] = useState(false)\n const [counting, setCounting] = useState<string | null>(null)\n\n // Re-seeded on every open, so the draft starts from the stored stages\n // rather than from whatever the last session left unsaved.\n useEffect(() => {\n if (!open) return\n setStages(sortedStages(pipeline))\n setNewName('')\n }, [open, pipeline])\n\n const handleRemove = useCallback(\n async (stageId: string) => {\n if (!pipeline) return\n setCounting(stageId)\n try {\n const snapshot = await getCountFromServer(\n query(\n collection(firestore, 'orgs', orgId, CRM_COLLECTIONS.deals),\n ...crmVisibleToClause(visibleToTokens),\n where('pipelineId', '==', pipeline.$id),\n where('stageId', '==', stageId),\n ),\n )\n const refusal = stageRemovalRefusal(stages, stageId, snapshot.data().count)\n if (refusal) {\n enqueueSnackbar(refusal, { variant: 'warning', persist: false })\n return\n }\n setStages((current) => removeStage(current, stageId))\n } catch (error) {\n console.error(error)\n enqueueSnackbar('The deals in this stage could not be counted, so it stays.', {\n variant: 'error',\n allowDuplicate: true,\n })\n } finally {\n setCounting(null)\n }\n },\n [firestore, orgId, pipeline, visibleToTokens, stages, enqueueSnackbar],\n )\n\n const problem = stagesProblem(stages)\n\n const handleSave = useCallback(async () => {\n if (!pipeline || problem) return\n setBusy(true)\n try {\n const verdict = await writeGuardedBySeed(\n { subject: 'pipeline', unreadable, fromCache },\n async () => {\n await updateDoc(\n doc(firestore, 'orgs', orgId, CRM_COLLECTIONS.pipelines, pipeline.$id),\n { stages, updatedAt: new Date() },\n )\n },\n )\n if (!verdict.ok) {\n enqueueSnackbar(verdict.message, { variant: 'warning', persist: false })\n return\n }\n enqueueSnackbar('Stages saved', { variant: 'success', persist: false })\n onClose()\n } catch (error) {\n console.error(error)\n enqueueSnackbar('An error has occurred', {\n variant: 'error',\n allowDuplicate: true,\n })\n } finally {\n setBusy(false)\n }\n }, [firestore, orgId, pipeline, problem, stages, unreadable, fromCache, enqueueSnackbar, onClose])\n\n const openCount = stages.filter((stage) => stage.kind === 'open').length\n\n return (\n <Dialog open={open} onClose={busy ? undefined : onClose} fullWidth maxWidth=\"sm\">\n <DialogTitle>{pipeline ? `${pipeline.name} stages` : 'Stages'}</DialogTitle>\n <DialogContent>\n <Stack spacing={2} sx={{ pt: 1 }}>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'The probability is the chance a deal in that stage closes, which ' +\n 'is what the weighted value multiplies by. Won is always 100% and ' +\n 'Lost always 0%.'}\n </Typography>\n {stages.map((stage, index) => {\n const isOpen = stage.kind === 'open'\n const first = index === 0\n const lastOpen = index === openCount - 1\n return (\n <Stack\n key={stage.id}\n direction=\"row\"\n spacing={1}\n sx={{ alignItems: 'center' }}\n >\n <TextField\n size=\"small\"\n label=\"Stage\"\n value={stage.name}\n onChange={(event) =>\n setStages((current) =>\n renameStage(current, stage.id, event.target.value),\n )\n }\n sx={{ flex: 1 }}\n slotProps={{ htmlInput: { maxLength: 60 } }}\n />\n <TextField\n size=\"small\"\n label=\"Probability\"\n type=\"number\"\n value={stage.probability}\n disabled={!isOpen}\n onChange={(event) =>\n setStages((current) =>\n setStageProbability(current, stage.id, event.target.value),\n )\n }\n sx={{ width: 120 }}\n slotProps={{\n htmlInput: { min: 0, max: 100, step: 5 },\n input: { endAdornment: '%' },\n }}\n />\n {isOpen ? (\n <>\n <Tooltip title=\"Move up\">\n <span>\n <IconButton\n size=\"small\"\n disabled={first}\n onClick={() =>\n setStages((current) => moveStage(current, stage.id, 'up'))\n }\n >\n <MdiIcon path={mdiArrowUp.path} size={0.8} />\n </IconButton>\n </span>\n </Tooltip>\n <Tooltip title=\"Move down\">\n <span>\n <IconButton\n size=\"small\"\n disabled={lastOpen}\n onClick={() =>\n setStages((current) => moveStage(current, stage.id, 'down'))\n }\n >\n <MdiIcon path={mdiArrowDown.path} size={0.8} />\n </IconButton>\n </span>\n </Tooltip>\n <Tooltip title=\"Remove stage\">\n <span>\n <IconButton\n size=\"small\"\n color=\"error\"\n disabled={counting === stage.id || busy}\n onClick={() => void handleRemove(stage.id)}\n >\n <MdiIcon path={mdiDeleteOutline.path} size={0.8} />\n </IconButton>\n </span>\n </Tooltip>\n </>\n ) : (\n <Chip\n size=\"small\"\n label={stage.kind === 'won' ? 'Won' : 'Lost'}\n color={stage.kind === 'won' ? 'success' : 'default'}\n sx={{ minWidth: 120 }}\n />\n )}\n </Stack>\n )\n })}\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <TextField\n size=\"small\"\n label=\"New stage\"\n value={newName}\n onChange={(event) => setNewName(event.target.value)}\n onKeyDown={(event) => {\n if (event.key !== 'Enter' || !newName.trim()) return\n event.preventDefault()\n setStages((current) => addStage(current, newName))\n setNewName('')\n }}\n sx={{ flex: 1 }}\n slotProps={{ htmlInput: { maxLength: 60 } }}\n />\n <Button\n disabled={!newName.trim()}\n onClick={() => {\n setStages((current) => addStage(current, newName))\n setNewName('')\n }}\n >\n {'Add stage'}\n </Button>\n </Stack>\n {problem ? (\n <Typography variant=\"caption\" color=\"error\">\n {problem}\n </Typography>\n ) : null}\n </Stack>\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose} disabled={busy}>\n {'Cancel'}\n </Button>\n <Button\n variant=\"contained\"\n disabled={busy || !pipeline || Boolean(problem)}\n onClick={() => void handleSave()}\n >\n {'Save stages'}\n </Button>\n </DialogActions>\n </Dialog>\n )\n}\nPipelineStagesDialog.displayName = 'PipelineStagesDialog'\n\nexport default PipelineStagesDialog\n"],"names":["CRM_COLLECTIONS","mdiArrowDown","mdiArrowUp","mdiDeleteOutline","MdiIcon","useSnackbar","useFirestore","writeGuardedBySeed","Button","Chip","Dialog","DialogActions","DialogContent","DialogTitle","IconButton","Stack","TextField","Tooltip","Typography","collection","doc","getCountFromServer","query","updateDoc","where","useCallback","useEffect","useState","crmVisibleToClause","addStage","moveStage","removeStage","renameStage","setStageProbability","sortedStages","stageRemovalRefusal","stagesProblem","PipelineStagesDialog","props","open","onClose","orgId","pipeline","fromCache","unreadable","visibleToTokens","firestore","enqueueSnackbar","stages","setStages","newName","setNewName","busy","setBusy","counting","setCounting","handleRemove","stageId","snapshot","deals","$id","refusal","data","count","variant","persist","current","error","console","allowDuplicate","problem","handleSave","verdict","subject","pipelines","updatedAt","Date","ok","message","openCount","filter","stage","kind","length","undefined","fullWidth","maxWidth","name","spacing","sx","pt","color","map","index","isOpen","first","lastOpen","direction","alignItems","size","label","value","onChange","event","id","target","flex","slotProps","htmlInput","maxLength","type","probability","disabled","width","min","max","step","input","endAdornment","title","span","onClick","path","minWidth","onKeyDown","key","trim","preventDefault","Boolean","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SAASA,eAAe,QAA2B,eAAc;AACjE,SACEC,YAAY,EACZC,UAAU,EACVC,gBAAgB,QACX,yBAAwB;AAC/B,SAASC,OAAO,QAAQ,uBAAsB;AAC9C,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SAASC,YAAY,EAAEC,kBAAkB,QAAQ,iCAAgC;AACjF,SACEC,MAAM,EACNC,IAAI,EACJC,MAAM,EACNC,aA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AAWoD,MAAME,MAAM,CAACJ,KAAK;oCAClDuB,WAAW,CAACrB;wCACV,IAAIA,MAAMsB,GAAG,KAAK,WAAW,CAAC3E,QAAQ4E,IAAI,IAAI;wCAC9CvB,MAAMwB,cAAc;wCACpB9E,UAAU,CAACiB,UAAYrC,SAASqC,SAAShB;wCACzCC,WAAW;oCACb;oCACAsC,IAAI;wCAAEiB,MAAM;oCAAE;oCACdC,WAAW;wCAAEC,WAAW;4CAAEC,WAAW;wCAAG;oCAAE;;8CAE5C,KAACrG;oCACCwG,UAAU,CAAC9D,QAAQ4E,IAAI;oCACvBL,SAAS;wCACPxE,UAAU,CAACiB,UAAYrC,SAASqC,SAAShB;wCACzCC,WAAW;oCACb;8CAEC;;;;wBAGJmB,wBACC,KAACpD;4BAAW8C,SAAQ;4BAAU2B,OAAM;sCACjCrB;6BAED;;;;0BAGR,MAAC3D;;kCACC,KAACH;wBAAOiH,SAASjF;wBAASwE,UAAU5D;kCACjC;;kCAEH,KAAC5C;wBACCwD,SAAQ;wBACRgD,UAAU5D,QAAQ,CAACV,YAAYsF,QAAQ1D;wBACvCmD,SAAS,IAAM,KAAKlD;kCAEnB;;;;;;AAKX;AACAlC,qBAAqB4F,WAAW,GAAG;AAEnC,eAAe5F,qBAAoB"}
@@ -0,0 +1,55 @@
1
+ import { type PipelineDoc } from '../model/deal-board-model';
2
+ export interface PipelinesDialogProps {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ orgId: string;
6
+ /**
7
+ * The site this console is viewed from — provenance on a pipeline created
8
+ * here — or at the organization level the site the reader picked, `null`
9
+ * until they have (AGL-2630): a pipeline made there is the org's.
10
+ */
11
+ hostId: string | null;
12
+ /** Every pipeline the viewer may read, archived ones included. */
13
+ pipelines: PipelineDoc[];
14
+ /** The listener's verdict on the rows, for the stale-seed guard. */
15
+ fromCache: boolean;
16
+ unreadable: boolean;
17
+ /** The scope tokens the open-deal count is filtered by — the viewer's own. */
18
+ visibleToTokens: readonly string[];
19
+ /** What a pipeline created here is stamped with. */
20
+ createTokens: readonly string[];
21
+ }
22
+ /**
23
+ * The org's pipelines (AGL-2620): list, create, rename, set as default,
24
+ * archive, and a door into each one's stages.
25
+ *
26
+ * ## Org documents, scoped like every CRM row
27
+ *
28
+ * A pipeline lives at `orgs/{orgId}/pipelines` and is stamped with the same
29
+ * scope tokens a contact captured on this site would carry, so an agency's
30
+ * client sees its own pipelines and the org-wide ones — the same rule the
31
+ * board reads by. Nothing here assumes one site: the tokens come in as
32
+ * props from `useCrmScope`, and an org-level mount passes its own.
33
+ *
34
+ * ## What each verb writes
35
+ *
36
+ * - **New pipeline** — one `addDoc` of `newPipelineDocument`: a COPY of the
37
+ * default stages, not the default, active. The field sits UNDER the list.
38
+ * - **Rename** — `name` on the one document, refused when an active
39
+ * pipeline already has the name (`pipelineNameProblem`).
40
+ * - **Set as default** — one batch: the flag on, and off on every other
41
+ * document that had it. A batch rather than two updates because two
42
+ * defaults for the length of a network round trip is a board that opens
43
+ * on either.
44
+ * - **Archive** — `archivedAt: now`, after the server has counted the
45
+ * pipeline's OPEN deals and `pipelineArchiveRefusal` has agreed; the
46
+ * count is taken at the click because a deal can be created into the
47
+ * pipeline from another tab meanwhile. The default pipeline and the last
48
+ * active one refuse. **Restore** clears the stamp.
49
+ * - **Edit stages** — opens the stages dialog for that pipeline, unchanged.
50
+ */
51
+ export declare function PipelinesDialog(props: PipelinesDialogProps): import("react").JSX.Element;
52
+ export declare namespace PipelinesDialog {
53
+ var displayName: string;
54
+ }
55
+ export default PipelinesDialog;