@burdenoff/microfe-theglobalfuel 2026.804.2 → 2026.827.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/stories/MetricsCard.stories.d.ts +2 -0
- package/dist/stories/MetricsCard.stories.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/analytics/AnalyticsPage.d.ts +5 -0
- package/dist/theglobalfuel/pages/analytics/AnalyticsPage.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/analytics/AnalyticsPage.js +426 -138
- package/dist/theglobalfuel/pages/analytics/AnalyticsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js +403 -299
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js.map +1 -1
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts +4 -3
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +310 -254
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
- package/dist/theglobalfuel/pages/production/ProductionPage.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/production/ProductionPage.js +29 -0
- package/dist/theglobalfuel/pages/production/ProductionPage.js.map +1 -1
- package/dist/theglobalfuel/utils/pageContext.d.ts.map +1 -1
- package/dist/theglobalfuel/utils/pageContext.js +2 -0
- package/dist/theglobalfuel/utils/pageContext.js.map +1 -1
- package/package.json +2 -2
|
@@ -11,25 +11,25 @@ import { EmptyState as v } from "../../components/EmptyState.js";
|
|
|
11
11
|
import { chartPalette as ee } from "../../components/viz/lib/palette.js";
|
|
12
12
|
import { Sparkline as y } from "../../components/viz/Sparkline.js";
|
|
13
13
|
import { AreaChart as te } from "../../components/viz/AreaChart.js";
|
|
14
|
-
import { DonutChart as
|
|
14
|
+
import { DonutChart as ne } from "../../components/viz/DonutChart.js";
|
|
15
15
|
import "../../components/viz/index.js";
|
|
16
16
|
import "../../context/index.js";
|
|
17
|
-
import { useTheAssets as
|
|
18
|
-
import { useThePageView as
|
|
19
|
-
import { useTheTranslation as
|
|
17
|
+
import { useTheAssets as re, useTheComplianceCerts as ie, useTheContracts as ae, useTheEmissionRecords as oe, useTheInventoryLots as se, useTheProductionRecords as ce, useTheReserveEstimates as le, useTheShipments as ue } from "../../hooks/useTheGlobalFuelApi.js";
|
|
18
|
+
import { useThePageView as de } from "../../hooks/useThePageView.js";
|
|
19
|
+
import { useTheTranslation as fe } from "../../hooks/useTheTranslation.js";
|
|
20
20
|
import "../../hooks/index.js";
|
|
21
|
-
import { useMemo as
|
|
22
|
-
import { Activity as
|
|
23
|
-
import { jsx as
|
|
24
|
-
import { GlassCard as
|
|
21
|
+
import { useMemo as b } from "react";
|
|
22
|
+
import { Activity as pe, ArrowRight as x, ArrowUpRight as S, Boxes as me, ClipboardList as he, Factory as ge, Fuel as _e, Gauge as ve, GitBranch as ye, Layers as be, ScrollText as xe, ShieldCheck as Se, Ship as Ce } from "lucide-react";
|
|
23
|
+
import { Fragment as we, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
24
|
+
import { GlassCard as T, Spinner as E } from "@burdenoff/fe-libs/ui";
|
|
25
25
|
//#region src/theglobalfuel/pages/dashboard/DashboardPage.tsx
|
|
26
|
-
var
|
|
26
|
+
var D = 1440 * 60 * 1e3, O = 30, k = (e) => {
|
|
27
27
|
if (!e) return !1;
|
|
28
28
|
let t = new Date(e).getTime();
|
|
29
29
|
if (Number.isNaN(t)) return !1;
|
|
30
30
|
let n = t - Date.now();
|
|
31
|
-
return n >= 0 && n <=
|
|
32
|
-
},
|
|
31
|
+
return n >= 0 && n <= O * D;
|
|
32
|
+
}, Te = {
|
|
33
33
|
EXPLORATION: "bg-[var(--color-accent-indigo)]",
|
|
34
34
|
APPRAISAL: "bg-[var(--color-accent-blue)]",
|
|
35
35
|
DEVELOPMENT: "bg-[var(--color-accent-teal)]",
|
|
@@ -37,32 +37,32 @@ var O = 1440 * 60 * 1e3, k = 30, A = (e) => {
|
|
|
37
37
|
SUSPENDED: "bg-status-warning-text",
|
|
38
38
|
DECOMMISSIONING: "bg-status-error-text",
|
|
39
39
|
RETIRED: "bg-[var(--color-text-tertiary)]"
|
|
40
|
-
},
|
|
40
|
+
}, Ee = {
|
|
41
41
|
SCOPE_1: "var(--color-status-error-text)",
|
|
42
42
|
SCOPE_2: "var(--color-status-warning-text)",
|
|
43
43
|
SCOPE_3: "var(--color-accent-blue)"
|
|
44
|
-
},
|
|
44
|
+
}, De = [
|
|
45
45
|
"SCOPE_1",
|
|
46
46
|
"SCOPE_2",
|
|
47
47
|
"SCOPE_3"
|
|
48
|
-
],
|
|
48
|
+
], A = (e) => `${e.getUTCFullYear()}-${String(e.getUTCMonth() + 1).padStart(2, "0")}`, j = new Intl.DateTimeFormat(void 0, {
|
|
49
49
|
month: "short",
|
|
50
50
|
year: "2-digit",
|
|
51
51
|
timeZone: "UTC"
|
|
52
|
-
}),
|
|
53
|
-
function
|
|
52
|
+
}), M = (e, t) => j.format(new Date(Date.UTC(e, t - 1, 1)));
|
|
53
|
+
function Oe(e, t, n) {
|
|
54
54
|
let r = /* @__PURE__ */ new Map();
|
|
55
55
|
for (let i of e) {
|
|
56
56
|
let e = t(i);
|
|
57
57
|
if (!e) continue;
|
|
58
58
|
let a = new Date(e);
|
|
59
59
|
if (Number.isNaN(a.getTime())) continue;
|
|
60
|
-
let o =
|
|
60
|
+
let o = A(a);
|
|
61
61
|
r.set(o, (r.get(o) ?? 0) + n(i));
|
|
62
62
|
}
|
|
63
63
|
return r;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function N(e, t = 18) {
|
|
66
66
|
let n = [...e.keys()].sort();
|
|
67
67
|
if (n.length === 0) return [];
|
|
68
68
|
let r = (e) => {
|
|
@@ -70,12 +70,12 @@ function P(e, t = 18) {
|
|
|
70
70
|
return [Number(t), Number(n)];
|
|
71
71
|
}, [i, a] = r(n[n.length - 1]), [o, s] = r(n[0]), c = [], l = 0;
|
|
72
72
|
for (; (o < i || o === i && s <= a) && l < 240;) c.push({
|
|
73
|
-
label:
|
|
73
|
+
label: M(o, s),
|
|
74
74
|
value: e.get(`${o}-${String(s).padStart(2, "0")}`) ?? 0
|
|
75
75
|
}), s += 1, s > 12 && (s = 1, o += 1), l += 1;
|
|
76
76
|
return c.length > t ? c.slice(c.length - t) : c;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function P(e, t) {
|
|
79
79
|
let n = /* @__PURE__ */ new Map();
|
|
80
80
|
for (let r of e) {
|
|
81
81
|
let e = t(r);
|
|
@@ -88,186 +88,186 @@ function F(e, t) {
|
|
|
88
88
|
pct: r ? t / r * 100 : 0
|
|
89
89
|
}));
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
return /* @__PURE__ */ T
|
|
91
|
+
function ke({ title: e, description: n, icon: r, linkLabel: i, onLink: a, isLoading: o, isError: c, onRetry: l, emptyLabel: u, bars: d, footer: f, className: m }) {
|
|
92
|
+
return /* @__PURE__ */ w(T, {
|
|
93
93
|
treatment: "glass",
|
|
94
94
|
className: t("flex flex-col p-5", m),
|
|
95
|
-
children: [/* @__PURE__ */
|
|
95
|
+
children: [/* @__PURE__ */ w("div", {
|
|
96
96
|
className: "mb-4 flex items-start justify-between gap-3",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
97
|
+
children: [/* @__PURE__ */ w("div", {
|
|
98
98
|
className: "flex min-w-0 items-start gap-2.5",
|
|
99
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ C("span", {
|
|
100
100
|
className: "mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-action-primary-bg",
|
|
101
101
|
children: r
|
|
102
|
-
}), /* @__PURE__ */
|
|
102
|
+
}), /* @__PURE__ */ w("div", {
|
|
103
103
|
className: "min-w-0",
|
|
104
|
-
children: [/* @__PURE__ */
|
|
104
|
+
children: [/* @__PURE__ */ C("h2", {
|
|
105
105
|
className: "text-base font-semibold text-text-primary",
|
|
106
106
|
children: e
|
|
107
|
-
}), /* @__PURE__ */
|
|
107
|
+
}), /* @__PURE__ */ C("p", {
|
|
108
108
|
className: "mt-0.5 text-xs text-text-tertiary",
|
|
109
109
|
children: n
|
|
110
110
|
})]
|
|
111
111
|
})]
|
|
112
|
-
}), /* @__PURE__ */
|
|
112
|
+
}), /* @__PURE__ */ w("button", {
|
|
113
113
|
type: "button",
|
|
114
114
|
onClick: a,
|
|
115
115
|
className: "inline-flex shrink-0 items-center gap-1 text-sm font-medium text-action-primary-bg hover:underline",
|
|
116
116
|
children: [
|
|
117
117
|
i,
|
|
118
118
|
" ",
|
|
119
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ C(x, { className: "h-4 w-4" })
|
|
120
120
|
]
|
|
121
121
|
})]
|
|
122
|
-
}), o ? /* @__PURE__ */
|
|
122
|
+
}), o ? /* @__PURE__ */ w("div", {
|
|
123
123
|
className: "flex items-center gap-2 py-8 text-sm text-text-secondary",
|
|
124
|
-
children: [/* @__PURE__ */
|
|
125
|
-
}) : c ? /* @__PURE__ */
|
|
124
|
+
children: [/* @__PURE__ */ C(E, { size: "sm" }), " Loading…"]
|
|
125
|
+
}) : c ? /* @__PURE__ */ w("div", {
|
|
126
126
|
className: "flex flex-col items-start gap-2 py-6",
|
|
127
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ w("p", {
|
|
128
128
|
className: "text-sm text-status-error-text",
|
|
129
129
|
children: [
|
|
130
130
|
"Couldn't load ",
|
|
131
131
|
e.toLowerCase(),
|
|
132
132
|
"."
|
|
133
133
|
]
|
|
134
|
-
}), /* @__PURE__ */
|
|
134
|
+
}), /* @__PURE__ */ C("button", {
|
|
135
135
|
type: "button",
|
|
136
136
|
onClick: l,
|
|
137
137
|
className: "rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
138
138
|
children: "Retry"
|
|
139
139
|
})]
|
|
140
|
-
}) : d.length === 0 ? /* @__PURE__ */
|
|
140
|
+
}) : d.length === 0 ? /* @__PURE__ */ C("div", {
|
|
141
141
|
className: "flex flex-1 flex-col items-center justify-center rounded-xl border border-dashed border-border-seam py-8 text-center",
|
|
142
|
-
children: /* @__PURE__ */
|
|
142
|
+
children: /* @__PURE__ */ C("p", {
|
|
143
143
|
className: "text-sm text-text-secondary",
|
|
144
144
|
children: u
|
|
145
145
|
})
|
|
146
|
-
}) : /* @__PURE__ */
|
|
146
|
+
}) : /* @__PURE__ */ w("div", {
|
|
147
147
|
className: "flex flex-1 flex-col justify-between gap-4",
|
|
148
|
-
children: [/* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ C("div", {
|
|
149
149
|
className: "space-y-3",
|
|
150
|
-
children: d.map((e) => /* @__PURE__ */
|
|
150
|
+
children: d.map((e) => /* @__PURE__ */ w("div", {
|
|
151
151
|
className: "flex items-center gap-3",
|
|
152
152
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ C("div", {
|
|
154
154
|
className: "w-24 shrink-0 truncate text-sm text-text-secondary sm:w-28",
|
|
155
155
|
children: e.label
|
|
156
156
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ C(p, {
|
|
158
158
|
value: e.pct,
|
|
159
159
|
barClassName: e.barClassName,
|
|
160
160
|
className: "flex-1",
|
|
161
161
|
height: 8
|
|
162
162
|
}),
|
|
163
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ C("span", {
|
|
164
164
|
className: "w-16 shrink-0 whitespace-nowrap text-right text-sm font-medium tabular-nums text-text-primary",
|
|
165
165
|
children: e.value
|
|
166
166
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ C("span", {
|
|
168
168
|
className: "hidden w-11 shrink-0 text-right text-xs tabular-nums text-text-tertiary sm:inline",
|
|
169
169
|
children: s(e.pct)
|
|
170
170
|
})
|
|
171
171
|
]
|
|
172
172
|
}, e.key))
|
|
173
|
-
}), f && /* @__PURE__ */
|
|
173
|
+
}), f && /* @__PURE__ */ C("p", {
|
|
174
174
|
className: "border-t border-border-seam/70 pt-3 text-xs text-text-tertiary",
|
|
175
175
|
children: f
|
|
176
176
|
})]
|
|
177
177
|
})]
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
|
-
function
|
|
181
|
-
return /* @__PURE__ */ T
|
|
180
|
+
function F({ title: e, caption: n, icon: r, link: i, isLoading: a, isError: o, onRetry: s, isEmpty: c, emptyLabel: l, footer: u, className: d, children: f }) {
|
|
181
|
+
return /* @__PURE__ */ w(T, {
|
|
182
182
|
treatment: "glass",
|
|
183
183
|
className: t("flex flex-col p-5", d),
|
|
184
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ w("div", {
|
|
185
185
|
className: "mb-4 flex items-start justify-between gap-3",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ w("div", {
|
|
187
187
|
className: "flex min-w-0 items-start gap-2.5",
|
|
188
|
-
children: [/* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ C("span", {
|
|
189
189
|
className: "mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-action-primary-bg",
|
|
190
190
|
children: r
|
|
191
|
-
}), /* @__PURE__ */
|
|
191
|
+
}), /* @__PURE__ */ w("div", {
|
|
192
192
|
className: "min-w-0",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ C("h2", {
|
|
194
194
|
className: "text-base font-semibold text-text-primary",
|
|
195
195
|
children: e
|
|
196
|
-
}), /* @__PURE__ */
|
|
196
|
+
}), /* @__PURE__ */ C("p", {
|
|
197
197
|
className: "mt-0.5 text-xs text-text-tertiary",
|
|
198
198
|
children: n
|
|
199
199
|
})]
|
|
200
200
|
})]
|
|
201
|
-
}), i ? /* @__PURE__ */
|
|
201
|
+
}), i ? /* @__PURE__ */ w("button", {
|
|
202
202
|
type: "button",
|
|
203
203
|
onClick: i.onClick,
|
|
204
204
|
className: "inline-flex shrink-0 items-center gap-1 text-sm font-medium text-action-primary-bg hover:underline",
|
|
205
205
|
children: [
|
|
206
206
|
i.label,
|
|
207
207
|
" ",
|
|
208
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ C(x, { className: "h-4 w-4" })
|
|
209
209
|
]
|
|
210
210
|
}) : null]
|
|
211
|
-
}), a ? /* @__PURE__ */
|
|
211
|
+
}), a ? /* @__PURE__ */ w("div", {
|
|
212
212
|
className: "flex flex-1 items-center gap-2 py-8 text-sm text-text-secondary",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
214
|
-
}) : o ? /* @__PURE__ */
|
|
213
|
+
children: [/* @__PURE__ */ C(E, { size: "sm" }), " Loading…"]
|
|
214
|
+
}) : o ? /* @__PURE__ */ w("div", {
|
|
215
215
|
className: "flex flex-1 flex-col items-start gap-2 py-6",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
216
|
+
children: [/* @__PURE__ */ w("p", {
|
|
217
217
|
className: "text-sm text-status-error-text",
|
|
218
218
|
children: [
|
|
219
219
|
"Couldn't load ",
|
|
220
220
|
e.toLowerCase(),
|
|
221
221
|
"."
|
|
222
222
|
]
|
|
223
|
-
}), /* @__PURE__ */
|
|
223
|
+
}), /* @__PURE__ */ C("button", {
|
|
224
224
|
type: "button",
|
|
225
225
|
onClick: s,
|
|
226
226
|
className: "rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
227
227
|
children: "Retry"
|
|
228
228
|
})]
|
|
229
|
-
}) : c ? /* @__PURE__ */
|
|
229
|
+
}) : c ? /* @__PURE__ */ C("div", {
|
|
230
230
|
className: "flex flex-1 flex-col items-center justify-center rounded-xl border border-dashed border-border-seam py-10 text-center",
|
|
231
|
-
children: /* @__PURE__ */
|
|
231
|
+
children: /* @__PURE__ */ C("p", {
|
|
232
232
|
className: "text-sm text-text-secondary",
|
|
233
233
|
children: l
|
|
234
234
|
})
|
|
235
|
-
}) : /* @__PURE__ */
|
|
235
|
+
}) : /* @__PURE__ */ w("div", {
|
|
236
236
|
className: "flex flex-1 flex-col justify-between gap-4",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
237
|
+
children: [/* @__PURE__ */ C("div", {
|
|
238
238
|
className: "flex-1",
|
|
239
239
|
children: f
|
|
240
|
-
}), u ? /* @__PURE__ */
|
|
240
|
+
}), u ? /* @__PURE__ */ C("p", {
|
|
241
241
|
className: "border-t border-border-seam/70 pt-3 text-xs text-text-tertiary",
|
|
242
242
|
children: u
|
|
243
243
|
}) : null]
|
|
244
244
|
})]
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
return /* @__PURE__ */
|
|
247
|
+
function Ae({ card: e, onOpen: t }) {
|
|
248
|
+
return /* @__PURE__ */ C(T, {
|
|
249
249
|
treatment: "metric",
|
|
250
250
|
className: "p-0",
|
|
251
|
-
children: /* @__PURE__ */
|
|
251
|
+
children: /* @__PURE__ */ w("button", {
|
|
252
252
|
type: "button",
|
|
253
253
|
onClick: t,
|
|
254
254
|
"aria-label": `Open ${e.name} assets`,
|
|
255
255
|
className: "flex w-full flex-col gap-4 rounded-[var(--radius-card)] p-5 text-left outline-none transition-transform duration-200 hover:-translate-y-0.5 focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
256
256
|
children: [
|
|
257
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ w("div", {
|
|
258
258
|
className: "flex items-start justify-between gap-2",
|
|
259
|
-
children: [/* @__PURE__ */
|
|
259
|
+
children: [/* @__PURE__ */ w("div", {
|
|
260
260
|
className: "flex min-w-0 items-center gap-2.5",
|
|
261
|
-
children: [/* @__PURE__ */
|
|
261
|
+
children: [/* @__PURE__ */ C("span", {
|
|
262
262
|
"aria-hidden": "true",
|
|
263
263
|
className: "size-2.5 shrink-0 rounded-full",
|
|
264
264
|
style: { backgroundColor: e.color }
|
|
265
|
-
}), /* @__PURE__ */
|
|
265
|
+
}), /* @__PURE__ */ w("div", {
|
|
266
266
|
className: "min-w-0",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ C("p", {
|
|
268
268
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
269
269
|
children: e.name
|
|
270
|
-
}), /* @__PURE__ */
|
|
270
|
+
}), /* @__PURE__ */ w("p", {
|
|
271
271
|
className: "text-xs text-text-tertiary",
|
|
272
272
|
children: [
|
|
273
273
|
e.assetCount,
|
|
@@ -276,46 +276,60 @@ function De({ card: e, onOpen: t }) {
|
|
|
276
276
|
]
|
|
277
277
|
})]
|
|
278
278
|
})]
|
|
279
|
-
}), /* @__PURE__ */
|
|
279
|
+
}), /* @__PURE__ */ C(S, { className: "h-4 w-4 shrink-0 text-text-tertiary" })]
|
|
280
280
|
}),
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
className: "grid grid-cols-
|
|
283
|
-
children: [
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
className: "
|
|
296
|
-
children: "
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
" "
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
281
|
+
/* @__PURE__ */ w("div", {
|
|
282
|
+
className: "grid grid-cols-3 gap-3",
|
|
283
|
+
children: [
|
|
284
|
+
/* @__PURE__ */ w("div", {
|
|
285
|
+
className: "min-w-0",
|
|
286
|
+
children: [/* @__PURE__ */ C("p", {
|
|
287
|
+
className: "text-[11px] uppercase tracking-wide text-text-tertiary",
|
|
288
|
+
children: "Capacity/day"
|
|
289
|
+
}), /* @__PURE__ */ C("p", {
|
|
290
|
+
className: "mt-0.5 truncate text-sm font-semibold tabular-nums text-text-primary",
|
|
291
|
+
children: e.capacity > 0 ? u(e.capacity, e.unit) : "—"
|
|
292
|
+
})]
|
|
293
|
+
}),
|
|
294
|
+
/* @__PURE__ */ w("div", {
|
|
295
|
+
className: "min-w-0",
|
|
296
|
+
children: [/* @__PURE__ */ C("p", {
|
|
297
|
+
className: "text-[11px] uppercase tracking-wide text-text-tertiary",
|
|
298
|
+
children: "Proved"
|
|
299
|
+
}), /* @__PURE__ */ C("p", {
|
|
300
|
+
className: "mt-0.5 truncate text-sm font-semibold tabular-nums text-text-primary",
|
|
301
|
+
title: e.reserves == null ? "No proved reserves booked" : `Latest proved estimate across ${e.reserveAssets} ${e.reserveAssets === 1 ? "asset" : "assets"}`,
|
|
302
|
+
children: e.reserves == null ? "—" : u(e.reserves, e.reserveUnit)
|
|
303
|
+
})]
|
|
304
|
+
}),
|
|
305
|
+
/* @__PURE__ */ w("div", {
|
|
306
|
+
className: "min-w-0",
|
|
307
|
+
children: [/* @__PURE__ */ C("p", {
|
|
308
|
+
className: "text-[11px] uppercase tracking-wide text-text-tertiary",
|
|
309
|
+
children: "Producing"
|
|
310
|
+
}), /* @__PURE__ */ w("p", {
|
|
311
|
+
className: "mt-0.5 text-sm font-semibold tabular-nums text-text-primary",
|
|
312
|
+
children: [
|
|
313
|
+
e.producing,
|
|
314
|
+
" ",
|
|
315
|
+
/* @__PURE__ */ w("span", {
|
|
316
|
+
className: "text-xs font-normal text-text-tertiary",
|
|
317
|
+
children: ["of ", e.assetCount]
|
|
318
|
+
})
|
|
319
|
+
]
|
|
320
|
+
})]
|
|
321
|
+
})
|
|
322
|
+
]
|
|
309
323
|
}),
|
|
310
|
-
e.spark.length >= 2 ? /* @__PURE__ */
|
|
324
|
+
e.spark.length >= 2 ? /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C(y, {
|
|
311
325
|
data: e.spark,
|
|
312
326
|
variant: "area",
|
|
313
327
|
height: 40,
|
|
314
328
|
label: `${e.name} monthly production`
|
|
315
|
-
}), /* @__PURE__ */
|
|
329
|
+
}), /* @__PURE__ */ C("p", {
|
|
316
330
|
className: "mt-1 text-[11px] text-text-tertiary",
|
|
317
331
|
children: "Monthly output"
|
|
318
|
-
})] }) : /* @__PURE__ */
|
|
332
|
+
})] }) : /* @__PURE__ */ C("p", {
|
|
319
333
|
className: "text-xs text-text-tertiary",
|
|
320
334
|
children: "No production logged yet."
|
|
321
335
|
})
|
|
@@ -323,16 +337,16 @@ function De({ card: e, onOpen: t }) {
|
|
|
323
337
|
})
|
|
324
338
|
});
|
|
325
339
|
}
|
|
326
|
-
function
|
|
327
|
-
|
|
328
|
-
let { navigateTo: t, currentUser: s } = e(), y =
|
|
340
|
+
function I() {
|
|
341
|
+
de("dashboard");
|
|
342
|
+
let { navigateTo: t, currentUser: s } = e(), y = re({ pagination: { limit: 200 } }), S = ae({ pagination: { limit: 50 } }), T = ue(void 0, "IN_TRANSIT"), E = oe({ pagination: { limit: 200 } }), D = se({ pagination: { limit: 50 } }), O = ie(), j = ce({ pagination: { limit: 200 } }), M = le(void 0, "PROVED", { limit: 200 }), I = b(() => y.data?.items ?? [], [y.data]), L = b(() => S.data?.items ?? [], [S.data]), R = b(() => T.data?.items ?? [], [T.data]), z = b(() => E.data?.items ?? [], [E.data]), B = b(() => D.data?.items ?? [], [D.data]), V = b(() => O.data?.items ?? [], [O.data]), H = b(() => j.data?.items ?? [], [j.data]), U = b(() => M.data?.items ?? [], [M.data]), W = I.filter((e) => e.status === "PRODUCING").length, je = L.filter((e) => e.status === "ACTIVE").length, G = z.reduce((e, t) => e + (t.co2eTonnes ?? 0), 0), Me = z.filter((e) => e.verified).length, Ne = B.filter((e) => e.status === "AVAILABLE").length, Pe = H.reduce((e, t) => e + (t.volume ?? 0), 0), Fe = V.filter((e) => e.status === "PENDING").length, Ie = V.filter((e) => e.expiresAt != null && (d(e.expiresAt) || k(e.expiresAt))).length, K = V.filter((e) => e.status === "PENDING" || e.expiresAt != null && (d(e.expiresAt) || k(e.expiresAt))).length, q = (e, t) => t ? `${e.length}+` : o(e.length), J = b(() => N(Oe(H, (e) => e.periodEnd, (e) => e.volume ?? 0)), [H]), Y = b(() => P(I, (e) => e.commodity), [I]), X = b(() => {
|
|
329
343
|
let e = ee(Y.length), t = /* @__PURE__ */ new Map();
|
|
330
344
|
return Y.forEach((n, r) => t.set(n.key, e[r])), t;
|
|
331
|
-
}, [Y]), Z =
|
|
345
|
+
}, [Y]), Z = b(() => Y.map((e) => ({
|
|
332
346
|
label: a(e.key),
|
|
333
347
|
value: e.count,
|
|
334
348
|
color: X.get(e.key)
|
|
335
|
-
})), [Y, X]),
|
|
349
|
+
})), [Y, X]), Le = b(() => {
|
|
336
350
|
if (z.length === 0) return [];
|
|
337
351
|
let e = {
|
|
338
352
|
SCOPE_1: 0,
|
|
@@ -340,25 +354,60 @@ function L() {
|
|
|
340
354
|
SCOPE_3: 0
|
|
341
355
|
};
|
|
342
356
|
for (let t of z) e[t.scope] += t.co2eTonnes ?? 0;
|
|
343
|
-
return
|
|
357
|
+
return De.filter((t) => e[t] > 0).map((t) => ({
|
|
344
358
|
label: a(t),
|
|
345
359
|
value: e[t],
|
|
346
|
-
color:
|
|
360
|
+
color: Ee[t]
|
|
347
361
|
}));
|
|
348
|
-
}, [z]),
|
|
362
|
+
}, [z]), Re = b(() => P(I, (e) => e.status).map((e) => ({
|
|
349
363
|
key: e.key,
|
|
350
|
-
label: /* @__PURE__ */
|
|
364
|
+
label: /* @__PURE__ */ C(f, { status: e.key }),
|
|
351
365
|
value: o(e.count),
|
|
352
366
|
pct: e.pct,
|
|
353
|
-
barClassName:
|
|
354
|
-
})), [
|
|
367
|
+
barClassName: Te[e.key] ?? "bg-action-primary-bg"
|
|
368
|
+
})), [I]), Q = b(() => {
|
|
355
369
|
let e = /* @__PURE__ */ new Map();
|
|
356
|
-
for (let t of
|
|
370
|
+
for (let t of I) e.set(t.id, t.commodity);
|
|
357
371
|
return e;
|
|
358
|
-
}, [
|
|
372
|
+
}, [I]), ze = b(() => {
|
|
373
|
+
let e = /* @__PURE__ */ new Map();
|
|
374
|
+
for (let t of U) {
|
|
375
|
+
let n = new Date(t.asOfDate).getTime();
|
|
376
|
+
if (Number.isNaN(n)) continue;
|
|
377
|
+
let r = e.get(t.assetId);
|
|
378
|
+
r && r.at >= n || e.set(t.assetId, {
|
|
379
|
+
recoverable: t.recoverable ?? 0,
|
|
380
|
+
unit: t.unit,
|
|
381
|
+
at: n
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
let t = /* @__PURE__ */ new Map();
|
|
385
|
+
for (let [n, r] of e) {
|
|
386
|
+
let e = Q.get(n);
|
|
387
|
+
if (!e) continue;
|
|
388
|
+
let i = t.get(e);
|
|
389
|
+
i || (i = /* @__PURE__ */ new Map(), t.set(e, i));
|
|
390
|
+
let a = i.get(r.unit) ?? {
|
|
391
|
+
total: 0,
|
|
392
|
+
assets: 0
|
|
393
|
+
};
|
|
394
|
+
a.total += r.recoverable, a.assets += 1, i.set(r.unit, a);
|
|
395
|
+
}
|
|
396
|
+
let n = /* @__PURE__ */ new Map();
|
|
397
|
+
for (let [e, r] of t) {
|
|
398
|
+
let t = null;
|
|
399
|
+
for (let [e, n] of r) (!t || n.assets > t.assets || n.assets === t.assets && n.total > t.total) && (t = {
|
|
400
|
+
total: n.total,
|
|
401
|
+
unit: e,
|
|
402
|
+
assets: n.assets
|
|
403
|
+
});
|
|
404
|
+
t && n.set(e, t);
|
|
405
|
+
}
|
|
406
|
+
return n;
|
|
407
|
+
}, [U, Q]), Be = b(() => {
|
|
359
408
|
if (Y.length === 0) return [];
|
|
360
409
|
let e = /* @__PURE__ */ new Map();
|
|
361
|
-
for (let t of
|
|
410
|
+
for (let t of I) {
|
|
362
411
|
let n = e.get(t.commodity) ?? {
|
|
363
412
|
count: 0,
|
|
364
413
|
producing: 0,
|
|
@@ -369,11 +418,11 @@ function L() {
|
|
|
369
418
|
}
|
|
370
419
|
let t = /* @__PURE__ */ new Map();
|
|
371
420
|
for (let e of H) {
|
|
372
|
-
let n =
|
|
421
|
+
let n = Q.get(e.assetId);
|
|
373
422
|
if (!n) continue;
|
|
374
423
|
let r = new Date(e.periodEnd);
|
|
375
424
|
if (Number.isNaN(r.getTime())) continue;
|
|
376
|
-
let i =
|
|
425
|
+
let i = A(r), a = t.get(n);
|
|
377
426
|
a || (a = /* @__PURE__ */ new Map(), t.set(n, a)), a.set(i, (a.get(i) ?? 0) + (e.volume ?? 0));
|
|
378
427
|
}
|
|
379
428
|
let n = (e) => {
|
|
@@ -387,7 +436,7 @@ function L() {
|
|
|
387
436
|
producing: 0,
|
|
388
437
|
capacity: 0,
|
|
389
438
|
units: /* @__PURE__ */ new Map()
|
|
390
|
-
}, o = t.get(r.key), s = o ?
|
|
439
|
+
}, o = t.get(r.key), s = o ? N(o, 12).map((e) => e.value) : [], c = ze.get(r.key);
|
|
391
440
|
return {
|
|
392
441
|
key: r.key,
|
|
393
442
|
name: a(r.key),
|
|
@@ -396,24 +445,28 @@ function L() {
|
|
|
396
445
|
producing: i.producing,
|
|
397
446
|
capacity: i.capacity,
|
|
398
447
|
unit: n(i.units),
|
|
448
|
+
reserves: c ? c.total : null,
|
|
449
|
+
reserveUnit: c?.unit ?? "",
|
|
450
|
+
reserveAssets: c?.assets ?? 0,
|
|
399
451
|
spark: s
|
|
400
452
|
};
|
|
401
453
|
});
|
|
402
454
|
}, [
|
|
403
|
-
|
|
455
|
+
I,
|
|
404
456
|
H,
|
|
405
|
-
|
|
457
|
+
Q,
|
|
406
458
|
Y,
|
|
407
|
-
X
|
|
408
|
-
|
|
459
|
+
X,
|
|
460
|
+
ze
|
|
461
|
+
]), Ve = b(() => {
|
|
409
462
|
let e = /* @__PURE__ */ new Map();
|
|
410
|
-
for (let t of
|
|
463
|
+
for (let t of I) e.set(t.id, t.name);
|
|
411
464
|
return e;
|
|
412
|
-
}, [
|
|
465
|
+
}, [I]), He = b(() => [...L].sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime()).slice(0, 6), [L]), Ue = b(() => [...H].sort((e, t) => new Date(t.periodEnd).getTime() - new Date(e.periodEnd).getTime()).slice(0, 6), [H]), We = [
|
|
413
466
|
{
|
|
414
467
|
key: "reference",
|
|
415
468
|
header: "Reference",
|
|
416
|
-
render: (e) => /* @__PURE__ */
|
|
469
|
+
render: (e) => /* @__PURE__ */ C("span", {
|
|
417
470
|
className: "font-medium text-text-primary",
|
|
418
471
|
children: e.reference
|
|
419
472
|
})
|
|
@@ -422,7 +475,7 @@ function L() {
|
|
|
422
475
|
key: "counterparty",
|
|
423
476
|
header: "Counterparty",
|
|
424
477
|
hideOnMobile: !0,
|
|
425
|
-
render: (e) => /* @__PURE__ */
|
|
478
|
+
render: (e) => /* @__PURE__ */ C("span", {
|
|
426
479
|
className: "text-text-secondary",
|
|
427
480
|
children: e.counterparty
|
|
428
481
|
})
|
|
@@ -431,7 +484,7 @@ function L() {
|
|
|
431
484
|
key: "commodity",
|
|
432
485
|
header: "Commodity",
|
|
433
486
|
hideOnMobile: !0,
|
|
434
|
-
render: (e) => /* @__PURE__ */
|
|
487
|
+
render: (e) => /* @__PURE__ */ C("span", {
|
|
435
488
|
className: "text-text-secondary",
|
|
436
489
|
children: a(e.commodity)
|
|
437
490
|
})
|
|
@@ -439,14 +492,14 @@ function L() {
|
|
|
439
492
|
{
|
|
440
493
|
key: "side",
|
|
441
494
|
header: "Side",
|
|
442
|
-
render: (e) => /* @__PURE__ */
|
|
495
|
+
render: (e) => /* @__PURE__ */ C(f, { status: e.side })
|
|
443
496
|
},
|
|
444
497
|
{
|
|
445
498
|
key: "volume",
|
|
446
499
|
header: "Volume",
|
|
447
500
|
align: "right",
|
|
448
501
|
hideOnMobile: !0,
|
|
449
|
-
render: (e) => /* @__PURE__ */
|
|
502
|
+
render: (e) => /* @__PURE__ */ C("span", {
|
|
450
503
|
className: "tabular-nums text-text-secondary",
|
|
451
504
|
children: u(e.contractedVolume, e.unit)
|
|
452
505
|
})
|
|
@@ -454,32 +507,32 @@ function L() {
|
|
|
454
507
|
{
|
|
455
508
|
key: "status",
|
|
456
509
|
header: "Status",
|
|
457
|
-
render: (e) => /* @__PURE__ */
|
|
510
|
+
render: (e) => /* @__PURE__ */ C(f, { status: e.status })
|
|
458
511
|
},
|
|
459
512
|
{
|
|
460
513
|
key: "created",
|
|
461
514
|
header: "Created",
|
|
462
515
|
align: "right",
|
|
463
516
|
hideOnMobile: !0,
|
|
464
|
-
render: (e) => /* @__PURE__ */
|
|
517
|
+
render: (e) => /* @__PURE__ */ C("span", {
|
|
465
518
|
className: "text-text-tertiary",
|
|
466
519
|
children: c(e.createdAt)
|
|
467
520
|
})
|
|
468
521
|
}
|
|
469
|
-
],
|
|
522
|
+
], Ge = [
|
|
470
523
|
{
|
|
471
524
|
key: "asset",
|
|
472
525
|
header: "Asset",
|
|
473
|
-
render: (e) => /* @__PURE__ */
|
|
526
|
+
render: (e) => /* @__PURE__ */ C("span", {
|
|
474
527
|
className: "font-medium text-text-primary",
|
|
475
|
-
children:
|
|
528
|
+
children: Ve.get(e.assetId) ?? "Unknown asset"
|
|
476
529
|
})
|
|
477
530
|
},
|
|
478
531
|
{
|
|
479
532
|
key: "period",
|
|
480
533
|
header: "Period",
|
|
481
534
|
hideOnMobile: !0,
|
|
482
|
-
render: (e) => /* @__PURE__ */
|
|
535
|
+
render: (e) => /* @__PURE__ */ w("span", {
|
|
483
536
|
className: "text-text-secondary",
|
|
484
537
|
children: [
|
|
485
538
|
i(e.periodStart),
|
|
@@ -492,7 +545,7 @@ function L() {
|
|
|
492
545
|
key: "volume",
|
|
493
546
|
header: "Volume",
|
|
494
547
|
align: "right",
|
|
495
|
-
render: (e) => /* @__PURE__ */
|
|
548
|
+
render: (e) => /* @__PURE__ */ C("span", {
|
|
496
549
|
className: "tabular-nums font-medium text-text-primary",
|
|
497
550
|
children: u(e.volume, e.unit)
|
|
498
551
|
})
|
|
@@ -502,7 +555,7 @@ function L() {
|
|
|
502
555
|
header: "Downtime",
|
|
503
556
|
align: "right",
|
|
504
557
|
hideOnMobile: !0,
|
|
505
|
-
render: (e) => /* @__PURE__ */
|
|
558
|
+
render: (e) => /* @__PURE__ */ w("span", {
|
|
506
559
|
className: "tabular-nums text-text-secondary",
|
|
507
560
|
children: [o(e.downtimeHours), " h"]
|
|
508
561
|
})
|
|
@@ -512,93 +565,93 @@ function L() {
|
|
|
512
565
|
header: "Logged",
|
|
513
566
|
align: "right",
|
|
514
567
|
hideOnMobile: !0,
|
|
515
|
-
render: (e) => /* @__PURE__ */
|
|
568
|
+
render: (e) => /* @__PURE__ */ C("span", {
|
|
516
569
|
className: "text-text-tertiary",
|
|
517
570
|
children: c(e.createdAt)
|
|
518
571
|
})
|
|
519
572
|
}
|
|
520
|
-
],
|
|
521
|
-
return
|
|
573
|
+
], Ke = s?.firstName || s?.name || "there", qe = fe(), Je = qe("theglobalfuel.pages.dashboard.subtitle", "Welcome back, {name} — your energy, mineral & commodity resource control room.", { name: Ke }), Ye = y.isLoading && S.isLoading && E.isLoading && D.isLoading && O.isLoading, $ = qe("theglobalfuel.pages.dashboard.title", "TheGlobalFuel");
|
|
574
|
+
return Ye ? /* @__PURE__ */ C(n, {
|
|
522
575
|
title: $,
|
|
523
576
|
titleGradient: !0,
|
|
524
577
|
aurora: !0,
|
|
525
|
-
description:
|
|
578
|
+
description: Je,
|
|
526
579
|
dataTour: "theglobalfuel-dashboard-page",
|
|
527
|
-
children: /* @__PURE__ */
|
|
528
|
-
}) : /* @__PURE__ */
|
|
580
|
+
children: /* @__PURE__ */ C(g, { label: "Loading your resource portfolio…" })
|
|
581
|
+
}) : /* @__PURE__ */ w(n, {
|
|
529
582
|
title: $,
|
|
530
583
|
titleGradient: !0,
|
|
531
584
|
aurora: !0,
|
|
532
|
-
description:
|
|
585
|
+
description: Je,
|
|
533
586
|
dataTour: "theglobalfuel-dashboard-page",
|
|
534
587
|
children: [
|
|
535
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ w("div", {
|
|
536
589
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",
|
|
537
590
|
children: [
|
|
538
|
-
/* @__PURE__ */
|
|
539
|
-
icon: /* @__PURE__ */
|
|
540
|
-
value: q(
|
|
591
|
+
/* @__PURE__ */ C(r, {
|
|
592
|
+
icon: /* @__PURE__ */ C(be, { className: "h-5 w-5" }),
|
|
593
|
+
value: q(I, y.data?.pageInfo?.hasMore),
|
|
541
594
|
label: "Resource assets",
|
|
542
595
|
featured: !0,
|
|
543
|
-
footer: /* @__PURE__ */
|
|
596
|
+
footer: /* @__PURE__ */ w("div", {
|
|
544
597
|
className: "space-y-2",
|
|
545
|
-
children: [/* @__PURE__ */
|
|
546
|
-
value:
|
|
598
|
+
children: [/* @__PURE__ */ C(p, {
|
|
599
|
+
value: I.length ? W / I.length * 100 : 0,
|
|
547
600
|
height: 4,
|
|
548
601
|
barClassName: "bg-status-success-text"
|
|
549
|
-
}), /* @__PURE__ */
|
|
602
|
+
}), /* @__PURE__ */ w("p", {
|
|
550
603
|
className: "text-xs text-text-tertiary",
|
|
551
|
-
children: [/* @__PURE__ */
|
|
604
|
+
children: [/* @__PURE__ */ C("span", {
|
|
552
605
|
className: "tabular-nums text-text-secondary",
|
|
553
|
-
children:
|
|
606
|
+
children: W
|
|
554
607
|
}), " producing"]
|
|
555
608
|
})]
|
|
556
609
|
})
|
|
557
610
|
}),
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
icon: /* @__PURE__ */
|
|
560
|
-
value: q(L,
|
|
611
|
+
/* @__PURE__ */ C(r, {
|
|
612
|
+
icon: /* @__PURE__ */ C(xe, { className: "h-5 w-5" }),
|
|
613
|
+
value: q(L, S.data?.pageInfo?.hasMore),
|
|
561
614
|
label: "Offtake contracts",
|
|
562
|
-
footer: /* @__PURE__ */
|
|
615
|
+
footer: /* @__PURE__ */ w("div", {
|
|
563
616
|
className: "space-y-2",
|
|
564
|
-
children: [/* @__PURE__ */
|
|
565
|
-
value: L.length ?
|
|
617
|
+
children: [/* @__PURE__ */ C(p, {
|
|
618
|
+
value: L.length ? je / L.length * 100 : 0,
|
|
566
619
|
height: 4,
|
|
567
620
|
barClassName: "bg-action-primary-bg"
|
|
568
|
-
}), /* @__PURE__ */
|
|
621
|
+
}), /* @__PURE__ */ w("p", {
|
|
569
622
|
className: "text-xs text-text-tertiary",
|
|
570
|
-
children: [/* @__PURE__ */
|
|
623
|
+
children: [/* @__PURE__ */ C("span", {
|
|
571
624
|
className: "tabular-nums text-text-secondary",
|
|
572
|
-
children:
|
|
625
|
+
children: je
|
|
573
626
|
}), " active"]
|
|
574
627
|
})]
|
|
575
628
|
})
|
|
576
629
|
}),
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
icon: /* @__PURE__ */
|
|
579
|
-
value:
|
|
630
|
+
/* @__PURE__ */ C(r, {
|
|
631
|
+
icon: /* @__PURE__ */ C(Ce, { className: "h-5 w-5" }),
|
|
632
|
+
value: T.isError ? "—" : o(R.length),
|
|
580
633
|
label: "Shipments in transit",
|
|
581
|
-
footer: /* @__PURE__ */
|
|
634
|
+
footer: /* @__PURE__ */ C("p", {
|
|
582
635
|
className: "text-xs text-text-tertiary",
|
|
583
636
|
children: R.length > 0 ? "In motion across carriers" : "No active movements"
|
|
584
637
|
})
|
|
585
638
|
}),
|
|
586
|
-
/* @__PURE__ */
|
|
587
|
-
icon: /* @__PURE__ */
|
|
588
|
-
value:
|
|
639
|
+
/* @__PURE__ */ C(r, {
|
|
640
|
+
icon: /* @__PURE__ */ C(ge, { className: "h-5 w-5" }),
|
|
641
|
+
value: E.isError ? "—" : l(G),
|
|
589
642
|
label: "Emissions logged",
|
|
590
|
-
footer: /* @__PURE__ */
|
|
643
|
+
footer: /* @__PURE__ */ w("div", {
|
|
591
644
|
className: "space-y-2",
|
|
592
|
-
children: [/* @__PURE__ */
|
|
593
|
-
value: z.length ?
|
|
645
|
+
children: [/* @__PURE__ */ C(p, {
|
|
646
|
+
value: z.length ? Me / z.length * 100 : 0,
|
|
594
647
|
height: 4,
|
|
595
648
|
barClassName: "bg-status-success-text"
|
|
596
|
-
}), /* @__PURE__ */
|
|
649
|
+
}), /* @__PURE__ */ w("p", {
|
|
597
650
|
className: "text-xs text-text-tertiary",
|
|
598
651
|
children: [
|
|
599
|
-
/* @__PURE__ */
|
|
652
|
+
/* @__PURE__ */ C("span", {
|
|
600
653
|
className: "tabular-nums text-text-secondary",
|
|
601
|
-
children:
|
|
654
|
+
children: Me
|
|
602
655
|
}),
|
|
603
656
|
" ",
|
|
604
657
|
"verified"
|
|
@@ -606,22 +659,22 @@ function L() {
|
|
|
606
659
|
})]
|
|
607
660
|
})
|
|
608
661
|
}),
|
|
609
|
-
/* @__PURE__ */
|
|
610
|
-
icon: /* @__PURE__ */
|
|
611
|
-
value:
|
|
662
|
+
/* @__PURE__ */ C(r, {
|
|
663
|
+
icon: /* @__PURE__ */ C(me, { className: "h-5 w-5" }),
|
|
664
|
+
value: D.isError ? "—" : o(Ne),
|
|
612
665
|
label: "Inventory available",
|
|
613
|
-
footer: /* @__PURE__ */
|
|
666
|
+
footer: /* @__PURE__ */ w("div", {
|
|
614
667
|
className: "space-y-2",
|
|
615
|
-
children: [/* @__PURE__ */
|
|
616
|
-
value: B.length ?
|
|
668
|
+
children: [/* @__PURE__ */ C(p, {
|
|
669
|
+
value: B.length ? Ne / B.length * 100 : 0,
|
|
617
670
|
height: 4,
|
|
618
671
|
barClassName: "bg-action-primary-bg"
|
|
619
|
-
}), /* @__PURE__ */
|
|
672
|
+
}), /* @__PURE__ */ w("p", {
|
|
620
673
|
className: "text-xs text-text-tertiary",
|
|
621
674
|
children: [
|
|
622
|
-
/* @__PURE__ */
|
|
675
|
+
/* @__PURE__ */ C("span", {
|
|
623
676
|
className: "tabular-nums text-text-secondary",
|
|
624
|
-
children: q(B,
|
|
677
|
+
children: q(B, D.data?.pageInfo?.hasMore)
|
|
625
678
|
}),
|
|
626
679
|
" ",
|
|
627
680
|
"lots total"
|
|
@@ -629,44 +682,44 @@ function L() {
|
|
|
629
682
|
})]
|
|
630
683
|
})
|
|
631
684
|
}),
|
|
632
|
-
/* @__PURE__ */
|
|
633
|
-
icon: /* @__PURE__ */
|
|
634
|
-
value:
|
|
685
|
+
/* @__PURE__ */ C(r, {
|
|
686
|
+
icon: /* @__PURE__ */ C(Se, { className: "h-5 w-5" }),
|
|
687
|
+
value: O.isError ? "—" : o(K),
|
|
635
688
|
label: "Certs need attention",
|
|
636
689
|
accent: K > 0 ? "warning" : V.length > 0 ? "success" : void 0,
|
|
637
|
-
footer: /* @__PURE__ */
|
|
690
|
+
footer: /* @__PURE__ */ C("p", {
|
|
638
691
|
className: K > 0 ? "text-xs font-medium text-status-warning-text" : "text-xs text-text-tertiary",
|
|
639
|
-
children: V.length === 0 ? "No certifications tracked yet" : K > 0 ? `${
|
|
692
|
+
children: V.length === 0 ? "No certifications tracked yet" : K > 0 ? `${Fe} pending · ${Ie} expiring` : "All certifications current"
|
|
640
693
|
})
|
|
641
694
|
})
|
|
642
695
|
]
|
|
643
696
|
}),
|
|
644
|
-
/* @__PURE__ */
|
|
697
|
+
/* @__PURE__ */ w("div", {
|
|
645
698
|
className: "mt-6 grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
646
|
-
children: [/* @__PURE__ */
|
|
699
|
+
children: [/* @__PURE__ */ C(F, {
|
|
647
700
|
className: "lg:col-span-2",
|
|
648
701
|
title: "Production trend",
|
|
649
702
|
caption: "Metered output aggregated by month across your producing assets.",
|
|
650
|
-
icon: /* @__PURE__ */
|
|
703
|
+
icon: /* @__PURE__ */ C(pe, { className: "h-4 w-4" }),
|
|
651
704
|
link: {
|
|
652
705
|
label: "Production",
|
|
653
706
|
onClick: () => t("production")
|
|
654
707
|
},
|
|
655
|
-
isLoading:
|
|
656
|
-
isError:
|
|
657
|
-
onRetry: () =>
|
|
708
|
+
isLoading: j.isLoading,
|
|
709
|
+
isError: j.isError,
|
|
710
|
+
onRetry: () => j.refetch(),
|
|
658
711
|
isEmpty: J.length === 0,
|
|
659
712
|
emptyLabel: "No production logged yet — record output to build the trend.",
|
|
660
|
-
footer: J.length > 0 ? `${o(
|
|
661
|
-
children: /* @__PURE__ */
|
|
713
|
+
footer: J.length > 0 ? `${o(Pe, { maximumFractionDigits: 0 })} total volume across ${q(H, j.data?.pageInfo?.hasMore)} records` : void 0,
|
|
714
|
+
children: /* @__PURE__ */ C(te, {
|
|
662
715
|
series: J,
|
|
663
716
|
height: 220,
|
|
664
717
|
title: "Monthly production volume"
|
|
665
718
|
})
|
|
666
|
-
}), /* @__PURE__ */
|
|
719
|
+
}), /* @__PURE__ */ C(F, {
|
|
667
720
|
title: "Commodity mix",
|
|
668
721
|
caption: "Share of assets across your commodity streams.",
|
|
669
|
-
icon: /* @__PURE__ */
|
|
722
|
+
icon: /* @__PURE__ */ C(_e, { className: "h-4 w-4" }),
|
|
670
723
|
link: {
|
|
671
724
|
label: "Assets",
|
|
672
725
|
onClick: () => t("assets")
|
|
@@ -676,13 +729,13 @@ function L() {
|
|
|
676
729
|
onRetry: () => y.refetch(),
|
|
677
730
|
isEmpty: Z.length === 0,
|
|
678
731
|
emptyLabel: "No assets registered yet.",
|
|
679
|
-
footer: Z.length > 0 ? `${q(
|
|
680
|
-
children: /* @__PURE__ */
|
|
732
|
+
footer: Z.length > 0 ? `${q(I, y.data?.pageInfo?.hasMore)} assets · ${Z.length} ${Z.length === 1 ? "commodity" : "commodities"}` : void 0,
|
|
733
|
+
children: /* @__PURE__ */ C("div", {
|
|
681
734
|
className: "flex items-center justify-center py-2",
|
|
682
|
-
children: /* @__PURE__ */
|
|
735
|
+
children: /* @__PURE__ */ C(ne, {
|
|
683
736
|
segments: Z,
|
|
684
737
|
size: 168,
|
|
685
|
-
centerLabel: o(
|
|
738
|
+
centerLabel: o(I.length),
|
|
686
739
|
centerCaption: "assets",
|
|
687
740
|
valueFormatter: (e) => o(e),
|
|
688
741
|
title: "Assets by commodity"
|
|
@@ -690,57 +743,60 @@ function L() {
|
|
|
690
743
|
})
|
|
691
744
|
})]
|
|
692
745
|
}),
|
|
693
|
-
/* @__PURE__ */
|
|
746
|
+
/* @__PURE__ */ C(_, {
|
|
694
747
|
title: "Commodity portfolio",
|
|
695
|
-
description: "One model, every commodity — assets, capacity and output across your book.",
|
|
696
|
-
children: y.isLoading ? /* @__PURE__ */
|
|
748
|
+
description: "One model, every commodity — assets, capacity, booked proved reserves and output across your book.",
|
|
749
|
+
children: y.isLoading ? /* @__PURE__ */ C(g, { label: "Loading commodities…" }) : y.isError ? /* @__PURE__ */ C(h, {
|
|
697
750
|
message: "Couldn't load your commodity portfolio.",
|
|
698
751
|
onRetry: () => y.refetch()
|
|
699
|
-
}) :
|
|
752
|
+
}) : Be.length === 0 ? /* @__PURE__ */ C(v, {
|
|
700
753
|
illustration: "empty-data",
|
|
701
|
-
icon: /* @__PURE__ */
|
|
754
|
+
icon: /* @__PURE__ */ C(be, { className: "h-10 w-10" }),
|
|
702
755
|
title: "No commodities yet",
|
|
703
756
|
description: "Register your first resource asset to build out your commodity portfolio."
|
|
704
|
-
}) : /* @__PURE__ */ w("div", {
|
|
757
|
+
}) : /* @__PURE__ */ w(we, { children: [/* @__PURE__ */ C("div", {
|
|
705
758
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",
|
|
706
|
-
children:
|
|
759
|
+
children: Be.map((e) => /* @__PURE__ */ C(Ae, {
|
|
707
760
|
card: e,
|
|
708
761
|
onOpen: () => t("assets")
|
|
709
762
|
}, e.key))
|
|
710
|
-
})
|
|
763
|
+
}), /* @__PURE__ */ C("p", {
|
|
764
|
+
className: "mt-3 text-xs text-text-tertiary",
|
|
765
|
+
children: M.isError ? "Proved reserves could not be loaded, so the proved column is blank — it is not a zero position." : M.isLoading ? "Loading booked proved reserves…" : "Proved reserves use the latest estimate booked per asset, totalled only within a single unit of measure."
|
|
766
|
+
})] })
|
|
711
767
|
}),
|
|
712
|
-
/* @__PURE__ */
|
|
768
|
+
/* @__PURE__ */ w("div", {
|
|
713
769
|
className: "mt-6 grid grid-cols-1 gap-6 lg:grid-cols-2",
|
|
714
|
-
children: [/* @__PURE__ */
|
|
770
|
+
children: [/* @__PURE__ */ C(ke, {
|
|
715
771
|
title: "Assets by lifecycle",
|
|
716
772
|
description: "Where the portfolio sits from exploration to retirement.",
|
|
717
|
-
icon: /* @__PURE__ */
|
|
773
|
+
icon: /* @__PURE__ */ C(ye, { className: "h-4 w-4" }),
|
|
718
774
|
linkLabel: "Assets",
|
|
719
775
|
onLink: () => t("assets"),
|
|
720
776
|
isLoading: y.isLoading,
|
|
721
777
|
isError: y.isError,
|
|
722
778
|
onRetry: () => y.refetch(),
|
|
723
779
|
emptyLabel: "No assets to profile yet.",
|
|
724
|
-
bars:
|
|
725
|
-
footer:
|
|
726
|
-
}), /* @__PURE__ */
|
|
780
|
+
bars: Re,
|
|
781
|
+
footer: I.length > 0 ? `${W} of ${q(I, y.data?.pageInfo?.hasMore)} currently producing` : void 0
|
|
782
|
+
}), /* @__PURE__ */ C(F, {
|
|
727
783
|
title: "Emissions by scope",
|
|
728
784
|
caption: "GHG Protocol Scope 1 / 2 / 3 — tonnes CO₂e logged.",
|
|
729
|
-
icon: /* @__PURE__ */
|
|
785
|
+
icon: /* @__PURE__ */ C(ve, { className: "h-4 w-4" }),
|
|
730
786
|
link: {
|
|
731
787
|
label: "Emissions",
|
|
732
788
|
onClick: () => t("emissions")
|
|
733
789
|
},
|
|
734
|
-
isLoading:
|
|
735
|
-
isError:
|
|
736
|
-
onRetry: () =>
|
|
737
|
-
isEmpty:
|
|
790
|
+
isLoading: E.isLoading,
|
|
791
|
+
isError: E.isError,
|
|
792
|
+
onRetry: () => E.refetch(),
|
|
793
|
+
isEmpty: Le.length === 0,
|
|
738
794
|
emptyLabel: "No emission records logged yet.",
|
|
739
|
-
footer: z.length > 0 ? `${l(G)} across ${q(z,
|
|
740
|
-
children: /* @__PURE__ */
|
|
795
|
+
footer: z.length > 0 ? `${l(G)} across ${q(z, E.data?.pageInfo?.hasMore)} records` : void 0,
|
|
796
|
+
children: /* @__PURE__ */ C("div", {
|
|
741
797
|
className: "flex items-center justify-center py-2",
|
|
742
|
-
children: /* @__PURE__ */
|
|
743
|
-
segments:
|
|
798
|
+
children: /* @__PURE__ */ C(ne, {
|
|
799
|
+
segments: Le,
|
|
744
800
|
size: 168,
|
|
745
801
|
centerLabel: o(G, {
|
|
746
802
|
notation: "compact",
|
|
@@ -753,60 +809,60 @@ function L() {
|
|
|
753
809
|
})
|
|
754
810
|
})]
|
|
755
811
|
}),
|
|
756
|
-
/* @__PURE__ */
|
|
812
|
+
/* @__PURE__ */ C(_, {
|
|
757
813
|
title: "Recent offtake contracts",
|
|
758
814
|
description: "Latest buy/sell agreements across your commodity book.",
|
|
759
|
-
action: /* @__PURE__ */
|
|
815
|
+
action: /* @__PURE__ */ w("button", {
|
|
760
816
|
type: "button",
|
|
761
817
|
onClick: () => t("contracts"),
|
|
762
818
|
className: "inline-flex items-center gap-1 text-sm font-medium text-action-primary-bg hover:underline",
|
|
763
|
-
children: ["All contracts ", /* @__PURE__ */
|
|
819
|
+
children: ["All contracts ", /* @__PURE__ */ C(x, { className: "h-4 w-4" })]
|
|
764
820
|
}),
|
|
765
|
-
children:
|
|
821
|
+
children: S.isLoading ? /* @__PURE__ */ C(g, { label: "Loading contracts…" }) : S.isError ? /* @__PURE__ */ C(h, {
|
|
766
822
|
message: "Couldn't load contracts.",
|
|
767
|
-
onRetry: () =>
|
|
768
|
-
}) :
|
|
823
|
+
onRetry: () => S.refetch()
|
|
824
|
+
}) : He.length === 0 ? /* @__PURE__ */ C(v, {
|
|
769
825
|
illustration: "empty-data",
|
|
770
|
-
icon: /* @__PURE__ */
|
|
826
|
+
icon: /* @__PURE__ */ C(xe, { className: "h-10 w-10" }),
|
|
771
827
|
title: "No contracts yet",
|
|
772
828
|
description: "Draft your first offtake contract to start tracking commodity trade."
|
|
773
|
-
}) : /* @__PURE__ */
|
|
774
|
-
columns:
|
|
775
|
-
rows:
|
|
829
|
+
}) : /* @__PURE__ */ C(m, {
|
|
830
|
+
columns: We,
|
|
831
|
+
rows: He,
|
|
776
832
|
rowKey: (e) => e.id,
|
|
777
833
|
onRowClick: (e) => t(`contracts/${e.id}`),
|
|
778
834
|
rowLabel: (e) => `Open contract ${e.reference}`
|
|
779
835
|
})
|
|
780
836
|
}),
|
|
781
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ C(_, {
|
|
782
838
|
title: "Recent production",
|
|
783
839
|
description: "Latest metered output captured against your producing assets.",
|
|
784
|
-
action: /* @__PURE__ */
|
|
840
|
+
action: /* @__PURE__ */ w("button", {
|
|
785
841
|
type: "button",
|
|
786
842
|
onClick: () => t("production"),
|
|
787
843
|
className: "inline-flex items-center gap-1 text-sm font-medium text-action-primary-bg hover:underline",
|
|
788
|
-
children: ["All production ", /* @__PURE__ */
|
|
844
|
+
children: ["All production ", /* @__PURE__ */ C(x, { className: "h-4 w-4" })]
|
|
789
845
|
}),
|
|
790
|
-
children:
|
|
846
|
+
children: j.isLoading ? /* @__PURE__ */ C(g, { label: "Loading production…" }) : j.isError ? /* @__PURE__ */ C(h, {
|
|
791
847
|
message: "Couldn't load production records.",
|
|
792
|
-
onRetry: () =>
|
|
793
|
-
}) :
|
|
848
|
+
onRetry: () => j.refetch()
|
|
849
|
+
}) : Ue.length === 0 ? /* @__PURE__ */ C(v, {
|
|
794
850
|
illustration: "empty-data",
|
|
795
|
-
icon: /* @__PURE__ */
|
|
851
|
+
icon: /* @__PURE__ */ C(he, { className: "h-10 w-10" }),
|
|
796
852
|
title: "No production logged yet",
|
|
797
853
|
description: "Record production against an asset to build its output history."
|
|
798
|
-
}) : /* @__PURE__ */
|
|
799
|
-
columns:
|
|
800
|
-
rows:
|
|
854
|
+
}) : /* @__PURE__ */ C(m, {
|
|
855
|
+
columns: Ge,
|
|
856
|
+
rows: Ue,
|
|
801
857
|
rowKey: (e) => e.id,
|
|
802
858
|
onRowClick: (e) => t(`assets/${e.assetId}`),
|
|
803
|
-
rowLabel: (e) => `Open ${
|
|
859
|
+
rowLabel: (e) => `Open ${Ve.get(e.assetId) ?? "asset"}`
|
|
804
860
|
})
|
|
805
861
|
})
|
|
806
862
|
]
|
|
807
863
|
});
|
|
808
864
|
}
|
|
809
865
|
//#endregion
|
|
810
|
-
export {
|
|
866
|
+
export { I as DashboardPage };
|
|
811
867
|
|
|
812
868
|
//# sourceMappingURL=DashboardPage.js.map
|