@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
@@ -1,26 +1,26 @@
1
1
  import { useTheGlobalFuel as e } from "../../context/TheGlobalFuelContext.js";
2
- import { PageLayout as t } from "../../components/PageLayout.js";
3
- import { formatEnumLabel as n, formatPercent as ee, formatRelativeTime as te, formatVolume as ne } from "../../utils/formatters.js";
4
- import { StatusBadge as re } from "../../components/StatusBadge.js";
5
- import { DataTable as r } from "../../components/DataTable.js";
6
- import { ErrorView as i, LoadingView as a } from "../../components/StateViews.js";
7
- import { EmptyState as o } from "../../components/EmptyState.js";
2
+ import { PageLayout as ee } from "../../components/PageLayout.js";
3
+ import { formatEnumLabel as t, formatPercent as n, formatRelativeTime as te, formatVolume as ne, toBackendDate as re } from "../../utils/formatters.js";
4
+ import { StatusBadge as ie } from "../../components/StatusBadge.js";
5
+ import { DataTable as ae } from "../../components/DataTable.js";
6
+ import { ErrorView as oe, LoadingView as se } from "../../components/StateViews.js";
7
+ import { EmptyState as r } from "../../components/EmptyState.js";
8
8
  import "../../context/index.js";
9
- import { useTheAssets as s, useTheCreateAsset as c } from "../../hooks/useTheGlobalFuelApi.js";
10
- import { useCursorPager as l } from "../../hooks/useCursorPager.js";
11
- import { useNotify as u } from "../../hooks/useNotify.js";
12
- import { useTheAnalytics as d } from "../../hooks/useTheAnalytics.js";
13
- import { useThePageView as f } from "../../hooks/useThePageView.js";
14
- import { useTheNativeControls as ie } from "../../hooks/useTheNativeControls.js";
15
- import { useTheTranslation as ae } from "../../hooks/useTheTranslation.js";
9
+ import { useTheAssets as i, useTheCreateAsset as a } from "../../hooks/useTheGlobalFuelApi.js";
10
+ import { useCursorPager as o } from "../../hooks/useCursorPager.js";
11
+ import { useNotify as s } from "../../hooks/useNotify.js";
12
+ import { useTheAnalytics as c } from "../../hooks/useTheAnalytics.js";
13
+ import { useThePageView as l } from "../../hooks/useThePageView.js";
14
+ import { useTheNativeControls as u } from "../../hooks/useTheNativeControls.js";
15
+ import { useTheTranslation as d } from "../../hooks/useTheTranslation.js";
16
16
  import "../../hooks/index.js";
17
- import { FilterTabs as oe } from "../../components/FilterTabs.js";
18
- import { Pagination as se } from "../../components/Pagination.js";
17
+ import { FilterTabs as f } from "../../components/FilterTabs.js";
18
+ import { Pagination as p } from "../../components/Pagination.js";
19
19
  import "../../components/index.js";
20
- import { useMemo as ce, useState as p } from "react";
21
- import { Fuel as m, MapPin as le, Plus as h } from "lucide-react";
22
- import { Fragment as ue, jsx as g, jsxs as _ } from "react/jsx-runtime";
23
- import { Button as v, Input as y, Label as b, ResponsiveDialog as x, ResponsiveDialogContent as S, ResponsiveDialogDescription as C, ResponsiveDialogFooter as de, ResponsiveDialogHeader as fe, ResponsiveDialogTitle as pe, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O } from "@burdenoff/fe-libs/ui";
20
+ import { useMemo as m, useState as h } from "react";
21
+ import { Fuel as g, MapPin as ce, Plus as _ } from "lucide-react";
22
+ import { Fragment as le, jsx as v, jsxs as y } from "react/jsx-runtime";
23
+ import { Button as b, Input as x, Label as S, ResponsiveDialog as ue, ResponsiveDialogContent as de, ResponsiveDialogDescription as fe, ResponsiveDialogFooter as pe, ResponsiveDialogHeader as me, ResponsiveDialogTitle as C, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O } from "@burdenoff/fe-libs/ui";
24
24
  //#region src/theglobalfuel/pages/assets/AssetsPage.tsx
