@burdenoff/microfe-theglobalfuel 2026.705.1 → 2026.705.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node_modules/{.bun/clsx@2.1.1/node_modules/clsx → clsx}/dist/clsx.js +1 -1
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/{.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge → tailwind-merge}/dist/bundle-mjs.js +212 -170
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/theglobalfuel/hooks/useCursorPager.js +6 -15
- package/dist/theglobalfuel/hooks/useCursorPager.js.map +1 -1
- package/dist/theglobalfuel/pages/assets/AssetsPage.js +99 -99
- package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/compliance/CompliancePage.js +250 -250
- package/dist/theglobalfuel/pages/compliance/CompliancePage.js.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractsPage.js +2 -2
- package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.js +174 -174
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/inventory/InventoryPage.js +60 -60
- package/dist/theglobalfuel/pages/inventory/InventoryPage.js.map +1 -1
- package/dist/theglobalfuel/pages/production/ProductionPage.js +2 -2
- package/dist/theglobalfuel/pages/production/ProductionPage.js.map +1 -1
- package/dist/theglobalfuel/pages/reserves/ReservesPage.js +152 -152
- package/dist/theglobalfuel/pages/reserves/ReservesPage.js.map +1 -1
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js +6 -6
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js.map +1 -1
- package/dist/theglobalfuel/utils/cn.js +2 -2
- package/package.json +1 -1
- package/dist/dev/main.d.ts +0 -2
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +0 -1
- package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
- package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts +0 -5
- package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +0 -1
- package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts +0 -4
- package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +0 -1
- package/dist/theglobalfuel/components/DataTable.d.ts +0 -30
- package/dist/theglobalfuel/components/DataTable.d.ts.map +0 -1
- package/dist/theglobalfuel/components/EmptyState.d.ts +0 -18
- package/dist/theglobalfuel/components/EmptyState.d.ts.map +0 -1
- package/dist/theglobalfuel/components/EvidenceUpload.d.ts +0 -14
- package/dist/theglobalfuel/components/EvidenceUpload.d.ts.map +0 -1
- package/dist/theglobalfuel/components/FileLink.d.ts +0 -15
- package/dist/theglobalfuel/components/FileLink.d.ts.map +0 -1
- package/dist/theglobalfuel/components/FilterTabs.d.ts +0 -18
- package/dist/theglobalfuel/components/FilterTabs.d.ts.map +0 -1
- package/dist/theglobalfuel/components/MetricsCard.d.ts +0 -23
- package/dist/theglobalfuel/components/MetricsCard.d.ts.map +0 -1
- package/dist/theglobalfuel/components/MiniBar.d.ts +0 -16
- package/dist/theglobalfuel/components/MiniBar.d.ts.map +0 -1
- package/dist/theglobalfuel/components/PageLayout.d.ts +0 -16
- package/dist/theglobalfuel/components/PageLayout.d.ts.map +0 -1
- package/dist/theglobalfuel/components/Pagination.d.ts +0 -22
- package/dist/theglobalfuel/components/Pagination.d.ts.map +0 -1
- package/dist/theglobalfuel/components/StateViews.d.ts +0 -24
- package/dist/theglobalfuel/components/StateViews.d.ts.map +0 -1
- package/dist/theglobalfuel/components/StatusBadge.d.ts +0 -9
- package/dist/theglobalfuel/components/StatusBadge.d.ts.map +0 -1
- package/dist/theglobalfuel/components/Tabs.d.ts +0 -17
- package/dist/theglobalfuel/components/Tabs.d.ts.map +0 -1
- package/dist/theglobalfuel/components/TheDiscussion.d.ts +0 -18
- package/dist/theglobalfuel/components/TheDiscussion.d.ts.map +0 -1
- package/dist/theglobalfuel/components/TheTags.d.ts +0 -17
- package/dist/theglobalfuel/components/TheTags.d.ts.map +0 -1
- package/dist/theglobalfuel/components/index.d.ts +0 -19
- package/dist/theglobalfuel/components/index.d.ts.map +0 -1
- package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts +0 -16
- package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts.map +0 -1
- package/dist/theglobalfuel/context/index.d.ts +0 -6
- package/dist/theglobalfuel/context/index.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/index.d.ts +0 -11
- package/dist/theglobalfuel/hooks/index.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useCursorPager.d.ts +0 -33
- package/dist/theglobalfuel/hooks/useCursorPager.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useNotify.d.ts +0 -23
- package/dist/theglobalfuel/hooks/useNotify.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useTheComments.d.ts +0 -36
- package/dist/theglobalfuel/hooks/useTheComments.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useTheFiles.d.ts +0 -47
- package/dist/theglobalfuel/hooks/useTheFiles.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +0 -79
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useTheTags.d.ts +0 -44
- package/dist/theglobalfuel/hooks/useTheTags.d.ts.map +0 -1
- package/dist/theglobalfuel/index.d.ts +0 -9
- package/dist/theglobalfuel/index.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts +0 -13
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts +0 -10
- package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts +0 -11
- package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts +0 -9
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts +0 -8
- package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts +0 -13
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts +0 -12
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts +0 -11
- package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/production/ProductionPage.d.ts +0 -11
- package/dist/theglobalfuel/pages/production/ProductionPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts +0 -10
- package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts +0 -11
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts.map +0 -1
- package/dist/theglobalfuel/types/index.d.ts +0 -376
- package/dist/theglobalfuel/types/index.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/cn.d.ts +0 -4
- package/dist/theglobalfuel/utils/cn.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/formatters.d.ts +0 -44
- package/dist/theglobalfuel/utils/formatters.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/i18n.d.ts +0 -6
- package/dist/theglobalfuel/utils/i18n.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/index.d.ts +0 -10
- package/dist/theglobalfuel/utils/index.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/navigation.d.ts +0 -14
- package/dist/theglobalfuel/utils/navigation.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/transitions.d.ts +0 -17
- package/dist/theglobalfuel/utils/transitions.d.ts.map +0 -1
|
@@ -3,25 +3,25 @@ import { MetricsCard as t } from "../../components/MetricsCard.js";
|
|
|
3
3
|
import { formatDate as n, formatEnumLabel as r, formatPercent as i, formatRelativeTime as ee, formatTonnesCo2e as a, toBackendDate as o } from "../../utils/formatters.js";
|
|
4
4
|
import { StatusBadge as te } from "../../components/StatusBadge.js";
|
|
5
5
|
import { MiniBar as s } from "../../components/MiniBar.js";
|
|
6
|
-
import { DataTable as
|
|
7
|
-
import { ErrorView as
|
|
8
|
-
import { EmptyState as
|
|
9
|
-
import { useTheAssets as
|
|
10
|
-
import { useCursorPager as
|
|
11
|
-
import { useNotify as
|
|
6
|
+
import { DataTable as ne } from "../../components/DataTable.js";
|
|
7
|
+
import { ErrorView as re, LoadingView as c } from "../../components/StateViews.js";
|
|
8
|
+
import { EmptyState as l } from "../../components/EmptyState.js";
|
|
9
|
+
import { useTheAssets as ie, useTheEmissionRecords as ae, useTheRecordEmission as oe, useTheVerifyEmission as se } from "../../hooks/useTheGlobalFuelApi.js";
|
|
10
|
+
import { useCursorPager as ce } from "../../hooks/useCursorPager.js";
|
|
11
|
+
import { useNotify as le } from "../../hooks/useNotify.js";
|
|
12
12
|
import "../../hooks/index.js";
|
|
13
|
-
import { FilterTabs as
|
|
14
|
-
import { Pagination as
|
|
15
|
-
import { useMemo as
|
|
16
|
-
import { CheckCircle2 as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { Button as
|
|
13
|
+
import { FilterTabs as ue } from "../../components/FilterTabs.js";
|
|
14
|
+
import { Pagination as de } from "../../components/Pagination.js";
|
|
15
|
+
import { useMemo as u, useState as d } from "react";
|
|
16
|
+
import { CheckCircle2 as fe, Circle as pe, Cloud as f, Factory as p, Flame as me, Plus as m, Truck as h, Zap as g } from "lucide-react";
|
|
17
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
18
|
+
import { Button as b, Input as x, Label as S, ResponsiveDialog as he, ResponsiveDialogContent as ge, ResponsiveDialogDescription as _e, ResponsiveDialogFooter as ve, ResponsiveDialogHeader as ye, ResponsiveDialogTitle as be, Select as C, SelectContent as w, SelectItem as T, SelectTrigger as E, SelectValue as D, Textarea as O } from "@burdenoff/fe-libs/ui";
|
|
19
19
|
//#region src/theglobalfuel/pages/emissions/EmissionsPage.tsx
|
|
20
|
-
var
|
|
20
|
+
var k = [
|
|
21
21
|
"SCOPE_1",
|
|
22
22
|
"SCOPE_2",
|
|
23
23
|
"SCOPE_3"
|
|
24
|
-
],
|
|
24
|
+
], A = [
|
|
25
25
|
{
|
|
26
26
|
value: "ALL",
|
|
27
27
|
label: "All scopes"
|
|
@@ -38,47 +38,47 @@ var A = [
|
|
|
38
38
|
value: "SCOPE_3",
|
|
39
39
|
label: "Scope 3"
|
|
40
40
|
}
|
|
41
|
-
],
|
|
41
|
+
], j = {
|
|
42
42
|
SCOPE_1: "bg-status-error-text",
|
|
43
43
|
SCOPE_2: "bg-status-warning-text",
|
|
44
44
|
SCOPE_3: "bg-accent"
|
|
45
|
-
},
|
|
45
|
+
}, M = 25, N = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), P = () => ({
|
|
46
46
|
assetId: "",
|
|
47
47
|
scope: "SCOPE_1",
|
|
48
48
|
co2eTonnes: "",
|
|
49
|
-
periodStart:
|
|
50
|
-
periodEnd:
|
|
49
|
+
periodStart: N(),
|
|
50
|
+
periodEnd: N(),
|
|
51
51
|
source: "",
|
|
52
52
|
methodology: "",
|
|
53
53
|
notes: ""
|
|
54
|
-
}),
|
|
54
|
+
}), F = (e, t, n) => {
|
|
55
55
|
if (t <= 0) return;
|
|
56
56
|
let r = e / t * 100;
|
|
57
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ y("div", {
|
|
58
58
|
className: "space-y-2",
|
|
59
|
-
children: [/* @__PURE__ */
|
|
59
|
+
children: [/* @__PURE__ */ v(s, {
|
|
60
60
|
value: r,
|
|
61
|
-
barClassName:
|
|
61
|
+
barClassName: j[n],
|
|
62
62
|
height: 4
|
|
63
|
-
}), /* @__PURE__ */
|
|
63
|
+
}), /* @__PURE__ */ y("p", {
|
|
64
64
|
className: "text-xs tabular-nums text-text-tertiary",
|
|
65
65
|
children: [i(r), " of total"]
|
|
66
66
|
})]
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
|
-
function
|
|
70
|
-
let i =
|
|
69
|
+
function I() {
|
|
70
|
+
let i = le(), [s, j] = d("ALL"), [N, I] = d("ALL"), L = ce(), [xe, R] = d(!1), [z, B] = d(P), [V, H] = d(null), [U, W] = d(null), G = ie({ pagination: { limit: 100 } }), Se = u(() => {
|
|
71
71
|
let e = {};
|
|
72
|
-
for (let t of
|
|
72
|
+
for (let t of G.data?.items ?? []) e[t.id] = t.name;
|
|
73
73
|
return e;
|
|
74
|
-
}, [
|
|
74
|
+
}, [G.data]), K = G.data?.items ?? [], { data: q, isLoading: Ce, isError: we, refetch: J } = ae({
|
|
75
75
|
scope: s === "ALL" ? void 0 : s,
|
|
76
|
-
assetId:
|
|
76
|
+
assetId: N === "ALL" ? void 0 : N,
|
|
77
77
|
pagination: {
|
|
78
|
-
limit:
|
|
79
|
-
|
|
78
|
+
limit: M,
|
|
79
|
+
offset: L.page * M
|
|
80
80
|
}
|
|
81
|
-
}), Y =
|
|
81
|
+
}), Y = oe(), Te = se(), X = u(() => q?.items ?? [], [q]), { total: Z, byScope: Q } = u(() => {
|
|
82
82
|
let e = {
|
|
83
83
|
SCOPE_1: 0,
|
|
84
84
|
SCOPE_2: 0,
|
|
@@ -93,14 +93,14 @@ function L() {
|
|
|
93
93
|
{
|
|
94
94
|
key: "scope",
|
|
95
95
|
header: "Scope",
|
|
96
|
-
render: (e) => /* @__PURE__ */
|
|
96
|
+
render: (e) => /* @__PURE__ */ v(te, { status: e.scope })
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
key: "asset",
|
|
100
100
|
header: "Asset",
|
|
101
|
-
render: (e) => /* @__PURE__ */
|
|
101
|
+
render: (e) => /* @__PURE__ */ v("span", {
|
|
102
102
|
className: "text-text-secondary",
|
|
103
|
-
children: e.assetId ?
|
|
103
|
+
children: e.assetId ? Se[e.assetId] ?? `${e.assetId.slice(0, 8)}…` : "—"
|
|
104
104
|
})
|
|
105
105
|
},
|
|
106
106
|
{
|
|
@@ -108,7 +108,7 @@ function L() {
|
|
|
108
108
|
header: "CO₂e",
|
|
109
109
|
align: "right",
|
|
110
110
|
sortValue: (e) => e.co2eTonnes,
|
|
111
|
-
render: (e) => /* @__PURE__ */
|
|
111
|
+
render: (e) => /* @__PURE__ */ v("span", {
|
|
112
112
|
className: "tabular-nums font-medium text-text-primary",
|
|
113
113
|
children: a(e.co2eTonnes)
|
|
114
114
|
})
|
|
@@ -118,7 +118,7 @@ function L() {
|
|
|
118
118
|
header: "Period",
|
|
119
119
|
hideOnMobile: !0,
|
|
120
120
|
sortValue: (e) => new Date(e.periodStart).getTime(),
|
|
121
|
-
render: (e) => /* @__PURE__ */
|
|
121
|
+
render: (e) => /* @__PURE__ */ y("span", {
|
|
122
122
|
className: "text-text-secondary",
|
|
123
123
|
children: [
|
|
124
124
|
n(e.periodStart),
|
|
@@ -131,7 +131,7 @@ function L() {
|
|
|
131
131
|
key: "source",
|
|
132
132
|
header: "Source",
|
|
133
133
|
hideOnMobile: !0,
|
|
134
|
-
render: (e) => /* @__PURE__ */
|
|
134
|
+
render: (e) => /* @__PURE__ */ v("span", {
|
|
135
135
|
className: "text-text-secondary",
|
|
136
136
|
children: e.source ?? "—"
|
|
137
137
|
})
|
|
@@ -139,22 +139,22 @@ function L() {
|
|
|
139
139
|
{
|
|
140
140
|
key: "verified",
|
|
141
141
|
header: "Verified",
|
|
142
|
-
render: (e) => e.verified ? /* @__PURE__ */
|
|
142
|
+
render: (e) => e.verified ? /* @__PURE__ */ y("span", {
|
|
143
143
|
className: "inline-flex items-center gap-1.5 text-status-success-text",
|
|
144
144
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ v(fe, { className: "h-4 w-4" }),
|
|
146
|
+
/* @__PURE__ */ v("span", {
|
|
147
147
|
className: "text-xs font-medium",
|
|
148
148
|
children: "Verified"
|
|
149
149
|
}),
|
|
150
|
-
e.verifiedAt && /* @__PURE__ */
|
|
150
|
+
e.verifiedAt && /* @__PURE__ */ v("span", {
|
|
151
151
|
className: "text-xs font-normal tabular-nums text-text-tertiary",
|
|
152
152
|
children: n(e.verifiedAt)
|
|
153
153
|
})
|
|
154
154
|
]
|
|
155
|
-
}) : /* @__PURE__ */
|
|
155
|
+
}) : /* @__PURE__ */ y("span", {
|
|
156
156
|
className: "inline-flex items-center gap-1.5 text-text-tertiary",
|
|
157
|
-
children: [/* @__PURE__ */
|
|
157
|
+
children: [/* @__PURE__ */ v(pe, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ v("span", {
|
|
158
158
|
className: "text-xs",
|
|
159
159
|
children: "Unverified"
|
|
160
160
|
})]
|
|
@@ -165,7 +165,7 @@ function L() {
|
|
|
165
165
|
header: "Logged",
|
|
166
166
|
align: "right",
|
|
167
167
|
hideOnMobile: !0,
|
|
168
|
-
render: (e) => /* @__PURE__ */
|
|
168
|
+
render: (e) => /* @__PURE__ */ v("span", {
|
|
169
169
|
className: "text-text-tertiary",
|
|
170
170
|
children: ee(e.createdAt)
|
|
171
171
|
})
|
|
@@ -174,75 +174,75 @@ function L() {
|
|
|
174
174
|
key: "verify",
|
|
175
175
|
header: "",
|
|
176
176
|
align: "right",
|
|
177
|
-
render: (e) => e.verified ? null : /* @__PURE__ */
|
|
177
|
+
render: (e) => e.verified ? null : /* @__PURE__ */ v(b, {
|
|
178
178
|
size: "sm",
|
|
179
179
|
variant: "outline",
|
|
180
180
|
onClick: () => {
|
|
181
|
-
|
|
181
|
+
W(e.id), Te.mutate(e.id, {
|
|
182
182
|
onSuccess: () => i.success("Emission verified"),
|
|
183
183
|
onError: (e) => i.fromError(e),
|
|
184
|
-
onSettled: () =>
|
|
184
|
+
onSettled: () => W(null)
|
|
185
185
|
});
|
|
186
186
|
},
|
|
187
|
-
disabled:
|
|
188
|
-
children:
|
|
187
|
+
disabled: U === e.id,
|
|
188
|
+
children: U === e.id ? "Verifying…" : "Verify"
|
|
189
189
|
})
|
|
190
190
|
}
|
|
191
191
|
], $ = () => {
|
|
192
|
-
|
|
192
|
+
B(P()), H(null), R(!0);
|
|
193
193
|
}, De = async () => {
|
|
194
|
-
let e = Number(
|
|
195
|
-
if (!
|
|
194
|
+
let e = Number(z.co2eTonnes);
|
|
195
|
+
if (!z.co2eTonnes || Number.isNaN(e) || e <= 0) {
|
|
196
196
|
let e = "CO₂e (tonnes) must be greater than zero.";
|
|
197
|
-
|
|
197
|
+
H(e), i.error(e);
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
|
-
if (!
|
|
201
|
-
|
|
200
|
+
if (!z.periodStart || !z.periodEnd) {
|
|
201
|
+
H("Period start and end are required.");
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
|
-
let t = o(
|
|
204
|
+
let t = o(z.periodStart), n = o(z.periodEnd);
|
|
205
205
|
if (!t || !n) {
|
|
206
|
-
|
|
206
|
+
H("Period start and end are required.");
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
209
|
if (new Date(n).getTime() < new Date(t).getTime()) {
|
|
210
|
-
|
|
210
|
+
H("Period end must be on or after the period start.");
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
|
-
|
|
213
|
+
H(null);
|
|
214
214
|
try {
|
|
215
215
|
await Y.mutateAsync({
|
|
216
|
-
assetId:
|
|
217
|
-
scope:
|
|
216
|
+
assetId: z.assetId || null,
|
|
217
|
+
scope: z.scope,
|
|
218
218
|
co2eTonnes: e,
|
|
219
219
|
periodStart: t,
|
|
220
220
|
periodEnd: n,
|
|
221
|
-
source:
|
|
222
|
-
methodology:
|
|
223
|
-
notes:
|
|
224
|
-
}), i.success("Emission recorded"),
|
|
221
|
+
source: z.source.trim() || null,
|
|
222
|
+
methodology: z.methodology.trim() || null,
|
|
223
|
+
notes: z.notes.trim() || null
|
|
224
|
+
}), i.success("Emission recorded"), R(!1), B(P());
|
|
225
225
|
} catch (e) {
|
|
226
|
-
i.fromError(e),
|
|
226
|
+
i.fromError(e), H(e instanceof Error ? e.message : "Failed to record emission.");
|
|
227
227
|
}
|
|
228
228
|
};
|
|
229
|
-
return /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ y(e, {
|
|
230
230
|
title: "Emissions",
|
|
231
231
|
description: "ESG greenhouse-gas ledger across every asset — GHG Protocol Scope 1 / 2 / 3, with third-party verification.",
|
|
232
|
-
actions: /* @__PURE__ */ b
|
|
232
|
+
actions: /* @__PURE__ */ y(b, {
|
|
233
233
|
onClick: $,
|
|
234
|
-
children: [/* @__PURE__ */
|
|
234
|
+
children: [/* @__PURE__ */ v(m, { className: "mr-1.5 h-4 w-4" }), " Record emission"]
|
|
235
235
|
}),
|
|
236
236
|
children: [
|
|
237
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ y("div", {
|
|
238
238
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
239
239
|
children: [
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
icon: /* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ v(t, {
|
|
241
|
+
icon: /* @__PURE__ */ v(p, { className: "h-5 w-5" }),
|
|
242
242
|
value: X.length > 0 ? a(Z) : "—",
|
|
243
243
|
label: "CO₂e on this page",
|
|
244
244
|
featured: !0,
|
|
245
|
-
footer: /* @__PURE__ */
|
|
245
|
+
footer: /* @__PURE__ */ y("p", {
|
|
246
246
|
className: "text-xs tabular-nums text-text-tertiary",
|
|
247
247
|
children: [
|
|
248
248
|
X.length,
|
|
@@ -252,65 +252,65 @@ function L() {
|
|
|
252
252
|
]
|
|
253
253
|
})
|
|
254
254
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
icon: /* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ v(t, {
|
|
256
|
+
icon: /* @__PURE__ */ v(me, { className: "h-5 w-5" }),
|
|
257
257
|
value: X.length > 0 ? a(Q.SCOPE_1) : "—",
|
|
258
258
|
label: "Scope 1 · Direct",
|
|
259
|
-
footer:
|
|
259
|
+
footer: F(Q.SCOPE_1, Z, "SCOPE_1")
|
|
260
260
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
icon: /* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ v(t, {
|
|
262
|
+
icon: /* @__PURE__ */ v(g, { className: "h-5 w-5" }),
|
|
263
263
|
value: X.length > 0 ? a(Q.SCOPE_2) : "—",
|
|
264
264
|
label: "Scope 2 · Purchased energy",
|
|
265
|
-
footer:
|
|
265
|
+
footer: F(Q.SCOPE_2, Z, "SCOPE_2")
|
|
266
266
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
icon: /* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ v(t, {
|
|
268
|
+
icon: /* @__PURE__ */ v(h, { className: "h-5 w-5" }),
|
|
269
269
|
value: X.length > 0 ? a(Q.SCOPE_3) : "—",
|
|
270
270
|
label: "Scope 3 · Value chain",
|
|
271
|
-
footer:
|
|
271
|
+
footer: F(Q.SCOPE_3, Z, "SCOPE_3")
|
|
272
272
|
})
|
|
273
273
|
]
|
|
274
274
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ y("div", {
|
|
276
276
|
className: "mt-6 mb-5 flex flex-wrap items-center gap-3",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
278
|
-
options:
|
|
277
|
+
children: [/* @__PURE__ */ v(ue, {
|
|
278
|
+
options: A,
|
|
279
279
|
value: s,
|
|
280
280
|
onChange: (e) => {
|
|
281
|
-
|
|
281
|
+
j(e), L.reset();
|
|
282
282
|
}
|
|
283
|
-
}), /* @__PURE__ */
|
|
284
|
-
value:
|
|
283
|
+
}), /* @__PURE__ */ y(C, {
|
|
284
|
+
value: N,
|
|
285
285
|
onValueChange: (e) => {
|
|
286
|
-
|
|
286
|
+
I(e), L.reset();
|
|
287
287
|
},
|
|
288
|
-
children: [/* @__PURE__ */
|
|
288
|
+
children: [/* @__PURE__ */ v(E, {
|
|
289
289
|
className: "w-56",
|
|
290
290
|
"aria-label": "Filter by asset",
|
|
291
|
-
children: /* @__PURE__ */
|
|
292
|
-
}), /* @__PURE__ */
|
|
291
|
+
children: /* @__PURE__ */ v(D, { placeholder: "All assets" })
|
|
292
|
+
}), /* @__PURE__ */ y(w, { children: [/* @__PURE__ */ v(T, {
|
|
293
293
|
value: "ALL",
|
|
294
294
|
children: "All assets"
|
|
295
|
-
}),
|
|
295
|
+
}), K.map((e) => /* @__PURE__ */ v(T, {
|
|
296
296
|
value: e.id,
|
|
297
297
|
children: e.name
|
|
298
298
|
}, e.id))] })]
|
|
299
299
|
})]
|
|
300
300
|
}),
|
|
301
|
-
|
|
301
|
+
Ce ? /* @__PURE__ */ v(c, { label: "Loading emission records…" }) : we ? /* @__PURE__ */ v(re, {
|
|
302
302
|
message: "Couldn't load emission records.",
|
|
303
|
-
onRetry: () =>
|
|
304
|
-
}) : X.length === 0 ? /* @__PURE__ */
|
|
303
|
+
onRetry: () => J()
|
|
304
|
+
}) : X.length === 0 ? /* @__PURE__ */ v(l, {
|
|
305
305
|
illustration: "empty-data",
|
|
306
|
-
icon: /* @__PURE__ */
|
|
306
|
+
icon: /* @__PURE__ */ v(f, { className: "h-10 w-10" }),
|
|
307
307
|
title: "No emissions recorded",
|
|
308
|
-
description: s === "ALL" &&
|
|
309
|
-
action: /* @__PURE__ */ b
|
|
308
|
+
description: s === "ALL" && N === "ALL" ? "Record a CO₂e figure to start building your Scope 1–3 emissions ledger." : "No emission records match these filters.",
|
|
309
|
+
action: /* @__PURE__ */ y(b, {
|
|
310
310
|
onClick: $,
|
|
311
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ v(m, { className: "mr-1.5 h-4 w-4" }), " Record emission"]
|
|
312
312
|
})
|
|
313
|
-
}) : /* @__PURE__ */
|
|
313
|
+
}) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(ne, {
|
|
314
314
|
columns: Ee,
|
|
315
315
|
rows: X,
|
|
316
316
|
rowKey: (e) => e.id,
|
|
@@ -318,176 +318,176 @@ function L() {
|
|
|
318
318
|
key: "period",
|
|
319
319
|
dir: "desc"
|
|
320
320
|
}
|
|
321
|
-
}), /* @__PURE__ */
|
|
322
|
-
page:
|
|
323
|
-
pageSize:
|
|
321
|
+
}), /* @__PURE__ */ v(de, {
|
|
322
|
+
page: L.page,
|
|
323
|
+
pageSize: M,
|
|
324
324
|
itemCount: X.length,
|
|
325
|
-
hasMore:
|
|
326
|
-
onPageChange:
|
|
325
|
+
hasMore: q?.pageInfo?.hasMore ?? !1,
|
|
326
|
+
onPageChange: L.onPageChange
|
|
327
327
|
})] }),
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
-
open:
|
|
328
|
+
/* @__PURE__ */ v(he, {
|
|
329
|
+
open: xe,
|
|
330
330
|
onOpenChange: (e) => {
|
|
331
|
-
|
|
331
|
+
R(e), e || (B(P()), H(null));
|
|
332
332
|
},
|
|
333
|
-
children: /* @__PURE__ */
|
|
333
|
+
children: /* @__PURE__ */ y(ge, { children: [/* @__PURE__ */ y(ye, { children: [/* @__PURE__ */ v(be, { children: "Record emission" }), /* @__PURE__ */ v(_e, { children: "Log a CO₂e figure for a reporting period — optionally attributed to an asset." })] }), /* @__PURE__ */ y("form", {
|
|
334
334
|
onSubmit: (e) => {
|
|
335
335
|
e.preventDefault(), De();
|
|
336
336
|
},
|
|
337
|
-
children: [/* @__PURE__ */
|
|
337
|
+
children: [/* @__PURE__ */ y("div", {
|
|
338
338
|
className: "grid gap-4 py-2",
|
|
339
339
|
children: [
|
|
340
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ y("div", {
|
|
341
341
|
className: "grid gap-2 sm:grid-cols-2",
|
|
342
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ y("div", {
|
|
343
343
|
className: "grid gap-1.5",
|
|
344
|
-
children: [/* @__PURE__ */
|
|
344
|
+
children: [/* @__PURE__ */ v(S, {
|
|
345
345
|
htmlFor: "emScope",
|
|
346
346
|
children: "Scope"
|
|
347
|
-
}), /* @__PURE__ */
|
|
348
|
-
value:
|
|
349
|
-
onValueChange: (e) =>
|
|
350
|
-
...
|
|
347
|
+
}), /* @__PURE__ */ y(C, {
|
|
348
|
+
value: z.scope,
|
|
349
|
+
onValueChange: (e) => B({
|
|
350
|
+
...z,
|
|
351
351
|
scope: e
|
|
352
352
|
}),
|
|
353
|
-
children: [/* @__PURE__ */
|
|
353
|
+
children: [/* @__PURE__ */ v(E, {
|
|
354
354
|
id: "emScope",
|
|
355
|
-
children: /* @__PURE__ */
|
|
356
|
-
}), /* @__PURE__ */
|
|
355
|
+
children: /* @__PURE__ */ v(D, {})
|
|
356
|
+
}), /* @__PURE__ */ v(w, { children: k.map((e) => /* @__PURE__ */ v(T, {
|
|
357
357
|
value: e,
|
|
358
358
|
children: r(e)
|
|
359
359
|
}, e)) })]
|
|
360
360
|
})]
|
|
361
|
-
}), /* @__PURE__ */
|
|
361
|
+
}), /* @__PURE__ */ y("div", {
|
|
362
362
|
className: "grid gap-1.5",
|
|
363
|
-
children: [/* @__PURE__ */
|
|
363
|
+
children: [/* @__PURE__ */ v(S, {
|
|
364
364
|
htmlFor: "emCo2e",
|
|
365
365
|
children: "CO₂e (tonnes) *"
|
|
366
|
-
}), /* @__PURE__ */
|
|
366
|
+
}), /* @__PURE__ */ v(x, {
|
|
367
367
|
id: "emCo2e",
|
|
368
368
|
type: "number",
|
|
369
369
|
min: "0",
|
|
370
370
|
step: "any",
|
|
371
|
-
value:
|
|
372
|
-
onChange: (e) =>
|
|
373
|
-
...
|
|
371
|
+
value: z.co2eTonnes,
|
|
372
|
+
onChange: (e) => B({
|
|
373
|
+
...z,
|
|
374
374
|
co2eTonnes: e.target.value
|
|
375
375
|
}),
|
|
376
376
|
placeholder: "1250"
|
|
377
377
|
})]
|
|
378
378
|
})]
|
|
379
379
|
}),
|
|
380
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ y("div", {
|
|
381
381
|
className: "grid gap-1.5",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
382
|
+
children: [/* @__PURE__ */ v(S, {
|
|
383
383
|
htmlFor: "emAsset",
|
|
384
384
|
children: "Asset"
|
|
385
|
-
}), /* @__PURE__ */
|
|
386
|
-
value:
|
|
387
|
-
onValueChange: (e) =>
|
|
388
|
-
...
|
|
385
|
+
}), /* @__PURE__ */ y(C, {
|
|
386
|
+
value: z.assetId,
|
|
387
|
+
onValueChange: (e) => B({
|
|
388
|
+
...z,
|
|
389
389
|
assetId: e
|
|
390
390
|
}),
|
|
391
|
-
children: [/* @__PURE__ */
|
|
391
|
+
children: [/* @__PURE__ */ v(E, {
|
|
392
392
|
id: "emAsset",
|
|
393
|
-
children: /* @__PURE__ */
|
|
394
|
-
}), /* @__PURE__ */
|
|
393
|
+
children: /* @__PURE__ */ v(D, { placeholder: "Optional — org-wide if unset" })
|
|
394
|
+
}), /* @__PURE__ */ v(w, { children: K.map((e) => /* @__PURE__ */ v(T, {
|
|
395
395
|
value: e.id,
|
|
396
396
|
children: e.name
|
|
397
397
|
}, e.id)) })]
|
|
398
398
|
})]
|
|
399
399
|
}),
|
|
400
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ y("div", {
|
|
401
401
|
className: "grid gap-2 sm:grid-cols-2",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
402
|
+
children: [/* @__PURE__ */ y("div", {
|
|
403
403
|
className: "grid gap-1.5",
|
|
404
|
-
children: [/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ v(S, {
|
|
405
405
|
htmlFor: "emStart",
|
|
406
406
|
children: "Period start *"
|
|
407
|
-
}), /* @__PURE__ */
|
|
407
|
+
}), /* @__PURE__ */ v(x, {
|
|
408
408
|
id: "emStart",
|
|
409
409
|
type: "date",
|
|
410
|
-
value:
|
|
411
|
-
onChange: (e) =>
|
|
412
|
-
...
|
|
410
|
+
value: z.periodStart,
|
|
411
|
+
onChange: (e) => B({
|
|
412
|
+
...z,
|
|
413
413
|
periodStart: e.target.value
|
|
414
414
|
})
|
|
415
415
|
})]
|
|
416
|
-
}), /* @__PURE__ */
|
|
416
|
+
}), /* @__PURE__ */ y("div", {
|
|
417
417
|
className: "grid gap-1.5",
|
|
418
|
-
children: [/* @__PURE__ */
|
|
418
|
+
children: [/* @__PURE__ */ v(S, {
|
|
419
419
|
htmlFor: "emEnd",
|
|
420
420
|
children: "Period end *"
|
|
421
|
-
}), /* @__PURE__ */
|
|
421
|
+
}), /* @__PURE__ */ v(x, {
|
|
422
422
|
id: "emEnd",
|
|
423
423
|
type: "date",
|
|
424
|
-
value:
|
|
425
|
-
onChange: (e) =>
|
|
426
|
-
...
|
|
424
|
+
value: z.periodEnd,
|
|
425
|
+
onChange: (e) => B({
|
|
426
|
+
...z,
|
|
427
427
|
periodEnd: e.target.value
|
|
428
428
|
})
|
|
429
429
|
})]
|
|
430
430
|
})]
|
|
431
431
|
}),
|
|
432
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ y("div", {
|
|
433
433
|
className: "grid gap-2 sm:grid-cols-2",
|
|
434
|
-
children: [/* @__PURE__ */
|
|
434
|
+
children: [/* @__PURE__ */ y("div", {
|
|
435
435
|
className: "grid gap-1.5",
|
|
436
|
-
children: [/* @__PURE__ */
|
|
436
|
+
children: [/* @__PURE__ */ v(S, {
|
|
437
437
|
htmlFor: "emSource",
|
|
438
438
|
children: "Source"
|
|
439
|
-
}), /* @__PURE__ */
|
|
439
|
+
}), /* @__PURE__ */ v(x, {
|
|
440
440
|
id: "emSource",
|
|
441
|
-
value:
|
|
442
|
-
onChange: (e) =>
|
|
443
|
-
...
|
|
441
|
+
value: z.source,
|
|
442
|
+
onChange: (e) => B({
|
|
443
|
+
...z,
|
|
444
444
|
source: e.target.value
|
|
445
445
|
}),
|
|
446
446
|
placeholder: "Flaring, grid electricity…"
|
|
447
447
|
})]
|
|
448
|
-
}), /* @__PURE__ */
|
|
448
|
+
}), /* @__PURE__ */ y("div", {
|
|
449
449
|
className: "grid gap-1.5",
|
|
450
|
-
children: [/* @__PURE__ */
|
|
450
|
+
children: [/* @__PURE__ */ v(S, {
|
|
451
451
|
htmlFor: "emMethod",
|
|
452
452
|
children: "Methodology"
|
|
453
|
-
}), /* @__PURE__ */
|
|
453
|
+
}), /* @__PURE__ */ v(x, {
|
|
454
454
|
id: "emMethod",
|
|
455
|
-
value:
|
|
456
|
-
onChange: (e) =>
|
|
457
|
-
...
|
|
455
|
+
value: z.methodology,
|
|
456
|
+
onChange: (e) => B({
|
|
457
|
+
...z,
|
|
458
458
|
methodology: e.target.value
|
|
459
459
|
}),
|
|
460
460
|
placeholder: "GHG Protocol / IPCC / API"
|
|
461
461
|
})]
|
|
462
462
|
})]
|
|
463
463
|
}),
|
|
464
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ y("div", {
|
|
465
465
|
className: "grid gap-1.5",
|
|
466
|
-
children: [/* @__PURE__ */
|
|
466
|
+
children: [/* @__PURE__ */ v(S, {
|
|
467
467
|
htmlFor: "emNotes",
|
|
468
468
|
children: "Notes"
|
|
469
|
-
}), /* @__PURE__ */
|
|
469
|
+
}), /* @__PURE__ */ v(O, {
|
|
470
470
|
id: "emNotes",
|
|
471
471
|
rows: 2,
|
|
472
|
-
value:
|
|
473
|
-
onChange: (e) =>
|
|
474
|
-
...
|
|
472
|
+
value: z.notes,
|
|
473
|
+
onChange: (e) => B({
|
|
474
|
+
...z,
|
|
475
475
|
notes: e.target.value
|
|
476
476
|
}),
|
|
477
477
|
placeholder: "Optional context about this figure."
|
|
478
478
|
})]
|
|
479
479
|
}),
|
|
480
|
-
|
|
480
|
+
V && /* @__PURE__ */ v("p", {
|
|
481
481
|
className: "text-sm text-status-error-text",
|
|
482
|
-
children:
|
|
482
|
+
children: V
|
|
483
483
|
})
|
|
484
484
|
]
|
|
485
|
-
}), /* @__PURE__ */
|
|
485
|
+
}), /* @__PURE__ */ y(ve, { children: [/* @__PURE__ */ v(b, {
|
|
486
486
|
type: "button",
|
|
487
487
|
variant: "outline",
|
|
488
|
-
onClick: () =>
|
|
488
|
+
onClick: () => R(!1),
|
|
489
489
|
children: "Cancel"
|
|
490
|
-
}), /* @__PURE__ */
|
|
490
|
+
}), /* @__PURE__ */ v(b, {
|
|
491
491
|
type: "submit",
|
|
492
492
|
disabled: Y.isPending,
|
|
493
493
|
children: Y.isPending ? "Recording…" : "Record emission"
|
|
@@ -498,6 +498,6 @@ function L() {
|
|
|
498
498
|
});
|
|
499
499
|
}
|
|
500
500
|
//#endregion
|
|
501
|
-
export {
|
|
501
|
+
export { I as EmissionsPage };
|
|
502
502
|
|
|
503
503
|
//# sourceMappingURL=EmissionsPage.js.map
|