@burdenoff/microfe-ecoimpacthub 2026.704.3 → 2026.704.5

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 (47) hide show
  1. package/dist/ecoimpacthub/pages/DashboardPage.js +345 -189
  2. package/dist/ecoimpacthub/pages/DashboardPage.js.map +1 -1
  3. package/dist/ecoimpacthub/pages/_shared/ConservationBadge.js +58 -0
  4. package/dist/ecoimpacthub/pages/_shared/ConservationBadge.js.map +1 -0
  5. package/dist/ecoimpacthub/pages/_shared/EvidenceThumb.js +70 -0
  6. package/dist/ecoimpacthub/pages/_shared/EvidenceThumb.js.map +1 -0
  7. package/dist/ecoimpacthub/pages/_shared/MethodBadge.js +51 -0
  8. package/dist/ecoimpacthub/pages/_shared/MethodBadge.js.map +1 -0
  9. package/dist/ecoimpacthub/pages/_shared/TaxonChip.js +29 -0
  10. package/dist/ecoimpacthub/pages/_shared/TaxonChip.js.map +1 -0
  11. package/dist/ecoimpacthub/pages/badges.js +71 -0
  12. package/dist/ecoimpacthub/pages/badges.js.map +1 -0
  13. package/dist/ecoimpacthub/pages/carbon/CarbonPage.js +341 -300
  14. package/dist/ecoimpacthub/pages/carbon/CarbonPage.js.map +1 -1
  15. package/dist/ecoimpacthub/pages/carbonVisuals.js +89 -0
  16. package/dist/ecoimpacthub/pages/carbonVisuals.js.map +1 -0
  17. package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.js +252 -218
  18. package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.js.map +1 -1
  19. package/dist/ecoimpacthub/pages/habitat/HabitatProjectsPage.js +15 -12
  20. package/dist/ecoimpacthub/pages/habitat/HabitatProjectsPage.js.map +1 -1
  21. package/dist/ecoimpacthub/pages/habitat/LifecycleProgress.js +168 -0
  22. package/dist/ecoimpacthub/pages/habitat/LifecycleProgress.js.map +1 -0
  23. package/dist/ecoimpacthub/pages/monitoring/MonitoringPage.js +30 -17
  24. package/dist/ecoimpacthub/pages/monitoring/MonitoringPage.js.map +1 -1
  25. package/dist/ecoimpacthub/pages/observations/ObservationsPage.js +236 -219
  26. package/dist/ecoimpacthub/pages/observations/ObservationsPage.js.map +1 -1
  27. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js +248 -212
  28. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js.map +1 -1
  29. package/dist/ecoimpacthub/pages/reports/ReportsPage.js +119 -118
  30. package/dist/ecoimpacthub/pages/reports/ReportsPage.js.map +1 -1
  31. package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js +498 -370
  32. package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js.map +1 -1
  33. package/dist/ecoimpacthub/pages/sites/SitesPage.js +109 -99
  34. package/dist/ecoimpacthub/pages/sites/SitesPage.js.map +1 -1
  35. package/dist/ecoimpacthub/pages/sites/siteTypeVisuals.js +64 -0
  36. package/dist/ecoimpacthub/pages/sites/siteTypeVisuals.js.map +1 -0
  37. package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js +275 -259
  38. package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js.map +1 -1
  39. package/dist/ecoimpacthub/pages/species/SpeciesPage.js +235 -177
  40. package/dist/ecoimpacthub/pages/species/SpeciesPage.js.map +1 -1
  41. package/dist/node_modules/recharts/es6/cartesian/CartesianGrid.js +305 -0
  42. package/dist/node_modules/recharts/es6/cartesian/CartesianGrid.js.map +1 -0
  43. package/dist/node_modules/recharts/es6/context/chartLayoutContext.js +44 -33
  44. package/dist/node_modules/recharts/es6/context/chartLayoutContext.js.map +1 -1
  45. package/dist/node_modules/recharts/es6/util/ChartUtils.js +31 -23
  46. package/dist/node_modules/recharts/es6/util/ChartUtils.js.map +1 -1
  47. package/package.json +1 -1