25
25
  var k = [
26
26
  {
@@ -101,33 +101,37 @@ var k = [
101
101
  longitude: "",
102
102
  capacityPerDay: "",
103
103
  capacityUnit: "BARRELS",
104
- workingInterestPct: ""
104
+ workingInterestPct: "",
105
+ discoveryAt: "",
106
+ area: "",
107
+ reservoirType: "",
108
+ waterDepth: ""
105
109
  };
106
110
  function F() {
107
- f("assets");
108
- let F = ae(), { navigateTo: I } = e(), L = u(), { haptic: R } = ie(), { trackAssetCreateClicked: z, trackAssetCreated: B } = d(), [V, me] = p("ALL"), [H, he] = p("ALL"), [U, ge] = p("ALL"), W = l(), [_e, G] = p(!1), [K, q] = p(P), [J, Y] = p(null), { data: X, isLoading: ve, isError: ye, refetch: be } = s({
109
- status: V === "ALL" ? void 0 : V,
110
- commodity: H === "ALL" ? void 0 : H,
111
- kind: U === "ALL" ? void 0 : U,
111
+ l("assets");
112
+ let F = d(), { navigateTo: I } = e(), L = s(), { haptic: R } = u(), { trackAssetCreateClicked: z, trackAssetCreated: he } = c(), [B, ge] = h("ALL"), [V, _e] = h("ALL"), [H, ve] = h("ALL"), U = o(), [ye, W] = h(!1), [G, K] = h(P), [q, J] = h(null), { data: Y, isLoading: X, isError: be, refetch: xe } = i({
113
+ status: B === "ALL" ? void 0 : B,
114
+ commodity: V === "ALL" ? void 0 : V,
115
+ kind: H === "ALL" ? void 0 : H,
112
116
  pagination: {
113
117
  limit: N,
114
- offset: W.page * N
118
+ offset: U.page * N
115
119
  }
116
- }), Z = c(), Q = ce(() => X?.items ?? [], [X]), xe = V !== "ALL" || H !== "ALL" || U !== "ALL", Se = [
120
+ }), Z = a(), Q = m(() => Y?.items ?? [], [Y]), Se = B !== "ALL" || V !== "ALL" || H !== "ALL", Ce = [
117
121
  {
118
122
  key: "name",
119
123
  header: "Asset",
120
- render: (e) => /* @__PURE__ */ _("div", {
124
+ render: (e) => /* @__PURE__ */ y("div", {
121
125
  className: "flex items-center gap-3",
122
- children: [/* @__PURE__ */ g("span", {
126
+ children: [/* @__PURE__ */ v("span", {
123
127
  className: "grid size-9 shrink-0 place-items-center rounded-lg bg-bg-sunken text-text-secondary",
124
- children: /* @__PURE__ */ g(m, { className: "h-4 w-4" })
125
- }), /* @__PURE__ */ _("div", {
128
+ children: /* @__PURE__ */ v(g, { className: "h-4 w-4" })
129
+ }), /* @__PURE__ */ y("div", {
126
130
  className: "min-w-0",
127
- children: [/* @__PURE__ */ g("p", {
131
+ children: [/* @__PURE__ */ v("p", {
128
132
  className: "truncate font-semibold text-text-primary",
129
133
  children: e.name
130
- }), e.code && /* @__PURE__ */ g("p", {
134
+ }), e.code && /* @__PURE__ */ v("p", {
131
135
  className: "truncate text-xs text-text-tertiary",
132
136
  children: e.code
133
137
  })]
@@ -138,24 +142,24 @@ function F() {
138
142
  key: "kind",
139
143
  header: "Kind",
140
144
  hideOnMobile: !0,
141
- render: (e) => /* @__PURE__ */ g("span", {
145
+ render: (e) => /* @__PURE__ */ v("span", {
142
146
  className: "text-text-secondary",
143
- children: n(e.kind)
147
+ children: t(e.kind)
144
148
  })
145
149
  },
146
150
  {
147
151
  key: "commodity",
148
152
  header: "Commodity",
149
153
  hideOnMobile: !0,
150
- render: (e) => /* @__PURE__ */ g("span", {
154
+ render: (e) => /* @__PURE__ */ v("span", {
151
155
  className: "text-text-secondary",
152
- children: n(e.commodity)
156
+ children: t(e.commodity)
153
157
  })
154
158
  },
155
159
  {
156
160
  key: "status",
157
161
  header: "Status",
158
- render: (e) => /* @__PURE__ */ g(re, { status: e.status })
162
+ render: (e) => /* @__PURE__ */ v(ie, { status: e.status })
159
163
  },
160
164
  {
161
165
  key: "capacity",
@@ -163,10 +167,10 @@ function F() {
163
167
  align: "right",
164
168
  hideOnMobile: !0,
165
169
  sortValue: (e) => e.capacityPerDay,
166
- render: (e) => e.capacityPerDay > 0 ? /* @__PURE__ */ _("span", {
170
+ render: (e) => e.capacityPerDay > 0 ? /* @__PURE__ */ y("span", {
167
171
  className: "tabular-nums text-text-secondary",
168
172
  children: [ne(e.capacityPerDay, e.capacityUnit), "/day"]
169
- }) : /* @__PURE__ */ g("span", {
173
+ }) : /* @__PURE__ */ v("span", {
170
174
  className: "text-text-tertiary",
171
175
  children: "—"
172
176
  })
@@ -177,19 +181,19 @@ function F() {
177
181
  align: "right",
178
182
  hideOnMobile: !0,
179
183
  sortValue: (e) => e.workingInterestPct,
180
- render: (e) => /* @__PURE__ */ g("span", {
184
+ render: (e) => /* @__PURE__ */ v("span", {
181
185
  className: "tabular-nums text-text-secondary",
182
- children: ee(e.workingInterestPct)
186
+ children: n(e.workingInterestPct)
183
187
  })
184
188
  },
185
189
  {
186
190
  key: "location",
187
191
  header: "Location",
188
192
  hideOnMobile: !0,
189
- render: (e) => e.location ? /* @__PURE__ */ _("span", {
193
+ render: (e) => e.location ? /* @__PURE__ */ y("span", {
190
194
  className: "inline-flex items-center gap-1.5 text-text-secondary",
191
- children: [/* @__PURE__ */ g(le, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }), e.location]
192
- }) : /* @__PURE__ */ g("span", {
195
+ children: [/* @__PURE__ */ v(ce, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }), e.location]
196
+ }) : /* @__PURE__ */ v("span", {
193
197
  className: "text-text-tertiary",
194
198
  children: "—"
195
199
  })
@@ -199,222 +203,226 @@ function F() {
199
203
  header: "Updated",
200
204
  align: "right",
201
205
  hideOnMobile: !0,
202
- render: (e) => /* @__PURE__ */ g("span", {
206
+ render: (e) => /* @__PURE__ */ v("span", {
203
207
  className: "text-text-tertiary",
204
208
  children: te(e.updatedAt)
205
209
  })
206
210
  }
207
211
  ], $ = () => {
208
- q(P), Y(null);
209
- }, Ce = async () => {
210
- if (!K.name.trim()) {
211
- Y("Asset name is required.");
212
+ K(P), J(null);
213
+ }, we = async () => {
214
+ if (!G.name.trim()) {
215
+ J("Asset name is required.");
212
216
  return;
213
217
  }
214
- Y(null), R("light"), z();
218
+ J(null), R("light"), z();
215
219
  try {
216
220
  let e = await Z.mutateAsync({
217
- name: K.name.trim(),
218
- code: K.code.trim() || null,
219
- commodity: K.commodity,
220
- kind: K.kind,
221
- status: K.status,
222
- location: K.location.trim() || null,
223
- latitude: K.latitude ? Number(K.latitude) : null,
224
- longitude: K.longitude ? Number(K.longitude) : null,
225
- capacityPerDay: K.capacityPerDay ? Number(K.capacityPerDay) : null,
226
- capacityUnit: K.capacityUnit,
227
- workingInterestPct: K.workingInterestPct ? Number(K.workingInterestPct) : null
221
+ name: G.name.trim(),
222
+ code: G.code.trim() || null,
223
+ commodity: G.commodity,
224
+ kind: G.kind,
225
+ status: G.status,
226
+ location: G.location.trim() || null,
227
+ latitude: G.latitude ? Number(G.latitude) : null,
228
+ longitude: G.longitude ? Number(G.longitude) : null,
229
+ capacityPerDay: G.capacityPerDay ? Number(G.capacityPerDay) : null,
230
+ capacityUnit: G.capacityUnit,
231
+ workingInterestPct: G.workingInterestPct ? Number(G.workingInterestPct) : null,
232
+ discoveryAt: re(G.discoveryAt) || null,
233
+ area: G.area ? Number(G.area) : null,
234
+ reservoirType: G.reservoirType.trim() || null,
235
+ waterDepth: G.waterDepth ? Number(G.waterDepth) : null
228
236
  });
229
- B(e.id), L.success("Asset created"), G(!1), $(), I(`assets/${e.id}`);
237
+ he(e.id), L.success("Asset created"), W(!1), $(), I(`assets/${e.id}`);
230
238
  } catch (e) {
231
- L.fromError(e), Y(e instanceof Error ? e.message : "Failed to create asset.");
239
+ L.fromError(e), J(e instanceof Error ? e.message : "Failed to create asset.");
232
240
  }
233
241
  };
234
- return /* @__PURE__ */ _(t, {
242
+ return /* @__PURE__ */ y(ee, {
235
243
  title: F("theglobalfuel.pages.assets.title", "Assets"),
236
244
  description: F("theglobalfuel.pages.assets.description", "Resource registry — fields, wells, mines, plants, terminals & pipelines across every commodity."),
237
245
  dataTour: "theglobalfuel-assets-page",
238
- actions: /* @__PURE__ */ _(v, {
239
- onClick: () => G(!0),
240
- children: [/* @__PURE__ */ g(h, { className: "mr-1.5 h-4 w-4" }), " New asset"]
246
+ actions: /* @__PURE__ */ y(b, {
247
+ onClick: () => W(!0),
248
+ children: [/* @__PURE__ */ v(_, { className: "mr-1.5 h-4 w-4" }), " New asset"]
241
249
  }),
242
250
  children: [
243
- /* @__PURE__ */ _("div", {
251
+ /* @__PURE__ */ y("div", {
244
252
  className: "mb-5 flex flex-wrap items-center gap-3",
245
253
  children: [
246
- /* @__PURE__ */ g(oe, {
254
+ /* @__PURE__ */ v(f, {
247
255
  options: k,
248
- value: V,
256
+ value: B,
249
257
  onChange: (e) => {
250
- me(e), W.reset();
258
+ ge(e), U.reset();
251
259
  }
252
260
  }),
253
- /* @__PURE__ */ _(w, {
254
- value: H,
261
+ /* @__PURE__ */ y(w, {
262
+ value: V,
255
263
  onValueChange: (e) => {
256
- he(e), W.reset();
264
+ _e(e), U.reset();
257
265
  },
258
- children: [/* @__PURE__ */ g(D, {
266
+ children: [/* @__PURE__ */ v(D, {
259
267
  className: "w-48",
260
268
  "aria-label": "Filter by commodity",
261
- children: /* @__PURE__ */ g(O, { placeholder: "All commodities" })
262
- }), /* @__PURE__ */ _(T, { children: [/* @__PURE__ */ g(E, {
269
+ children: /* @__PURE__ */ v(O, { placeholder: "All commodities" })
270
+ }), /* @__PURE__ */ y(T, { children: [/* @__PURE__ */ v(E, {
263
271
  value: "ALL",
264
272
  children: "All commodities"
265
- }), j.map((e) => /* @__PURE__ */ g(E, {
273
+ }), j.map((e) => /* @__PURE__ */ v(E, {
266
274
  value: e,
267
- children: n(e)
275
+ children: t(e)
268
276
  }, e))] })]
269
277
  }),
270
- /* @__PURE__ */ _(w, {
271
- value: U,
278
+ /* @__PURE__ */ y(w, {
279
+ value: H,
272
280
  onValueChange: (e) => {
273
- ge(e), W.reset();
281
+ ve(e), U.reset();
274
282
  },
275
- children: [/* @__PURE__ */ g(D, {
283
+ children: [/* @__PURE__ */ v(D, {
276
284
  className: "w-48",
277
285
  "aria-label": "Filter by kind",
278
- children: /* @__PURE__ */ g(O, { placeholder: "All kinds" })
279
- }), /* @__PURE__ */ _(T, { children: [/* @__PURE__ */ g(E, {
286
+ children: /* @__PURE__ */ v(O, { placeholder: "All kinds" })
287
+ }), /* @__PURE__ */ y(T, { children: [/* @__PURE__ */ v(E, {
280
288
  value: "ALL",
281
289
  children: "All kinds"
282
- }), A.map((e) => /* @__PURE__ */ g(E, {
290
+ }), A.map((e) => /* @__PURE__ */ v(E, {
283
291
  value: e,
284
- children: n(e)
292
+ children: t(e)
285
293
  }, e))] })]
286
294
  })
287
295
  ]
288
296
  }),
289
- ve ? /* @__PURE__ */ g(a, { label: "Loading assets…" }) : ye ? /* @__PURE__ */ g(i, {
297
+ X ? /* @__PURE__ */ v(se, { label: "Loading assets…" }) : be ? /* @__PURE__ */ v(oe, {
290
298
  message: "Couldn't load assets.",
291
- onRetry: () => be()
292
- }) : Q.length === 0 ? /* @__PURE__ */ g(o, {
299
+ onRetry: () => xe()
300
+ }) : Q.length === 0 ? /* @__PURE__ */ v(r, {
293
301
  illustration: "empty-data",
294
- icon: /* @__PURE__ */ g(m, { className: "h-10 w-10" }),
302
+ icon: /* @__PURE__ */ v(g, { className: "h-10 w-10" }),
295
303
  title: "No assets yet",
296
- description: xe ? "No assets match these filters." : "Register your first resource asset to start tracking production, reserves & emissions.",
297
- action: /* @__PURE__ */ _(v, {
298
- onClick: () => G(!0),
299
- children: [/* @__PURE__ */ g(h, { className: "mr-1.5 h-4 w-4" }), " New asset"]
304
+ description: Se ? "No assets match these filters." : "Register your first resource asset to start tracking production, reserves & emissions.",
305
+ action: /* @__PURE__ */ y(b, {
306
+ onClick: () => W(!0),
307
+ children: [/* @__PURE__ */ v(_, { className: "mr-1.5 h-4 w-4" }), " New asset"]
300
308
  })
301
- }) : /* @__PURE__ */ _(ue, { children: [/* @__PURE__ */ g(r, {
302
- columns: Se,
309
+ }) : /* @__PURE__ */ y(le, { children: [/* @__PURE__ */ v(ae, {
310
+ columns: Ce,
303
311
  rows: Q,
304
312
  rowKey: (e) => e.id,
305
313
  onRowClick: (e) => I(`assets/${e.id}`),
306
314
  rowLabel: (e) => `Open ${e.name}`
307
- }), /* @__PURE__ */ g(se, {
308
- page: W.page,
315
+ }), /* @__PURE__ */ v(p, {
316
+ page: U.page,
309
317
  pageSize: N,
310
318
  itemCount: Q.length,
311
- hasMore: X?.pageInfo?.hasMore ?? !1,
312
- onPageChange: W.onPageChange
319
+ hasMore: Y?.pageInfo?.hasMore ?? !1,
320
+ onPageChange: U.onPageChange
313
321
  })] }),
314
- /* @__PURE__ */ g(x, {
315
- open: _e,
322
+ /* @__PURE__ */ v(ue, {
323
+ open: ye,
316
324
  onOpenChange: (e) => {
317
- G(e), e || $();
325
+ W(e), e || $();
318
326
  },
319
- children: /* @__PURE__ */ _(S, { children: [
320
- /* @__PURE__ */ _(fe, { children: [/* @__PURE__ */ g(pe, { children: "New asset" }), /* @__PURE__ */ g(C, { children: "Register a resource asset — a field, well, mine, plant, terminal or pipeline." })] }),
321
- /* @__PURE__ */ _("form", {
327
+ children: /* @__PURE__ */ y(de, { children: [
328
+ /* @__PURE__ */ y(me, { children: [/* @__PURE__ */ v(C, { children: "New asset" }), /* @__PURE__ */ v(fe, { children: "Register a resource asset — a field, well, mine, plant, terminal or pipeline." })] }),
329
+ /* @__PURE__ */ y("form", {
322
330
  id: "createAssetForm",
323
331
  onSubmit: (e) => {
324
- e.preventDefault(), Ce();
332
+ e.preventDefault(), we();
325
333
  },
326
334
  className: "grid gap-4 py-2",
327
335
  children: [
328
- /* @__PURE__ */ _("div", {
336
+ /* @__PURE__ */ y("div", {
329
337
  className: "grid gap-2 sm:grid-cols-2",
330
- children: [/* @__PURE__ */ _("div", {
338
+ children: [/* @__PURE__ */ y("div", {
331
339
  className: "grid gap-1.5",
332
- children: [/* @__PURE__ */ g(b, {
340
+ children: [/* @__PURE__ */ v(S, {
333
341
  htmlFor: "assetName",
334
342
  children: "Name *"
335
- }), /* @__PURE__ */ g(y, {
343
+ }), /* @__PURE__ */ v(x, {
336
344
  id: "assetName",
337
- value: K.name,
338
- onChange: (e) => q({
339
- ...K,
345
+ value: G.name,
346
+ onChange: (e) => K({
347
+ ...G,
340
348
  name: e.target.value
341
349
  }),
342
350
  placeholder: "Rumaila North Field"
343
351
  })]
344
- }), /* @__PURE__ */ _("div", {
352
+ }), /* @__PURE__ */ y("div", {
345
353
  className: "grid gap-1.5",
346
- children: [/* @__PURE__ */ g(b, {
354
+ children: [/* @__PURE__ */ v(S, {
347
355
  htmlFor: "assetCode",
348
356
  children: "Code"
349
- }), /* @__PURE__ */ g(y, {
357
+ }), /* @__PURE__ */ v(x, {
350
358
  id: "assetCode",
351
- value: K.code,
352
- onChange: (e) => q({
353
- ...K,
359
+ value: G.code,
360
+ onChange: (e) => K({
361
+ ...G,
354
362
  code: e.target.value
355
363
  }),
356
364
  placeholder: "AST-RMB-N"
357
365
  })]
358
366
  })]
359
367
  }),
360
- /* @__PURE__ */ _("div", {
368
+ /* @__PURE__ */ y("div", {
361
369
  className: "grid gap-2 sm:grid-cols-3",
362
370
  children: [
363
- /* @__PURE__ */ _("div", {
371
+ /* @__PURE__ */ y("div", {
364
372
  className: "grid gap-1.5",
365
- children: [/* @__PURE__ */ g(b, {
373
+ children: [/* @__PURE__ */ v(S, {
366
374
  htmlFor: "assetCommodity",
367
375
  children: "Commodity *"
368
- }), /* @__PURE__ */ _(w, {
369
- value: K.commodity,
370
- onValueChange: (e) => q({
371
- ...K,
376
+ }), /* @__PURE__ */ y(w, {
377
+ value: G.commodity,
378
+ onValueChange: (e) => K({
379
+ ...G,
372
380
  commodity: e
373
381
  }),
374
- children: [/* @__PURE__ */ g(D, {
382
+ children: [/* @__PURE__ */ v(D, {
375
383
  id: "assetCommodity",
376
- children: /* @__PURE__ */ g(O, {})
377
- }), /* @__PURE__ */ g(T, { children: j.map((e) => /* @__PURE__ */ g(E, {
384
+ children: /* @__PURE__ */ v(O, {})
385
+ }), /* @__PURE__ */ v(T, { children: j.map((e) => /* @__PURE__ */ v(E, {
378
386
  value: e,
379
- children: n(e)
387
+ children: t(e)
380
388
  }, e)) })]
381
389
  })]
382
390
  }),
383
- /* @__PURE__ */ _("div", {
391
+ /* @__PURE__ */ y("div", {
384
392
  className: "grid gap-1.5",
385
- children: [/* @__PURE__ */ g(b, {
393
+ children: [/* @__PURE__ */ v(S, {
386
394
  htmlFor: "assetKind",
387
395
  children: "Kind"
388
- }), /* @__PURE__ */ _(w, {
389
- value: K.kind,
390
- onValueChange: (e) => q({
391
- ...K,
396
+ }), /* @__PURE__ */ y(w, {
397
+ value: G.kind,
398
+ onValueChange: (e) => K({
399
+ ...G,
392
400
  kind: e
393
401
  }),
394
- children: [/* @__PURE__ */ g(D, {
402
+ children: [/* @__PURE__ */ v(D, {
395
403
  id: "assetKind",
396
- children: /* @__PURE__ */ g(O, {})
397
- }), /* @__PURE__ */ g(T, { children: A.map((e) => /* @__PURE__ */ g(E, {
404
+ children: /* @__PURE__ */ v(O, {})
405
+ }), /* @__PURE__ */ v(T, { children: A.map((e) => /* @__PURE__ */ v(E, {
398
406
  value: e,
399
- children: n(e)
407
+ children: t(e)
400
408
  }, e)) })]
401
409
  })]
402
410
  }),
403
- /* @__PURE__ */ _("div", {
411
+ /* @__PURE__ */ y("div", {
404
412
  className: "grid gap-1.5",
405
- children: [/* @__PURE__ */ g(b, {
413
+ children: [/* @__PURE__ */ v(S, {
406
414
  htmlFor: "assetStatus",
407
415
  children: "Status"
408
- }), /* @__PURE__ */ _(w, {
409
- value: K.status,
410
- onValueChange: (e) => q({
411
- ...K,
416
+ }), /* @__PURE__ */ y(w, {
417
+ value: G.status,
418
+ onValueChange: (e) => K({
419
+ ...G,
412
420
  status: e
413
421
  }),
414
- children: [/* @__PURE__ */ g(D, {
422
+ children: [/* @__PURE__ */ v(D, {
415
423
  id: "assetStatus",
416
- children: /* @__PURE__ */ g(O, {})
417
- }), /* @__PURE__ */ g(T, { children: k.filter((e) => e.value !== "ALL").map((e) => /* @__PURE__ */ g(E, {
424
+ children: /* @__PURE__ */ v(O, {})
425
+ }), /* @__PURE__ */ v(T, { children: k.filter((e) => e.value !== "ALL").map((e) => /* @__PURE__ */ v(E, {
418
426
  value: e.value,
419
427
  children: e.label
420
428
  }, e.value)) })]
@@ -422,112 +430,112 @@ function F() {
422
430
  })
423
431
  ]
424
432
  }),
425
- /* @__PURE__ */ _("div", {
433
+ /* @__PURE__ */ y("div", {
426
434
  className: "grid gap-1.5",
427
- children: [/* @__PURE__ */ g(b, {
435
+ children: [/* @__PURE__ */ v(S, {
428
436
  htmlFor: "assetLocation",
429
437
  children: "Location"
430
- }), /* @__PURE__ */ g(y, {
438
+ }), /* @__PURE__ */ v(x, {
431
439
  id: "assetLocation",
432
- value: K.location,
433
- onChange: (e) => q({
434
- ...K,
440
+ value: G.location,
441
+ onChange: (e) => K({
442
+ ...G,
435
443
  location: e.target.value
436
444
  }),
437
445
  placeholder: "Basra, Iraq"
438
446
  })]
439
447
  }),
440
- /* @__PURE__ */ _("div", {
448
+ /* @__PURE__ */ y("div", {
441
449
  className: "grid gap-2 sm:grid-cols-2",
442
- children: [/* @__PURE__ */ _("div", {
450
+ children: [/* @__PURE__ */ y("div", {
443
451
  className: "grid gap-1.5",
444
- children: [/* @__PURE__ */ g(b, {
452
+ children: [/* @__PURE__ */ v(S, {
445
453
  htmlFor: "assetLat",
446
454
  children: "Latitude"
447
- }), /* @__PURE__ */ g(y, {
455
+ }), /* @__PURE__ */ v(x, {
448
456
  id: "assetLat",
449
457
  type: "number",
450
458
  step: "any",
451
- value: K.latitude,
452
- onChange: (e) => q({
453
- ...K,
459
+ value: G.latitude,
460
+ onChange: (e) => K({
461
+ ...G,
454
462
  latitude: e.target.value
455
463
  }),
456
464
  placeholder: "30.5085"
457
465
  })]
458
- }), /* @__PURE__ */ _("div", {
466
+ }), /* @__PURE__ */ y("div", {
459
467
  className: "grid gap-1.5",
460
- children: [/* @__PURE__ */ g(b, {
468
+ children: [/* @__PURE__ */ v(S, {
461
469
  htmlFor: "assetLng",
462
470
  children: "Longitude"
463
- }), /* @__PURE__ */ g(y, {
471
+ }), /* @__PURE__ */ v(x, {
464
472
  id: "assetLng",
465
473
  type: "number",
466
474
  step: "any",
467
- value: K.longitude,
468
- onChange: (e) => q({
469
- ...K,
475
+ value: G.longitude,
476
+ onChange: (e) => K({
477
+ ...G,
470
478
  longitude: e.target.value
471
479
  }),
472
480
  placeholder: "47.7804"
473
481
  })]
474
482
  })]
475
483
  }),
476
- /* @__PURE__ */ _("div", {
484
+ /* @__PURE__ */ y("div", {
477
485
  className: "grid gap-2 sm:grid-cols-3",
478
486
  children: [
479
- /* @__PURE__ */ _("div", {
487
+ /* @__PURE__ */ y("div", {
480
488
  className: "grid gap-1.5 sm:col-span-1",
481
- children: [/* @__PURE__ */ g(b, {
489
+ children: [/* @__PURE__ */ v(S, {
482
490
  htmlFor: "assetCapacity",
483
491
  children: "Capacity / day"
484
- }), /* @__PURE__ */ g(y, {
492
+ }), /* @__PURE__ */ v(x, {
485
493
  id: "assetCapacity",
486
494
  type: "number",
487
495
  min: "0",
488
496
  step: "any",
489
- value: K.capacityPerDay,
490
- onChange: (e) => q({
491
- ...K,
497
+ value: G.capacityPerDay,
498
+ onChange: (e) => K({
499
+ ...G,
492
500
  capacityPerDay: e.target.value
493
501
  }),
494
502
  placeholder: "120000"
495
503
  })]
496
504
  }),
497
- /* @__PURE__ */ _("div", {
505
+ /* @__PURE__ */ y("div", {
498
506
  className: "grid gap-1.5",
499
- children: [/* @__PURE__ */ g(b, {
507
+ children: [/* @__PURE__ */ v(S, {
500
508
  htmlFor: "assetUnit",
501
509
  children: "Capacity unit"
502
- }), /* @__PURE__ */ _(w, {
503
- value: K.capacityUnit,
504
- onValueChange: (e) => q({
505
- ...K,
510
+ }), /* @__PURE__ */ y(w, {
511
+ value: G.capacityUnit,
512
+ onValueChange: (e) => K({
513
+ ...G,
506
514
  capacityUnit: e
507
515
  }),
508
- children: [/* @__PURE__ */ g(D, {
516
+ children: [/* @__PURE__ */ v(D, {
509
517
  id: "assetUnit",
510
- children: /* @__PURE__ */ g(O, {})
511
- }), /* @__PURE__ */ g(T, { children: M.map((e) => /* @__PURE__ */ g(E, {
518
+ children: /* @__PURE__ */ v(O, {})
519
+ }), /* @__PURE__ */ v(T, { children: M.map((e) => /* @__PURE__ */ v(E, {
512
520
  value: e,
513
- children: n(e)
521
+ children: t(e)
514
522
  }, e)) })]
515
523
  })]
516
524
  }),
517
- /* @__PURE__ */ _("div", {
525
+ /* @__PURE__ */ y("div", {
518
526
  className: "grid gap-1.5",
519
- children: [/* @__PURE__ */ g(b, {
527
+ children: [/* @__PURE__ */ v(S, {
520
528
  htmlFor: "assetWi",
521
529
  children: "Working interest (%)"
522
- }), /* @__PURE__ */ g(y, {
530
+ }), /* @__PURE__ */ v(x, {
523
531
  id: "assetWi",
524
532
  type: "number",
525
533
  min: "0",
526
534
  max: "100",
527
535
  step: "any",
528
- value: K.workingInterestPct,
529
- onChange: (e) => q({
530
- ...K,
536
+ value: G.workingInterestPct,
537
+ onChange: (e) => K({
538
+ ...G,
531
539
  workingInterestPct: e.target.value
532
540
  }),
533
541
  placeholder: "47.5"
@@ -535,20 +543,90 @@ function F() {
535
543
  })
536
544
  ]
537
545
  }),
538
- J && /* @__PURE__ */ g("p", {
546
+ /* @__PURE__ */ y("div", {
547
+ className: "grid gap-2 sm:grid-cols-2",
548
+ children: [/* @__PURE__ */ y("div", {
549
+ className: "grid gap-1.5",
550
+ children: [/* @__PURE__ */ v(S, {
551
+ htmlFor: "assetDiscovery",
552
+ children: "Field discovery"
553
+ }), /* @__PURE__ */ v(x, {
554
+ id: "assetDiscovery",
555
+ type: "date",
556
+ value: G.discoveryAt,
557
+ onChange: (e) => K({
558
+ ...G,
559
+ discoveryAt: e.target.value
560
+ })
561
+ })]
562
+ }), /* @__PURE__ */ y("div", {
563
+ className: "grid gap-1.5",
564
+ children: [/* @__PURE__ */ v(S, {
565
+ htmlFor: "assetArea",
566
+ children: "Area (km²)"
567
+ }), /* @__PURE__ */ v(x, {
568
+ id: "assetArea",
569
+ type: "number",
570
+ min: "0",
571
+ step: "any",
572
+ value: G.area,
573
+ onChange: (e) => K({
574
+ ...G,
575
+ area: e.target.value
576
+ }),
577
+ placeholder: "2600"
578
+ })]
579
+ })]
580
+ }),
581
+ /* @__PURE__ */ y("div", {
582
+ className: "grid gap-2 sm:grid-cols-2",
583
+ children: [/* @__PURE__ */ y("div", {
584
+ className: "grid gap-1.5",
585
+ children: [/* @__PURE__ */ v(S, {
586
+ htmlFor: "assetReservoirType",
587
+ children: "Reservoir type"
588
+ }), /* @__PURE__ */ v(x, {
589
+ id: "assetReservoirType",
590
+ value: G.reservoirType,
591
+ onChange: (e) => K({
592
+ ...G,
593
+ reservoirType: e.target.value
594
+ }),
595
+ placeholder: "Carbonate"
596
+ })]
597
+ }), /* @__PURE__ */ y("div", {
598
+ className: "grid gap-1.5",
599
+ children: [/* @__PURE__ */ v(S, {
600
+ htmlFor: "assetWaterDepth",
601
+ children: "Water depth (m)"
602
+ }), /* @__PURE__ */ v(x, {
603
+ id: "assetWaterDepth",
604
+ type: "number",
605
+ min: "0",
606
+ step: "any",
607
+ value: G.waterDepth,
608
+ onChange: (e) => K({
609
+ ...G,
610
+ waterDepth: e.target.value
611
+ }),
612
+ placeholder: "Leave blank for onshore"
613
+ })]
614
+ })]
615
+ }),
616
+ q && /* @__PURE__ */ v("p", {
539
617
  className: "text-sm text-status-error-text",
540
- children: J
618
+ children: q
541
619
  })
542
620
  ]
543
621
  }),
544
- /* @__PURE__ */ _(de, { children: [/* @__PURE__ */ g(v, {
622
+ /* @__PURE__ */ y(pe, { children: [/* @__PURE__ */ v(b, {
545
623
  variant: "outline",
546
624
  type: "button",
547
625
  onClick: () => {
548
- G(!1), $();
626
+ W(!1), $();
549
627
  },
550
628
  children: "Cancel"
551
- }), /* @__PURE__ */ g(v, {
629
+ }), /* @__PURE__ */ v(b, {
552
630
  type: "submit",
553
631
  form: "createAssetForm",
554
632
  disabled: Z.isPending,