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