@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,37 +1,37 @@
1
1
  import { PageLayout as e } from "../../components/PageLayout.js";
2
2
  import { MetricsCard as t } from "../../components/MetricsCard.js";
3
- import { formatCo2e as n, formatDate as ee, formatEnumLabel as r, formatNumber as i } from "../../utils/formatters.js";
4
- import { StatusBadge as a } from "../../components/StatusBadge.js";
5
- import { MiniBar as te } from "../../components/MiniBar.js";
6
- import { ErrorView as o, LoadingView as s } from "../../components/StateViews.js";
7
- import { EmptyState as c } from "../../components/EmptyState.js";
8
- import { useEcoCarbonEntries as ne, useEcoCarbonTotals as re, useEcoCreateEmissionFactor as ie, useEcoCreateReductionTarget as ae, useEcoEmissionFactors as oe, useEcoRecordCarbonEntry as se, useEcoReductionTargets as ce, useEcoSetReductionTargetStatus as le, useEcoSites as ue, useEcoVerifyCarbonEntry as de } from "../../hooks/useEcoImpactHubApi.js";
9
- import { useCursorPager as fe } from "../../hooks/useCursorPager.js";
3
+ import { formatCo2e as n, formatDate as r, formatEnumLabel as i, formatNumber as a, formatPercent as o } from "../../utils/formatters.js";
4
+ import { StatusBadge as s } from "../../components/StatusBadge.js";
5
+ import { ErrorView as c, LoadingView as l } from "../../components/StateViews.js";
6
+ import { EmptyState as ee } from "../../components/EmptyState.js";
7
+ import { Meter as te, SCOPE_HUE as ne, ScopeSplitBar as re } from "../carbonVisuals.js";
8
+ import { useEcoCarbonEntries as ie, useEcoCarbonTotals as ae, useEcoCreateEmissionFactor as oe, useEcoCreateReductionTarget as se, useEcoEmissionFactors as ce, useEcoRecordCarbonEntry as le, useEcoReductionTargets as ue, useEcoSetReductionTargetStatus as de, useEcoSites as fe, useEcoVerifyCarbonEntry as pe } from "../../hooks/useEcoImpactHubApi.js";
9
+ import { useCursorPager as me } from "../../hooks/useCursorPager.js";
10
10
  import "../../hooks/index.js";
11
- import { DataTable as l } from "../../components/DataTable.js";
12
- import { Tabs as pe } from "../../components/Tabs.js";
13
- import { Pagination as me } from "../../components/Pagination.js";
14
- import { useMemo as he, useState as u } from "react";
15
- import { Factory as d, Flame as ge, Leaf as _e, Plus as f, Target as ve, Truck as ye, Zap as be } from "lucide-react";
16
- import { Fragment as xe, jsx as p, jsxs as m } from "react/jsx-runtime";
17
- import { Button as h, Input as g, Label as _, ResponsiveDialog as v, ResponsiveDialogContent as Se, ResponsiveDialogDescription as y, ResponsiveDialogFooter as b, ResponsiveDialogHeader as x, ResponsiveDialogTitle as S, Select as C, SelectContent as w, SelectItem as T, SelectTrigger as E, SelectValue as D, Textarea as Ce } from "@burdenoff/fe-libs/ui";
11
+ import { DataTable as u } from "../../components/DataTable.js";
12
+ import { Tabs as he } from "../../components/Tabs.js";
13
+ import { Pagination as ge } from "../../components/Pagination.js";
14
+ import { useMemo as _e, useState as d } from "react";
15
+ import { Factory as f, Flame as ve, Leaf as ye, Plus as p, Target as be, Truck as xe, Zap as Se } from "lucide-react";
16
+ import { Fragment as Ce, jsx as m, jsxs as h } from "react/jsx-runtime";
17
+ import { Button as g, Input as _, Label as v, ResponsiveDialog as we, ResponsiveDialogContent as y, ResponsiveDialogDescription as Te, ResponsiveDialogFooter as b, ResponsiveDialogHeader as x, ResponsiveDialogTitle as S, Select as C, SelectContent as w, SelectItem as T, SelectTrigger as E, SelectValue as D, Textarea as Ee } from "@burdenoff/fe-libs/ui";
18
18
  //#region src/ecoimpacthub/pages/carbon/CarbonPage.tsx
