@burdenoff/microfe-theglobalfuel 2026.716.1 → 2026.720.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +1 -1
  2. package/dist/theglobalfuel/TheGlobalFuelRoutes.js +34 -22
  3. package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -1
  4. package/dist/theglobalfuel/components/DataTable.js +1 -1
  5. package/dist/theglobalfuel/components/DataTable.js.map +1 -1
  6. package/dist/theglobalfuel/components/MiniBar.d.ts.map +1 -1
  7. package/dist/theglobalfuel/components/MiniBar.js +1 -1
  8. package/dist/theglobalfuel/components/MiniBar.js.map +1 -1
  9. package/dist/theglobalfuel/components/Tabs.js +1 -1
  10. package/dist/theglobalfuel/components/Tabs.js.map +1 -1
  11. package/dist/theglobalfuel/components/index.js +2 -0
  12. package/dist/theglobalfuel/components/viz/BarChart.js +83 -4
  13. package/dist/theglobalfuel/components/viz/BarChart.js.map +1 -0
  14. package/dist/theglobalfuel/components/viz/StatCard.js +60 -3
  15. package/dist/theglobalfuel/components/viz/StatCard.js.map +1 -0
  16. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +10 -1
  17. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +1 -1
  18. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +1 -1
  19. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -1
  20. package/dist/theglobalfuel/pages/alerts/AlertsPage.d.ts +16 -0
  21. package/dist/theglobalfuel/pages/alerts/AlertsPage.d.ts.map +1 -0
  22. package/dist/theglobalfuel/pages/alerts/AlertsPage.js +295 -0
  23. package/dist/theglobalfuel/pages/alerts/AlertsPage.js.map +1 -0
  24. package/dist/theglobalfuel/pages/analytics/AnalyticsPage.d.ts +13 -0
  25. package/dist/theglobalfuel/pages/analytics/AnalyticsPage.d.ts.map +1 -0
  26. package/dist/theglobalfuel/pages/analytics/AnalyticsPage.js +358 -0
  27. package/dist/theglobalfuel/pages/analytics/AnalyticsPage.js.map +1 -0
  28. package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts.map +1 -1
  29. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +386 -342
  30. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -1
  31. package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts.map +1 -1
  32. package/dist/theglobalfuel/pages/assets/AssetsPage.js +277 -199
  33. package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -1
  34. package/dist/theglobalfuel/pages/contracts/ContractsPage.js +1 -1
  35. package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -1
  36. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +6 -6
  37. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
  38. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js +1 -1
  39. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js.map +1 -1
  40. package/dist/theglobalfuel/pages/inventory/InventoryPage.js +1 -1
  41. package/dist/theglobalfuel/pages/inventory/InventoryPage.js.map +1 -1
  42. package/dist/theglobalfuel/pages/provenance/ProvenancePage.d.ts.map +1 -1
  43. package/dist/theglobalfuel/pages/provenance/ProvenancePage.js +372 -216
  44. package/dist/theglobalfuel/pages/provenance/ProvenancePage.js.map +1 -1
  45. package/dist/theglobalfuel/pages/reports/ReportsPage.d.ts +16 -0
  46. package/dist/theglobalfuel/pages/reports/ReportsPage.d.ts.map +1 -0
  47. package/dist/theglobalfuel/pages/reports/ReportsPage.js +578 -0
  48. package/dist/theglobalfuel/pages/reports/ReportsPage.js.map +1 -0
  49. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts.map +1 -1
  50. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js +43 -12
  51. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js.map +1 -1
  52. package/dist/theglobalfuel/types/index.d.ts +37 -8
  53. package/dist/theglobalfuel/types/index.d.ts.map +1 -1
  54. package/dist/theglobalfuel/utils/csv.d.ts +16 -0
  55. package/dist/theglobalfuel/utils/csv.d.ts.map +1 -0
  56. package/dist/theglobalfuel/utils/csv.js +14 -0
  57. package/dist/theglobalfuel/utils/csv.js.map +1 -0
  58. package/dist/theglobalfuel/utils/index.d.ts +2 -0
  59. package/dist/theglobalfuel/utils/index.d.ts.map +1 -1
  60. package/dist/theglobalfuel/utils/pageContext.d.ts.map +1 -1
  61. package/dist/theglobalfuel/utils/pageContext.js +32 -0
  62. package/dist/theglobalfuel/utils/pageContext.js.map +1 -1
  63. package/dist/theglobalfuel/utils/provenance.d.ts +135 -0
  64. package/dist/theglobalfuel/utils/provenance.d.ts.map +1 -0
  65. package/dist/theglobalfuel/utils/provenance.js +57 -0
  66. package/dist/theglobalfuel/utils/provenance.js.map +1 -0
  67. package/package.json +1 -1
@@ -3,108 +3,118 @@ import { cn as t } from "../../utils/cn.js";
3
3
  import { PageLayout as n } from "../../components/PageLayout.js";
4
4
  import { formatCoords as r, formatDate as i, formatEnumLabel as a, formatNumber as o, formatTonnesCo2e as ee, formatVolume as s } from "../../utils/formatters.js";
5
5
  import { StatusBadge as c } from "../../components/StatusBadge.js";
6
- import { ErrorView as l, LoadingView as te } from "../../components/StateViews.js";
7
- import { EmptyState as ne } from "../../components/EmptyState.js";
8
- import { Timeline as re } from "../../components/viz/Timeline.js";
9
- import { StepProgress as ie } from "../../components/viz/StepProgress.js";
6
+ import { ErrorView as te, LoadingView as ne } from "../../components/StateViews.js";
7
+ import { EmptyState as re } from "../../components/EmptyState.js";
8
+ import { Timeline as ie } from "../../components/viz/Timeline.js";
9
+ import { StepProgress as ae } from "../../components/viz/StepProgress.js";
10
10
  import "../../context/index.js";
11
- import { useTheAsset as ae, useTheAssets as oe, useTheComplianceCerts as se, useTheContract as ce, useTheContracts as le, useTheEmissionRecords as ue, useTheInventoryLots as de } from "../../hooks/useTheGlobalFuelApi.js";
12
- import { useThePageView as fe } from "../../hooks/useThePageView.js";
13
- import { useTheTranslation as pe } from "../../hooks/useTheTranslation.js";
11
+ import { useTheAsset as oe, useTheAssets as se, useTheComplianceCerts as ce, useTheContract as le, useTheContracts as ue, useTheEmissionRecords as de, useTheInventoryLots as fe } from "../../hooks/useTheGlobalFuelApi.js";
12
+ import { useNotify as pe } from "../../hooks/useNotify.js";
13
+ import { useThePageView as me } from "../../hooks/useThePageView.js";
14
+ import { useTheTranslation as he } from "../../hooks/useTheTranslation.js";
14
15
  import "../../hooks/index.js";