@@ -1,303 +1,339 @@
1
1
  import { useEcoImpactHub as e } from "../../context/EcoImpactHubContext.js";
2
2
  import { PageLayout as t } from "../../components/PageLayout.js";
3
- import { formatDate as n, formatEnumLabel as r, formatNumber as i } from "../../utils/formatters.js";
4
- import { StatusBadge as a } from "../../components/StatusBadge.js";
5
- import { ErrorView as o, LoadingView as s, Section as c } from "../../components/StateViews.js";
6
- import { EmptyState as l } from "../../components/EmptyState.js";
3
+ import { formatDate as n, formatNumber as r } from "../../utils/formatters.js";
4
+ import { StatusBadge as i } from "../../components/StatusBadge.js";
5
+ import { ErrorView as a, LoadingView as o, Section as s } from "../../components/StateViews.js";
6
+ import { EmptyState as c } from "../../components/EmptyState.js";
7
7
  import "../../context/index.js";
8
- import { useEcoAddReportLineItem as u, useEcoPublishReport as d, useEcoReport as f } from "../../hooks/useEcoImpactHubApi.js";
8
+ import { useEcoAddReportLineItem as l, useEcoPublishReport as u, useEcoReport as d } from "../../hooks/useEcoImpactHubApi.js";
9
9
  import "../../hooks/index.js";
10
- import { DataTable as p } from "../../components/DataTable.js";
11
- import { EvidenceUpload as m } from "../../components/EvidenceUpload.js";
12
- import { FileLink as h } from "../../components/FileLink.js";
13
- import { EcoDiscussion as g } from "../../components/EcoDiscussion.js";
14
- import { useMemo as _, useState as v } from "react";
15
- import { ArrowLeft as y, ListPlus as b, Plus as x, Send as S } from "lucide-react";
16
- import { useParams as C } from "react-router-dom";
17
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
18
- import { Button as D, GlassCard as O, Input as k, Label as A, ResponsiveDialog as j, ResponsiveDialogContent as M, ResponsiveDialogDescription as N, ResponsiveDialogFooter as P, ResponsiveDialogHeader as F, ResponsiveDialogTitle as I } from "@burdenoff/fe-libs/ui";
10
+ import { FrameworkBadge as f } from "../badges.js";
11
+ import { EvidenceUpload as p } from "../../components/EvidenceUpload.js";
12
+ import { FileLink as m } from "../../components/FileLink.js";
13
+ import { EcoDiscussion as h } from "../../components/EcoDiscussion.js";
14
+ import { useMemo as g, useState as _ } from "react";
15
+ import { ArrowLeft as v, ListPlus as y, Send as b } from "lucide-react";
16
+ import { useParams as x } from "react-router-dom";
17
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
18
+ import { Button as T, GlassCard as E, Input as D, Label as O, ResponsiveDialog as k, ResponsiveDialogContent as ee, ResponsiveDialogDescription as A, ResponsiveDialogFooter as j, ResponsiveDialogHeader as M, ResponsiveDialogTitle as N } from "@burdenoff/fe-libs/ui";
19
19
  //#region src/ecoimpacthub/pages/reports/ReportDetailPage.tsx
