@aglyn/aglyn 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 (963) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +11 -0
  3. package/package.json +66 -0
  4. package/src/index.d.ts +25 -0
  5. package/src/index.js +26 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/aglyn.d.ts +31 -0
  8. package/src/lib/aglyn.js +114 -0
  9. package/src/lib/aglyn.js.map +1 -0
  10. package/src/lib/app-utils/abuse-report.d.ts +193 -0
  11. package/src/lib/app-utils/abuse-report.js +321 -0
  12. package/src/lib/app-utils/abuse-report.js.map +1 -0
  13. package/src/lib/app-utils/accept-negotiation.d.ts +129 -0
  14. package/src/lib/app-utils/accept-negotiation.js +266 -0
  15. package/src/lib/app-utils/accept-negotiation.js.map +1 -0
  16. package/src/lib/app-utils/account-emails.d.ts +263 -0
  17. package/src/lib/app-utils/account-emails.js +264 -0
  18. package/src/lib/app-utils/account-emails.js.map +1 -0
  19. package/src/lib/app-utils/actions.d.ts +717 -0
  20. package/src/lib/app-utils/actions.js +1031 -0
  21. package/src/lib/app-utils/actions.js.map +1 -0
  22. package/src/lib/app-utils/activity-presenter.d.ts +152 -0
  23. package/src/lib/app-utils/activity-presenter.js +326 -0
  24. package/src/lib/app-utils/activity-presenter.js.map +1 -0
  25. package/src/lib/app-utils/advertising-tag-mounts.d.ts +133 -0
  26. package/src/lib/app-utils/advertising-tag-mounts.js +118 -0
  27. package/src/lib/app-utils/advertising-tag-mounts.js.map +1 -0
  28. package/src/lib/app-utils/advertising-tags.d.ts +307 -0
  29. package/src/lib/app-utils/advertising-tags.js +525 -0
  30. package/src/lib/app-utils/advertising-tags.js.map +1 -0
  31. package/src/lib/app-utils/agent-api-catalog.d.ts +94 -0
  32. package/src/lib/app-utils/agent-api-catalog.js +106 -0
  33. package/src/lib/app-utils/agent-api-catalog.js.map +1 -0
  34. package/src/lib/app-utils/agent-openapi.d.ts +103 -0
  35. package/src/lib/app-utils/agent-openapi.js +1128 -0
  36. package/src/lib/app-utils/agent-openapi.js.map +1 -0
  37. package/src/lib/app-utils/analytics-beacon.d.ts +154 -0
  38. package/src/lib/app-utils/analytics-beacon.js +152 -0
  39. package/src/lib/app-utils/analytics-beacon.js.map +1 -0
  40. package/src/lib/app-utils/analytics-environment.d.ts +133 -0
  41. package/src/lib/app-utils/analytics-environment.js +152 -0
  42. package/src/lib/app-utils/analytics-environment.js.map +1 -0
  43. package/src/lib/app-utils/analytics-events.d.ts +744 -0
  44. package/src/lib/app-utils/analytics-events.js +650 -0
  45. package/src/lib/app-utils/analytics-events.js.map +1 -0
  46. package/src/lib/app-utils/analytics-link-clicks.d.ts +102 -0
  47. package/src/lib/app-utils/analytics-link-clicks.js +267 -0
  48. package/src/lib/app-utils/analytics-link-clicks.js.map +1 -0
  49. package/src/lib/app-utils/analytics-path-key.d.ts +46 -0
  50. package/src/lib/app-utils/analytics-path-key.js +46 -0
  51. package/src/lib/app-utils/analytics-path-key.js.map +1 -0
  52. package/src/lib/app-utils/api-adapter.d.ts +47 -0
  53. package/src/lib/app-utils/api-adapter.js +367 -0
  54. package/src/lib/app-utils/api-adapter.js.map +1 -0
  55. package/src/lib/app-utils/api-idempotency.d.ts +169 -0
  56. package/src/lib/app-utils/api-idempotency.js +213 -0
  57. package/src/lib/app-utils/api-idempotency.js.map +1 -0
  58. package/src/lib/app-utils/api-plugins.d.ts +210 -0
  59. package/src/lib/app-utils/api-plugins.js +221 -0
  60. package/src/lib/app-utils/api-plugins.js.map +1 -0
  61. package/src/lib/app-utils/assist-credits.d.ts +482 -0
  62. package/src/lib/app-utils/assist-credits.js +509 -0
  63. package/src/lib/app-utils/assist-credits.js.map +1 -0
  64. package/src/lib/app-utils/attribution-attribute.d.ts +34 -0
  65. package/src/lib/app-utils/attribution-attribute.js +34 -0
  66. package/src/lib/app-utils/attribution-attribute.js.map +1 -0
  67. package/src/lib/app-utils/attribution-guard.d.ts +130 -0
  68. package/src/lib/app-utils/attribution-guard.js +410 -0
  69. package/src/lib/app-utils/attribution-guard.js.map +1 -0
  70. package/src/lib/app-utils/author-css.d.ts +123 -0
  71. package/src/lib/app-utils/author-css.js +275 -0
  72. package/src/lib/app-utils/author-css.js.map +1 -0
  73. package/src/lib/app-utils/author-html-markdown.d.ts +31 -0
  74. package/src/lib/app-utils/author-html-markdown.js +497 -0
  75. package/src/lib/app-utils/author-html-markdown.js.map +1 -0
  76. package/src/lib/app-utils/author-html.d.ts +135 -0
  77. package/src/lib/app-utils/author-html.js +1037 -0
  78. package/src/lib/app-utils/author-html.js.map +1 -0
  79. package/src/lib/app-utils/automation-placeholders.d.ts +72 -0
  80. package/src/lib/app-utils/automation-placeholders.js +207 -0
  81. package/src/lib/app-utils/automation-placeholders.js.map +1 -0
  82. package/src/lib/app-utils/bandwidth-cap.d.ts +183 -0
  83. package/src/lib/app-utils/bandwidth-cap.js +193 -0
  84. package/src/lib/app-utils/bandwidth-cap.js.map +1 -0
  85. package/src/lib/app-utils/binding-token-catalog.d.ts +82 -0
  86. package/src/lib/app-utils/binding-token-catalog.js +293 -0
  87. package/src/lib/app-utils/binding-token-catalog.js.map +1 -0
  88. package/src/lib/app-utils/binding-tokens.d.ts +157 -0
  89. package/src/lib/app-utils/binding-tokens.js +251 -0
  90. package/src/lib/app-utils/binding-tokens.js.map +1 -0
  91. package/src/lib/app-utils/breadcrumb-json-ld.d.ts +57 -0
  92. package/src/lib/app-utils/breadcrumb-json-ld.js +67 -0
  93. package/src/lib/app-utils/breadcrumb-json-ld.js.map +1 -0
  94. package/src/lib/app-utils/campaign-attribution.d.ts +117 -0
  95. package/src/lib/app-utils/campaign-attribution.js +162 -0
  96. package/src/lib/app-utils/campaign-attribution.js.map +1 -0
  97. package/src/lib/app-utils/campaign-forwarding.d.ts +220 -0
  98. package/src/lib/app-utils/campaign-forwarding.js +332 -0
  99. package/src/lib/app-utils/campaign-forwarding.js.map +1 -0
  100. package/src/lib/app-utils/campaign-membership.d.ts +109 -0
  101. package/src/lib/app-utils/campaign-membership.js +176 -0
  102. package/src/lib/app-utils/campaign-membership.js.map +1 -0
  103. package/src/lib/app-utils/campaign-touch.d.ts +206 -0
  104. package/src/lib/app-utils/campaign-touch.js +326 -0
  105. package/src/lib/app-utils/campaign-touch.js.map +1 -0
  106. package/src/lib/app-utils/child-contract-compose.d.ts +28 -0
  107. package/src/lib/app-utils/child-contract-compose.js +140 -0
  108. package/src/lib/app-utils/child-contract-compose.js.map +1 -0
  109. package/src/lib/app-utils/child-contract.d.ts +129 -0
  110. package/src/lib/app-utils/child-contract.js +153 -0
  111. package/src/lib/app-utils/child-contract.js.map +1 -0
  112. package/src/lib/app-utils/collection-delete.d.ts +113 -0
  113. package/src/lib/app-utils/collection-delete.js +120 -0
  114. package/src/lib/app-utils/collection-delete.js.map +1 -0
  115. package/src/lib/app-utils/collection-entries.d.ts +833 -0
  116. package/src/lib/app-utils/collection-entries.js +1285 -0
  117. package/src/lib/app-utils/collection-entries.js.map +1 -0
  118. package/src/lib/app-utils/collection-entry-date.d.ts +129 -0
  119. package/src/lib/app-utils/collection-entry-date.js +183 -0
  120. package/src/lib/app-utils/collection-entry-date.js.map +1 -0
  121. package/src/lib/app-utils/collection-kind.d.ts +55 -0
  122. package/src/lib/app-utils/collection-kind.js +69 -0
  123. package/src/lib/app-utils/collection-kind.js.map +1 -0
  124. package/src/lib/app-utils/collection-slug.d.ts +79 -0
  125. package/src/lib/app-utils/collection-slug.js +70 -0
  126. package/src/lib/app-utils/collection-slug.js.map +1 -0
  127. package/src/lib/app-utils/compose-layout-nodes.d.ts +147 -0
  128. package/src/lib/app-utils/compose-layout-nodes.js +261 -0
  129. package/src/lib/app-utils/compose-layout-nodes.js.map +1 -0
  130. package/src/lib/app-utils/compose-layout-props.d.ts +71 -0
  131. package/src/lib/app-utils/compose-layout-props.js +61 -0
  132. package/src/lib/app-utils/compose-layout-props.js.map +1 -0
  133. package/src/lib/app-utils/compose-reusable-components.d.ts +504 -0
  134. package/src/lib/app-utils/compose-reusable-components.js +1366 -0
  135. package/src/lib/app-utils/compose-reusable-components.js.map +1 -0
  136. package/src/lib/app-utils/compress.d.ts +35 -0
  137. package/src/lib/app-utils/compress.js +38 -0
  138. package/src/lib/app-utils/compress.js.map +1 -0
  139. package/src/lib/app-utils/consent-banner-ui.d.ts +226 -0
  140. package/src/lib/app-utils/consent-banner-ui.js +583 -0
  141. package/src/lib/app-utils/consent-banner-ui.js.map +1 -0
  142. package/src/lib/app-utils/consent-groups.d.ts +189 -0
  143. package/src/lib/app-utils/consent-groups.js +219 -0
  144. package/src/lib/app-utils/consent-groups.js.map +1 -0
  145. package/src/lib/app-utils/consent-preferences-dialog.d.ts +58 -0
  146. package/src/lib/app-utils/consent-preferences-dialog.js +106 -0
  147. package/src/lib/app-utils/consent-preferences-dialog.js.map +1 -0
  148. package/src/lib/app-utils/console-record-links.d.ts +163 -0
  149. package/src/lib/app-utils/console-record-links.js +178 -0
  150. package/src/lib/app-utils/console-record-links.js.map +1 -0
  151. package/src/lib/app-utils/console-routes.d.ts +658 -0
  152. package/src/lib/app-utils/console-routes.js +489 -0
  153. package/src/lib/app-utils/console-routes.js.map +1 -0
  154. package/src/lib/app-utils/console-widget-slot-context.d.ts +46 -0
  155. package/src/lib/app-utils/console-widget-slot-context.js +23 -0
  156. package/src/lib/app-utils/console-widget-slot-context.js.map +1 -0
  157. package/src/lib/app-utils/contact-custom-fields.d.ts +191 -0
  158. package/src/lib/app-utils/contact-custom-fields.js +349 -0
  159. package/src/lib/app-utils/contact-custom-fields.js.map +1 -0
  160. package/src/lib/app-utils/contact-holder.d.ts +52 -0
  161. package/src/lib/app-utils/contact-holder.js +98 -0
  162. package/src/lib/app-utils/contact-holder.js.map +1 -0
  163. package/src/lib/app-utils/contact-merge.d.ts +136 -0
  164. package/src/lib/app-utils/contact-merge.js +379 -0
  165. package/src/lib/app-utils/contact-merge.js.map +1 -0
  166. package/src/lib/app-utils/contacts.d.ts +554 -0
  167. package/src/lib/app-utils/contacts.js +401 -0
  168. package/src/lib/app-utils/contacts.js.map +1 -0
  169. package/src/lib/app-utils/content-author-profile.d.ts +68 -0
  170. package/src/lib/app-utils/content-author-profile.js +118 -0
  171. package/src/lib/app-utils/content-author-profile.js.map +1 -0
  172. package/src/lib/app-utils/content-authors.d.ts +662 -0
  173. package/src/lib/app-utils/content-authors.js +771 -0
  174. package/src/lib/app-utils/content-authors.js.map +1 -0
  175. package/src/lib/app-utils/content-schema-type.d.ts +81 -0
  176. package/src/lib/app-utils/content-schema-type.js +87 -0
  177. package/src/lib/app-utils/content-schema-type.js.map +1 -0
  178. package/src/lib/app-utils/contexts.d.ts +35 -0
  179. package/src/lib/app-utils/contexts.js +35 -0
  180. package/src/lib/app-utils/contexts.js.map +1 -0
  181. package/src/lib/app-utils/create-resource-uid.d.ts +18 -0
  182. package/src/lib/app-utils/create-resource-uid.js +23 -0
  183. package/src/lib/app-utils/create-resource-uid.js.map +1 -0
  184. package/src/lib/app-utils/crm-booking.d.ts +75 -0
  185. package/src/lib/app-utils/crm-booking.js +133 -0
  186. package/src/lib/app-utils/crm-booking.js.map +1 -0
  187. package/src/lib/app-utils/crm-csv.d.ts +232 -0
  188. package/src/lib/app-utils/crm-csv.js +432 -0
  189. package/src/lib/app-utils/crm-csv.js.map +1 -0
  190. package/src/lib/app-utils/crm-digest.d.ts +179 -0
  191. package/src/lib/app-utils/crm-digest.js +271 -0
  192. package/src/lib/app-utils/crm-digest.js.map +1 -0
  193. package/src/lib/app-utils/crm-email-templates.d.ts +172 -0
  194. package/src/lib/app-utils/crm-email-templates.js +382 -0
  195. package/src/lib/app-utils/crm-email-templates.js.map +1 -0
  196. package/src/lib/app-utils/crm-inbound.d.ts +245 -0
  197. package/src/lib/app-utils/crm-inbound.js +407 -0
  198. package/src/lib/app-utils/crm-inbound.js.map +1 -0
  199. package/src/lib/app-utils/crm-kinds.d.ts +73 -0
  200. package/src/lib/app-utils/crm-kinds.js +92 -0
  201. package/src/lib/app-utils/crm-kinds.js.map +1 -0
  202. package/src/lib/app-utils/crm-next-activity.d.ts +107 -0
  203. package/src/lib/app-utils/crm-next-activity.js +140 -0
  204. package/src/lib/app-utils/crm-next-activity.js.map +1 -0
  205. package/src/lib/app-utils/crm-reports.d.ts +479 -0
  206. package/src/lib/app-utils/crm-reports.js +680 -0
  207. package/src/lib/app-utils/crm-reports.js.map +1 -0
  208. package/src/lib/app-utils/crm-task-reminders.d.ts +129 -0
  209. package/src/lib/app-utils/crm-task-reminders.js +139 -0
  210. package/src/lib/app-utils/crm-task-reminders.js.map +1 -0
  211. package/src/lib/app-utils/crm.d.ts +1546 -0
  212. package/src/lib/app-utils/crm.js +1814 -0
  213. package/src/lib/app-utils/crm.js.map +1 -0
  214. package/src/lib/app-utils/csp-report.d.ts +84 -0
  215. package/src/lib/app-utils/csp-report.js +177 -0
  216. package/src/lib/app-utils/csp-report.js.map +1 -0
  217. package/src/lib/app-utils/csv-import.d.ts +192 -0
  218. package/src/lib/app-utils/csv-import.js +279 -0
  219. package/src/lib/app-utils/csv-import.js.map +1 -0
  220. package/src/lib/app-utils/dataset-csv.d.ts +109 -0
  221. package/src/lib/app-utils/dataset-csv.js +235 -0
  222. package/src/lib/app-utils/dataset-csv.js.map +1 -0
  223. package/src/lib/app-utils/dataset-models.d.ts +194 -0
  224. package/src/lib/app-utils/dataset-models.js +409 -0
  225. package/src/lib/app-utils/dataset-models.js.map +1 -0
  226. package/src/lib/app-utils/dataset-query.d.ts +57 -0
  227. package/src/lib/app-utils/dataset-query.js +126 -0
  228. package/src/lib/app-utils/dataset-query.js.map +1 -0
  229. package/src/lib/app-utils/datasets.d.ts +136 -0
  230. package/src/lib/app-utils/datasets.js +177 -0
  231. package/src/lib/app-utils/datasets.js.map +1 -0
  232. package/src/lib/app-utils/decompress.d.ts +36 -0
  233. package/src/lib/app-utils/decompress.js +32 -0
  234. package/src/lib/app-utils/decompress.js.map +1 -0
  235. package/src/lib/app-utils/dedicated-sending-domain.d.ts +47 -0
  236. package/src/lib/app-utils/dedicated-sending-domain.js +114 -0
  237. package/src/lib/app-utils/dedicated-sending-domain.js.map +1 -0
  238. package/src/lib/app-utils/deferred-image.d.ts +86 -0
  239. package/src/lib/app-utils/deferred-image.js +83 -0
  240. package/src/lib/app-utils/deferred-image.js.map +1 -0
  241. package/src/lib/app-utils/definition-canvas-tree.d.ts +61 -0
  242. package/src/lib/app-utils/definition-canvas-tree.js +126 -0
  243. package/src/lib/app-utils/definition-canvas-tree.js.map +1 -0
  244. package/src/lib/app-utils/deployment-shape.d.ts +167 -0
  245. package/src/lib/app-utils/deployment-shape.js +238 -0
  246. package/src/lib/app-utils/deployment-shape.js.map +1 -0
  247. package/src/lib/app-utils/detect-template-placeholders.d.ts +30 -0
  248. package/src/lib/app-utils/detect-template-placeholders.js +53 -0
  249. package/src/lib/app-utils/detect-template-placeholders.js.map +1 -0
  250. package/src/lib/app-utils/dmca-counter-notice.d.ts +185 -0
  251. package/src/lib/app-utils/dmca-counter-notice.js +277 -0
  252. package/src/lib/app-utils/dmca-counter-notice.js.map +1 -0
  253. package/src/lib/app-utils/docs-deflection.d.ts +156 -0
  254. package/src/lib/app-utils/docs-deflection.js +547 -0
  255. package/src/lib/app-utils/docs-deflection.js.map +1 -0
  256. package/src/lib/app-utils/docs-help.d.ts +57 -0
  257. package/src/lib/app-utils/docs-help.generated.d.ts +303 -0
  258. package/src/lib/app-utils/docs-help.generated.js +867 -0
  259. package/src/lib/app-utils/docs-help.generated.js.map +1 -0
  260. package/src/lib/app-utils/docs-help.js +46 -0
  261. package/src/lib/app-utils/docs-help.js.map +1 -0
  262. package/src/lib/app-utils/docs-index.generated.d.ts +29 -0
  263. package/src/lib/app-utils/docs-index.generated.js +8388 -0
  264. package/src/lib/app-utils/docs-index.generated.js.map +1 -0
  265. package/src/lib/app-utils/docs-retrieval.d.ts +67 -0
  266. package/src/lib/app-utils/docs-retrieval.js +188 -0
  267. package/src/lib/app-utils/docs-retrieval.js.map +1 -0
  268. package/src/lib/app-utils/document-landmark.d.ts +50 -0
  269. package/src/lib/app-utils/document-landmark.js +100 -0
  270. package/src/lib/app-utils/document-landmark.js.map +1 -0
  271. package/src/lib/app-utils/duplicate-resource.d.ts +101 -0
  272. package/src/lib/app-utils/duplicate-resource.js +206 -0
  273. package/src/lib/app-utils/duplicate-resource.js.map +1 -0
  274. package/src/lib/app-utils/dynamic-list-rule.d.ts +471 -0
  275. package/src/lib/app-utils/dynamic-list-rule.js +914 -0
  276. package/src/lib/app-utils/dynamic-list-rule.js.map +1 -0
  277. package/src/lib/app-utils/element-animation.d.ts +200 -0
  278. package/src/lib/app-utils/element-animation.js +233 -0
  279. package/src/lib/app-utils/element-animation.js.map +1 -0
  280. package/src/lib/app-utils/element-hidden-style.d.ts +46 -0
  281. package/src/lib/app-utils/element-hidden-style.js +48 -0
  282. package/src/lib/app-utils/element-hidden-style.js.map +1 -0
  283. package/src/lib/app-utils/element-ui.d.ts +243 -0
  284. package/src/lib/app-utils/element-ui.js +459 -0
  285. package/src/lib/app-utils/element-ui.js.map +1 -0
  286. package/src/lib/app-utils/email-starter-policy.d.ts +160 -0
  287. package/src/lib/app-utils/email-starter-policy.js +327 -0
  288. package/src/lib/app-utils/email-starter-policy.js.map +1 -0
  289. package/src/lib/app-utils/email-topics.d.ts +310 -0
  290. package/src/lib/app-utils/email-topics.js +336 -0
  291. package/src/lib/app-utils/email-topics.js.map +1 -0
  292. package/src/lib/app-utils/enabled-plugins-context.d.ts +100 -0
  293. package/src/lib/app-utils/enabled-plugins-context.js +113 -0
  294. package/src/lib/app-utils/enabled-plugins-context.js.map +1 -0
  295. package/src/lib/app-utils/ensure-canvas-root.d.ts +38 -0
  296. package/src/lib/app-utils/ensure-canvas-root.js +61 -0
  297. package/src/lib/app-utils/ensure-canvas-root.js.map +1 -0
  298. package/src/lib/app-utils/entity-picker-context.d.ts +199 -0
  299. package/src/lib/app-utils/entity-picker-context.js +93 -0
  300. package/src/lib/app-utils/entity-picker-context.js.map +1 -0
  301. package/src/lib/app-utils/error-beacon.d.ts +107 -0
  302. package/src/lib/app-utils/error-beacon.js +296 -0
  303. package/src/lib/app-utils/error-beacon.js.map +1 -0
  304. package/src/lib/app-utils/expand-repeatables.d.ts +172 -0
  305. package/src/lib/app-utils/expand-repeatables.js +299 -0
  306. package/src/lib/app-utils/expand-repeatables.js.map +1 -0
  307. package/src/lib/app-utils/foreign-script.d.ts +82 -0
  308. package/src/lib/app-utils/foreign-script.js +102 -0
  309. package/src/lib/app-utils/foreign-script.js.map +1 -0
  310. package/src/lib/app-utils/form-abuse-ceiling.d.ts +146 -0
  311. package/src/lib/app-utils/form-abuse-ceiling.js +158 -0
  312. package/src/lib/app-utils/form-abuse-ceiling.js.map +1 -0
  313. package/src/lib/app-utils/form-contract.d.ts +198 -0
  314. package/src/lib/app-utils/form-contract.js +282 -0
  315. package/src/lib/app-utils/form-contract.js.map +1 -0
  316. package/src/lib/app-utils/form-dataset-binding.d.ts +50 -0
  317. package/src/lib/app-utils/form-dataset-binding.js +74 -0
  318. package/src/lib/app-utils/form-dataset-binding.js.map +1 -0
  319. package/src/lib/app-utils/forms.d.ts +727 -0
  320. package/src/lib/app-utils/forms.js +777 -0
  321. package/src/lib/app-utils/forms.js.map +1 -0
  322. package/src/lib/app-utils/functions.d.ts +188 -0
  323. package/src/lib/app-utils/functions.js +529 -0
  324. package/src/lib/app-utils/functions.js.map +1 -0
  325. package/src/lib/app-utils/guarded-version-save.d.ts +91 -0
  326. package/src/lib/app-utils/guarded-version-save.js +131 -0
  327. package/src/lib/app-utils/guarded-version-save.js.map +1 -0
  328. package/src/lib/app-utils/health-report.d.ts +1766 -0
  329. package/src/lib/app-utils/health-report.js +2072 -0
  330. package/src/lib/app-utils/health-report.js.map +1 -0
  331. package/src/lib/app-utils/host-naming.d.ts +135 -0
  332. package/src/lib/app-utils/host-naming.js +188 -0
  333. package/src/lib/app-utils/host-naming.js.map +1 -0
  334. package/src/lib/app-utils/host-permissions.d.ts +76 -0
  335. package/src/lib/app-utils/host-permissions.js +119 -0
  336. package/src/lib/app-utils/host-permissions.js.map +1 -0
  337. package/src/lib/app-utils/host-tokens.d.ts +228 -0
  338. package/src/lib/app-utils/host-tokens.js +304 -0
  339. package/src/lib/app-utils/host-tokens.js.map +1 -0
  340. package/src/lib/app-utils/idp-profile.d.ts +83 -0
  341. package/src/lib/app-utils/idp-profile.js +268 -0
  342. package/src/lib/app-utils/idp-profile.js.map +1 -0
  343. package/src/lib/app-utils/image-upload-types.d.ts +49 -0
  344. package/src/lib/app-utils/image-upload-types.js +86 -0
  345. package/src/lib/app-utils/image-upload-types.js.map +1 -0
  346. package/src/lib/app-utils/index.d.ts +18 -0
  347. package/src/lib/app-utils/index.js +23 -0
  348. package/src/lib/app-utils/index.js.map +1 -0
  349. package/src/lib/app-utils/internal-traffic.d.ts +197 -0
  350. package/src/lib/app-utils/internal-traffic.js +288 -0
  351. package/src/lib/app-utils/internal-traffic.js.map +1 -0
  352. package/src/lib/app-utils/lineal-order.d.ts +62 -0
  353. package/src/lib/app-utils/lineal-order.js +65 -0
  354. package/src/lib/app-utils/lineal-order.js.map +1 -0
  355. package/src/lib/app-utils/link-references.d.ts +36 -0
  356. package/src/lib/app-utils/link-references.js +89 -0
  357. package/src/lib/app-utils/link-references.js.map +1 -0
  358. package/src/lib/app-utils/link-target-search-context.d.ts +123 -0
  359. package/src/lib/app-utils/link-target-search-context.js +221 -0
  360. package/src/lib/app-utils/link-target-search-context.js.map +1 -0
  361. package/src/lib/app-utils/list-assignment-policy.d.ts +169 -0
  362. package/src/lib/app-utils/list-assignment-policy.js +170 -0
  363. package/src/lib/app-utils/list-assignment-policy.js.map +1 -0
  364. package/src/lib/app-utils/list-import.d.ts +158 -0
  365. package/src/lib/app-utils/list-import.js +332 -0
  366. package/src/lib/app-utils/list-import.js.map +1 -0
  367. package/src/lib/app-utils/llms-txt.d.ts +104 -0
  368. package/src/lib/app-utils/llms-txt.js +144 -0
  369. package/src/lib/app-utils/llms-txt.js.map +1 -0
  370. package/src/lib/app-utils/local-storage-budget.d.ts +75 -0
  371. package/src/lib/app-utils/local-storage-budget.js +153 -0
  372. package/src/lib/app-utils/local-storage-budget.js.map +1 -0
  373. package/src/lib/app-utils/lockdown.d.ts +698 -0
  374. package/src/lib/app-utils/lockdown.js +929 -0
  375. package/src/lib/app-utils/lockdown.js.map +1 -0
  376. package/src/lib/app-utils/margin-utilization.d.ts +267 -0
  377. package/src/lib/app-utils/margin-utilization.js +351 -0
  378. package/src/lib/app-utils/margin-utilization.js.map +1 -0
  379. package/src/lib/app-utils/markdown-lite.d.ts +297 -0
  380. package/src/lib/app-utils/markdown-lite.js +705 -0
  381. package/src/lib/app-utils/markdown-lite.js.map +1 -0
  382. package/src/lib/app-utils/marketing-consent.d.ts +704 -0
  383. package/src/lib/app-utils/marketing-consent.js +783 -0
  384. package/src/lib/app-utils/marketing-consent.js.map +1 -0
  385. package/src/lib/app-utils/marketplace-listing-visibility.d.ts +120 -0
  386. package/src/lib/app-utils/marketplace-listing-visibility.js +139 -0
  387. package/src/lib/app-utils/marketplace-listing-visibility.js.map +1 -0
  388. package/src/lib/app-utils/marketplace-overrides.d.ts +271 -0
  389. package/src/lib/app-utils/marketplace-overrides.js +462 -0
  390. package/src/lib/app-utils/marketplace-overrides.js.map +1 -0
  391. package/src/lib/app-utils/marketplace-provenance.d.ts +150 -0
  392. package/src/lib/app-utils/marketplace-provenance.js +136 -0
  393. package/src/lib/app-utils/marketplace-provenance.js.map +1 -0
  394. package/src/lib/app-utils/marketplace-theme.d.ts +237 -0
  395. package/src/lib/app-utils/marketplace-theme.js +525 -0
  396. package/src/lib/app-utils/marketplace-theme.js.map +1 -0
  397. package/src/lib/app-utils/marketplace-update-state.d.ts +119 -0
  398. package/src/lib/app-utils/marketplace-update-state.js +132 -0
  399. package/src/lib/app-utils/marketplace-update-state.js.map +1 -0
  400. package/src/lib/app-utils/marketplace-verification.d.ts +95 -0
  401. package/src/lib/app-utils/marketplace-verification.js +81 -0
  402. package/src/lib/app-utils/marketplace-verification.js.map +1 -0
  403. package/src/lib/app-utils/measure-node-map.d.ts +76 -0
  404. package/src/lib/app-utils/measure-node-map.js +111 -0
  405. package/src/lib/app-utils/measure-node-map.js.map +1 -0
  406. package/src/lib/app-utils/media-alt.d.ts +55 -0
  407. package/src/lib/app-utils/media-alt.js +58 -0
  408. package/src/lib/app-utils/media-alt.js.map +1 -0
  409. package/src/lib/app-utils/media-asset-facts.d.ts +125 -0
  410. package/src/lib/app-utils/media-asset-facts.js +467 -0
  411. package/src/lib/app-utils/media-asset-facts.js.map +1 -0
  412. package/src/lib/app-utils/media-cdn-scope.d.ts +65 -0
  413. package/src/lib/app-utils/media-cdn-scope.js +75 -0
  414. package/src/lib/app-utils/media-cdn-scope.js.map +1 -0
  415. package/src/lib/app-utils/media-folders.d.ts +161 -0
  416. package/src/lib/app-utils/media-folders.js +230 -0
  417. package/src/lib/app-utils/media-folders.js.map +1 -0
  418. package/src/lib/app-utils/media-metadata.d.ts +277 -0
  419. package/src/lib/app-utils/media-metadata.js +388 -0
  420. package/src/lib/app-utils/media-metadata.js.map +1 -0
  421. package/src/lib/app-utils/media-picker-context.d.ts +93 -0
  422. package/src/lib/app-utils/media-picker-context.js +26 -0
  423. package/src/lib/app-utils/media-picker-context.js.map +1 -0
  424. package/src/lib/app-utils/media-quarantine.d.ts +247 -0
  425. package/src/lib/app-utils/media-quarantine.js +323 -0
  426. package/src/lib/app-utils/media-quarantine.js.map +1 -0
  427. package/src/lib/app-utils/media-ref.d.ts +661 -0
  428. package/src/lib/app-utils/media-ref.js +1055 -0
  429. package/src/lib/app-utils/media-ref.js.map +1 -0
  430. package/src/lib/app-utils/media-takedown-reach.d.ts +126 -0
  431. package/src/lib/app-utils/media-takedown-reach.js +143 -0
  432. package/src/lib/app-utils/media-takedown-reach.js.map +1 -0
  433. package/src/lib/app-utils/member-email-aliases.d.ts +180 -0
  434. package/src/lib/app-utils/member-email-aliases.js +217 -0
  435. package/src/lib/app-utils/member-email-aliases.js.map +1 -0
  436. package/src/lib/app-utils/merge-node-sx.d.ts +47 -0
  437. package/src/lib/app-utils/merge-node-sx.js +123 -0
  438. package/src/lib/app-utils/merge-node-sx.js.map +1 -0
  439. package/src/lib/app-utils/name-match.d.ts +155 -0
  440. package/src/lib/app-utils/name-match.js +175 -0
  441. package/src/lib/app-utils/name-match.js.map +1 -0
  442. package/src/lib/app-utils/name-search.d.ts +117 -0
  443. package/src/lib/app-utils/name-search.js +145 -0
  444. package/src/lib/app-utils/name-search.js.map +1 -0
  445. package/src/lib/app-utils/node-capabilities.d.ts +85 -0
  446. package/src/lib/app-utils/node-capabilities.js +88 -0
  447. package/src/lib/app-utils/node-capabilities.js.map +1 -0
  448. package/src/lib/app-utils/node-definition-sanitizer.d.ts +164 -0
  449. package/src/lib/app-utils/node-definition-sanitizer.js +402 -0
  450. package/src/lib/app-utils/node-definition-sanitizer.js.map +1 -0
  451. package/src/lib/app-utils/node-identity.d.ts +47 -0
  452. package/src/lib/app-utils/node-identity.js +50 -0
  453. package/src/lib/app-utils/node-identity.js.map +1 -0
  454. package/src/lib/app-utils/node-interactions.d.ts +102 -0
  455. package/src/lib/app-utils/node-interactions.js +192 -0
  456. package/src/lib/app-utils/node-interactions.js.map +1 -0
  457. package/src/lib/app-utils/node-url-policy.d.ts +54 -0
  458. package/src/lib/app-utils/node-url-policy.js +72 -0
  459. package/src/lib/app-utils/node-url-policy.js.map +1 -0
  460. package/src/lib/app-utils/notifications.d.ts +71 -0
  461. package/src/lib/app-utils/notifications.js +101 -0
  462. package/src/lib/app-utils/notifications.js.map +1 -0
  463. package/src/lib/app-utils/onboarding-deep-link.d.ts +120 -0
  464. package/src/lib/app-utils/onboarding-deep-link.js +142 -0
  465. package/src/lib/app-utils/onboarding-deep-link.js.map +1 -0
  466. package/src/lib/app-utils/operator-identity.d.ts +207 -0
  467. package/src/lib/app-utils/operator-identity.js +186 -0
  468. package/src/lib/app-utils/operator-identity.js.map +1 -0
  469. package/src/lib/app-utils/org-billing-doc.d.ts +231 -0
  470. package/src/lib/app-utils/org-billing-doc.js +238 -0
  471. package/src/lib/app-utils/org-billing-doc.js.map +1 -0
  472. package/src/lib/app-utils/org-override-reason.d.ts +100 -0
  473. package/src/lib/app-utils/org-override-reason.js +116 -0
  474. package/src/lib/app-utils/org-override-reason.js.map +1 -0
  475. package/src/lib/app-utils/org-permissions.d.ts +194 -0
  476. package/src/lib/app-utils/org-permissions.js +357 -0
  477. package/src/lib/app-utils/org-permissions.js.map +1 -0
  478. package/src/lib/app-utils/org-roles.d.ts +72 -0
  479. package/src/lib/app-utils/org-roles.js +131 -0
  480. package/src/lib/app-utils/org-roles.js.map +1 -0
  481. package/src/lib/app-utils/organizations.d.ts +407 -0
  482. package/src/lib/app-utils/organizations.js +511 -0
  483. package/src/lib/app-utils/organizations.js.map +1 -0
  484. package/src/lib/app-utils/page-header-actions-context.d.ts +83 -0
  485. package/src/lib/app-utils/page-header-actions-context.js +58 -0
  486. package/src/lib/app-utils/page-header-actions-context.js.map +1 -0
  487. package/src/lib/app-utils/page-header-record-context.d.ts +80 -0
  488. package/src/lib/app-utils/page-header-record-context.js +64 -0
  489. package/src/lib/app-utils/page-header-record-context.js.map +1 -0
  490. package/src/lib/app-utils/page-markdown.d.ts +103 -0
  491. package/src/lib/app-utils/page-markdown.js +385 -0
  492. package/src/lib/app-utils/page-markdown.js.map +1 -0
  493. package/src/lib/app-utils/paid-media-source.d.ts +90 -0
  494. package/src/lib/app-utils/paid-media-source.js +184 -0
  495. package/src/lib/app-utils/paid-media-source.js.map +1 -0
  496. package/src/lib/app-utils/palette-sx.d.ts +34 -0
  497. package/src/lib/app-utils/palette-sx.js +150 -0
  498. package/src/lib/app-utils/palette-sx.js.map +1 -0
  499. package/src/lib/app-utils/password-policy.d.ts +47 -0
  500. package/src/lib/app-utils/password-policy.js +46 -0
  501. package/src/lib/app-utils/password-policy.js.map +1 -0
  502. package/src/lib/app-utils/payments-configured.d.ts +84 -0
  503. package/src/lib/app-utils/payments-configured.js +88 -0
  504. package/src/lib/app-utils/payments-configured.js.map +1 -0
  505. package/src/lib/app-utils/person-erasure.d.ts +126 -0
  506. package/src/lib/app-utils/person-erasure.js +121 -0
  507. package/src/lib/app-utils/person-erasure.js.map +1 -0
  508. package/src/lib/app-utils/person-key.d.ts +32 -0
  509. package/src/lib/app-utils/person-key.js +62 -0
  510. package/src/lib/app-utils/person-key.js.map +1 -0
  511. package/src/lib/app-utils/plan-entitlements.d.ts +2756 -0
  512. package/src/lib/app-utils/plan-entitlements.js +4085 -0
  513. package/src/lib/app-utils/plan-entitlements.js.map +1 -0
  514. package/src/lib/app-utils/platform-ad-conversions.d.ts +122 -0
  515. package/src/lib/app-utils/platform-ad-conversions.js +174 -0
  516. package/src/lib/app-utils/platform-ad-conversions.js.map +1 -0
  517. package/src/lib/app-utils/platform-advertising-tags.d.ts +139 -0
  518. package/src/lib/app-utils/platform-advertising-tags.js +203 -0
  519. package/src/lib/app-utils/platform-advertising-tags.js.map +1 -0
  520. package/src/lib/app-utils/platform-brand.d.ts +151 -0
  521. package/src/lib/app-utils/platform-brand.js +175 -0
  522. package/src/lib/app-utils/platform-brand.js.map +1 -0
  523. package/src/lib/app-utils/platform-consent-default.d.ts +142 -0
  524. package/src/lib/app-utils/platform-consent-default.js +295 -0
  525. package/src/lib/app-utils/platform-consent-default.js.map +1 -0
  526. package/src/lib/app-utils/platform-marketing-consent.d.ts +151 -0
  527. package/src/lib/app-utils/platform-marketing-consent.js +182 -0
  528. package/src/lib/app-utils/platform-marketing-consent.js.map +1 -0
  529. package/src/lib/app-utils/platform-marketing-host.d.ts +33 -0
  530. package/src/lib/app-utils/platform-marketing-host.js +97 -0
  531. package/src/lib/app-utils/platform-marketing-host.js.map +1 -0
  532. package/src/lib/app-utils/platform-visitor-consent.d.ts +252 -0
  533. package/src/lib/app-utils/platform-visitor-consent.js +533 -0
  534. package/src/lib/app-utils/platform-visitor-consent.js.map +1 -0
  535. package/src/lib/app-utils/plugin-api-cross-origin.d.ts +61 -0
  536. package/src/lib/app-utils/plugin-api-cross-origin.js +202 -0
  537. package/src/lib/app-utils/plugin-api-cross-origin.js.map +1 -0
  538. package/src/lib/app-utils/plugin-api-rate-limit.d.ts +192 -0
  539. package/src/lib/app-utils/plugin-api-rate-limit.js +270 -0
  540. package/src/lib/app-utils/plugin-api-rate-limit.js.map +1 -0
  541. package/src/lib/app-utils/plugin-artifact-path.d.ts +32 -0
  542. package/src/lib/app-utils/plugin-artifact-path.js +33 -0
  543. package/src/lib/app-utils/plugin-artifact-path.js.map +1 -0
  544. package/src/lib/app-utils/plugin-bundle-checks.d.ts +148 -0
  545. package/src/lib/app-utils/plugin-bundle-checks.js +989 -0
  546. package/src/lib/app-utils/plugin-bundle-checks.js.map +1 -0
  547. package/src/lib/app-utils/plugin-manifest.d.ts +516 -0
  548. package/src/lib/app-utils/plugin-manifest.js +687 -0
  549. package/src/lib/app-utils/plugin-manifest.js.map +1 -0
  550. package/src/lib/app-utils/published-legal-pages.d.ts +71 -0
  551. package/src/lib/app-utils/published-legal-pages.js +90 -0
  552. package/src/lib/app-utils/published-legal-pages.js.map +1 -0
  553. package/src/lib/app-utils/publisher-agreement.d.ts +254 -0
  554. package/src/lib/app-utils/publisher-agreement.js +274 -0
  555. package/src/lib/app-utils/publisher-agreement.js.map +1 -0
  556. package/src/lib/app-utils/publisher-attestation.d.ts +99 -0
  557. package/src/lib/app-utils/publisher-attestation.js +158 -0
  558. package/src/lib/app-utils/publisher-attestation.js.map +1 -0
  559. package/src/lib/app-utils/recipient-email-render.d.ts +216 -0
  560. package/src/lib/app-utils/recipient-email-render.js +221 -0
  561. package/src/lib/app-utils/recipient-email-render.js.map +1 -0
  562. package/src/lib/app-utils/redispatch-caught-error.d.ts +38 -0
  563. package/src/lib/app-utils/redispatch-caught-error.js +46 -0
  564. package/src/lib/app-utils/redispatch-caught-error.js.map +1 -0
  565. package/src/lib/app-utils/registering-plugin.d.ts +19 -0
  566. package/src/lib/app-utils/registering-plugin.js +38 -0
  567. package/src/lib/app-utils/registering-plugin.js.map +1 -0
  568. package/src/lib/app-utils/release-flags.d.ts +283 -0
  569. package/src/lib/app-utils/release-flags.js +518 -0
  570. package/src/lib/app-utils/release-flags.js.map +1 -0
  571. package/src/lib/app-utils/repair-canvas-nodes.d.ts +130 -0
  572. package/src/lib/app-utils/repair-canvas-nodes.js +298 -0
  573. package/src/lib/app-utils/repair-canvas-nodes.js.map +1 -0
  574. package/src/lib/app-utils/repeat-infringer.d.ts +166 -0
  575. package/src/lib/app-utils/repeat-infringer.js +188 -0
  576. package/src/lib/app-utils/repeat-infringer.js.map +1 -0
  577. package/src/lib/app-utils/repeat-sources.d.ts +115 -0
  578. package/src/lib/app-utils/repeat-sources.js +86 -0
  579. package/src/lib/app-utils/repeat-sources.js.map +1 -0
  580. package/src/lib/app-utils/request-geo.d.ts +114 -0
  581. package/src/lib/app-utils/request-geo.js +247 -0
  582. package/src/lib/app-utils/request-geo.js.map +1 -0
  583. package/src/lib/app-utils/request-ip.d.ts +213 -0
  584. package/src/lib/app-utils/request-ip.js +344 -0
  585. package/src/lib/app-utils/request-ip.js.map +1 -0
  586. package/src/lib/app-utils/resolve-named-tokens.d.ts +26 -0
  587. package/src/lib/app-utils/resolve-named-tokens.js +59 -0
  588. package/src/lib/app-utils/resolve-named-tokens.js.map +1 -0
  589. package/src/lib/app-utils/responsive-typography-sx.d.ts +77 -0
  590. package/src/lib/app-utils/responsive-typography-sx.js +122 -0
  591. package/src/lib/app-utils/responsive-typography-sx.js.map +1 -0
  592. package/src/lib/app-utils/reusable-component-keys.d.ts +135 -0
  593. package/src/lib/app-utils/reusable-component-keys.js +140 -0
  594. package/src/lib/app-utils/reusable-component-keys.js.map +1 -0
  595. package/src/lib/app-utils/reusable-prop-values.d.ts +199 -0
  596. package/src/lib/app-utils/reusable-prop-values.js +494 -0
  597. package/src/lib/app-utils/reusable-prop-values.js.map +1 -0
  598. package/src/lib/app-utils/safe-json-ld.d.ts +29 -0
  599. package/src/lib/app-utils/safe-json-ld.js +37 -0
  600. package/src/lib/app-utils/safe-json-ld.js.map +1 -0
  601. package/src/lib/app-utils/sanitize-svg.d.ts +55 -0
  602. package/src/lib/app-utils/sanitize-svg.js +460 -0
  603. package/src/lib/app-utils/sanitize-svg.js.map +1 -0
  604. package/src/lib/app-utils/scheme-sx.d.ts +84 -0
  605. package/src/lib/app-utils/scheme-sx.js +148 -0
  606. package/src/lib/app-utils/scheme-sx.js.map +1 -0
  607. package/src/lib/app-utils/scope-tokens.d.ts +249 -0
  608. package/src/lib/app-utils/scope-tokens.js +331 -0
  609. package/src/lib/app-utils/scope-tokens.js.map +1 -0
  610. package/src/lib/app-utils/screen-link-context-value.d.ts +57 -0
  611. package/src/lib/app-utils/screen-link-context-value.js +43 -0
  612. package/src/lib/app-utils/screen-link-context-value.js.map +1 -0
  613. package/src/lib/app-utils/screen-link-context.d.ts +185 -0
  614. package/src/lib/app-utils/screen-link-context.js +304 -0
  615. package/src/lib/app-utils/screen-link-context.js.map +1 -0
  616. package/src/lib/app-utils/screen-link-value.d.ts +269 -0
  617. package/src/lib/app-utils/screen-link-value.js +384 -0
  618. package/src/lib/app-utils/screen-link-value.js.map +1 -0
  619. package/src/lib/app-utils/screen-route.d.ts +669 -0
  620. package/src/lib/app-utils/screen-route.js +751 -0
  621. package/src/lib/app-utils/screen-route.js.map +1 -0
  622. package/src/lib/app-utils/screen-seo-fields.d.ts +37 -0
  623. package/src/lib/app-utils/screen-seo-fields.js +42 -0
  624. package/src/lib/app-utils/screen-seo-fields.js.map +1 -0
  625. package/src/lib/app-utils/search-indexing.d.ts +162 -0
  626. package/src/lib/app-utils/search-indexing.js +207 -0
  627. package/src/lib/app-utils/search-indexing.js.map +1 -0
  628. package/src/lib/app-utils/seo-listing-fields.d.ts +70 -0
  629. package/src/lib/app-utils/seo-listing-fields.js +75 -0
  630. package/src/lib/app-utils/seo-listing-fields.js.map +1 -0
  631. package/src/lib/app-utils/seo-locale.d.ts +119 -0
  632. package/src/lib/app-utils/seo-locale.js +133 -0
  633. package/src/lib/app-utils/seo-locale.js.map +1 -0
  634. package/src/lib/app-utils/seo-title-variables.d.ts +149 -0
  635. package/src/lib/app-utils/seo-title-variables.js +190 -0
  636. package/src/lib/app-utils/seo-title-variables.js.map +1 -0
  637. package/src/lib/app-utils/seo-title.d.ts +70 -0
  638. package/src/lib/app-utils/seo-title.js +117 -0
  639. package/src/lib/app-utils/seo-title.js.map +1 -0
  640. package/src/lib/app-utils/server.d.ts +174 -0
  641. package/src/lib/app-utils/server.js +314 -0
  642. package/src/lib/app-utils/server.js.map +1 -0
  643. package/src/lib/app-utils/site-context.d.ts +106 -0
  644. package/src/lib/app-utils/site-context.js +100 -0
  645. package/src/lib/app-utils/site-context.js.map +1 -0
  646. package/src/lib/app-utils/sitemap.d.ts +117 -0
  647. package/src/lib/app-utils/sitemap.js +183 -0
  648. package/src/lib/app-utils/sitemap.js.map +1 -0
  649. package/src/lib/app-utils/social-image.d.ts +112 -0
  650. package/src/lib/app-utils/social-image.js +191 -0
  651. package/src/lib/app-utils/social-image.js.map +1 -0
  652. package/src/lib/app-utils/starter-templates.d.ts +99 -0
  653. package/src/lib/app-utils/starter-templates.js +579 -0
  654. package/src/lib/app-utils/starter-templates.js.map +1 -0
  655. package/src/lib/app-utils/stored-nodes.d.ts +120 -0
  656. package/src/lib/app-utils/stored-nodes.js +174 -0
  657. package/src/lib/app-utils/stored-nodes.js.map +1 -0
  658. package/src/lib/app-utils/strip-undefined.d.ts +59 -0
  659. package/src/lib/app-utils/strip-undefined.js +95 -0
  660. package/src/lib/app-utils/strip-undefined.js.map +1 -0
  661. package/src/lib/app-utils/stripe-deployment-mode.d.ts +47 -0
  662. package/src/lib/app-utils/stripe-deployment-mode.js +70 -0
  663. package/src/lib/app-utils/stripe-deployment-mode.js.map +1 -0
  664. package/src/lib/app-utils/support-tiers.d.ts +108 -0
  665. package/src/lib/app-utils/support-tiers.js +201 -0
  666. package/src/lib/app-utils/support-tiers.js.map +1 -0
  667. package/src/lib/app-utils/timezone-geo-hint.d.ts +36 -0
  668. package/src/lib/app-utils/timezone-geo-hint.js +180 -0
  669. package/src/lib/app-utils/timezone-geo-hint.js.map +1 -0
  670. package/src/lib/app-utils/upload-cors.d.ts +155 -0
  671. package/src/lib/app-utils/upload-cors.js +254 -0
  672. package/src/lib/app-utils/upload-cors.js.map +1 -0
  673. package/src/lib/app-utils/upload-inspection.d.ts +159 -0
  674. package/src/lib/app-utils/upload-inspection.js +539 -0
  675. package/src/lib/app-utils/upload-inspection.js.map +1 -0
  676. package/src/lib/app-utils/url-slug.d.ts +40 -0
  677. package/src/lib/app-utils/url-slug.js +42 -0
  678. package/src/lib/app-utils/url-slug.js.map +1 -0
  679. package/src/lib/app-utils/usage-budget.d.ts +429 -0
  680. package/src/lib/app-utils/usage-budget.js +421 -0
  681. package/src/lib/app-utils/usage-budget.js.map +1 -0
  682. package/src/lib/app-utils/variables.d.ts +96 -0
  683. package/src/lib/app-utils/variables.js +233 -0
  684. package/src/lib/app-utils/variables.js.map +1 -0
  685. package/src/lib/app-utils/video-asset-facts.d.ts +61 -0
  686. package/src/lib/app-utils/video-asset-facts.js +70 -0
  687. package/src/lib/app-utils/video-asset-facts.js.map +1 -0
  688. package/src/lib/app-utils/video-object.d.ts +89 -0
  689. package/src/lib/app-utils/video-object.js +245 -0
  690. package/src/lib/app-utils/video-object.js.map +1 -0
  691. package/src/lib/app-utils/visitor-consent.d.ts +757 -0
  692. package/src/lib/app-utils/visitor-consent.js +981 -0
  693. package/src/lib/app-utils/visitor-consent.js.map +1 -0
  694. package/src/lib/app-utils/visitor-record-ceiling.d.ts +223 -0
  695. package/src/lib/app-utils/visitor-record-ceiling.js +215 -0
  696. package/src/lib/app-utils/visitor-record-ceiling.js.map +1 -0
  697. package/src/lib/app-utils/web-vitals-rum.d.ts +53 -0
  698. package/src/lib/app-utils/web-vitals-rum.js +278 -0
  699. package/src/lib/app-utils/web-vitals-rum.js.map +1 -0
  700. package/src/lib/app-utils/webhook-delivery.d.ts +324 -0
  701. package/src/lib/app-utils/webhook-delivery.js +413 -0
  702. package/src/lib/app-utils/webhook-delivery.js.map +1 -0
  703. package/src/lib/app-utils/where-used.d.ts +57 -0
  704. package/src/lib/app-utils/where-used.js +59 -0
  705. package/src/lib/app-utils/where-used.js.map +1 -0
  706. package/src/lib/app-utils/wistia-embed.d.ts +86 -0
  707. package/src/lib/app-utils/wistia-embed.js +119 -0
  708. package/src/lib/app-utils/wistia-embed.js.map +1 -0
  709. package/src/lib/app-utils/workflows.d.ts +136 -0
  710. package/src/lib/app-utils/workflows.js +346 -0
  711. package/src/lib/app-utils/workflows.js.map +1 -0
  712. package/src/lib/canvas-manager/canvas-manager-tree.d.ts +109 -0
  713. package/src/lib/canvas-manager/canvas-manager-tree.js +139 -0
  714. package/src/lib/canvas-manager/canvas-manager-tree.js.map +1 -0
  715. package/src/lib/canvas-manager/canvas-manager.d.ts +549 -0
  716. package/src/lib/canvas-manager/canvas-manager.js +1311 -0
  717. package/src/lib/canvas-manager/canvas-manager.js.map +1 -0
  718. package/src/lib/canvas-manager/index.d.ts +20 -0
  719. package/src/lib/canvas-manager/index.js +21 -0
  720. package/src/lib/canvas-manager/index.js.map +1 -0
  721. package/src/lib/canvas-manager/stores/index.d.ts +17 -0
  722. package/src/lib/canvas-manager/stores/index.js +18 -0
  723. package/src/lib/canvas-manager/stores/index.js.map +1 -0
  724. package/src/lib/canvas-manager/stores/node.store.d.ts +30 -0
  725. package/src/lib/canvas-manager/stores/node.store.js +45 -0
  726. package/src/lib/canvas-manager/stores/node.store.js.map +1 -0
  727. package/src/lib/components-manager/components-manager.d.ts +56 -0
  728. package/src/lib/components-manager/components-manager.js +191 -0
  729. package/src/lib/components-manager/components-manager.js.map +1 -0
  730. package/src/lib/components-manager/index.d.ts +18 -0
  731. package/src/lib/components-manager/index.js +19 -0
  732. package/src/lib/components-manager/index.js.map +1 -0
  733. package/src/lib/emit-manager/emit-manager.d.ts +56 -0
  734. package/src/lib/emit-manager/emit-manager.js +60 -0
  735. package/src/lib/emit-manager/emit-manager.js.map +1 -0
  736. package/src/lib/emit-manager/index.d.ts +18 -0
  737. package/src/lib/emit-manager/index.js +19 -0
  738. package/src/lib/emit-manager/index.js.map +1 -0
  739. package/src/lib/foundation/constants/_internal.d.ts +18 -0
  740. package/src/lib/foundation/constants/_internal.js +62 -0
  741. package/src/lib/foundation/constants/_internal.js.map +1 -0
  742. package/src/lib/foundation/constants/app.d.ts +23 -0
  743. package/src/lib/foundation/constants/app.js +25 -0
  744. package/src/lib/foundation/constants/app.js.map +1 -0
  745. package/src/lib/foundation/constants/canvas.d.ts +18 -0
  746. package/src/lib/foundation/constants/canvas.js +18 -0
  747. package/src/lib/foundation/constants/canvas.js.map +1 -0
  748. package/src/lib/foundation/constants/components.d.ts +54 -0
  749. package/src/lib/foundation/constants/components.js +61 -0
  750. package/src/lib/foundation/constants/components.js.map +1 -0
  751. package/src/lib/foundation/constants/shared.d.ts +50 -0
  752. package/src/lib/foundation/constants/shared.js +49 -0
  753. package/src/lib/foundation/constants/shared.js.map +1 -0
  754. package/src/lib/foundation/constants/symbol.d.ts +63 -0
  755. package/src/lib/foundation/constants/symbol.js +75 -0
  756. package/src/lib/foundation/constants/symbol.js.map +1 -0
  757. package/src/lib/foundation/definitions/components.types.d.ts +372 -0
  758. package/src/lib/foundation/definitions/components.types.js +180 -0
  759. package/src/lib/foundation/definitions/components.types.js.map +1 -0
  760. package/src/lib/foundation/definitions/contact.types.d.ts +73 -0
  761. package/src/lib/foundation/definitions/contact.types.js +107 -0
  762. package/src/lib/foundation/definitions/contact.types.js.map +1 -0
  763. package/src/lib/foundation/definitions/host-content-collections.d.ts +137 -0
  764. package/src/lib/foundation/definitions/host-content-collections.js +219 -0
  765. package/src/lib/foundation/definitions/host-content-collections.js.map +1 -0
  766. package/src/lib/foundation/definitions/org-billing.types.d.ts +1361 -0
  767. package/src/lib/foundation/definitions/org-billing.types.js +77 -0
  768. package/src/lib/foundation/definitions/org-billing.types.js.map +1 -0
  769. package/src/lib/foundation/definitions/organization.types.d.ts +307 -0
  770. package/src/lib/foundation/definitions/organization.types.js +42 -0
  771. package/src/lib/foundation/definitions/organization.types.js.map +1 -0
  772. package/src/lib/foundation/definitions/platform.types.d.ts +1326 -0
  773. package/src/lib/foundation/definitions/platform.types.js +124 -0
  774. package/src/lib/foundation/definitions/platform.types.js.map +1 -0
  775. package/src/lib/foundation/definitions/property-kinds.d.ts +189 -0
  776. package/src/lib/foundation/definitions/property-kinds.js +565 -0
  777. package/src/lib/foundation/definitions/property-kinds.js.map +1 -0
  778. package/src/lib/foundation/definitions/shared.d.ts +23 -0
  779. package/src/lib/foundation/definitions/shared.js +18 -0
  780. package/src/lib/foundation/definitions/shared.js.map +1 -0
  781. package/src/lib/foundation/definitions/write-deny-coverage.util.d.ts +249 -0
  782. package/src/lib/foundation/definitions/write-deny-coverage.util.js +499 -0
  783. package/src/lib/foundation/definitions/write-deny-coverage.util.js.map +1 -0
  784. package/src/lib/foundation/index.d.ts +32 -0
  785. package/src/lib/foundation/index.js +67 -0
  786. package/src/lib/foundation/index.js.map +1 -0
  787. package/src/lib/lifecycle.d.ts +24 -0
  788. package/src/lib/lifecycle.js +39 -0
  789. package/src/lib/lifecycle.js.map +1 -0
  790. package/src/lib/mst/common.d.ts +17 -0
  791. package/src/lib/mst/common.js +23 -0
  792. package/src/lib/mst/common.js.map +1 -0
  793. package/src/lib/mst/index.d.ts +19 -0
  794. package/src/lib/mst/index.js +20 -0
  795. package/src/lib/mst/index.js.map +1 -0
  796. package/src/lib/mst/json.d.ts +22 -0
  797. package/src/lib/mst/json.js +23 -0
  798. package/src/lib/mst/json.js.map +1 -0
  799. package/src/lib/mst/types.d.ts +20 -0
  800. package/src/lib/mst/types.js +18 -0
  801. package/src/lib/mst/types.js.map +1 -0
  802. package/src/lib/plugin-manager/billing-webhook-hooks.d.ts +77 -0
  803. package/src/lib/plugin-manager/billing-webhook-hooks.js +55 -0
  804. package/src/lib/plugin-manager/billing-webhook-hooks.js.map +1 -0
  805. package/src/lib/plugin-manager/commerce-zone-props.d.ts +172 -0
  806. package/src/lib/plugin-manager/commerce-zone-props.js +31 -0
  807. package/src/lib/plugin-manager/commerce-zone-props.js.map +1 -0
  808. package/src/lib/plugin-manager/custom-fields.d.ts +60 -0
  809. package/src/lib/plugin-manager/custom-fields.js +39 -0
  810. package/src/lib/plugin-manager/custom-fields.js.map +1 -0
  811. package/src/lib/plugin-manager/editor-sessions.d.ts +109 -0
  812. package/src/lib/plugin-manager/editor-sessions.js +137 -0
  813. package/src/lib/plugin-manager/editor-sessions.js.map +1 -0
  814. package/src/lib/plugin-manager/enabled-plugins.d.ts +438 -0
  815. package/src/lib/plugin-manager/enabled-plugins.js +403 -0
  816. package/src/lib/plugin-manager/enabled-plugins.js.map +1 -0
  817. package/src/lib/plugin-manager/feature-plugins.d.ts +1314 -0
  818. package/src/lib/plugin-manager/feature-plugins.js +609 -0
  819. package/src/lib/plugin-manager/feature-plugins.js.map +1 -0
  820. package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +11 -0
  821. package/src/lib/plugin-manager/first-party-plugins.generated.js +149 -0
  822. package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -0
  823. package/src/lib/plugin-manager/index.d.ts +42 -0
  824. package/src/lib/plugin-manager/index.js +46 -0
  825. package/src/lib/plugin-manager/index.js.map +1 -0
  826. package/src/lib/plugin-manager/install-presets.d.ts +93 -0
  827. package/src/lib/plugin-manager/install-presets.js +86 -0
  828. package/src/lib/plugin-manager/install-presets.js.map +1 -0
  829. package/src/lib/plugin-manager/media-delivery-provider.d.ts +124 -0
  830. package/src/lib/plugin-manager/media-delivery-provider.js +53 -0
  831. package/src/lib/plugin-manager/media-delivery-provider.js.map +1 -0
  832. package/src/lib/plugin-manager/order-fulfilment.d.ts +142 -0
  833. package/src/lib/plugin-manager/order-fulfilment.js +104 -0
  834. package/src/lib/plugin-manager/order-fulfilment.js.map +1 -0
  835. package/src/lib/plugin-manager/plugin-activity-actions.d.ts +122 -0
  836. package/src/lib/plugin-manager/plugin-activity-actions.js +140 -0
  837. package/src/lib/plugin-manager/plugin-activity-actions.js.map +1 -0
  838. package/src/lib/plugin-manager/plugin-bridge.d.ts +98 -0
  839. package/src/lib/plugin-manager/plugin-bridge.js +154 -0
  840. package/src/lib/plugin-manager/plugin-bridge.js.map +1 -0
  841. package/src/lib/plugin-manager/plugin-config.d.ts +148 -0
  842. package/src/lib/plugin-manager/plugin-config.js +228 -0
  843. package/src/lib/plugin-manager/plugin-config.js.map +1 -0
  844. package/src/lib/plugin-manager/plugin-console-crons.d.ts +139 -0
  845. package/src/lib/plugin-manager/plugin-console-crons.js +177 -0
  846. package/src/lib/plugin-manager/plugin-console-crons.js.map +1 -0
  847. package/src/lib/plugin-manager/plugin-contact-capture.d.ts +220 -0
  848. package/src/lib/plugin-manager/plugin-contact-capture.js +89 -0
  849. package/src/lib/plugin-manager/plugin-contact-capture.js.map +1 -0
  850. package/src/lib/plugin-manager/plugin-contributions.d.ts +244 -0
  851. package/src/lib/plugin-manager/plugin-contributions.js +283 -0
  852. package/src/lib/plugin-manager/plugin-contributions.js.map +1 -0
  853. package/src/lib/plugin-manager/plugin-entitlement-keys.d.ts +169 -0
  854. package/src/lib/plugin-manager/plugin-entitlement-keys.js +84 -0
  855. package/src/lib/plugin-manager/plugin-entitlement-keys.js.map +1 -0
  856. package/src/lib/plugin-manager/plugin-entitlements.d.ts +181 -0
  857. package/src/lib/plugin-manager/plugin-entitlements.js +188 -0
  858. package/src/lib/plugin-manager/plugin-entitlements.js.map +1 -0
  859. package/src/lib/plugin-manager/plugin-events.d.ts +145 -0
  860. package/src/lib/plugin-manager/plugin-events.js +79 -0
  861. package/src/lib/plugin-manager/plugin-events.js.map +1 -0
  862. package/src/lib/plugin-manager/plugin-figures.d.ts +251 -0
  863. package/src/lib/plugin-manager/plugin-figures.js +252 -0
  864. package/src/lib/plugin-manager/plugin-figures.js.map +1 -0
  865. package/src/lib/plugin-manager/plugin-host-collections.d.ts +146 -0
  866. package/src/lib/plugin-manager/plugin-host-collections.js +116 -0
  867. package/src/lib/plugin-manager/plugin-host-collections.js.map +1 -0
  868. package/src/lib/plugin-manager/plugin-jobs.d.ts +130 -0
  869. package/src/lib/plugin-manager/plugin-jobs.js +182 -0
  870. package/src/lib/plugin-manager/plugin-jobs.js.map +1 -0
  871. package/src/lib/plugin-manager/plugin-loader.d.ts +86 -0
  872. package/src/lib/plugin-manager/plugin-loader.js +223 -0
  873. package/src/lib/plugin-manager/plugin-loader.js.map +1 -0
  874. package/src/lib/plugin-manager/plugin-manager.d.ts +95 -0
  875. package/src/lib/plugin-manager/plugin-manager.js +343 -0
  876. package/src/lib/plugin-manager/plugin-manager.js.map +1 -0
  877. package/src/lib/plugin-manager/plugin-metered-lines.d.ts +97 -0
  878. package/src/lib/plugin-manager/plugin-metered-lines.js +123 -0
  879. package/src/lib/plugin-manager/plugin-metered-lines.js.map +1 -0
  880. package/src/lib/plugin-manager/plugin-org-erasure.d.ts +52 -0
  881. package/src/lib/plugin-manager/plugin-org-erasure.js +100 -0
  882. package/src/lib/plugin-manager/plugin-org-erasure.js.map +1 -0
  883. package/src/lib/plugin-manager/plugin-permissions.d.ts +69 -0
  884. package/src/lib/plugin-manager/plugin-permissions.js +77 -0
  885. package/src/lib/plugin-manager/plugin-permissions.js.map +1 -0
  886. package/src/lib/plugin-manager/plugin-person-erasure.d.ts +58 -0
  887. package/src/lib/plugin-manager/plugin-person-erasure.js +109 -0
  888. package/src/lib/plugin-manager/plugin-person-erasure.js.map +1 -0
  889. package/src/lib/plugin-manager/plugin-record-cards.d.ts +99 -0
  890. package/src/lib/plugin-manager/plugin-record-cards.js +59 -0
  891. package/src/lib/plugin-manager/plugin-record-cards.js.map +1 -0
  892. package/src/lib/plugin-manager/plugin-record-facts.d.ts +111 -0
  893. package/src/lib/plugin-manager/plugin-record-facts.js +51 -0
  894. package/src/lib/plugin-manager/plugin-record-facts.js.map +1 -0
  895. package/src/lib/plugin-manager/plugin-record-routes.d.ts +129 -0
  896. package/src/lib/plugin-manager/plugin-record-routes.js +93 -0
  897. package/src/lib/plugin-manager/plugin-record-routes.js.map +1 -0
  898. package/src/lib/plugin-manager/plugin-record-timeline.d.ts +147 -0
  899. package/src/lib/plugin-manager/plugin-record-timeline.js +39 -0
  900. package/src/lib/plugin-manager/plugin-record-timeline.js.map +1 -0
  901. package/src/lib/plugin-manager/plugin-resource-drafts.d.ts +137 -0
  902. package/src/lib/plugin-manager/plugin-resource-drafts.js +51 -0
  903. package/src/lib/plugin-manager/plugin-resource-drafts.js.map +1 -0
  904. package/src/lib/plugin-manager/plugin-services.d.ts +94 -0
  905. package/src/lib/plugin-manager/plugin-services.js +153 -0
  906. package/src/lib/plugin-manager/plugin-services.js.map +1 -0
  907. package/src/lib/plugin-manager/plugin-styles-ui.d.ts +71 -0
  908. package/src/lib/plugin-manager/plugin-styles-ui.js +80 -0
  909. package/src/lib/plugin-manager/plugin-styles-ui.js.map +1 -0
  910. package/src/lib/plugin-manager/plugin-styles.d.ts +176 -0
  911. package/src/lib/plugin-manager/plugin-styles.js +186 -0
  912. package/src/lib/plugin-manager/plugin-styles.js.map +1 -0
  913. package/src/lib/plugin-manager/plugin-subprocessors.d.ts +135 -0
  914. package/src/lib/plugin-manager/plugin-subprocessors.js +129 -0
  915. package/src/lib/plugin-manager/plugin-subprocessors.js.map +1 -0
  916. package/src/lib/plugin-manager/plugin-tax-profile.d.ts +84 -0
  917. package/src/lib/plugin-manager/plugin-tax-profile.js +39 -0
  918. package/src/lib/plugin-manager/plugin-tax-profile.js.map +1 -0
  919. package/src/lib/plugin-manager/plugin-user-erasure.d.ts +53 -0
  920. package/src/lib/plugin-manager/plugin-user-erasure.js +84 -0
  921. package/src/lib/plugin-manager/plugin-user-erasure.js.map +1 -0
  922. package/src/lib/plugin-manager/plugin-zones.d.ts +121 -0
  923. package/src/lib/plugin-manager/plugin-zones.js +74 -0
  924. package/src/lib/plugin-manager/plugin-zones.js.map +1 -0
  925. package/src/lib/plugin-manager/realm-plugins.d.ts +112 -0
  926. package/src/lib/plugin-manager/realm-plugins.js +196 -0
  927. package/src/lib/plugin-manager/realm-plugins.js.map +1 -0
  928. package/src/lib/plugin-manager/realm-server.d.ts +54 -0
  929. package/src/lib/plugin-manager/realm-server.js +88 -0
  930. package/src/lib/plugin-manager/realm-server.js.map +1 -0
  931. package/src/lib/plugin-manager/record-zone-props.d.ts +126 -0
  932. package/src/lib/plugin-manager/record-zone-props.js +31 -0
  933. package/src/lib/plugin-manager/record-zone-props.js.map +1 -0
  934. package/src/lib/plugin-manager/site-page-hooks.d.ts +102 -0
  935. package/src/lib/plugin-manager/site-page-hooks.js +114 -0
  936. package/src/lib/plugin-manager/site-page-hooks.js.map +1 -0
  937. package/src/lib/plugin-manager/site-runtime.d.ts +57 -0
  938. package/src/lib/plugin-manager/site-runtime.js +25 -0
  939. package/src/lib/plugin-manager/site-runtime.js.map +1 -0
  940. package/src/lib/plugin-manager/usage-alert-contributors.d.ts +115 -0
  941. package/src/lib/plugin-manager/usage-alert-contributors.js +106 -0
  942. package/src/lib/plugin-manager/usage-alert-contributors.js.map +1 -0
  943. package/src/lib/types/ast.d.ts +199 -0
  944. package/src/lib/types/ast.js +20 -0
  945. package/src/lib/types/ast.js.map +1 -0
  946. package/src/lib/types/index.d.ts +20 -0
  947. package/src/lib/types/index.js +21 -0
  948. package/src/lib/types/index.js.map +1 -0
  949. package/src/lib/types/nodes.d.ts +608 -0
  950. package/src/lib/types/nodes.js +28 -0
  951. package/src/lib/types/nodes.js.map +1 -0
  952. package/src/lib/types/routing.d.ts +17 -0
  953. package/src/lib/types/routing.js +18 -0
  954. package/src/lib/types/routing.js.map +1 -0
  955. package/src/lib/types/screen.d.ts +23 -0
  956. package/src/lib/types/screen.js +18 -0
  957. package/src/lib/types/screen.js.map +1 -0
  958. package/src/lib/utils.d.ts +25 -0
  959. package/src/lib/utils.js +42 -0
  960. package/src/lib/utils.js.map +1 -0
  961. package/src/server.d.ts +37 -0
  962. package/src/server.js +55 -0
  963. package/src/server.js.map +1 -0