15
- import { FileLink as u } from "../../components/FileLink.js";
16
- import { WorldMap as me } from "../../components/WorldMap.js";
16
+ import { buildProvenanceDocument as ge, downloadTextFile as _e, shortDigest as ve, slugify as ye } from "../../utils/provenance.js";
17
+ import { FileLink as l } from "../../components/FileLink.js";
18
+ import { WorldMap as be } from "../../components/WorldMap.js";
17
19
  import "../../components/index.js";
18
- import { useMemo as d, useState as he } from "react";
19
- import { Boxes as f, CheckCircle2 as p, Factory as ge, Fuel as _e, Gauge as m, Layers as ve, Link2 as ye, MapPin as h, Route as be, Shield as xe, ShieldCheck as g, Ship as _ } from "lucide-react";
20
- import { Fragment as Se, jsx as v, jsxs as y } from "react/jsx-runtime";
21
- import { GlassCard as b, Select as Ce, SelectContent as we, SelectItem as Te, SelectTrigger as Ee, SelectValue as De } from "@burdenoff/fe-libs/ui";
20
+ import { useMemo as u, useState as xe } from "react";
21
+ import { Boxes as d, CheckCircle2 as Se, Download as Ce, Factory as we, Fingerprint as Te, Fuel as Ee, Gauge as f, Layers as De, Link2 as Oe, MapPin as p, Network as ke, Route as Ae, Share2 as je, Shield as Me, ShieldCheck as m, Ship as h } from "lucide-react";
22
+ import { Fragment as Ne, jsx as g, jsxs as _ } from "react/jsx-runtime";
23
+ import { Button as Pe, GlassCard as v, Select as Fe, SelectContent as Ie, SelectItem as Le, SelectTrigger as Re, SelectValue as ze } from "@burdenoff/fe-libs/ui";
22
24
  //#region src/theglobalfuel/pages/provenance/ProvenancePage.tsx
