@burdenoff/microfe-headshotmarketing 2026.1107.2 → 2026.1107.3
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.
- package/dist/generated/wspace-operations.d.ts +360 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +492 -380
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +8498 -352
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +11 -7
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/ReportScheduleDialog.d.ts +26 -0
- package/dist/headshotmarketing/pages/analytics/ReportScheduleDialog.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/analytics/ReportScheduleDialog.js +402 -0
- package/dist/headshotmarketing/pages/analytics/ReportScheduleDialog.js.map +1 -0
- package/dist/headshotmarketing/pages/analytics/ReportsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/analytics/ReportsPage.js +356 -243
- package/dist/headshotmarketing/pages/analytics/ReportsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/reportSchedule.d.ts +66 -0
- package/dist/headshotmarketing/pages/analytics/reportSchedule.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/analytics/reportSchedule.js +131 -0
- package/dist/headshotmarketing/pages/analytics/reportSchedule.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,25 +1,32 @@
|
|
|
1
|
-
import { useHeadshotmarketingCreateSavedReportMutation as e, useHeadshotmarketingDeleteSavedReportMutation as t,
|
|
2
|
-
import { useHeadshotMarketing as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { PageLayout as
|
|
5
|
-
import { Modal as
|
|
6
|
-
import { ConfirmDeleteDialog as
|
|
7
|
-
import { ToastContainer as
|
|
8
|
-
import { QueryStateBoundary as
|
|
1
|
+
import { useHeadshotmarketingCreateSavedReportMutation as e, useHeadshotmarketingDeleteSavedReportMutation as t, useHeadshotmarketingDeleteSavedReportScheduleMutation as n, useHeadshotmarketingSavedReportQuery as r, useHeadshotmarketingSavedReportsQuery as i, useHeadshotmarketingSendSavedReportNowMutation as a, useHeadshotmarketingSetSavedReportScheduleMutation as o, useHeadshotmarketingUpdateSavedReportMutation as s } from "../../../generated/wspace-operations.js";
|
|
2
|
+
import { useHeadshotMarketing as c } from "../../context/HeadshotMarketingContext.js";
|
|
3
|
+
import { cn as l, exportRowsToCsv as u } from "../../utils/helpers.js";
|
|
4
|
+
import { PageLayout as ee } from "../../components/PageLayout.js";
|
|
5
|
+
import { Modal as d } from "../../components/Modal.js";
|
|
6
|
+
import { ConfirmDeleteDialog as te } from "../../components/ConfirmDeleteDialog.js";
|
|
7
|
+
import { ToastContainer as ne } from "../../components/Toast.js";
|
|
8
|
+
import { QueryStateBoundary as re } from "../../components/QueryStateBoundary.js";
|
|
9
9
|
import "../../components/index.js";
|
|
10
|
-
import { analyticsCsvRows as
|
|
11
|
-
import { AnalyticsSourceNotice as
|
|
12
|
-
import { useAnalyticsData as
|
|
13
|
-
import { useToast as
|
|
14
|
-
import { EXECUTIVE_SUMMARY as h, WIDGET_ORDER as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
10
|
+
import { analyticsCsvRows as ie, dateRangeLabel as f, formatWindow as ae, resolveDateWindow as oe } from "./analyticsView.js";
|
|
11
|
+
import { AnalyticsSourceNotice as se, DateRangeControl as p, ReportWidgetView as ce, WIDGET_META as m } from "./analyticsWidgets.js";
|
|
12
|
+
import { useAnalyticsData as le } from "./useAnalyticsData.js";
|
|
13
|
+
import { useToast as ue } from "../../hooks/useToast.js";
|
|
14
|
+
import { EXECUTIVE_SUMMARY as h, WIDGET_ORDER as de, draftFrom as g, reportShareUrl as fe, toReportInput as pe, toggleWidget as me, validateDraft as he } from "./reportDraft.js";
|
|
15
|
+
import { browserTimezone as ge, cadenceBadge as _e, deliveryStatusLabel as ve, deliveryStatusTone as ye, describeSchedule as be, formatInstant as xe, scheduleDraftFrom as Se, toScheduleInput as Ce, validateScheduleDraft as we } from "./reportSchedule.js";
|
|
16
|
+
import { ReportScheduleDialog as Te } from "./ReportScheduleDialog.js";
|
|
17
|
+
import { useMemo as Ee, useState as _ } from "react";
|
|
18
|
+
import { ArrowUpRight as De, BarChart3 as v, CalendarClock as y, DollarSign as b, Download as Oe, FileDown as ke, FileText as Ae, Pencil as je, Plus as Me, Share2 as Ne, Target as x, Trash2 as Pe, TrendingUp as S, Users as C } from "lucide-react";
|
|
19
|
+
import { useSearchParams as Fe } from "react-router";
|
|
20
|
+
import { Fragment as Ie, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
21
|
+
import { EmphasisPanel as E, GradientText as Le, PagePurpose as Re } from "@burdenoff/fe-libs/ui";
|
|
20
22
|
//#region src/headshotmarketing/pages/analytics/ReportsPage.tsx
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
+
var D = ["HeadshotmarketingSavedReports", "HeadshotmarketingSavedReport"], O = [...D, "HeadshotmarketingSavedReportDeliveryRuns"], ze = {
|
|
24
|
+
success: "text-status-success-text",
|
|
25
|
+
warning: "text-status-warning-text",
|
|
26
|
+
error: "text-status-error-text",
|
|
27
|
+
neutral: "text-text-secondary"
|
|
28
|
+
}, k = 100, A = "inline-flex min-h-[40px] items-center gap-2 rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60";
|
|
29
|
+
function Be(e) {
|
|
23
30
|
return {
|
|
24
31
|
name: e.name,
|
|
25
32
|
description: e.description ?? null,
|
|
@@ -29,35 +36,35 @@ function Se(e) {
|
|
|
29
36
|
customEndDate: e.customEndDate ?? null
|
|
30
37
|
};
|
|
31
38
|
}
|
|
32
|
-
var
|
|
39
|
+
var j = (e) => e instanceof Error ? e.message : "Something went wrong.", Ve = ({ open: e, title: t, submitLabel: n, draft: r, onChange: i, errors: a, serverError: o, saving: s, onClose: c, onSubmit: u }) => /* @__PURE__ */ w(d, {
|
|
33
40
|
open: e,
|
|
34
|
-
onClose:
|
|
41
|
+
onClose: c,
|
|
35
42
|
title: t,
|
|
36
43
|
description: "Choose what the report shows and the period it covers.",
|
|
37
44
|
size: "lg",
|
|
38
|
-
footer: /* @__PURE__ */
|
|
45
|
+
footer: /* @__PURE__ */ T(Ie, { children: [/* @__PURE__ */ w("button", {
|
|
39
46
|
type: "button",
|
|
40
|
-
onClick:
|
|
41
|
-
disabled:
|
|
42
|
-
className:
|
|
47
|
+
onClick: c,
|
|
48
|
+
disabled: s,
|
|
49
|
+
className: A,
|
|
43
50
|
children: "Cancel"
|
|
44
|
-
}), /* @__PURE__ */
|
|
51
|
+
}), /* @__PURE__ */ w("button", {
|
|
45
52
|
type: "button",
|
|
46
|
-
onClick:
|
|
47
|
-
disabled:
|
|
53
|
+
onClick: u,
|
|
54
|
+
disabled: s,
|
|
48
55
|
className: "inline-flex min-h-[40px] items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:cursor-not-allowed disabled:opacity-60",
|
|
49
|
-
children:
|
|
56
|
+
children: s ? "Saving…" : n
|
|
50
57
|
})] }),
|
|
51
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ T("div", {
|
|
52
59
|
className: "space-y-5",
|
|
53
60
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ T("div", { children: [
|
|
62
|
+
/* @__PURE__ */ w("label", {
|
|
56
63
|
htmlFor: "hm-report-name",
|
|
57
64
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
58
65
|
children: "Name"
|
|
59
66
|
}),
|
|
60
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ w("input", {
|
|
61
68
|
id: "hm-report-name",
|
|
62
69
|
value: r.name,
|
|
63
70
|
onChange: (e) => i({
|
|
@@ -65,24 +72,24 @@ var N = (e) => e instanceof Error ? e.message : "Something went wrong.", Ce = ({
|
|
|
65
72
|
name: e.target.value
|
|
66
73
|
}),
|
|
67
74
|
"aria-invalid": !!a.name,
|
|
68
|
-
className:
|
|
75
|
+
className: l("min-h-[44px] w-full rounded-md border bg-bg-surface px-3 py-2 text-sm text-text-primary", a.name ? "border-status-error-border" : "border-border-seam"),
|
|
69
76
|
placeholder: "e.g. Weekly Executive Summary"
|
|
70
77
|
}),
|
|
71
|
-
a.name && /* @__PURE__ */
|
|
78
|
+
a.name && /* @__PURE__ */ w("p", {
|
|
72
79
|
className: "mt-1 text-xs text-status-error-text",
|
|
73
80
|
children: a.name
|
|
74
81
|
})
|
|
75
82
|
] }),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ T("div", { children: [
|
|
84
|
+
/* @__PURE__ */ T("label", {
|
|
78
85
|
htmlFor: "hm-report-description",
|
|
79
86
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
80
|
-
children: ["Description ", /* @__PURE__ */
|
|
87
|
+
children: ["Description ", /* @__PURE__ */ w("span", {
|
|
81
88
|
className: "text-text-secondary",
|
|
82
89
|
children: "(optional)"
|
|
83
90
|
})]
|
|
84
91
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ w("textarea", {
|
|
86
93
|
id: "hm-report-description",
|
|
87
94
|
value: r.description,
|
|
88
95
|
onChange: (e) => i({
|
|
@@ -91,19 +98,19 @@ var N = (e) => e instanceof Error ? e.message : "Something went wrong.", Ce = ({
|
|
|
91
98
|
}),
|
|
92
99
|
rows: 2,
|
|
93
100
|
"aria-invalid": !!a.description,
|
|
94
|
-
className:
|
|
101
|
+
className: l("w-full rounded-md border bg-bg-surface px-3 py-2 text-sm text-text-primary", a.description ? "border-status-error-border" : "border-border-seam")
|
|
95
102
|
}),
|
|
96
|
-
a.description && /* @__PURE__ */
|
|
103
|
+
a.description && /* @__PURE__ */ w("p", {
|
|
97
104
|
className: "mt-1 text-xs text-status-error-text",
|
|
98
105
|
children: a.description
|
|
99
106
|
})
|
|
100
107
|
] }),
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ T("div", { children: [
|
|
109
|
+
/* @__PURE__ */ w("p", {
|
|
103
110
|
className: "mb-1 text-sm font-medium text-text-primary",
|
|
104
111
|
children: "Period"
|
|
105
112
|
}),
|
|
106
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ w(p, {
|
|
107
114
|
idPrefix: "hm-report-editor",
|
|
108
115
|
value: {
|
|
109
116
|
preset: r.dateRange,
|
|
@@ -118,36 +125,36 @@ var N = (e) => e instanceof Error ? e.message : "Something went wrong.", Ce = ({
|
|
|
118
125
|
}),
|
|
119
126
|
invalid: !!a.dateRange
|
|
120
127
|
}),
|
|
121
|
-
a.dateRange && /* @__PURE__ */
|
|
128
|
+
a.dateRange && /* @__PURE__ */ w("p", {
|
|
122
129
|
className: "mt-1 text-xs text-status-error-text",
|
|
123
130
|
children: a.dateRange
|
|
124
131
|
})
|
|
125
132
|
] }),
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ T("fieldset", { children: [
|
|
134
|
+
/* @__PURE__ */ w("legend", {
|
|
128
135
|
className: "mb-2 text-sm font-medium text-text-primary",
|
|
129
136
|
children: "Widgets"
|
|
130
137
|
}),
|
|
131
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ w("div", {
|
|
132
139
|
className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
|
|
133
|
-
children:
|
|
140
|
+
children: de.map((e) => {
|
|
134
141
|
let t = m[e], n = r.widgets.includes(e);
|
|
135
|
-
return /* @__PURE__ */
|
|
136
|
-
className:
|
|
137
|
-
children: [/* @__PURE__ */
|
|
142
|
+
return /* @__PURE__ */ T("label", {
|
|
143
|
+
className: l("flex cursor-pointer items-start gap-3 rounded-lg border p-3 transition-colors", n ? "border-action-primary-bg bg-bg-sunken/40" : "border-border-seam hover:bg-bg-sunken/30"),
|
|
144
|
+
children: [/* @__PURE__ */ w("input", {
|
|
138
145
|
type: "checkbox",
|
|
139
146
|
checked: n,
|
|
140
147
|
onChange: () => i({
|
|
141
148
|
...r,
|
|
142
|
-
widgets:
|
|
149
|
+
widgets: me(r.widgets, e)
|
|
143
150
|
}),
|
|
144
151
|
className: "mt-0.5 h-4 w-4"
|
|
145
|
-
}), /* @__PURE__ */
|
|
152
|
+
}), /* @__PURE__ */ T("span", {
|
|
146
153
|
className: "min-w-0",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
154
|
+
children: [/* @__PURE__ */ T("span", {
|
|
148
155
|
className: "flex items-center gap-1.5 text-sm font-medium text-text-primary",
|
|
149
156
|
children: [t.icon, t.label]
|
|
150
|
-
}), /* @__PURE__ */
|
|
157
|
+
}), /* @__PURE__ */ w("span", {
|
|
151
158
|
className: "mt-0.5 block text-xs text-text-secondary",
|
|
152
159
|
children: t.description
|
|
153
160
|
})]
|
|
@@ -155,90 +162,99 @@ var N = (e) => e instanceof Error ? e.message : "Something went wrong.", Ce = ({
|
|
|
155
162
|
}, e);
|
|
156
163
|
})
|
|
157
164
|
}),
|
|
158
|
-
a.widgets && /* @__PURE__ */
|
|
165
|
+
a.widgets && /* @__PURE__ */ w("p", {
|
|
159
166
|
className: "mt-1 text-xs text-status-error-text",
|
|
160
167
|
children: a.widgets
|
|
161
168
|
})
|
|
162
169
|
] }),
|
|
163
|
-
|
|
170
|
+
o && /* @__PURE__ */ w("p", {
|
|
164
171
|
role: "alert",
|
|
165
172
|
className: "rounded-lg border border-status-error-border px-4 py-3 text-sm text-status-error-text",
|
|
166
|
-
children:
|
|
173
|
+
children: o
|
|
167
174
|
})
|
|
168
175
|
]
|
|
169
176
|
})
|
|
170
|
-
}),
|
|
177
|
+
}), He = [
|
|
171
178
|
{
|
|
172
179
|
id: "campaigns",
|
|
173
180
|
name: "Campaign performance",
|
|
174
181
|
description: "Revenue, conversions and ROAS by campaign.",
|
|
175
|
-
icon: /* @__PURE__ */
|
|
182
|
+
icon: /* @__PURE__ */ w(x, { className: "h-5 w-5" }),
|
|
176
183
|
segment: "/analytics/campaigns"
|
|
177
184
|
},
|
|
178
185
|
{
|
|
179
186
|
id: "channels",
|
|
180
187
|
name: "Channel analytics",
|
|
181
188
|
description: "Revenue, ROAS and attribution by channel.",
|
|
182
|
-
icon: /* @__PURE__ */
|
|
189
|
+
icon: /* @__PURE__ */ w(v, { className: "h-5 w-5" }),
|
|
183
190
|
segment: "/analytics"
|
|
184
191
|
},
|
|
185
192
|
{
|
|
186
193
|
id: "ads",
|
|
187
194
|
name: "Ad performance",
|
|
188
195
|
description: "Paid spend, CPC and ROAS by platform.",
|
|
189
|
-
icon: /* @__PURE__ */
|
|
196
|
+
icon: /* @__PURE__ */ w(S, { className: "h-5 w-5" }),
|
|
190
197
|
segment: "/analytics/ads"
|
|
191
198
|
},
|
|
192
199
|
{
|
|
193
200
|
id: "social",
|
|
194
201
|
name: "Social digest",
|
|
195
202
|
description: "Reach, engagement and top posts by platform.",
|
|
196
|
-
icon: /* @__PURE__ */
|
|
203
|
+
icon: /* @__PURE__ */ w(Ne, { className: "h-5 w-5" }),
|
|
197
204
|
segment: "/analytics/social"
|
|
198
205
|
},
|
|
199
206
|
{
|
|
200
207
|
id: "attribution",
|
|
201
208
|
name: "Attribution",
|
|
202
209
|
description: "Which touches earned your won revenue.",
|
|
203
|
-
icon: /* @__PURE__ */
|
|
210
|
+
icon: /* @__PURE__ */ w(C, { className: "h-5 w-5" }),
|
|
204
211
|
segment: "/analytics/attribution"
|
|
205
212
|
},
|
|
206
213
|
{
|
|
207
214
|
id: "pipeline",
|
|
208
215
|
name: "Lead pipeline",
|
|
209
216
|
description: "Deals and value across your CRM pipeline.",
|
|
210
|
-
icon: /* @__PURE__ */
|
|
217
|
+
icon: /* @__PURE__ */ w(b, { className: "h-5 w-5" }),
|
|
211
218
|
segment: "/crm/pipeline"
|
|
212
219
|
}
|
|
213
|
-
],
|
|
214
|
-
let { navigate:
|
|
215
|
-
variables: { pagination: { limit:
|
|
220
|
+
], Ue = () => {
|
|
221
|
+
let { navigate: d, basePath: p, workspaceId: de, currentUser: me } = c(), [v, b] = Fe(), x = v.get("report"), { toasts: S, toast: C, dismiss: Ue } = ue(), [M] = _(() => /* @__PURE__ */ new Date()), N = i({
|
|
222
|
+
variables: { pagination: { limit: k } },
|
|
216
223
|
fetchPolicy: "cache-and-network"
|
|
217
|
-
}), [
|
|
218
|
-
variables: { id:
|
|
219
|
-
skip: !
|
|
224
|
+
}), [We, Ge] = _(!1), P = N.data?.headshotmarketingSavedReports.items ?? [], Ke = N.data?.headshotmarketingSavedReports.total, qe = N.data?.headshotmarketingSavedReports.hasMore ?? !1, F = P.find((e) => e.id === x) ?? null, Je = !N.loading && N.data !== void 0, I = x !== null && F === null && Je, L = r({
|
|
225
|
+
variables: { id: x ?? "" },
|
|
226
|
+
skip: !I,
|
|
220
227
|
fetchPolicy: "cache-and-network"
|
|
221
|
-
}),
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
]),
|
|
227
|
-
refetchQueries:
|
|
228
|
+
}), R = F ?? (I ? L.data?.headshotmarketingSavedReport ?? null : null), Ye = I && R === null && !L.loading && (L.data !== void 0 || L.error !== void 0), z = R ? Be(R) : h, B = Ee(() => oe(z.dateRange, M, z.customStartDate, z.customEndDate), [
|
|
229
|
+
z.dateRange,
|
|
230
|
+
z.customStartDate,
|
|
231
|
+
z.customEndDate,
|
|
232
|
+
M
|
|
233
|
+
]), V = B ? ae(B) : "—", H = le(B, 10), [U, W] = _(null), [Xe, Ze] = _(!1), [Qe, G] = _(null), [$e, K] = _(!1), [et, q] = _(null), [J, Y] = _(null), [tt, nt] = _(!1), [rt, X] = _(null), [it, at] = e({
|
|
234
|
+
refetchQueries: D,
|
|
235
|
+
awaitRefetchQueries: !0
|
|
236
|
+
}), [ot, st] = s({
|
|
237
|
+
refetchQueries: D,
|
|
238
|
+
awaitRefetchQueries: !0
|
|
239
|
+
}), [ct, lt] = t({
|
|
240
|
+
refetchQueries: D,
|
|
241
|
+
awaitRefetchQueries: !0
|
|
242
|
+
}), [ut, dt] = o({
|
|
243
|
+
refetchQueries: O,
|
|
228
244
|
awaitRefetchQueries: !0
|
|
229
|
-
}), [
|
|
230
|
-
refetchQueries:
|
|
245
|
+
}), [ft, pt] = n({
|
|
246
|
+
refetchQueries: O,
|
|
231
247
|
awaitRefetchQueries: !0
|
|
232
|
-
}), [
|
|
233
|
-
refetchQueries:
|
|
248
|
+
}), [mt, ht] = a({
|
|
249
|
+
refetchQueries: O,
|
|
234
250
|
awaitRefetchQueries: !0
|
|
235
|
-
}),
|
|
236
|
-
|
|
251
|
+
}), gt = async () => {
|
|
252
|
+
Ge(!0);
|
|
237
253
|
try {
|
|
238
|
-
await
|
|
254
|
+
await N.fetchMore({
|
|
239
255
|
variables: { pagination: {
|
|
240
|
-
limit:
|
|
241
|
-
offset:
|
|
256
|
+
limit: k,
|
|
257
|
+
offset: P.length
|
|
242
258
|
} },
|
|
243
259
|
updateQuery: (e, { fetchMoreResult: t }) => {
|
|
244
260
|
let n = new Set(e.headshotmarketingSavedReports.items.map((e) => e.id));
|
|
@@ -254,58 +270,106 @@ var N = (e) => e instanceof Error ? e.message : "Something went wrong.", Ce = ({
|
|
|
254
270
|
} catch (e) {
|
|
255
271
|
C({
|
|
256
272
|
title: "More reports could not be loaded",
|
|
257
|
-
description:
|
|
273
|
+
description: j(e),
|
|
258
274
|
variant: "error"
|
|
259
275
|
});
|
|
260
276
|
} finally {
|
|
261
|
-
|
|
277
|
+
Ge(!1);
|
|
262
278
|
}
|
|
263
|
-
},
|
|
264
|
-
let t = new URLSearchParams(
|
|
265
|
-
e ? t.set("report", e) : t.delete("report"),
|
|
266
|
-
},
|
|
267
|
-
|
|
279
|
+
}, Z = (e) => {
|
|
280
|
+
let t = new URLSearchParams(v);
|
|
281
|
+
e ? t.set("report", e) : t.delete("report"), b(t);
|
|
282
|
+
}, Q = (e, t) => {
|
|
283
|
+
Ze(!1), G(null), W({
|
|
268
284
|
reportId: e,
|
|
269
285
|
draft: t
|
|
270
286
|
});
|
|
271
|
-
},
|
|
272
|
-
if (!
|
|
273
|
-
|
|
274
|
-
let e =
|
|
287
|
+
}, _t = U ? he(U.draft, M) : {}, vt = async () => {
|
|
288
|
+
if (!U || (Ze(!0), Object.keys(_t).length > 0)) return;
|
|
289
|
+
G(null);
|
|
290
|
+
let e = pe(U.draft);
|
|
275
291
|
try {
|
|
276
|
-
if (
|
|
277
|
-
id:
|
|
292
|
+
if (U.reportId) await ot({ variables: {
|
|
293
|
+
id: U.reportId,
|
|
278
294
|
input: e
|
|
279
295
|
} }), C({
|
|
280
296
|
title: "Report updated",
|
|
281
297
|
variant: "success"
|
|
282
298
|
});
|
|
283
299
|
else {
|
|
284
|
-
let t = (await
|
|
300
|
+
let t = (await it({ variables: { input: e } })).data?.headshotmarketingCreateSavedReport.id;
|
|
285
301
|
C({
|
|
286
302
|
title: "Report saved",
|
|
287
303
|
variant: "success"
|
|
288
|
-
}), t &&
|
|
304
|
+
}), t && Z(t);
|
|
289
305
|
}
|
|
290
|
-
|
|
306
|
+
W(null);
|
|
291
307
|
} catch (e) {
|
|
292
|
-
|
|
308
|
+
G(j(e));
|
|
293
309
|
}
|
|
294
|
-
},
|
|
295
|
-
if (
|
|
296
|
-
|
|
310
|
+
}, yt = async () => {
|
|
311
|
+
if (R) {
|
|
312
|
+
q(null);
|
|
297
313
|
try {
|
|
298
|
-
await
|
|
314
|
+
await ct({ variables: { id: R.id } }), K(!1), Z(null), C({
|
|
299
315
|
title: "Report deleted",
|
|
300
316
|
variant: "success"
|
|
301
317
|
});
|
|
302
318
|
} catch (e) {
|
|
303
|
-
|
|
319
|
+
q(j(e));
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}, $ = R?.schedule ?? null, bt = J ? we(J) : {}, xt = dt.loading ? "save" : pt.loading ? "remove" : ht.loading ? "send" : null, St = () => {
|
|
323
|
+
R && (nt(!1), X(null), Y(Se($, {
|
|
324
|
+
timezone: ge(),
|
|
325
|
+
recipientUserId: me?.id ?? null
|
|
326
|
+
})));
|
|
327
|
+
}, Ct = async () => {
|
|
328
|
+
if (!(!R || !J) && (nt(!0), !(Object.keys(bt).length > 0))) {
|
|
329
|
+
X(null);
|
|
330
|
+
try {
|
|
331
|
+
await ut({ variables: {
|
|
332
|
+
reportId: R.id,
|
|
333
|
+
input: Ce(J)
|
|
334
|
+
} }), Y(null), C({
|
|
335
|
+
title: J.enabled ? "Schedule saved" : "Schedule paused",
|
|
336
|
+
variant: "success"
|
|
337
|
+
});
|
|
338
|
+
} catch (e) {
|
|
339
|
+
X(j(e));
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}, wt = async () => {
|
|
343
|
+
if (R) {
|
|
344
|
+
X(null);
|
|
345
|
+
try {
|
|
346
|
+
await ft({ variables: { reportId: R.id } }), Y(null), C({
|
|
347
|
+
title: "Schedule removed",
|
|
348
|
+
variant: "success"
|
|
349
|
+
});
|
|
350
|
+
} catch (e) {
|
|
351
|
+
X(j(e));
|
|
304
352
|
}
|
|
305
353
|
}
|
|
306
|
-
},
|
|
307
|
-
if (
|
|
308
|
-
|
|
354
|
+
}, Tt = async () => {
|
|
355
|
+
if (R) {
|
|
356
|
+
X(null);
|
|
357
|
+
try {
|
|
358
|
+
let e = (await mt({ variables: { reportId: R.id } })).data?.headshotmarketingSendSavedReportNow;
|
|
359
|
+
if (!e) return;
|
|
360
|
+
let t = ye(e.status);
|
|
361
|
+
C({
|
|
362
|
+
title: `${ve(e.status)}: ${e.deliveredCount} of ${e.recipientCount} recipients`,
|
|
363
|
+
description: e.error ?? void 0,
|
|
364
|
+
variant: t === "success" ? "success" : t === "error" ? "error" : void 0
|
|
365
|
+
});
|
|
366
|
+
} catch (e) {
|
|
367
|
+
X(j(e));
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}, Et = async () => {
|
|
371
|
+
if (!R) return;
|
|
372
|
+
let e = fe(globalThis.location.href, R.id);
|
|
309
373
|
try {
|
|
310
374
|
await navigator.clipboard.writeText(e), C({
|
|
311
375
|
title: "Link copied",
|
|
@@ -318,71 +382,76 @@ var N = (e) => e instanceof Error ? e.message : "Something went wrong.", Ce = ({
|
|
|
318
382
|
description: e
|
|
319
383
|
});
|
|
320
384
|
}
|
|
321
|
-
},
|
|
322
|
-
let { headers: e, rows: t } =
|
|
323
|
-
title:
|
|
324
|
-
windowLabel:
|
|
325
|
-
view:
|
|
326
|
-
attribution:
|
|
385
|
+
}, Dt = () => {
|
|
386
|
+
let { headers: e, rows: t } = ie({
|
|
387
|
+
title: z.name,
|
|
388
|
+
windowLabel: V,
|
|
389
|
+
view: H.view,
|
|
390
|
+
attribution: H.attribution
|
|
327
391
|
});
|
|
328
|
-
|
|
329
|
-
},
|
|
392
|
+
u(z.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "report", e, t);
|
|
393
|
+
}, Ot = () => {
|
|
330
394
|
let e = document.title;
|
|
331
|
-
document.title = `${
|
|
332
|
-
},
|
|
333
|
-
return /* @__PURE__ */
|
|
395
|
+
document.title = `${z.name} — ${V}`, globalThis.print(), document.title = e;
|
|
396
|
+
}, kt = at.loading || st.loading;
|
|
397
|
+
return /* @__PURE__ */ T(ee, {
|
|
334
398
|
title: "Reports",
|
|
335
399
|
description: "Saved reports you can open, share and export",
|
|
336
|
-
actions: /* @__PURE__ */
|
|
400
|
+
actions: /* @__PURE__ */ T("button", {
|
|
337
401
|
type: "button",
|
|
338
|
-
onClick: () =>
|
|
402
|
+
onClick: () => Q(null, g(h, M, "New report")),
|
|
339
403
|
className: "inline-flex min-h-[44px] items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90",
|
|
340
|
-
children: [/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ w(Me, { className: "h-4 w-4" }), "New Report"]
|
|
341
405
|
}),
|
|
342
406
|
children: [
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ w(Re, { children: "Save the views your team reads every week. A report keeps its widgets and period — for example the last 30 days — and always shows the latest numbers for that period. Share a link with your workspace, export it to CSV or save it as a PDF." }),
|
|
408
|
+
/* @__PURE__ */ T("div", {
|
|
345
409
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-[300px_minmax(0,1fr)]",
|
|
346
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ T("aside", {
|
|
347
411
|
"aria-label": "Reports",
|
|
348
412
|
className: "h-fit rounded-lg border border-border-seam bg-gloss-card p-3 shadow-pop",
|
|
349
413
|
children: [
|
|
350
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ w("h2", {
|
|
351
415
|
className: "px-2 pb-2 pt-1 text-sm font-semibold text-text-secondary",
|
|
352
416
|
children: "Reports"
|
|
353
417
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ T("ul", {
|
|
355
419
|
className: "space-y-1",
|
|
356
|
-
children: [/* @__PURE__ */
|
|
420
|
+
children: [/* @__PURE__ */ w("li", { children: /* @__PURE__ */ T("button", {
|
|
357
421
|
type: "button",
|
|
358
|
-
onClick: () =>
|
|
359
|
-
"aria-current":
|
|
360
|
-
className:
|
|
361
|
-
children: [/* @__PURE__ */
|
|
422
|
+
onClick: () => Z(null),
|
|
423
|
+
"aria-current": R === null ? "true" : void 0,
|
|
424
|
+
className: l("w-full rounded-md px-3 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", R === null ? "bg-bg-sunken" : "hover:bg-bg-sunken/50"),
|
|
425
|
+
children: [/* @__PURE__ */ w("span", {
|
|
362
426
|
className: "block text-sm font-medium text-text-primary",
|
|
363
427
|
children: h.name
|
|
364
|
-
}), /* @__PURE__ */
|
|
428
|
+
}), /* @__PURE__ */ T("span", {
|
|
365
429
|
className: "mt-1 inline-flex items-center gap-2 text-xs text-text-secondary",
|
|
366
|
-
children: [/* @__PURE__ */
|
|
430
|
+
children: [/* @__PURE__ */ w("span", {
|
|
367
431
|
className: "rounded bg-action-primary-bg px-1.5 py-0.5 text-action-primary-text",
|
|
368
432
|
children: "Built-in"
|
|
369
433
|
}), f(h.dateRange)]
|
|
370
434
|
})]
|
|
371
|
-
}) }),
|
|
435
|
+
}) }), P.map((e) => /* @__PURE__ */ w("li", { children: /* @__PURE__ */ T("button", {
|
|
372
436
|
type: "button",
|
|
373
|
-
onClick: () =>
|
|
374
|
-
"aria-current":
|
|
375
|
-
className:
|
|
376
|
-
children: [/* @__PURE__ */
|
|
437
|
+
onClick: () => Z(e.id),
|
|
438
|
+
"aria-current": R?.id === e.id ? "true" : void 0,
|
|
439
|
+
className: l("w-full rounded-md px-3 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", R?.id === e.id ? "bg-bg-sunken" : "hover:bg-bg-sunken/50"),
|
|
440
|
+
children: [/* @__PURE__ */ w("span", {
|
|
377
441
|
className: "block truncate text-sm font-medium text-text-primary",
|
|
378
442
|
children: e.name
|
|
379
|
-
}), /* @__PURE__ */
|
|
443
|
+
}), /* @__PURE__ */ T("span", {
|
|
380
444
|
className: "mt-1 inline-flex flex-wrap items-center gap-2 text-xs text-text-secondary",
|
|
381
445
|
children: [
|
|
382
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ w("span", {
|
|
383
447
|
className: "rounded border border-border-seam px-1.5 py-0.5",
|
|
384
448
|
children: f(e.dateRange)
|
|
385
449
|
}),
|
|
450
|
+
e.schedule && /* @__PURE__ */ T("span", {
|
|
451
|
+
className: "inline-flex items-center gap-1 rounded bg-bg-sunken px-1.5 py-0.5 text-text-primary",
|
|
452
|
+
title: be(e.schedule),
|
|
453
|
+
children: [/* @__PURE__ */ w(y, { className: "h-3 w-3" }), _e(e.schedule)]
|
|
454
|
+
}),
|
|
386
455
|
"Updated",
|
|
387
456
|
" ",
|
|
388
457
|
new Date(e.updatedAt).toLocaleDateString("en-US", {
|
|
@@ -393,182 +462,226 @@ var N = (e) => e instanceof Error ? e.message : "Something went wrong.", Ce = ({
|
|
|
393
462
|
})]
|
|
394
463
|
}) }, e.id))]
|
|
395
464
|
}),
|
|
396
|
-
|
|
465
|
+
qe && /* @__PURE__ */ T("button", {
|
|
397
466
|
type: "button",
|
|
398
|
-
onClick: () => void
|
|
399
|
-
disabled:
|
|
467
|
+
onClick: () => void gt(),
|
|
468
|
+
disabled: We,
|
|
400
469
|
className: "mt-2 w-full rounded-md px-3 py-2 text-left text-xs font-medium text-text-secondary transition-colors hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-50",
|
|
401
|
-
children: ["Show more reports",
|
|
470
|
+
children: ["Show more reports", Ke === void 0 ? "" : ` (${P.length} of ${Ke})`]
|
|
402
471
|
}),
|
|
403
|
-
|
|
472
|
+
N.error && /* @__PURE__ */ T("p", {
|
|
404
473
|
className: "px-2 pt-2 text-xs text-status-error-text",
|
|
405
|
-
children: ["Saved reports could not be loaded: ",
|
|
474
|
+
children: ["Saved reports could not be loaded: ", N.error.message]
|
|
406
475
|
}),
|
|
407
|
-
!
|
|
476
|
+
!N.error && N.data && P.length === 0 && /* @__PURE__ */ w("p", {
|
|
408
477
|
className: "px-2 pt-2 text-xs text-text-secondary",
|
|
409
478
|
children: "No saved reports yet. Use New Report, or save the Executive Summary as your own."
|
|
410
479
|
})
|
|
411
480
|
]
|
|
412
|
-
}), /* @__PURE__ */
|
|
481
|
+
}), /* @__PURE__ */ T("section", {
|
|
413
482
|
"aria-label": "Report",
|
|
414
483
|
className: "min-w-0 space-y-6",
|
|
415
484
|
children: [
|
|
416
|
-
|
|
485
|
+
Ye && /* @__PURE__ */ w("p", {
|
|
417
486
|
role: "status",
|
|
418
487
|
className: "rounded-lg border border-border-seam px-4 py-3 text-sm text-text-secondary",
|
|
419
488
|
children: "That report no longer exists or is not in this workspace. Showing the Executive Summary instead."
|
|
420
489
|
}),
|
|
421
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ w(E, { children: /* @__PURE__ */ T("div", {
|
|
422
491
|
className: "flex flex-col gap-4 xl:flex-row xl:items-start xl:justify-between",
|
|
423
|
-
children: [/* @__PURE__ */
|
|
492
|
+
children: [/* @__PURE__ */ T("div", {
|
|
424
493
|
className: "min-w-0",
|
|
425
494
|
children: [
|
|
426
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ w("h2", {
|
|
427
496
|
className: "text-xl font-bold tracking-tight",
|
|
428
|
-
children: /* @__PURE__ */
|
|
497
|
+
children: /* @__PURE__ */ w(Le, { children: z.name })
|
|
429
498
|
}),
|
|
430
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ T("p", {
|
|
431
500
|
className: "mt-0.5 text-sm text-text-secondary",
|
|
432
|
-
children: [f(
|
|
501
|
+
children: [f(z.dateRange), B ? ` · ${V}` : ""]
|
|
433
502
|
}),
|
|
434
|
-
|
|
503
|
+
z.description && /* @__PURE__ */ w("p", {
|
|
435
504
|
className: "mt-1 text-sm text-text-secondary",
|
|
436
|
-
children:
|
|
505
|
+
children: z.description
|
|
506
|
+
}),
|
|
507
|
+
$ && /* @__PURE__ */ T("p", {
|
|
508
|
+
className: "mt-1 inline-flex flex-wrap items-center gap-x-1.5 text-xs text-text-secondary",
|
|
509
|
+
"data-testid": "report-schedule-summary",
|
|
510
|
+
children: [
|
|
511
|
+
/* @__PURE__ */ w(y, { className: "h-3.5 w-3.5" }),
|
|
512
|
+
$.enabled ? `${be($)} · next ${xe($.nextRunAt)}` : "Delivery paused",
|
|
513
|
+
$.lastRunStatus && /* @__PURE__ */ T("span", { children: [
|
|
514
|
+
"· last delivery",
|
|
515
|
+
" ",
|
|
516
|
+
/* @__PURE__ */ w("span", {
|
|
517
|
+
className: ze[ye($.lastRunStatus)],
|
|
518
|
+
title: $.lastRunError ?? void 0,
|
|
519
|
+
children: ve($.lastRunStatus)
|
|
520
|
+
}),
|
|
521
|
+
" ",
|
|
522
|
+
xe($.lastRunAt)
|
|
523
|
+
] })
|
|
524
|
+
]
|
|
437
525
|
})
|
|
438
526
|
]
|
|
439
|
-
}), /* @__PURE__ */
|
|
527
|
+
}), /* @__PURE__ */ T("div", {
|
|
440
528
|
className: "flex flex-wrap items-center gap-2",
|
|
441
529
|
children: [
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
530
|
+
R ? /* @__PURE__ */ T(Ie, { children: [
|
|
531
|
+
/* @__PURE__ */ T("button", {
|
|
532
|
+
type: "button",
|
|
533
|
+
onClick: () => Q(R.id, g(z, M)),
|
|
534
|
+
className: A,
|
|
535
|
+
children: [/* @__PURE__ */ w(je, { className: "h-4 w-4" }), "Edit"]
|
|
536
|
+
}),
|
|
537
|
+
/* @__PURE__ */ T("button", {
|
|
538
|
+
type: "button",
|
|
539
|
+
onClick: () => void Et(),
|
|
540
|
+
className: A,
|
|
541
|
+
children: [/* @__PURE__ */ w(Ne, { className: "h-4 w-4" }), "Share"]
|
|
542
|
+
}),
|
|
543
|
+
/* @__PURE__ */ T("button", {
|
|
544
|
+
type: "button",
|
|
545
|
+
onClick: St,
|
|
546
|
+
className: A,
|
|
547
|
+
children: [/* @__PURE__ */ w(y, { className: "h-4 w-4" }), "Schedule"]
|
|
548
|
+
})
|
|
549
|
+
] }) : /* @__PURE__ */ T("button", {
|
|
453
550
|
type: "button",
|
|
454
|
-
onClick: () =>
|
|
455
|
-
className:
|
|
456
|
-
children: [/* @__PURE__ */
|
|
551
|
+
onClick: () => Q(null, g(h, M, `${h.name} (copy)`)),
|
|
552
|
+
className: A,
|
|
553
|
+
children: [/* @__PURE__ */ w(Ae, { className: "h-4 w-4" }), "Save as report"]
|
|
457
554
|
}),
|
|
458
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ T("button", {
|
|
459
556
|
type: "button",
|
|
460
|
-
onClick:
|
|
461
|
-
disabled: !
|
|
462
|
-
className:
|
|
463
|
-
children: [/* @__PURE__ */
|
|
557
|
+
onClick: Dt,
|
|
558
|
+
disabled: !H.hasData,
|
|
559
|
+
className: A,
|
|
560
|
+
children: [/* @__PURE__ */ w(Oe, { className: "h-4 w-4" }), "Export CSV"]
|
|
464
561
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ T("button", {
|
|
466
563
|
type: "button",
|
|
467
|
-
onClick:
|
|
468
|
-
disabled: !
|
|
564
|
+
onClick: Ot,
|
|
565
|
+
disabled: !H.hasData,
|
|
469
566
|
title: "Save this report as a PDF (opens your browser's print dialog)",
|
|
470
|
-
className:
|
|
471
|
-
children: [/* @__PURE__ */
|
|
567
|
+
className: A,
|
|
568
|
+
children: [/* @__PURE__ */ w(ke, { className: "h-4 w-4" }), "Export PDF"]
|
|
472
569
|
}),
|
|
473
|
-
|
|
570
|
+
R && /* @__PURE__ */ w("button", {
|
|
474
571
|
type: "button",
|
|
475
572
|
onClick: () => {
|
|
476
|
-
|
|
573
|
+
q(null), K(!0);
|
|
477
574
|
},
|
|
478
575
|
"aria-label": "Delete report",
|
|
479
|
-
className:
|
|
480
|
-
children: /* @__PURE__ */
|
|
576
|
+
className: l(A, "text-status-error-text"),
|
|
577
|
+
children: /* @__PURE__ */ w(Pe, { className: "h-4 w-4" })
|
|
481
578
|
})
|
|
482
579
|
]
|
|
483
580
|
})]
|
|
484
581
|
}) }),
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
loading:
|
|
487
|
-
error:
|
|
488
|
-
onRetry:
|
|
489
|
-
hasData:
|
|
490
|
-
children: [/* @__PURE__ */
|
|
491
|
-
source:
|
|
492
|
-
windowLabel:
|
|
493
|
-
}), /* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ T(re, {
|
|
583
|
+
loading: H.loading,
|
|
584
|
+
error: H.error,
|
|
585
|
+
onRetry: H.refetch,
|
|
586
|
+
hasData: H.hasData,
|
|
587
|
+
children: [/* @__PURE__ */ w(se, {
|
|
588
|
+
source: H.view.source,
|
|
589
|
+
windowLabel: V
|
|
590
|
+
}), /* @__PURE__ */ T("div", {
|
|
494
591
|
className: "grid grid-cols-1 gap-6 xl:grid-cols-2",
|
|
495
|
-
children: [
|
|
496
|
-
className:
|
|
497
|
-
children: /* @__PURE__ */
|
|
592
|
+
children: [z.widgets.map((e) => /* @__PURE__ */ w("div", {
|
|
593
|
+
className: l(m[e].wide && "xl:col-span-2"),
|
|
594
|
+
children: /* @__PURE__ */ w(ce, {
|
|
498
595
|
widget: e,
|
|
499
|
-
view:
|
|
500
|
-
attribution:
|
|
501
|
-
attributionLoading:
|
|
502
|
-
attributionError:
|
|
503
|
-
onOpenCampaign: (e) =>
|
|
596
|
+
view: H.view,
|
|
597
|
+
attribution: H.attribution,
|
|
598
|
+
attributionLoading: H.attributionLoading,
|
|
599
|
+
attributionError: H.attributionError,
|
|
600
|
+
onOpenCampaign: (e) => d(p + "/campaigns/" + e)
|
|
504
601
|
})
|
|
505
|
-
}, e)), /* @__PURE__ */
|
|
602
|
+
}, e)), /* @__PURE__ */ T("button", {
|
|
506
603
|
type: "button",
|
|
507
|
-
onClick: () =>
|
|
604
|
+
onClick: () => R ? Q(R.id, g(z, M)) : Q(null, g(h, M, `${h.name} (copy)`)),
|
|
508
605
|
className: "flex min-h-[160px] flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-border-seam text-sm font-medium text-text-secondary transition-colors hover:bg-bg-sunken/40 hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] print:hidden",
|
|
509
|
-
children: [/* @__PURE__ */
|
|
606
|
+
children: [/* @__PURE__ */ w(Me, { className: "h-6 w-6" }), "Add widget"]
|
|
510
607
|
})]
|
|
511
608
|
})]
|
|
512
609
|
})
|
|
513
610
|
]
|
|
514
611
|
})]
|
|
515
612
|
}),
|
|
516
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ T(E, { children: [/* @__PURE__ */ w("h3", {
|
|
517
614
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
518
615
|
children: "Open a live view"
|
|
519
|
-
}), /* @__PURE__ */
|
|
616
|
+
}), /* @__PURE__ */ w("div", {
|
|
520
617
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",
|
|
521
|
-
children:
|
|
618
|
+
children: He.map((e) => /* @__PURE__ */ T("button", {
|
|
522
619
|
type: "button",
|
|
523
|
-
onClick: () =>
|
|
620
|
+
onClick: () => d(p + e.segment),
|
|
524
621
|
className: "group flex items-start gap-3 rounded-lg border border-border-seam bg-gloss-card p-4 text-left shadow-pop transition-colors hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
525
|
-
children: [/* @__PURE__ */
|
|
622
|
+
children: [/* @__PURE__ */ w("span", {
|
|
526
623
|
className: "text-text-secondary transition-colors group-hover:text-action-primary-bg",
|
|
527
624
|
children: e.icon
|
|
528
|
-
}), /* @__PURE__ */
|
|
625
|
+
}), /* @__PURE__ */ T("div", {
|
|
529
626
|
className: "min-w-0 flex-1",
|
|
530
|
-
children: [/* @__PURE__ */
|
|
627
|
+
children: [/* @__PURE__ */ T("p", {
|
|
531
628
|
className: "flex items-center gap-1 text-sm font-medium text-text-primary",
|
|
532
|
-
children: [e.name, /* @__PURE__ */
|
|
533
|
-
}), /* @__PURE__ */
|
|
629
|
+
children: [e.name, /* @__PURE__ */ w(De, { className: "h-3.5 w-3.5 shrink-0 text-text-secondary opacity-0 transition-opacity group-hover:opacity-100" })]
|
|
630
|
+
}), /* @__PURE__ */ w("p", {
|
|
534
631
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
535
632
|
children: e.description
|
|
536
633
|
})]
|
|
537
634
|
})]
|
|
538
635
|
}, e.id))
|
|
539
636
|
})] }),
|
|
540
|
-
|
|
637
|
+
U && /* @__PURE__ */ w(Ve, {
|
|
541
638
|
open: !0,
|
|
542
|
-
title:
|
|
543
|
-
submitLabel:
|
|
544
|
-
draft:
|
|
545
|
-
onChange: (e) =>
|
|
546
|
-
...
|
|
639
|
+
title: U.reportId ? "Edit report" : "New report",
|
|
640
|
+
submitLabel: U.reportId ? "Save changes" : "Save report",
|
|
641
|
+
draft: U.draft,
|
|
642
|
+
onChange: (e) => W({
|
|
643
|
+
...U,
|
|
547
644
|
draft: e
|
|
548
645
|
}),
|
|
549
|
-
errors:
|
|
550
|
-
serverError:
|
|
551
|
-
saving:
|
|
552
|
-
onClose: () =>
|
|
553
|
-
onSubmit: () => void
|
|
646
|
+
errors: Xe ? _t : {},
|
|
647
|
+
serverError: Qe,
|
|
648
|
+
saving: kt,
|
|
649
|
+
onClose: () => W(null),
|
|
650
|
+
onSubmit: () => void vt()
|
|
651
|
+
}),
|
|
652
|
+
R && J && /* @__PURE__ */ w(Te, {
|
|
653
|
+
open: !0,
|
|
654
|
+
reportId: R.id,
|
|
655
|
+
reportName: R.name,
|
|
656
|
+
workspaceId: de,
|
|
657
|
+
schedule: $,
|
|
658
|
+
draft: J,
|
|
659
|
+
onChange: Y,
|
|
660
|
+
errors: tt ? bt : {},
|
|
661
|
+
serverError: rt,
|
|
662
|
+
busy: xt,
|
|
663
|
+
onClose: () => Y(null),
|
|
664
|
+
onSave: () => void Ct(),
|
|
665
|
+
onRemove: () => void wt(),
|
|
666
|
+
onSendNow: () => void Tt()
|
|
554
667
|
}),
|
|
555
|
-
/* @__PURE__ */
|
|
556
|
-
open:
|
|
557
|
-
onClose: () =>
|
|
668
|
+
/* @__PURE__ */ w(te, {
|
|
669
|
+
open: $e,
|
|
670
|
+
onClose: () => K(!1),
|
|
558
671
|
title: "Delete report",
|
|
559
|
-
message: `Delete "${
|
|
560
|
-
deleting:
|
|
561
|
-
error:
|
|
562
|
-
onConfirm: () => void
|
|
672
|
+
message: `Delete "${z.name}"? Everyone in the workspace loses this saved report. The underlying analytics are not affected.`,
|
|
673
|
+
deleting: lt.loading,
|
|
674
|
+
error: et,
|
|
675
|
+
onConfirm: () => void yt()
|
|
563
676
|
}),
|
|
564
|
-
/* @__PURE__ */
|
|
677
|
+
/* @__PURE__ */ w(ne, { toasts: S.map((e) => ({
|
|
565
678
|
...e,
|
|
566
|
-
onDismiss:
|
|
679
|
+
onDismiss: Ue
|
|
567
680
|
})) })
|
|
568
681
|
]
|
|
569
682
|
});
|
|
570
683
|
};
|
|
571
684
|
//#endregion
|
|
572
|
-
export {
|
|
685
|
+
export { Ue as ReportsPage };
|
|
573
686
|
|
|
574
687
|
//# sourceMappingURL=ReportsPage.js.map
|