@aglyn/plugins-marketing 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 (183) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +7 -0
  3. package/package.json +56 -0
  4. package/src/index.d.ts +19 -0
  5. package/src/index.js +20 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/components/announcement-bar-card.component.d.ts +20 -0
  8. package/src/lib/components/announcement-bar-card.component.js +292 -0
  9. package/src/lib/components/announcement-bar-card.component.js.map +1 -0
  10. package/src/lib/components/campaign-composer.d.ts +84 -0
  11. package/src/lib/components/campaign-composer.js +1643 -0
  12. package/src/lib/components/campaign-composer.js.map +1 -0
  13. package/src/lib/components/campaign-conversions-card.d.ts +22 -0
  14. package/src/lib/components/campaign-conversions-card.js +642 -0
  15. package/src/lib/components/campaign-conversions-card.js.map +1 -0
  16. package/src/lib/components/campaign-detail-card.d.ts +55 -0
  17. package/src/lib/components/campaign-detail-card.js +771 -0
  18. package/src/lib/components/campaign-detail-card.js.map +1 -0
  19. package/src/lib/components/campaign-edit-drawer.d.ts +60 -0
  20. package/src/lib/components/campaign-edit-drawer.js +252 -0
  21. package/src/lib/components/campaign-edit-drawer.js.map +1 -0
  22. package/src/lib/components/campaign-email-zones.d.ts +111 -0
  23. package/src/lib/components/campaign-email-zones.js +54 -0
  24. package/src/lib/components/campaign-email-zones.js.map +1 -0
  25. package/src/lib/components/campaign-glance-card.component.d.ts +18 -0
  26. package/src/lib/components/campaign-glance-card.component.js +151 -0
  27. package/src/lib/components/campaign-glance-card.component.js.map +1 -0
  28. package/src/lib/components/campaign-members-section.d.ts +87 -0
  29. package/src/lib/components/campaign-members-section.js +499 -0
  30. package/src/lib/components/campaign-members-section.js.map +1 -0
  31. package/src/lib/components/campaign-reach-sections.d.ts +137 -0
  32. package/src/lib/components/campaign-reach-sections.js +694 -0
  33. package/src/lib/components/campaign-reach-sections.js.map +1 -0
  34. package/src/lib/components/campaign-report-card.d.ts +91 -0
  35. package/src/lib/components/campaign-report-card.js +667 -0
  36. package/src/lib/components/campaign-report-card.js.map +1 -0
  37. package/src/lib/components/campaign-test-send-drawer.d.ts +45 -0
  38. package/src/lib/components/campaign-test-send-drawer.js +238 -0
  39. package/src/lib/components/campaign-test-send-drawer.js.map +1 -0
  40. package/src/lib/components/campaigns-card.d.ts +31 -0
  41. package/src/lib/components/campaigns-card.js +667 -0
  42. package/src/lib/components/campaigns-card.js.map +1 -0
  43. package/src/lib/components/conversion-attribution.component.d.ts +62 -0
  44. package/src/lib/components/conversion-attribution.component.js +127 -0
  45. package/src/lib/components/conversion-attribution.component.js.map +1 -0
  46. package/src/lib/components/email-compose-card.d.ts +12 -0
  47. package/src/lib/components/email-compose-card.js +157 -0
  48. package/src/lib/components/email-compose-card.js.map +1 -0
  49. package/src/lib/components/email-detail.d.ts +40 -0
  50. package/src/lib/components/email-detail.js +1180 -0
  51. package/src/lib/components/email-detail.js.map +1 -0
  52. package/src/lib/components/email-edit-drawer.d.ts +54 -0
  53. package/src/lib/components/email-edit-drawer.js +172 -0
  54. package/src/lib/components/email-edit-drawer.js.map +1 -0
  55. package/src/lib/components/email-messages-widget.d.ts +22 -0
  56. package/src/lib/components/email-messages-widget.js +49 -0
  57. package/src/lib/components/email-messages-widget.js.map +1 -0
  58. package/src/lib/components/email-recipients-card.d.ts +50 -0
  59. package/src/lib/components/email-recipients-card.js +338 -0
  60. package/src/lib/components/email-recipients-card.js.map +1 -0
  61. package/src/lib/components/emails-list-card.d.ts +36 -0
  62. package/src/lib/components/emails-list-card.js +544 -0
  63. package/src/lib/components/emails-list-card.js.map +1 -0
  64. package/src/lib/components/experiment-zones.d.ts +78 -0
  65. package/src/lib/components/experiment-zones.js +65 -0
  66. package/src/lib/components/experiment-zones.js.map +1 -0
  67. package/src/lib/components/host-experiments-card.component.d.ts +17 -0
  68. package/src/lib/components/host-experiments-card.component.js +887 -0
  69. package/src/lib/components/host-experiments-card.component.js.map +1 -0
  70. package/src/lib/components/host-marketing-summary-card.component.d.ts +15 -0
  71. package/src/lib/components/host-marketing-summary-card.component.js +161 -0
  72. package/src/lib/components/host-marketing-summary-card.component.js.map +1 -0
  73. package/src/lib/components/host-overlays-card.component.d.ts +19 -0
  74. package/src/lib/components/host-overlays-card.component.js +783 -0
  75. package/src/lib/components/host-overlays-card.component.js.map +1 -0
  76. package/src/lib/components/marketing-console-page.d.ts +28 -0
  77. package/src/lib/components/marketing-console-page.js +166 -0
  78. package/src/lib/components/marketing-console-page.js.map +1 -0
  79. package/src/lib/components/marketing-console-sections.d.ts +34 -0
  80. package/src/lib/components/marketing-console-sections.js +77 -0
  81. package/src/lib/components/marketing-console-sections.js.map +1 -0
  82. package/src/lib/components/overlay-stats-row.component.d.ts +15 -0
  83. package/src/lib/components/overlay-stats-row.component.js +78 -0
  84. package/src/lib/components/overlay-stats-row.component.js.map +1 -0
  85. package/src/lib/components/popup-card.component.d.ts +18 -0
  86. package/src/lib/components/popup-card.component.js +462 -0
  87. package/src/lib/components/popup-card.component.js.map +1 -0
  88. package/src/lib/components/record-attribution-widget.d.ts +35 -0
  89. package/src/lib/components/record-attribution-widget.js +33 -0
  90. package/src/lib/components/record-attribution-widget.js.map +1 -0
  91. package/src/lib/components/site-runtime.d.ts +9 -0
  92. package/src/lib/components/site-runtime.js +1081 -0
  93. package/src/lib/components/site-runtime.js.map +1 -0
  94. package/src/lib/components/use-campaign-send-api.d.ts +35 -0
  95. package/src/lib/components/use-campaign-send-api.js +99 -0
  96. package/src/lib/components/use-campaign-send-api.js.map +1 -0
  97. package/src/lib/components/use-campaign-topic-options.d.ts +20 -0
  98. package/src/lib/components/use-campaign-topic-options.js +44 -0
  99. package/src/lib/components/use-campaign-topic-options.js.map +1 -0
  100. package/src/lib/components/use-emails-hub-path.d.ts +39 -0
  101. package/src/lib/components/use-emails-hub-path.js +70 -0
  102. package/src/lib/components/use-emails-hub-path.js.map +1 -0
  103. package/src/lib/components/use-marketing-hub-path.d.ts +21 -0
  104. package/src/lib/components/use-marketing-hub-path.js +50 -0
  105. package/src/lib/components/use-marketing-hub-path.js.map +1 -0
  106. package/src/lib/components/use-overlay-copy-editor.d.ts +79 -0
  107. package/src/lib/components/use-overlay-copy-editor.js +110 -0
  108. package/src/lib/components/use-overlay-copy-editor.js.map +1 -0
  109. package/src/lib/constants/bundle-common.d.ts +8 -0
  110. package/src/lib/constants/bundle-common.js +9 -0
  111. package/src/lib/constants/bundle-common.js.map +1 -0
  112. package/src/lib/model/campaign-membership-figures.d.ts +109 -0
  113. package/src/lib/model/campaign-membership-figures.js +113 -0
  114. package/src/lib/model/campaign-membership-figures.js.map +1 -0
  115. package/src/lib/model/compile-client-automations.d.ts +65 -0
  116. package/src/lib/model/compile-client-automations.js +95 -0
  117. package/src/lib/model/compile-client-automations.js.map +1 -0
  118. package/src/lib/model/experiments.d.ts +130 -0
  119. package/src/lib/model/experiments.js +186 -0
  120. package/src/lib/model/experiments.js.map +1 -0
  121. package/src/lib/model/index.d.ts +26 -0
  122. package/src/lib/model/index.js +26 -0
  123. package/src/lib/model/index.js.map +1 -0
  124. package/src/lib/model/marketing-record-routes.d.ts +6 -0
  125. package/src/lib/model/marketing-record-routes.js +46 -0
  126. package/src/lib/model/marketing-record-routes.js.map +1 -0
  127. package/src/lib/model/overlay-copy.d.ts +62 -0
  128. package/src/lib/model/overlay-copy.js +78 -0
  129. package/src/lib/model/overlay-copy.js.map +1 -0
  130. package/src/lib/model/overlays.d.ts +113 -0
  131. package/src/lib/model/overlays.js +93 -0
  132. package/src/lib/model/overlays.js.map +1 -0
  133. package/src/lib/model/site-contract.d.ts +100 -0
  134. package/src/lib/model/site-contract.js +23 -0
  135. package/src/lib/model/site-contract.js.map +1 -0
  136. package/src/lib/plugin.d.ts +27 -0
  137. package/src/lib/plugin.js +168 -0
  138. package/src/lib/plugin.js.map +1 -0
  139. package/src/lib/preview-props.d.ts +31 -0
  140. package/src/lib/preview-props.js +54 -0
  141. package/src/lib/preview-props.js.map +1 -0
  142. package/src/lib/server/campaign-manage.d.ts +62 -0
  143. package/src/lib/server/campaign-manage.js +829 -0
  144. package/src/lib/server/campaign-manage.js.map +1 -0
  145. package/src/lib/server/campaign-process-scheduled.d.ts +26 -0
  146. package/src/lib/server/campaign-process-scheduled.js +198 -0
  147. package/src/lib/server/campaign-process-scheduled.js.map +1 -0
  148. package/src/lib/server/campaign-recipients.d.ts +55 -0
  149. package/src/lib/server/campaign-recipients.js +219 -0
  150. package/src/lib/server/campaign-recipients.js.map +1 -0
  151. package/src/lib/server/campaign-send.d.ts +487 -0
  152. package/src/lib/server/campaign-send.js +3157 -0
  153. package/src/lib/server/campaign-send.js.map +1 -0
  154. package/src/lib/server/email-campaign-reach.d.ts +174 -0
  155. package/src/lib/server/email-campaign-reach.js +254 -0
  156. package/src/lib/server/email-campaign-reach.js.map +1 -0
  157. package/src/lib/server/email-events.d.ts +27 -0
  158. package/src/lib/server/email-events.js +714 -0
  159. package/src/lib/server/email-events.js.map +1 -0
  160. package/src/lib/server/get-client-automations.d.ts +60 -0
  161. package/src/lib/server/get-client-automations.js +87 -0
  162. package/src/lib/server/get-client-automations.js.map +1 -0
  163. package/src/lib/server/get-overlays.d.ts +28 -0
  164. package/src/lib/server/get-overlays.js +65 -0
  165. package/src/lib/server/get-overlays.js.map +1 -0
  166. package/src/lib/server/get-screen-experiments.d.ts +42 -0
  167. package/src/lib/server/get-screen-experiments.js +82 -0
  168. package/src/lib/server/get-screen-experiments.js.map +1 -0
  169. package/src/lib/server/lists-materialize.d.ts +18 -0
  170. package/src/lib/server/lists-materialize.js +130 -0
  171. package/src/lib/server/lists-materialize.js.map +1 -0
  172. package/src/lib/server/marketing-figures.d.ts +37 -0
  173. package/src/lib/server/marketing-figures.js +248 -0
  174. package/src/lib/server/marketing-figures.js.map +1 -0
  175. package/src/lib/server/site-page-enricher.d.ts +26 -0
  176. package/src/lib/server/site-page-enricher.js +210 -0
  177. package/src/lib/server/site-page-enricher.js.map +1 -0
  178. package/src/lib/server.d.ts +20 -0
  179. package/src/lib/server.js +152 -0
  180. package/src/lib/server.js.map +1 -0
  181. package/src/lib/site.d.ts +22 -0
  182. package/src/lib/site.js +48 -0
  183. package/src/lib/site.js.map +1 -0