23
- var x = { limit: 200 };
24
- function S(e) {
25
+ var y = { limit: 200 }, Be = 6;
26
+ function Ve() {
27
+ return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("assetId") ?? "";
28
+ }
29
+ function He(e) {
30
+ if (typeof window > "u") return "";
31
+ let t = new URL(window.location.href);
32
+ return t.searchParams.set("assetId", e), t.hash = "", t.toString();
33
+ }
34
+ function b(e) {
25
35
  return (t, n) => {
26
36
  let r = new Date(e(t) ?? t.createdAt).getTime();
27
37
  return new Date(e(n) ?? n.createdAt).getTime() - r;
28
38
  };
29
39
  }
30
- var Oe = {
40
+ var Ue = {
31
41
  done: "bg-status-success-bg-subtle text-status-success-text",
32
- active: "bg-[var(--color-accent-soft)] text-accent",
42
+ active: "bg-[var(--color-accent-soft)] text-action-primary-bg",
33
43
  todo: "bg-bg-sunken text-text-muted",
34
44
  locked: "bg-bg-sunken text-text-muted"
35
- }, C = {
45
+ }, x = {
36
46
  done: "bg-status-success-bg-subtle text-status-success-text",
37
- active: "bg-[var(--color-accent-soft)] text-accent",
47
+ active: "bg-[var(--color-accent-soft)] text-action-primary-bg",
38
48
  todo: "bg-bg-sunken text-text-tertiary",
39
49
  locked: "bg-bg-sunken text-text-tertiary"
40
- }, w = {
50
+ }, S = {
41
51
  done: "bg-status-success-text",
42
52
  active: "bg-[var(--color-accent-primary)] motion-safe:animate-vc-glow-pulse",
43
53
  todo: "bg-border-strong",
44
54
  locked: "bg-border-strong"
45
55
  };
46
- function ke({ node: e }) {
47
- return /* @__PURE__ */ y(b, {
56
+ function We({ node: e }) {
57
+ return /* @__PURE__ */ _(v, {
48
58
  treatment: "glass",
49
59
  className: t("relative flex h-full flex-col gap-3 p-5 transition-shadow", e.state === "done" && "shadow-[inset_0_2px_0_0_var(--color-status-success-text)]", e.state === "active" && "shadow-[inset_0_2px_0_0_var(--color-accent-primary)]"),
50
60
  children: [
51
- /* @__PURE__ */ y("div", {
61
+ /* @__PURE__ */ _("div", {
52
62
  className: "flex items-center justify-between",
53
- children: [/* @__PURE__ */ v("span", {
54
- className: t("flex size-7 items-center justify-center rounded-full text-xs font-semibold tabular-nums", Oe[e.state]),
63
+ children: [/* @__PURE__ */ g("span", {
64
+ className: t("flex size-7 items-center justify-center rounded-full text-xs font-semibold tabular-nums", Ue[e.state]),
55
65
  children: e.step
56
- }), /* @__PURE__ */ v("span", {
66
+ }), /* @__PURE__ */ g("span", {
57
67
  "aria-hidden": "true",
58
- className: t("size-2 rounded-full", w[e.state])
68
+ className: t("size-2 rounded-full", S[e.state])
59
69
  })]
60
70
  }),
61
- /* @__PURE__ */ v("span", {
62
- className: t("flex size-11 items-center justify-center rounded-xl [&_svg]:size-6", C[e.state]),
71
+ /* @__PURE__ */ g("span", {
72
+ className: t("flex size-11 items-center justify-center rounded-xl [&_svg]:size-6", x[e.state]),
63
73
  children: e.icon
64
74
  }),
65
- /* @__PURE__ */ y("div", {
75
+ /* @__PURE__ */ _("div", {
66
76
  className: "min-w-0",
67
77
  children: [
68
- /* @__PURE__ */ v("p", {
78
+ /* @__PURE__ */ g("p", {
69
79
  className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
70
80
  children: e.label
71
81
  }),
72
- /* @__PURE__ */ v("p", {
82
+ /* @__PURE__ */ g("p", {
73
83
  className: t("mt-1 truncate text-base font-semibold", e.present ? "text-text-primary" : "text-text-muted"),
74
84
  title: typeof e.primary == "string" ? e.primary : void 0,
75
85
  children: e.present ? e.primary : "Pending"
76
86
  }),
77
- e.present && e.secondary && /* @__PURE__ */ v("p", {
87
+ e.present && e.secondary && /* @__PURE__ */ g("p", {
78
88
  className: "mt-0.5 line-clamp-2 text-xs text-text-secondary",
79
89
  children: e.secondary
80
90
  })
81
91
  ]
82
92
  }),
83
- (e.badge || e.present && e.fileId) && /* @__PURE__ */ y("div", {
93
+ (e.badge || e.present && e.fileId) && /* @__PURE__ */ _("div", {
84
94
  className: "mt-auto flex flex-wrap items-center gap-2 pt-1",
85
- children: [e.badge, e.present && e.fileId && /* @__PURE__ */ v(u, { fileId: e.fileId })]
95
+ children: [e.badge, e.present && e.fileId && /* @__PURE__ */ g(l, { fileId: e.fileId })]
86
96
  })
87
97
  ]
88
98
  });
89
99
  }
90
- function T({ icon: e, label: t, value: n, caption: r }) {
91
- return /* @__PURE__ */ y("div", {
100
+ function C({ icon: e, label: t, value: n, caption: r }) {
101
+ return /* @__PURE__ */ _("div", {
92
102
  className: "flex items-start gap-3",
93
- children: [/* @__PURE__ */ v("span", {
94
- className: "mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent [&_svg]:size-4",
103
+ children: [/* @__PURE__ */ g("span", {
104
+ className: "mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-action-primary-bg [&_svg]:size-4",
95
105
  children: e
96
- }), /* @__PURE__ */ y("div", {
106
+ }), /* @__PURE__ */ _("div", {
97
107
  className: "min-w-0",
98
108
  children: [
99
- /* @__PURE__ */ v("p", {
109
+ /* @__PURE__ */ g("p", {
100
110
  className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
101
111
  children: t
102
112
  }),
103
- /* @__PURE__ */ v("p", {
113
+ /* @__PURE__ */ g("p", {
104
114
  className: "mt-0.5 truncate text-sm font-semibold text-text-primary",
105
115
  children: n
106
116
  }),
107
- r && /* @__PURE__ */ v("p", {
117
+ r && /* @__PURE__ */ g("p", {
108
118
  className: "truncate text-xs text-text-tertiary",
109
119
  children: r
110
120
  })
@@ -112,25 +122,25 @@ function T({ icon: e, label: t, value: n, caption: r }) {
112
122
  })]
113
123
  });
114
124
  }
115
- function E() {
116
- fe("provenance");
117
- let u = pe(), { navigateTo: Oe } = e(), C = oe({ pagination: x }), w = d(() => C.data?.items ?? [], [C.data]), [E, Ae] = he(""), je = d(() => w.find((e) => e.status === "PRODUCING")?.id ?? w[0]?.id ?? "", [w]), D = E || je, O = ae(D || void 0), k = de({ pagination: x }), A = ue({
118
- assetId: D || void 0,
119
- pagination: x
120
- }), j = se(D || void 0, void 0, void 0, x), M = le({
121
- commodity: O.data?.commodity,
122
- pagination: x
123
- }), N = d(() => {
124
- let e = [...M.data?.items ?? []].sort(S((e) => e.createdAt));
125
+ function w() {
126
+ me("provenance");
127
+ let l = he(), { navigateTo: Ue } = e(), x = se({ pagination: y }), S = u(() => x.data?.items ?? [], [x.data]), w = pe(), [Ge, Ke] = xe(Ve), qe = u(() => S.find((e) => e.status === "PRODUCING")?.id ?? S[0]?.id ?? "", [S]), T = Ge || qe, E = oe(T || void 0), Je = fe({ pagination: y }), D = de({
128
+ assetId: T || void 0,
129
+ pagination: y
130
+ }), Ye = ce(T || void 0, void 0, void 0, y), O = ue({
131
+ commodity: E.data?.commodity,
132
+ pagination: y
133
+ }), k = u(() => {
134
+ let e = [...O.data?.items ?? []].sort(b((e) => e.createdAt));
125
135
  return (e.find((e) => e.deliveredVolume > 0 && e.side === "SELL") ?? e.find((e) => e.deliveredVolume > 0) ?? e.find((e) => e.side === "SELL") ?? e[0])?.id;
126
- }, [M.data]), P = ce(N), F = d(() => [...O.data?.productionRecords ?? []].sort(S((e) => e.periodEnd)), [O.data]), I = F[0], L = d(() => (k.data?.items ?? []).filter((e) => e.assetId === D).sort(S((e) => e.producedAt)), [k.data, D]), R = L[0], z = d(() => P.data?.shipments ?? [], [P.data]), B = d(() => [...z].filter((e) => e.status === "DELIVERED").sort(S((e) => e.deliveredAt))[0], [z]), V = d(() => B ?? [...z].sort(S((e) => e.departedAt ?? e.scheduledAt))[0], [B, z]), H = d(() => M.data?.items.find((e) => e.id === N), [M.data, N]), U = d(() => j.data?.items ?? [], [j.data]), W = d(() => U.find((e) => e.category === "CHAIN_OF_CUSTODY") ?? U.find((e) => e.status === "APPROVED") ?? U[0], [U]), G = W?.status === "APPROVED", K = d(() => A.data?.items ?? [], [A.data]), Me = K.reduce((e, t) => e + (t.co2eTonnes ?? 0), 0), Ne = K.filter((e) => e.verified).length, q = O.data, J = [
127
- !!q,
128
- F.length > 0,
129
- L.length > 0,
130
- !!V,
131
- !!B,
132
- G
133
- ], Pe = J.filter(Boolean).length, Fe = J.findIndex((e) => !e), Ie = Fe === -1 ? J.length : Fe, Y = G && !!B, X = (e) => J[e] ? "done" : e === Ie ? "active" : "todo", Le = [
136
+ }, [O.data]), Xe = le(k), A = u(() => [...E.data?.productionRecords ?? []].sort(b((e) => e.periodEnd)), [E.data]), j = A[0], M = u(() => (Je.data?.items ?? []).filter((e) => e.assetId === T).sort(b((e) => e.producedAt)), [Je.data, T]), N = M[0], P = u(() => Xe.data?.shipments ?? [], [Xe.data]), F = u(() => [...P].filter((e) => e.status === "DELIVERED").sort(b((e) => e.deliveredAt))[0], [P]), I = u(() => F ?? [...P].sort(b((e) => e.departedAt ?? e.scheduledAt))[0], [F, P]), L = u(() => O.data?.items.find((e) => e.id === k), [O.data, k]), R = u(() => Ye.data?.items ?? [], [Ye.data]), z = u(() => R.find((e) => e.category === "CHAIN_OF_CUSTODY") ?? R.find((e) => e.status === "APPROVED") ?? R[0], [R]), B = z?.status === "APPROVED", V = u(() => D.data?.items ?? [], [D.data]), H = V.reduce((e, t) => e + (t.co2eTonnes ?? 0), 0), U = V.filter((e) => e.verified).length, W = E.data, G = [
137
+ !!W,
138
+ A.length > 0,
139
+ M.length > 0,
140
+ !!I,
141
+ !!F,
142
+ B
143
+ ], K = G.filter(Boolean).length, Ze = G.findIndex((e) => !e), Qe = Ze === -1 ? G.length : Ze, q = B && !!F, J = (e) => G[e] ? "done" : e === Qe ? "active" : "todo", $e = [
134
144
  {
135
145
  label: "Asset",
136
146
  description: "Origin"
@@ -155,69 +165,69 @@ function E() {
155
165
  label: "Certificate",
156
166
  description: "Verified"
157
167
  }
158
- ], Z = V && (V.origin || V.destination) ? [V.origin, V.destination].filter(Boolean).join(" → ") : void 0, Re = q ? [
168
+ ], Y = I && (I.origin || I.destination) ? [I.origin, I.destination].filter(Boolean).join(" → ") : void 0, et = W ? [
159
169
  {
160
170
  step: 1,
161
- icon: /* @__PURE__ */ v(h, {}),
171
+ icon: /* @__PURE__ */ g(p, {}),
162
172
  label: "Asset",
163
- primary: q.name,
164
- secondary: q.location ?? r(q.latitude, q.longitude),
165
- badge: /* @__PURE__ */ v(c, { status: q.status }),
166
- state: X(0),
173
+ primary: W.name,
174
+ secondary: W.location ?? r(W.latitude, W.longitude),
175
+ badge: /* @__PURE__ */ g(c, { status: W.status }),
176
+ state: J(0),
167
177
  present: !0
168
178
  },
169
179
  {
170
180
  step: 2,
171
- icon: /* @__PURE__ */ v(m, {}),
181
+ icon: /* @__PURE__ */ g(f, {}),
172
182
  label: "Production",
173
- primary: I ? s(I.volume, I.unit) : "Not yet recorded",
174
- secondary: I ? `${i(I.periodStart)} – ${i(I.periodEnd)}` : void 0,
175
- state: X(1),
176
- present: !!I
183
+ primary: j ? s(j.volume, j.unit) : "Not yet recorded",
184
+ secondary: j ? `${i(j.periodStart)} – ${i(j.periodEnd)}` : void 0,
185
+ state: J(1),
186
+ present: !!j
177
187
  },
178
188
  {
179
189
  step: 3,
180
- icon: /* @__PURE__ */ v(f, {}),
190
+ icon: /* @__PURE__ */ g(d, {}),
181
191
  label: "Inventory lot",
182
- primary: R ? R.lotCode : "No lot yet",
183
- secondary: R ? s(R.quantity, R.unit) : void 0,
184
- badge: R ? /* @__PURE__ */ v(c, { status: R.status }) : void 0,
185
- state: X(2),
186
- present: !!R
192
+ primary: N ? N.lotCode : "No lot yet",
193
+ secondary: N ? s(N.quantity, N.unit) : void 0,
194
+ badge: N ? /* @__PURE__ */ g(c, { status: N.status }) : void 0,
195
+ state: J(2),
196
+ present: !!N
187
197
  },
188
198
  {
189
199
  step: 4,
190
- icon: /* @__PURE__ */ v(_, {}),
200
+ icon: /* @__PURE__ */ g(h, {}),
191
201
  label: "Shipment",
192
- primary: V ? V.reference : "Not shipped",
193
- secondary: V ? [a(V.mode), Z].filter(Boolean).join(" · ") : void 0,
194
- badge: V ? /* @__PURE__ */ v(c, { status: V.status }) : void 0,
195
- fileId: V?.document?.id,
196
- state: X(3),
197
- present: !!V
202
+ primary: I ? I.reference : "Not shipped",
203
+ secondary: I ? [a(I.mode), Y].filter(Boolean).join(" · ") : void 0,
204
+ badge: I ? /* @__PURE__ */ g(c, { status: I.status }) : void 0,
205
+ fileId: I?.document?.id,
206
+ state: J(3),
207
+ present: !!I
198
208
  },
199
209
  {
200
210
  step: 5,
201
- icon: /* @__PURE__ */ v(p, {}),
211
+ icon: /* @__PURE__ */ g(Se, {}),
202
212
  label: "Delivered",
203
- primary: B ? s(B.volume, B.unit) : "Awaiting delivery",
204
- secondary: B && [B.deliveredAt ? i(B.deliveredAt) : null, H ? `Contract ${H.reference}` : null].filter(Boolean).join(" · ") || void 0,
205
- state: X(4),
206
- present: !!B
213
+ primary: F ? s(F.volume, F.unit) : "Awaiting delivery",
214
+ secondary: F && [F.deliveredAt ? i(F.deliveredAt) : null, L ? `Contract ${L.reference}` : null].filter(Boolean).join(" · ") || void 0,
215
+ state: J(4),
216
+ present: !!F
207
217
  },
208
218
  {
209
219
  step: 6,
210
- icon: /* @__PURE__ */ v(g, {}),
220
+ icon: /* @__PURE__ */ g(m, {}),
211
221
  label: "Certificate",
212
- primary: W ? W.certNumber ?? W.title : "No certificate",
213
- secondary: W ? a(W.category) : void 0,
214
- badge: W ? /* @__PURE__ */ v(c, { status: W.status }) : void 0,
215
- fileId: W?.evidence?.id,
216
- state: X(5),
217
- present: !!W
222
+ primary: z ? z.certNumber ?? z.title : "No certificate",
223
+ secondary: z ? a(z.category) : void 0,
224
+ badge: z ? /* @__PURE__ */ g(c, { status: z.status }) : void 0,
225
+ fileId: z?.evidence?.id,
226
+ state: J(5),
227
+ present: !!z
218
228
  }
219
- ] : [], ze = d(() => {
220
- if (!q) return [];
229
+ ] : [], tt = u(() => {
230
+ if (!W) return [];
221
231
  let e = [], t = (t, n) => {
222
232
  if (!t) return;
223
233
  let r = new Date(t).getTime();
@@ -226,106 +236,217 @@ function E() {
226
236
  item: n
227
237
  });
228
238
  };
229
- return t(q.commissionedAt ?? q.createdAt, {
239
+ return t(W.commissionedAt ?? W.createdAt, {
230
240
  title: "Asset registered",
231
- meta: q.name,
241
+ meta: W.name,
232
242
  tone: "accent",
233
- icon: /* @__PURE__ */ v(h, { className: "h-3 w-3" })
234
- }), I && t(I.periodEnd ?? I.createdAt, {
243
+ icon: /* @__PURE__ */ g(p, { className: "h-3 w-3" })
244
+ }), j && t(j.periodEnd ?? j.createdAt, {
235
245
  title: "Production recorded",
236
- meta: s(I.volume, I.unit),
246
+ meta: s(j.volume, j.unit),
237
247
  tone: "info",
238
- icon: /* @__PURE__ */ v(m, { className: "h-3 w-3" })
239
- }), R && t(R.producedAt ?? R.createdAt, {
248
+ icon: /* @__PURE__ */ g(f, { className: "h-3 w-3" })
249
+ }), N && t(N.producedAt ?? N.createdAt, {
240
250
  title: "Inventory lot created",
241
- meta: `${R.lotCode} · ${s(R.quantity, R.unit)}`,
251
+ meta: `${N.lotCode} · ${s(N.quantity, N.unit)}`,
242
252
  tone: "info",
243
- icon: /* @__PURE__ */ v(f, { className: "h-3 w-3" })
244
- }), V && t(V.departedAt ?? V.scheduledAt ?? V.createdAt, {
245
- title: V.departedAt ? "Shipment departed" : "Shipment scheduled",
246
- meta: [V.reference, Z].filter(Boolean).join(" · "),
253
+ icon: /* @__PURE__ */ g(d, { className: "h-3 w-3" })
254
+ }), I && t(I.departedAt ?? I.scheduledAt ?? I.createdAt, {
255
+ title: I.departedAt ? "Shipment departed" : "Shipment scheduled",
256
+ meta: [I.reference, Y].filter(Boolean).join(" · "),
247
257
  tone: "accent",
248
- icon: /* @__PURE__ */ v(_, { className: "h-3 w-3" })
249
- }), B?.deliveredAt && t(B.deliveredAt, {
258
+ icon: /* @__PURE__ */ g(h, { className: "h-3 w-3" })
259
+ }), F?.deliveredAt && t(F.deliveredAt, {
250
260
  title: "Delivered",
251
- meta: s(B.volume, B.unit),
261
+ meta: s(F.volume, F.unit),
252
262
  tone: "success",
253
- icon: /* @__PURE__ */ v(p, { className: "h-3 w-3" })
254
- }), W && t(W.issuedAt ?? W.createdAt, {
255
- title: G ? "Certificate approved" : "Certificate registered",
256
- meta: W.certNumber ?? W.title,
257
- tone: G ? "success" : "warning",
258
- icon: /* @__PURE__ */ v(g, { className: "h-3 w-3" })
263
+ icon: /* @__PURE__ */ g(Se, { className: "h-3 w-3" })
264
+ }), z && t(z.issuedAt ?? z.createdAt, {
265
+ title: B ? "Certificate approved" : "Certificate registered",
266
+ meta: z.certNumber ?? z.title,
267
+ tone: B ? "success" : "warning",
268
+ icon: /* @__PURE__ */ g(m, { className: "h-3 w-3" })
259
269
  }), e.sort((e, t) => new Date(e.date).getTime() - new Date(t.date).getTime()).map(({ date: e, item: t }) => ({
260
270
  ...t,
261
271
  time: i(e)
262
272
  }));
263
273
  }, [
264
- q,
274
+ W,
275
+ j,
276
+ N,
265
277
  I,
266
- R,
267
- V,
278
+ F,
279
+ z,
268
280
  B,
281
+ Y
282
+ ]), X = u(() => W ? {
283
+ asset: {
284
+ id: W.id,
285
+ name: W.name,
286
+ code: W.code ?? null,
287
+ commodity: W.commodity,
288
+ kind: W.kind,
289
+ status: W.status,
290
+ location: W.location ?? null,
291
+ latitude: W.latitude ?? null,
292
+ longitude: W.longitude ?? null,
293
+ commissionedAt: W.commissionedAt ?? null,
294
+ createdAt: W.createdAt
295
+ },
296
+ production: j ? {
297
+ id: j.id,
298
+ periodStart: j.periodStart,
299
+ periodEnd: j.periodEnd,
300
+ volume: j.volume,
301
+ unit: j.unit,
302
+ source: j.source ?? null,
303
+ createdAt: j.createdAt
304
+ } : null,
305
+ lot: N ? {
306
+ id: N.id,
307
+ lotCode: N.lotCode,
308
+ quantity: N.quantity,
309
+ unit: N.unit,
310
+ status: N.status,
311
+ location: N.location ?? null,
312
+ producedAt: N.producedAt ?? null,
313
+ createdAt: N.createdAt
314
+ } : null,
315
+ shipment: I ? {
316
+ id: I.id,
317
+ reference: I.reference,
318
+ status: I.status,
319
+ mode: I.mode,
320
+ volume: I.volume,
321
+ unit: I.unit,
322
+ carrier: I.carrier ?? null,
323
+ trackingId: I.trackingId ?? null,
324
+ origin: I.origin ?? null,
325
+ destination: I.destination ?? null,
326
+ scheduledAt: I.scheduledAt ?? null,
327
+ departedAt: I.departedAt ?? null,
328
+ deliveredAt: I.deliveredAt ?? null,
329
+ createdAt: I.createdAt
330
+ } : null,
331
+ contract: L ? {
332
+ id: L.id,
333
+ reference: L.reference,
334
+ counterparty: L.counterparty,
335
+ side: L.side,
336
+ status: L.status
337
+ } : null,
338
+ certificate: z ? {
339
+ id: z.id,
340
+ title: z.title,
341
+ category: z.category,
342
+ status: z.status,
343
+ certNumber: z.certNumber ?? null,
344
+ authority: z.authority ?? null,
345
+ issuedAt: z.issuedAt ?? null,
346
+ expiresAt: z.expiresAt ?? null,
347
+ createdAt: z.createdAt
348
+ } : null,
349
+ emissions: {
350
+ totalCo2eTonnes: H,
351
+ recordCount: V.length,
352
+ verifiedCount: U
353
+ }
354
+ } : null, [
355
+ W,
356
+ j,
357
+ N,
358
+ I,
359
+ L,
360
+ z,
361
+ H,
362
+ V.length,
363
+ U
364
+ ]), Z = u(() => X && W ? ge(W.workspaceId, X, K, Be, q) : null, [
365
+ X,
269
366
  W,
270
- G,
271
- Z
272
- ]), Be = q && typeof q.latitude == "number" && typeof q.longitude == "number" ? {
273
- lat: q.latitude,
274
- lng: q.longitude,
275
- label: q.name,
367
+ K,
368
+ q
369
+ ]), nt = () => {
370
+ !Z || !W || (_e(`${ye(W.name)}-chain-of-custody.json`, "application/json", JSON.stringify(Z, null, 2)) ? w.success("Chain of custody exported") : w.error("This browser can't download the export."));
371
+ }, rt = () => {
372
+ if (!T) return;
373
+ let e = He(T), t = typeof navigator < "u" ? navigator.clipboard : void 0;
374
+ if (!t) {
375
+ w.error("This browser doesn't allow copying to the clipboard.");
376
+ return;
377
+ }
378
+ t.writeText(e).then(() => w.success("Provenance link copied"), () => w.error("Couldn't copy the provenance link."));
379
+ }, it = W && typeof W.latitude == "number" && typeof W.longitude == "number" ? {
380
+ lat: W.latitude,
381
+ lng: W.longitude,
382
+ label: W.name,
276
383
  primary: !0
277
- } : null, Q = u("theglobalfuel.pages.provenance.description", "Pit to port to certificate — end-to-end traceability from origin to verified certificate."), $ = u("theglobalfuel.pages.provenance.title", "Provenance");
278
- return C.isLoading && w.length === 0 ? /* @__PURE__ */ v(n, {
384
+ } : null, Q = l("theglobalfuel.pages.provenance.description", "Pit to port to certificate — end-to-end traceability from origin to verified certificate."), $ = l("theglobalfuel.pages.provenance.title", "Provenance");
385
+ return x.isLoading && S.length === 0 ? /* @__PURE__ */ g(n, {
279
386
  title: $,
280
387
  description: Q,
281
388
  dataTour: "theglobalfuel-provenance-page",
282
- children: /* @__PURE__ */ v(te, { label: "Loading assets…" })
283
- }) : C.isError ? /* @__PURE__ */ v(n, {
389
+ children: /* @__PURE__ */ g(ne, { label: "Loading assets…" })
390
+ }) : x.isError ? /* @__PURE__ */ g(n, {
284
391
  title: $,
285
392
  description: Q,
286
393
  dataTour: "theglobalfuel-provenance-page",
287
- children: /* @__PURE__ */ v(l, {
394
+ children: /* @__PURE__ */ g(te, {
288
395
  message: "Couldn't load assets to trace.",
289
- onRetry: () => C.refetch()
396
+ onRetry: () => x.refetch()
290
397
  })
291
- }) : w.length === 0 ? /* @__PURE__ */ v(n, {
398
+ }) : S.length === 0 ? /* @__PURE__ */ g(n, {
292
399
  title: $,
293
400
  description: Q,
294
401
  dataTour: "theglobalfuel-provenance-page",
295
- children: /* @__PURE__ */ v(ne, {
402
+ children: /* @__PURE__ */ g(re, {
296
403
  illustration: "empty-data",
297
- icon: /* @__PURE__ */ v(ye, { className: "h-10 w-10" }),
404
+ icon: /* @__PURE__ */ g(Oe, { className: "h-10 w-10" }),
298
405
  title: "No assets to trace",
299
406
  description: "Register a resource asset to build its end-to-end chain of custody.",
300
- action: /* @__PURE__ */ v("button", {
407
+ action: /* @__PURE__ */ g("button", {
301
408
  type: "button",
302
- onClick: () => Oe("assets"),
409
+ onClick: () => Ue("assets"),
303
410
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
304
411
  children: "Go to assets"
305
412
  })
306
413
  })
307
- }) : /* @__PURE__ */ y(n, {
414
+ }) : /* @__PURE__ */ _(n, {
308
415
  title: $,
309
416
  description: Q,
310
417
  dataTour: "theglobalfuel-provenance-page",
311
- children: [/* @__PURE__ */ y(b, {
418
+ actions: /* @__PURE__ */ _(Ne, { children: [/* @__PURE__ */ _(Pe, {
419
+ variant: "outline",
420
+ size: "sm",
421
+ onClick: rt,
422
+ disabled: !T,
423
+ "data-tour": "theglobalfuel-provenance-share",
424
+ children: [/* @__PURE__ */ g(je, { className: "mr-2 h-4 w-4" }), "Share"]
425
+ }), /* @__PURE__ */ _(Pe, {
426
+ size: "sm",
427
+ onClick: nt,
428
+ disabled: !Z,
429
+ "data-tour": "theglobalfuel-provenance-export",
430
+ children: [/* @__PURE__ */ g(Ce, { className: "mr-2 h-4 w-4" }), "Export"]
431
+ })] }),
432
+ children: [/* @__PURE__ */ _(v, {
312
433
  treatment: "glass",
313
434
  className: "flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between",
314
- children: [/* @__PURE__ */ y("div", {
435
+ children: [/* @__PURE__ */ _("div", {
315
436
  className: "flex min-w-0 flex-1 flex-col gap-1.5",
316
- children: [/* @__PURE__ */ v("label", {
437
+ children: [/* @__PURE__ */ g("label", {
317
438
  htmlFor: "provenance-asset",
318
439
  className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
319
440
  children: "Trace asset"
320
- }), /* @__PURE__ */ y(Ce, {
321
- value: D,
322
- onValueChange: Ae,
323
- children: [/* @__PURE__ */ v(Ee, {
441
+ }), /* @__PURE__ */ _(Fe, {
442
+ value: T,
443
+ onValueChange: Ke,
444
+ children: [/* @__PURE__ */ g(Re, {
324
445
  id: "provenance-asset",
325
446
  className: "h-10 w-full sm:w-96",
326
447
  "aria-label": "Select an asset to trace",
327
- children: /* @__PURE__ */ v(De, { placeholder: "Select an asset to trace" })
328
- }), /* @__PURE__ */ v(we, { children: w.map((e) => /* @__PURE__ */ y(Te, {
448
+ children: /* @__PURE__ */ g(ze, { placeholder: "Select an asset to trace" })
449
+ }), /* @__PURE__ */ g(Ie, { children: S.map((e) => /* @__PURE__ */ _(Le, {
329
450
  value: e.id,
330
451
  children: [
331
452
  e.name,
@@ -334,132 +455,167 @@ function E() {
334
455
  ]
335
456
  }, e.id)) })]
336
457
  })]
337
- }), /* @__PURE__ */ y("div", {
338
- className: t("flex items-center gap-2 self-start rounded-full px-3.5 py-1.5 text-sm font-medium", Y ? "bg-status-success-bg-subtle text-status-success-text" : "bg-bg-sunken text-text-secondary"),
339
- children: [v(Y ? g : xe, { className: "h-4 w-4" }), Y ? "Chain of custody verified" : `Traceability in progress · ${Pe}/6`]
458
+ }), /* @__PURE__ */ _("div", {
459
+ className: t("flex items-center gap-2 self-start rounded-full px-3.5 py-1.5 text-sm font-medium", q ? "bg-status-success-bg-subtle text-status-success-text" : "bg-bg-sunken text-text-secondary"),
460
+ children: [g(q ? m : Me, { className: "h-4 w-4" }), q ? "Chain of custody verified" : `Traceability in progress · ${K}/6`]
340
461
  })]
341
- }), O.isLoading ? /* @__PURE__ */ v("div", {
462
+ }), E.isLoading ? /* @__PURE__ */ g("div", {
342
463
  className: "mt-6",
343
- children: /* @__PURE__ */ v(te, { label: "Assembling chain of custody…" })
344
- }) : O.isError || !q ? /* @__PURE__ */ v("div", {
464
+ children: /* @__PURE__ */ g(ne, { label: "Assembling chain of custody…" })
465
+ }) : E.isError || !W ? /* @__PURE__ */ g("div", {
345
466
  className: "mt-6",
346
- children: /* @__PURE__ */ v(l, {
467
+ children: /* @__PURE__ */ g(te, {
347
468
  message: "Couldn't load this asset's provenance.",
348
- onRetry: () => O.refetch()
469
+ onRetry: () => E.refetch()
349
470
  })
350
- }) : /* @__PURE__ */ y(Se, { children: [
351
- /* @__PURE__ */ v(b, {
471
+ }) : /* @__PURE__ */ _(Ne, { children: [
472
+ /* @__PURE__ */ _("div", {
473
+ className: t("mt-6 flex flex-col gap-2 rounded-xl border p-4 sm:flex-row sm:items-center sm:gap-3", q ? "border-status-success-border bg-status-success-bg-subtle" : "border-border-seam bg-bg-sunken"),
474
+ role: "status",
475
+ children: [/* @__PURE__ */ g("span", {
476
+ className: t("flex size-9 shrink-0 items-center justify-center rounded-lg", q ? "bg-status-success-bg-subtle text-status-success-text" : "bg-bg-surface text-text-secondary"),
477
+ children: g(q ? m : Me, { className: "h-5 w-5" })
478
+ }), /* @__PURE__ */ _("div", {
479
+ className: "min-w-0",
480
+ children: [/* @__PURE__ */ g("p", {
481
+ className: t("text-sm font-semibold", q ? "text-status-success-text" : "text-text-primary"),
482
+ children: q ? "Verified chain of custody" : `Chain of custody incomplete · ${K} of ${Be} stages`
483
+ }), /* @__PURE__ */ g("p", {
484
+ className: "text-xs text-text-secondary",
485
+ children: q ? "Every stage from origin to delivery is backed by a linked record, and the chain-of-custody certificate is approved." : "Stages without a linked record are shown as pending below. A chain is only marked verified once it is delivered and its custody certificate is approved."
486
+ })]
487
+ })]
488
+ }),
489
+ /* @__PURE__ */ g(v, {
352
490
  treatment: "glass",
353
491
  className: "mt-6 p-5",
354
- children: /* @__PURE__ */ v(ie, {
355
- steps: Le,
356
- current: Ie
492
+ children: /* @__PURE__ */ g(ae, {
493
+ steps: $e,
494
+ current: Qe
357
495
  })
358
496
  }),
359
- /* @__PURE__ */ v("div", {
497
+ /* @__PURE__ */ g("div", {
360
498
  className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",
361
- children: Re.map((e) => /* @__PURE__ */ v(ke, { node: e }, e.step))
499
+ children: et.map((e) => /* @__PURE__ */ g(We, { node: e }, e.step))
362
500
  }),
363
- /* @__PURE__ */ y("div", {
501
+ /* @__PURE__ */ _("div", {
364
502
  className: "mt-6 grid grid-cols-1 gap-6 lg:grid-cols-3",
365
- children: [/* @__PURE__ */ y(b, {
503
+ children: [/* @__PURE__ */ _(v, {
366
504
  treatment: "glass",
367
505
  className: "p-5 lg:col-span-2",
368
- children: [/* @__PURE__ */ y("div", {
506
+ children: [/* @__PURE__ */ _("div", {
369
507
  className: "mb-4 flex items-center gap-2.5",
370
- children: [/* @__PURE__ */ v("span", {
371
- className: "flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent",
372
- children: /* @__PURE__ */ v(be, { className: "h-4 w-4" })
373
- }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h2", {
508
+ children: [/* @__PURE__ */ g("span", {
509
+ className: "flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-action-primary-bg",
510
+ children: /* @__PURE__ */ g(Ae, { className: "h-4 w-4" })
511
+ }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h2", {
374
512
  className: "text-base font-semibold text-text-primary",
375
513
  children: "Traceability timeline"
376
- }), /* @__PURE__ */ v("p", {
514
+ }), /* @__PURE__ */ g("p", {
377
515
  className: "text-xs text-text-tertiary",
378
516
  children: "Recorded custody events, oldest to newest."
379
517
  })] })]
380
- }), ze.length > 0 ? /* @__PURE__ */ v(re, { items: ze }) : /* @__PURE__ */ v("div", {
518
+ }), tt.length > 0 ? /* @__PURE__ */ g(ie, { items: tt }) : /* @__PURE__ */ g("div", {
381
519
  className: "rounded-xl border border-dashed border-border-seam py-8 text-center text-sm text-text-secondary",
382
520
  children: "No dated custody events yet."
383
521
  })]
384
- }), /* @__PURE__ */ y(b, {
522
+ }), /* @__PURE__ */ _(v, {
385
523
  treatment: "glass",
386
524
  className: "flex flex-col gap-4 p-5",
387
- children: [/* @__PURE__ */ y("div", {
525
+ children: [/* @__PURE__ */ _("div", {
388
526
  className: "flex items-center gap-2.5",
389
- children: [/* @__PURE__ */ v("span", {
390
- className: "flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent",
391
- children: /* @__PURE__ */ v(h, { className: "h-4 w-4" })
392
- }), /* @__PURE__ */ y("div", {
527
+ children: [/* @__PURE__ */ g("span", {
528
+ className: "flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-action-primary-bg",
529
+ children: /* @__PURE__ */ g(p, { className: "h-4 w-4" })
530
+ }), /* @__PURE__ */ _("div", {
393
531
  className: "min-w-0",
394
- children: [/* @__PURE__ */ v("h2", {
532
+ children: [/* @__PURE__ */ g("h2", {
395
533
  className: "text-base font-semibold text-text-primary",
396
534
  children: "Origin"
397
- }), /* @__PURE__ */ v("p", {
535
+ }), /* @__PURE__ */ g("p", {
398
536
  className: "truncate text-xs text-text-tertiary",
399
- children: q.location ?? a(q.kind)
537
+ children: W.location ?? a(W.kind)
400
538
  })]
401
539
  })]
402
- }), Be ? /* @__PURE__ */ v(me, { points: [Be] }) : /* @__PURE__ */ v("div", {
540
+ }), it ? /* @__PURE__ */ g(be, { points: [it] }) : /* @__PURE__ */ g("div", {
403
541
  className: "rounded-xl border border-dashed border-border-seam py-8 text-center text-sm text-text-secondary",
404
542
  children: "No coordinates recorded for this asset."
405
543
  })]
406
544
  })]
407
545
  }),
408
- /* @__PURE__ */ y(b, {
546
+ /* @__PURE__ */ _(v, {
409
547
  treatment: "glass",
410
548
  className: "mt-6 p-5",
411
- children: [/* @__PURE__ */ v("h2", {
549
+ children: [/* @__PURE__ */ g("h2", {
412
550
  className: "mb-4 text-base font-semibold text-text-primary",
413
551
  children: "Provenance summary"
414
- }), /* @__PURE__ */ y("div", {
552
+ }), /* @__PURE__ */ _("div", {
415
553
  className: "grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",
416
554
  children: [
417
- /* @__PURE__ */ v(T, {
418
- icon: /* @__PURE__ */ v(_e, {}),
555
+ /* @__PURE__ */ g(C, {
556
+ icon: /* @__PURE__ */ g(Ee, {}),
419
557
  label: "Commodity",
420
- value: a(q.commodity),
421
- caption: a(q.kind)
558
+ value: a(W.commodity),
559
+ caption: a(W.kind)
422
560
  }),
423
- /* @__PURE__ */ v(T, {
424
- icon: /* @__PURE__ */ v(h, {}),
561
+ /* @__PURE__ */ g(C, {
562
+ icon: /* @__PURE__ */ g(p, {}),
425
563
  label: "Origin",
426
- value: q.location ?? q.name,
427
- caption: r(q.latitude, q.longitude)
564
+ value: W.location ?? W.name,
565
+ caption: r(W.latitude, W.longitude)
428
566
  }),
429
- /* @__PURE__ */ v(T, {
430
- icon: /* @__PURE__ */ v(m, {}),
567
+ /* @__PURE__ */ g(C, {
568
+ icon: /* @__PURE__ */ g(f, {}),
431
569
  label: "Production",
432
- value: `${o(F.length)} records`,
433
- caption: I ? `Latest ${s(I.volume, I.unit)}` : "None yet"
570
+ value: `${o(A.length)} records`,
571
+ caption: j ? `Latest ${s(j.volume, j.unit)}` : "None yet"
434
572
  }),
435
- /* @__PURE__ */ v(T, {
436
- icon: /* @__PURE__ */ v(f, {}),
573
+ /* @__PURE__ */ g(C, {
574
+ icon: /* @__PURE__ */ g(d, {}),
437
575
  label: "Inventory",
438
- value: `${o(L.length)} lots`,
439
- caption: R ? R.lotCode : "None yet"
576
+ value: `${o(M.length)} lots`,
577
+ caption: N ? N.lotCode : "None yet"
440
578
  }),
441
- /* @__PURE__ */ v(T, {
442
- icon: /* @__PURE__ */ v(ge, {}),
579
+ /* @__PURE__ */ g(C, {
580
+ icon: /* @__PURE__ */ g(we, {}),
443
581
  label: "Emissions",
444
- value: A.isError ? "—" : ee(Me),
445
- caption: `${Ne} verified`
582
+ value: D.isError ? "—" : ee(H),
583
+ caption: `${U} verified`
446
584
  }),
447
- /* @__PURE__ */ v(T, {
448
- icon: /* @__PURE__ */ v(g, {}),
585
+ /* @__PURE__ */ g(C, {
586
+ icon: /* @__PURE__ */ g(m, {}),
449
587
  label: "Certificates",
450
- value: `${o(U.length)} tracked`,
451
- caption: G ? "Custody approved" : W ? "Under review" : "None yet"
588
+ value: `${o(R.length)} tracked`,
589
+ caption: B ? "Custody approved" : z ? "Under review" : "None yet"
590
+ }),
591
+ /* @__PURE__ */ g(C, {
592
+ icon: /* @__PURE__ */ g(h, {}),
593
+ label: "Tracking ID",
594
+ value: I?.trackingId ?? "Not issued",
595
+ caption: I ? [I.reference, I.carrier].filter(Boolean).join(" · ") : "No shipment yet"
596
+ }),
597
+ /* @__PURE__ */ g(C, {
598
+ icon: /* @__PURE__ */ g(Te, {}),
599
+ label: "Data integrity",
600
+ value: Z ? ve(Z.integrityDigest) : "Unavailable",
601
+ caption: "Checksum over the linked records — re-export to compare"
602
+ }),
603
+ /* @__PURE__ */ g(C, {
604
+ icon: /* @__PURE__ */ g(ke, {}),
605
+ label: "Record network",
606
+ value: "Federated workspace records",
607
+ caption: "Registry · Commerce · Sustainability subgraphs"
452
608
  })
453
609
  ]
454
610
  })]
455
611
  }),
456
- (q.reserveEstimates?.length ?? 0) > 0 && /* @__PURE__ */ y("p", {
612
+ (W.reserveEstimates?.length ?? 0) > 0 && /* @__PURE__ */ _("p", {
457
613
  className: "mt-4 flex items-center gap-1.5 text-xs text-text-tertiary",
458
614
  children: [
459
- /* @__PURE__ */ v(ve, { className: "h-3.5 w-3.5" }),
460
- o(q.reserveEstimates?.length ?? 0),
615
+ /* @__PURE__ */ g(De, { className: "h-3.5 w-3.5" }),
616
+ o(W.reserveEstimates?.length ?? 0),
461
617
  " reserve estimate",
462
- (q.reserveEstimates?.length ?? 0) === 1 ? "" : "s",
618
+ (W.reserveEstimates?.length ?? 0) === 1 ? "" : "s",
463
619
  " on record for this asset."
464
620
  ]
465
621
  })
@@ -467,6 +623,6 @@ function E() {
467
623
  });
468
624
  }
469
625
  //#endregion
470
- export { E as ProvenancePage };
626
+ export { w as ProvenancePage };
471
627
 
472
628
  //# sourceMappingURL=ProvenancePage.js.map