@@ -0,0 +1,1546 @@
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
+ /**
18
+ * Contacts CRM v2 (AGL-2595): the records that sit BESIDE a contact.
19
+ *
20
+ * v1 is one collection — `contacts` — and everything a holder knows about a
21
+ * person lives in that holder's facet on the shared row. That shape is right
22
+ * for the person and wrong for everything a sales team keeps AROUND the
23
+ * person: a company is known by several contacts, a deal moves through
24
+ * stages on its own clock, a task is due whether or not anybody opens the
25
+ * contact it hangs off, and an activity log grows past anything a facet
26
+ * should carry. So each of those is a collection of its own under
27
+ * `orgs/{orgId}/`, pointing back at the contact by id.
28
+ *
29
+ * ## One scope model, not a second one
30
+ *
31
+ * Every collection here carries `visibleTo`, the same array `contacts`
32
+ * carries, and is stamped the same way — {@link crmScopeTokens} is the
33
+ * contact create path's expression, exported so that no creator computes its
34
+ * own. The rules gate all six on the contacts predicate (`canReadScopedPeople`,
35
+ * `data.manage`), because a deal or a call log is a fact about a person and
36
+ * discloses exactly what the contact row would.
37
+ *
38
+ * What these collections do NOT have is the facet map. A contact is shared
39
+ * across holders because one human is one row; a company, deal or task is
40
+ * one holder's record from the moment it is created, so `visibleTo` alone
41
+ * says who may see it and there is nothing to split per holder.
42
+ *
43
+ * Pure data module: types, constants and the small helpers every surface
44
+ * would otherwise write for itself. No Firestore, no React.
45
+ */
46
+ import type { AglynPostalAddress, OrgCrmAssignmentRule } from '../foundation';
47
+ import { type ConsentGroup } from './consent-groups';
48
+ import { type ContactLifecycleStage, type CrmActivityKind, type CrmTaskKind } from './crm-kinds';
49
+ import { type ContactInteraction, type ContactSegment, type ContactSource } from './contacts';
50
+ import { type ScopeToken } from './scope-tokens';
51
+ export * from './crm-kinds';
52
+ /**
53
+ * The CRM's collections, every one under `orgs/{orgId}/`.
54
+ *
55
+ * Named here rather than spelled at each call site because the rules, the
56
+ * indexes and the console must agree on the string, and the three prefixed
57
+ * ones are prefixed on purpose: `tasks`, `activities` and `views` are words
58
+ * the org document will want for something else one day, and a collection
59
+ * name is persisted in every document path that uses it.
60
+ */
61
+ export declare const CRM_COLLECTIONS: {
62
+ readonly companies: "companies";
63
+ readonly pipelines: "pipelines";
64
+ readonly deals: "deals";
65
+ readonly tasks: "crmTasks";
66
+ readonly activities: "crmActivities";
67
+ readonly contactFields: "contactFields";
68
+ readonly views: "crmViews";
69
+ readonly emailTemplates: "crmEmailTemplates";
70
+ };
71
+ export type CrmCollection = (typeof CRM_COLLECTIONS)[keyof typeof CRM_COLLECTIONS];
72
+ /**
73
+ * The three collections the CRM RECORDS band counts (AGL-2611), in the order
74
+ * the billing caption lists them. `contacts` is not in `CRM_COLLECTIONS`
75
+ * because it predates the hub and is addressed through `orgDataCollection`,
76
+ * so the band's own list has to name all three itself. Tasks, pipelines,
77
+ * activities and field definitions are deliberately absent: a band that
78
+ * counted what a rep does every hour would price the team's effort, not the
79
+ * audience it holds.
80
+ */
81
+ export declare const CRM_RECORD_COLLECTIONS: readonly ["contacts", "companies", "deals"];
82
+ /**
83
+ * What a create says when the records band refused it, on every surface —
84
+ * the contacts list's alert, the company and deal drawers, the plugin's
85
+ * create routes and the lead conversion (AGL-2596, widened in AGL-2611).
86
+ *
87
+ * One sentence in one place, because a reader who is refused in the drawer
88
+ * and then reads the list must be told the same thing, and the remedy is the
89
+ * same wherever the refusal lands: a band refuses only on a plan that puts
90
+ * no overage rate past it, so "upgrade" is the whole of the answer.
91
+ */
92
+ export declare const CRM_RECORDS_BAND_FULL_MESSAGE: string;
93
+ /**
94
+ * The most logged activities ONE record may carry (AGL-2611) — a contact's,
95
+ * a company's or a deal's own log, counted on the link the activity was
96
+ * filed under.
97
+ *
98
+ * A platform ceiling and not a plan dimension, in the family of
99
+ * `WEBHOOK_MAX_PER_HOST` and `NON_PAGE_SCREEN_MAX_PER_HOST`: activities are
100
+ * not in the records band because they are bounded by human effort, and
101
+ * this is the bound. Five thousand is a call a day for fourteen years on one
102
+ * person, so nobody working a real relationship reaches it — what does is
103
+ * an automation logging on every event, or an import replaying a history,
104
+ * and either of those past this line is a document cost with no reader.
105
+ *
106
+ * Enforced where an activity is written: the console's log dialog, the
107
+ * `logCrmActivity` automation step and `POST /v1/activities`, each with one
108
+ * aggregate read on the record's link before the create. The timeline reads
109
+ * a hundred at a time and is untouched by the number.
110
+ */
111
+ export declare const CRM_ACTIVITIES_PER_RECORD_CEILING = 5000;
112
+ /**
113
+ * What every writer says when a record's log is full — the console's log
114
+ * dialog, the automation step's run history and `POST /v1/activities`.
115
+ */
116
+ export declare const CRM_ACTIVITY_LOG_FULL_MESSAGE: string;
117
+ /** The record an activity is filed under: its links, of which one leads. */
118
+ export interface CrmActivityLink {
119
+ contactId?: string | null;
120
+ companyId?: string | null;
121
+ dealId?: string | null;
122
+ /**
123
+ * `hosts/{hostId}/leads/{leadId}` — a person not yet converted (AGL-2615).
124
+ * A lead is host-scoped by path and carries no `visibleTo` of its own, so
125
+ * an activity filed under one is stamped with the site's scope like any
126
+ * other record created from that site.
127
+ */
128
+ leadId?: string | null;
129
+ }
130
+ /**
131
+ * The field the per-record activity ceiling is counted on, or `null` for an
132
+ * activity that names no record at all.
133
+ *
134
+ * The contact leads, then the company, then the deal: an activity logged
135
+ * from a contact's page carries the company beside it (the automation step
136
+ * copies the facet's `companyId` onto every record it creates), and a
137
+ * ceiling counted on the company would let one busy account exhaust every
138
+ * contact filed under it. The record whose PAGE the log is read on is the
139
+ * one whose log has the limit. Shared by the client dialog and the two
140
+ * server writers so they count the same thing.
141
+ */
142
+ export declare function crmActivityCeilingLink(link: CrmActivityLink): {
143
+ field: 'contactId' | 'companyId' | 'dealId' | 'leadId';
144
+ id: string;
145
+ } | null;
146
+ /**
147
+ * Whether ONE MORE activity fits under `CRM_ACTIVITIES_PER_RECORD_CEILING`.
148
+ * Both halves of the boundary live here so no writer re-derives `>=`.
149
+ */
150
+ export declare function crmActivityLogHasRoom(existing: number): boolean;
151
+ /** How a lifecycle stage reads on screen — typed so a stage cannot ship unlabeled. */
152
+ export declare const CONTACT_LIFECYCLE_STAGE_LABELS: Record<ContactLifecycleStage, string>;
153
+ /**
154
+ * The stage a person is in once a capture has happened that implies at least
155
+ * `floor` (AGL-2612).
156
+ *
157
+ * The one ordering rule every capture door shares: a door names the EARLIEST
158
+ * stage that describes what just happened — a form submission is a lead, a
159
+ * newsletter opt-in is a subscriber, a purchase is a customer — and the
160
+ * result is that stage for a person who had none or an earlier one, and the
161
+ * stage they already had otherwise. "Never downgrades" is the whole contract:
162
+ * a customer who fills in a contact form is still a customer, and `other` —
163
+ * the deliberate stage a business picked for a funnel step none of the names
164
+ * fit — sits after `customer` in the list precisely so no capture can
165
+ * overwrite it. A stored value that is not a stage at all reads as absent,
166
+ * because a capture door is not the place to preserve a typo.
167
+ *
168
+ * With no floor the answer is the current stage as it stands, or `undefined`
169
+ * for one that is absent or unusable — so a writer can apply this
170
+ * unconditionally and write only what comes back.
171
+ */
172
+ export declare function advanceContactLifecycleStage(current: unknown, floor: ContactLifecycleStage | undefined): ContactLifecycleStage | undefined;
173
+ /**
174
+ * The stage a person is in once they have BOUGHT something (AGL-2596).
175
+ *
176
+ * `customer` when they had no stage or an earlier one; whatever they already
177
+ * had otherwise — {@link advanceContactLifecycleStage} with `customer` as the
178
+ * floor, kept under its own name because "after a purchase" is the question
179
+ * the order paths and the reports ask.
180
+ */
181
+ export declare function contactLifecycleStageAfterPurchase(current: unknown): ContactLifecycleStage;
182
+ /**
183
+ * What a custom contact field may hold.
184
+ *
185
+ * Scalars only. A field is something a merchant filters and exports on, and
186
+ * a nested value is neither; `null` is the explicit "cleared" that a form
187
+ * writes so the key stays present for a `where` clause to find.
188
+ */
189
+ export type ContactCustomValue = string | number | boolean | null;
190
+ /**
191
+ * The same scalar, under the name the other objects use (AGL-2661).
192
+ *
193
+ * A company's and a deal's `custom` map hold exactly what a contact's
194
+ * does — one definition, one coercion rule, one stored shape — so the
195
+ * value type is one type with two names: the contact name it was born
196
+ * with, and this one for code that is not about contacts.
197
+ */
198
+ export type CrmCustomValue = ContactCustomValue;
199
+ /**
200
+ * The fields every CRM document carries.
201
+ *
202
+ * `visibleTo` is the scope both enforcement layers evaluate — see
203
+ * `scope-tokens.ts` for why an absent one is seen by NOBODY. `hostId` is
204
+ * provenance: the site whose console created the record, never rewritten,
205
+ * so a report can say where a deal came from after the scope has widened.
206
+ * The timestamps are `unknown` because a client write carries a `Date` and a
207
+ * read hands back a Firestore `Timestamp`; callers narrow at the edge.
208
+ */
209
+ export interface CrmScoped {
210
+ visibleTo: string[];
211
+ /** The site that created it. */
212
+ hostId: string;
213
+ createdAt?: unknown;
214
+ updatedAt?: unknown;
215
+ }
216
+ /** `orgs/{orgId}/companies/{companyId}`. */
217
+ export interface CrmCompany extends CrmScoped {
218
+ name: string;
219
+ /** `nameSearchFields` twins, for the prefix search the list runs. */
220
+ nameLower?: string;
221
+ nameTokens?: string[];
222
+ /** Lowercase hostname, no protocol — see {@link normalizeCompanyDomain}. */
223
+ domain?: string;
224
+ website?: string;
225
+ /** E.164 — `normalizePhone` before writing. */
226
+ phone?: string;
227
+ address?: AglynPostalAddress | null;
228
+ industry?: string;
229
+ ownerUid?: string;
230
+ notes?: string;
231
+ /**
232
+ * Lowercased, deduplicated, capped at twenty — the same shape a contact's
233
+ * tags take, so a bulk "Add tag" over companies and one over contacts
234
+ * write the same kind of value (AGL-2621).
235
+ */
236
+ tags?: string[];
237
+ createdByUid?: string;
238
+ /**
239
+ * How many contacts name this company in their {@link CONTACT_COMPANY_IDS_FIELD}
240
+ * mirror — see {@link COMPANY_CONTACTS_COUNT_FIELD}. Absent on a company
241
+ * nobody has linked since the counter existed, which reads as zero.
242
+ */
243
+ contactsCount?: number;
244
+ /**
245
+ * Custom field values, keyed by the key of a definition whose `object`
246
+ * is `company` — see {@link fieldDefinitionObject} (AGL-2661).
247
+ */
248
+ custom?: Record<string, CrmCustomValue>;
249
+ /**
250
+ * When the earliest OPEN task filed against this company is due, epoch
251
+ * ms, or `null` when none is — see {@link CrmDeal.nextTaskAtMs}.
252
+ */
253
+ nextTaskAtMs?: number | null;
254
+ /** Org-library files attached to the company (AGL-2662) — see {@link CRM_MEDIA_IDS_MAX}. */
255
+ mediaIds?: string[];
256
+ }
257
+ /** One step of a pipeline. */
258
+ export interface CrmDealStage {
259
+ id: string;
260
+ name: string;
261
+ /** Position in the pipeline, ascending. */
262
+ order: number;
263
+ /** Chance of closing from here, 0–100 — what a weighted forecast multiplies by. */
264
+ probability: number;
265
+ /**
266
+ * Whether landing in this stage closes the deal. A pipeline has exactly one
267
+ * `won` and one `lost` stage in the default set; `open` is everything in
268
+ * between.
269
+ */
270
+ kind: 'open' | 'won' | 'lost';
271
+ }
272
+ /** `orgs/{orgId}/pipelines/{pipelineId}`. */
273
+ export interface CrmPipeline extends CrmScoped {
274
+ name: string;
275
+ stages: CrmDealStage[];
276
+ /** The pipeline a new deal lands in when nobody picks one. */
277
+ isDefault?: boolean;
278
+ /**
279
+ * When the pipeline was retired, epoch ms. An archived pipeline takes no
280
+ * new deal and is offered by no picker, but it is never deleted: the deals
281
+ * it closed still name it, and a report that could not resolve their
282
+ * stages would forecast them as orphans. Absent or `null` while active.
283
+ */
284
+ archivedAt?: number | null;
285
+ }
286
+ /** Whether a pipeline has been retired — see {@link CrmPipeline.archivedAt}. */
287
+ export declare function isPipelineArchived(pipeline: Pick<CrmPipeline, 'archivedAt'> | null | undefined): boolean;
288
+ /**
289
+ * The stages a fresh pipeline starts with.
290
+ *
291
+ * Readonly on purpose: a pipeline document stores its own COPY (`[...]`), so
292
+ * a merchant editing their stages must not be editing the module's default,
293
+ * and a second pipeline seeded later must start from the original set.
294
+ */
295
+ export declare const DEFAULT_DEAL_STAGES: readonly CrmDealStage[];
296
+ export type CrmDealStatus = 'open' | 'won' | 'lost';
297
+ /**
298
+ * One product on a deal — what is being sold, how many, at what.
299
+ *
300
+ * `productId` names a catalog product when the line came from one; a line
301
+ * typed by hand has none. The name is copied rather than joined, the way a
302
+ * deal copies its contact's name: a catalog product can be renamed or
303
+ * deleted after the deal was priced, and the deal has to keep saying what
304
+ * it was for. `currency` is the deal's — every line on a deal is in one
305
+ * currency, because their sum is the deal's amount and a sum across
306
+ * currencies is a number with no unit.
307
+ */
308
+ export interface CrmDealLineItem {
309
+ productId?: string;
310
+ name: string;
311
+ /** A whole number of units, one or more. */
312
+ quantity: number;
313
+ /** Per unit, in the currency's minor unit, zero or more. */
314
+ unitAmountCents: number;
315
+ /** Lowercase ISO 4217. */
316
+ currency: string;
317
+ }
318
+ /** The most lines one deal carries — a quote, not a catalog. */
319
+ export declare const DEAL_LINE_ITEMS_MAX = 50;
320
+ export declare const DEAL_LINE_ITEM_NAME_MAX = 120;
321
+ /** Units per line; past this the number is a data-entry slip. */
322
+ export declare const DEAL_LINE_ITEM_QUANTITY_MAX = 1000000;
323
+ /**
324
+ * `orgs/{orgId}/deals/{dealId}`.
325
+ *
326
+ * A WON DEAL MAKES ITS CONTACT A CUSTOMER (AGL-2641). A win is the same
327
+ * fact as a purchase — the business has decided this person bought — and an
328
+ * order already floors a contact's lifecycle stage at `customer` on
329
+ * capture. So every writer of `status` — the console's stage route at both
330
+ * levels and the REST resource — applies the same floor to the contact
331
+ * `contactId` names on the transition into `won`, in the facet of the site
332
+ * the deal was made on (`hostId`), with `advanceContactLifecycleStage`'s
333
+ * rule: an empty stage is filled, an earlier one advanced, and nobody is
334
+ * ever moved back. Behind no setting, because a won deal is a customer by
335
+ * definition; an automation on `dealWon` is for what happens NEXT.
336
+ */
337
+ export interface CrmDeal extends CrmScoped {
338
+ title: string;
339
+ titleLower?: string;
340
+ pipelineId: string;
341
+ stageId: string;
342
+ /**
343
+ * Denormalized from the stage's `kind` at every stage move, because it is
344
+ * what the list filters and the indexes sort on — a query cannot join the
345
+ * pipeline to ask what the stage means.
346
+ */
347
+ status: CrmDealStatus;
348
+ /**
349
+ * What the deal is worth. Typed by hand on a deal with no line items;
350
+ * on a deal WITH them it is their sum, stored beside them by every
351
+ * writer (`lineItemsTotalCents`), because the board, the reports and the
352
+ * REST list all read this one field and none of them can afford to add
353
+ * up fifty lines per row. A deal with line items refuses a typed amount.
354
+ */
355
+ amountCents?: number;
356
+ /** Lowercase ISO 4217; `'usd'` when absent. */
357
+ currency?: string;
358
+ /** The products behind the amount — see {@link CrmDealLineItem}. */
359
+ lineItems?: CrmDealLineItem[];
360
+ expectedCloseAtMs?: number | null;
361
+ closedAtMs?: number | null;
362
+ /** When the deal last moved — what "stuck in stage" reports read. */
363
+ stageChangedAtMs?: number;
364
+ ownerUid?: string;
365
+ contactId?: string;
366
+ companyId?: string;
367
+ lostReason?: string;
368
+ notes?: string;
369
+ createdByUid?: string;
370
+ /**
371
+ * Custom field values, keyed by the key of a definition whose `object`
372
+ * is `deal` — see {@link fieldDefinitionObject} (AGL-2661).
373
+ */
374
+ custom?: Record<string, CrmCustomValue>;
375
+ /**
376
+ * When the earliest OPEN task filed against this deal is due, epoch ms,
377
+ * or `null` when no open task names it (AGL-2661).
378
+ *
379
+ * DENORMALIZED from `crmTasks`, because the question "which deals have
380
+ * nothing scheduled" is asked of a LIST — a column, a filter, a report
381
+ * tile — and a list cannot afford a task query per row. Every server
382
+ * writer of a task recomputes it for the records the task names
383
+ * (`recomputeCrmNextTaskAt` in the admin library), and a client-direct
384
+ * task write asks the console route to do the same; the Fields section
385
+ * offers a one-off recompute for the records written before the field
386
+ * existed. Absent on such a record, which every reader treats as `null`.
387
+ */
388
+ nextTaskAtMs?: number | null;
389
+ /** Org-library files attached to the deal (AGL-2662) — see {@link CRM_MEDIA_IDS_MAX}. */
390
+ mediaIds?: string[];
391
+ }
392
+ export declare const CRM_TASK_KIND_LABELS: Record<CrmTaskKind, string>;
393
+ export type CrmTaskPriority = 'low' | 'normal' | 'high';
394
+ export type CrmTaskStatus = 'open' | 'done';
395
+ /**
396
+ * `orgs/{orgId}/crmTasks/{taskId}`.
397
+ *
398
+ * The one CRM record that may belong to NO site (AGL-2637): a task filed
399
+ * from the organization's own hub carries `hostId: null` and the org scope
400
+ * token alone, because a to-do owed by the organization — renew the
401
+ * insurance, chase the agency's own invoice — is not captured by any brand.
402
+ * Every other record is a fact about a person some site met, so
403
+ * `CrmScoped` keeps its site required.
404
+ */
405
+ export interface CrmTask extends Omit<CrmScoped, 'hostId'> {
406
+ /** The site that created it, or `null` for the organization's own task. */
407
+ hostId: string | null;
408
+ title: string;
409
+ notes?: string;
410
+ kind: CrmTaskKind;
411
+ priority: CrmTaskPriority;
412
+ status: CrmTaskStatus;
413
+ dueAtMs?: number | null;
414
+ completedAtMs?: number | null;
415
+ /**
416
+ * Who ticked it off, which is not always the assignee: a manager closing
417
+ * out a departed teammate's list completes tasks that were never theirs.
418
+ * Stamped by the `crm/task-complete` route beside `completedAtMs`.
419
+ */
420
+ completedByUid?: string;
421
+ assigneeUid?: string;
422
+ /**
423
+ * The person who made it, or `''` when no person did.
424
+ *
425
+ * An automation has no uid, and inventing one — the action's id, a
426
+ * sentinel — would put a value into a field every reader resolves as a
427
+ * member. The empty string says "nobody", and {@link sourceActionId}
428
+ * beside it says what.
429
+ */
430
+ createdByUid: string;
431
+ /** The automation that created it (AGL-2605), when a person did not. */
432
+ sourceActionId?: string;
433
+ /**
434
+ * The plugin that filed it on the record-timeline seam (AGL-2981) — a
435
+ * sequence's call step, a reply to answer — when no person did.
436
+ */
437
+ sourcePluginId?: string;
438
+ contactId?: string;
439
+ companyId?: string;
440
+ dealId?: string;
441
+ /**
442
+ * When the assignee is reminded (AGL-2659): the due time unless a person
443
+ * moved it, `null` for no reminder. The hourly `/api/crm/task-reminders`
444
+ * runner reads every open task whose reminder has come due, so a task
445
+ * that should never remind carries `null` rather than no field — a
446
+ * missing key and a null both fall outside the range, but the null says
447
+ * it was decided.
448
+ */
449
+ remindAtMs?: number | null;
450
+ /**
451
+ * When the runner handled the reminder — sent it, or found nobody to
452
+ * send it to. Absent while the reminder is still owed, which is how a
453
+ * rerun over the same hour sends nothing twice; cleared again when the
454
+ * reminder moves, because a moved reminder is a new one.
455
+ */
456
+ reminderSentAtMs?: number;
457
+ }
458
+ /** How an activity kind reads on screen — typed so a kind cannot ship unlabeled. */
459
+ export declare const CRM_ACTIVITY_KIND_LABELS: Record<CrmActivityKind, string>;
460
+ /**
461
+ * Whether a kind takes an outcome and a duration.
462
+ *
463
+ * A call and a meeting are conversations: they end somewhere ("left a
464
+ * voicemail", "agreed to a trial") and they take a measurable amount of
465
+ * time, and both are what a manager reading the log wants to know. An email
466
+ * has neither in any useful sense, a note is not an event at all, and
467
+ * `other` is unknowable — so the dialog hides the two fields for those
468
+ * rather than offering boxes that mean nothing.
469
+ */
470
+ export declare function activityKindHasOutcome(kind: CrmActivityKind): boolean;
471
+ /**
472
+ * Where a one-to-one email got to (AGL-2615), in the order it normally
473
+ * happens — the vocabulary the delivery webhook maps its events onto an
474
+ * `email` activity in, and the chip the timeline shows beside the entry.
475
+ *
476
+ * The first four are a progression: a message is sent, then delivered, then
477
+ * opened, then clicked, and a later state implies the earlier ones. The last
478
+ * two are terminal failures. A message the mailbox provider bounced or that
479
+ * the recipient reported is never "opened" in any sense the timeline should
480
+ * report, whatever a tracking pixel says afterwards.
481
+ */
482
+ export declare const CRM_EMAIL_DELIVERY_STATES: readonly ["sent", "delivered", "opened", "clicked", "bounced", "complained"];
483
+ export type CrmEmailDeliveryState = (typeof CRM_EMAIL_DELIVERY_STATES)[number];
484
+ /** How a delivery state reads on the chip — typed so a state cannot ship unlabeled. */
485
+ export declare const CRM_EMAIL_DELIVERY_STATE_LABELS: Record<CrmEmailDeliveryState, string>;
486
+ export declare function isCrmEmailDeliveryState(value: unknown): value is CrmEmailDeliveryState;
487
+ /** The two states that mean the message did not land. */
488
+ export declare function isCrmEmailDeliveryFailure(state: unknown): boolean;
489
+ /**
490
+ * The state an activity holds after one more delivery event, from the state
491
+ * it held before.
492
+ *
493
+ * MONOTONIC. Provider events arrive at least once and in no promised order
494
+ * — an `opened` can reach the webhook before the `delivered` it implies, and
495
+ * a replay can hand back yesterday's `delivered` after today's `clicked` —
496
+ * so the row keeps whichever state is further along, and an event that says
497
+ * less than the row already knows changes nothing. A stored value the
498
+ * vocabulary does not name reads as nothing, so the incoming event stands.
499
+ */
500
+ export declare function nextCrmEmailDeliveryState(current: unknown, incoming: CrmEmailDeliveryState): CrmEmailDeliveryState;
501
+ /** The most a one-to-one email's subject may hold. */
502
+ export declare const CRM_EMAIL_SUBJECT_MAX = 200;
503
+ /** The most a one-to-one email's body may hold — a letter, not a document. */
504
+ export declare const CRM_EMAIL_BODY_MAX = 10000;
505
+ /**
506
+ * The `context` a one-to-one email is sent under, which `sendEmail` stamps
507
+ * as a provider tag on the message and the delivery log files it by.
508
+ */
509
+ export declare const CRM_EMAIL_CONTEXT = "crm";
510
+ /** The provider tag naming the activity row a one-to-one email belongs to. */
511
+ export declare const CRM_EMAIL_ACTIVITY_TAG = "activityId";
512
+ /** The provider tag naming the org whose `crmActivities` holds that row. */
513
+ export declare const CRM_EMAIL_ORG_TAG = "orgId";
514
+ /**
515
+ * The tags a one-to-one email carries so the delivery webhook can find its
516
+ * activity row (AGL-2615): the org, the activity, and the site for the
517
+ * per-site suppression list a bounce lands on.
518
+ *
519
+ * Every value is checked against the provider's alphabet rather than
520
+ * trusted, for the reason `contextTag` gives — a value the provider rejects
521
+ * fails the send, and a failed send is worse than an untracked one. The
522
+ * org and the activity are the pair the webhook needs, so an unusable
523
+ * value for EITHER yields no tags at all: a tag set that named a row it
524
+ * could not locate would be a promise the timeline cannot keep. The site
525
+ * is stamped when it can be and dropped alone when it cannot.
526
+ */
527
+ export declare function crmEmailDeliveryTags(input: {
528
+ orgId: string;
529
+ hostId: string;
530
+ activityId: string;
531
+ }): {
532
+ name: string;
533
+ value: string;
534
+ }[];
535
+ /**
536
+ * Which way an `email` activity's message traveled. `outbound` is every
537
+ * message the workspace wrote — sent by the platform, or copied to the
538
+ * capture address from a mailbox; `inbound` is one a correspondent wrote,
539
+ * which only the capture route files (AGL-2657).
540
+ */
541
+ export type CrmEmailDirection = 'outbound' | 'inbound';
542
+ /**
543
+ * `orgs/{orgId}/crmActivities/{activityId}` — one thing that happened.
544
+ *
545
+ * Distinct from a contact's `interactions`: those are what the PLATFORM
546
+ * recorded (a form, an order, a booking) and live capped on the row. An
547
+ * activity is what a PERSON logged — a call made, a meeting held — and can
548
+ * hang off a company or a deal with no contact at all.
549
+ */
550
+ export interface CrmActivity extends CrmScoped {
551
+ kind: CrmActivityKind;
552
+ body: string;
553
+ /** When it happened, which is not when it was logged. */
554
+ atMs: number;
555
+ /** Who logged it, or `''` for an automation — see `CrmTask.createdByUid`. */
556
+ byUid: string;
557
+ /**
558
+ * The author's display name as it read when the activity was logged.
559
+ *
560
+ * Denormalized because there is no lookup that could answer it later: a
561
+ * member document is readable by its own subject and by org-wide members
562
+ * only, so a scoped editor reading a colleague's call log could not
563
+ * resolve the `byUid` beside it into a name. Stamped from the signed-in
564
+ * user's resolved name at log time and never rewritten, so it can drift
565
+ * from a later rename — the way a signed letter keeps the name it was
566
+ * signed with.
567
+ */
568
+ byName?: string;
569
+ /** The automation that logged it (AGL-2605), when a person did not. */
570
+ sourceActionId?: string;
571
+ /**
572
+ * The plugin that filed it on the record-timeline seam (AGL-2981) — an
573
+ * email a sequence sent, a reply it read.
574
+ */
575
+ sourcePluginId?: string;
576
+ contactId?: string;
577
+ companyId?: string;
578
+ dealId?: string;
579
+ /** The lead it was filed under (AGL-2615) — see {@link CrmActivityLink.leadId}. */
580
+ leadId?: string;
581
+ outcome?: string;
582
+ durationMinutes?: number;
583
+ /**
584
+ * An `email` the platform SENT (AGL-2615), as against one a person logged
585
+ * by hand: the subject line, who it went to, and where delivery got to.
586
+ * Absent on a hand-logged email, which has a body and nothing else.
587
+ */
588
+ subject?: string;
589
+ /** The address the message left for. */
590
+ to?: string;
591
+ /**
592
+ * `outbound` for a message the platform sent or a teammate copied to the
593
+ * capture address; `inbound` for one a correspondent wrote (AGL-2657).
594
+ */
595
+ direction?: CrmEmailDirection;
596
+ /** See {@link CrmEmailDeliveryState}; advanced by the delivery webhook. */
597
+ deliveryState?: CrmEmailDeliveryState;
598
+ /** When the delivery state last moved, epoch ms. */
599
+ deliveryAtMs?: number;
600
+ /**
601
+ * `hosts/{hostId}/bookings/{bookingId}` — the booking a `meeting` was
602
+ * filed from (AGL-2660), so a row the Bookings plugin wrote can be told
603
+ * from one a person logged, and a booking is never filed twice.
604
+ */
605
+ bookingId?: string;
606
+ /**
607
+ * An email CAPTURED from a mailbox (AGL-2657) — forwarded or copied to
608
+ * the workspace's capture address — as against one the platform sent:
609
+ * who wrote it, the provider's `Message-ID` the row is deduplicated by,
610
+ * the message it answered, and the subject with its reply and forward
611
+ * prefixes removed, which is what groups a thread. Absent on every other
612
+ * email row.
613
+ */
614
+ from?: string;
615
+ messageId?: string;
616
+ inReplyTo?: string;
617
+ threadSubject?: string;
618
+ }
619
+ /** An activity as a listener hands it back: the document plus its id. */
620
+ export type CrmActivityRow = CrmActivity & {
621
+ $id: string;
622
+ };
623
+ /** What a sent one-to-one email is logged from — see {@link buildCrmEmailActivity}. */
624
+ export interface CrmEmailActivityInput {
625
+ subject: string;
626
+ body: string;
627
+ /** The recipient, as the message was addressed. */
628
+ to: string;
629
+ /** When it was sent. */
630
+ atMs: number;
631
+ /** Who sent it, or `''` for an automation — see `CrmActivity.byUid`. */
632
+ byUid: string;
633
+ byName?: string;
634
+ sourceActionId?: string;
635
+ link: CrmActivityLink;
636
+ hostId: string;
637
+ visibleTo: string[];
638
+ }
639
+ /**
640
+ * The activity row a sent one-to-one email is logged as (AGL-2615).
641
+ *
642
+ * ONE builder for the two writers — the console's send route and the
643
+ * `sendEmail` automation step — so a message a rep wrote and a message a
644
+ * flow sent are the same kind of entry on the timeline: `kind: 'email'`,
645
+ * outbound, starting at `sent` for the delivery webhook to advance. A
646
+ * writer that assembled its own would be the one whose rows the chip did
647
+ * not know how to read. Timestamps are the writer's: a server stamps
648
+ * `serverTimestamp()` and this module has no Firestore.
649
+ */
650
+ export declare function buildCrmEmailActivity(input: CrmEmailActivityInput): CrmActivity;
651
+ /**
652
+ * One campaign email this person was sent, and what became of it (AGL-2616).
653
+ *
654
+ * The per-recipient delivery log — `emailDeliveries/{key}/messages` — keeps
655
+ * one document per MESSAGE with a timestamp per lifecycle state and a count
656
+ * of opens and clicks, and this is that document as a timeline reads it:
657
+ * which email, when it went out, and how far it got. A message that bounced
658
+ * or was complained about carries that state too, because "we mailed them
659
+ * and it bounced" is part of the history of a relationship and a timeline
660
+ * that showed only the successes would read as if nothing had been tried.
661
+ *
662
+ * The server answers with this shape, never the log record itself: the log
663
+ * carries the recipient's address, the provider and the links they followed,
664
+ * and none of that is the timeline's to show.
665
+ */
666
+ export interface ContactCampaignEmail {
667
+ /** The provider's message id — distinct per send, and the entry's key. */
668
+ messageId: string;
669
+ /** The site the campaign went out from. */
670
+ hostId: string;
671
+ /** `hosts/{hostId}/campaigns/{campaignId}` — the email, whose report the entry links to. */
672
+ campaignId: string;
673
+ /**
674
+ * The email as the team named it in the Emails console — its display name,
675
+ * or its subject when it has none. `null` when the email has since been
676
+ * deleted, in which case the entry still has the subject it was sent with.
677
+ */
678
+ campaignName: string | null;
679
+ /** The subject line the person received. */
680
+ subject: string | null;
681
+ /** When it went out — the provider's `sent` instant, or the first event seen. */
682
+ sentAtMs: number;
683
+ deliveredAtMs?: number;
684
+ openedAtMs?: number;
685
+ clickedAtMs?: number;
686
+ bouncedAtMs?: number;
687
+ complainedAtMs?: number;
688
+ openCount: number;
689
+ clickCount: number;
690
+ }
691
+ /**
692
+ * One entry of a contact's timeline (AGL-2600): something the platform
693
+ * CAPTURED on the contact's facet, something a person LOGGED beside it, or
694
+ * — since AGL-2616 — a CAMPAIGN email the person was sent.
695
+ *
696
+ * A tagged union rather than a flattened row, because the three are
697
+ * different facts with different affordances — a captured interaction is
698
+ * read-only and names the door it came through, a logged activity has an
699
+ * author who may edit it, a campaign email is read-only and links to the
700
+ * campaign's report — and a surface drawing the stream has to say which is
701
+ * which. A logged activity of kind `email` and a campaign entry are two
702
+ * different things on purpose: the first is a message a person on the team
703
+ * sent or recorded, the second is a mailing the platform delivered, and the
704
+ * two must never share a kind id or a glyph.
705
+ */
706
+ export type ContactTimelineEntry = {
707
+ kind: 'captured';
708
+ /** Distinct across the merged list, for a React key. */
709
+ key: string;
710
+ atMs: number;
711
+ interaction: ContactInteraction;
712
+ } | {
713
+ kind: 'logged';
714
+ key: string;
715
+ atMs: number;
716
+ activity: CrmActivityRow;
717
+ } | {
718
+ kind: 'campaign';
719
+ key: string;
720
+ atMs: number;
721
+ email: ContactCampaignEmail;
722
+ };
723
+ /**
724
+ * What became of one campaign email, as the words a timeline row prints
725
+ * after the email's name: `sent · delivered · opened ×2 · clicked`.
726
+ *
727
+ * In lifecycle order, and only the states that happened. `sent` is always
728
+ * first because the row exists; the counts appear only past one, because
729
+ * "opened ×1" says nothing "opened" does not. A bounce or a complaint is
730
+ * printed where it falls, after whatever succeeded before it — a message
731
+ * delivered and then complained about reads as both, which is what
732
+ * happened.
733
+ */
734
+ export declare function campaignEmailSummary(email: ContactCampaignEmail): string[];
735
+ /**
736
+ * ONE newest-first stream from a contact's two histories.
737
+ *
738
+ * The captured interactions live on the contact's facet and the logged
739
+ * activities in their own collection, and a page showing them as two lists
740
+ * asks the reader to do the interleaving in their head — "did the call come
741
+ * before or after the order?" is the question a timeline exists to answer.
742
+ *
743
+ * STABLE on purpose. The sort is on `atMs` alone, and at a tie the captured
744
+ * entries keep their place ahead of the logged ones, each in the order it
745
+ * arrived: a facet's interactions are already newest-first and a listener's
746
+ * rows are already ordered, so the merge must not reshuffle what its inputs
747
+ * settled. An entry with no usable time goes LAST, never first — a row that
748
+ * cannot say when it happened must not read as the most recent thing.
749
+ *
750
+ * The key is what a list renders by. A captured interaction has no id of its
751
+ * own, so its key is built from what it does carry; a logged activity's is
752
+ * its document id; a campaign email's is the provider's message id.
753
+ *
754
+ * A campaign email is placed at the instant it was SENT, not at its latest
755
+ * open. The row tells the whole story of that message in one line, and a
756
+ * message that moved up the stream every time its reader re-opened it would
757
+ * be a timeline that reorders itself under the reader.
758
+ */
759
+ export declare function mergeContactTimeline(interactions: readonly ContactInteraction[] | null | undefined, activities: readonly CrmActivityRow[] | null | undefined, campaignEmails?: readonly ContactCampaignEmail[] | null): ContactTimelineEntry[];
760
+ /**
761
+ * Which record an activity is ABOUT, for a surface that links to it, or
762
+ * `null` when it was filed against nothing.
763
+ *
764
+ * A contact outranks a deal outranks a company. An activity can name all
765
+ * three — a call with a person about a deal at their company — and the
766
+ * contact is the one a reader means when they ask "who was this with"; the
767
+ * deal is next because it is the thing with a clock on it; the company is
768
+ * the widest and so the last resort.
769
+ */
770
+ export declare function crmActivityRecordLink(activity: Pick<CrmActivity, 'contactId' | 'companyId' | 'dealId' | 'leadId'>): {
771
+ record: 'contact' | 'deal' | 'company' | 'lead';
772
+ id: string;
773
+ } | null;
774
+ /**
775
+ * How long ago something happened, in the words a list row uses.
776
+ *
777
+ * Coarse on purpose. A row reads "3 days ago" and carries the full timestamp
778
+ * in its tooltip; the sentence exists so that a reader scanning a log can
779
+ * tell this week from last month without parsing dates. Past a week the
780
+ * relative form stops helping — "412 days ago" is a date the reader has to
781
+ * compute — so it becomes one. A time AHEAD of now is a date too: a call
782
+ * logged for tomorrow is a scheduling mistake the page should show plainly
783
+ * rather than dress as "in 14 hours". An unusable time reads as nothing.
784
+ *
785
+ * English rather than `Intl.RelativeTimeFormat` because the console is
786
+ * English-only, and the thresholds are what the spec pins.
787
+ */
788
+ export declare function activityTimeLabel(atMs: number, nowMs: number): string;
789
+ export type ContactFieldType = 'text' | 'number' | 'date' | 'select' | 'checkbox' | 'url';
790
+ /**
791
+ * `orgs/{orgId}/contactFields/{fieldId}` — a custom field a holder defined.
792
+ *
793
+ * The `key` is the map key under a facet's `custom`, so it is IMMUTABLE once
794
+ * a value has been written under it; a rename is a new field and a retire.
795
+ * `retiredAt` rather than a delete for the same reason: values written under
796
+ * the key survive, and a retired field still has to be able to read them
797
+ * back on an export.
798
+ */
799
+ export interface ContactFieldDefinition extends CrmScoped {
800
+ /** `^[a-z][a-z0-9_]{0,39}$` — see {@link normalizeContactFieldKey}. */
801
+ key: string;
802
+ label: string;
803
+ type: ContactFieldType;
804
+ /** The choices, for `select`. */
805
+ options?: string[];
806
+ required?: boolean;
807
+ /** Position in the form and the export, ascending. */
808
+ order: number;
809
+ retiredAt?: number | null;
810
+ /**
811
+ * Which record the field describes (AGL-2661). ABSENT means `contact`,
812
+ * because every definition written before companies and deals could carry
813
+ * custom fields described a contact, and a backfill that stamped them
814
+ * would touch every org for a fact the reader can infer. Read it through
815
+ * {@link fieldDefinitionObject}, never directly, so that inference lives
816
+ * in one place. Keys are unique PER OBJECT: a company field and a contact
817
+ * field may both be called `region`.
818
+ */
819
+ object?: CrmFieldObject;
820
+ }
821
+ /**
822
+ * The records a custom field may describe, in the order the Fields
823
+ * section tabs them (AGL-2661).
824
+ */
825
+ export declare const CRM_FIELD_OBJECTS: readonly ["contact", "company", "deal"];
826
+ export type CrmFieldObject = (typeof CRM_FIELD_OBJECTS)[number];
827
+ /** How each object reads on the Fields section's tabs and in a refusal. */
828
+ export declare const CRM_FIELD_OBJECT_LABELS: Record<CrmFieldObject, string>;
829
+ export declare function isCrmFieldObject(value: unknown): value is CrmFieldObject;
830
+ /**
831
+ * Which record a definition describes — `contact` when the document says
832
+ * nothing, or says something no reader understands.
833
+ *
834
+ * The one reader of {@link ContactFieldDefinition.object}. A stored value
835
+ * outside the list is read as `contact` rather than refused, for the
836
+ * reason an absent one is: the definition predates the field, or was
837
+ * written by something that never learned it, and either way the values
838
+ * under its key sit on contacts.
839
+ */
840
+ export declare function fieldDefinitionObject(definition: Pick<ContactFieldDefinition, 'object'> | null | undefined): CrmFieldObject;
841
+ /**
842
+ * The definition type under the name new code uses (AGL-2661). The type,
843
+ * the collection (`contactFields`) and the rules match keep the contact
844
+ * name: renaming them would ripple through the rules, the REST resources
845
+ * and the docs for no change in what is stored.
846
+ */
847
+ export type CrmFieldDefinition = ContactFieldDefinition;
848
+ /** What a stored field key must look like — a letter, then up to 39 of `[a-z0-9_]`. */
849
+ export declare const CONTACT_FIELD_KEY_PATTERN: RegExp;
850
+ /**
851
+ * A typed label, as the key it would be stored under, or `null` when nothing
852
+ * usable survives.
853
+ *
854
+ * Lowercased and snake-cased rather than refused, because the key is derived
855
+ * from the label a merchant typed ("Annual revenue" → `annual_revenue`) and
856
+ * they should not have to learn the grammar. Anything outside `[a-z0-9_]` is
857
+ * dropped after separators become underscores, runs collapse, and a leading
858
+ * run of digits or underscores goes — a key has to start with a letter so it
859
+ * can never collide with an array index or read as a number in a filter.
860
+ */
861
+ export declare function normalizeContactFieldKey(input: unknown): string | null;
862
+ /** The stage a deal is in, or `null` when the pipeline no longer has it. */
863
+ export declare function dealStageById(pipeline: Pick<CrmPipeline, 'stages'> | null | undefined, stageId: string): CrmDealStage | null;
864
+ /**
865
+ * What a deal is worth to a forecast, in cents.
866
+ *
867
+ * STATUS wins over the stage. A deal marked won is worth its full amount
868
+ * whatever stage it happens to sit in, and a lost one is worth nothing —
869
+ * the stage's probability is the odds of an OPEN deal, and applying it to a
870
+ * closed one would forecast a sale that has already happened as a fraction
871
+ * of itself. An open deal with no resolvable stage is worth nothing rather
872
+ * than everything: the pipeline lost the stage, and a forecast that filled
873
+ * the gap with 100% would be the most optimistic number available.
874
+ */
875
+ export declare function weightedDealAmountCents(deal: Pick<CrmDeal, 'amountCents' | 'status'>, stage: Pick<CrmDealStage, 'probability'> | null | undefined): number;
876
+ /** Whether a deal's amount is derived — it has at least one line item. */
877
+ export declare function dealHasLineItems(deal: Pick<CrmDeal, 'lineItems'> | null | undefined): boolean;
878
+ /**
879
+ * What a set of line items adds up to, in cents — the amount a deal with
880
+ * line items stores. Whole cents, never negative: a line's quantity and
881
+ * unit amount have both been through `readDealLineItems`, but a stored
882
+ * document from an older writer is trusted no further than that.
883
+ */
884
+ export declare function lineItemsTotalCents(items: readonly Pick<CrmDealLineItem, 'quantity' | 'unitAmountCents'>[] | null | undefined): number;
885
+ /**
886
+ * Line items as a client typed or sent them, validated into the stored
887
+ * shape, or the one reason they were refused.
888
+ *
889
+ * The one reader for both writers — the products card on a deal's page
890
+ * and `POST`/`PATCH /v1/deals` — so a line the console accepts is a line
891
+ * the API accepts and the other way round. The rules: at most
892
+ * {@link DEAL_LINE_ITEMS_MAX} lines; every line a name, a whole quantity
893
+ * of one or more, a whole unit amount of zero or more; every line in the
894
+ * DEAL's currency (`currency`), which a line may omit and may not
895
+ * contradict. An empty list is valid and means "no line items" — the
896
+ * amount goes back to being typed.
897
+ */
898
+ export declare function readDealLineItems(input: unknown, currency: string): {
899
+ items: CrmDealLineItem[];
900
+ } | {
901
+ error: string;
902
+ };
903
+ export type TaskDueState = 'overdue' | 'today' | 'upcoming' | 'none' | 'done';
904
+ /**
905
+ * Where a task stands against the clock.
906
+ *
907
+ * `today` is decided on the LOCAL calendar day and beats `overdue`: a task
908
+ * due at nine this morning is today's work until midnight, not something the
909
+ * list should paint red at 9:01. Overdue is yesterday or earlier. `done`
910
+ * comes first because a completed task's due date is history whichever side
911
+ * of now it fell on.
912
+ */
913
+ export declare function taskDueState(task: Pick<CrmTask, 'status' | 'dueAtMs'>, nowMs: number): TaskDueState;
914
+ /**
915
+ * A typed or pasted domain, reduced to the bare lowercase hostname a company
916
+ * is keyed by, or `null` when what is left is not one.
917
+ *
918
+ * Strips what people paste along with a domain — the protocol, a `www.`, a
919
+ * path, a query, a port — because the value is a KEY: two contacts at
920
+ * `https://www.acme.com/about` and `acme.com` work for one company, and the
921
+ * match is only findable if both reduce to the same string. The last label
922
+ * has to be letters because a company's domain has a TLD; a bare IP address
923
+ * or a single word is not one and answers `null` rather than being stored as
924
+ * something a later match will never hit.
925
+ */
926
+ export declare function normalizeCompanyDomain(input: unknown): string | null;
927
+ /**
928
+ * The typed website, as a URL; `''` for a blank; `null` when it cannot be
929
+ * one.
930
+ *
931
+ * People type `acme.com` where a URL is asked for, and refusing that is
932
+ * pedantry — it becomes `https://acme.com`. What IS refused is anything the
933
+ * URL parser cannot read or a scheme other than http(s): a `javascript:` link
934
+ * on a record that renders as an anchor is not a website. One function for
935
+ * the company drawer and the companies import, so a website typed and a
936
+ * website imported are stored the same way.
937
+ */
938
+ export declare function normalizeCompanyWebsite(input: unknown): string | null;
939
+ /**
940
+ * Mailbox domains that belong to people rather than to a business: the
941
+ * providers anybody can sign up with, and the ones an internet provider
942
+ * hands its subscribers.
943
+ *
944
+ * Auto-associating a contact with a company by email domain is the whole
945
+ * reason {@link companyDomainForEmail} exists, and it is wrong for every
946
+ * address at a public mailbox: `gmail.com` is not a company, and a rule
947
+ * that treated it as one would file half of a consumer list under a single
948
+ * phantom account. It is also the fact a cold email has to know — an
949
+ * address here is a person's own, not their work address — which is why the
950
+ * list is exported with {@link isPublicMailboxDomain}: a second list kept
951
+ * for that question would drift from this one.
952
+ *
953
+ * Exact domains, not suffixes: a subscriber's regional host (`nc.rr.com`)
954
+ * is not listed, and neither is a company that happens to end in `mail.com`.
955
+ */
956
+ export declare const PUBLIC_MAILBOX_DOMAINS: ReadonlySet<string>;
957
+ /**
958
+ * Whether a domain — or the domain of an address — is one of the
959
+ * {@link PUBLIC_MAILBOX_DOMAINS}. Read the way a company domain is, so case,
960
+ * a trailing dot and a pasted `www.` do not hide one.
961
+ */
962
+ export declare function isPublicMailboxDomain(domainOrEmail: unknown): boolean;
963
+ /**
964
+ * The company domain an email address implies, or `null` when it implies
965
+ * none — a malformed address, or one at a public mailbox provider.
966
+ */
967
+ export declare function companyDomainForEmail(email: unknown): string | null;
968
+ /**
969
+ * The name a company minted from a domain starts with: the first label with
970
+ * a capital — `acme.com` → `Acme`, `initech.co.uk` → `Initech`.
971
+ *
972
+ * A starting point and not a claim about what the business is called: the
973
+ * lead-convert dialog offers it for editing, and a company the capture door
974
+ * creates on its own carries it until somebody renames the record. The
975
+ * domain itself would be an honest name too, but a list of companies that
976
+ * reads `acme.com`, `globex.example` looks like a list of websites, and the
977
+ * domain is on the row beside the name anyway.
978
+ */
979
+ export declare function companyNameForDomain(domain: string): string;
980
+ /**
981
+ * The top-level field on a CONTACT naming every company it is linked to.
982
+ *
983
+ * It carries the union of every holder's link, so removing an id from it is
984
+ * only correct when no other holder's facet still names that id — the rule
985
+ * the planner enforces, and the reason nothing writes this field without
986
+ * going through it. The facet is the truth and this is its index: a reader
987
+ * answering "which company is this person at" reads the facet; only a QUERY
988
+ * reads this.
989
+ */
990
+ export declare const CONTACT_COMPANY_IDS_FIELD = "companyIds";
991
+ /**
992
+ * The field on a COMPANY counting the contacts whose mirror names it.
993
+ *
994
+ * Denormalized because the honest figure is an aggregate over every contact
995
+ * in the org, which a list of two hundred companies cannot afford to take
996
+ * per row. Moved by `increment` in the same batch as the link that changes
997
+ * it, so the two cannot disagree by a failed second write; a company's own
998
+ * page still takes the live aggregate, which is what corrects a count that
999
+ * predates the counter.
1000
+ */
1001
+ export declare const COMPANY_CONTACTS_COUNT_FIELD = "contactsCount";
1002
+ /** What the planner needs to know about a contact's links, and nothing else. */
1003
+ export interface ContactCompanyLinkState {
1004
+ /** This holder's link, or `null` when the facet names no company. */
1005
+ companyId: string | null;
1006
+ /** The mirror as stored, in no order. */
1007
+ companyIds: string[];
1008
+ /**
1009
+ * Ids named by OTHER holders' facets — what keeps an id in the mirror
1010
+ * when this holder lets go of it.
1011
+ */
1012
+ heldElsewhere: string[];
1013
+ }
1014
+ /** The link state of a stored contact, read for one holder. */
1015
+ export declare function readContactCompanyLink(contact: Record<string, unknown> | null | undefined, groupId: string): ContactCompanyLinkState;
1016
+ /**
1017
+ * Every holder whose facet names this company, in no order.
1018
+ *
1019
+ * What a company's DELETION clears. Unlike a link change, which is one
1020
+ * holder's, a deletion takes the record away from every holder at once: a
1021
+ * facet still naming it would be a link to nothing, on a surface its holder
1022
+ * has no reason to revisit. Nothing else about another holder's facet is
1023
+ * read.
1024
+ */
1025
+ export declare function contactGroupsNamingCompany(contact: Record<string, unknown> | null | undefined, companyId: string): string[];
1026
+ /**
1027
+ * How the mirror changes. Three shapes because Firestore takes ONE transform
1028
+ * per field per write: an `arrayUnion` and an `arrayRemove` on the same
1029
+ * field cannot share an update, so a move rewrites the array whole.
1030
+ */
1031
+ export type ContactCompanyMirrorChange = {
1032
+ op: 'union';
1033
+ companyId: string;
1034
+ } | {
1035
+ op: 'remove';
1036
+ companyId: string;
1037
+ } | {
1038
+ op: 'set';
1039
+ companyIds: string[];
1040
+ };
1041
+ export interface ContactCompanyLinkPlan {
1042
+ /** The facet's new value: the id, or `null` meaning delete the field. */
1043
+ companyId: string | null;
1044
+ /** What happens to the mirror, or `null` when it already carries the right ids. */
1045
+ mirror: ContactCompanyMirrorChange | null;
1046
+ /**
1047
+ * Per company, how its contacts count moves. A company enters the list
1048
+ * only when the mirror actually gains or loses it, so a link some other
1049
+ * holder already made is not counted twice and a mirror that never carried
1050
+ * an id is not decremented for it.
1051
+ */
1052
+ counts: Array<{
1053
+ companyId: string;
1054
+ delta: 1 | -1;
1055
+ }>;
1056
+ }
1057
+ /**
1058
+ * What linking a contact to a company FOR ONE HOLDER changes — or unlinking
1059
+ * them, with `null`. `null` when the document already says what was asked.
1060
+ *
1061
+ * Three cases, and the mirror is handled differently in each because it is
1062
+ * shared across holders while the facet is not:
1063
+ *
1064
+ * - A first link `union`s the id in, which is safe against a concurrent
1065
+ * writer adding another holder's id.
1066
+ * - A MOVE from one company to another rewrites the mirror as a whole. The
1067
+ * old id is dropped only if no other holder's facet still names it.
1068
+ * - An unlink `remove`s the old id, on the same condition, and leaves the
1069
+ * mirror alone when another holder still needs it there.
1070
+ *
1071
+ * The counts follow the mirror, not the facet: the company's figure is "how
1072
+ * many contacts name me in the mirror", and that is the quantity the
1073
+ * company page's live aggregate measures.
1074
+ */
1075
+ export declare function planContactCompanyLink(state: ContactCompanyLinkState, companyId: string | null): ContactCompanyLinkPlan | null;
1076
+ /** The org-document key the CRM's settings live under. */
1077
+ export declare const ORG_CRM_SETTINGS_FIELD = "crm";
1078
+ /** The dotted path an `update()` writes the auto-create switch by. */
1079
+ export declare const CRM_AUTO_CREATE_COMPANIES_PATH = "crm.autoCreateCompanies";
1080
+ /**
1081
+ * Whether a capture from a work email domain no visible company carries
1082
+ * should CREATE the company. Off unless the org document says `true`: a
1083
+ * company minted from every domain that ever submitted a form is a list
1084
+ * nobody asked for, so the default is the quiet one.
1085
+ *
1086
+ * Read off the raw document rather than a typed field, because the capture
1087
+ * door holds a `Partial<AglynOrganization>` and the console a
1088
+ * `Partial<AglynOrgBilling>`, and one reader has to answer both.
1089
+ */
1090
+ export declare function orgAutoCreatesCompanies(orgDocument: Record<string, unknown> | null | undefined): boolean;
1091
+ /** Where the ordered rules live on the org document. */
1092
+ export declare const CRM_ASSIGNMENT_RULES_PATH = "crm.assignmentRules";
1093
+ /** The round-robin pool's member list, in rotation order. */
1094
+ export declare const CRM_ROUND_ROBIN_POOL_PATH = "crm.roundRobin.memberUids";
1095
+ /** The member handed the most recent round-robin record. */
1096
+ export declare const CRM_ROUND_ROBIN_LAST_ASSIGNED_PATH = "crm.roundRobin.lastAssignedUid";
1097
+ /**
1098
+ * The most rules an org may keep. A first-match list longer than this is
1099
+ * one nobody can reason about, and the section refuses the fifty-first
1100
+ * rather than letting the document grow unbounded.
1101
+ */
1102
+ export declare const CRM_ASSIGNMENT_RULES_MAX = 50;
1103
+ /** The most members a round-robin pool may hold. */
1104
+ export declare const CRM_ROUND_ROBIN_POOL_MAX = 50;
1105
+ /**
1106
+ * The field-path SEGMENTS of a site's default owner on the org document.
1107
+ *
1108
+ * Segments rather than a dotted string, because the host id is a document
1109
+ * id and a document id may contain a dot; joined with dots it would be read
1110
+ * as two path elements and the write would land beside the setting rather
1111
+ * than in it. A caller builds a `FieldPath` from these on either SDK.
1112
+ */
1113
+ export declare function crmHostDefaultOwnerSegments(hostId: string): string[];
1114
+ /** The conditions a rule may name — every one present must hold. */
1115
+ export interface CrmAssignmentRuleWhen {
1116
+ /** The capture door: `form`, `booking`, `order`, `manual`… */
1117
+ source?: ContactSource;
1118
+ /** The form the capture came through, by its document id. */
1119
+ formId?: string;
1120
+ /** The captured address's domain, lowercased, without a leading `@`. */
1121
+ emailDomain?: string;
1122
+ /** A tag the capture carries or the contact already wears. */
1123
+ tag?: string;
1124
+ }
1125
+ /** How a matching rule assigns: one member, or the next in the pool. */
1126
+ export type CrmAssignmentTarget = {
1127
+ memberUid: string;
1128
+ } | {
1129
+ roundRobin: true;
1130
+ };
1131
+ /**
1132
+ * One rule as the CRM reads it — `OrgCrmAssignmentRule` with the source
1133
+ * narrowed to the capture vocabulary.
1134
+ */
1135
+ export interface CrmAssignmentRule extends OrgCrmAssignmentRule {
1136
+ when: CrmAssignmentRuleWhen;
1137
+ assign: CrmAssignmentTarget;
1138
+ }
1139
+ /** The pool as the CRM reads it: never absent, possibly empty. */
1140
+ export interface CrmRoundRobinPool {
1141
+ memberUids: string[];
1142
+ lastAssignedUid: string | null;
1143
+ }
1144
+ /**
1145
+ * The org's assignment settings, read tolerantly off the raw document.
1146
+ *
1147
+ * Every field is optional on the document and the section writes each on
1148
+ * its own, so a reader that trusted the shape would throw on the first org
1149
+ * that has set the pool but never a rule. Malformed entries are dropped
1150
+ * rather than refused wholesale: one hand-edited rule must not stop the
1151
+ * others from assigning.
1152
+ */
1153
+ export interface CrmAssignmentSettings {
1154
+ rules: CrmAssignmentRule[];
1155
+ pool: CrmRoundRobinPool;
1156
+ /** Site id → default owner uid, for the sites that set one. */
1157
+ hostDefaultOwners: Record<string, string>;
1158
+ }
1159
+ /** A rule as the document holds it, or `null` for one that cannot assign. */
1160
+ export declare function readCrmAssignmentRule(raw: unknown): CrmAssignmentRule | null;
1161
+ export declare function readCrmAssignmentSettings(orgDocument: Record<string, unknown> | null | undefined): CrmAssignmentSettings;
1162
+ /** The member a site hands unclaimed captures to, or `null` for nobody. */
1163
+ export declare function crmHostDefaultOwner(orgDocument: Record<string, unknown> | null | undefined, hostId: string): string | null;
1164
+ /** What a rule is matched against: the capture, as its door described it. */
1165
+ export interface CrmAssignmentCapture {
1166
+ source: ContactSource;
1167
+ email: string;
1168
+ formId?: string | null;
1169
+ /** The capture's own tags and whatever the contact already wears. */
1170
+ tags?: readonly string[];
1171
+ }
1172
+ /**
1173
+ * The domain a rule's `emailDomain` is compared with — the address's own,
1174
+ * lowercased. Not `companyDomainForEmail`, which answers `null` for a public
1175
+ * mailbox: a team may well route every `gmail.com` sign-up to one rep, and
1176
+ * a rule that could not name a consumer domain could not say so.
1177
+ */
1178
+ export declare function assignmentEmailDomain(email: string): string | null;
1179
+ /**
1180
+ * Whether every condition the rule names holds for this capture. A rule
1181
+ * with no condition matches every capture — the catch-all.
1182
+ */
1183
+ export declare function assignmentRuleMatches(when: CrmAssignmentRuleWhen, capture: CrmAssignmentCapture): boolean;
1184
+ /**
1185
+ * The pool in the order the next record should try it: the member after
1186
+ * the last recipient first, wrapping round, and the last recipient
1187
+ * themselves at the end — so a pool of one still assigns, and a pointer
1188
+ * naming somebody no longer in the pool starts from the top.
1189
+ */
1190
+ export declare function roundRobinOrder(memberUids: readonly string[], lastAssignedUid: string | null | undefined): string[];
1191
+ /**
1192
+ * How a rule reads in the settings list — its conditions in words and
1193
+ * where it sends the record — so a reader can tell two rules apart without
1194
+ * opening either. `memberLabel` turns a uid into a name; the section passes
1195
+ * the roster's.
1196
+ */
1197
+ export declare function describeAssignmentRule(rule: CrmAssignmentRule, memberLabel: (uid: string) => string): {
1198
+ when: string;
1199
+ assign: string;
1200
+ };
1201
+ /**
1202
+ * A fresh rule id, unique among the ones the org already holds. Time and
1203
+ * entropy rather than a counter, so two admins adding a rule in two tabs
1204
+ * do not mint the same id and have one reorder clobber the other's rule.
1205
+ */
1206
+ export declare function newAssignmentRuleId(existing: readonly string[]): string;
1207
+ /**
1208
+ * The `visibleTo` every CRM creator stamps — client or server, whichever
1209
+ * door the record comes in through.
1210
+ *
1211
+ * The contact create path's own expression (`upsertHostContact`), lifted
1212
+ * here so that a company, a deal or a task created from a site's console
1213
+ * lands in exactly the scope a contact captured on that site would: the
1214
+ * whole org when the org has chosen `defaultResourceScope: 'org'`, and
1215
+ * otherwise the sites that present as one sender — which, undeclared, is
1216
+ * this site alone. That is the agency's isolation, arrived at with nothing
1217
+ * configured, and the reason this is a function rather than a convention
1218
+ * eight creators are asked to remember.
1219
+ *
1220
+ * Widening past the group is an ACT — an org-wide member editing the scope
1221
+ * on the record — never a default. The rules refuse a scoped member creating
1222
+ * a record outside their own tokens, so a creator that bypassed this could
1223
+ * only make its record invisible to itself, never wider.
1224
+ */
1225
+ export declare function crmScopeTokens(org: Record<string, unknown> | null | undefined, group: ConsentGroup): ScopeToken[];
1226
+ /**
1227
+ * The `visibleTo` tokens a reader of this group may LIST, for the
1228
+ * `array-contains-any` every CRM listener filters by.
1229
+ *
1230
+ * The other half of {@link crmScopeTokens}: that is what a creator stamps,
1231
+ * this is what a reader asks for, and the two differ by exactly one token.
1232
+ * `'org'` leads because an org-wide record is visible to every site — an org
1233
+ * that widened its default deliberately still sees its own rows — and the
1234
+ * group's sites follow. The contacts list computes this inline; every other
1235
+ * CRM reader takes it from here so that none of them can drop the org token
1236
+ * and lose the org-wide rows, or forget the cap and have Firestore refuse
1237
+ * the query outright.
1238
+ *
1239
+ * Capped at {@link MAX_SCOPE_HOSTS}: a group wider than the operator's limit
1240
+ * is listed as far as the limit reaches, which is the contacts list's
1241
+ * behavior and the only one short of an error.
1242
+ */
1243
+ export declare function crmReadTokens(group: ConsentGroup): ScopeToken[];
1244
+ /** One person on the team, as a picker lists them and a reference resolves to them. */
1245
+ export interface CrmMemberOption {
1246
+ /** The account uid — what `ownerUid` and `assigneeUid` store. */
1247
+ uid: string;
1248
+ /** The name a colleague recognizes: display name, else address, else the uid. */
1249
+ label: string;
1250
+ /** The roster's address, when the member document carries one. */
1251
+ email?: string;
1252
+ }
1253
+ /**
1254
+ * How a step or a column names somebody on the team: an address when the
1255
+ * text is one, otherwise a uid. `null` for a blank, which every caller
1256
+ * treats as "nobody named" rather than as a member called "".
1257
+ */
1258
+ export type CrmMemberRef = {
1259
+ kind: 'uid';
1260
+ uid: string;
1261
+ } | {
1262
+ kind: 'email';
1263
+ email: string;
1264
+ };
1265
+ export declare function parseCrmMemberRef(value: unknown): CrmMemberRef | null;
1266
+ /**
1267
+ * A roster row as every CRM picker and column shows it.
1268
+ *
1269
+ * One mapping rather than four, because four is what the CRM had — and one
1270
+ * of them dropped a member whose document had neither a display name nor an
1271
+ * address, which is precisely the member the uid fallback exists for.
1272
+ */
1273
+ export declare function crmMemberOption(member: Record<string, unknown>): CrmMemberOption | null;
1274
+ /**
1275
+ * The member a stored reference names: by uid first — the stored shape —
1276
+ * and by address second, so a record that carries an address where a uid
1277
+ * belongs (an older import, a hand edit) still names the person the roster
1278
+ * has under it. Undefined for nobody, which the caller renders honestly as
1279
+ * "former member" or as the reference itself rather than as unassigned.
1280
+ */
1281
+ export declare function findOrgMember<T extends {
1282
+ uid: string;
1283
+ email?: string | null;
1284
+ }>(members: readonly T[], ref: string | null | undefined): T | undefined;
1285
+ /**
1286
+ * Where a lead stands, in the order a person works one.
1287
+ *
1288
+ * `qualified` is the CONVERTED state — a lead becomes a contact by being
1289
+ * qualified, and the conversion stamps `convertedContactId` beside it — and
1290
+ * `unqualified` is the closed-without-conversion state with its reason. A
1291
+ * fixed list rather than free text for the reason the lifecycle stages are:
1292
+ * the section filters on it and a report counts by it.
1293
+ */
1294
+ export declare const CRM_LEAD_STATUSES: readonly ["new", "working", "qualified", "unqualified"];
1295
+ export type CrmLeadStatus = (typeof CRM_LEAD_STATUSES)[number];
1296
+ /** How a lead status reads on screen — typed so a status cannot ship unlabeled. */
1297
+ export declare const CRM_LEAD_STATUS_LABELS: Record<CrmLeadStatus, string>;
1298
+ /**
1299
+ * The statuses a lead still needs somebody's attention in — what the Leads
1300
+ * section shows by default, so the list opens on the work rather than on
1301
+ * the history.
1302
+ */
1303
+ export declare const CRM_LEAD_OPEN_STATUSES: readonly CrmLeadStatus[];
1304
+ /**
1305
+ * The statuses that mean nobody needs to work the lead any more — the
1306
+ * operand of the `in` clause an open-lead figure subtracts with. Subtracts,
1307
+ * because an untouched lead carries no status field at all and Firestore
1308
+ * cannot select on a field's absence; the closed statuses are always
1309
+ * written, so they can be counted, and what remains is open. See
1310
+ * `openLeadsFromCounts`.
1311
+ */
1312
+ export declare const CRM_LEAD_CLOSED_STATUSES: readonly CrmLeadStatus[];
1313
+ export declare function isCrmLeadStatus(value: unknown): value is CrmLeadStatus;
1314
+ /**
1315
+ * The working state the CRM writes onto a lead document, beside what the
1316
+ * capture door wrote (`email`, `name`, `sources`, `submissionCount`,
1317
+ * `firstSeenAtMs`, `lastSeenAtMs`, the consent map).
1318
+ *
1319
+ * The four `converted*`/`dealId`/`companyId` fields are stamped ONLY by the
1320
+ * `crm/lead-convert` server route, in one write after the contact exists, so
1321
+ * a lead that carries `convertedContactId` names a contact that was really
1322
+ * created and a lead without it was never converted, whatever its status
1323
+ * says. `unqualifiedReason` travels with `status: 'unqualified'` and is the
1324
+ * one free-text field a report will want to read back.
1325
+ */
1326
+ export interface CrmLeadFields {
1327
+ status?: CrmLeadStatus;
1328
+ /** The team member working the lead. */
1329
+ ownerUid?: string;
1330
+ notes?: string;
1331
+ unqualifiedReason?: string;
1332
+ /** `orgs/{orgId}/contacts/{contactId}` — the person this lead became. */
1333
+ convertedContactId?: string;
1334
+ convertedAtMs?: number;
1335
+ /** The deal the conversion opened, when the converter asked for one. */
1336
+ dealId?: string;
1337
+ /** The company the conversion created or linked, when it named one. */
1338
+ companyId?: string;
1339
+ }
1340
+ /**
1341
+ * A lead's status as the list and the filter should read it.
1342
+ *
1343
+ * `new` for a lead that carries no status at all — every lead captured
1344
+ * before the CRM existed, and every lead the capture door writes today,
1345
+ * because `addHostLead` stamps none. Reading the absence as `new` is what
1346
+ * lets the section open on the leads a site already holds rather than on an
1347
+ * empty list until each one has been touched once. A stored value the union
1348
+ * does not name also reads as `new`: it is a document some other writer
1349
+ * produced, and refusing to list it would hide a person.
1350
+ */
1351
+ export declare function crmLeadStatus(lead: Pick<CrmLeadFields, 'status'> | null | undefined): CrmLeadStatus;
1352
+ /** Whether a lead still needs working — see {@link CRM_LEAD_OPEN_STATUSES}. */
1353
+ export declare function isCrmLeadOpen(lead: Pick<CrmLeadFields, 'status'> | null | undefined): boolean;
1354
+ /** The lists a view can be saved for — every CRM section that has one. */
1355
+ export declare const CRM_VIEW_SECTIONS: readonly ["contacts", "companies", "deals", "tasks", "leads"];
1356
+ export type CrmViewSection = (typeof CRM_VIEW_SECTIONS)[number];
1357
+ export declare function isCrmViewSection(value: unknown): value is CrmViewSection;
1358
+ /**
1359
+ * One filter a view carries: a field, an operator and a value, exactly as a
1360
+ * list's own filter panel would send them to its query.
1361
+ *
1362
+ * `label` is the human reading of an OPAQUE value — a team member's name
1363
+ * beside their uid, a company's name beside its id — kept on the clause so
1364
+ * the chip that shows it can say "Owner is Dana" without a read. Display
1365
+ * only: nothing matches on it, and a clause without one shows its value.
1366
+ */
1367
+ export interface CrmViewFilterClause {
1368
+ field: string;
1369
+ op: string;
1370
+ value: string;
1371
+ label?: string;
1372
+ }
1373
+ /** The column a view orders by, and which way. */
1374
+ export interface CrmViewSort {
1375
+ field: string;
1376
+ direction: 'asc' | 'desc';
1377
+ }
1378
+ /**
1379
+ * What a view holds about a list — the part a section reads and writes,
1380
+ * without the name and the ownership around it.
1381
+ *
1382
+ * `columns` is the VISIBLE set, by column field, or empty for the list's
1383
+ * own default; `sort` is one column or none, because a table sorts by one.
1384
+ */
1385
+ export interface CrmViewState {
1386
+ filters: CrmViewFilterClause[];
1387
+ columns: string[];
1388
+ sort: CrmViewSort | null;
1389
+ }
1390
+ /** `orgs/{orgId}/crmViews/{viewId}`. */
1391
+ export interface CrmSavedView extends CrmScoped, CrmViewState {
1392
+ section: CrmViewSection;
1393
+ name: string;
1394
+ /** Whose working arrangement this is — the creator, and the one member the rules let change it. */
1395
+ ownerUid: string;
1396
+ createdByUid: string;
1397
+ /** Listed for everybody who can read the section, rather than the owner alone. */
1398
+ shared: boolean;
1399
+ }
1400
+ export declare const CRM_VIEW_NAME_MAX = 60;
1401
+ /**
1402
+ * The most clauses one view carries. A bound on the predicate, not the
1403
+ * audience: the list matches most of them in memory over a bounded window,
1404
+ * and a stored array has no natural end.
1405
+ */
1406
+ export declare const CRM_VIEW_MAX_FILTERS = 20;
1407
+ export declare const CRM_VIEW_MAX_COLUMNS = 60;
1408
+ export declare const EMPTY_CRM_VIEW_STATE: CrmViewState;
1409
+ /**
1410
+ * A stored view's filters, held to the clause shape.
1411
+ *
1412
+ * Strict about what it keeps: a clause with no field or no operator is not
1413
+ * a filter, and a valued operator with no value would read as a filter
1414
+ * that matches nothing — so both are dropped rather than kept, for the same
1415
+ * reason the dynamic-list rule drops an empty branch: a view must not
1416
+ * quietly select a different population than the one it reads as.
1417
+ */
1418
+ export declare function normalizeCrmViewFilters(value: unknown): CrmViewFilterClause[];
1419
+ export declare function normalizeCrmViewColumns(value: unknown): string[];
1420
+ export declare function normalizeCrmViewSort(value: unknown): CrmViewSort | null;
1421
+ /** A stored document's three list-facing fields, held to their shapes. */
1422
+ export declare function normalizeCrmViewState(value: unknown): CrmViewState;
1423
+ /**
1424
+ * Whether two states describe the same list — what "unsaved changes" means.
1425
+ *
1426
+ * Clause order matters (a list applies them in order, and the first one the
1427
+ * query can serve is the one it serves); the label on a clause does not,
1428
+ * because nothing matches on it.
1429
+ */
1430
+ export declare function crmViewStateEquals(a: CrmViewState, b: CrmViewState): boolean;
1431
+ /**
1432
+ * Whether a view belongs in this reader's menu: their own, or one somebody
1433
+ * shared. The rules admit the read either way — see the module note — so
1434
+ * this is what keeps one person's private arrangement out of another's
1435
+ * list.
1436
+ */
1437
+ export declare function crmViewIsListed(view: Pick<CrmSavedView, 'shared' | 'ownerUid'>, uid: string | null | undefined): boolean;
1438
+ /**
1439
+ * The Contacts list's filterable fields, by the names a view clause carries.
1440
+ *
1441
+ * A contract between three readers that cannot import one another: the
1442
+ * list's own filter grammar (which declares these as its columns), a saved
1443
+ * view (which stores them), and the dynamic-list translator below in
1444
+ * `dynamic-list-rule.ts` (which turns them into audience dimensions). Named
1445
+ * once so a rename on the list cannot silently stop an audience matching.
1446
+ * `custom` is a PREFIX: a custom field's column is the prefix and its key.
1447
+ */
1448
+ export declare const CRM_CONTACT_VIEW_FIELDS: {
1449
+ readonly tags: "tags";
1450
+ readonly source: "source";
1451
+ readonly owner: "ownerUid";
1452
+ readonly stage: "lifecycleStage";
1453
+ readonly company: "companyId";
1454
+ readonly createdAt: "createdAt";
1455
+ readonly updatedAt: "updatedAt";
1456
+ readonly orders: "ordersCount";
1457
+ readonly ltv: "ltvCents";
1458
+ readonly custom: "custom_";
1459
+ };
1460
+ /** The column a custom contact field filters and shows as. */
1461
+ export declare const crmContactCustomColumn: (key: string) => string;
1462
+ /** The field key a custom column stands for, or `null` for any other column. */
1463
+ export declare function crmContactCustomKey(column: string): string | null;
1464
+ /**
1465
+ * A stored phone number as the `href` of a click-to-call link, or `null`
1466
+ * when the value is not one (AGL-2661).
1467
+ *
1468
+ * The console stores E.164 (`normalizePhone` runs before every write), and
1469
+ * a `tel:` URL wants exactly that: digits with a leading `+`, nothing else.
1470
+ * Spaces, dots, dashes and parentheses are dropped rather than refused
1471
+ * because a value written before normalization existed may carry them;
1472
+ * anything that is not a run of digits after that — a word, an extension
1473
+ * typed as `x123` — is refused, because a dialer handed it would ring
1474
+ * nothing and the link would be a lie.
1475
+ */
1476
+ export declare function crmTelHref(phone: unknown): string | null;
1477
+ /**
1478
+ * A saved segment, as the filters of a contacts view.
1479
+ *
1480
+ * A segment is "any of these tags AND any of these sources", so each
1481
+ * becomes one `isAnyOf` clause — OR within, AND across, which is the
1482
+ * reading `contactMatchesSegment` gives it. A single tag is emitted as
1483
+ * `contains` instead: that operator is the one the contacts query can serve
1484
+ * from the index, so a one-tag segment opened as a view reaches the whole
1485
+ * collection rather than the loaded window. The values are the segment's
1486
+ * own, joined the way the grammar's `isAnyOf` splits them.
1487
+ */
1488
+ export declare function crmViewFiltersFromSegment(segment: Pick<ContactSegment, 'tags' | 'sources'>): CrmViewFilterClause[];
1489
+ /**
1490
+ * The other direction: the segment a view's filters describe, or `null`
1491
+ * when the view carries no tag or source clause a segment could hold.
1492
+ *
1493
+ * Only the two dimensions a segment has are read, and only through the
1494
+ * operators that mean "has one of these"; a `name startsWith` or an owner
1495
+ * clause is not a segment's to keep. What comes back is what "Save as
1496
+ * segment" writes, so a campaign audience built from it selects exactly the
1497
+ * tags and sources the reader could see on the chips.
1498
+ */
1499
+ export declare function crmViewSegmentFilters(filters: readonly CrmViewFilterClause[]): Pick<ContactSegment, 'tags' | 'sources'> | null;
1500
+ /**
1501
+ * `users/{uid}.crmDefaultViews` — `{ [orgId]: { [section]: viewId } }`.
1502
+ *
1503
+ * On the reader's own profile document, beside `notificationPrefs`, because
1504
+ * it is the same kind of fact: how one person wants their console to
1505
+ * behave, owned and written by them alone. Keyed by org first because one
1506
+ * account sits on several organizations and a view id is only meaningful
1507
+ * inside the one that holds it.
1508
+ */
1509
+ export declare const CRM_DEFAULT_VIEWS_FIELD = "crmDefaultViews";
1510
+ /** The view a section opens on for this reader in this org, or none. */
1511
+ export declare function crmDefaultViewId(profile: Record<string, unknown> | null | undefined, orgId: string | null | undefined, section: CrmViewSection): string | null;
1512
+ /**
1513
+ * The merge patch that sets — or, with `null`, clears — one default.
1514
+ *
1515
+ * Shaped for a merged write so the other organizations' and sections'
1516
+ * defaults on the same document survive it; `null` rather than a delete
1517
+ * sentinel because this module carries no Firestore, and the reader above
1518
+ * treats a null as no default.
1519
+ */
1520
+ export declare function crmDefaultViewPatch(orgId: string, section: CrmViewSection, viewId: string | null): Record<string, unknown>;
1521
+ /** The field a record's attached files are stored under, on all three. */
1522
+ export declare const CRM_MEDIA_IDS_FIELD = "mediaIds";
1523
+ /**
1524
+ * The most files one record may carry.
1525
+ *
1526
+ * A platform ceiling in the family of {@link CRM_ACTIVITIES_PER_RECORD_CEILING}
1527
+ * rather than a plan dimension: attachments are bounded by human effort, and
1528
+ * this is the bound. It is also what the Firestore rules can actually check
1529
+ * — a rule can assert a list and its size, and cannot walk one — so the
1530
+ * number is enforced rather than merely documented.
1531
+ */
1532
+ export declare const CRM_MEDIA_IDS_MAX = 20;
1533
+ /**
1534
+ * A stored or submitted attachment list, cleaned.
1535
+ *
1536
+ * Ids rather than URLs, deduplicated, trimmed, non-empty and capped. Written
1537
+ * through by every path that sets the field — the console card, the REST
1538
+ * write — so a record cannot hold a list one of them would refuse.
1539
+ *
1540
+ * An id is a media DOCUMENT id, resolved against the organization's library
1541
+ * (`orgs/{orgId}/media/{mediaId}`) at read time. Storing the id and not the
1542
+ * URL is what lets a file move between folders, and what keeps a private
1543
+ * asset behind the signed CDN door rather than pinned to a raw storage URL
1544
+ * that names its current location.
1545
+ */
1546
+ export declare function normalizeCrmMediaIds(value: unknown): string[];