@@ -0,0 +1,499 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ 'use client';
17
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
18
+ import { AppLink } from "@aglyn/shared-ui-jsx";
19
+ import { Figure, Section } from "@aglyn/shared-ui-email-campaigns/components/report-figures";
20
+ import { ListTable } from "@aglyn/shared-ui-jsx/components/list-table.component";
21
+ import { TABLE_ROW_HEIGHT } from "@aglyn/shared-ui-jsx/const/table-pagination";
22
+ import { buildRoute, CAMPAIGN_MEMBERSHIP_FIELD, readCampaignIds, Route } from "@aglyn/aglyn";
23
+ import { Alert, Stack, Typography } from "@mui/material";
24
+ import { collection, documentId, limit, orderBy, query, where } from "firebase/firestore";
25
+ import { useMemo } from "react";
26
+ import { useConsoleHostRoute, useFirestore, useFirestoreCollection } from "@aglyn/tenant-feature-instance";
27
+ import { campaignFormsRollup, campaignFormTotals, campaignPeriodRange, isWindowedRange } from "../model/campaign-membership-figures.js";
28
+ /**
29
+ * How many members of one kind the section enumerates.
30
+ *
31
+ * One document past it is asked for, so "this campaign holds more than are
32
+ * listed" is a fact rather than a guess — the same probe the emails table on
33
+ * this page makes.
34
+ */ const MEMBER_CEILING = 25;
35
+ /**
36
+ * The rows a reader may act on: the window, minus what has been deleted.
37
+ *
38
+ * The soft delete is filtered HERE and not in the query. `deletedAt` is
39
+ * written only when a record is removed, so `where('deletedAt', '==', null)`
40
+ * would match nothing at all — Firestore's equality matches documents that
41
+ * HAVE the field — and every live record would vanish from the campaign. The
42
+ * campaigns table filters its own soft-deleted containers the same way.
43
+ */ function live(docs) {
44
+ return (docs != null ? docs : []).slice(0, MEMBER_CEILING).filter((row)=>!row['deletedAt']);
45
+ }
46
+ /**
47
+ * WHAT ELSE IS IN THIS CAMPAIGN — the landing pages and forms assigned to it,
48
+ * and what those forms have collected.
49
+ *
50
+ * ## Declared, and therefore different from every section above it
51
+ *
52
+ * The conversions, revenue and destinations sections are EVIDENCE: they join
53
+ * on the campaign's send ids and report what visitors did BECAUSE of this
54
+ * campaign's mail. This one is a statement the merchant made — a screen or a
55
+ * form carries this campaign's id in {@link CAMPAIGN_MEMBERSHIP_FIELD} — plus
56
+ * the counters those records carry on their own documents.
57
+ *
58
+ * The distinction survives into the wording, because the arithmetic will not
59
+ * enforce it. A form's submissions are the form's; filing the form under a
60
+ * campaign does not make them the campaign's, and a heading that said
61
+ * "this campaign produced 40 leads" over a number meaning "the forms filed
62
+ * here have 40 leads" would be a worse page than one showing nothing. So the
63
+ * figures are labeled as what the forms HOLD, they sit in their own block
64
+ * under their own disclaimer, and no total on this page adds them to an
65
+ * attributed one.
66
+ *
67
+ * ## Three ways the forms' counters could mislead, each answered
68
+ *
69
+ * 1. **They are lifetime.** `stats.submissions` has counted since the form
70
+ * existed, including every submission from before anybody filed it here.
71
+ * Where the campaign carries dates, the figures are summed from the
72
+ * monthly `stats.periods` series over those months instead, and the
73
+ * caption says which of the two a reader is looking at. Months are whole,
74
+ * so a campaign starting mid-month includes that month entire — stated,
75
+ * not rounded away.
76
+ * 2. **A form can be in twenty campaigns.** `campaignIds` is an array, so
77
+ * the same submissions count toward every campaign the form is filed
78
+ * under. Rows say so and the total refuses to present itself as
79
+ * exclusive.
80
+ * 3. **A counter nobody wrote is not a zero.** `stats.leads` is incremented
81
+ * only for a form whose `routing.lead` is set, and `stats.views` only by
82
+ * the analytics beacon. Both reach the shared `Figure`, which draws an em
83
+ * dash and the words "not recorded" rather than a confident 0.
84
+ *
85
+ * ## Screens carry no counter, and this section will not invent one
86
+ *
87
+ * A form's counters ride on the form document, so the query this section
88
+ * already makes pays for them. A screen's traffic does not: it is one
89
+ * document per screen per day in `hosts/{hostId}/screenAnalytics`, with no
90
+ * lifetime total anywhere, so a views column here would cost a range read
91
+ * across screens times days on every open of this page — and the display of
92
+ * those figures is a paid entitlement this section does not resolve. The
93
+ * screens block names the absence and links to the surface that does measure
94
+ * it, which is a smaller lie than a number nobody can stand behind.
95
+ *
96
+ * ## The join is `array-contains`, on the member's own document
97
+ *
98
+ * A campaign holds no member list. Each record names the campaigns it is in,
99
+ * which is what makes deleting one record leave nothing behind and what lets
100
+ * a record's own page draw its campaigns without a query. The query here is
101
+ * the other direction of the same field, served by Firestore's automatic
102
+ * single-field index.
103
+ *
104
+ * `orderBy(documentId())`, like every other bounded list in this console: a
105
+ * form carries `updatedAt` only if some writer stamped one, and ordering on a
106
+ * field a writer may omit does not mis-sort the list, it drops rows from it.
107
+ *
108
+ * ## Contacts are named here and NOT listed, and the reason is a query limit
109
+ *
110
+ * A contact is org-scoped and shared between the sites that captured it, so
111
+ * every client read of the collection has to carry
112
+ * `visibleTo array-contains-any` — that is what makes the read provable
113
+ * per-document under the rules. Firestore permits ONE array clause per query,
114
+ * and that is it: there is no client query that filters contacts by campaign
115
+ * as well, so there is no pre-filtered address to link to either. The link
116
+ * offered goes to the Contacts page and says it arrives unfiltered; the
117
+ * assignment is real, is set from the contact's own drawer, and a count of it
118
+ * would cost a scan of the collection the customer is billed on.
119
+ */ export function CampaignMembersSection(props) {
120
+ var _range_from, _range_to;
121
+ const { hostId, campaignId, startAtMs, endAtMs } = props;
122
+ const firestore = useFirestore();
123
+ const { orgSlug, subdomain: host } = useConsoleHostRoute(hostId);
124
+ const memberQuery = (collectionName)=>()=>query(collection(firestore, 'hosts', hostId, collectionName), where(CAMPAIGN_MEMBERSHIP_FIELD, 'array-contains', campaignId), orderBy(documentId()), limit(MEMBER_CEILING + 1));
125
+ const { data: screenDocs, status: screensStatus } = useFirestoreCollection(memberQuery('screens'), [
126
+ firestore,
127
+ hostId,
128
+ campaignId
129
+ ], {
130
+ idField: '$id'
131
+ });
132
+ const { data: formDocs, status: formsStatus } = useFirestoreCollection(memberQuery('forms'), [
133
+ firestore,
134
+ hostId,
135
+ campaignId
136
+ ], {
137
+ idField: '$id'
138
+ });
139
+ /*
140
+ * The months the campaign's dates cover, or nothing where it has neither.
141
+ * Derived from props the detail card already holds, so asking what a
142
+ * figure covers costs no read.
143
+ */ const range = useMemo(()=>campaignPeriodRange({
144
+ startAtMs,
145
+ endAtMs
146
+ }), [
147
+ startAtMs,
148
+ endAtMs
149
+ ]);
150
+ const windowed = isWindowedRange(range);
151
+ const screens = useMemo(()=>{
152
+ return live(screenDocs).map((row)=>{
153
+ var _row_versionId, _row_displayName;
154
+ const id = String(row['$id']);
155
+ const versionId = String((_row_versionId = row['versionId']) != null ? _row_versionId : '');
156
+ return {
157
+ id,
158
+ name: String((_row_displayName = row['displayName']) != null ? _row_displayName : id),
159
+ /*
160
+ * A screen with no saved version has no detail address to build —
161
+ * the route carries a version — so it stays plain text rather than
162
+ * linking somewhere that 404s. The screens list applies the same
163
+ * guard to its own name column.
164
+ */ href: versionId && orgSlug && host ? buildRoute(Route.SCREEN_DETAILS, {
165
+ orgSlug,
166
+ host,
167
+ screenId: id,
168
+ versionId
169
+ }) : null,
170
+ hrefReason: versionId ? 'This site’s console URL has not resolved yet' : 'This screen has no saved version yet',
171
+ campaigns: readCampaignIds(row).length
172
+ };
173
+ });
174
+ }, [
175
+ screenDocs,
176
+ orgSlug,
177
+ host
178
+ ]);
179
+ /*
180
+ * The counters ride on the documents the membership query already returned,
181
+ * so every figure below is paid for by a read this section was making
182
+ * anyway. Nothing here opens a second listener.
183
+ */ const forms = useMemo(()=>{
184
+ return live(formDocs).map((row)=>{
185
+ var _row_displayName;
186
+ const id = String(row['$id']);
187
+ return {
188
+ id,
189
+ name: String((_row_displayName = row['displayName']) != null ? _row_displayName : id),
190
+ href: orgSlug && host ? buildRoute(Route.FORM_DETAILS, {
191
+ orgSlug,
192
+ host,
193
+ formId: id
194
+ }) : null,
195
+ hrefReason: 'This site’s console URL has not resolved yet',
196
+ totals: campaignFormTotals(row['stats'], range),
197
+ campaigns: readCampaignIds(row).length
198
+ };
199
+ });
200
+ }, [
201
+ formDocs,
202
+ orgSlug,
203
+ host,
204
+ range
205
+ ]);
206
+ const rollup = useMemo(()=>campaignFormsRollup(forms.map((row)=>{
207
+ var _row_campaigns;
208
+ return {
209
+ totals: row.totals,
210
+ campaigns: (_row_campaigns = row.campaigns) != null ? _row_campaigns : 1
211
+ };
212
+ })), [
213
+ forms
214
+ ]);
215
+ const screensTruncated = (screenDocs != null ? screenDocs : []).length > MEMBER_CEILING;
216
+ const formsTruncated = (formDocs != null ? formDocs : []).length > MEMBER_CEILING;
217
+ const settled = screensStatus !== 'loading' && formsStatus !== 'loading';
218
+ const analyticsHref = orgSlug && host ? buildRoute(Route.HOST_ANALYTICS, {
219
+ orgSlug,
220
+ host
221
+ }) : null;
222
+ const contactsHref = orgSlug && host ? buildRoute(Route.HOST_CONTACTS, {
223
+ orgSlug,
224
+ host
225
+ }) : null;
226
+ return /*#__PURE__*/ _jsx(Section, {
227
+ title: "Assigned to this campaign",
228
+ children: /*#__PURE__*/ _jsxs(Stack, {
229
+ spacing: 2,
230
+ children: [
231
+ /*#__PURE__*/ _jsx(Typography, {
232
+ variant: "body2",
233
+ color: "text.secondary",
234
+ children: 'The pages and forms somebody put in this campaign. Assignment is ' + 'a grouping — what the campaign was credited with is measured ' + 'above, from the links its emails carried.'
235
+ }),
236
+ /*#__PURE__*/ _jsx(MemberTable, {
237
+ heading: "Screens",
238
+ noun: "screen",
239
+ rows: screens,
240
+ truncated: screensTruncated,
241
+ settled: settled
242
+ }),
243
+ /*#__PURE__*/ _jsxs(Typography, {
244
+ variant: "caption",
245
+ color: "text.secondary",
246
+ children: [
247
+ 'Page views are not shown here. A screen keeps no running total ' + 'on its own record — traffic is stored a day at a time — so ' + 'counting it would be a fresh read of the site’s history every ' + 'time this page opens. ',
248
+ analyticsHref ? /*#__PURE__*/ _jsx(AppLink, {
249
+ href: analyticsHref,
250
+ children: 'The site’s analytics measures it by screen.'
251
+ }) : 'The site’s analytics page measures it by screen.'
252
+ ]
253
+ }),
254
+ /*#__PURE__*/ _jsx(MemberTable, {
255
+ heading: "Forms",
256
+ noun: "form",
257
+ rows: forms,
258
+ truncated: formsTruncated,
259
+ settled: settled,
260
+ figures: true
261
+ }),
262
+ forms.length ? /*#__PURE__*/ _jsx(FormsHoldings, {
263
+ rollup: rollup,
264
+ windowed: windowed,
265
+ from: (_range_from = range.from) != null ? _range_from : null,
266
+ to: (_range_to = range.to) != null ? _range_to : null
267
+ }) : null,
268
+ /*#__PURE__*/ _jsxs(Stack, {
269
+ spacing: 0.5,
270
+ children: [
271
+ /*#__PURE__*/ _jsx(Typography, {
272
+ variant: "overline",
273
+ color: "text.secondary",
274
+ children: 'Contacts'
275
+ }),
276
+ /*#__PURE__*/ _jsxs(Typography, {
277
+ variant: "body2",
278
+ color: "text.secondary",
279
+ children: [
280
+ 'Contacts are filed under a campaign from the contact’s own ' + 'panel on the Contacts page. They are not listed or counted ' + 'here: a contact belongs to the organization rather than to ' + 'this site, so the query that reads them is already spending ' + 'its one array filter on which sites may see the person. ',
281
+ contactsHref ? /*#__PURE__*/ _jsx(AppLink, {
282
+ href: contactsHref,
283
+ children: 'Open Contacts'
284
+ }) : null,
285
+ contactsHref ? ' — it opens unfiltered, because that same rule leaves no ' + 'campaign filter for the address to carry.' : ''
286
+ ]
287
+ })
288
+ ]
289
+ })
290
+ ]
291
+ })
292
+ });
293
+ }
294
+ /**
295
+ * What the campaign's forms have collected — and what that is NOT.
296
+ *
297
+ * Two sentences do the whole job of keeping this apart from the attributed
298
+ * figures, and both are load-bearing:
299
+ *
300
+ * - The first refuses causation outright. A merchant reading a number under
301
+ * a campaign's heading will assume the campaign caused it unless told
302
+ * otherwise in the same breath.
303
+ * - The second says which months the number covers. A lifetime total under a
304
+ * campaign that ran for six weeks is the same lie one step quieter.
305
+ *
306
+ * `shared` is stated as a count rather than folded into the arithmetic. There
307
+ * is no honest way to divide a submission between two campaigns a form is
308
+ * filed under, so the total is left whole and the overlap is disclosed.
309
+ */ function FormsHoldings(props) {
310
+ const { rollup, windowed, from, to } = props;
311
+ const note = (recorded)=>recorded < rollup.members ? `across ${recorded} of ${rollup.members} forms` : `across ${rollup.members} form${rollup.members === 1 ? '' : 's'}`;
312
+ const span = windowed ? `the campaign’s months (${from != null ? from : 'the first month recorded'} to ${to != null ? to : 'now'})` : 'each form’s whole history';
313
+ return /*#__PURE__*/ _jsxs(Stack, {
314
+ spacing: 1,
315
+ children: [
316
+ /*#__PURE__*/ _jsx(Typography, {
317
+ variant: "overline",
318
+ color: "text.secondary",
319
+ children: 'What these forms hold'
320
+ }),
321
+ /*#__PURE__*/ _jsxs(Stack, {
322
+ direction: "row",
323
+ spacing: 3,
324
+ sx: {
325
+ flexWrap: 'wrap'
326
+ },
327
+ children: [
328
+ /*#__PURE__*/ _jsx(Figure, {
329
+ label: "Views",
330
+ value: rollup.views.value,
331
+ note: note(rollup.views.recorded)
332
+ }),
333
+ /*#__PURE__*/ _jsx(Figure, {
334
+ label: "Started",
335
+ value: rollup.starts.value,
336
+ note: note(rollup.starts.recorded)
337
+ }),
338
+ /*#__PURE__*/ _jsx(Figure, {
339
+ label: "Submissions",
340
+ value: rollup.submissions.value,
341
+ note: note(rollup.submissions.recorded)
342
+ }),
343
+ /*#__PURE__*/ _jsx(Figure, {
344
+ label: "Leads",
345
+ value: rollup.leads.value,
346
+ note: note(rollup.leads.recorded)
347
+ })
348
+ ]
349
+ }),
350
+ /*#__PURE__*/ _jsx(Typography, {
351
+ variant: "caption",
352
+ color: "text.secondary",
353
+ children: 'These are the forms’ own counters, not this campaign’s results. ' + 'A submission is counted here because somebody filed the form ' + 'under this campaign, whether or not this campaign’s mail sent ' + `the visitor. Counted over ${span}.`
354
+ }),
355
+ windowed ? /*#__PURE__*/ _jsx(Typography, {
356
+ variant: "caption",
357
+ color: "text.secondary",
358
+ children: 'Whole calendar months: a campaign that started or ended mid-' + 'month takes that month entire, and a form counting nothing in ' + 'those months adds nothing here even where its lifetime total ' + 'is large.'
359
+ }) : /*#__PURE__*/ _jsx(Typography, {
360
+ variant: "caption",
361
+ color: "text.secondary",
362
+ children: 'This campaign has no dates, so nothing narrows the figures to ' + 'it. They are lifetime totals and include everything from ' + 'before the forms were put in this campaign. Give the campaign ' + 'a start and an end to count only its months.'
363
+ }),
364
+ rollup.shared ? /*#__PURE__*/ _jsx(Typography, {
365
+ variant: "caption",
366
+ color: "text.secondary",
367
+ children: `${rollup.shared} of these ${rollup.members} forms ${rollup.shared === 1 ? 'is' : 'are'} filed under another campaign too, so the same submissions are ` + 'counted there as well. This total is not exclusive to this ' + 'campaign.'
368
+ }) : null
369
+ ]
370
+ });
371
+ }
372
+ FormsHoldings.displayName = 'FormsHoldings';
373
+ /** A counter as a cell: an em dash where nothing was recorded, never a zero. */ function statCell(value) {
374
+ return value === null || value === undefined ? '—' : value.toLocaleString();
375
+ }
376
+ /** The counters a form carries on its own document, in the order they are read. */ const MEMBER_FIGURES = [
377
+ [
378
+ 'views',
379
+ 'Views'
380
+ ],
381
+ [
382
+ 'starts',
383
+ 'Started'
384
+ ],
385
+ [
386
+ 'submissions',
387
+ 'Submissions'
388
+ ],
389
+ [
390
+ 'leads',
391
+ 'Leads'
392
+ ]
393
+ ];
394
+ /**
395
+ * One kind's members, as a record list in the shared grid.
396
+ *
397
+ * The rows are a window this component already holds — the same arrangement
398
+ * the campaign's emails list beside it uses, and for the same reason: the
399
+ * ceiling bounds the read, and the grid's footer lets a reader walk what came
400
+ * back without the card deciding how many rows fit.
401
+ *
402
+ * `figures` adds the counter columns for a kind that carries them on its own
403
+ * document. It is a prop rather than two lists because the row grammar — the
404
+ * name cell, the reason a member has no link, the footer — is the part that
405
+ * has to stay identical between screens and forms.
406
+ */ function MemberTable(props) {
407
+ const { heading, noun, rows, truncated, settled, figures } = props;
408
+ const columns = useMemo(()=>[
409
+ {
410
+ field: 'name',
411
+ headerName: 'Name',
412
+ flex: 1,
413
+ minWidth: 240,
414
+ renderCell: ({ row })=>{
415
+ var _row_campaigns, _row_campaigns1, _row_campaigns2;
416
+ return /*#__PURE__*/ _jsxs(Stack, {
417
+ sx: {
418
+ py: 1,
419
+ minWidth: 0
420
+ },
421
+ children: [
422
+ row.href ? /*#__PURE__*/ _jsx(AppLink, {
423
+ href: row.href,
424
+ children: row.name
425
+ }) : /*#__PURE__*/ _jsxs(_Fragment, {
426
+ children: [
427
+ /*#__PURE__*/ _jsx(Typography, {
428
+ variant: "body2",
429
+ children: row.name
430
+ }),
431
+ /*#__PURE__*/ _jsx(Typography, {
432
+ variant: "caption",
433
+ color: "text.secondary",
434
+ children: row.hrefReason
435
+ })
436
+ ]
437
+ }),
438
+ ((_row_campaigns = row.campaigns) != null ? _row_campaigns : 1) > 1 ? /*#__PURE__*/ _jsx(Typography, {
439
+ variant: "caption",
440
+ color: "text.secondary",
441
+ children: `Also in ${((_row_campaigns1 = row.campaigns) != null ? _row_campaigns1 : 1) - 1} other campaign${((_row_campaigns2 = row.campaigns) != null ? _row_campaigns2 : 1) - 1 === 1 ? '' : 's'}`
442
+ }) : null
443
+ ]
444
+ });
445
+ }
446
+ },
447
+ ...figures ? MEMBER_FIGURES.map(([figure, headerName])=>({
448
+ field: figure,
449
+ headerName,
450
+ type: 'number',
451
+ align: 'right',
452
+ headerAlign: 'right',
453
+ width: 120,
454
+ valueGetter: (_value, row)=>{
455
+ var _ref;
456
+ var _row_totals;
457
+ return (_ref = (_row_totals = row.totals) == null ? void 0 : _row_totals[figure]) != null ? _ref : null;
458
+ },
459
+ renderCell: ({ row })=>{
460
+ var _row_totals;
461
+ return statCell((_row_totals = row.totals) == null ? void 0 : _row_totals[figure]);
462
+ }
463
+ })) : []
464
+ ], [
465
+ figures
466
+ ]);
467
+ return /*#__PURE__*/ _jsxs(Stack, {
468
+ spacing: 0.5,
469
+ children: [
470
+ /*#__PURE__*/ _jsx(Typography, {
471
+ variant: "overline",
472
+ color: "text.secondary",
473
+ children: heading
474
+ }),
475
+ truncated ? /*#__PURE__*/ _jsx(Alert, {
476
+ severity: "info",
477
+ children: `More than ${MEMBER_CEILING} ${noun}s are in this campaign. The ` + `first ${MEMBER_CEILING} are listed, in document order.`
478
+ }) : null,
479
+ rows.length ? /*#__PURE__*/ _jsx(ListTable, {
480
+ "aria-label": heading,
481
+ rows: rows,
482
+ columns: columns,
483
+ getRowId: (row)=>row.id,
484
+ rowHeight: TABLE_ROW_HEIGHT,
485
+ // A member's name carries why it has no link, and the other
486
+ // campaigns it is in, beneath it.
487
+ getRowHeight: ()=>'auto'
488
+ }) : /*#__PURE__*/ _jsx(Typography, {
489
+ variant: "body2",
490
+ color: "text.secondary",
491
+ children: settled ? `No ${noun} is in this campaign. Open a ${noun} and pick this ` + 'campaign on its own page to put it in one.' : `Reading this campaign’s ${noun}s…`
492
+ })
493
+ ]
494
+ });
495
+ }
496
+ CampaignMembersSection.displayName = 'CampaignMembersSection';
497
+ export default CampaignMembersSection;
498
+
499
+ //# sourceMappingURL=campaign-members-section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/marketing/src/lib/components/campaign-members-section.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { AppLink } from '@aglyn/shared-ui-jsx'\nimport {\n Figure,\n Section,\n} from '@aglyn/shared-ui-email-campaigns/components/report-figures'\nimport { ListTable } from '@aglyn/shared-ui-jsx/components/list-table.component'\nimport { TABLE_ROW_HEIGHT } from '@aglyn/shared-ui-jsx/const/table-pagination'\nimport {\n buildRoute,\n CAMPAIGN_MEMBERSHIP_FIELD,\n readCampaignIds,\n Route,\n type FormStats,\n type FormStatsTotals,\n} from '@aglyn/aglyn'\nimport { Alert, Stack, Typography } from '@mui/material'\nimport type { GridColDef } from '@mui/x-data-grid'\nimport {\n collection,\n documentId,\n limit,\n orderBy,\n query,\n where,\n} from 'firebase/firestore'\nimport { useMemo } from 'react'\nimport {\n useConsoleHostRoute,\n useFirestore,\n useFirestoreCollection,\n} from '@aglyn/tenant-feature-instance'\nimport {\n campaignFormsRollup,\n campaignFormTotals,\n campaignPeriodRange,\n isWindowedRange,\n type CampaignFormsRollup,\n} from '../model/campaign-membership-figures'\n\n/**\n * How many members of one kind the section enumerates.\n *\n * One document past it is asked for, so \"this campaign holds more than are\n * listed\" is a fact rather than a guess — the same probe the emails table on\n * this page makes.\n */\nconst MEMBER_CEILING = 25\n\nexport interface CampaignMembersSectionProps {\n hostId: string\n campaignId: string\n /** The campaign's first day, when it has one. */\n startAtMs?: number | null\n /** The campaign's last day, when it has one. */\n endAtMs?: number | null\n}\n\n/**\n * The rows a reader may act on: the window, minus what has been deleted.\n *\n * The soft delete is filtered HERE and not in the query. `deletedAt` is\n * written only when a record is removed, so `where('deletedAt', '==', null)`\n * would match nothing at all — Firestore's equality matches documents that\n * HAVE the field — and every live record would vanish from the campaign. The\n * campaigns table filters its own soft-deleted containers the same way.\n */\nfunction live(\n docs: Array<Record<string, unknown>> | undefined,\n): Array<Record<string, unknown>> {\n return (docs ?? [])\n .slice(0, MEMBER_CEILING)\n .filter((row) => !row['deletedAt'])\n}\n\n/** One row, whatever collection it came out of. */\ninterface MemberRow {\n id: string\n name: string\n href: string | null\n /** Why there is no link, when there is none. */\n hrefReason?: string\n /** The member's own counters, for a kind that carries them. */\n totals?: FormStatsTotals\n /** Campaigns the member is filed under, this one included. */\n campaigns?: number\n}\n\n/**\n * WHAT ELSE IS IN THIS CAMPAIGN — the landing pages and forms assigned to it,\n * and what those forms have collected.\n *\n * ## Declared, and therefore different from every section above it\n *\n * The conversions, revenue and destinations sections are EVIDENCE: they join\n * on the campaign's send ids and report what visitors did BECAUSE of this\n * campaign's mail. This one is a statement the merchant made — a screen or a\n * form carries this campaign's id in {@link CAMPAIGN_MEMBERSHIP_FIELD} — plus\n * the counters those records carry on their own documents.\n *\n * The distinction survives into the wording, because the arithmetic will not\n * enforce it. A form's submissions are the form's; filing the form under a\n * campaign does not make them the campaign's, and a heading that said\n * \"this campaign produced 40 leads\" over a number meaning \"the forms filed\n * here have 40 leads\" would be a worse page than one showing nothing. So the\n * figures are labeled as what the forms HOLD, they sit in their own block\n * under their own disclaimer, and no total on this page adds them to an\n * attributed one.\n *\n * ## Three ways the forms' counters could mislead, each answered\n *\n * 1. **They are lifetime.** `stats.submissions` has counted since the form\n * existed, including every submission from before anybody filed it here.\n * Where the campaign carries dates, the figures are summed from the\n * monthly `stats.periods` series over those months instead, and the\n * caption says which of the two a reader is looking at. Months are whole,\n * so a campaign starting mid-month includes that month entire — stated,\n * not rounded away.\n * 2. **A form can be in twenty campaigns.** `campaignIds` is an array, so\n * the same submissions count toward every campaign the form is filed\n * under. Rows say so and the total refuses to present itself as\n * exclusive.\n * 3. **A counter nobody wrote is not a zero.** `stats.leads` is incremented\n * only for a form whose `routing.lead` is set, and `stats.views` only by\n * the analytics beacon. Both reach the shared `Figure`, which draws an em\n * dash and the words \"not recorded\" rather than a confident 0.\n *\n * ## Screens carry no counter, and this section will not invent one\n *\n * A form's counters ride on the form document, so the query this section\n * already makes pays for them. A screen's traffic does not: it is one\n * document per screen per day in `hosts/{hostId}/screenAnalytics`, with no\n * lifetime total anywhere, so a views column here would cost a range read\n * across screens times days on every open of this page — and the display of\n * those figures is a paid entitlement this section does not resolve. The\n * screens block names the absence and links to the surface that does measure\n * it, which is a smaller lie than a number nobody can stand behind.\n *\n * ## The join is `array-contains`, on the member's own document\n *\n * A campaign holds no member list. Each record names the campaigns it is in,\n * which is what makes deleting one record leave nothing behind and what lets\n * a record's own page draw its campaigns without a query. The query here is\n * the other direction of the same field, served by Firestore's automatic\n * single-field index.\n *\n * `orderBy(documentId())`, like every other bounded list in this console: a\n * form carries `updatedAt` only if some writer stamped one, and ordering on a\n * field a writer may omit does not mis-sort the list, it drops rows from it.\n *\n * ## Contacts are named here and NOT listed, and the reason is a query limit\n *\n * A contact is org-scoped and shared between the sites that captured it, so\n * every client read of the collection has to carry\n * `visibleTo array-contains-any` — that is what makes the read provable\n * per-document under the rules. Firestore permits ONE array clause per query,\n * and that is it: there is no client query that filters contacts by campaign\n * as well, so there is no pre-filtered address to link to either. The link\n * offered goes to the Contacts page and says it arrives unfiltered; the\n * assignment is real, is set from the contact's own drawer, and a count of it\n * would cost a scan of the collection the customer is billed on.\n */\nexport function CampaignMembersSection(props: CampaignMembersSectionProps) {\n const { hostId, campaignId, startAtMs, endAtMs } = props\n const firestore = useFirestore()\n const { orgSlug, subdomain: host } = useConsoleHostRoute(hostId)\n\n const memberQuery = (collectionName: string) => () =>\n query(\n collection(firestore, 'hosts', hostId, collectionName),\n where(CAMPAIGN_MEMBERSHIP_FIELD, 'array-contains', campaignId),\n orderBy(documentId()),\n limit(MEMBER_CEILING + 1),\n )\n\n const { data: screenDocs, status: screensStatus } = useFirestoreCollection<\n Record<string, unknown>\n >(memberQuery('screens'), [firestore, hostId, campaignId], {\n idField: '$id',\n })\n const { data: formDocs, status: formsStatus } = useFirestoreCollection<\n Record<string, unknown>\n >(memberQuery('forms'), [firestore, hostId, campaignId], { idField: '$id' })\n\n /*\n * The months the campaign's dates cover, or nothing where it has neither.\n * Derived from props the detail card already holds, so asking what a\n * figure covers costs no read.\n */\n const range = useMemo(\n () => campaignPeriodRange({ startAtMs, endAtMs }),\n [startAtMs, endAtMs],\n )\n const windowed = isWindowedRange(range)\n\n const screens = useMemo<MemberRow[]>(() => {\n return live(screenDocs).map((row) => {\n const id = String(row['$id'])\n const versionId = String(row['versionId'] ?? '')\n return {\n id,\n name: String(row['displayName'] ?? id),\n /*\n * A screen with no saved version has no detail address to build —\n * the route carries a version — so it stays plain text rather than\n * linking somewhere that 404s. The screens list applies the same\n * guard to its own name column.\n */\n href:\n versionId && orgSlug && host\n ? buildRoute(Route.SCREEN_DETAILS, {\n orgSlug,\n host,\n screenId: id,\n versionId,\n })\n : null,\n hrefReason: versionId\n ? 'This site’s console URL has not resolved yet'\n : 'This screen has no saved version yet',\n campaigns: readCampaignIds(row).length,\n }\n })\n }, [screenDocs, orgSlug, host])\n\n /*\n * The counters ride on the documents the membership query already returned,\n * so every figure below is paid for by a read this section was making\n * anyway. Nothing here opens a second listener.\n */\n const forms = useMemo<MemberRow[]>(() => {\n return live(formDocs).map((row) => {\n const id = String(row['$id'])\n return {\n id,\n name: String(row['displayName'] ?? id),\n href:\n orgSlug && host\n ? buildRoute(Route.FORM_DETAILS, { orgSlug, host, formId: id })\n : null,\n hrefReason: 'This site’s console URL has not resolved yet',\n totals: campaignFormTotals(row['stats'] as FormStats | undefined, range),\n campaigns: readCampaignIds(row).length,\n }\n })\n }, [formDocs, orgSlug, host, range])\n\n const rollup = useMemo(\n () =>\n campaignFormsRollup(\n forms.map((row) => ({\n totals: row.totals as FormStatsTotals,\n campaigns: row.campaigns ?? 1,\n })),\n ),\n [forms],\n )\n\n const screensTruncated = (screenDocs ?? []).length > MEMBER_CEILING\n const formsTruncated = (formDocs ?? []).length > MEMBER_CEILING\n const settled = screensStatus !== 'loading' && formsStatus !== 'loading'\n\n const analyticsHref =\n orgSlug && host\n ? buildRoute(Route.HOST_ANALYTICS, { orgSlug, host })\n : null\n const contactsHref =\n orgSlug && host ? buildRoute(Route.HOST_CONTACTS, { orgSlug, host }) : null\n\n return (\n <Section title=\"Assigned to this campaign\">\n <Stack spacing={2}>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'The pages and forms somebody put in this campaign. Assignment is ' +\n 'a grouping — what the campaign was credited with is measured ' +\n 'above, from the links its emails carried.'}\n </Typography>\n <MemberTable\n heading=\"Screens\"\n noun=\"screen\"\n rows={screens}\n truncated={screensTruncated}\n settled={settled}\n />\n {/*\n The absence, named where a reader would look for the number.\n\n A screen's traffic is not on the screen document — it is a day doc\n per screen in `screenAnalytics` — so a views column here would be a\n read across screens times days on every open, for figures whose\n display is a paid entitlement this section does not resolve. The\n page that does both is linked instead.\n */}\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'Page views are not shown here. A screen keeps no running total ' +\n 'on its own record — traffic is stored a day at a time — so ' +\n 'counting it would be a fresh read of the site’s history every ' +\n 'time this page opens. '}\n {analyticsHref ? (\n <AppLink href={analyticsHref}>\n {'The site’s analytics measures it by screen.'}\n </AppLink>\n ) : (\n 'The site’s analytics page measures it by screen.'\n )}\n </Typography>\n <MemberTable\n heading=\"Forms\"\n noun=\"form\"\n rows={forms}\n truncated={formsTruncated}\n settled={settled}\n figures\n />\n {/*\n THE MEMBERSHIP TOTAL, fenced off from the attributed ones above.\n\n Same `Figure` primitive as the mail rollup, deliberately different\n words: it says what the forms HOLD, and the caption beneath refuses\n the reading a merchant will reach for first.\n */}\n {forms.length ? (\n <FormsHoldings\n rollup={rollup}\n windowed={windowed}\n from={range.from ?? null}\n to={range.to ?? null}\n />\n ) : null}\n {/*\n The people, named rather than omitted.\n\n A contact CAN be filed under a campaign and this page cannot list\n them — see the module comment for the query rule that decides it.\n Leaving the heading out entirely would read as \"contacts cannot be\n assigned\", which is the one thing it does not mean.\n */}\n <Stack spacing={0.5}>\n <Typography variant=\"overline\" color=\"text.secondary\">\n {'Contacts'}\n </Typography>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Contacts are filed under a campaign from the contact’s own ' +\n 'panel on the Contacts page. They are not listed or counted ' +\n 'here: a contact belongs to the organization rather than to ' +\n 'this site, so the query that reads them is already spending ' +\n 'its one array filter on which sites may see the person. '}\n {contactsHref ? (\n <AppLink href={contactsHref}>{'Open Contacts'}</AppLink>\n ) : null}\n {contactsHref\n ? ' — it opens unfiltered, because that same rule leaves no ' +\n 'campaign filter for the address to carry.'\n : ''}\n </Typography>\n </Stack>\n </Stack>\n </Section>\n )\n}\n\n/**\n * What the campaign's forms have collected — and what that is NOT.\n *\n * Two sentences do the whole job of keeping this apart from the attributed\n * figures, and both are load-bearing:\n *\n * - The first refuses causation outright. A merchant reading a number under\n * a campaign's heading will assume the campaign caused it unless told\n * otherwise in the same breath.\n * - The second says which months the number covers. A lifetime total under a\n * campaign that ran for six weeks is the same lie one step quieter.\n *\n * `shared` is stated as a count rather than folded into the arithmetic. There\n * is no honest way to divide a submission between two campaigns a form is\n * filed under, so the total is left whole and the overlap is disclosed.\n */\nfunction FormsHoldings(props: {\n rollup: CampaignFormsRollup\n windowed: boolean\n from: string | null\n to: string | null\n}) {\n const { rollup, windowed, from, to } = props\n const note = (recorded: number) =>\n recorded < rollup.members\n ? `across ${recorded} of ${rollup.members} forms`\n : `across ${rollup.members} form${rollup.members === 1 ? '' : 's'}`\n const span = windowed\n ? `the campaign’s months (${from ?? 'the first month recorded'} to ${\n to ?? 'now'\n })`\n : 'each form’s whole history'\n return (\n <Stack spacing={1}>\n <Typography variant=\"overline\" color=\"text.secondary\">\n {'What these forms hold'}\n </Typography>\n <Stack direction=\"row\" spacing={3} sx={{ flexWrap: 'wrap' }}>\n <Figure\n label=\"Views\"\n value={rollup.views.value}\n note={note(rollup.views.recorded)}\n />\n <Figure\n label=\"Started\"\n value={rollup.starts.value}\n note={note(rollup.starts.recorded)}\n />\n <Figure\n label=\"Submissions\"\n value={rollup.submissions.value}\n note={note(rollup.submissions.recorded)}\n />\n <Figure\n label=\"Leads\"\n value={rollup.leads.value}\n note={note(rollup.leads.recorded)}\n />\n </Stack>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'These are the forms’ own counters, not this campaign’s results. ' +\n 'A submission is counted here because somebody filed the form ' +\n 'under this campaign, whether or not this campaign’s mail sent ' +\n `the visitor. Counted over ${span}.`}\n </Typography>\n {windowed ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'Whole calendar months: a campaign that started or ended mid-' +\n 'month takes that month entire, and a form counting nothing in ' +\n 'those months adds nothing here even where its lifetime total ' +\n 'is large.'}\n </Typography>\n ) : (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'This campaign has no dates, so nothing narrows the figures to ' +\n 'it. They are lifetime totals and include everything from ' +\n 'before the forms were put in this campaign. Give the campaign ' +\n 'a start and an end to count only its months.'}\n </Typography>\n )}\n {rollup.shared ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`${rollup.shared} of these ${rollup.members} forms ${\n rollup.shared === 1 ? 'is' : 'are'\n } filed under another campaign too, so the same submissions are ` +\n 'counted there as well. This total is not exclusive to this ' +\n 'campaign.'}\n </Typography>\n ) : null}\n </Stack>\n )\n}\nFormsHoldings.displayName = 'FormsHoldings'\n\n/** A counter as a cell: an em dash where nothing was recorded, never a zero. */\nfunction statCell(value: number | null | undefined) {\n return value === null || value === undefined ? '—' : value.toLocaleString()\n}\n\n/** The counters a form carries on its own document, in the order they are read. */\nconst MEMBER_FIGURES = [\n ['views', 'Views'],\n ['starts', 'Started'],\n ['submissions', 'Submissions'],\n ['leads', 'Leads'],\n] as const\n\n/**\n * One kind's members, as a record list in the shared grid.\n *\n * The rows are a window this component already holds — the same arrangement\n * the campaign's emails list beside it uses, and for the same reason: the\n * ceiling bounds the read, and the grid's footer lets a reader walk what came\n * back without the card deciding how many rows fit.\n *\n * `figures` adds the counter columns for a kind that carries them on its own\n * document. It is a prop rather than two lists because the row grammar — the\n * name cell, the reason a member has no link, the footer — is the part that\n * has to stay identical between screens and forms.\n */\nfunction MemberTable(props: {\n heading: string\n noun: string\n rows: MemberRow[]\n truncated: boolean\n settled: boolean\n figures?: boolean\n}) {\n const { heading, noun, rows, truncated, settled, figures } = props\n const columns = useMemo<GridColDef<MemberRow>[]>(\n () => [\n {\n field: 'name',\n headerName: 'Name',\n flex: 1,\n minWidth: 240,\n renderCell: ({ row }) => (\n <Stack sx={{ py: 1, minWidth: 0 }}>\n {row.href ? (\n <AppLink href={row.href}>{row.name}</AppLink>\n ) : (\n <>\n <Typography variant=\"body2\">{row.name}</Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {row.hrefReason}\n </Typography>\n </>\n )}\n {/*\n The overlap, on the row that causes it. A reader comparing two\n campaigns has to be able to see which rows they have in common\n without opening either.\n */}\n {(row.campaigns ?? 1) > 1 ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`Also in ${(row.campaigns ?? 1) - 1} other campaign${\n (row.campaigns ?? 1) - 1 === 1 ? '' : 's'\n }`}\n </Typography>\n ) : null}\n </Stack>\n ),\n },\n ...(figures\n ? MEMBER_FIGURES.map(\n ([figure, headerName]): GridColDef<MemberRow> => ({\n field: figure,\n headerName,\n type: 'number',\n align: 'right',\n headerAlign: 'right',\n width: 120,\n valueGetter: (_value, row) => row.totals?.[figure] ?? null,\n renderCell: ({ row }) => statCell(row.totals?.[figure]),\n }),\n )\n : []),\n ],\n [figures],\n )\n return (\n <Stack spacing={0.5}>\n <Typography variant=\"overline\" color=\"text.secondary\">\n {heading}\n </Typography>\n {truncated ? (\n <Alert severity=\"info\">\n {`More than ${MEMBER_CEILING} ${noun}s are in this campaign. The ` +\n `first ${MEMBER_CEILING} are listed, in document order.`}\n </Alert>\n ) : null}\n {rows.length ? (\n <ListTable\n aria-label={heading}\n rows={rows}\n columns={columns}\n getRowId={(row: MemberRow) => row.id}\n rowHeight={TABLE_ROW_HEIGHT}\n // A member's name carries why it has no link, and the other\n // campaigns it is in, beneath it.\n getRowHeight={() => 'auto'}\n />\n ) : (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {settled\n ? `No ${noun} is in this campaign. Open a ${noun} and pick this ` +\n 'campaign on its own page to put it in one.'\n : `Reading this campaign’s ${noun}s…`}\n </Typography>\n )}\n </Stack>\n )\n}\n\nCampaignMembersSection.displayName = 'CampaignMembersSection'\n\nexport default CampaignMembersSection\n"],"names":["AppLink","Figure","Section","ListTable","TABLE_ROW_HEIGHT","buildRoute","CAMPAIGN_MEMBERSHIP_FIELD","readCampaignIds","Route","Alert","Stack","Typography","collection","documentId","limit","orderBy","query","where","useMemo","useConsoleHostRoute","useFirestore","useFirestoreCollection","campaignFormsRollup","campaignFormTotals","campaignPeriodRange","isWindowedRange","MEMBER_CEILING","live","docs","slice","filter","row","CampaignMembersSection","props","range","hostId","campaignId","startAtMs","endAtMs","firestore","orgSlug","subdomain","host","memberQuery","collectionName","data","screenDocs","status","screensStatus","idField","formDocs","formsStatus","windowed","screens","map","id","String","versionId","name","href","SCREEN_DETAILS","screenId","hrefReason","campaigns","length","forms","FORM_DETAILS","formId","totals","rollup","screensTruncated","formsTruncated","settled","analyticsHref","HOST_ANALYTICS","contactsHref","HOST_CONTACTS","title","spacing","variant","color","MemberTable","heading","noun","rows","truncated","figures","FormsHoldings","from","to","note","recorded","members","span","direction","sx","flexWrap","label","value","views","starts","submissions","leads","shared","displayName","statCell","undefined","toLocaleString","MEMBER_FIGURES","columns","field","headerName","flex","minWidth","renderCell","py","figure","type","align","headerAlign","width","valueGetter","_value","severity","aria-label","getRowId","rowHeight","getRowHeight"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SAASA,OAAO,QAAQ,uBAAsB;AAC9C,SACEC,MAAM,EACNC,OAAO,QACF,6DAA4D;AACnE,SAASC,SAAS,QAAQ,uDAAsD;AAChF,SAASC,gBAAgB,QAAQ,8CAA6C;AAC9E,SACEC,UAAU,EACVC,yBAAyB,EACzBC,eAAe,EACfC,KAAK,QAGA,eAAc;AACrB,SAASC,KAAK,EAAEC,KAAK,EAA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