20
- function L() {
21
- let { id: L } = C(), { navigateTo: R } = e(), { data: z, isLoading: B, isError: V, refetch: H } = f(L), U = u(), W = d(), [G, K] = v(!1), [q, J] = v({
20
+ function P({ label: e, children: t }) {
21
+ return /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("dt", {
22
+ className: "text-xs text-text-tertiary",
23
+ children: e
24
+ }), /* @__PURE__ */ C("dd", {
25
+ className: "mt-1 text-sm text-text-primary",
26
+ children: t
27
+ })] });
28
+ }
29
+ function F() {
30
+ let { id: F } = x(), { navigateTo: I } = e(), { data: L, isLoading: R, isError: z, refetch: B } = d(F), V = l(), H = u(), [U, W] = _(!1), [G, K] = _({
22
31
  label: "",
23
32
  value: "",
24
33
  unit: "",
25
34
  category: "",
26
35
  carbonEntryId: ""
27
- }), [Y, X] = v(null), [Z, Q] = v(null), $ = _(() => z?.lineItems ?? [], [z]), ee = _(() => $.reduce((e, t) => e + t.value, 0), [$]);
28
- return B ? /* @__PURE__ */ T(t, {
36
+ }), [q, J] = _(null), [Y, X] = _(null), Z = g(() => L?.lineItems ?? [], [L]), Q = g(() => Z.reduce((e, t) => e + t.value, 0), [Z]), $ = g(() => {
37
+ let e = new Set(Z.map((e) => e.unit));
38
+ return e.size === 1 ? [...e][0] : null;
39
+ }, [Z]);
40
+ if (R) return /* @__PURE__ */ C(t, {
29
41
  title: "Report",
30
- children: /* @__PURE__ */ T(s, {})
31
- }) : V || !z ? /* @__PURE__ */ T(t, {
42
+ children: /* @__PURE__ */ C(o, {})
43
+ });
44
+ if (z || !L) return /* @__PURE__ */ C(t, {
32
45
  title: "Report",
33
- children: /* @__PURE__ */ T(o, {
46
+ children: /* @__PURE__ */ C(a, {
34
47
  message: "This report could not be loaded.",
35
- onRetry: () => H()
48
+ onRetry: () => B()
36
49
  })
37
- }) : /* @__PURE__ */ E(t, {
38
- title: z.title,
39
- description: [r(z.framework), r(z.status)].filter(Boolean).join(" · "),
40
- actions: /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(a, { status: z.status }), /* @__PURE__ */ E(D, {
50
+ });
51
+ let te = L.status === "PUBLISHED";
52
+ return /* @__PURE__ */ w(t, {
53
+ title: /* @__PURE__ */ w("span", {
54
+ className: "flex flex-wrap items-center gap-x-3 gap-y-2",
55
+ children: [/* @__PURE__ */ C("span", {
56
+ className: "text-text-primary",
57
+ children: L.title
58
+ }), /* @__PURE__ */ C(f, { framework: L.framework })]
59
+ }),
60
+ description: `Reporting period ${n(L.periodStart)} – ${n(L.periodEnd)}`,
61
+ actions: /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(i, { status: L.status }), /* @__PURE__ */ w(T, {
41
62
  variant: "ghost",
42
- onClick: () => R("reports"),
43
- children: [/* @__PURE__ */ T(y, { className: "mr-1.5 h-4 w-4" }), " Back"]
63
+ onClick: () => I("reports"),
64
+ children: [/* @__PURE__ */ C(v, { className: "mr-1.5 h-4 w-4" }), " Back"]
44
65
  })] }),
45
66
  children: [
46
- /* @__PURE__ */ E("div", {
67
+ /* @__PURE__ */ w("div", {
47
68
  className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
48
- children: [/* @__PURE__ */ E(O, {
69
+ children: [/* @__PURE__ */ w(E, {
49
70
  treatment: "glass",
50
71
  className: "p-6 lg:col-span-2",
51
- children: [/* @__PURE__ */ E("dl", {
72
+ children: [/* @__PURE__ */ w("dl", {
52
73
  className: "grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3",
53
74
  children: [
54
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
55
- className: "text-xs text-text-tertiary",
56
- children: "Framework"
57
- }), /* @__PURE__ */ T("dd", {
58
- className: "mt-0.5",
59
- children: /* @__PURE__ */ T(a, { status: z.framework })
60
- })] }),
61
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
62
- className: "text-xs text-text-tertiary",
63
- children: "Status"
64
- }), /* @__PURE__ */ T("dd", {
65
- className: "mt-0.5",
66
- children: /* @__PURE__ */ T(a, { status: z.status })
67
- })] }),
68
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
69
- className: "text-xs text-text-tertiary",
70
- children: "Period"
71
- }), /* @__PURE__ */ E("dd", {
72
- className: "mt-0.5 text-sm text-text-primary tabular-nums",
73
- children: [
74
- n(z.periodStart),
75
- " – ",
76
- n(z.periodEnd)
77
- ]
78
- })] }),
79
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
80
- className: "text-xs text-text-tertiary",
81
- children: "Published"
82
- }), /* @__PURE__ */ T("dd", {
83
- className: "mt-0.5 text-sm text-text-primary",
84
- children: n(z.publishedAt)
85
- })] }),
86
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
87
- className: "text-xs text-text-tertiary",
88
- children: "Line items"
89
- }), /* @__PURE__ */ T("dd", {
90
- className: "mt-0.5 text-sm text-text-primary tabular-nums",
91
- children: $.length
92
- })] }),
93
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
94
- className: "text-xs text-text-tertiary",
95
- children: "Attachment"
96
- }), /* @__PURE__ */ T("dd", {
97
- className: "mt-0.5 text-sm",
98
- children: z.file?.id ? /* @__PURE__ */ T(h, { fileId: z.file.id }) : /* @__PURE__ */ T("span", {
75
+ /* @__PURE__ */ C(P, {
76
+ label: "Framework",
77
+ children: /* @__PURE__ */ C(f, { framework: L.framework })
78
+ }),
79
+ /* @__PURE__ */ C(P, {
80
+ label: "Status",
81
+ children: /* @__PURE__ */ C(i, { status: L.status })
82
+ }),
83
+ /* @__PURE__ */ C(P, {
84
+ label: "Period",
85
+ children: /* @__PURE__ */ w("span", {
86
+ className: "tabular-nums",
87
+ children: [
88
+ n(L.periodStart),
89
+ " – ",
90
+ n(L.periodEnd)
91
+ ]
92
+ })
93
+ }),
94
+ /* @__PURE__ */ C(P, {
95
+ label: "Published",
96
+ children: n(L.publishedAt)
97
+ }),
98
+ /* @__PURE__ */ C(P, {
99
+ label: "Line items",
100
+ children: /* @__PURE__ */ C("span", {
101
+ className: "tabular-nums",
102
+ children: Z.length
103
+ })
104
+ }),
105
+ /* @__PURE__ */ C(P, {
106
+ label: "Attachment",
107
+ children: L.file?.id ? /* @__PURE__ */ C(m, { fileId: L.file.id }) : /* @__PURE__ */ C("span", {
99
108
  className: "text-text-tertiary",
100
109
  children: "—"
101
110
  })
102
- })] })
111
+ })
103
112
  ]
