@burdenoff/microfe-theglobalfuel 2026.705.4 → 2026.705.5

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.
@@ -66,7 +66,7 @@ var d = r(() => import("./pages/assets/AssetsPage.js").then((e) => ({ default: e
66
66
  /* @__PURE__ */ c(a, {
67
67
  path: "*",
68
68
  element: /* @__PURE__ */ c(i, {
69
- to: "",
69
+ to: w || "/",
70
70
  replace: !0
71
71
  })
72
72
  })
@@ -1 +1 @@
1
- {"version":3,"file":"TheGlobalFuelRoutes.js","names":[],"sources":["../../src/theglobalfuel/TheGlobalFuelRoutes.tsx"],"sourcesContent":["/**\n * TheGlobalFuel Routes\n * @module theglobalfuel\n *\n * Domain routes. The dashboard is eager-loaded (primary landing); all other\n * pages are lazy-loaded. Every route maps to a real `the*` backend capability.\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router-dom';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { useTheGlobalFuel } from './context/TheGlobalFuelContext';\n\n// Eager — primary landing\nimport { DashboardPage } from './pages/dashboard/DashboardPage';\n\n// Registry — Assets, Production, Reserves\nconst AssetsPage = lazy(() =>\n import('./pages/assets/AssetsPage').then((m) => ({ default: m.AssetsPage }))\n);\nconst AssetDetailPage = lazy(() =>\n import('./pages/assets/AssetDetailPage').then((m) => ({ default: m.AssetDetailPage }))\n);\nconst ProductionPage = lazy(() =>\n import('./pages/production/ProductionPage').then((m) => ({ default: m.ProductionPage }))\n);\nconst ReservesPage = lazy(() =>\n import('./pages/reserves/ReservesPage').then((m) => ({ default: m.ReservesPage }))\n);\n\n// Commerce — Offtake Contracts, Shipments, Inventory\nconst ContractsPage = lazy(() =>\n import('./pages/contracts/ContractsPage').then((m) => ({ default: m.ContractsPage }))\n);\nconst ContractDetailPage = lazy(() =>\n import('./pages/contracts/ContractDetailPage').then((m) => ({ default: m.ContractDetailPage }))\n);\nconst ShipmentsPage = lazy(() =>\n import('./pages/shipments/ShipmentsPage').then((m) => ({ default: m.ShipmentsPage }))\n);\nconst InventoryPage = lazy(() =>\n import('./pages/inventory/InventoryPage').then((m) => ({ default: m.InventoryPage }))\n);\n\n// Sustainability — Emissions, Compliance\nconst EmissionsPage = lazy(() =>\n import('./pages/emissions/EmissionsPage').then((m) => ({ default: m.EmissionsPage }))\n);\nconst CompliancePage = lazy(() =>\n import('./pages/compliance/CompliancePage').then((m) => ({ default: m.CompliancePage }))\n);\nconst ProvenancePage = lazy(() =>\n import('./pages/provenance/ProvenancePage').then((m) => ({ default: m.ProvenancePage }))\n);\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Spinner size=\"lg\" />\n </div>\n);\n\nexport const TheGlobalFuelRoutes: FC = () => {\n const { basePath, isStandalone } = useTheGlobalFuel();\n const location = useLocation();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the current path matches basePath (integrated mode).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={<DashboardPage />} />\n\n <Route path=\"assets\" element={<AssetsPage />} />\n <Route path=\"assets/:id\" element={<AssetDetailPage />} />\n\n <Route path=\"production\" element={<ProductionPage />} />\n\n <Route path=\"reserves\" element={<ReservesPage />} />\n\n <Route path=\"contracts\" element={<ContractsPage />} />\n <Route path=\"contracts/:id\" element={<ContractDetailPage />} />\n\n <Route path=\"shipments\" element={<ShipmentsPage />} />\n\n <Route path=\"inventory\" element={<InventoryPage />} />\n\n <Route path=\"emissions\" element={<EmissionsPage />} />\n\n <Route path=\"compliance\" element={<CompliancePage />} />\n\n <Route path=\"provenance\" element={<ProvenancePage />} />\n\n <Route path=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C,GAAD;MAAU,IAAG;MAAG,SAAA;MAAU,CAAA;KAAI,CAAA;IAChD,EAAA,CAAA;GACA,CAAA;EACP,CAAA"}
1
+ {"version":3,"file":"TheGlobalFuelRoutes.js","names":[],"sources":["../../src/theglobalfuel/TheGlobalFuelRoutes.tsx"],"sourcesContent":["/**\n * TheGlobalFuel Routes\n * @module theglobalfuel\n *\n * Domain routes. The dashboard is eager-loaded (primary landing); all other\n * pages are lazy-loaded. Every route maps to a real `the*` backend capability.\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router-dom';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { useTheGlobalFuel } from './context/TheGlobalFuelContext';\n\n// Eager — primary landing\nimport { DashboardPage } from './pages/dashboard/DashboardPage';\n\n// Registry — Assets, Production, Reserves\nconst AssetsPage = lazy(() =>\n import('./pages/assets/AssetsPage').then((m) => ({ default: m.AssetsPage }))\n);\nconst AssetDetailPage = lazy(() =>\n import('./pages/assets/AssetDetailPage').then((m) => ({ default: m.AssetDetailPage }))\n);\nconst ProductionPage = lazy(() =>\n import('./pages/production/ProductionPage').then((m) => ({ default: m.ProductionPage }))\n);\nconst ReservesPage = lazy(() =>\n import('./pages/reserves/ReservesPage').then((m) => ({ default: m.ReservesPage }))\n);\n\n// Commerce — Offtake Contracts, Shipments, Inventory\nconst ContractsPage = lazy(() =>\n import('./pages/contracts/ContractsPage').then((m) => ({ default: m.ContractsPage }))\n);\nconst ContractDetailPage = lazy(() =>\n import('./pages/contracts/ContractDetailPage').then((m) => ({ default: m.ContractDetailPage }))\n);\nconst ShipmentsPage = lazy(() =>\n import('./pages/shipments/ShipmentsPage').then((m) => ({ default: m.ShipmentsPage }))\n);\nconst InventoryPage = lazy(() =>\n import('./pages/inventory/InventoryPage').then((m) => ({ default: m.InventoryPage }))\n);\n\n// Sustainability — Emissions, Compliance\nconst EmissionsPage = lazy(() =>\n import('./pages/emissions/EmissionsPage').then((m) => ({ default: m.EmissionsPage }))\n);\nconst CompliancePage = lazy(() =>\n import('./pages/compliance/CompliancePage').then((m) => ({ default: m.CompliancePage }))\n);\nconst ProvenancePage = lazy(() =>\n import('./pages/provenance/ProvenancePage').then((m) => ({ default: m.ProvenancePage }))\n);\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Spinner size=\"lg\" />\n </div>\n);\n\nexport const TheGlobalFuelRoutes: FC = () => {\n const { basePath, isStandalone } = useTheGlobalFuel();\n const location = useLocation();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the current path matches basePath (integrated mode).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={<DashboardPage />} />\n\n <Route path=\"assets\" element={<AssetsPage />} />\n <Route path=\"assets/:id\" element={<AssetDetailPage />} />\n\n <Route path=\"production\" element={<ProductionPage />} />\n\n <Route path=\"reserves\" element={<ReservesPage />} />\n\n <Route path=\"contracts\" element={<ContractsPage />} />\n <Route path=\"contracts/:id\" element={<ContractDetailPage />} />\n\n <Route path=\"shipments\" element={<ShipmentsPage />} />\n\n <Route path=\"inventory\" element={<InventoryPage />} />\n\n <Route path=\"emissions\" element={<EmissionsPage />} />\n\n <Route path=\"compliance\" element={<CompliancePage />} />\n\n <Route path=\"provenance\" element={<ProvenancePage />} />\n\n {/* Unknown subpaths (e.g. /theglobalfuel/dashboard, stale bookmarks) canonicalize\n to the product root (the dashboard index). An absolute target avoids the\n self-referential `to=\"\"` loop that renders blank inside the nested Routes. */}\n <Route path=\"*\" element={<Navigate to={normalizedBasePath || '/'} replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;AAiBA,IAAM,IAA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ACP,CAAA"}
@@ -111,7 +111,7 @@ function E({ icon: e, label: t, value: n, caption: r }) {
111
111
  });
112
112
  }
113
113
  function D() {
114
- let { navigateTo: d } = e(), C = ae({ pagination: x }), w = f(() => C.data?.items ?? [], [C.data]), [T, D] = fe(""), O = T || w[0]?.id || "", k = ie(O || void 0), A = ue({ pagination: x }), j = le({
114
+ let { navigateTo: d } = e(), C = ae({ pagination: x }), w = f(() => C.data?.items ?? [], [C.data]), [T, D] = fe(""), De = f(() => w.find((e) => e.status === "PRODUCING")?.id ?? w[0]?.id ?? "", [w]), O = T || De, k = ie(O || void 0), A = ue({ pagination: x }), j = le({
115
115
  assetId: O || void 0,
116
116
  pagination: x
117
117
  }), M = oe(O || void 0, void 0, void 0, x), N = ce({
@@ -120,14 +120,14 @@ function D() {
120
120
  }), P = f(() => {
121
121
  let e = [...N.data?.items ?? []].sort(S((e) => e.createdAt));
122
122
  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;
123
- }, [N.data]), F = se(P), I = f(() => [...k.data?.productionRecords ?? []].sort(S((e) => e.periodEnd)), [k.data]), L = I[0], R = f(() => (A.data?.items ?? []).filter((e) => e.assetId === O).sort(S((e) => e.producedAt)), [A.data, O]), z = R[0], B = f(() => F.data?.shipments ?? [], [F.data]), V = f(() => [...B].filter((e) => e.status === "DELIVERED").sort(S((e) => e.deliveredAt))[0], [B]), H = f(() => V ?? [...B].sort(S((e) => e.departedAt ?? e.scheduledAt))[0], [V, B]), De = f(() => N.data?.items.find((e) => e.id === P), [N.data, P]), U = f(() => M.data?.items ?? [], [M.data]), W = f(() => U.find((e) => e.category === "CHAIN_OF_CUSTODY") ?? U.find((e) => e.status === "APPROVED") ?? U[0], [U]), G = W?.status === "APPROVED", Oe = f(() => j.data?.items ?? [], [j.data]), ke = Oe.reduce((e, t) => e + (t.co2eTonnes ?? 0), 0), Ae = Oe.filter((e) => e.verified).length, K = k.data, q = [
123
+ }, [N.data]), F = se(P), I = f(() => [...k.data?.productionRecords ?? []].sort(S((e) => e.periodEnd)), [k.data]), L = I[0], R = f(() => (A.data?.items ?? []).filter((e) => e.assetId === O).sort(S((e) => e.producedAt)), [A.data, O]), z = R[0], B = f(() => F.data?.shipments ?? [], [F.data]), V = f(() => [...B].filter((e) => e.status === "DELIVERED").sort(S((e) => e.deliveredAt))[0], [B]), H = f(() => V ?? [...B].sort(S((e) => e.departedAt ?? e.scheduledAt))[0], [V, B]), Oe = f(() => N.data?.items.find((e) => e.id === P), [N.data, P]), U = f(() => M.data?.items ?? [], [M.data]), W = f(() => U.find((e) => e.category === "CHAIN_OF_CUSTODY") ?? U.find((e) => e.status === "APPROVED") ?? U[0], [U]), G = W?.status === "APPROVED", ke = f(() => j.data?.items ?? [], [j.data]), Ae = ke.reduce((e, t) => e + (t.co2eTonnes ?? 0), 0), je = ke.filter((e) => e.verified).length, K = k.data, q = [
124
124
  !!K,
125
125
  I.length > 0,
126
126
  R.length > 0,
127
127
  !!H,
128
128
  !!V,
129
129
  G
130
- ], je = q.filter(Boolean).length, Me = q.findIndex((e) => !e), J = Me === -1 ? q.length : Me, Y = G && !!V, X = (e) => q[e] ? "done" : e === J ? "active" : "todo", Ne = [
130
+ ], Me = q.filter(Boolean).length, J = q.findIndex((e) => !e), Ne = J === -1 ? q.length : J, Y = G && !!V, X = (e) => q[e] ? "done" : e === Ne ? "active" : "todo", Pe = [
131
131
  {
132
132
  label: "Asset",
133
133
  description: "Origin"
@@ -152,7 +152,7 @@ function D() {
152
152
  label: "Certificate",
153
153
  description: "Verified"
154
154
  }
155
- ], Z = H && (H.origin || H.destination) ? [H.origin, H.destination].filter(Boolean).join(" → ") : void 0, Pe = K ? [
155
+ ], Z = H && (H.origin || H.destination) ? [H.origin, H.destination].filter(Boolean).join(" → ") : void 0, Fe = K ? [
156
156
  {
157
157
  step: 1,
158
158
  icon: /* @__PURE__ */ v(g, {}),
@@ -198,7 +198,7 @@ function D() {
198
198
  icon: /* @__PURE__ */ v(m, {}),
199
199
  label: "Delivered",
200
200
  primary: V ? s(V.volume, V.unit) : "Awaiting delivery",
201
- secondary: V && [V.deliveredAt ? i(V.deliveredAt) : null, De ? `Contract ${De.reference}` : null].filter(Boolean).join(" · ") || void 0,
201
+ secondary: V && [V.deliveredAt ? i(V.deliveredAt) : null, Oe ? `Contract ${Oe.reference}` : null].filter(Boolean).join(" · ") || void 0,
202
202
  state: X(4),
203
203
  present: !!V
204
204
  },
@@ -213,7 +213,7 @@ function D() {
213
213
  state: X(5),
214
214
  present: !!W
215
215
  }
216
- ] : [], Fe = f(() => {
216
+ ] : [], Ie = f(() => {
217
217
  if (!K) return [];
218
218
  let e = [], t = (t, n) => {
219
219
  if (!t) return;
@@ -329,7 +329,7 @@ function D() {
329
329
  })]
330
330
  }), /* @__PURE__ */ y("div", {
331
331
  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"),
332
- children: [v(Y ? _ : ve, { className: "h-4 w-4" }), Y ? "Chain of custody verified" : `Traceability in progress · ${je}/6`]
332
+ children: [v(Y ? _ : ve, { className: "h-4 w-4" }), Y ? "Chain of custody verified" : `Traceability in progress · ${Me}/6`]
333
333
  })]
334
334
  }), k.isLoading ? /* @__PURE__ */ v("div", {
335
335
  className: "mt-6",
@@ -345,13 +345,13 @@ function D() {
345
345
  treatment: "glass",
346
346
  className: "mt-6 p-5",
347
347
  children: /* @__PURE__ */ v(re, {
348
- steps: Ne,
349
- current: J
348
+ steps: Pe,
349
+ current: Ne
350
350
  })
351
351
  }),
352
352
  /* @__PURE__ */ v("div", {
353
353
  className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",
354
- children: Pe.map((e) => /* @__PURE__ */ v(Ee, { node: e }, e.step))
354
+ children: Fe.map((e) => /* @__PURE__ */ v(Ee, { node: e }, e.step))
355
355
  }),
356
356
  /* @__PURE__ */ y("div", {
357
357
  className: "mt-6 grid grid-cols-1 gap-6 lg:grid-cols-3",
@@ -370,7 +370,7 @@ function D() {
370
370
  className: "text-xs text-text-tertiary",
371
371
  children: "Recorded custody events, oldest to newest."
372
372
  })] })]
373
- }), Fe.length > 0 ? /* @__PURE__ */ v(ne, { items: Fe }) : /* @__PURE__ */ v("div", {
373
+ }), Ie.length > 0 ? /* @__PURE__ */ v(ne, { items: Ie }) : /* @__PURE__ */ v("div", {
374
374
  className: "rounded-xl border border-dashed border-border-seam py-8 text-center text-sm text-text-secondary",
375
375
  children: "No dated custody events yet."
376
376
  })]
@@ -434,8 +434,8 @@ function D() {
434
434
  /* @__PURE__ */ v(E, {
435
435
  icon: /* @__PURE__ */ v(pe, {}),
436
436
  label: "Emissions",
437
- value: j.isError ? "—" : ee(ke),
438
- caption: `${Ae} verified`
437
+ value: j.isError ? "—" : ee(Ae),
438
+ caption: `${je} verified`
439
439
  }),
440
440
  /* @__PURE__ */ v(E, {
441
441
  icon: /* @__PURE__ */ v(_, {}),
@@ -1 +1 @@
1
- {"version":3,"file":"ProvenancePage.js","names":[],"sources":["../../../../src/theglobalfuel/pages/provenance/ProvenancePage.tsx"],"sourcesContent":["/**\n * Provenance — chain-of-custody traceability (pit → port → certificate).\n * @module theglobalfuel/pages/provenance\n *\n * The flagship end-to-end traceability view. The user picks a resource asset and\n * we assemble its custody chain entirely from REAL linked records:\n * Asset (registry) → Production → Inventory lot → Shipment (+ document) →\n * Delivered → Chain-of-custody certificate (+ evidence)\n *\n * Sources — all `the*` endpoints, no mock data:\n * - useTheAsset(id) → the asset + nested productionRecords/reserves\n * - useTheInventoryLots() → filtered client-side to lot.assetId === id\n * - useTheEmissionRecords() → attributed emissions for the summary\n * - useTheComplianceCerts(id) → CHAIN_OF_CUSTODY / evidence certs\n * - useTheContracts({commodity}) + useTheContract() → offtake + nested shipments\n *\n * The chain renders as a StepProgress flow + a row of rich node cards (each\n * carrying the real record and a FileLink for its document/evidence), a Timeline\n * of the real dated events, an origin map and a provenance summary. Every stage\n * degrades gracefully when its downstream record does not exist yet (pre-launch).\n */\n\nimport { useMemo, useState, type ReactNode } from 'react';\nimport {\n Link2,\n MapPin,\n Gauge,\n Boxes,\n Ship,\n CheckCircle2,\n ShieldCheck,\n Shield,\n Fuel,\n Factory,\n Route,\n Layers,\n} from 'lucide-react';\nimport {\n GlassCard,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@burdenoff/fe-libs/ui';\nimport {\n PageLayout,\n StatusBadge,\n LoadingView,\n ErrorView,\n EmptyState,\n FileLink,\n WorldMap,\n StepProgress,\n Timeline,\n type TimelineItem,\n type StepProgressStep,\n type PathStepState,\n} from '../../components';\nimport { useTheGlobalFuel } from '../../context';\nimport {\n useTheAssets,\n useTheAsset,\n useTheInventoryLots,\n useTheEmissionRecords,\n useTheComplianceCerts,\n useTheContracts,\n useTheContract,\n} from '../../hooks';\nimport { cn } from '../../utils/cn';\nimport {\n formatDate,\n formatVolume,\n formatEnumLabel,\n formatCoords,\n formatNumber,\n formatTonnesCo2e,\n} from '../../utils';\nimport type { TheProductionRecord, TheInventoryLot, TheShipment } from '../../types';\n\nconst PAGE: { limit: number } = { limit: 200 };\n\n/** Latest-first by an optional date field, falling back to createdAt. */\nfunction byDateDesc<T extends { createdAt: string }>(pick: (row: T) => string | null | undefined) {\n return (a: T, b: T): number => {\n const av = new Date(pick(a) ?? a.createdAt).getTime();\n const bv = new Date(pick(b) ?? b.createdAt).getTime();\n return bv - av;\n };\n}\n\n// ── Chain node card ──────────────────────────────────────────────────────────\n\ninterface ChainNodeVM {\n step: number;\n icon: ReactNode;\n label: string;\n /** Real primary value; shown muted as \"Pending\" when the artifact is absent. */\n primary: ReactNode;\n secondary?: ReactNode;\n badge?: ReactNode;\n fileId?: string | null;\n state: PathStepState;\n present: boolean;\n}\n\nconst NUMBER_STYLE: Record<PathStepState, string> = {\n done: 'bg-status-success-bg-subtle text-status-success-text',\n active: 'bg-[var(--color-accent-soft)] text-accent',\n todo: 'bg-bg-sunken text-text-muted',\n locked: 'bg-bg-sunken text-text-muted',\n};\n\nconst ICON_STYLE: Record<PathStepState, string> = {\n done: 'bg-status-success-bg-subtle text-status-success-text',\n active: 'bg-[var(--color-accent-soft)] text-accent',\n todo: 'bg-bg-sunken text-text-tertiary',\n locked: 'bg-bg-sunken text-text-tertiary',\n};\n\nconst DOT_STYLE: Record<PathStepState, string> = {\n done: 'bg-status-success-text',\n active: 'bg-[var(--color-accent-primary)] motion-safe:animate-vc-glow-pulse',\n todo: 'bg-border-strong',\n locked: 'bg-border-strong',\n};\n\nfunction ChainNodeCard({ node }: { node: ChainNodeVM }) {\n return (\n <GlassCard\n treatment=\"glass\"\n className={cn(\n 'relative flex h-full flex-col gap-3 p-5 transition-shadow',\n node.state === 'done' && 'shadow-[inset_0_2px_0_0_var(--color-status-success-text)]',\n node.state === 'active' && 'shadow-[inset_0_2px_0_0_var(--color-accent-primary)]'\n )}\n >\n <div className=\"flex items-center justify-between\">\n <span\n className={cn(\n 'flex size-7 items-center justify-center rounded-full text-xs font-semibold tabular-nums',\n NUMBER_STYLE[node.state]\n )}\n >\n {node.step}\n </span>\n <span aria-hidden=\"true\" className={cn('size-2 rounded-full', DOT_STYLE[node.state])} />\n </div>\n\n <span\n className={cn(\n 'flex size-11 items-center justify-center rounded-xl [&_svg]:size-6',\n ICON_STYLE[node.state]\n )}\n >\n {node.icon}\n </span>\n\n <div className=\"min-w-0\">\n <p className=\"text-xs font-medium uppercase tracking-wide text-text-tertiary\">\n {node.label}\n </p>\n <p\n className={cn(\n 'mt-1 truncate text-base font-semibold',\n node.present ? 'text-text-primary' : 'text-text-muted'\n )}\n title={typeof node.primary === 'string' ? node.primary : undefined}\n >\n {node.present ? node.primary : 'Pending'}\n </p>\n {node.present && node.secondary && (\n <p className=\"mt-0.5 line-clamp-2 text-xs text-text-secondary\">{node.secondary}</p>\n )}\n </div>\n\n {(node.badge || (node.present && node.fileId)) && (\n <div className=\"mt-auto flex flex-wrap items-center gap-2 pt-1\">\n {node.badge}\n {node.present && node.fileId && <FileLink fileId={node.fileId} />}\n </div>\n )}\n </GlassCard>\n );\n}\n\n// ── Summary cell ─────────────────────────────────────────────────────────────\n\nfunction SummaryCell({\n icon,\n label,\n value,\n caption,\n}: {\n icon: ReactNode;\n label: string;\n value: ReactNode;\n caption?: ReactNode;\n}) {\n return (\n <div className=\"flex items-start gap-3\">\n <span 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\">\n {icon}\n </span>\n <div className=\"min-w-0\">\n <p className=\"text-xs font-medium uppercase tracking-wide text-text-tertiary\">{label}</p>\n <p className=\"mt-0.5 truncate text-sm font-semibold text-text-primary\">{value}</p>\n {caption && <p className=\"truncate text-xs text-text-tertiary\">{caption}</p>}\n </div>\n </div>\n );\n}\n\n// ── Page ─────────────────────────────────────────────────────────────────────\n\nexport function ProvenancePage() {\n const { navigateTo } = useTheGlobalFuel();\n\n const assets = useTheAssets({ pagination: PAGE });\n const assetRows = useMemo(() => assets.data?.items ?? [], [assets.data]);\n\n const [selectedAssetId, setSelectedAssetId] = useState<string>('');\n // Auto-focus the first asset (no effect needed) so the chain renders at once;\n // an explicit user selection always wins.\n const effectiveAssetId = selectedAssetId || assetRows[0]?.id || '';\n\n const asset = useTheAsset(effectiveAssetId || undefined);\n const inventory = useTheInventoryLots({ pagination: PAGE });\n const emissions = useTheEmissionRecords({\n assetId: effectiveAssetId || undefined,\n pagination: PAGE,\n });\n const compliance = useTheComplianceCerts(\n effectiveAssetId || undefined,\n undefined,\n undefined,\n PAGE\n );\n const contracts = useTheContracts({ commodity: asset.data?.commodity, pagination: PAGE });\n\n // Pick the contract most likely to carry a delivered shipment for this\n // commodity: prefer one that has already delivered volume (SELL first), else\n // the most recent. Its nested shipments give us the movement + delivery nodes.\n const pickedContractId = useMemo(() => {\n const rows = [...(contracts.data?.items ?? [])].sort(byDateDesc((c) => c.createdAt));\n const pick =\n rows.find((c) => c.deliveredVolume > 0 && c.side === 'SELL') ??\n rows.find((c) => c.deliveredVolume > 0) ??\n rows.find((c) => c.side === 'SELL') ??\n rows[0];\n return pick?.id;\n }, [contracts.data]);\n\n const contractDetail = useTheContract(pickedContractId);\n\n // ── Derive the chain from real linked records ──────────────────────────────\n const productionRecords = useMemo(\n () => [...(asset.data?.productionRecords ?? [])].sort(byDateDesc((r) => r.periodEnd)),\n [asset.data]\n );\n const latestProduction: TheProductionRecord | undefined = productionRecords[0];\n\n const assetLots = useMemo<TheInventoryLot[]>(\n () =>\n (inventory.data?.items ?? [])\n .filter((l) => l.assetId === effectiveAssetId)\n .sort(byDateDesc((l) => l.producedAt)),\n [inventory.data, effectiveAssetId]\n );\n const latestLot: TheInventoryLot | undefined = assetLots[0];\n\n const shipments = useMemo<TheShipment[]>(\n () => contractDetail.data?.shipments ?? [],\n [contractDetail.data]\n );\n const deliveredShipment = useMemo<TheShipment | undefined>(\n () =>\n [...shipments]\n .filter((s) => s.status === 'DELIVERED')\n .sort(byDateDesc((s) => s.deliveredAt))[0],\n [shipments]\n );\n const primaryShipment = useMemo<TheShipment | undefined>(\n () =>\n deliveredShipment ?? [...shipments].sort(byDateDesc((s) => s.departedAt ?? s.scheduledAt))[0],\n [deliveredShipment, shipments]\n );\n const pickedContract = useMemo(\n () => contracts.data?.items.find((c) => c.id === pickedContractId),\n [contracts.data, pickedContractId]\n );\n\n const certRows = useMemo(() => compliance.data?.items ?? [], [compliance.data]);\n const custodyCert = useMemo(\n () =>\n certRows.find((c) => c.category === 'CHAIN_OF_CUSTODY') ??\n certRows.find((c) => c.status === 'APPROVED') ??\n certRows[0],\n [certRows]\n );\n const certApproved = custodyCert?.status === 'APPROVED';\n\n const emissionRows = useMemo(() => emissions.data?.items ?? [], [emissions.data]);\n const totalTonnes = emissionRows.reduce((sum, e) => sum + (e.co2eTonnes ?? 0), 0);\n const verifiedEmissions = emissionRows.filter((e) => e.verified).length;\n\n const a = asset.data;\n\n // Stage completeness, in chain order.\n const completeFlags = [\n Boolean(a),\n productionRecords.length > 0,\n assetLots.length > 0,\n Boolean(primaryShipment),\n Boolean(deliveredShipment),\n certApproved,\n ];\n const completeCount = completeFlags.filter(Boolean).length;\n const firstIncomplete = completeFlags.findIndex((f) => !f);\n const current = firstIncomplete === -1 ? completeFlags.length : firstIncomplete;\n const verified = certApproved && Boolean(deliveredShipment);\n\n const stateFor = (i: number): PathStepState =>\n completeFlags[i] ? 'done' : i === current ? 'active' : 'todo';\n\n const progressSteps: StepProgressStep[] = [\n { label: 'Asset', description: 'Origin' },\n { label: 'Production', description: 'Extracted' },\n { label: 'Inventory', description: 'Lotted' },\n { label: 'Shipment', description: 'In transit' },\n { label: 'Delivered', description: 'Received' },\n { label: 'Certificate', description: 'Verified' },\n ];\n\n const shipmentRoute =\n primaryShipment && (primaryShipment.origin || primaryShipment.destination)\n ? [primaryShipment.origin, primaryShipment.destination].filter(Boolean).join(' → ')\n : undefined;\n\n const nodes: ChainNodeVM[] = a\n ? [\n {\n step: 1,\n icon: <MapPin />,\n label: 'Asset',\n primary: a.name,\n secondary: a.location ?? formatCoords(a.latitude, a.longitude),\n badge: <StatusBadge status={a.status} />,\n state: stateFor(0),\n present: true,\n },\n {\n step: 2,\n icon: <Gauge />,\n label: 'Production',\n primary: latestProduction\n ? formatVolume(latestProduction.volume, latestProduction.unit)\n : 'Not yet recorded',\n secondary: latestProduction\n ? `${formatDate(latestProduction.periodStart)} – ${formatDate(latestProduction.periodEnd)}`\n : undefined,\n state: stateFor(1),\n present: Boolean(latestProduction),\n },\n {\n step: 3,\n icon: <Boxes />,\n label: 'Inventory lot',\n primary: latestLot ? latestLot.lotCode : 'No lot yet',\n secondary: latestLot ? formatVolume(latestLot.quantity, latestLot.unit) : undefined,\n badge: latestLot ? <StatusBadge status={latestLot.status} /> : undefined,\n state: stateFor(2),\n present: Boolean(latestLot),\n },\n {\n step: 4,\n icon: <Ship />,\n label: 'Shipment',\n primary: primaryShipment ? primaryShipment.reference : 'Not shipped',\n secondary: primaryShipment\n ? [formatEnumLabel(primaryShipment.mode), shipmentRoute].filter(Boolean).join(' · ')\n : undefined,\n badge: primaryShipment ? <StatusBadge status={primaryShipment.status} /> : undefined,\n fileId: primaryShipment?.document?.id,\n state: stateFor(3),\n present: Boolean(primaryShipment),\n },\n {\n step: 5,\n icon: <CheckCircle2 />,\n label: 'Delivered',\n primary: deliveredShipment\n ? formatVolume(deliveredShipment.volume, deliveredShipment.unit)\n : 'Awaiting delivery',\n secondary: deliveredShipment\n ? [\n deliveredShipment.deliveredAt ? formatDate(deliveredShipment.deliveredAt) : null,\n pickedContract ? `Contract ${pickedContract.reference}` : null,\n ]\n .filter(Boolean)\n .join(' · ') || undefined\n : undefined,\n state: stateFor(4),\n present: Boolean(deliveredShipment),\n },\n {\n step: 6,\n icon: <ShieldCheck />,\n label: 'Certificate',\n primary: custodyCert ? (custodyCert.certNumber ?? custodyCert.title) : 'No certificate',\n secondary: custodyCert ? formatEnumLabel(custodyCert.category) : undefined,\n badge: custodyCert ? <StatusBadge status={custodyCert.status} /> : undefined,\n fileId: custodyCert?.evidence?.id,\n state: stateFor(5),\n present: Boolean(custodyCert),\n },\n ]\n : [];\n\n // ── Timeline (real dated events, ascending) ────────────────────────────────\n const timelineItems = useMemo<TimelineItem[]>(() => {\n if (!a) return [];\n const raw: { date: string; item: Omit<TimelineItem, 'time'> }[] = [];\n const push = (date: string | null | undefined, item: Omit<TimelineItem, 'time'>) => {\n if (!date) return;\n const t = new Date(date).getTime();\n if (Number.isNaN(t)) return;\n raw.push({ date, item });\n };\n\n push(a.commissionedAt ?? a.createdAt, {\n title: 'Asset registered',\n meta: a.name,\n tone: 'accent',\n icon: <MapPin className=\"h-3 w-3\" />,\n });\n if (latestProduction) {\n push(latestProduction.periodEnd ?? latestProduction.createdAt, {\n title: 'Production recorded',\n meta: formatVolume(latestProduction.volume, latestProduction.unit),\n tone: 'info',\n icon: <Gauge className=\"h-3 w-3\" />,\n });\n }\n if (latestLot) {\n push(latestLot.producedAt ?? latestLot.createdAt, {\n title: 'Inventory lot created',\n meta: `${latestLot.lotCode} · ${formatVolume(latestLot.quantity, latestLot.unit)}`,\n tone: 'info',\n icon: <Boxes className=\"h-3 w-3\" />,\n });\n }\n if (primaryShipment) {\n push(primaryShipment.departedAt ?? primaryShipment.scheduledAt ?? primaryShipment.createdAt, {\n title: primaryShipment.departedAt ? 'Shipment departed' : 'Shipment scheduled',\n meta: [primaryShipment.reference, shipmentRoute].filter(Boolean).join(' · '),\n tone: 'accent',\n icon: <Ship className=\"h-3 w-3\" />,\n });\n }\n if (deliveredShipment?.deliveredAt) {\n push(deliveredShipment.deliveredAt, {\n title: 'Delivered',\n meta: formatVolume(deliveredShipment.volume, deliveredShipment.unit),\n tone: 'success',\n icon: <CheckCircle2 className=\"h-3 w-3\" />,\n });\n }\n if (custodyCert) {\n push(custodyCert.issuedAt ?? custodyCert.createdAt, {\n title: certApproved ? 'Certificate approved' : 'Certificate registered',\n meta: custodyCert.certNumber ?? custodyCert.title,\n tone: certApproved ? 'success' : 'warning',\n icon: <ShieldCheck className=\"h-3 w-3\" />,\n });\n }\n\n return raw\n .sort((x, y) => new Date(x.date).getTime() - new Date(y.date).getTime())\n .map(({ date, item }) => ({ ...item, time: formatDate(date) }));\n }, [\n a,\n latestProduction,\n latestLot,\n primaryShipment,\n deliveredShipment,\n custodyCert,\n certApproved,\n shipmentRoute,\n ]);\n\n const originPoint =\n a && typeof a.latitude === 'number' && typeof a.longitude === 'number'\n ? { lat: a.latitude, lng: a.longitude, label: a.name, primary: true }\n : null;\n\n const description =\n 'Pit to port to certificate — end-to-end traceability from origin to verified certificate.';\n\n // ── Render ─────────────────────────────────────────────────────────────────\n if (assets.isLoading && assetRows.length === 0) {\n return (\n <PageLayout title=\"Provenance\" description={description}>\n <LoadingView label=\"Loading assets…\" />\n </PageLayout>\n );\n }\n if (assets.isError) {\n return (\n <PageLayout title=\"Provenance\" description={description}>\n <ErrorView message=\"Couldn't load assets to trace.\" onRetry={() => assets.refetch()} />\n </PageLayout>\n );\n }\n if (assetRows.length === 0) {\n return (\n <PageLayout title=\"Provenance\" description={description}>\n <EmptyState\n illustration=\"empty-data\"\n icon={<Link2 className=\"h-10 w-10\" />}\n title=\"No assets to trace\"\n description=\"Register a resource asset to build its end-to-end chain of custody.\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('assets')}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n Go to assets\n </button>\n }\n />\n </PageLayout>\n );\n }\n\n return (\n <PageLayout title=\"Provenance\" description={description}>\n {/* Control bar: asset picker + trust state */}\n <GlassCard\n treatment=\"glass\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between\"\n >\n <div className=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <label\n htmlFor=\"provenance-asset\"\n className=\"text-xs font-medium uppercase tracking-wide text-text-tertiary\"\n >\n Trace asset\n </label>\n <Select value={effectiveAssetId} onValueChange={setSelectedAssetId}>\n <SelectTrigger\n id=\"provenance-asset\"\n className=\"h-10 w-full sm:w-96\"\n aria-label=\"Select an asset to trace\"\n >\n <SelectValue placeholder=\"Select an asset to trace\" />\n </SelectTrigger>\n <SelectContent>\n {assetRows.map((row) => (\n <SelectItem key={row.id} value={row.id}>\n {row.name} · {formatEnumLabel(row.commodity)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div\n className={cn(\n 'flex items-center gap-2 self-start rounded-full px-3.5 py-1.5 text-sm font-medium',\n verified\n ? 'bg-status-success-bg-subtle text-status-success-text'\n : 'bg-bg-sunken text-text-secondary'\n )}\n >\n {verified ? <ShieldCheck className=\"h-4 w-4\" /> : <Shield className=\"h-4 w-4\" />}\n {verified ? 'Chain of custody verified' : `Traceability in progress · ${completeCount}/6`}\n </div>\n </GlassCard>\n\n {asset.isLoading ? (\n <div className=\"mt-6\">\n <LoadingView label=\"Assembling chain of custody…\" />\n </div>\n ) : asset.isError || !a ? (\n <div className=\"mt-6\">\n <ErrorView\n message=\"Couldn't load this asset's provenance.\"\n onRetry={() => asset.refetch()}\n />\n </div>\n ) : (\n <>\n {/* Flow ribbon */}\n <GlassCard treatment=\"glass\" className=\"mt-6 p-5\">\n <StepProgress steps={progressSteps} current={current} />\n </GlassCard>\n\n {/* Chain nodes */}\n <div className=\"mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6\">\n {nodes.map((node) => (\n <ChainNodeCard key={node.step} node={node} />\n ))}\n </div>\n\n {/* Timeline + origin */}\n <div className=\"mt-6 grid grid-cols-1 gap-6 lg:grid-cols-3\">\n <GlassCard treatment=\"glass\" className=\"p-5 lg:col-span-2\">\n <div className=\"mb-4 flex items-center gap-2.5\">\n <span className=\"flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent\">\n <Route className=\"h-4 w-4\" />\n </span>\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">\n Traceability timeline\n </h2>\n <p className=\"text-xs text-text-tertiary\">\n Recorded custody events, oldest to newest.\n </p>\n </div>\n </div>\n {timelineItems.length > 0 ? (\n <Timeline items={timelineItems} />\n ) : (\n <div className=\"rounded-xl border border-dashed border-border-seam py-8 text-center text-sm text-text-secondary\">\n No dated custody events yet.\n </div>\n )}\n </GlassCard>\n\n <GlassCard treatment=\"glass\" className=\"flex flex-col gap-4 p-5\">\n <div className=\"flex items-center gap-2.5\">\n <span className=\"flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent\">\n <MapPin className=\"h-4 w-4\" />\n </span>\n <div className=\"min-w-0\">\n <h2 className=\"text-base font-semibold text-text-primary\">Origin</h2>\n <p className=\"truncate text-xs text-text-tertiary\">\n {a.location ?? formatEnumLabel(a.kind)}\n </p>\n </div>\n </div>\n {originPoint ? (\n <WorldMap points={[originPoint]} />\n ) : (\n <div className=\"rounded-xl border border-dashed border-border-seam py-8 text-center text-sm text-text-secondary\">\n No coordinates recorded for this asset.\n </div>\n )}\n </GlassCard>\n </div>\n\n {/* Provenance summary */}\n <GlassCard treatment=\"glass\" className=\"mt-6 p-5\">\n <h2 className=\"mb-4 text-base font-semibold text-text-primary\">Provenance summary</h2>\n <div className=\"grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6\">\n <SummaryCell\n icon={<Fuel />}\n label=\"Commodity\"\n value={formatEnumLabel(a.commodity)}\n caption={formatEnumLabel(a.kind)}\n />\n <SummaryCell\n icon={<MapPin />}\n label=\"Origin\"\n value={a.location ?? a.name}\n caption={formatCoords(a.latitude, a.longitude)}\n />\n <SummaryCell\n icon={<Gauge />}\n label=\"Production\"\n value={`${formatNumber(productionRecords.length)} records`}\n caption={\n latestProduction\n ? `Latest ${formatVolume(latestProduction.volume, latestProduction.unit)}`\n : 'None yet'\n }\n />\n <SummaryCell\n icon={<Boxes />}\n label=\"Inventory\"\n value={`${formatNumber(assetLots.length)} lots`}\n caption={latestLot ? latestLot.lotCode : 'None yet'}\n />\n <SummaryCell\n icon={<Factory />}\n label=\"Emissions\"\n value={emissions.isError ? '—' : formatTonnesCo2e(totalTonnes)}\n caption={`${verifiedEmissions} verified`}\n />\n <SummaryCell\n icon={<ShieldCheck />}\n label=\"Certificates\"\n value={`${formatNumber(certRows.length)} tracked`}\n caption={\n certApproved ? 'Custody approved' : custodyCert ? 'Under review' : 'None yet'\n }\n />\n </div>\n </GlassCard>\n\n {/* Reserves footnote — surface proved reserves when present */}\n {(a.reserveEstimates?.length ?? 0) > 0 && (\n <p className=\"mt-4 flex items-center gap-1.5 text-xs text-text-tertiary\">\n <Layers className=\"h-3.5 w-3.5\" />\n {formatNumber(a.reserveEstimates?.length ?? 0)} reserve estimate\n {(a.reserveEstimates?.length ?? 0) === 1 ? '' : 's'} on record for this asset.\n </p>\n )}\n </>\n )}\n </P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CAAA;MACF,kBAAC,GAAD;OACE,MAAM,kBAAC,GAAD,EAAU,CAAA;OAChB,OAAM;OACN,OAAO,EAAE,YAAY,EAAE;OACvB,SAAS,EAAa,EAAE,UAAU,EAAE,UAAU;OAC9C,CAAA;MACF,kBAAC,GAAD;OACE,MAAM,kBAAC,GAAD,EAAS,CAAA;OACf,OAAM;OACN,OAAO,GAAG,EAAa,EAAkB,OAAO,CAAC;OACjD,SACE,IACI,UAAU,EAAa,EAAiB,QAAQ,EAAiB,KAAK,KACtE;OAEN,CAAA;MACF,kBAAC,GAAD;OACE,MAAM,kBAAC,GAAD,EAAS,CAAA;OACf,OAAM;OACN,OAAO,GAAG,EAAa,EAAU,OAAO,CAAC;OACzC,SAAS,IAAY,EAAU,UAAU;OACzC,CAAA;MACF,kBAAC,GAAD;OACE,MAAM,kBAAC,IAAD,EAAW,CAAA;OACjB,OAAM;OACN,OAAO,EAAU,UAAU,MAAM,GAAiB,GAAY;OAC9D,SAAS,GAAG,GAAkB;OAC9B,CAAA;MACF,kBAAC,GAAD;OACE,MAAM,kBAAC,GAAD,EAAe,CAAA;OACrB,OAAM;OACN,OAAO,GAAG,EAAa,EAAS,OAAO,CAAC;OACxC,SACE,IAAe,qBAAqB,IAAc,iBAAiB;OAErE,CAAA;MACE;OACI;;IAGV,EAAE,kBAAkB,UAAU,KAAK,KACnC,kBAAC,KAAD;IAAG,WAAU;cAAb;KACE,kBAAC,IAAD,EAAQ,WAAU,eAAgB,CAAA;KACjC,EAAa,EAAE,kBAAkB,UAAU,EAAE;KAAC;MAC7C,EAAE,kBAAkB,UAAU,OAAO,IAAI,KAAK;KAAI;KAClD;;GAEL,EAAA,CAAA,CAEM"}
1
+ {"version":3,"file":"ProvenancePage.js","names":[],"sources":["../../../../src/theglobalfuel/pages/provenance/ProvenancePage.tsx"],"sourcesContent":["/**\n * Provenance — chain-of-custody traceability (pit → port → certificate).\n * @module theglobalfuel/pages/provenance\n *\n * The flagship end-to-end traceability view. The user picks a resource asset and\n * we assemble its custody chain entirely from REAL linked records:\n * Asset (registry) → Production → Inventory lot → Shipment (+ document) →\n * Delivered → Chain-of-custody certificate (+ evidence)\n *\n * Sources — all `the*` endpoints, no mock data:\n * - useTheAsset(id) → the asset + nested productionRecords/reserves\n * - useTheInventoryLots() → filtered client-side to lot.assetId === id\n * - useTheEmissionRecords() → attributed emissions for the summary\n * - useTheComplianceCerts(id) → CHAIN_OF_CUSTODY / evidence certs\n * - useTheContracts({commodity}) + useTheContract() → offtake + nested shipments\n *\n * The chain renders as a StepProgress flow + a row of rich node cards (each\n * carrying the real record and a FileLink for its document/evidence), a Timeline\n * of the real dated events, an origin map and a provenance summary. Every stage\n * degrades gracefully when its downstream record does not exist yet (pre-launch).\n */\n\nimport { useMemo, useState, type ReactNode } from 'react';\nimport {\n Link2,\n MapPin,\n Gauge,\n Boxes,\n Ship,\n CheckCircle2,\n ShieldCheck,\n Shield,\n Fuel,\n Factory,\n Route,\n Layers,\n} from 'lucide-react';\nimport {\n GlassCard,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@burdenoff/fe-libs/ui';\nimport {\n PageLayout,\n StatusBadge,\n LoadingView,\n ErrorView,\n EmptyState,\n FileLink,\n WorldMap,\n StepProgress,\n Timeline,\n type TimelineItem,\n type StepProgressStep,\n type PathStepState,\n} from '../../components';\nimport { useTheGlobalFuel } from '../../context';\nimport {\n useTheAssets,\n useTheAsset,\n useTheInventoryLots,\n useTheEmissionRecords,\n useTheComplianceCerts,\n useTheContracts,\n useTheContract,\n} from '../../hooks';\nimport { cn } from '../../utils/cn';\nimport {\n formatDate,\n formatVolume,\n formatEnumLabel,\n formatCoords,\n formatNumber,\n formatTonnesCo2e,\n} from '../../utils';\nimport type { TheProductionRecord, TheInventoryLot, TheShipment } from '../../types';\n\nconst PAGE: { limit: number } = { limit: 200 };\n\n/** Latest-first by an optional date field, falling back to createdAt. */\nfunction byDateDesc<T extends { createdAt: string }>(pick: (row: T) => string | null | undefined) {\n return (a: T, b: T): number => {\n const av = new Date(pick(a) ?? a.createdAt).getTime();\n const bv = new Date(pick(b) ?? b.createdAt).getTime();\n return bv - av;\n };\n}\n\n// ── Chain node card ──────────────────────────────────────────────────────────\n\ninterface ChainNodeVM {\n step: number;\n icon: ReactNode;\n label: string;\n /** Real primary value; shown muted as \"Pending\" when the artifact is absent. */\n primary: ReactNode;\n secondary?: ReactNode;\n badge?: ReactNode;\n fileId?: string | null;\n state: PathStepState;\n present: boolean;\n}\n\nconst NUMBER_STYLE: Record<PathStepState, string> = {\n done: 'bg-status-success-bg-subtle text-status-success-text',\n active: 'bg-[var(--color-accent-soft)] text-accent',\n todo: 'bg-bg-sunken text-text-muted',\n locked: 'bg-bg-sunken text-text-muted',\n};\n\nconst ICON_STYLE: Record<PathStepState, string> = {\n done: 'bg-status-success-bg-subtle text-status-success-text',\n active: 'bg-[var(--color-accent-soft)] text-accent',\n todo: 'bg-bg-sunken text-text-tertiary',\n locked: 'bg-bg-sunken text-text-tertiary',\n};\n\nconst DOT_STYLE: Record<PathStepState, string> = {\n done: 'bg-status-success-text',\n active: 'bg-[var(--color-accent-primary)] motion-safe:animate-vc-glow-pulse',\n todo: 'bg-border-strong',\n locked: 'bg-border-strong',\n};\n\nfunction ChainNodeCard({ node }: { node: ChainNodeVM }) {\n return (\n <GlassCard\n treatment=\"glass\"\n className={cn(\n 'relative flex h-full flex-col gap-3 p-5 transition-shadow',\n node.state === 'done' && 'shadow-[inset_0_2px_0_0_var(--color-status-success-text)]',\n node.state === 'active' && 'shadow-[inset_0_2px_0_0_var(--color-accent-primary)]'\n )}\n >\n <div className=\"flex items-center justify-between\">\n <span\n className={cn(\n 'flex size-7 items-center justify-center rounded-full text-xs font-semibold tabular-nums',\n NUMBER_STYLE[node.state]\n )}\n >\n {node.step}\n </span>\n <span aria-hidden=\"true\" className={cn('size-2 rounded-full', DOT_STYLE[node.state])} />\n </div>\n\n <span\n className={cn(\n 'flex size-11 items-center justify-center rounded-xl [&_svg]:size-6',\n ICON_STYLE[node.state]\n )}\n >\n {node.icon}\n </span>\n\n <div className=\"min-w-0\">\n <p className=\"text-xs font-medium uppercase tracking-wide text-text-tertiary\">\n {node.label}\n </p>\n <p\n className={cn(\n 'mt-1 truncate text-base font-semibold',\n node.present ? 'text-text-primary' : 'text-text-muted'\n )}\n title={typeof node.primary === 'string' ? node.primary : undefined}\n >\n {node.present ? node.primary : 'Pending'}\n </p>\n {node.present && node.secondary && (\n <p className=\"mt-0.5 line-clamp-2 text-xs text-text-secondary\">{node.secondary}</p>\n )}\n </div>\n\n {(node.badge || (node.present && node.fileId)) && (\n <div className=\"mt-auto flex flex-wrap items-center gap-2 pt-1\">\n {node.badge}\n {node.present && node.fileId && <FileLink fileId={node.fileId} />}\n </div>\n )}\n </GlassCard>\n );\n}\n\n// ── Summary cell ─────────────────────────────────────────────────────────────\n\nfunction SummaryCell({\n icon,\n label,\n value,\n caption,\n}: {\n icon: ReactNode;\n label: string;\n value: ReactNode;\n caption?: ReactNode;\n}) {\n return (\n <div className=\"flex items-start gap-3\">\n <span 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\">\n {icon}\n </span>\n <div className=\"min-w-0\">\n <p className=\"text-xs font-medium uppercase tracking-wide text-text-tertiary\">{label}</p>\n <p className=\"mt-0.5 truncate text-sm font-semibold text-text-primary\">{value}</p>\n {caption && <p className=\"truncate text-xs text-text-tertiary\">{caption}</p>}\n </div>\n </div>\n );\n}\n\n// ── Page ─────────────────────────────────────────────────────────────────────\n\nexport function ProvenancePage() {\n const { navigateTo } = useTheGlobalFuel();\n\n const assets = useTheAssets({ pagination: PAGE });\n const assetRows = useMemo(() => assets.data?.items ?? [], [assets.data]);\n\n const [selectedAssetId, setSelectedAssetId] = useState<string>('');\n // Auto-focus a *producing* asset first (no effect needed) — those carry the\n // downstream production / shipment / certificate activity, so the chain reads\n // as a real, populated trace on first paint instead of a string of \"Pending\"\n // nodes. Falls back to the first asset. An explicit user selection always wins.\n const defaultAssetId = useMemo(() => {\n const producing = assetRows.find((a) => a.status === 'PRODUCING');\n return producing?.id ?? assetRows[0]?.id ?? '';\n }, [assetRows]);\n const effectiveAssetId = selectedAssetId || defaultAssetId;\n\n const asset = useTheAsset(effectiveAssetId || undefined);\n const inventory = useTheInventoryLots({ pagination: PAGE });\n const emissions = useTheEmissionRecords({\n assetId: effectiveAssetId || undefined,\n pagination: PAGE,\n });\n const compliance = useTheComplianceCerts(\n effectiveAssetId || undefined,\n undefined,\n undefined,\n PAGE\n );\n const contracts = useTheContracts({ commodity: asset.data?.commodity, pagination: PAGE });\n\n // Pick the contract most likely to carry a delivered shipment for this\n // commodity: prefer one that has already delivered volume (SELL first), else\n // the most recent. Its nested shipments give us the movement + delivery nodes.\n const pickedContractId = useMemo(() => {\n const rows = [...(contracts.data?.items ?? [])].sort(byDateDesc((c) => c.createdAt));\n const pick =\n rows.find((c) => c.deliveredVolume > 0 && c.side === 'SELL') ??\n rows.find((c) => c.deliveredVolume > 0) ??\n rows.find((c) => c.side === 'SELL') ??\n rows[0];\n return pick?.id;\n }, [contracts.data]);\n\n const contractDetail = useTheContract(pickedContractId);\n\n // ── Derive the chain from real linked records ──────────────────────────────\n const productionRecords = useMemo(\n () => [...(asset.data?.productionRecords ?? [])].sort(byDateDesc((r) => r.periodEnd)),\n [asset.data]\n );\n const latestProduction: TheProductionRecord | undefined = productionRecords[0];\n\n const assetLots = useMemo<TheInventoryLot[]>(\n () =>\n (inventory.data?.items ?? [])\n .filter((l) => l.assetId === effectiveAssetId)\n .sort(byDateDesc((l) => l.producedAt)),\n [inventory.data, effectiveAssetId]\n );\n const latestLot: TheInventoryLot | undefined = assetLots[0];\n\n const shipments = useMemo<TheShipment[]>(\n () => contractDetail.data?.shipments ?? [],\n [contractDetail.data]\n );\n const deliveredShipment = useMemo<TheShipment | undefined>(\n () =>\n [...shipments]\n .filter((s) => s.status === 'DELIVERED')\n .sort(byDateDesc((s) => s.deliveredAt))[0],\n [shipments]\n );\n const primaryShipment = useMemo<TheShipment | undefined>(\n () =>\n deliveredShipment ?? [...shipments].sort(byDateDesc((s) => s.departedAt ?? s.scheduledAt))[0],\n [deliveredShipment, shipments]\n );\n const pickedContract = useMemo(\n () => contracts.data?.items.find((c) => c.id === pickedContractId),\n [contracts.data, pickedContractId]\n );\n\n const certRows = useMemo(() => compliance.data?.items ?? [], [compliance.data]);\n const custodyCert = useMemo(\n () =>\n certRows.find((c) => c.category === 'CHAIN_OF_CUSTODY') ??\n certRows.find((c) => c.status === 'APPROVED') ??\n certRows[0],\n [certRows]\n );\n const certApproved = custodyCert?.status === 'APPROVED';\n\n const emissionRows = useMemo(() => emissions.data?.items ?? [], [emissions.data]);\n const totalTonnes = emissionRows.reduce((sum, e) => sum + (e.co2eTonnes ?? 0), 0);\n const verifiedEmissions = emissionRows.filter((e) => e.verified).length;\n\n const a = asset.data;\n\n // Stage completeness, in chain order.\n const completeFlags = [\n Boolean(a),\n productionRecords.length > 0,\n assetLots.length > 0,\n Boolean(primaryShipment),\n Boolean(deliveredShipment),\n certApproved,\n ];\n const completeCount = completeFlags.filter(Boolean).length;\n const firstIncomplete = completeFlags.findIndex((f) => !f);\n const current = firstIncomplete === -1 ? completeFlags.length : firstIncomplete;\n const verified = certApproved && Boolean(deliveredShipment);\n\n const stateFor = (i: number): PathStepState =>\n completeFlags[i] ? 'done' : i === current ? 'active' : 'todo';\n\n const progressSteps: StepProgressStep[] = [\n { label: 'Asset', description: 'Origin' },\n { label: 'Production', description: 'Extracted' },\n { label: 'Inventory', description: 'Lotted' },\n { label: 'Shipment', description: 'In transit' },\n { label: 'Delivered', description: 'Received' },\n { label: 'Certificate', description: 'Verified' },\n ];\n\n const shipmentRoute =\n primaryShipment && (primaryShipment.origin || primaryShipment.destination)\n ? [primaryShipment.origin, primaryShipment.destination].filter(Boolean).join(' → ')\n : undefined;\n\n const nodes: ChainNodeVM[] = a\n ? [\n {\n step: 1,\n icon: <MapPin />,\n label: 'Asset',\n primary: a.name,\n secondary: a.location ?? formatCoords(a.latitude, a.longitude),\n badge: <StatusBadge status={a.status} />,\n state: stateFor(0),\n present: true,\n },\n {\n step: 2,\n icon: <Gauge />,\n label: 'Production',\n primary: latestProduction\n ? formatVolume(latestProduction.volume, latestProduction.unit)\n : 'Not yet recorded',\n secondary: latestProduction\n ? `${formatDate(latestProduction.periodStart)} – ${formatDate(latestProduction.periodEnd)}`\n : undefined,\n state: stateFor(1),\n present: Boolean(latestProduction),\n },\n {\n step: 3,\n icon: <Boxes />,\n label: 'Inventory lot',\n primary: latestLot ? latestLot.lotCode : 'No lot yet',\n secondary: latestLot ? formatVolume(latestLot.quantity, latestLot.unit) : undefined,\n badge: latestLot ? <StatusBadge status={latestLot.status} /> : undefined,\n state: stateFor(2),\n present: Boolean(latestLot),\n },\n {\n step: 4,\n icon: <Ship />,\n label: 'Shipment',\n primary: primaryShipment ? primaryShipment.reference : 'Not shipped',\n secondary: primaryShipment\n ? [formatEnumLabel(primaryShipment.mode), shipmentRoute].filter(Boolean).join(' · ')\n : undefined,\n badge: primaryShipment ? <StatusBadge status={primaryShipment.status} /> : undefined,\n fileId: primaryShipment?.document?.id,\n state: stateFor(3),\n present: Boolean(primaryShipment),\n },\n {\n step: 5,\n icon: <CheckCircle2 />,\n label: 'Delivered',\n primary: deliveredShipment\n ? formatVolume(deliveredShipment.volume, deliveredShipment.unit)\n : 'Awaiting delivery',\n secondary: deliveredShipment\n ? [\n deliveredShipment.deliveredAt ? formatDate(deliveredShipment.deliveredAt) : null,\n pickedContract ? `Contract ${pickedContract.reference}` : null,\n ]\n .filter(Boolean)\n .join(' · ') || undefined\n : undefined,\n state: stateFor(4),\n present: Boolean(deliveredShipment),\n },\n {\n step: 6,\n icon: <ShieldCheck />,\n label: 'Certificate',\n primary: custodyCert ? (custodyCert.certNumber ?? custodyCert.title) : 'No certificate',\n secondary: custodyCert ? formatEnumLabel(custodyCert.category) : undefined,\n badge: custodyCert ? <StatusBadge status={custodyCert.status} /> : undefined,\n fileId: custodyCert?.evidence?.id,\n state: stateFor(5),\n present: Boolean(custodyCert),\n },\n ]\n : [];\n\n // ── Timeline (real dated events, ascending) ────────────────────────────────\n const timelineItems = useMemo<TimelineItem[]>(() => {\n if (!a) return [];\n const raw: { date: string; item: Omit<TimelineItem, 'time'> }[] = [];\n const push = (date: string | null | undefined, item: Omit<TimelineItem, 'time'>) => {\n if (!date) return;\n const t = new Date(date).getTime();\n if (Number.isNaN(t)) return;\n raw.push({ date, item });\n };\n\n push(a.commissionedAt ?? a.createdAt, {\n title: 'Asset registered',\n meta: a.name,\n tone: 'accent',\n icon: <MapPin className=\"h-3 w-3\" />,\n });\n if (latestProduction) {\n push(latestProduction.periodEnd ?? latestProduction.createdAt, {\n title: 'Production recorded',\n meta: formatVolume(latestProduction.volume, latestProduction.unit),\n tone: 'info',\n icon: <Gauge className=\"h-3 w-3\" />,\n });\n }\n if (latestLot) {\n push(latestLot.producedAt ?? latestLot.createdAt, {\n title: 'Inventory lot created',\n meta: `${latestLot.lotCode} · ${formatVolume(latestLot.quantity, latestLot.unit)}`,\n tone: 'info',\n icon: <Boxes className=\"h-3 w-3\" />,\n });\n }\n if (primaryShipment) {\n push(primaryShipment.departedAt ?? primaryShipment.scheduledAt ?? primaryShipment.createdAt, {\n title: primaryShipment.departedAt ? 'Shipment departed' : 'Shipment scheduled',\n meta: [primaryShipment.reference, shipmentRoute].filter(Boolean).join(' · '),\n tone: 'accent',\n icon: <Ship className=\"h-3 w-3\" />,\n });\n }\n if (deliveredShipment?.deliveredAt) {\n push(deliveredShipment.deliveredAt, {\n title: 'Delivered',\n meta: formatVolume(deliveredShipment.volume, deliveredShipment.unit),\n tone: 'success',\n icon: <CheckCircle2 className=\"h-3 w-3\" />,\n });\n }\n if (custodyCert) {\n push(custodyCert.issuedAt ?? custodyCert.createdAt, {\n title: certApproved ? 'Certificate approved' : 'Certificate registered',\n meta: custodyCert.certNumber ?? custodyCert.title,\n tone: certApproved ? 'success' : 'warning',\n icon: <ShieldCheck className=\"h-3 w-3\" />,\n });\n }\n\n return raw\n .sort((x, y) => new Date(x.date).getTime() - new Date(y.date).getTime())\n .map(({ date, item }) => ({ ...item, time: formatDate(date) }));\n }, [\n a,\n latestProduction,\n latestLot,\n primaryShipment,\n deliveredShipment,\n custodyCert,\n certApproved,\n shipmentRoute,\n ]);\n\n const originPoint =\n a && typeof a.latitude === 'number' && typeof a.longitude === 'number'\n ? { lat: a.latitude, lng: a.longitude, label: a.name, primary: true }\n : null;\n\n const description =\n 'Pit to port to certificate — end-to-end traceability from origin to verified certificate.';\n\n // ── Render ─────────────────────────────────────────────────────────────────\n if (assets.isLoading && assetRows.length === 0) {\n return (\n <PageLayout title=\"Provenance\" description={description}>\n <LoadingView label=\"Loading assets…\" />\n </PageLayout>\n );\n }\n if (assets.isError) {\n return (\n <PageLayout title=\"Provenance\" description={description}>\n <ErrorView message=\"Couldn't load assets to trace.\" onRetry={() => assets.refetch()} />\n </PageLayout>\n );\n }\n if (assetRows.length === 0) {\n return (\n <PageLayout title=\"Provenance\" description={description}>\n <EmptyState\n illustration=\"empty-data\"\n icon={<Link2 className=\"h-10 w-10\" />}\n title=\"No assets to trace\"\n description=\"Register a resource asset to build its end-to-end chain of custody.\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('assets')}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n Go to assets\n </button>\n }\n />\n </PageLayout>\n );\n }\n\n return (\n <PageLayout title=\"Provenance\" description={description}>\n {/* Control bar: asset picker + trust state */}\n <GlassCard\n treatment=\"glass\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between\"\n >\n <div className=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <label\n htmlFor=\"provenance-asset\"\n className=\"text-xs font-medium uppercase tracking-wide text-text-tertiary\"\n >\n Trace asset\n </label>\n <Select value={effectiveAssetId} onValueChange={setSelectedAssetId}>\n <SelectTrigger\n id=\"provenance-asset\"\n className=\"h-10 w-full sm:w-96\"\n aria-label=\"Select an asset to trace\"\n >\n <SelectValue placeholder=\"Select an asset to trace\" />\n </SelectTrigger>\n <SelectContent>\n {assetRows.map((row) => (\n <SelectItem key={row.id} value={row.id}>\n {row.name} · {formatEnumLabel(row.commodity)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div\n className={cn(\n 'flex items-center gap-2 self-start rounded-full px-3.5 py-1.5 text-sm font-medium',\n verified\n ? 'bg-status-success-bg-subtle text-status-success-text'\n : 'bg-bg-sunken text-text-secondary'\n )}\n >\n {verified ? <ShieldCheck className=\"h-4 w-4\" /> : <Shield className=\"h-4 w-4\" />}\n {verified ? 'Chain of custody verified' : `Traceability in progress · ${completeCount}/6`}\n </div>\n </GlassCard>\n\n {asset.isLoading ? (\n <div className=\"mt-6\">\n <LoadingView label=\"Assembling chain of custody…\" />\n </div>\n ) : asset.isError || !a ? (\n <div className=\"mt-6\">\n <ErrorView\n message=\"Couldn't load this asset's provenance.\"\n onRetry={() => asset.refetch()}\n />\n </div>\n ) : (\n <>\n {/* Flow ribbon */}\n <GlassCard treatment=\"glass\" className=\"mt-6 p-5\">\n <StepProgress steps={progressSteps} current={current} />\n </GlassCard>\n\n {/* Chain nodes */}\n <div className=\"mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6\">\n {nodes.map((node) => (\n <ChainNodeCard key={node.step} node={node} />\n ))}\n </div>\n\n {/* Timeline + origin */}\n <div className=\"mt-6 grid grid-cols-1 gap-6 lg:grid-cols-3\">\n <GlassCard treatment=\"glass\" className=\"p-5 lg:col-span-2\">\n <div className=\"mb-4 flex items-center gap-2.5\">\n <span className=\"flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent\">\n <Route className=\"h-4 w-4\" />\n </span>\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">\n Traceability timeline\n </h2>\n <p className=\"text-xs text-text-tertiary\">\n Recorded custody events, oldest to newest.\n </p>\n </div>\n </div>\n {timelineItems.length > 0 ? (\n <Timeline items={timelineItems} />\n ) : (\n <div className=\"rounded-xl border border-dashed border-border-seam py-8 text-center text-sm text-text-secondary\">\n No dated custody events yet.\n </div>\n )}\n </GlassCard>\n\n <GlassCard treatment=\"glass\" className=\"flex flex-col gap-4 p-5\">\n <div className=\"flex items-center gap-2.5\">\n <span className=\"flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent\">\n <MapPin className=\"h-4 w-4\" />\n </span>\n <div className=\"min-w-0\">\n <h2 className=\"text-base font-semibold text-text-primary\">Origin</h2>\n <p className=\"truncate text-xs text-text-tertiary\">\n {a.location ?? formatEnumLabel(a.kind)}\n </p>\n </div>\n </div>\n {originPoint ? (\n <WorldMap points={[originPoint]} />\n ) : (\n <div className=\"rounded-xl border border-dashed border-border-seam py-8 text-center text-sm text-text-secondary\">\n No coordinates recorded for this asset.\n </div>\n )}\n </GlassCard>\n </div>\n\n {/* Provenance summary */}\n <GlassCard treatment=\"glass\" className=\"mt-6 p-5\">\n <h2 className=\"mb-4 text-base font-semibold text-text-primary\">Provenance summary</h2>\n <div className=\"grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6\">\n <SummaryCell\n icon={<Fuel />}\n label=\"Commodity\"\n value={formatEnumLabel(a.commodity)}\n caption={formatEnumLabel(a.kind)}\n />\n <SummaryCell\n icon={<MapPin />}\n label=\"Origin\"\n value={a.location ?? a.name}\n caption={formatCoords(a.latitude, a.longitude)}\n />\n <SummaryCell\n icon={<Gauge />}\n label=\"Production\"\n value={`${formatNumber(productionRecords.length)} records`}\n caption={\n latestProduction\n ? `Latest ${formatVolume(latestProduction.volume, latestProduction.unit)}`\n : 'None yet'\n }\n />\n <SummaryCell\n icon={<Boxes />}\n label=\"Inventory\"\n value={`${formatNumber(assetLots.length)} lots`}\n caption={latestLot ? latestLot.lotCode : 'None yet'}\n />\n <SummaryCell\n icon={<Factory />}\n label=\"Emissions\"\n value={emissions.isError ? '—' : formatTonnesCo2e(totalTonnes)}\n caption={`${verifiedEmissions} verified`}\n />\n <SummaryCell\n icon={<ShieldCheck />}\n label=\"Certificates\"\n value={`${formatNumber(certRows.length)} tracked`}\n caption={\n certApproved ? 'Custody approved' : custodyCert ? 'Under review' : 'None yet'\n }\n />\n </div>\n </GlassCard>\n\n {/* Reserves footnote — surface proved reserves when present */}\n {(a.reserveEstimates?.length ?? 0) > 0 && (\n <p className=\"mt-4 flex items-center gap-1.5 text-xs text-text-tertiary\">\n <Layers className=\"h-3.5 w-3.5\" />\n {formatNumber(a.reserveEstimates?.length ?? 0)} reserve estimate\n {(a.reserveEstimates?.length ?? 0) === 1 ? '' : 's'} on record for this asset.\n </p>\n )}\n </>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgFA,IAAM,IAA0B,EAAE,OAAO,KAAK;AAG9C,SAAS,EAA4C,GAA6C;AAChG,SAAQ,GAAM,MAAiB;EAC7B,IAAM,IAAK,IAAI,KAAK,EAAK,EAAE,IAAI,EAAE,UAAU,CAAC,SAAS;AAErD,SADW,IAAI,KAAK,EAAK,EAAE,IAAI,EAAE,UAAU,CAAC,SAAS,GACzC;;;AAmBhB,IAAM,IAA8C;CAClD,MAAM;CACN,QAAQ;CACR,MAAM;CACN,QAAQ;CACT,EAEK,IAA4C;CAChD,MAAM;CACN,QAAQ;CACR,MAAM;CACN,QAAQ;CACT,EAEK,IAA2C;CAC/C,MAAM;CACN,QAAQ;CACR,MAAM;CACN,QAAQ;CACT;AAED,SAAS,GAAc,EAAE,WAA+B;AACtD,QACE,kBAAC,GAAD;EACE,WAAU;EACV,WAAW,EACT,6DACA,EAAK,UAAU,UAAU,6DACzB,EAAK,UAAU,YAAY,uDAC5B;YANH;GAQE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KACE,WAAW,EACT,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AkB;OAC9B,CAAA;MACF,kBAAC,GAAD;OACE,MAAM,kBAAC,GAAD,EAAe,CAAA;OACrB,OAAM;OACN,OAAO,GAAG,EAAa,EAAS,OAAO,CAAC;OACxC,SACE,IAAe,qBAAqB,IAAc,iBAAiB;OAErE,CAAA;MACE;OACI;;IAGV,EAAE,kBAAkB,UAAU,KAAK,KACnC,kBAAC,KAAD;IAAG,WAAU;cAAb;KACE,kBAAC,IAAD,EAAQ,WAAU,eAAgB,CAAA;KACjC,EAAa,EAAE,kBAAkB,UAAU,EAAE;KAAC;MAC7C,EAAE,kBAAkB,UAAU,OAAO,IAAI,KAAK;KAAI;KAClD;;GAEL,EAAA,CAAA,CAEM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-theglobalfuel",
3
- "version": "2026.705.4",
3
+ "version": "2026.705.5",
4
4
  "description": "Burdenoff TheGlobalFuel Microfrontend — Energy, Mineral & Commodity Resource operating system",
5
5
  "type": "module",
6
6
  "files": [