@burdenoff/microfe-ecoimpacthub 2026.1123.2 → 2026.1124.2
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/ecoimpacthub/EcoImpactHubRoutes.js +47 -39
- package/dist/ecoimpacthub/EcoImpactHubRoutes.js.map +1 -1
- package/dist/ecoimpacthub/hooks/ecoTransport.d.ts +2 -0
- package/dist/ecoimpacthub/hooks/ecoTransport.js +1 -0
- package/dist/ecoimpacthub/hooks/ecoTransport.js.map +1 -1
- package/dist/ecoimpacthub/hooks/index.d.ts +1 -0
- package/dist/ecoimpacthub/hooks/index.js +3 -2
- package/dist/ecoimpacthub/hooks/useEcoAiOperations.d.ts +15 -0
- package/dist/ecoimpacthub/hooks/useEcoAiOperations.js +90 -0
- package/dist/ecoimpacthub/hooks/useEcoAiOperations.js.map +1 -0
- package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.js +1 -1
- package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.js.map +1 -1
- package/dist/ecoimpacthub/pages/ai/AiOperationsPage.d.ts +21 -0
- package/dist/ecoimpacthub/pages/ai/AiOperationsPage.js +536 -0
- package/dist/ecoimpacthub/pages/ai/AiOperationsPage.js.map +1 -0
- package/dist/ecoimpacthub/pages/carbon/CarbonPage.js +346 -320
- package/dist/ecoimpacthub/pages/carbon/CarbonPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/habitat/HabitatProjectsPage.js +85 -81
- package/dist/ecoimpacthub/pages/habitat/HabitatProjectsPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/habitat/StewardshipPage.d.ts +1 -0
- package/dist/ecoimpacthub/pages/habitat/StewardshipPage.js +193 -0
- package/dist/ecoimpacthub/pages/habitat/StewardshipPage.js.map +1 -0
- package/dist/ecoimpacthub/pages/habitat/stewardship.d.ts +34 -0
- package/dist/ecoimpacthub/pages/habitat/stewardship.js +83 -0
- package/dist/ecoimpacthub/pages/habitat/stewardship.js.map +1 -0
- package/dist/ecoimpacthub/pages/observations/ObservationsPage.js +165 -143
- package/dist/ecoimpacthub/pages/observations/ObservationsPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js +346 -185
- package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js.map +1 -1
- package/dist/ecoimpacthub/types/index.d.ts +83 -0
- package/dist/ecoimpacthub/utils/pageContext.js +2 -1
- package/dist/ecoimpacthub/utils/pageContext.js.map +1 -1
- package/package.json +2 -2
|
@@ -14,28 +14,29 @@ import "../../hooks/index.js";
|
|
|
14
14
|
import { DraftWithAiDialog as ve } from "./DraftWithAiDialog.js";
|
|
15
15
|
import { DraftReviewPanel as ye } from "./DraftReviewPanel.js";
|
|
16
16
|
import { SuggestFactorPanel as be } from "./SuggestFactorPanel.js";
|
|
17
|
-
import { formatCo2e as o, formatDate as xe, formatEnumLabel as s, formatNumber as c, formatPercent as
|
|
18
|
-
import { useMemo as
|
|
19
|
-
import { Factory as
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
17
|
+
import { formatCo2e as o, formatDate as xe, formatEnumLabel as s, formatNumber as c, formatPercent as Se } from "../../utils/formatters.js";
|
|
18
|
+
import { useMemo as Ce, useState as l } from "react";
|
|
19
|
+
import { Factory as u, Flame as we, Leaf as Te, Plus as d, Sparkles as Ee, Target as De, Truck as Oe, Zap as ke } from "lucide-react";
|
|
20
|
+
import { useSearchParams as Ae } from "react-router";
|
|
21
|
+
import { Fragment as je, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
22
|
+
import { Button as m, Input as h, Label as g, ResponsiveDialog as _, ResponsiveDialogContent as v, ResponsiveDialogDescription as Me, ResponsiveDialogFooter as Ne, ResponsiveDialogHeader as Pe, ResponsiveDialogTitle as y, Select as b, SelectContent as x, SelectItem as S, SelectTrigger as C, SelectValue as w, Textarea as Fe } from "@burdenoff/fe-libs/ui";
|
|
22
23
|
// src/ecoimpacthub/pages/carbon/CarbonPage.tsx
|
|
23
|
-
var
|
|
24
|
+
var T = [
|
|
24
25
|
"SCOPE_1",
|
|
25
26
|
"SCOPE_2",
|
|
26
27
|
"SCOPE_3"
|
|
27
|
-
],
|
|
28
|
+
], Ie = [
|
|
28
29
|
"DRAFT",
|
|
29
30
|
"RECORDED",
|
|
30
31
|
"VERIFIED",
|
|
31
32
|
"ADJUSTED"
|
|
32
|
-
],
|
|
33
|
+
], Le = [
|
|
33
34
|
"PROPOSED",
|
|
34
35
|
"ACTIVE",
|
|
35
36
|
"ACHIEVED",
|
|
36
37
|
"MISSED",
|
|
37
38
|
"RETIRED"
|
|
38
|
-
],
|
|
39
|
+
], Re = 25, ze = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), E = {
|
|
39
40
|
category: "",
|
|
40
41
|
scope: "SCOPE_1",
|
|
41
42
|
activityValue: "",
|
|
@@ -44,14 +45,14 @@ var E = [
|
|
|
44
45
|
siteId: "",
|
|
45
46
|
periodStart: "",
|
|
46
47
|
notes: ""
|
|
47
|
-
},
|
|
48
|
+
}, D = {
|
|
48
49
|
name: "",
|
|
49
50
|
scope: "SCOPE_1",
|
|
50
51
|
activityUnit: "",
|
|
51
52
|
factorKgco2e: "",
|
|
52
53
|
source: "",
|
|
53
54
|
validYear: ""
|
|
54
|
-
},
|
|
55
|
+
}, O = {
|
|
55
56
|
name: "",
|
|
56
57
|
metric: "",
|
|
57
58
|
baselineValue: "",
|
|
@@ -60,13 +61,13 @@ var E = [
|
|
|
60
61
|
targetYear: "",
|
|
61
62
|
unit: "",
|
|
62
63
|
description: ""
|
|
63
|
-
},
|
|
64
|
+
}, Be = (e) => Math.max(0, Math.min(100, e)), Ve = {
|
|
64
65
|
PROPOSED: "var(--color-text-tertiary)",
|
|
65
66
|
ACTIVE: "var(--color-action-primary-bg)",
|
|
66
67
|
ACHIEVED: "var(--color-status-success-text)",
|
|
67
68
|
MISSED: "var(--color-status-error-text)",
|
|
68
69
|
RETIRED: "var(--color-text-tertiary)"
|
|
69
|
-
},
|
|
70
|
+
}, k = (e, t, n) => {
|
|
70
71
|
if (e == null || t == null || t <= 0) return;
|
|
71
72
|
let r = e / t * 100;
|
|
72
73
|
return /* @__PURE__ */ p("div", {
|
|
@@ -77,95 +78,95 @@ var E = [
|
|
|
77
78
|
height: 4
|
|
78
79
|
}), /* @__PURE__ */ p("p", {
|
|
79
80
|
className: "text-xs tabular-nums text-text-tertiary",
|
|
80
|
-
children: [
|
|
81
|
+
children: [Se(r), " of total"]
|
|
81
82
|
})]
|
|
82
83
|
});
|
|
83
84
|
};
|
|
84
|
-
function
|
|
85
|
-
let a = me(), [
|
|
85
|
+
function He() {
|
|
86
|
+
let a = me(), [Se, He] = Ae(), A = Se.get("highlight"), [j, Ue] = l("ledger"), [We, Ge] = l(!1), [M, Ke] = l("ALL"), [N, qe] = l("ALL"), [P, Je] = l("ALL"), F = pe(), [I, Ye] = l("ALL"), [L, Xe] = l("ALL"), [Ze, R] = l(!1), [z, B] = l(E), [Qe, V] = l(!1), [H, U] = l(D), [$e, W] = l(!1), [G, K] = l(O), [q, J] = l(null), et = de({ pagination: {
|
|
86
87
|
limit: 100,
|
|
87
88
|
offset: 0
|
|
88
|
-
} }),
|
|
89
|
+
} }), Y = Ce(() => {
|
|
89
90
|
let e = {};
|
|
90
|
-
for (let t of
|
|
91
|
+
for (let t of et.data?.items ?? []) e[t.id] = t.name;
|
|
91
92
|
return e;
|
|
92
|
-
}, [
|
|
93
|
-
scope:
|
|
94
|
-
siteId:
|
|
95
|
-
status:
|
|
93
|
+
}, [et.data]), X = ie(), Z = re({
|
|
94
|
+
scope: M === "ALL" ? void 0 : M,
|
|
95
|
+
siteId: P === "ALL" ? void 0 : P,
|
|
96
|
+
status: N === "ALL" ? void 0 : N,
|
|
96
97
|
pagination: {
|
|
97
|
-
limit:
|
|
98
|
-
cursor:
|
|
98
|
+
limit: Re,
|
|
99
|
+
cursor: F.cursor
|
|
99
100
|
}
|
|
100
|
-
}),
|
|
101
|
-
|
|
101
|
+
}), tt = Z.data?.items ?? [], nt = se(), Q = se(I === "ALL" ? void 0 : I), rt = Q.data?.items ?? [], $ = le(L === "ALL" ? void 0 : L), it = $.data?.items ?? [], at = ce(), ot = fe(), st = ae(), ct = oe(), lt = ue(), ut = () => {
|
|
102
|
+
B({
|
|
103
|
+
...E,
|
|
104
|
+
periodStart: ze()
|
|
105
|
+
}), J(null), R(!0);
|
|
106
|
+
}, dt = (e) => {
|
|
107
|
+
U({
|
|
102
108
|
...D,
|
|
103
|
-
periodStart: Le()
|
|
104
|
-
}), q(null), L(!0);
|
|
105
|
-
}, st = (e) => {
|
|
106
|
-
H({
|
|
107
|
-
...O,
|
|
108
109
|
...e
|
|
109
|
-
}),
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
if (!
|
|
110
|
+
}), J(null), V(!0);
|
|
111
|
+
}, ft = () => {
|
|
112
|
+
K(O), J(null), W(!0);
|
|
113
|
+
}, pt = async () => {
|
|
114
|
+
if (!z.category.trim() || !z.activityValue || !z.activityUnit.trim()) J("Category, activity value and unit are required.");
|
|
114
115
|
else {
|
|
115
|
-
|
|
116
|
+
J(null);
|
|
116
117
|
try {
|
|
117
|
-
await
|
|
118
|
-
category:
|
|
119
|
-
scope:
|
|
120
|
-
activityValue: Number(
|
|
121
|
-
activityUnit:
|
|
122
|
-
factorId:
|
|
123
|
-
siteId:
|
|
124
|
-
periodStart: new Date(
|
|
125
|
-
notes:
|
|
126
|
-
}),
|
|
118
|
+
await at.mutateAsync({
|
|
119
|
+
category: z.category.trim(),
|
|
120
|
+
scope: z.scope,
|
|
121
|
+
activityValue: Number(z.activityValue),
|
|
122
|
+
activityUnit: z.activityUnit.trim(),
|
|
123
|
+
factorId: z.factorId || null,
|
|
124
|
+
siteId: z.siteId || null,
|
|
125
|
+
periodStart: new Date(z.periodStart || ze()).toISOString(),
|
|
126
|
+
notes: z.notes.trim() || null
|
|
127
|
+
}), R(!1), B(E);
|
|
127
128
|
} catch (e) {
|
|
128
|
-
|
|
129
|
+
J(e instanceof Error ? e.message : "Failed to record carbon entry.");
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
|
-
},
|
|
132
|
-
if (!
|
|
132
|
+
}, mt = async () => {
|
|
133
|
+
if (!H.name.trim() || !H.activityUnit.trim() || !H.factorKgco2e) J("Name, activity unit and factor value are required.");
|
|
133
134
|
else {
|
|
134
|
-
|
|
135
|
+
J(null);
|
|
135
136
|
try {
|
|
136
|
-
await
|
|
137
|
-
name:
|
|
138
|
-
scope:
|
|
139
|
-
activityUnit:
|
|
140
|
-
factorKgco2e: Number(
|
|
141
|
-
source:
|
|
142
|
-
validYear:
|
|
143
|
-
}),
|
|
137
|
+
await st.mutateAsync({
|
|
138
|
+
name: H.name.trim(),
|
|
139
|
+
scope: H.scope,
|
|
140
|
+
activityUnit: H.activityUnit.trim(),
|
|
141
|
+
factorKgco2e: Number(H.factorKgco2e),
|
|
142
|
+
source: H.source.trim() || null,
|
|
143
|
+
validYear: H.validYear ? Number(H.validYear) : null
|
|
144
|
+
}), V(!1), U(D);
|
|
144
145
|
} catch (e) {
|
|
145
|
-
|
|
146
|
+
J(e instanceof Error ? e.message : "Failed to create emission factor.");
|
|
146
147
|
}
|
|
147
148
|
}
|
|
148
|
-
},
|
|
149
|
-
if (!
|
|
150
|
-
else if (Number(
|
|
149
|
+
}, ht = async () => {
|
|
150
|
+
if (!G.name.trim() || !G.metric.trim() || !G.baselineValue || !G.baselineYear || !G.targetValue || !G.targetYear || !G.unit.trim()) J("All fields except description are required.");
|
|
151
|
+
else if (Number(G.targetYear) <= Number(G.baselineYear)) J("Target year must be later than the baseline year.");
|
|
151
152
|
else {
|
|
152
|
-
|
|
153
|
+
J(null);
|
|
153
154
|
try {
|
|
154
|
-
await
|
|
155
|
-
name:
|
|
156
|
-
metric:
|
|
157
|
-
baselineValue: Number(
|
|
158
|
-
baselineYear: Number(
|
|
159
|
-
targetValue: Number(
|
|
160
|
-
targetYear: Number(
|
|
161
|
-
unit:
|
|
162
|
-
description:
|
|
163
|
-
}),
|
|
155
|
+
await ct.mutateAsync({
|
|
156
|
+
name: G.name.trim(),
|
|
157
|
+
metric: G.metric.trim(),
|
|
158
|
+
baselineValue: Number(G.baselineValue),
|
|
159
|
+
baselineYear: Number(G.baselineYear),
|
|
160
|
+
targetValue: Number(G.targetValue),
|
|
161
|
+
targetYear: Number(G.targetYear),
|
|
162
|
+
unit: G.unit.trim(),
|
|
163
|
+
description: G.description.trim() || null
|
|
164
|
+
}), W(!1), K(O);
|
|
164
165
|
} catch (e) {
|
|
165
|
-
|
|
166
|
+
J(e instanceof Error ? e.message : "Failed to create reduction target.");
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
|
-
},
|
|
169
|
+
}, gt = [
|
|
169
170
|
{
|
|
170
171
|
key: "category",
|
|
171
172
|
header: "Category",
|
|
@@ -235,17 +236,17 @@ function A() {
|
|
|
235
236
|
render: (e) => e.status === "DRAFT" ? /* @__PURE__ */ f(m, {
|
|
236
237
|
size: "sm",
|
|
237
238
|
variant: "outline",
|
|
238
|
-
onClick: () =>
|
|
239
|
+
onClick: () => Ue("drafts"),
|
|
239
240
|
children: a("ecoCarbon.ai.review.reviewAction", "Review")
|
|
240
241
|
}) : e.status === "VERIFIED" ? null : /* @__PURE__ */ f(m, {
|
|
241
242
|
size: "sm",
|
|
242
243
|
variant: "outline",
|
|
243
|
-
onClick: () =>
|
|
244
|
-
disabled:
|
|
244
|
+
onClick: () => ot.mutate(e.id),
|
|
245
|
+
disabled: ot.isPending,
|
|
245
246
|
children: "Verify"
|
|
246
247
|
})
|
|
247
248
|
}
|
|
248
|
-
],
|
|
249
|
+
], _t = [
|
|
249
250
|
{
|
|
250
251
|
key: "name",
|
|
251
252
|
header: "Factor",
|
|
@@ -299,7 +300,7 @@ function A() {
|
|
|
299
300
|
align: "right",
|
|
300
301
|
render: (e) => e.isActive ? /* @__PURE__ */ f(n, { status: "OK" }) : /* @__PURE__ */ f(n, { status: "Inactive" })
|
|
301
302
|
}
|
|
302
|
-
],
|
|
303
|
+
], vt = [
|
|
303
304
|
{
|
|
304
305
|
key: "name",
|
|
305
306
|
header: "Target",
|
|
@@ -351,12 +352,12 @@ function A() {
|
|
|
351
352
|
key: "reduction",
|
|
352
353
|
header: "Planned reduction",
|
|
353
354
|
render: (e) => {
|
|
354
|
-
let t = e.baselineValue > 0 ?
|
|
355
|
+
let t = e.baselineValue > 0 ? Be((e.baselineValue - e.targetValue) / e.baselineValue * 100) : 0;
|
|
355
356
|
return /* @__PURE__ */ p("div", {
|
|
356
357
|
className: "flex min-w-[10rem] items-center gap-3",
|
|
357
358
|
children: [/* @__PURE__ */ f(ge, {
|
|
358
359
|
value: t,
|
|
359
|
-
color:
|
|
360
|
+
color: Ve[e.status] ?? "var(--color-action-primary-bg)",
|
|
360
361
|
height: 8,
|
|
361
362
|
className: "flex-1"
|
|
362
363
|
}), /* @__PURE__ */ p("span", {
|
|
@@ -375,26 +376,26 @@ function A() {
|
|
|
375
376
|
key: "setStatus",
|
|
376
377
|
header: "",
|
|
377
378
|
align: "right",
|
|
378
|
-
render: (e) => /* @__PURE__ */ p(
|
|
379
|
+
render: (e) => /* @__PURE__ */ p(b, {
|
|
379
380
|
value: e.status,
|
|
380
|
-
onValueChange: (t) =>
|
|
381
|
+
onValueChange: (t) => lt.mutate({
|
|
381
382
|
id: e.id,
|
|
382
383
|
status: t
|
|
383
384
|
}),
|
|
384
|
-
children: [/* @__PURE__ */ f(
|
|
385
|
+
children: [/* @__PURE__ */ f(C, {
|
|
385
386
|
className: "h-8 w-36",
|
|
386
|
-
children: /* @__PURE__ */ f(
|
|
387
|
-
}), /* @__PURE__ */ f(
|
|
387
|
+
children: /* @__PURE__ */ f(w, {})
|
|
388
|
+
}), /* @__PURE__ */ f(x, { children: Le.map((e) => /* @__PURE__ */ f(S, {
|
|
388
389
|
value: e,
|
|
389
390
|
children: s(e)
|
|
390
391
|
}, e)) })]
|
|
391
392
|
})
|
|
392
393
|
}
|
|
393
|
-
],
|
|
394
|
+
], yt = [
|
|
394
395
|
{
|
|
395
396
|
value: "ledger",
|
|
396
397
|
label: "Ledger",
|
|
397
|
-
icon: /* @__PURE__ */ f(
|
|
398
|
+
icon: /* @__PURE__ */ f(u, { className: "h-4 w-4" })
|
|
398
399
|
},
|
|
399
400
|
{
|
|
400
401
|
value: "drafts",
|
|
@@ -405,17 +406,17 @@ function A() {
|
|
|
405
406
|
value: "factors",
|
|
406
407
|
label: "Emission factors",
|
|
407
408
|
icon: /* @__PURE__ */ f(Te, { className: "h-4 w-4" }),
|
|
408
|
-
count:
|
|
409
|
+
count: Q.data?.items?.length
|
|
409
410
|
},
|
|
410
411
|
{
|
|
411
412
|
value: "targets",
|
|
412
413
|
label: "Reduction targets",
|
|
413
414
|
icon: /* @__PURE__ */ f(De, { className: "h-4 w-4" }),
|
|
414
|
-
count:
|
|
415
|
+
count: $.data?.items?.length
|
|
415
416
|
}
|
|
416
|
-
],
|
|
417
|
+
], bt = /* @__PURE__ */ p(m, {
|
|
417
418
|
variant: "outline",
|
|
418
|
-
onClick: () =>
|
|
419
|
+
onClick: () => Ge(!0),
|
|
419
420
|
children: [
|
|
420
421
|
/* @__PURE__ */ f(Ee, { className: "mr-1.5 h-4 w-4" }),
|
|
421
422
|
" ",
|
|
@@ -425,17 +426,17 @@ function A() {
|
|
|
425
426
|
return /* @__PURE__ */ p(e, {
|
|
426
427
|
title: "Carbon & Sustainability",
|
|
427
428
|
description: "Carbon ledger, emission factors & science-based reduction targets — GHG Protocol Scope 1 / 2 / 3.",
|
|
428
|
-
actions:
|
|
429
|
+
actions: j === "ledger" ? /* @__PURE__ */ p("div", {
|
|
429
430
|
className: "flex flex-wrap gap-2",
|
|
430
|
-
children: [
|
|
431
|
-
onClick:
|
|
431
|
+
children: [bt, /* @__PURE__ */ p(m, {
|
|
432
|
+
onClick: ut,
|
|
432
433
|
children: [/* @__PURE__ */ f(d, { className: "mr-1.5 h-4 w-4" }), " Record entry"]
|
|
433
434
|
})]
|
|
434
|
-
}) :
|
|
435
|
-
onClick: () =>
|
|
435
|
+
}) : j === "drafts" ? bt : j === "factors" ? /* @__PURE__ */ p(m, {
|
|
436
|
+
onClick: () => dt(),
|
|
436
437
|
children: [/* @__PURE__ */ f(d, { className: "mr-1.5 h-4 w-4" }), " New factor"]
|
|
437
438
|
}) : /* @__PURE__ */ p(m, {
|
|
438
|
-
onClick:
|
|
439
|
+
onClick: ft,
|
|
439
440
|
children: [/* @__PURE__ */ f(d, { className: "mr-1.5 h-4 w-4" }), " New target"]
|
|
440
441
|
}),
|
|
441
442
|
children: [
|
|
@@ -443,16 +444,16 @@ function A() {
|
|
|
443
444
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
444
445
|
children: [
|
|
445
446
|
/* @__PURE__ */ f(t, {
|
|
446
|
-
icon: /* @__PURE__ */ f(
|
|
447
|
-
value:
|
|
447
|
+
icon: /* @__PURE__ */ f(u, { className: "h-5 w-5" }),
|
|
448
|
+
value: X.data ? o(X.data.total) : "—",
|
|
448
449
|
label: "Total footprint",
|
|
449
450
|
featured: !0,
|
|
450
|
-
footer:
|
|
451
|
+
footer: X.data && X.data.total > 0 ? /* @__PURE__ */ p("div", {
|
|
451
452
|
className: "space-y-2",
|
|
452
453
|
children: [/* @__PURE__ */ f(_e, {
|
|
453
|
-
scope1:
|
|
454
|
-
scope2:
|
|
455
|
-
scope3:
|
|
454
|
+
scope1: X.data.scope1,
|
|
455
|
+
scope2: X.data.scope2,
|
|
456
|
+
scope3: X.data.scope3,
|
|
456
457
|
height: 6
|
|
457
458
|
}), /* @__PURE__ */ f("p", {
|
|
458
459
|
className: "text-xs text-text-tertiary",
|
|
@@ -462,196 +463,221 @@ function A() {
|
|
|
462
463
|
}),
|
|
463
464
|
/* @__PURE__ */ f(t, {
|
|
464
465
|
icon: /* @__PURE__ */ f(we, { className: "h-5 w-5" }),
|
|
465
|
-
value:
|
|
466
|
+
value: X.data ? o(X.data.scope1) : "—",
|
|
466
467
|
label: "Scope 1 · Direct",
|
|
467
|
-
footer:
|
|
468
|
+
footer: k(X.data?.scope1, X.data?.total, "SCOPE_1")
|
|
468
469
|
}),
|
|
469
470
|
/* @__PURE__ */ f(t, {
|
|
470
471
|
icon: /* @__PURE__ */ f(ke, { className: "h-5 w-5" }),
|
|
471
|
-
value:
|
|
472
|
+
value: X.data ? o(X.data.scope2) : "—",
|
|
472
473
|
label: "Scope 2 · Purchased energy",
|
|
473
|
-
footer:
|
|
474
|
+
footer: k(X.data?.scope2, X.data?.total, "SCOPE_2")
|
|
474
475
|
}),
|
|
475
476
|
/* @__PURE__ */ f(t, {
|
|
476
477
|
icon: /* @__PURE__ */ f(Oe, { className: "h-5 w-5" }),
|
|
477
|
-
value:
|
|
478
|
+
value: X.data ? o(X.data.scope3) : "—",
|
|
478
479
|
label: "Scope 3 · Value chain",
|
|
479
|
-
footer:
|
|
480
|
+
footer: k(X.data?.scope3, X.data?.total, "SCOPE_3")
|
|
480
481
|
})
|
|
481
482
|
]
|
|
482
483
|
}),
|
|
483
484
|
/* @__PURE__ */ f("div", {
|
|
484
485
|
className: "mt-6",
|
|
485
486
|
children: /* @__PURE__ */ f(ee, {
|
|
486
|
-
items:
|
|
487
|
-
value:
|
|
488
|
-
onChange:
|
|
487
|
+
items: yt,
|
|
488
|
+
value: j,
|
|
489
|
+
onChange: Ue
|
|
489
490
|
})
|
|
490
491
|
}),
|
|
491
|
-
|
|
492
|
+
j === "ledger" && /* @__PURE__ */ p("div", {
|
|
492
493
|
className: "mt-6",
|
|
493
494
|
children: [/* @__PURE__ */ p("div", {
|
|
494
495
|
className: "mb-5 flex flex-wrap items-center gap-3",
|
|
495
496
|
children: [
|
|
496
|
-
/* @__PURE__ */ p(
|
|
497
|
-
value:
|
|
497
|
+
/* @__PURE__ */ p(b, {
|
|
498
|
+
value: M,
|
|
498
499
|
onValueChange: (e) => {
|
|
499
|
-
|
|
500
|
+
Ke(e), F.reset();
|
|
500
501
|
},
|
|
501
|
-
children: [/* @__PURE__ */ f(
|
|
502
|
+
children: [/* @__PURE__ */ f(C, {
|
|
502
503
|
className: "w-40",
|
|
503
|
-
children: /* @__PURE__ */ f(
|
|
504
|
-
}), /* @__PURE__ */ p(
|
|
504
|
+
children: /* @__PURE__ */ f(w, { placeholder: "All scopes" })
|
|
505
|
+
}), /* @__PURE__ */ p(x, { children: [/* @__PURE__ */ f(S, {
|
|
505
506
|
value: "ALL",
|
|
506
507
|
children: "All scopes"
|
|
507
|
-
}),
|
|
508
|
+
}), T.map((e) => /* @__PURE__ */ f(S, {
|
|
508
509
|
value: e,
|
|
509
510
|
children: s(e)
|
|
510
511
|
}, e))] })]
|
|
511
512
|
}),
|
|
512
|
-
/* @__PURE__ */ p(
|
|
513
|
-
value:
|
|
513
|
+
/* @__PURE__ */ p(b, {
|
|
514
|
+
value: N,
|
|
514
515
|
onValueChange: (e) => {
|
|
515
|
-
|
|
516
|
+
qe(e), F.reset();
|
|
516
517
|
},
|
|
517
|
-
children: [/* @__PURE__ */ f(
|
|
518
|
+
children: [/* @__PURE__ */ f(C, {
|
|
518
519
|
className: "w-40",
|
|
519
|
-
children: /* @__PURE__ */ f(
|
|
520
|
-
}), /* @__PURE__ */ p(
|
|
520
|
+
children: /* @__PURE__ */ f(w, { placeholder: "All statuses" })
|
|
521
|
+
}), /* @__PURE__ */ p(x, { children: [/* @__PURE__ */ f(S, {
|
|
521
522
|
value: "ALL",
|
|
522
523
|
children: "All statuses"
|
|
523
|
-
}),
|
|
524
|
+
}), Ie.map((e) => /* @__PURE__ */ f(S, {
|
|
524
525
|
value: e,
|
|
525
526
|
children: s(e)
|
|
526
527
|
}, e))] })]
|
|
527
528
|
}),
|
|
528
|
-
/* @__PURE__ */ p(
|
|
529
|
-
value:
|
|
529
|
+
/* @__PURE__ */ p(b, {
|
|
530
|
+
value: P,
|
|
530
531
|
onValueChange: (e) => {
|
|
531
|
-
|
|
532
|
+
Je(e), F.reset();
|
|
532
533
|
},
|
|
533
|
-
children: [/* @__PURE__ */ f(
|
|
534
|
+
children: [/* @__PURE__ */ f(C, {
|
|
534
535
|
className: "w-48",
|
|
535
|
-
children: /* @__PURE__ */ f(
|
|
536
|
-
}), /* @__PURE__ */ p(
|
|
536
|
+
children: /* @__PURE__ */ f(w, { placeholder: "All sites" })
|
|
537
|
+
}), /* @__PURE__ */ p(x, { children: [/* @__PURE__ */ f(S, {
|
|
537
538
|
value: "ALL",
|
|
538
539
|
children: "All sites"
|
|
539
|
-
}), Object.entries(
|
|
540
|
+
}), Object.entries(Y).map(([e, t]) => /* @__PURE__ */ f(S, {
|
|
540
541
|
value: e,
|
|
541
542
|
children: t
|
|
542
543
|
}, e))] })]
|
|
543
544
|
})
|
|
544
545
|
]
|
|
545
|
-
}),
|
|
546
|
+
}), Z.isLoading ? /* @__PURE__ */ f(ne, { label: "Loading carbon ledger…" }) : Z.isError ? /* @__PURE__ */ f(te, {
|
|
546
547
|
message: "Couldn't load carbon entries.",
|
|
547
|
-
onRetry: () =>
|
|
548
|
-
}) :
|
|
548
|
+
onRetry: () => Z.refetch()
|
|
549
|
+
}) : tt.length === 0 ? /* @__PURE__ */ f(i, {
|
|
549
550
|
illustration: "empty-data",
|
|
550
|
-
icon: /* @__PURE__ */ f(
|
|
551
|
+
icon: /* @__PURE__ */ f(u, { className: "h-10 w-10" }),
|
|
551
552
|
title: "No carbon entries",
|
|
552
|
-
description:
|
|
553
|
+
description: M === "ALL" && N === "ALL" && P === "ALL" ? "Record activity to build your Scope 1–3 emissions ledger." : "No entries match these filters.",
|
|
553
554
|
action: /* @__PURE__ */ p(m, {
|
|
554
|
-
onClick:
|
|
555
|
+
onClick: ut,
|
|
555
556
|
children: [/* @__PURE__ */ f(d, { className: "mr-1.5 h-4 w-4" }), " Record entry"]
|
|
556
557
|
})
|
|
557
|
-
}) : /* @__PURE__ */ p(
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
558
|
+
}) : /* @__PURE__ */ p(je, { children: [
|
|
559
|
+
A && /* @__PURE__ */ p("div", {
|
|
560
|
+
role: "status",
|
|
561
|
+
"data-testid": "eco-carbon-highlight-banner",
|
|
562
|
+
className: "mb-3 flex items-center justify-between rounded-lg border border-border-seam bg-bg-sunken px-3 py-2 text-xs text-text-primary",
|
|
563
|
+
children: [/* @__PURE__ */ p("span", { children: [
|
|
564
|
+
"Highlighting cited carbon entry",
|
|
565
|
+
" ",
|
|
566
|
+
/* @__PURE__ */ f("code", {
|
|
567
|
+
className: "font-mono",
|
|
568
|
+
children: A
|
|
569
|
+
})
|
|
570
|
+
] }), /* @__PURE__ */ f(m, {
|
|
571
|
+
size: "sm",
|
|
572
|
+
variant: "ghost",
|
|
573
|
+
onClick: () => {
|
|
574
|
+
let e = new URLSearchParams(Se);
|
|
575
|
+
e.delete("highlight"), He(e, { replace: !0 });
|
|
576
|
+
},
|
|
577
|
+
children: "Clear highlight"
|
|
578
|
+
})]
|
|
579
|
+
}),
|
|
580
|
+
/* @__PURE__ */ f(r, {
|
|
581
|
+
columns: gt,
|
|
582
|
+
rows: tt,
|
|
583
|
+
rowKey: (e) => e.id,
|
|
584
|
+
rowClassName: (e) => A && e.id === A ? "bg-status-warning-bg-subtle/60 ring-1 ring-inset ring-border-strong" : void 0
|
|
585
|
+
}),
|
|
586
|
+
/* @__PURE__ */ f(he, {
|
|
587
|
+
page: F.page,
|
|
588
|
+
pageSize: Re,
|
|
589
|
+
itemCount: tt.length,
|
|
590
|
+
hasMore: Z.data?.pageInfo?.hasMore ?? !1,
|
|
591
|
+
onPageChange: (e) => F.onPageChange(e, Z.data?.pageInfo?.cursor)
|
|
592
|
+
})
|
|
593
|
+
] })]
|
|
568
594
|
}),
|
|
569
|
-
|
|
595
|
+
j === "drafts" && /* @__PURE__ */ f("div", {
|
|
570
596
|
className: "mt-6",
|
|
571
597
|
children: /* @__PURE__ */ f(ye, {
|
|
572
|
-
sites:
|
|
573
|
-
onDraftWithAi: () =>
|
|
598
|
+
sites: Y,
|
|
599
|
+
onDraftWithAi: () => Ge(!0)
|
|
574
600
|
})
|
|
575
601
|
}),
|
|
576
|
-
|
|
602
|
+
j === "factors" && /* @__PURE__ */ p("div", {
|
|
577
603
|
className: "mt-6",
|
|
578
604
|
children: [/* @__PURE__ */ f("div", {
|
|
579
605
|
className: "mb-5 flex flex-wrap items-center gap-3",
|
|
580
|
-
children: /* @__PURE__ */ p(
|
|
581
|
-
value:
|
|
582
|
-
onValueChange: (e) =>
|
|
583
|
-
children: [/* @__PURE__ */ f(
|
|
606
|
+
children: /* @__PURE__ */ p(b, {
|
|
607
|
+
value: I,
|
|
608
|
+
onValueChange: (e) => Ye(e),
|
|
609
|
+
children: [/* @__PURE__ */ f(C, {
|
|
584
610
|
className: "w-40",
|
|
585
|
-
children: /* @__PURE__ */ f(
|
|
586
|
-
}), /* @__PURE__ */ p(
|
|
611
|
+
children: /* @__PURE__ */ f(w, { placeholder: "All scopes" })
|
|
612
|
+
}), /* @__PURE__ */ p(x, { children: [/* @__PURE__ */ f(S, {
|
|
587
613
|
value: "ALL",
|
|
588
614
|
children: "All scopes"
|
|
589
|
-
}),
|
|
615
|
+
}), T.map((e) => /* @__PURE__ */ f(S, {
|
|
590
616
|
value: e,
|
|
591
617
|
children: s(e)
|
|
592
618
|
}, e))] })]
|
|
593
619
|
})
|
|
594
|
-
}),
|
|
620
|
+
}), Q.isLoading ? /* @__PURE__ */ f(ne, { label: "Loading emission factors…" }) : Q.isError ? /* @__PURE__ */ f(te, {
|
|
595
621
|
message: "Couldn't load emission factors.",
|
|
596
|
-
onRetry: () =>
|
|
597
|
-
}) :
|
|
622
|
+
onRetry: () => Q.refetch()
|
|
623
|
+
}) : rt.length === 0 ? /* @__PURE__ */ f(i, {
|
|
598
624
|
illustration: "empty-data",
|
|
599
625
|
icon: /* @__PURE__ */ f(Te, { className: "h-10 w-10" }),
|
|
600
626
|
title: "No emission factors",
|
|
601
|
-
description:
|
|
627
|
+
description: I === "ALL" ? "Add emission factors (kg CO₂e per activity unit) to convert activity into CO₂e." : "No emission factors match this scope.",
|
|
602
628
|
action: /* @__PURE__ */ p(m, {
|
|
603
|
-
onClick: () =>
|
|
629
|
+
onClick: () => dt(),
|
|
604
630
|
children: [/* @__PURE__ */ f(d, { className: "mr-1.5 h-4 w-4" }), " New factor"]
|
|
605
631
|
})
|
|
606
632
|
}) : /* @__PURE__ */ f(r, {
|
|
607
|
-
columns:
|
|
608
|
-
rows:
|
|
633
|
+
columns: _t,
|
|
634
|
+
rows: rt,
|
|
609
635
|
rowKey: (e) => e.id
|
|
610
636
|
})]
|
|
611
637
|
}),
|
|
612
|
-
|
|
638
|
+
j === "targets" && /* @__PURE__ */ p("div", {
|
|
613
639
|
className: "mt-6",
|
|
614
640
|
children: [/* @__PURE__ */ f("div", {
|
|
615
641
|
className: "mb-5 flex flex-wrap items-center gap-3",
|
|
616
|
-
children: /* @__PURE__ */ p(
|
|
617
|
-
value:
|
|
618
|
-
onValueChange: (e) =>
|
|
619
|
-
children: [/* @__PURE__ */ f(
|
|
642
|
+
children: /* @__PURE__ */ p(b, {
|
|
643
|
+
value: L,
|
|
644
|
+
onValueChange: (e) => Xe(e),
|
|
645
|
+
children: [/* @__PURE__ */ f(C, {
|
|
620
646
|
className: "w-44",
|
|
621
|
-
children: /* @__PURE__ */ f(
|
|
622
|
-
}), /* @__PURE__ */ p(
|
|
647
|
+
children: /* @__PURE__ */ f(w, { placeholder: "All statuses" })
|
|
648
|
+
}), /* @__PURE__ */ p(x, { children: [/* @__PURE__ */ f(S, {
|
|
623
649
|
value: "ALL",
|
|
624
650
|
children: "All statuses"
|
|
625
|
-
}),
|
|
651
|
+
}), Le.map((e) => /* @__PURE__ */ f(S, {
|
|
626
652
|
value: e,
|
|
627
653
|
children: s(e)
|
|
628
654
|
}, e))] })]
|
|
629
655
|
})
|
|
630
|
-
}),
|
|
656
|
+
}), $.isLoading ? /* @__PURE__ */ f(ne, { label: "Loading reduction targets…" }) : $.isError ? /* @__PURE__ */ f(te, {
|
|
631
657
|
message: "Couldn't load reduction targets.",
|
|
632
|
-
onRetry: () =>
|
|
633
|
-
}) :
|
|
658
|
+
onRetry: () => $.refetch()
|
|
659
|
+
}) : it.length === 0 ? /* @__PURE__ */ f(i, {
|
|
634
660
|
illustration: "empty-data",
|
|
635
661
|
icon: /* @__PURE__ */ f(De, { className: "h-10 w-10" }),
|
|
636
662
|
title: "No reduction targets",
|
|
637
|
-
description:
|
|
663
|
+
description: L === "ALL" ? "Set science-based reduction targets to track progress against a baseline." : "No targets match this status.",
|
|
638
664
|
action: /* @__PURE__ */ p(m, {
|
|
639
|
-
onClick:
|
|
665
|
+
onClick: ft,
|
|
640
666
|
children: [/* @__PURE__ */ f(d, { className: "mr-1.5 h-4 w-4" }), " New target"]
|
|
641
667
|
})
|
|
642
668
|
}) : /* @__PURE__ */ f(r, {
|
|
643
|
-
columns:
|
|
644
|
-
rows:
|
|
669
|
+
columns: vt,
|
|
670
|
+
rows: it,
|
|
645
671
|
rowKey: (e) => e.id
|
|
646
672
|
})]
|
|
647
673
|
}),
|
|
648
|
-
/* @__PURE__ */ f(
|
|
649
|
-
open:
|
|
674
|
+
/* @__PURE__ */ f(_, {
|
|
675
|
+
open: Ze,
|
|
650
676
|
onOpenChange: (e) => {
|
|
651
|
-
|
|
677
|
+
R(e), e || (B(E), J(null));
|
|
652
678
|
},
|
|
653
|
-
children: /* @__PURE__ */ p(
|
|
654
|
-
/* @__PURE__ */ p(
|
|
679
|
+
children: /* @__PURE__ */ p(v, { children: [
|
|
680
|
+
/* @__PURE__ */ p(Pe, { children: [/* @__PURE__ */ f(y, { children: "Record carbon entry" }), /* @__PURE__ */ f(Me, { children: "Log an activity — CO₂e is computed server-side from activity value × emission factor." })] }),
|
|
655
681
|
/* @__PURE__ */ p("div", {
|
|
656
682
|
className: "grid gap-4 py-2",
|
|
657
683
|
children: [
|
|
@@ -662,9 +688,9 @@ function A() {
|
|
|
662
688
|
children: "Category *"
|
|
663
689
|
}), /* @__PURE__ */ f(h, {
|
|
664
690
|
id: "ceCategory",
|
|
665
|
-
value:
|
|
666
|
-
onChange: (e) =>
|
|
667
|
-
...
|
|
691
|
+
value: z.category,
|
|
692
|
+
onChange: (e) => B({
|
|
693
|
+
...z,
|
|
668
694
|
category: e.target.value
|
|
669
695
|
}),
|
|
670
696
|
placeholder: "Diesel generators"
|
|
@@ -677,16 +703,16 @@ function A() {
|
|
|
677
703
|
children: [/* @__PURE__ */ f(g, {
|
|
678
704
|
htmlFor: "ceScope",
|
|
679
705
|
children: "Scope"
|
|
680
|
-
}), /* @__PURE__ */ p(
|
|
681
|
-
value:
|
|
682
|
-
onValueChange: (e) =>
|
|
683
|
-
...
|
|
706
|
+
}), /* @__PURE__ */ p(b, {
|
|
707
|
+
value: z.scope,
|
|
708
|
+
onValueChange: (e) => B({
|
|
709
|
+
...z,
|
|
684
710
|
scope: e
|
|
685
711
|
}),
|
|
686
|
-
children: [/* @__PURE__ */ f(
|
|
712
|
+
children: [/* @__PURE__ */ f(C, {
|
|
687
713
|
id: "ceScope",
|
|
688
|
-
children: /* @__PURE__ */ f(
|
|
689
|
-
}), /* @__PURE__ */ f(
|
|
714
|
+
children: /* @__PURE__ */ f(w, {})
|
|
715
|
+
}), /* @__PURE__ */ f(x, { children: T.map((e) => /* @__PURE__ */ f(S, {
|
|
690
716
|
value: e,
|
|
691
717
|
children: s(e)
|
|
692
718
|
}, e)) })]
|
|
@@ -699,9 +725,9 @@ function A() {
|
|
|
699
725
|
}), /* @__PURE__ */ f(h, {
|
|
700
726
|
id: "cePeriod",
|
|
701
727
|
type: "date",
|
|
702
|
-
value:
|
|
703
|
-
onChange: (e) =>
|
|
704
|
-
...
|
|
728
|
+
value: z.periodStart,
|
|
729
|
+
onChange: (e) => B({
|
|
730
|
+
...z,
|
|
705
731
|
periodStart: e.target.value
|
|
706
732
|
})
|
|
707
733
|
})]
|
|
@@ -719,9 +745,9 @@ function A() {
|
|
|
719
745
|
type: "number",
|
|
720
746
|
min: "0",
|
|
721
747
|
step: "any",
|
|
722
|
-
value:
|
|
723
|
-
onChange: (e) =>
|
|
724
|
-
...
|
|
748
|
+
value: z.activityValue,
|
|
749
|
+
onChange: (e) => B({
|
|
750
|
+
...z,
|
|
725
751
|
activityValue: e.target.value
|
|
726
752
|
}),
|
|
727
753
|
placeholder: "1200"
|
|
@@ -733,9 +759,9 @@ function A() {
|
|
|
733
759
|
children: "Activity unit *"
|
|
734
760
|
}), /* @__PURE__ */ f(h, {
|
|
735
761
|
id: "ceUnit",
|
|
736
|
-
value:
|
|
737
|
-
onChange: (e) =>
|
|
738
|
-
...
|
|
762
|
+
value: z.activityUnit,
|
|
763
|
+
onChange: (e) => B({
|
|
764
|
+
...z,
|
|
739
765
|
activityUnit: e.target.value
|
|
740
766
|
}),
|
|
741
767
|
placeholder: "L, kWh, km"
|
|
@@ -749,16 +775,16 @@ function A() {
|
|
|
749
775
|
children: [/* @__PURE__ */ f(g, {
|
|
750
776
|
htmlFor: "ceFactor",
|
|
751
777
|
children: "Emission factor"
|
|
752
|
-
}), /* @__PURE__ */ p(
|
|
753
|
-
value:
|
|
754
|
-
onValueChange: (e) =>
|
|
755
|
-
...
|
|
778
|
+
}), /* @__PURE__ */ p(b, {
|
|
779
|
+
value: z.factorId,
|
|
780
|
+
onValueChange: (e) => B({
|
|
781
|
+
...z,
|
|
756
782
|
factorId: e
|
|
757
783
|
}),
|
|
758
|
-
children: [/* @__PURE__ */ f(
|
|
784
|
+
children: [/* @__PURE__ */ f(C, {
|
|
759
785
|
id: "ceFactor",
|
|
760
|
-
children: /* @__PURE__ */ f(
|
|
761
|
-
}), /* @__PURE__ */ f(
|
|
786
|
+
children: /* @__PURE__ */ f(w, { placeholder: "Optional" })
|
|
787
|
+
}), /* @__PURE__ */ f(x, { children: (nt.data?.items ?? []).map((e) => /* @__PURE__ */ f(S, {
|
|
762
788
|
value: e.id,
|
|
763
789
|
children: e.name
|
|
764
790
|
}, e.id)) })]
|
|
@@ -768,16 +794,16 @@ function A() {
|
|
|
768
794
|
children: [/* @__PURE__ */ f(g, {
|
|
769
795
|
htmlFor: "ceSite",
|
|
770
796
|
children: "Site"
|
|
771
|
-
}), /* @__PURE__ */ p(
|
|
772
|
-
value:
|
|
773
|
-
onValueChange: (e) =>
|
|
774
|
-
...
|
|
797
|
+
}), /* @__PURE__ */ p(b, {
|
|
798
|
+
value: z.siteId,
|
|
799
|
+
onValueChange: (e) => B({
|
|
800
|
+
...z,
|
|
775
801
|
siteId: e
|
|
776
802
|
}),
|
|
777
|
-
children: [/* @__PURE__ */ f(
|
|
803
|
+
children: [/* @__PURE__ */ f(C, {
|
|
778
804
|
id: "ceSite",
|
|
779
|
-
children: /* @__PURE__ */ f(
|
|
780
|
-
}), /* @__PURE__ */ f(
|
|
805
|
+
children: /* @__PURE__ */ f(w, { placeholder: "Optional" })
|
|
806
|
+
}), /* @__PURE__ */ f(x, { children: Object.entries(Y).map(([e, t]) => /* @__PURE__ */ f(S, {
|
|
781
807
|
value: e,
|
|
782
808
|
children: t
|
|
783
809
|
}, e)) })]
|
|
@@ -786,22 +812,22 @@ function A() {
|
|
|
786
812
|
}),
|
|
787
813
|
/* @__PURE__ */ f(be, {
|
|
788
814
|
form: {
|
|
789
|
-
activityType:
|
|
790
|
-
unit:
|
|
791
|
-
periodStart:
|
|
792
|
-
siteId:
|
|
815
|
+
activityType: z.category,
|
|
816
|
+
unit: z.activityUnit,
|
|
817
|
+
periodStart: z.periodStart,
|
|
818
|
+
siteId: z.siteId
|
|
793
819
|
},
|
|
794
|
-
selectedFactorId:
|
|
795
|
-
onUseFactor: (e, t) =>
|
|
820
|
+
selectedFactorId: z.factorId,
|
|
821
|
+
onUseFactor: (e, t) => B((n) => ({
|
|
796
822
|
...n,
|
|
797
823
|
factorId: e,
|
|
798
824
|
scope: t ?? n.scope
|
|
799
825
|
})),
|
|
800
826
|
onCreateFactor: (e) => {
|
|
801
|
-
|
|
827
|
+
R(!1), dt({
|
|
802
828
|
name: e.name,
|
|
803
829
|
activityUnit: e.unit,
|
|
804
|
-
scope: e.scope ??
|
|
830
|
+
scope: e.scope ?? z.scope
|
|
805
831
|
});
|
|
806
832
|
}
|
|
807
833
|
}),
|
|
@@ -810,41 +836,41 @@ function A() {
|
|
|
810
836
|
children: [/* @__PURE__ */ f(g, {
|
|
811
837
|
htmlFor: "ceNotes",
|
|
812
838
|
children: "Notes"
|
|
813
|
-
}), /* @__PURE__ */ f(
|
|
839
|
+
}), /* @__PURE__ */ f(Fe, {
|
|
814
840
|
id: "ceNotes",
|
|
815
841
|
rows: 2,
|
|
816
|
-
value:
|
|
817
|
-
onChange: (e) =>
|
|
818
|
-
...
|
|
842
|
+
value: z.notes,
|
|
843
|
+
onChange: (e) => B({
|
|
844
|
+
...z,
|
|
819
845
|
notes: e.target.value
|
|
820
846
|
}),
|
|
821
847
|
placeholder: "Optional context about this entry."
|
|
822
848
|
})]
|
|
823
849
|
}),
|
|
824
|
-
|
|
850
|
+
q && /* @__PURE__ */ f("p", {
|
|
825
851
|
className: "text-sm text-status-error-text",
|
|
826
|
-
children:
|
|
852
|
+
children: q
|
|
827
853
|
})
|
|
828
854
|
]
|
|
829
855
|
}),
|
|
830
|
-
/* @__PURE__ */ p(
|
|
856
|
+
/* @__PURE__ */ p(Ne, { children: [/* @__PURE__ */ f(m, {
|
|
831
857
|
variant: "outline",
|
|
832
|
-
onClick: () =>
|
|
858
|
+
onClick: () => R(!1),
|
|
833
859
|
children: "Cancel"
|
|
834
860
|
}), /* @__PURE__ */ f(m, {
|
|
835
|
-
onClick:
|
|
836
|
-
disabled:
|
|
837
|
-
children:
|
|
861
|
+
onClick: pt,
|
|
862
|
+
disabled: at.isPending,
|
|
863
|
+
children: at.isPending ? "Recording…" : "Record entry"
|
|
838
864
|
})] })
|
|
839
865
|
] })
|
|
840
866
|
}),
|
|
841
|
-
/* @__PURE__ */ f(
|
|
842
|
-
open:
|
|
867
|
+
/* @__PURE__ */ f(_, {
|
|
868
|
+
open: Qe,
|
|
843
869
|
onOpenChange: (e) => {
|
|
844
|
-
|
|
870
|
+
V(e), e || (U(D), J(null));
|
|
845
871
|
},
|
|
846
|
-
children: /* @__PURE__ */ p(
|
|
847
|
-
/* @__PURE__ */ p(
|
|
872
|
+
children: /* @__PURE__ */ p(v, { children: [
|
|
873
|
+
/* @__PURE__ */ p(Pe, { children: [/* @__PURE__ */ f(y, { children: "New emission factor" }), /* @__PURE__ */ f(Me, { children: "Define kg CO₂e per activity unit — used to convert ledger activity into CO₂e." })] }),
|
|
848
874
|
/* @__PURE__ */ p("div", {
|
|
849
875
|
className: "grid gap-4 py-2",
|
|
850
876
|
children: [
|
|
@@ -855,9 +881,9 @@ function A() {
|
|
|
855
881
|
children: "Name *"
|
|
856
882
|
}), /* @__PURE__ */ f(h, {
|
|
857
883
|
id: "efName",
|
|
858
|
-
value:
|
|
859
|
-
onChange: (e) =>
|
|
860
|
-
...
|
|
884
|
+
value: H.name,
|
|
885
|
+
onChange: (e) => U({
|
|
886
|
+
...H,
|
|
861
887
|
name: e.target.value
|
|
862
888
|
}),
|
|
863
889
|
placeholder: "Diesel (stationary combustion)"
|
|
@@ -870,16 +896,16 @@ function A() {
|
|
|
870
896
|
children: [/* @__PURE__ */ f(g, {
|
|
871
897
|
htmlFor: "efScope",
|
|
872
898
|
children: "Scope"
|
|
873
|
-
}), /* @__PURE__ */ p(
|
|
874
|
-
value:
|
|
875
|
-
onValueChange: (e) =>
|
|
876
|
-
...
|
|
899
|
+
}), /* @__PURE__ */ p(b, {
|
|
900
|
+
value: H.scope,
|
|
901
|
+
onValueChange: (e) => U({
|
|
902
|
+
...H,
|
|
877
903
|
scope: e
|
|
878
904
|
}),
|
|
879
|
-
children: [/* @__PURE__ */ f(
|
|
905
|
+
children: [/* @__PURE__ */ f(C, {
|
|
880
906
|
id: "efScope",
|
|
881
|
-
children: /* @__PURE__ */ f(
|
|
882
|
-
}), /* @__PURE__ */ f(
|
|
907
|
+
children: /* @__PURE__ */ f(w, {})
|
|
908
|
+
}), /* @__PURE__ */ f(x, { children: T.map((e) => /* @__PURE__ */ f(S, {
|
|
883
909
|
value: e,
|
|
884
910
|
children: s(e)
|
|
885
911
|
}, e)) })]
|
|
@@ -891,9 +917,9 @@ function A() {
|
|
|
891
917
|
children: "Activity unit *"
|
|
892
918
|
}), /* @__PURE__ */ f(h, {
|
|
893
919
|
id: "efUnit",
|
|
894
|
-
value:
|
|
895
|
-
onChange: (e) =>
|
|
896
|
-
...
|
|
920
|
+
value: H.activityUnit,
|
|
921
|
+
onChange: (e) => U({
|
|
922
|
+
...H,
|
|
897
923
|
activityUnit: e.target.value
|
|
898
924
|
}),
|
|
899
925
|
placeholder: "kWh, L, km"
|
|
@@ -912,9 +938,9 @@ function A() {
|
|
|
912
938
|
type: "number",
|
|
913
939
|
min: "0",
|
|
914
940
|
step: "any",
|
|
915
|
-
value:
|
|
916
|
-
onChange: (e) =>
|
|
917
|
-
...
|
|
941
|
+
value: H.factorKgco2e,
|
|
942
|
+
onChange: (e) => U({
|
|
943
|
+
...H,
|
|
918
944
|
factorKgco2e: e.target.value
|
|
919
945
|
}),
|
|
920
946
|
placeholder: "2.68"
|
|
@@ -928,9 +954,9 @@ function A() {
|
|
|
928
954
|
id: "efYear",
|
|
929
955
|
type: "number",
|
|
930
956
|
step: "1",
|
|
931
|
-
value:
|
|
932
|
-
onChange: (e) =>
|
|
933
|
-
...
|
|
957
|
+
value: H.validYear,
|
|
958
|
+
onChange: (e) => U({
|
|
959
|
+
...H,
|
|
934
960
|
validYear: e.target.value
|
|
935
961
|
}),
|
|
936
962
|
placeholder: "2026"
|
|
@@ -944,38 +970,38 @@ function A() {
|
|
|
944
970
|
children: "Source"
|
|
945
971
|
}), /* @__PURE__ */ f(h, {
|
|
946
972
|
id: "efSource",
|
|
947
|
-
value:
|
|
948
|
-
onChange: (e) =>
|
|
949
|
-
...
|
|
973
|
+
value: H.source,
|
|
974
|
+
onChange: (e) => U({
|
|
975
|
+
...H,
|
|
950
976
|
source: e.target.value
|
|
951
977
|
}),
|
|
952
978
|
placeholder: "DEFRA / IPCC / EPA"
|
|
953
979
|
})]
|
|
954
980
|
}),
|
|
955
|
-
|
|
981
|
+
q && /* @__PURE__ */ f("p", {
|
|
956
982
|
className: "text-sm text-status-error-text",
|
|
957
|
-
children:
|
|
983
|
+
children: q
|
|
958
984
|
})
|
|
959
985
|
]
|
|
960
986
|
}),
|
|
961
|
-
/* @__PURE__ */ p(
|
|
987
|
+
/* @__PURE__ */ p(Ne, { children: [/* @__PURE__ */ f(m, {
|
|
962
988
|
variant: "outline",
|
|
963
|
-
onClick: () =>
|
|
989
|
+
onClick: () => V(!1),
|
|
964
990
|
children: "Cancel"
|
|
965
991
|
}), /* @__PURE__ */ f(m, {
|
|
966
|
-
onClick:
|
|
967
|
-
disabled:
|
|
968
|
-
children:
|
|
992
|
+
onClick: mt,
|
|
993
|
+
disabled: st.isPending,
|
|
994
|
+
children: st.isPending ? "Creating…" : "Create factor"
|
|
969
995
|
})] })
|
|
970
996
|
] })
|
|
971
997
|
}),
|
|
972
|
-
/* @__PURE__ */ f(
|
|
973
|
-
open:
|
|
998
|
+
/* @__PURE__ */ f(_, {
|
|
999
|
+
open: $e,
|
|
974
1000
|
onOpenChange: (e) => {
|
|
975
|
-
|
|
1001
|
+
W(e), e || (K(O), J(null));
|
|
976
1002
|
},
|
|
977
|
-
children: /* @__PURE__ */ p(
|
|
978
|
-
/* @__PURE__ */ p(
|
|
1003
|
+
children: /* @__PURE__ */ p(v, { children: [
|
|
1004
|
+
/* @__PURE__ */ p(Pe, { children: [/* @__PURE__ */ f(y, { children: "New reduction target" }), /* @__PURE__ */ f(Me, { children: "Commit to a measurable reduction from a baseline to a target year." })] }),
|
|
979
1005
|
/* @__PURE__ */ p("div", {
|
|
980
1006
|
className: "grid gap-4 py-2",
|
|
981
1007
|
children: [
|
|
@@ -988,9 +1014,9 @@ function A() {
|
|
|
988
1014
|
children: "Name *"
|
|
989
1015
|
}), /* @__PURE__ */ f(h, {
|
|
990
1016
|
id: "rtName",
|
|
991
|
-
value:
|
|
992
|
-
onChange: (e) =>
|
|
993
|
-
...
|
|
1017
|
+
value: G.name,
|
|
1018
|
+
onChange: (e) => K({
|
|
1019
|
+
...G,
|
|
994
1020
|
name: e.target.value
|
|
995
1021
|
}),
|
|
996
1022
|
placeholder: "Net-zero operations"
|
|
@@ -1002,9 +1028,9 @@ function A() {
|
|
|
1002
1028
|
children: "Metric *"
|
|
1003
1029
|
}), /* @__PURE__ */ f(h, {
|
|
1004
1030
|
id: "rtMetric",
|
|
1005
|
-
value:
|
|
1006
|
-
onChange: (e) =>
|
|
1007
|
-
...
|
|
1031
|
+
value: G.metric,
|
|
1032
|
+
onChange: (e) => K({
|
|
1033
|
+
...G,
|
|
1008
1034
|
metric: e.target.value
|
|
1009
1035
|
}),
|
|
1010
1036
|
placeholder: "tCO2e/yr"
|
|
@@ -1023,9 +1049,9 @@ function A() {
|
|
|
1023
1049
|
id: "rtBaseVal",
|
|
1024
1050
|
type: "number",
|
|
1025
1051
|
step: "any",
|
|
1026
|
-
value:
|
|
1027
|
-
onChange: (e) =>
|
|
1028
|
-
...
|
|
1052
|
+
value: G.baselineValue,
|
|
1053
|
+
onChange: (e) => K({
|
|
1054
|
+
...G,
|
|
1029
1055
|
baselineValue: e.target.value
|
|
1030
1056
|
}),
|
|
1031
1057
|
placeholder: "1000"
|
|
@@ -1040,9 +1066,9 @@ function A() {
|
|
|
1040
1066
|
id: "rtBaseYear",
|
|
1041
1067
|
type: "number",
|
|
1042
1068
|
step: "1",
|
|
1043
|
-
value:
|
|
1044
|
-
onChange: (e) =>
|
|
1045
|
-
...
|
|
1069
|
+
value: G.baselineYear,
|
|
1070
|
+
onChange: (e) => K({
|
|
1071
|
+
...G,
|
|
1046
1072
|
baselineYear: e.target.value
|
|
1047
1073
|
}),
|
|
1048
1074
|
placeholder: "2024"
|
|
@@ -1055,9 +1081,9 @@ function A() {
|
|
|
1055
1081
|
children: "Unit *"
|
|
1056
1082
|
}), /* @__PURE__ */ f(h, {
|
|
1057
1083
|
id: "rtUnit",
|
|
1058
|
-
value:
|
|
1059
|
-
onChange: (e) =>
|
|
1060
|
-
...
|
|
1084
|
+
value: G.unit,
|
|
1085
|
+
onChange: (e) => K({
|
|
1086
|
+
...G,
|
|
1061
1087
|
unit: e.target.value
|
|
1062
1088
|
}),
|
|
1063
1089
|
placeholder: "tCO2e"
|
|
@@ -1076,9 +1102,9 @@ function A() {
|
|
|
1076
1102
|
id: "rtTargetVal",
|
|
1077
1103
|
type: "number",
|
|
1078
1104
|
step: "any",
|
|
1079
|
-
value:
|
|
1080
|
-
onChange: (e) =>
|
|
1081
|
-
...
|
|
1105
|
+
value: G.targetValue,
|
|
1106
|
+
onChange: (e) => K({
|
|
1107
|
+
...G,
|
|
1082
1108
|
targetValue: e.target.value
|
|
1083
1109
|
}),
|
|
1084
1110
|
placeholder: "0"
|
|
@@ -1092,9 +1118,9 @@ function A() {
|
|
|
1092
1118
|
id: "rtTargetYear",
|
|
1093
1119
|
type: "number",
|
|
1094
1120
|
step: "1",
|
|
1095
|
-
value:
|
|
1096
|
-
onChange: (e) =>
|
|
1097
|
-
...
|
|
1121
|
+
value: G.targetYear,
|
|
1122
|
+
onChange: (e) => K({
|
|
1123
|
+
...G,
|
|
1098
1124
|
targetYear: e.target.value
|
|
1099
1125
|
}),
|
|
1100
1126
|
placeholder: "2030"
|
|
@@ -1106,43 +1132,43 @@ function A() {
|
|
|
1106
1132
|
children: [/* @__PURE__ */ f(g, {
|
|
1107
1133
|
htmlFor: "rtDesc",
|
|
1108
1134
|
children: "Description"
|
|
1109
|
-
}), /* @__PURE__ */ f(
|
|
1135
|
+
}), /* @__PURE__ */ f(Fe, {
|
|
1110
1136
|
id: "rtDesc",
|
|
1111
1137
|
rows: 2,
|
|
1112
|
-
value:
|
|
1113
|
-
onChange: (e) =>
|
|
1114
|
-
...
|
|
1138
|
+
value: G.description,
|
|
1139
|
+
onChange: (e) => K({
|
|
1140
|
+
...G,
|
|
1115
1141
|
description: e.target.value
|
|
1116
1142
|
}),
|
|
1117
1143
|
placeholder: "Optional context about this target."
|
|
1118
1144
|
})]
|
|
1119
1145
|
}),
|
|
1120
|
-
|
|
1146
|
+
q && /* @__PURE__ */ f("p", {
|
|
1121
1147
|
className: "text-sm text-status-error-text",
|
|
1122
|
-
children:
|
|
1148
|
+
children: q
|
|
1123
1149
|
})
|
|
1124
1150
|
]
|
|
1125
1151
|
}),
|
|
1126
|
-
/* @__PURE__ */ p(
|
|
1152
|
+
/* @__PURE__ */ p(Ne, { children: [/* @__PURE__ */ f(m, {
|
|
1127
1153
|
variant: "outline",
|
|
1128
|
-
onClick: () =>
|
|
1154
|
+
onClick: () => W(!1),
|
|
1129
1155
|
children: "Cancel"
|
|
1130
1156
|
}), /* @__PURE__ */ f(m, {
|
|
1131
|
-
onClick:
|
|
1132
|
-
disabled:
|
|
1133
|
-
children:
|
|
1157
|
+
onClick: ht,
|
|
1158
|
+
disabled: ct.isPending,
|
|
1159
|
+
children: ct.isPending ? "Creating…" : "Create target"
|
|
1134
1160
|
})] })
|
|
1135
1161
|
] })
|
|
1136
1162
|
}),
|
|
1137
1163
|
/* @__PURE__ */ f(ve, {
|
|
1138
|
-
open:
|
|
1139
|
-
onOpenChange:
|
|
1140
|
-
sites:
|
|
1141
|
-
onReviewDrafts: () =>
|
|
1164
|
+
open: We,
|
|
1165
|
+
onOpenChange: Ge,
|
|
1166
|
+
sites: Y,
|
|
1167
|
+
onReviewDrafts: () => Ue("drafts")
|
|
1142
1168
|
})
|
|
1143
1169
|
]
|
|
1144
1170
|
});
|
|
1145
1171
|
}
|
|
1146
|
-
export {
|
|
1172
|
+
export { He as CarbonPage };
|
|
1147
1173
|
|
|
1148
1174
|
//# sourceMappingURL=CarbonPage.js.map
|