19
19
  var O = [
20
20
  "SCOPE_1",
21
21
  "SCOPE_2",
22
22
  "SCOPE_3"
23
- ], we = [
23
+ ], De = [
24
24
  "DRAFT",
25
25
  "RECORDED",
26
26
  "VERIFIED",
27
27
  "ADJUSTED"
28
- ], Te = [
28
+ ], Oe = [
29
29
  "PROPOSED",
30
30
  "ACTIVE",
31
31
  "ACHIEVED",
32
32
  "MISSED",
33
33
  "RETIRED"
34
- ], Ee = 25, De = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), k = {
34
+ ], ke = 25, Ae = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), k = {
35
35
  category: "",
36
36
  scope: "SCOPE_1",
37
37
  activityValue: "",
@@ -56,60 +56,80 @@ var O = [
56
56
  targetYear: "",
57
57
  unit: "",
58
58
  description: ""
59
- }, Oe = (e) => Math.max(0, Math.min(100, e));
60
- function M() {
61
- let [M, ke] = u("ledger"), [N, Ae] = u("ALL"), [P, je] = u("ALL"), [F, Me] = u("ALL"), I = fe(), [L, Ne] = u("ALL"), [R, Pe] = u("ALL"), [Fe, z] = u(!1), [B, V] = u(k), [Ie, H] = u(!1), [U, W] = u(A), [Le, G] = u(!1), [K, q] = u(j), [J, Y] = u(null), Re = ue({ pagination: {
59
+ }, je = (e) => Math.max(0, Math.min(100, e)), Me = {
60
+ PROPOSED: "var(--color-text-tertiary)",
61
+ ACTIVE: "var(--color-action-primary-bg)",
62
+ ACHIEVED: "var(--color-status-success-text)",
63
+ MISSED: "var(--color-status-error-text)",
64
+ RETIRED: "var(--color-text-tertiary)"
65
+ }, M = (e, t, n) => {
66
+ if (e == null || t == null || t <= 0) return;
67
+ let r = e / t * 100;
68
+ return /* @__PURE__ */ h("div", {
69
+ className: "space-y-2",
70
+ children: [/* @__PURE__ */ m(te, {
71
+ value: r,
72
+ color: ne[n],
73
+ height: 4
74
+ }), /* @__PURE__ */ h("p", {
75
+ className: "text-xs tabular-nums text-text-tertiary",
76
+ children: [o(r), " of total"]
77
+ })]
78
+ });
79
+ };
80
+ function N() {
81
+ let [o, ne] = d("ledger"), [N, Ne] = d("ALL"), [P, Pe] = d("ALL"), [F, Fe] = d("ALL"), I = me(), [L, Ie] = d("ALL"), [R, Le] = d("ALL"), [Re, z] = d(!1), [B, V] = d(k), [ze, H] = d(!1), [U, W] = d(A), [Be, G] = d(!1), [K, q] = d(j), [J, Y] = d(null), Ve = fe({ pagination: {
62
82
  limit: 100,
63
83
  offset: 0
64
- } }), ze = he(() => {
84
+ } }), He = _e(() => {
65
85
  let e = {};
66
- for (let t of Re.data?.items ?? []) e[t.id] = t.name;
86
+ for (let t of Ve.data?.items ?? []) e[t.id] = t.name;
67
87
  return e;
68
- }, [Re.data]), X = re(), Z = ne({
88
+ }, [Ve.data]), X = ae(), Z = ie({
69
89
  scope: N === "ALL" ? void 0 : N,
70
90
  siteId: F === "ALL" ? void 0 : F,
71
91
  status: P === "ALL" ? void 0 : P,
72
92
  pagination: {
73
- limit: Ee,
93
+ limit: ke,
74
94
  cursor: I.cursor
75
95
  }
76
- }), Be = Z.data?.items ?? [], Ve = oe(), Q = oe(L === "ALL" ? void 0 : L), He = Q.data ?? [], $ = ce(R === "ALL" ? void 0 : R), Ue = $.data ?? [], We = se(), Ge = de(), Ke = ie(), qe = ae(), Je = le(), Ye = () => {
96
+ }), Ue = Z.data?.items ?? [], We = ce(), Q = ce(L === "ALL" ? void 0 : L), Ge = Q.data ?? [], $ = ue(R === "ALL" ? void 0 : R), Ke = $.data ?? [], qe = le(), Je = pe(), Ye = oe(), Xe = se(), Ze = de(), Qe = () => {
77
97
  V({
78
98
  ...k,
79
- periodStart: De()
99
+ periodStart: Ae()
80
100
  }), Y(null), z(!0);
81
- }, Xe = () => {
101
+ }, $e = () => {
82
102
  W(A), Y(null), H(!0);
83
- }, Ze = () => {
103
+ }, et = () => {
84
104
  q(j), Y(null), G(!0);
85
- }, Qe = async () => {
105
+ }, tt = async () => {
86
106
  if (!B.category.trim() || !B.activityValue || !B.activityUnit.trim()) {
87
107
  Y("Category, activity value and unit are required.");
88
108
  return;
89
109
  }
90
110
  Y(null);
91
111
  try {
92
- await We.mutateAsync({
112
+ await qe.mutateAsync({
93
113
  category: B.category.trim(),
94
114
  scope: B.scope,
95
115
  activityValue: Number(B.activityValue),
96
116
  activityUnit: B.activityUnit.trim(),
97
117
  factorId: B.factorId || null,
98
118
  siteId: B.siteId || null,
99
- periodStart: new Date(B.periodStart || De()).toISOString(),
119
+ periodStart: new Date(B.periodStart || Ae()).toISOString(),
100
120
  notes: B.notes.trim() || null
101
121
  }), z(!1), V(k);
102
122
  } catch (e) {
103
123
  Y(e instanceof Error ? e.message : "Failed to record carbon entry.");
104
124
  }
105
- }, $e = async () => {
125
+ }, nt = async () => {
106
126
  if (!U.name.trim() || !U.activityUnit.trim() || !U.factorKgco2e) {
107
127
  Y("Name, activity unit and factor value are required.");
108
128
  return;
109
129
  }
110
130
  Y(null);
111
131
  try {
112
- await Ke.mutateAsync({
132
+ await Ye.mutateAsync({
113
133
  name: U.name.trim(),
114
134
  scope: U.scope,
115
135
  activityUnit: U.activityUnit.trim(),
@@ -120,14 +140,18 @@ function M() {
120
140
  } catch (e) {
121
141
  Y(e instanceof Error ? e.message : "Failed to create emission factor.");
122
142
  }
123
- }, et = async () => {
143
+ }, rt = async () => {
124
144
  if (!K.name.trim() || !K.metric.trim() || !K.baselineValue || !K.baselineYear || !K.targetValue || !K.targetYear || !K.unit.trim()) {
125
145
  Y("All fields except description are required.");
126
146
  return;
127
147
  }
148
+ if (Number(K.targetYear) <= Number(K.baselineYear)) {
149
+ Y("Target year must be later than the baseline year.");
150
+ return;
151
+ }
128
152
  Y(null);
129
153
  try {
130
- await qe.mutateAsync({
154
+ await Xe.mutateAsync({
131
155
  name: K.name.trim(),
132
156
  metric: K.metric.trim(),
133
157
  baselineValue: Number(K.baselineValue),
@@ -140,11 +164,11 @@ function M() {
140
164
  } catch (e) {
141
165
  Y(e instanceof Error ? e.message : "Failed to create reduction target.");
142
166
  }
143
- }, tt = [
167
+ }, it = [
144
168
  {
145
169
  key: "category",
146
170
  header: "Category",
147
- render: (e) => /* @__PURE__ */ p("span", {
171
+ render: (e) => /* @__PURE__ */ m("span", {
148
172
  className: "font-medium text-text-primary",
149
173
  children: e.category
150
174
  })
@@ -152,7 +176,7 @@ function M() {
152
176
  {
153
177
  key: "scope",
154
178
  header: "Scope",
155
- render: (e) => /* @__PURE__ */ p(a, { status: e.scope })
179
+ render: (e) => /* @__PURE__ */ m(s, { status: e.scope })
156
180
  },
157
181
  {
158
182
  key: "activity",
@@ -160,10 +184,10 @@ function M() {
160
184
  align: "right",
161
185
  hideOnMobile: !0,
162
186
  sortValue: (e) => e.activityValue,
163
- render: (e) => /* @__PURE__ */ m("span", {
187
+ render: (e) => /* @__PURE__ */ h("span", {
164
188
  className: "tabular-nums text-text-secondary",
165
189
  children: [
166
- i(e.activityValue),
190
+ a(e.activityValue),
167
191
  " ",
168
192
  e.activityUnit
169
193
  ]
@@ -174,7 +198,7 @@ function M() {
174
198
  header: "CO₂e",
175
199
  align: "right",
176
200
  sortValue: (e) => e.co2eKg,
177
- render: (e) => /* @__PURE__ */ p("span", {
201
+ render: (e) => /* @__PURE__ */ m("span", {
178
202
  className: "tabular-nums font-medium text-text-primary",
179
203
  children: n(e.co2eKg)
180
204
  })
@@ -182,23 +206,23 @@ function M() {
182
206
  {
183
207
  key: "status",
184
208
  header: "Status",
185
- render: (e) => /* @__PURE__ */ p(a, { status: e.status })
209
+ render: (e) => /* @__PURE__ */ m(s, { status: e.status })
186
210
  },
187
211
  {
188
212
  key: "period",
189
213
  header: "Period",
190
214
  align: "right",
191
215
  hideOnMobile: !0,
192
- render: (e) => /* @__PURE__ */ p("span", {
216
+ render: (e) => /* @__PURE__ */ m("span", {
193
217
  className: "text-text-tertiary",
194
- children: ee(e.periodStart)
218
+ children: r(e.periodStart)
195
219
  })
196
220
  },
197
221
  {
198
222
  key: "factor",
199
223
  header: "Factor",
200
224
  hideOnMobile: !0,
201
- render: (e) => /* @__PURE__ */ p("span", {
225
+ render: (e) => /* @__PURE__ */ m("span", {
202
226
  className: "text-text-secondary",
203
227
  children: e.factor?.name ?? "—"
204
228
  })
@@ -207,19 +231,19 @@ function M() {
207
231
  key: "verify",
208
232
  header: "",
209
233
  align: "right",
210
- render: (e) => e.status === "VERIFIED" ? null : /* @__PURE__ */ p(h, {
234
+ render: (e) => e.status === "VERIFIED" ? null : /* @__PURE__ */ m(g, {
211
235
  size: "sm",
212
236
  variant: "outline",
213
- onClick: () => Ge.mutate(e.id),
214
- disabled: Ge.isPending,
237
+ onClick: () => Je.mutate(e.id),
238
+ disabled: Je.isPending,
215
239
  children: "Verify"
216
240
  })
217
241
  }
218
- ], nt = [
242
+ ], at = [
219
243
  {
220
244
  key: "name",
221
245
  header: "Factor",
222
- render: (e) => /* @__PURE__ */ p("span", {
246
+ render: (e) => /* @__PURE__ */ m("span", {
223
247
  className: "font-medium text-text-primary",
224
248
  children: e.name
225
249
  })
@@ -227,7 +251,7 @@ function M() {
227
251
  {
228
252
  key: "scope",
229
253
  header: "Scope",
230
- render: (e) => /* @__PURE__ */ p(a, { status: e.scope })
254
+ render: (e) => /* @__PURE__ */ m(s, { status: e.scope })
231
255
  },
232
256
  {
233
257
  key: "value",
@@ -235,10 +259,10 @@ function M() {
235
259
  align: "right",
236
260
  hideOnMobile: !0,
237
261
  sortValue: (e) => e.factorKgco2e,
238
- render: (e) => /* @__PURE__ */ m("span", {
262
+ render: (e) => /* @__PURE__ */ h("span", {
239
263
  className: "tabular-nums text-text-secondary",
240
264
  children: [
241
- i(e.factorKgco2e),
265
+ a(e.factorKgco2e),
242
266
  " kg/",
243
267
  e.activityUnit
244
268
  ]
@@ -248,7 +272,7 @@ function M() {
248
272
  key: "source",
249
273
  header: "Source",
250
274
  hideOnMobile: !0,
251
- render: (e) => /* @__PURE__ */ p("span", {
275
+ render: (e) => /* @__PURE__ */ m("span", {
252
276
  className: "text-text-secondary",
253
277
  children: e.source ?? "—"
254
278
  })
@@ -258,7 +282,7 @@ function M() {
258
282
  header: "Valid year",
259
283
  align: "right",
260
284
  hideOnMobile: !0,
261
- render: (e) => /* @__PURE__ */ p("span", {
285
+ render: (e) => /* @__PURE__ */ m("span", {
262
286
  className: "tabular-nums text-text-tertiary",
263
287
  children: e.validYear ?? "—"
264
288
  })
@@ -267,13 +291,13 @@ function M() {
267
291
  key: "active",
268
292
  header: "Active",
269
293
  align: "right",
270
- render: (e) => e.isActive ? /* @__PURE__ */ p(a, { status: "OK" }) : /* @__PURE__ */ p(a, { status: "Inactive" })
294
+ render: (e) => e.isActive ? /* @__PURE__ */ m(s, { status: "OK" }) : /* @__PURE__ */ m(s, { status: "Inactive" })
271
295
  }
272
- ], rt = [
296
+ ], ot = [
273
297
  {
274
298
  key: "name",
275
299
  header: "Target",
276
- render: (e) => /* @__PURE__ */ p("span", {
300
+ render: (e) => /* @__PURE__ */ m("span", {
277
301
  className: "font-medium text-text-primary",
278
302
  children: e.name
279
303
  })
@@ -282,7 +306,7 @@ function M() {
282
306
  key: "metric",
283
307
  header: "Metric",
284
308
  hideOnMobile: !0,
285
- render: (e) => /* @__PURE__ */ p("span", {
309
+ render: (e) => /* @__PURE__ */ m("span", {
286
310
  className: "text-text-secondary",
287
311
  children: e.metric
288
312
  })
@@ -291,10 +315,10 @@ function M() {
291
315
  key: "baseline",
292
316
  header: "Baseline",
293
317
  hideOnMobile: !0,
294
- render: (e) => /* @__PURE__ */ m("span", {
318
+ render: (e) => /* @__PURE__ */ h("span", {
295
319
  className: "tabular-nums text-text-secondary",
296
320
  children: [
297
- i(e.baselineValue),
321
+ a(e.baselineValue),
298
322
  " ",
299
323
  e.unit,
300
324
  " @",
@@ -306,10 +330,10 @@ function M() {
306
330
  key: "target",
307
331
  header: "Target",
308
332
  hideOnMobile: !0,
309
- render: (e) => /* @__PURE__ */ m("span", {
333
+ render: (e) => /* @__PURE__ */ h("span", {
310
334
  className: "tabular-nums text-text-secondary",
311
335
  children: [
312
- i(e.targetValue),
336
+ a(e.targetValue),
313
337
  " ",
314
338
  e.unit,
315
339
  " @",
@@ -321,14 +345,16 @@ function M() {
321
345
  key: "reduction",
322
346
  header: "Planned reduction",
323
347
  render: (e) => {
324
- let t = e.baselineValue > 0 ? Oe((e.baselineValue - e.targetValue) / e.baselineValue * 100) : 0;
325
- return /* @__PURE__ */ m("div", {
326
- className: "flex min-w-[9rem] items-center gap-2",
327
- children: [/* @__PURE__ */ p(te, {
348
+ let t = e.baselineValue > 0 ? je((e.baselineValue - e.targetValue) / e.baselineValue * 100) : 0;
349
+ return /* @__PURE__ */ h("div", {
350
+ className: "flex min-w-[10rem] items-center gap-3",
351
+ children: [/* @__PURE__ */ m(te, {
328
352
  value: t,
353
+ color: Me[e.status] ?? "var(--color-action-primary-bg)",
354
+ height: 8,
329
355
  className: "flex-1"
330
- }), /* @__PURE__ */ m("span", {
331
- className: "w-11 shrink-0 text-right text-sm tabular-nums text-text-secondary",
356
+ }), /* @__PURE__ */ h("span", {
357
+ className: "w-11 shrink-0 text-right text-sm font-semibold tabular-nums text-text-primary",
332
358
  children: [Math.round(t), "%"]
333
359
  })]
334
360
  });
@@ -337,260 +363,275 @@ function M() {
337
363
  {
338
364
  key: "status",
339
365
  header: "Status",
340
- render: (e) => /* @__PURE__ */ p(a, { status: e.status })
366
+ render: (e) => /* @__PURE__ */ m(s, { status: e.status })
341
367
  },
342
368
  {
343
369
  key: "setStatus",
344
370
  header: "",
345
371
  align: "right",
346
- render: (e) => /* @__PURE__ */ m(C, {
372
+ render: (e) => /* @__PURE__ */ h(C, {
347
373
  value: e.status,
348
- onValueChange: (t) => Je.mutate({
374
+ onValueChange: (t) => Ze.mutate({
349
375
  id: e.id,
350
376
  status: t
351
377
  }),
352
- children: [/* @__PURE__ */ p(E, {
378
+ children: [/* @__PURE__ */ m(E, {
353
379
  className: "h-8 w-36",
354
- children: /* @__PURE__ */ p(D, {})
355
- }), /* @__PURE__ */ p(w, { children: Te.map((e) => /* @__PURE__ */ p(T, {
380
+ children: /* @__PURE__ */ m(D, {})
381
+ }), /* @__PURE__ */ m(w, { children: Oe.map((e) => /* @__PURE__ */ m(T, {
356
382
  value: e,
357
- children: r(e)
383
+ children: i(e)
358
384
  }, e)) })]
359
385
  })
360
386
  }
361
- ], it = [
387
+ ], st = [
362
388
  {
363
389
  value: "ledger",
364
390
  label: "Ledger",
365
- icon: /* @__PURE__ */ p(d, { className: "h-4 w-4" })
391
+ icon: /* @__PURE__ */ m(f, { className: "h-4 w-4" })
366
392
  },
367
393
  {
368
394
  value: "factors",
369
395
  label: "Emission factors",
370
- icon: /* @__PURE__ */ p(_e, { className: "h-4 w-4" }),
396
+ icon: /* @__PURE__ */ m(ye, { className: "h-4 w-4" }),
371
397
  count: Q.data?.length
372
398
  },
373
399
  {
374
400
  value: "targets",
375
401
  label: "Reduction targets",
376
- icon: /* @__PURE__ */ p(ve, { className: "h-4 w-4" }),
402
+ icon: /* @__PURE__ */ m(be, { className: "h-4 w-4" }),
377
403
  count: $.data?.length
378
404
  }
379
405
  ];
380
- return /* @__PURE__ */ m(e, {
406
+ return /* @__PURE__ */ h(e, {
381
407
  title: "Carbon & Sustainability",
382
408
  description: "Carbon ledger, emission factors & science-based reduction targets — GHG Protocol Scope 1 / 2 / 3.",
383
- actions: M === "ledger" ? /* @__PURE__ */ m(h, {
384
- onClick: Ye,
385
- children: [/* @__PURE__ */ p(f, { className: "mr-1.5 h-4 w-4" }), " Record entry"]
386
- }) : M === "factors" ? /* @__PURE__ */ m(h, {
387
- onClick: Xe,
388
- children: [/* @__PURE__ */ p(f, { className: "mr-1.5 h-4 w-4" }), " New factor"]
389
- }) : /* @__PURE__ */ m(h, {
390
- onClick: Ze,
391
- children: [/* @__PURE__ */ p(f, { className: "mr-1.5 h-4 w-4" }), " New target"]
409
+ actions: o === "ledger" ? /* @__PURE__ */ h(g, {
410
+ onClick: Qe,
411
+ children: [/* @__PURE__ */ m(p, { className: "mr-1.5 h-4 w-4" }), " Record entry"]
412
+ }) : o === "factors" ? /* @__PURE__ */ h(g, {
413
+ onClick: $e,
414
+ children: [/* @__PURE__ */ m(p, { className: "mr-1.5 h-4 w-4" }), " New factor"]
415
+ }) : /* @__PURE__ */ h(g, {
416
+ onClick: et,
417
+ children: [/* @__PURE__ */ m(p, { className: "mr-1.5 h-4 w-4" }), " New target"]
392
418
  }),
393
419
  children: [
394
- /* @__PURE__ */ m("div", {
420
+ /* @__PURE__ */ h("div", {
395
421
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
396
422
  children: [
397
- /* @__PURE__ */ p(t, {
398
- icon: /* @__PURE__ */ p(d, { className: "h-5 w-5" }),
423
+ /* @__PURE__ */ m(t, {
424
+ icon: /* @__PURE__ */ m(f, { className: "h-5 w-5" }),
399
425
  value: X.data ? n(X.data.total) : "—",
400
426
  label: "Total footprint",
401
- featured: !0
427
+ featured: !0,
428
+ footer: X.data && X.data.total > 0 ? /* @__PURE__ */ h("div", {
429
+ className: "space-y-2",
430
+ children: [/* @__PURE__ */ m(re, {
431
+ scope1: X.data.scope1,
432
+ scope2: X.data.scope2,
433
+ scope3: X.data.scope3,
434
+ height: 6
435
+ }), /* @__PURE__ */ m("p", {
436
+ className: "text-xs text-text-tertiary",
437
+ children: "Scope 1 · 2 · 3 split"
438
+ })]
439
+ }) : void 0
402
440
  }),
403
- /* @__PURE__ */ p(t, {
404
- icon: /* @__PURE__ */ p(ge, { className: "h-5 w-5" }),
441
+ /* @__PURE__ */ m(t, {
442
+ icon: /* @__PURE__ */ m(ve, { className: "h-5 w-5" }),
405
443
  value: X.data ? n(X.data.scope1) : "—",
406
- label: "Scope 1 · Direct"
444
+ label: "Scope 1 · Direct",
445
+ footer: M(X.data?.scope1, X.data?.total, "SCOPE_1")
407
446
  }),
408
- /* @__PURE__ */ p(t, {
409
- icon: /* @__PURE__ */ p(be, { className: "h-5 w-5" }),
447
+ /* @__PURE__ */ m(t, {
448
+ icon: /* @__PURE__ */ m(Se, { className: "h-5 w-5" }),
410
449
  value: X.data ? n(X.data.scope2) : "—",
411
- label: "Scope 2 · Purchased energy"
450
+ label: "Scope 2 · Purchased energy",
451
+ footer: M(X.data?.scope2, X.data?.total, "SCOPE_2")
412
452
  }),
413
- /* @__PURE__ */ p(t, {
414
- icon: /* @__PURE__ */ p(ye, { className: "h-5 w-5" }),
453
+ /* @__PURE__ */ m(t, {
454
+ icon: /* @__PURE__ */ m(xe, { className: "h-5 w-5" }),
415
455
  value: X.data ? n(X.data.scope3) : "—",
416
- label: "Scope 3 · Value chain"
456
+ label: "Scope 3 · Value chain",
457
+ footer: M(X.data?.scope3, X.data?.total, "SCOPE_3")
417
458
  })
418
459
  ]
419
460
  }),
420
- /* @__PURE__ */ p("div", {
461
+ /* @__PURE__ */ m("div", {
421
462
  className: "mt-6",
422
- children: /* @__PURE__ */ p(pe, {
423
- items: it,
424
- value: M,
425
- onChange: ke
463
+ children: /* @__PURE__ */ m(he, {
464
+ items: st,
465
+ value: o,
466
+ onChange: ne
426
467
  })
427
468
  }),
428
- M === "ledger" && /* @__PURE__ */ m("div", {
469
+ o === "ledger" && /* @__PURE__ */ h("div", {
429
470
  className: "mt-6",
430
- children: [/* @__PURE__ */ m("div", {
471
+ children: [/* @__PURE__ */ h("div", {
431
472
  className: "mb-5 flex flex-wrap items-center gap-3",
432
473
  children: [
433
- /* @__PURE__ */ m(C, {
474
+ /* @__PURE__ */ h(C, {
434
475
  value: N,
435
476
  onValueChange: (e) => {
436
- Ae(e), I.reset();
477
+ Ne(e), I.reset();
437
478
  },
438
- children: [/* @__PURE__ */ p(E, {
479
+ children: [/* @__PURE__ */ m(E, {
439
480
  className: "w-40",
440
- children: /* @__PURE__ */ p(D, { placeholder: "All scopes" })
441
- }), /* @__PURE__ */ m(w, { children: [/* @__PURE__ */ p(T, {
481
+ children: /* @__PURE__ */ m(D, { placeholder: "All scopes" })
482
+ }), /* @__PURE__ */ h(w, { children: [/* @__PURE__ */ m(T, {
442
483
  value: "ALL",
443
484
  children: "All scopes"
444
- }), O.map((e) => /* @__PURE__ */ p(T, {
485
+ }), O.map((e) => /* @__PURE__ */ m(T, {
445
486
  value: e,
446
- children: r(e)
487
+ children: i(e)
447
488
  }, e))] })]
448
489
  }),
449
- /* @__PURE__ */ m(C, {
490
+ /* @__PURE__ */ h(C, {
450
491
  value: P,
451
492
  onValueChange: (e) => {
452
- je(e), I.reset();
493
+ Pe(e), I.reset();
453
494
  },
454
- children: [/* @__PURE__ */ p(E, {
495
+ children: [/* @__PURE__ */ m(E, {
455
496
  className: "w-40",
456
- children: /* @__PURE__ */ p(D, { placeholder: "All statuses" })
457
- }), /* @__PURE__ */ m(w, { children: [/* @__PURE__ */ p(T, {
497
+ children: /* @__PURE__ */ m(D, { placeholder: "All statuses" })
498
+ }), /* @__PURE__ */ h(w, { children: [/* @__PURE__ */ m(T, {
458
499
  value: "ALL",
459
500
  children: "All statuses"
460
- }), we.map((e) => /* @__PURE__ */ p(T, {
501
+ }), De.map((e) => /* @__PURE__ */ m(T, {
461
502
  value: e,
462
- children: r(e)
503
+ children: i(e)
463
504
  }, e))] })]
464
505
  }),
465
- /* @__PURE__ */ m(C, {
506
+ /* @__PURE__ */ h(C, {
466
507
  value: F,
467
508
  onValueChange: (e) => {
468
- Me(e), I.reset();
509
+ Fe(e), I.reset();
469
510
  },
470
- children: [/* @__PURE__ */ p(E, {
511
+ children: [/* @__PURE__ */ m(E, {
471
512
  className: "w-48",
472
- children: /* @__PURE__ */ p(D, { placeholder: "All sites" })
473
- }), /* @__PURE__ */ m(w, { children: [/* @__PURE__ */ p(T, {
513
+ children: /* @__PURE__ */ m(D, { placeholder: "All sites" })
514
+ }), /* @__PURE__ */ h(w, { children: [/* @__PURE__ */ m(T, {
474
515
  value: "ALL",
475
516
  children: "All sites"
476
- }), Object.entries(ze).map(([e, t]) => /* @__PURE__ */ p(T, {
517
+ }), Object.entries(He).map(([e, t]) => /* @__PURE__ */ m(T, {
477
518
  value: e,
478
519
  children: t
479
520
  }, e))] })]
480
521
  })
481
522
  ]
482
- }), Z.isLoading ? /* @__PURE__ */ p(s, { label: "Loading carbon ledger…" }) : Z.isError ? /* @__PURE__ */ p(o, {
523
+ }), Z.isLoading ? /* @__PURE__ */ m(l, { label: "Loading carbon ledger…" }) : Z.isError ? /* @__PURE__ */ m(c, {
483
524
  message: "Couldn't load carbon entries.",
484
525
  onRetry: () => Z.refetch()
485
- }) : Be.length === 0 ? /* @__PURE__ */ p(c, {
526
+ }) : Ue.length === 0 ? /* @__PURE__ */ m(ee, {
486
527
  illustration: "empty-data",
487
- icon: /* @__PURE__ */ p(d, { className: "h-10 w-10" }),
528
+ icon: /* @__PURE__ */ m(f, { className: "h-10 w-10" }),
488
529
  title: "No carbon entries",
489
530
  description: N === "ALL" && P === "ALL" && F === "ALL" ? "Record activity to build your Scope 1–3 emissions ledger." : "No entries match these filters.",
490
- action: /* @__PURE__ */ m(h, {
491
- onClick: Ye,
492
- children: [/* @__PURE__ */ p(f, { className: "mr-1.5 h-4 w-4" }), " Record entry"]
531
+ action: /* @__PURE__ */ h(g, {
532
+ onClick: Qe,
533
+ children: [/* @__PURE__ */ m(p, { className: "mr-1.5 h-4 w-4" }), " Record entry"]
493
534
  })
494
- }) : /* @__PURE__ */ m(xe, { children: [/* @__PURE__ */ p(l, {
495
- columns: tt,
496
- rows: Be,
535
+ }) : /* @__PURE__ */ h(Ce, { children: [/* @__PURE__ */ m(u, {
536
+ columns: it,
537
+ rows: Ue,
497
538
  rowKey: (e) => e.id
498
- }), /* @__PURE__ */ p(me, {
539
+ }), /* @__PURE__ */ m(ge, {
499
540
  page: I.page,
500
- pageSize: Ee,
501
- itemCount: Be.length,
541
+ pageSize: ke,
542
+ itemCount: Ue.length,
502
543
  hasMore: Z.data?.pageInfo?.hasMore ?? !1,
503
544
  onPageChange: (e) => I.onPageChange(e, Z.data?.pageInfo?.cursor)
504
545
  })] })]
505
546
  }),
506
- M === "factors" && /* @__PURE__ */ m("div", {
547
+ o === "factors" && /* @__PURE__ */ h("div", {
507
548
  className: "mt-6",
508
- children: [/* @__PURE__ */ p("div", {
549
+ children: [/* @__PURE__ */ m("div", {
509
550
  className: "mb-5 flex flex-wrap items-center gap-3",
510
- children: /* @__PURE__ */ m(C, {
551
+ children: /* @__PURE__ */ h(C, {
511
552
  value: L,
512
- onValueChange: (e) => Ne(e),
513
- children: [/* @__PURE__ */ p(E, {
553
+ onValueChange: (e) => Ie(e),
554
+ children: [/* @__PURE__ */ m(E, {
514
555
  className: "w-40",
515
- children: /* @__PURE__ */ p(D, { placeholder: "All scopes" })
516
- }), /* @__PURE__ */ m(w, { children: [/* @__PURE__ */ p(T, {
556
+ children: /* @__PURE__ */ m(D, { placeholder: "All scopes" })
557
+ }), /* @__PURE__ */ h(w, { children: [/* @__PURE__ */ m(T, {
517
558
  value: "ALL",
518
559
  children: "All scopes"
519
- }), O.map((e) => /* @__PURE__ */ p(T, {
560
+ }), O.map((e) => /* @__PURE__ */ m(T, {
520
561
  value: e,
521
- children: r(e)
562
+ children: i(e)
522
563
  }, e))] })]
523
564
  })
524
- }), Q.isLoading ? /* @__PURE__ */ p(s, { label: "Loading emission factors…" }) : Q.isError ? /* @__PURE__ */ p(o, {
565
+ }), Q.isLoading ? /* @__PURE__ */ m(l, { label: "Loading emission factors…" }) : Q.isError ? /* @__PURE__ */ m(c, {
525
566
  message: "Couldn't load emission factors.",
526
567
  onRetry: () => Q.refetch()
527
- }) : He.length === 0 ? /* @__PURE__ */ p(c, {
568
+ }) : Ge.length === 0 ? /* @__PURE__ */ m(ee, {
528
569
  illustration: "empty-data",
529
- icon: /* @__PURE__ */ p(_e, { className: "h-10 w-10" }),
570
+ icon: /* @__PURE__ */ m(ye, { className: "h-10 w-10" }),
530
571
  title: "No emission factors",
531
572
  description: L === "ALL" ? "Add emission factors (kg CO₂e per activity unit) to convert activity into CO₂e." : "No emission factors match this scope.",
532
- action: /* @__PURE__ */ m(h, {
533
- onClick: Xe,
534
- children: [/* @__PURE__ */ p(f, { className: "mr-1.5 h-4 w-4" }), " New factor"]
573
+ action: /* @__PURE__ */ h(g, {
574
+ onClick: $e,
575
+ children: [/* @__PURE__ */ m(p, { className: "mr-1.5 h-4 w-4" }), " New factor"]
535
576
  })
536
- }) : /* @__PURE__ */ p(l, {
537
- columns: nt,
538
- rows: He,
577
+ }) : /* @__PURE__ */ m(u, {
578
+ columns: at,
579
+ rows: Ge,
539
580
  rowKey: (e) => e.id
540
581
  })]
541
582
  }),
542
- M === "targets" && /* @__PURE__ */ m("div", {
583
+ o === "targets" && /* @__PURE__ */ h("div", {
543
584
  className: "mt-6",
544
- children: [/* @__PURE__ */ p("div", {
585
+ children: [/* @__PURE__ */ m("div", {
545
586
  className: "mb-5 flex flex-wrap items-center gap-3",
546
- children: /* @__PURE__ */ m(C, {
587
+ children: /* @__PURE__ */ h(C, {
547
588
  value: R,
548
- onValueChange: (e) => Pe(e),
549
- children: [/* @__PURE__ */ p(E, {
589
+ onValueChange: (e) => Le(e),
590
+ children: [/* @__PURE__ */ m(E, {
550
591
  className: "w-44",
551
- children: /* @__PURE__ */ p(D, { placeholder: "All statuses" })
552
- }), /* @__PURE__ */ m(w, { children: [/* @__PURE__ */ p(T, {
592
+ children: /* @__PURE__ */ m(D, { placeholder: "All statuses" })
593
+ }), /* @__PURE__ */ h(w, { children: [/* @__PURE__ */ m(T, {
553
594
  value: "ALL",
554
595
  children: "All statuses"
555
- }), Te.map((e) => /* @__PURE__ */ p(T, {
596
+ }), Oe.map((e) => /* @__PURE__ */ m(T, {
556
597
  value: e,
557
- children: r(e)
598
+ children: i(e)
558
599
  }, e))] })]
559
600
  })
560
- }), $.isLoading ? /* @__PURE__ */ p(s, { label: "Loading reduction targets…" }) : $.isError ? /* @__PURE__ */ p(o, {
601
+ }), $.isLoading ? /* @__PURE__ */ m(l, { label: "Loading reduction targets…" }) : $.isError ? /* @__PURE__ */ m(c, {
561
602
  message: "Couldn't load reduction targets.",
562
603
  onRetry: () => $.refetch()
563
- }) : Ue.length === 0 ? /* @__PURE__ */ p(c, {
604
+ }) : Ke.length === 0 ? /* @__PURE__ */ m(ee, {
564
605
  illustration: "empty-data",
565
- icon: /* @__PURE__ */ p(ve, { className: "h-10 w-10" }),
606
+ icon: /* @__PURE__ */ m(be, { className: "h-10 w-10" }),
566
607
  title: "No reduction targets",
567
608
  description: R === "ALL" ? "Set science-based reduction targets to track progress against a baseline." : "No targets match this status.",
568
- action: /* @__PURE__ */ m(h, {
569
- onClick: Ze,
570
- children: [/* @__PURE__ */ p(f, { className: "mr-1.5 h-4 w-4" }), " New target"]
609
+ action: /* @__PURE__ */ h(g, {
610
+ onClick: et,
611
+ children: [/* @__PURE__ */ m(p, { className: "mr-1.5 h-4 w-4" }), " New target"]
571
612
  })
572
- }) : /* @__PURE__ */ p(l, {
573
- columns: rt,
574
- rows: Ue,
613
+ }) : /* @__PURE__ */ m(u, {
614
+ columns: ot,
615
+ rows: Ke,
575
616
  rowKey: (e) => e.id
576
617
  })]
577
618
  }),
578
- /* @__PURE__ */ p(v, {
579
- open: Fe,
619
+ /* @__PURE__ */ m(we, {
620
+ open: Re,
580
621
  onOpenChange: (e) => {
581
622
  z(e), e || (V(k), Y(null));
582
623
  },
583
- children: /* @__PURE__ */ m(Se, { children: [
584
- /* @__PURE__ */ m(x, { children: [/* @__PURE__ */ p(S, { children: "Record carbon entry" }), /* @__PURE__ */ p(y, { children: "Log an activity — CO₂e is computed server-side from activity value × emission factor." })] }),
585
- /* @__PURE__ */ m("div", {
624
+ children: /* @__PURE__ */ h(y, { children: [
625
+ /* @__PURE__ */ h(x, { children: [/* @__PURE__ */ m(S, { children: "Record carbon entry" }), /* @__PURE__ */ m(Te, { children: "Log an activity — CO₂e is computed server-side from activity value × emission factor." })] }),
626
+ /* @__PURE__ */ h("div", {
586
627
  className: "grid gap-4 py-2",
587
628
  children: [
588
- /* @__PURE__ */ m("div", {
629
+ /* @__PURE__ */ h("div", {
589
630
  className: "grid gap-1.5",
590
- children: [/* @__PURE__ */ p(_, {
631
+ children: [/* @__PURE__ */ m(v, {
591
632
  htmlFor: "ceCategory",
592
633
  children: "Category *"
593
- }), /* @__PURE__ */ p(g, {
634
+ }), /* @__PURE__ */ m(_, {
594
635
  id: "ceCategory",
595
636
  value: B.category,
596
637
  onChange: (e) => V({
@@ -600,33 +641,33 @@ function M() {
600
641
  placeholder: "Diesel generators"
601
642
  })]
602
643
  }),
603
- /* @__PURE__ */ m("div", {
644
+ /* @__PURE__ */ h("div", {
604
645
  className: "grid gap-2 sm:grid-cols-2",
605
- children: [/* @__PURE__ */ m("div", {
646
+ children: [/* @__PURE__ */ h("div", {
606
647
  className: "grid gap-1.5",
607
- children: [/* @__PURE__ */ p(_, {
648
+ children: [/* @__PURE__ */ m(v, {
608
649
  htmlFor: "ceScope",
609
650
  children: "Scope"
610
- }), /* @__PURE__ */ m(C, {
651
+ }), /* @__PURE__ */ h(C, {
611
652
  value: B.scope,
612
653
  onValueChange: (e) => V({
613
654
  ...B,
614
655
  scope: e
615
656
  }),
616
- children: [/* @__PURE__ */ p(E, {
657
+ children: [/* @__PURE__ */ m(E, {
617
658
  id: "ceScope",
618
- children: /* @__PURE__ */ p(D, {})
619
- }), /* @__PURE__ */ p(w, { children: O.map((e) => /* @__PURE__ */ p(T, {
659
+ children: /* @__PURE__ */ m(D, {})
660
+ }), /* @__PURE__ */ m(w, { children: O.map((e) => /* @__PURE__ */ m(T, {
620
661
  value: e,
621
- children: r(e)
662
+ children: i(e)
622
663
  }, e)) })]
623
664
  })]
624
- }), /* @__PURE__ */ m("div", {
665
+ }), /* @__PURE__ */ h("div", {
625
666
  className: "grid gap-1.5",
626
- children: [/* @__PURE__ */ p(_, {
667
+ children: [/* @__PURE__ */ m(v, {
627
668
  htmlFor: "cePeriod",
628
669
  children: "Period start"
629
- }), /* @__PURE__ */ p(g, {
670
+ }), /* @__PURE__ */ m(_, {
630
671
  id: "cePeriod",
631
672
  type: "date",
632
673
  value: B.periodStart,
@@ -637,14 +678,14 @@ function M() {
637
678
  })]
638
679
  })]
639
680
  }),
640
- /* @__PURE__ */ m("div", {
681
+ /* @__PURE__ */ h("div", {
641
682
  className: "grid gap-2 sm:grid-cols-2",
642
- children: [/* @__PURE__ */ m("div", {
683
+ children: [/* @__PURE__ */ h("div", {
643
684
  className: "grid gap-1.5",
644
- children: [/* @__PURE__ */ p(_, {
685
+ children: [/* @__PURE__ */ m(v, {
645
686
  htmlFor: "ceValue",
646
687
  children: "Activity value *"
647
- }), /* @__PURE__ */ p(g, {
688
+ }), /* @__PURE__ */ m(_, {
648
689
  id: "ceValue",
649
690
  type: "number",
650
691
  min: "0",
@@ -656,12 +697,12 @@ function M() {
656
697
  }),
657
698
  placeholder: "1200"
658
699
  })]
659
- }), /* @__PURE__ */ m("div", {
700
+ }), /* @__PURE__ */ h("div", {
660
701
  className: "grid gap-1.5",
661
- children: [/* @__PURE__ */ p(_, {
702
+ children: [/* @__PURE__ */ m(v, {
662
703
  htmlFor: "ceUnit",
663
704
  children: "Activity unit *"
664
- }), /* @__PURE__ */ p(g, {
705
+ }), /* @__PURE__ */ m(_, {
665
706
  id: "ceUnit",
666
707
  value: B.activityUnit,
667
708
  onChange: (e) => V({
@@ -672,54 +713,54 @@ function M() {
672
713
  })]
673
714
  })]
674
715
  }),
675
- /* @__PURE__ */ m("div", {
716
+ /* @__PURE__ */ h("div", {
676
717
  className: "grid gap-2 sm:grid-cols-2",
677
- children: [/* @__PURE__ */ m("div", {
718
+ children: [/* @__PURE__ */ h("div", {
678
719
  className: "grid gap-1.5",
679
- children: [/* @__PURE__ */ p(_, {
720
+ children: [/* @__PURE__ */ m(v, {
680
721
  htmlFor: "ceFactor",
681
722
  children: "Emission factor"
682
- }), /* @__PURE__ */ m(C, {
723
+ }), /* @__PURE__ */ h(C, {
683
724
  value: B.factorId,
684
725
  onValueChange: (e) => V({
685
726
  ...B,
686
727
  factorId: e
687
728
  }),
688
- children: [/* @__PURE__ */ p(E, {
729
+ children: [/* @__PURE__ */ m(E, {
689
730
  id: "ceFactor",
690
- children: /* @__PURE__ */ p(D, { placeholder: "Optional" })
691
- }), /* @__PURE__ */ p(w, { children: (Ve.data ?? []).map((e) => /* @__PURE__ */ p(T, {
731
+ children: /* @__PURE__ */ m(D, { placeholder: "Optional" })
732
+ }), /* @__PURE__ */ m(w, { children: (We.data ?? []).map((e) => /* @__PURE__ */ m(T, {
692
733
  value: e.id,
693
734
  children: e.name
694
735
  }, e.id)) })]
695
736
  })]
696
- }), /* @__PURE__ */ m("div", {
737
+ }), /* @__PURE__ */ h("div", {
697
738
  className: "grid gap-1.5",
698
- children: [/* @__PURE__ */ p(_, {
739
+ children: [/* @__PURE__ */ m(v, {
699
740
  htmlFor: "ceSite",
700
741
  children: "Site"
701
- }), /* @__PURE__ */ m(C, {
742
+ }), /* @__PURE__ */ h(C, {
702
743
  value: B.siteId,
703
744
  onValueChange: (e) => V({
704
745
  ...B,
705
746
  siteId: e
706
747
  }),
707
- children: [/* @__PURE__ */ p(E, {
748
+ children: [/* @__PURE__ */ m(E, {
708
749
  id: "ceSite",
709
- children: /* @__PURE__ */ p(D, { placeholder: "Optional" })
710
- }), /* @__PURE__ */ p(w, { children: Object.entries(ze).map(([e, t]) => /* @__PURE__ */ p(T, {
750
+ children: /* @__PURE__ */ m(D, { placeholder: "Optional" })
751
+ }), /* @__PURE__ */ m(w, { children: Object.entries(He).map(([e, t]) => /* @__PURE__ */ m(T, {
711
752
  value: e,
712
753
  children: t
713
754
  }, e)) })]
714
755
  })]
715
756
  })]
716
757
  }),
717
- /* @__PURE__ */ m("div", {
758
+ /* @__PURE__ */ h("div", {
718
759
  className: "grid gap-1.5",
719
- children: [/* @__PURE__ */ p(_, {
760
+ children: [/* @__PURE__ */ m(v, {
720
761
  htmlFor: "ceNotes",
721
762
  children: "Notes"
722
- }), /* @__PURE__ */ p(Ce, {
763
+ }), /* @__PURE__ */ m(Ee, {
723
764
  id: "ceNotes",
724
765
  rows: 2,
725
766
  value: B.notes,
@@ -730,39 +771,39 @@ function M() {
730
771
  placeholder: "Optional context about this entry."
731
772
  })]
732
773
  }),
733
- J && /* @__PURE__ */ p("p", {
774
+ J && /* @__PURE__ */ m("p", {
734
775
  className: "text-sm text-status-error-text",
735
776
  children: J
736
777
  })
737
778
  ]
738
779
  }),
739
- /* @__PURE__ */ m(b, { children: [/* @__PURE__ */ p(h, {
780
+ /* @__PURE__ */ h(b, { children: [/* @__PURE__ */ m(g, {
740
781
  variant: "outline",
741
782
  onClick: () => z(!1),
742
783
  children: "Cancel"
743
- }), /* @__PURE__ */ p(h, {
744
- onClick: Qe,
745
- disabled: We.isPending,
746
- children: We.isPending ? "Recording…" : "Record entry"
784
+ }), /* @__PURE__ */ m(g, {
785
+ onClick: tt,
786
+ disabled: qe.isPending,
787
+ children: qe.isPending ? "Recording…" : "Record entry"
747
788
  })] })
748
789
  ] })
749
790
  }),
750
- /* @__PURE__ */ p(v, {
751
- open: Ie,
791
+ /* @__PURE__ */ m(we, {
792
+ open: ze,
752
793
  onOpenChange: (e) => {
753
794
  H(e), e || (W(A), Y(null));
754
795
  },
755
- children: /* @__PURE__ */ m(Se, { children: [
756
- /* @__PURE__ */ m(x, { children: [/* @__PURE__ */ p(S, { children: "New emission factor" }), /* @__PURE__ */ p(y, { children: "Define kg CO₂e per activity unit — used to convert ledger activity into CO₂e." })] }),
757
- /* @__PURE__ */ m("div", {
796
+ children: /* @__PURE__ */ h(y, { children: [
797
+ /* @__PURE__ */ h(x, { children: [/* @__PURE__ */ m(S, { children: "New emission factor" }), /* @__PURE__ */ m(Te, { children: "Define kg CO₂e per activity unit — used to convert ledger activity into CO₂e." })] }),
798
+ /* @__PURE__ */ h("div", {
758
799
  className: "grid gap-4 py-2",
759
800
  children: [
760
- /* @__PURE__ */ m("div", {
801
+ /* @__PURE__ */ h("div", {
761
802
  className: "grid gap-1.5",
762
- children: [/* @__PURE__ */ p(_, {
803
+ children: [/* @__PURE__ */ m(v, {
763
804
  htmlFor: "efName",
764
805
  children: "Name *"
765
- }), /* @__PURE__ */ p(g, {
806
+ }), /* @__PURE__ */ m(_, {
766
807
  id: "efName",
767
808
  value: U.name,
768
809
  onChange: (e) => W({
@@ -772,33 +813,33 @@ function M() {
772
813
  placeholder: "Diesel (stationary combustion)"
773
814
  })]
774
815
  }),
775
- /* @__PURE__ */ m("div", {
816
+ /* @__PURE__ */ h("div", {
776
817
  className: "grid gap-2 sm:grid-cols-2",
777
- children: [/* @__PURE__ */ m("div", {
818
+ children: [/* @__PURE__ */ h("div", {
778
819
  className: "grid gap-1.5",
779
- children: [/* @__PURE__ */ p(_, {
820
+ children: [/* @__PURE__ */ m(v, {
780
821
  htmlFor: "efScope",
781
822
  children: "Scope"
782
- }), /* @__PURE__ */ m(C, {
823
+ }), /* @__PURE__ */ h(C, {
783
824
  value: U.scope,
784
825
  onValueChange: (e) => W({
785
826
  ...U,
786
827
  scope: e
787
828
  }),
788
- children: [/* @__PURE__ */ p(E, {
829
+ children: [/* @__PURE__ */ m(E, {
789
830
  id: "efScope",
790
- children: /* @__PURE__ */ p(D, {})
791
- }), /* @__PURE__ */ p(w, { children: O.map((e) => /* @__PURE__ */ p(T, {
831
+ children: /* @__PURE__ */ m(D, {})
832
+ }), /* @__PURE__ */ m(w, { children: O.map((e) => /* @__PURE__ */ m(T, {
792
833
  value: e,
793
- children: r(e)
834
+ children: i(e)
794
835
  }, e)) })]
795
836
  })]
796
- }), /* @__PURE__ */ m("div", {
837
+ }), /* @__PURE__ */ h("div", {
797
838
  className: "grid gap-1.5",
798
- children: [/* @__PURE__ */ p(_, {
839
+ children: [/* @__PURE__ */ m(v, {
799
840
  htmlFor: "efUnit",
800
841
  children: "Activity unit *"
801
- }), /* @__PURE__ */ p(g, {
842
+ }), /* @__PURE__ */ m(_, {
802
843
  id: "efUnit",
803
844
  value: U.activityUnit,
804
845
  onChange: (e) => W({
@@ -809,14 +850,14 @@ function M() {
809
850
  })]
810
851
  })]
811
852
  }),
812
- /* @__PURE__ */ m("div", {
853
+ /* @__PURE__ */ h("div", {
813
854
  className: "grid gap-2 sm:grid-cols-2",
814
- children: [/* @__PURE__ */ m("div", {
855
+ children: [/* @__PURE__ */ h("div", {
815
856
  className: "grid gap-1.5",
816
- children: [/* @__PURE__ */ p(_, {
857
+ children: [/* @__PURE__ */ m(v, {
817
858
  htmlFor: "efFactor",
818
859
  children: "Factor (kg CO₂e / unit) *"
819
- }), /* @__PURE__ */ p(g, {
860
+ }), /* @__PURE__ */ m(_, {
820
861
  id: "efFactor",
821
862
  type: "number",
822
863
  min: "0",
@@ -828,12 +869,12 @@ function M() {
828
869
  }),
829
870
  placeholder: "2.68"
830
871
  })]
831
- }), /* @__PURE__ */ m("div", {
872
+ }), /* @__PURE__ */ h("div", {
832
873
  className: "grid gap-1.5",
833
- children: [/* @__PURE__ */ p(_, {
874
+ children: [/* @__PURE__ */ m(v, {
834
875
  htmlFor: "efYear",
835
876
  children: "Valid year"
836
- }), /* @__PURE__ */ p(g, {
877
+ }), /* @__PURE__ */ m(_, {
837
878
  id: "efYear",
838
879
  type: "number",
839
880
  step: "1",
@@ -846,12 +887,12 @@ function M() {
846
887
  })]
847
888
  })]
848
889
  }),
849
- /* @__PURE__ */ m("div", {
890
+ /* @__PURE__ */ h("div", {
850
891
  className: "grid gap-1.5",
851
- children: [/* @__PURE__ */ p(_, {
892
+ children: [/* @__PURE__ */ m(v, {
852
893
  htmlFor: "efSource",
853
894
  children: "Source"
854
- }), /* @__PURE__ */ p(g, {
895
+ }), /* @__PURE__ */ m(_, {
855
896
  id: "efSource",
856
897
  value: U.source,
857
898
  onChange: (e) => W({
@@ -861,41 +902,41 @@ function M() {
861
902
  placeholder: "DEFRA / IPCC / EPA"
862
903
  })]
863
904
  }),
864
- J && /* @__PURE__ */ p("p", {
905
+ J && /* @__PURE__ */ m("p", {
865
906
  className: "text-sm text-status-error-text",
866
907
  children: J
867
908
  })
868
909
  ]
869
910
  }),
870
- /* @__PURE__ */ m(b, { children: [/* @__PURE__ */ p(h, {
911
+ /* @__PURE__ */ h(b, { children: [/* @__PURE__ */ m(g, {
871
912
  variant: "outline",
872
913
  onClick: () => H(!1),
873
914
  children: "Cancel"
874
- }), /* @__PURE__ */ p(h, {
875
- onClick: $e,
876
- disabled: Ke.isPending,
877
- children: Ke.isPending ? "Creating…" : "Create factor"
915
+ }), /* @__PURE__ */ m(g, {
916
+ onClick: nt,
917
+ disabled: Ye.isPending,
918
+ children: Ye.isPending ? "Creating…" : "Create factor"
878
919
  })] })
879
920
  ] })
880
921
  }),
881
- /* @__PURE__ */ p(v, {
882
- open: Le,
922
+ /* @__PURE__ */ m(we, {
923
+ open: Be,
883
924
  onOpenChange: (e) => {
884
925
  G(e), e || (q(j), Y(null));
885
926
  },
886
- children: /* @__PURE__ */ m(Se, { children: [
887
- /* @__PURE__ */ m(x, { children: [/* @__PURE__ */ p(S, { children: "New reduction target" }), /* @__PURE__ */ p(y, { children: "Commit to a measurable reduction from a baseline to a target year." })] }),
888
- /* @__PURE__ */ m("div", {
927
+ children: /* @__PURE__ */ h(y, { children: [
928
+ /* @__PURE__ */ h(x, { children: [/* @__PURE__ */ m(S, { children: "New reduction target" }), /* @__PURE__ */ m(Te, { children: "Commit to a measurable reduction from a baseline to a target year." })] }),
929
+ /* @__PURE__ */ h("div", {
889
930
  className: "grid gap-4 py-2",
890
931
  children: [
891
- /* @__PURE__ */ m("div", {
932
+ /* @__PURE__ */ h("div", {
892
933
  className: "grid gap-2 sm:grid-cols-2",
893
- children: [/* @__PURE__ */ m("div", {
934
+ children: [/* @__PURE__ */ h("div", {
894
935
  className: "grid gap-1.5",
895
- children: [/* @__PURE__ */ p(_, {
936
+ children: [/* @__PURE__ */ m(v, {
896
937
  htmlFor: "rtName",
897
938
  children: "Name *"
898
- }), /* @__PURE__ */ p(g, {
939
+ }), /* @__PURE__ */ m(_, {
899
940
  id: "rtName",
900
941
  value: K.name,
901
942
  onChange: (e) => q({
@@ -904,12 +945,12 @@ function M() {
904
945
  }),
905
946
  placeholder: "Net-zero operations"
906
947
  })]
907
- }), /* @__PURE__ */ m("div", {
948
+ }), /* @__PURE__ */ h("div", {
908
949
  className: "grid gap-1.5",
909
- children: [/* @__PURE__ */ p(_, {
950
+ children: [/* @__PURE__ */ m(v, {
910
951
  htmlFor: "rtMetric",
911
952
  children: "Metric *"
912
- }), /* @__PURE__ */ p(g, {
953
+ }), /* @__PURE__ */ m(_, {
913
954
  id: "rtMetric",
914
955
  value: K.metric,
915
956
  onChange: (e) => q({
@@ -920,15 +961,15 @@ function M() {
920
961
  })]
921
962
  })]
922
963
  }),
923
- /* @__PURE__ */ m("div", {
964
+ /* @__PURE__ */ h("div", {
924
965
  className: "grid gap-2 sm:grid-cols-3",
925
966
  children: [
926
- /* @__PURE__ */ m("div", {
967
+ /* @__PURE__ */ h("div", {
927
968
  className: "grid gap-1.5",
928
- children: [/* @__PURE__ */ p(_, {
969
+ children: [/* @__PURE__ */ m(v, {
929
970
  htmlFor: "rtBaseVal",
930
971
  children: "Baseline value *"
931
- }), /* @__PURE__ */ p(g, {
972
+ }), /* @__PURE__ */ m(_, {
932
973
  id: "rtBaseVal",
933
974
  type: "number",
934
975
  step: "any",
@@ -940,12 +981,12 @@ function M() {
940
981
  placeholder: "1000"
941
982
  })]
942
983
  }),
943
- /* @__PURE__ */ m("div", {
984
+ /* @__PURE__ */ h("div", {
944
985
  className: "grid gap-1.5",
945
- children: [/* @__PURE__ */ p(_, {
986
+ children: [/* @__PURE__ */ m(v, {
946
987
  htmlFor: "rtBaseYear",
947
988
  children: "Baseline year *"
948
- }), /* @__PURE__ */ p(g, {
989
+ }), /* @__PURE__ */ m(_, {
949
990
  id: "rtBaseYear",
950
991
  type: "number",
951
992
  step: "1",
@@ -957,12 +998,12 @@ function M() {
957
998
  placeholder: "2024"
958
999
  })]
959
1000
  }),
960
- /* @__PURE__ */ m("div", {
1001
+ /* @__PURE__ */ h("div", {
961
1002
  className: "grid gap-1.5",
962
- children: [/* @__PURE__ */ p(_, {
1003
+ children: [/* @__PURE__ */ m(v, {
963
1004
  htmlFor: "rtUnit",
964
1005
  children: "Unit *"
965
- }), /* @__PURE__ */ p(g, {
1006
+ }), /* @__PURE__ */ m(_, {
966
1007
  id: "rtUnit",
967
1008
  value: K.unit,
968
1009
  onChange: (e) => q({
@@ -974,14 +1015,14 @@ function M() {
974
1015
  })
975
1016
  ]
976
1017
  }),
977
- /* @__PURE__ */ m("div", {
1018
+ /* @__PURE__ */ h("div", {
978
1019
  className: "grid gap-2 sm:grid-cols-2",
979
- children: [/* @__PURE__ */ m("div", {
1020
+ children: [/* @__PURE__ */ h("div", {
980
1021
  className: "grid gap-1.5",
981
- children: [/* @__PURE__ */ p(_, {
1022
+ children: [/* @__PURE__ */ m(v, {
982
1023
  htmlFor: "rtTargetVal",
983
1024
  children: "Target value *"
984
- }), /* @__PURE__ */ p(g, {
1025
+ }), /* @__PURE__ */ m(_, {
985
1026
  id: "rtTargetVal",
986
1027
  type: "number",
987
1028
  step: "any",
@@ -992,12 +1033,12 @@ function M() {
992
1033
  }),
993
1034
  placeholder: "0"
994
1035
  })]
995
- }), /* @__PURE__ */ m("div", {
1036
+ }), /* @__PURE__ */ h("div", {
996
1037
  className: "grid gap-1.5",
997
- children: [/* @__PURE__ */ p(_, {
1038
+ children: [/* @__PURE__ */ m(v, {
998
1039
  htmlFor: "rtTargetYear",
999
1040
  children: "Target year *"
1000
- }), /* @__PURE__ */ p(g, {
1041
+ }), /* @__PURE__ */ m(_, {
1001
1042
  id: "rtTargetYear",
1002
1043
  type: "number",
1003
1044
  step: "1",
@@ -1010,12 +1051,12 @@ function M() {
1010
1051
  })]
1011
1052
  })]
1012
1053
  }),
1013
- /* @__PURE__ */ m("div", {
1054
+ /* @__PURE__ */ h("div", {
1014
1055
  className: "grid gap-1.5",
1015
- children: [/* @__PURE__ */ p(_, {
1056
+ children: [/* @__PURE__ */ m(v, {
1016
1057
  htmlFor: "rtDesc",
1017
1058
  children: "Description"
1018
- }), /* @__PURE__ */ p(Ce, {
1059
+ }), /* @__PURE__ */ m(Ee, {
1019
1060
  id: "rtDesc",
1020
1061
  rows: 2,
1021
1062
  value: K.description,
@@ -1026,20 +1067,20 @@ function M() {
1026
1067
  placeholder: "Optional context about this target."
1027
1068
  })]
1028
1069
  }),
1029
- J && /* @__PURE__ */ p("p", {
1070
+ J && /* @__PURE__ */ m("p", {
1030
1071
  className: "text-sm text-status-error-text",
1031
1072
  children: J
1032
1073
  })
1033
1074
  ]
1034
1075
  }),
1035
- /* @__PURE__ */ m(b, { children: [/* @__PURE__ */ p(h, {
1076
+ /* @__PURE__ */ h(b, { children: [/* @__PURE__ */ m(g, {
1036
1077
  variant: "outline",
1037
1078
  onClick: () => G(!1),
1038
1079
  children: "Cancel"
1039
- }), /* @__PURE__ */ p(h, {
1040
- onClick: et,
1041
- disabled: qe.isPending,
1042
- children: qe.isPending ? "Creating…" : "Create target"
1080
+ }), /* @__PURE__ */ m(g, {
1081
+ onClick: rt,
1082
+ disabled: Xe.isPending,
1083
+ children: Xe.isPending ? "Creating…" : "Create target"
1043
1084
  })] })
1044
1085
  ] })
1045
1086
  })
@@ -1047,6 +1088,6 @@ function M() {
1047
1088
  });
1048
1089
  }
1049
1090
  //#endregion
1050
- export { M as CarbonPage };
1091
+ export { N as CarbonPage };
1051
1092
 
1052
1093
  //# sourceMappingURL=CarbonPage.js.map