104
- }), z.summary && /* @__PURE__ */ T("p", {
113
+ }), L.summary && /* @__PURE__ */ C("p", {
105
114
  className: "mt-5 rounded-lg bg-bg-sunken/60 p-3 text-sm text-text-secondary",
106
- children: z.summary
115
+ children: L.summary
107
116
  })]
108
- }), /* @__PURE__ */ E(O, {
117
+ }), /* @__PURE__ */ w(E, {
109
118
  treatment: "glass",
110
119
  className: "flex flex-col gap-3 p-6",
111
120
  children: [
112
- /* @__PURE__ */ T("p", {
113
- className: "text-xs text-text-tertiary",
114
- children: "Quick actions"
121
+ /* @__PURE__ */ C("p", {
122
+ className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
123
+ children: "Actions"
115
124
  }),
116
- /* @__PURE__ */ E(D, {
117
- onClick: () => K(!0),
118
- children: [/* @__PURE__ */ T(b, { className: "mr-1.5 h-4 w-4" }), " Add line item"]
125
+ /* @__PURE__ */ w(T, {
126
+ onClick: () => W(!0),
127
+ children: [/* @__PURE__ */ C(y, { className: "mr-1.5 h-4 w-4" }), " Add line item"]
119
128
  }),
120
- z.status !== "PUBLISHED" && /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(m, {
129
+ te ? /* @__PURE__ */ w("p", {
130
+ className: "mt-1 text-sm text-text-secondary",
131
+ children: [
132
+ "Published ",
133
+ n(L.publishedAt),
134
+ ". This disclosure is finalised."
135
+ ]
136
+ }) : /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(p, {
121
137
  id: "reportAttachment",
122
138
  label: "Attach file (optional)",
123
- value: Z,
124
- onChange: Q,
139
+ value: Y,
140
+ onChange: X,
125
141
  hint: "Attach the signed report PDF or supporting document, then publish."
126
- }), /* @__PURE__ */ E(D, {
142
+ }), /* @__PURE__ */ w(T, {
127
143
  variant: "outline",
128
144
  onClick: async () => {
129
- if (L) {
130
- X(null);
145
+ if (F) {
146
+ J(null);
131
147
  try {
132
- await W.mutateAsync({
133
- id: L,
134
- fileId: Z?.fileId ?? null
135
- }), Q(null);
148
+ await H.mutateAsync({
149
+ id: F,
150
+ fileId: Y?.fileId ?? null
151
+ }), X(null);
136
152
  } catch (e) {
137
- X(e instanceof Error ? e.message : "Failed to publish report.");
153
+ J(e instanceof Error ? e.message : "Failed to publish report.");
138
154
  }
139
155
  }
140
156
  },
141
- disabled: W.isPending,
142
- children: [/* @__PURE__ */ T(S, { className: "mr-1.5 h-4 w-4" }), W.isPending ? "Publishing…" : "Publish report"]
157
+ disabled: H.isPending,
158
+ children: [/* @__PURE__ */ C(b, { className: "mr-1.5 h-4 w-4" }), H.isPending ? "Publishing…" : "Publish report"]
143
159
  })] })
144
160
  ]
145
161
  })]
146
162
  }),
147
- Y && /* @__PURE__ */ T("p", {
163
+ q && /* @__PURE__ */ C("p", {
148
164
  className: "mt-4 text-sm text-status-error-text",
149
- children: Y
165
+ children: q
150
166
  }),
151
- /* @__PURE__ */ T(c, {
167
+ /* @__PURE__ */ C(s, {
152
168
  title: "Line items",
153
169
  description: "Quantified disclosures that make up this report.",
154
- action: /* @__PURE__ */ E(D, {
170
+ action: /* @__PURE__ */ w(T, {
155
171
  size: "sm",
156
- onClick: () => K(!0),
157
- children: [/* @__PURE__ */ T(x, { className: "mr-1.5 h-4 w-4" }), " Add line item"]
172
+ onClick: () => W(!0),
173
+ children: [/* @__PURE__ */ C(y, { className: "mr-1.5 h-4 w-4" }), " Add line item"]
158
174
  }),
159
- children: $.length === 0 ? /* @__PURE__ */ T(l, {
175
+ children: Z.length === 0 ? /* @__PURE__ */ C(c, {
160
176
  illustration: "empty-data",
161
177
  title: "No line items",
162
- description: "Add a line item to record a quantified disclosure for this report."
163
- }) : /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ E("div", {
164
- className: "mb-3 flex items-center justify-end gap-2 text-sm",
165
- children: [/* @__PURE__ */ T("span", {
166
- className: "text-text-tertiary",
167
- children: "Total value"
168
- }), /* @__PURE__ */ T("span", {
169
- className: "font-semibold text-text-primary tabular-nums",
170
- children: i(ee)
171
- })]
172
- }), /* @__PURE__ */ T(p, {
173
- columns: [
174
- {
175
- key: "label",
176
- header: "Line item",
177
- render: (e) => /* @__PURE__ */ T("span", {
178
- className: "font-semibold text-text-primary",
179
- children: e.label
180
- })
181
- },
182
- {
183
- key: "category",
184
- header: "Category",
185
- hideOnMobile: !0,
186
- render: (e) => /* @__PURE__ */ T("span", {
187
- className: "text-text-secondary",
188
- children: e.category ?? "—"
189
- })
190
- },
191
- {
192
- key: "value",
193
- header: "Value",
194
- align: "right",
195
- sortValue: (e) => e.value,
196
- render: (e) => /* @__PURE__ */ E("span", {
197
- className: "tabular-nums text-text-primary",
198
- children: [
199
- i(e.value),
200
- " ",
201
- e.unit
202
- ]
203
- })
204
- }
205
- ],
206
- rows: $,
207
- rowKey: (e) => e.id
208
- })] })
178
+ description: "Add a line item to record a quantified disclosure for this report.",
179
+ action: /* @__PURE__ */ w(T, {
180
+ size: "sm",
181
+ onClick: () => W(!0),
182
+ children: [/* @__PURE__ */ C(y, { className: "mr-1.5 h-4 w-4" }), " Add line item"]
183
+ })
184
+ }) : /* @__PURE__ */ C(E, {
185
+ treatment: "plain",
186
+ className: "overflow-hidden",
187
+ children: /* @__PURE__ */ C("div", {
188
+ className: "overflow-x-auto",
189
+ children: /* @__PURE__ */ w("table", {
190
+ className: "w-full border-collapse text-sm",
191
+ children: [
192
+ /* @__PURE__ */ C("thead", { children: /* @__PURE__ */ w("tr", {
193
+ className: "border-b border-border-seam text-left",
194
+ children: [
195
+ /* @__PURE__ */ C("th", {
196
+ className: "px-4 py-3 font-medium text-text-secondary",
197
+ children: "Line item"
198
+ }),
199
+ /* @__PURE__ */ C("th", {
200
+ className: "hidden px-4 py-3 font-medium text-text-secondary md:table-cell",
201
+ children: "Category"
202
+ }),
203
+ /* @__PURE__ */ C("th", {
204
+ className: "px-4 py-3 text-right font-medium text-text-secondary",
205
+ children: "Value"
206
+ })
207
+ ]
208
+ }) }),
209
+ /* @__PURE__ */ C("tbody", { children: Z.map((e) => /* @__PURE__ */ w("tr", {
210
+ className: "border-b border-border-seam/60",
211
+ children: [
212
+ /* @__PURE__ */ C("td", {
213
+ className: "px-4 py-3 font-medium text-text-primary",
214
+ children: e.label
215
+ }),
216
+ /* @__PURE__ */ C("td", {
217
+ className: "hidden px-4 py-3 text-text-secondary md:table-cell",
218
+ children: e.category ?? "—"
219
+ }),
220
+ /* @__PURE__ */ w("td", {
221
+ className: "px-4 py-3 text-right text-text-primary tabular-nums",
222
+ children: [
223
+ r(e.value),
224
+ " ",
225
+ e.unit
226
+ ]
227
+ })
228
+ ]
229
+ }, e.id)) }),
230
+ /* @__PURE__ */ C("tfoot", { children: /* @__PURE__ */ w("tr", {
231
+ className: "border-t-2 border-border-seam bg-bg-sunken/40",
232
+ children: [/* @__PURE__ */ C("td", {
233
+ className: "px-4 py-3 text-sm font-semibold text-text-primary",
234
+ colSpan: 2,
235
+ children: "Total"
236
+ }), /* @__PURE__ */ w("td", {
237
+ className: "px-4 py-3 text-right text-base font-bold text-text-primary tabular-nums",
238
+ children: [r(Q), $ ? ` ${$}` : ""]
239
+ })]
240
+ }) })
241
+ ]
242
+ })
243
+ })
244
+ })
209
245
  }),
210
- /* @__PURE__ */ T(g, {
246
+ /* @__PURE__ */ C(h, {
211
247
  entityType: "ecoimpacthub-report",
212
- entityId: z.id,
248
+ entityId: L.id,
213
249
  description: "Coordinate review and sign-off on this disclosure with your team."
214
250
  }),
215
- /* @__PURE__ */ T(j, {
216
- open: G,
217
- onOpenChange: K,
218
- children: /* @__PURE__ */ E(M, { children: [
219
- /* @__PURE__ */ E(F, { children: [/* @__PURE__ */ T(I, { children: "Add line item" }), /* @__PURE__ */ E(N, { children: [
251
+ /* @__PURE__ */ C(k, {
252
+ open: U,
253
+ onOpenChange: W,
254
+ children: /* @__PURE__ */ w(ee, { children: [
255
+ /* @__PURE__ */ w(M, { children: [/* @__PURE__ */ C(N, { children: "Add line item" }), /* @__PURE__ */ w(A, { children: [
220
256
  "Record a quantified disclosure for ",
221
- z.title,
257
+ L.title,
222
258
  "."
223
259
  ] })] }),
224
- /* @__PURE__ */ E("div", {
260
+ /* @__PURE__ */ w("div", {
225
261
  className: "grid gap-4 py-2",
226
262
  children: [
227
- /* @__PURE__ */ E("div", {
263
+ /* @__PURE__ */ w("div", {
228
264
  className: "grid gap-1.5",
229
- children: [/* @__PURE__ */ T(A, {
265
+ children: [/* @__PURE__ */ C(O, {
230
266
  htmlFor: "liLabel",
231
267
  children: "Label *"
232
- }), /* @__PURE__ */ T(k, {
268
+ }), /* @__PURE__ */ C(D, {
233
269
  id: "liLabel",
234
- value: q.label,
235
- onChange: (e) => J({
236
- ...q,
270
+ value: G.label,
271
+ onChange: (e) => K({
272
+ ...G,
237
273
  label: e.target.value
238
274
  }),
239
275
  placeholder: "Scope 1 emissions"
240
276
  })]
241
277
  }),
242
- /* @__PURE__ */ E("div", {
278
+ /* @__PURE__ */ w("div", {
243
279
  className: "grid gap-2 sm:grid-cols-2",
244
- children: [/* @__PURE__ */ E("div", {
280
+ children: [/* @__PURE__ */ w("div", {
245
281
  className: "grid gap-1.5",
246
- children: [/* @__PURE__ */ T(A, {
282
+ children: [/* @__PURE__ */ C(O, {
247
283
  htmlFor: "liValue",
248
284
  children: "Value *"
249
- }), /* @__PURE__ */ T(k, {
285
+ }), /* @__PURE__ */ C(D, {
250
286
  id: "liValue",
251
287
  type: "number",
252
288
  step: "any",
253
- value: q.value,
254
- onChange: (e) => J({
255
- ...q,
289
+ value: G.value,
290
+ onChange: (e) => K({
291
+ ...G,
256
292
  value: e.target.value
257
293
  }),
258
294
  placeholder: "1250"
259
295
  })]
260
- }), /* @__PURE__ */ E("div", {
296
+ }), /* @__PURE__ */ w("div", {
261
297
  className: "grid gap-1.5",
262
- children: [/* @__PURE__ */ T(A, {
298
+ children: [/* @__PURE__ */ C(O, {
263
299
  htmlFor: "liUnit",
264
300
  children: "Unit *"
265
- }), /* @__PURE__ */ T(k, {
301
+ }), /* @__PURE__ */ C(D, {
266
302
  id: "liUnit",
267
- value: q.unit,
268
- onChange: (e) => J({
269
- ...q,
303
+ value: G.unit,
304
+ onChange: (e) => K({
305
+ ...G,
270
306
  unit: e.target.value
271
307
  }),
272
308
  placeholder: "t CO₂e"
273
309
  })]
274
310
  })]
275
311
  }),
276
- /* @__PURE__ */ E("div", {
312
+ /* @__PURE__ */ w("div", {
277
313
  className: "grid gap-1.5",
278
- children: [/* @__PURE__ */ T(A, {
314
+ children: [/* @__PURE__ */ C(O, {
279
315
  htmlFor: "liCategory",
280
316
  children: "Category"
281
- }), /* @__PURE__ */ T(k, {
317
+ }), /* @__PURE__ */ C(D, {
282
318
  id: "liCategory",
283
- value: q.category,
284
- onChange: (e) => J({
285
- ...q,
319
+ value: G.category,
320
+ onChange: (e) => K({
321
+ ...G,
286
322
  category: e.target.value
287
323
  }),
288
324
  placeholder: "Optional grouping, e.g. Energy"
289
325
  })]
290
326
  }),
291
- /* @__PURE__ */ E("div", {
327
+ /* @__PURE__ */ w("div", {
292
328
  className: "grid gap-1.5",
293
- children: [/* @__PURE__ */ T(A, {
329
+ children: [/* @__PURE__ */ C(O, {
294
330
  htmlFor: "liCarbonEntry",
295
331
  children: "Carbon entry ID"
296
- }), /* @__PURE__ */ T(k, {
332
+ }), /* @__PURE__ */ C(D, {
297
333
  id: "liCarbonEntry",
298
- value: q.carbonEntryId,
299
- onChange: (e) => J({
300
- ...q,
334
+ value: G.carbonEntryId,
335
+ onChange: (e) => K({
336
+ ...G,
301
337
  carbonEntryId: e.target.value
302
338
  }),
303
339
  placeholder: "Optional linked carbon-ledger entry"
@@ -305,27 +341,27 @@ function L() {
305
341
  })
306
342
  ]
307
343
  }),
308
- /* @__PURE__ */ E(P, { children: [/* @__PURE__ */ T(D, {
344
+ /* @__PURE__ */ w(j, { children: [/* @__PURE__ */ C(T, {
309
345
  variant: "outline",
310
- onClick: () => K(!1),
346
+ onClick: () => W(!1),
311
347
  children: "Cancel"
312
- }), /* @__PURE__ */ T(D, {
348
+ }), /* @__PURE__ */ C(T, {
313
349
  onClick: async () => {
314
- if (L) {
315
- if (!q.label.trim() || !q.value || !q.unit.trim()) {
316
- X("Label, value and unit are required.");
350
+ if (F) {
351
+ if (!G.label.trim() || !G.value || !G.unit.trim()) {
352
+ J("Label, value and unit are required.");
317
353
  return;
318
354
  }
319
- X(null);
355
+ J(null);
320
356
  try {
321
- await U.mutateAsync({
322
- reportId: L,
323
- label: q.label.trim(),
324
- value: Number(q.value),
325
- unit: q.unit.trim(),
326
- category: q.category.trim() || null,
327
- carbonEntryId: q.carbonEntryId.trim() || null
328
- }), K(!1), J({
357
+ await V.mutateAsync({
358
+ reportId: F,
359
+ label: G.label.trim(),
360
+ value: Number(G.value),
361
+ unit: G.unit.trim(),
362
+ category: G.category.trim() || null,
363
+ carbonEntryId: G.carbonEntryId.trim() || null
364
+ }), W(!1), K({
329
365
  label: "",
330
366
  value: "",
331
367
  unit: "",
@@ -333,12 +369,12 @@ function L() {
333
369
  carbonEntryId: ""
334
370
  });
335
371
  } catch (e) {
336
- X(e instanceof Error ? e.message : "Failed to add line item.");
372
+ J(e instanceof Error ? e.message : "Failed to add line item.");
337
373
  }
338
374
  }
339
375
  },
340
- disabled: U.isPending,
341
- children: U.isPending ? "Adding…" : "Add line item"
376
+ disabled: V.isPending,
377
+ children: V.isPending ? "Adding…" : "Add line item"
342
378
  })] })
343
379
  ] })
344
380
  })
@@ -346,6 +382,6 @@ function L() {
346
382
  });
347
383
  }
348
384
  //#endregion
349
- export { L as ReportDetailPage };
385
+ export { F as ReportDetailPage };
350
386
 
351
387
  //# sourceMappingURL=ReportDetailPage.js.map