@burdenoff/microfe-theglobalfuel 2026.705.4 → 2026.709.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/index.js +3 -1
  2. package/dist/theglobalfuel/TheGlobalFuelRoutes.js +1 -1
  3. package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -1
  4. package/dist/theglobalfuel/hooks/index.js +1 -0
  5. package/dist/theglobalfuel/hooks/useTheAnalytics.js +45 -0
  6. package/dist/theglobalfuel/hooks/useTheAnalytics.js.map +1 -0
  7. package/dist/theglobalfuel/index.js +2 -0
  8. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +284 -279
  9. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -1
  10. package/dist/theglobalfuel/pages/assets/AssetsPage.js +141 -138
  11. package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -1
  12. package/dist/theglobalfuel/pages/contracts/ContractsPage.js +234 -231
  13. package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -1
  14. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +243 -238
  15. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
  16. package/dist/theglobalfuel/pages/provenance/ProvenancePage.js +13 -13
  17. package/dist/theglobalfuel/pages/provenance/ProvenancePage.js.map +1 -1
  18. package/dist/theglobalfuel/services/assistantApi.js +225 -0
  19. package/dist/theglobalfuel/services/assistantApi.js.map +1 -0
  20. package/dist/theglobalfuel/services/createSandboxAssistantTransport.js +120 -0
  21. package/dist/theglobalfuel/services/createSandboxAssistantTransport.js.map +1 -0
  22. package/dist/theglobalfuel/utils/pageContext.js +65 -0
  23. package/dist/theglobalfuel/utils/pageContext.js.map +1 -0
  24. package/package.json +5 -1
  25. package/dist/node_modules/clsx/dist/clsx.js +0 -18
  26. package/dist/node_modules/clsx/dist/clsx.js.map +0 -1
  27. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -1716
  28. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
@@ -1,24 +1,25 @@
1
1
  import { useTheGlobalFuel as e } from "../../context/TheGlobalFuelContext.js";
2
- import { PageLayout as ee } from "../../components/PageLayout.js";
3
- import { formatEnumLabel as t, formatMoney as n, formatUnit as r, formatVolume as i, toBackendDate as a } from "../../utils/formatters.js";
2
+ import { PageLayout as t } from "../../components/PageLayout.js";
3
+ import { formatEnumLabel as n, formatMoney as ee, formatUnit as r, formatVolume as i, toBackendDate as a } from "../../utils/formatters.js";
4
4
  import { StatusBadge as o } from "../../components/StatusBadge.js";
5
5
  import { MiniBar as s } from "../../components/MiniBar.js";
6
- import { DataTable as c } from "../../components/DataTable.js";
7
- import { ErrorView as l, LoadingView as u } from "../../components/StateViews.js";
8
- import { EmptyState as d } from "../../components/EmptyState.js";
6
+ import { DataTable as te } from "../../components/DataTable.js";
7
+ import { ErrorView as ne, LoadingView as re } from "../../components/StateViews.js";
8
+ import { EmptyState as ie } from "../../components/EmptyState.js";
9
9
  import "../../context/index.js";
10
- import { useTheContracts as f, useTheCreateContract as p } from "../../hooks/useTheGlobalFuelApi.js";
11
- import { useCursorPager as te } from "../../hooks/useCursorPager.js";
12
- import { useNotify as ne } from "../../hooks/useNotify.js";
10
+ import { useTheContracts as ae, useTheCreateContract as c } from "../../hooks/useTheGlobalFuelApi.js";
11
+ import { useCursorPager as oe } from "../../hooks/useCursorPager.js";
12
+ import { useNotify as se } from "../../hooks/useNotify.js";
13
+ import { useTheAnalytics as ce } from "../../hooks/useTheAnalytics.js";
13
14
  import "../../hooks/index.js";
14
- import { FilterTabs as re } from "../../components/FilterTabs.js";
15
- import { Pagination as ie } from "../../components/Pagination.js";
16
- import { useMemo as ae, useState as m } from "react";
17
- import { FileSignature as h, Plus as g } from "lucide-react";
18
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
19
- import { Button as b, Input as x, Label as S, ResponsiveDialog as oe, ResponsiveDialogContent as se, ResponsiveDialogDescription as ce, ResponsiveDialogFooter as le, ResponsiveDialogHeader as ue, ResponsiveDialogTitle as de, Select as C, SelectContent as w, SelectItem as T, SelectTrigger as E, SelectValue as D, Textarea as fe } from "@burdenoff/fe-libs/ui";
15
+ import { FilterTabs as le } from "../../components/FilterTabs.js";
16
+ import { Pagination as ue } from "../../components/Pagination.js";
17
+ import { useMemo as de, useState as l } from "react";
18
+ import { FileSignature as u, Plus as d } from "lucide-react";
19
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
20
+ import { Button as h, Input as g, Label as _, ResponsiveDialog as v, ResponsiveDialogContent as y, ResponsiveDialogDescription as b, ResponsiveDialogFooter as x, ResponsiveDialogHeader as S, ResponsiveDialogTitle as fe, Select as C, SelectContent as w, SelectItem as T, SelectTrigger as E, SelectValue as D, Textarea as O } from "@burdenoff/fe-libs/ui";
20
21
  //#region src/theglobalfuel/pages/contracts/ContractsPage.tsx
21
- var O = [
22
+ var k = [
22
23
  {
23
24
  value: "ALL",
24
25
  label: "All"
@@ -51,12 +52,12 @@ var O = [
51
52
  value: "TERMINATED",
52
53
  label: "Terminated"
53
54
  }
54
- ], k = ["BUY", "SELL"], A = [
55
+ ], A = ["BUY", "SELL"], j = [
55
56
  "FIXED",
56
57
  "INDEX_LINKED",
57
58
  "FORMULA",
58
59
  "SPOT"
59
- ], j = [
60
+ ], M = [
60
61
  "CRUDE_OIL",
61
62
  "NATURAL_GAS",
62
63
  "LNG",
@@ -70,7 +71,7 @@ var O = [
70
71
  "GOLD",
71
72
  "LITHIUM",
72
73
  "RARE_EARTH"
73
- ], M = [
74
+ ], N = [
74
75
  "BARRELS",
75
76
  "CUBIC_METERS",
76
77
  "TONNES",
@@ -78,7 +79,7 @@ var O = [
78
79
  "MWH",
79
80
  "GJ",
80
81
  "MCF"
81
- ], N = 25, P = (e) => Math.max(0, Math.min(100, e)), F = (e) => e.contractedVolume > 0 ? P(e.deliveredVolume / e.contractedVolume * 100) : 0, I = {
82
+ ], P = 25, F = (e) => Math.max(0, Math.min(100, e)), I = (e) => e.contractedVolume > 0 ? F(e.deliveredVolume / e.contractedVolume * 100) : 0, L = {
82
83
  reference: "",
83
84
  counterparty: "",
84
85
  commodity: "CRUDE_OIL",
@@ -94,30 +95,30 @@ var O = [
94
95
  endDate: "",
95
96
  notes: ""
96
97
  };
97
- function L() {
98
- let { navigateTo: P } = e(), L = ne(), [R, z] = m("ALL"), [B, V] = m("ALL"), [H, pe] = m("ALL"), U = te(), [me, W] = m(!1), [G, K] = m(I), [q, J] = m(null), { data: Y, isLoading: he, isError: ge, refetch: _e } = f({
99
- status: R === "ALL" ? void 0 : R,
100
- side: B === "ALL" ? void 0 : B,
101
- commodity: H === "ALL" ? void 0 : H,
98
+ function R() {
99
+ let { navigateTo: F } = e(), R = se(), { trackContractCreateClicked: z, trackContractCreated: B } = ce(), [V, pe] = l("ALL"), [H, me] = l("ALL"), [U, he] = l("ALL"), W = oe(), [ge, G] = l(!1), [K, q] = l(L), [J, Y] = l(null), { data: X, isLoading: _e, isError: ve, refetch: ye } = ae({
100
+ status: V === "ALL" ? void 0 : V,
101
+ side: H === "ALL" ? void 0 : H,
102
+ commodity: U === "ALL" ? void 0 : U,
102
103
  pagination: {
103
- limit: N,
104
- offset: U.page * N
104
+ limit: P,
105
+ offset: W.page * P
105
106
  }
106
- }), X = p(), Z = ae(() => Y?.items ?? [], [Y]), Q = [
107
+ }), Z = c(), Q = de(() => X?.items ?? [], [X]), be = [
107
108
  {
108
109
  key: "reference",
109
110
  header: "Contract",
110
- render: (e) => /* @__PURE__ */ y("div", {
111
+ render: (e) => /* @__PURE__ */ m("div", {
111
112
  className: "flex items-center gap-3",
112
- children: [/* @__PURE__ */ v("div", {
113
+ children: [/* @__PURE__ */ p("div", {
113
114
  className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent",
114
- children: /* @__PURE__ */ v(h, { className: "h-4 w-4" })
115
- }), /* @__PURE__ */ y("div", {
115
+ children: /* @__PURE__ */ p(u, { className: "h-4 w-4" })
116
+ }), /* @__PURE__ */ m("div", {
116
117
  className: "min-w-0",
117
- children: [/* @__PURE__ */ v("p", {
118
+ children: [/* @__PURE__ */ p("p", {
118
119
  className: "truncate font-semibold text-text-primary",
119
120
  children: e.reference
120
- }), /* @__PURE__ */ v("p", {
121
+ }), /* @__PURE__ */ p("p", {
121
122
  className: "truncate text-xs text-text-tertiary",
122
123
  children: e.counterparty
123
124
  })]
@@ -127,21 +128,21 @@ function L() {
127
128
  {
128
129
  key: "side",
129
130
  header: "Side",
130
- render: (e) => /* @__PURE__ */ v(o, { status: e.side })
131
+ render: (e) => /* @__PURE__ */ p(o, { status: e.side })
131
132
  },
132
133
  {
133
134
  key: "commodity",
134
135
  header: "Commodity",
135
136
  hideOnMobile: !0,
136
- render: (e) => /* @__PURE__ */ v("span", {
137
+ render: (e) => /* @__PURE__ */ p("span", {
137
138
  className: "text-text-secondary",
138
- children: t(e.commodity)
139
+ children: n(e.commodity)
139
140
  })
140
141
  },
141
142
  {
142
143
  key: "status",
143
144
  header: "Status",
144
- render: (e) => /* @__PURE__ */ v(o, { status: e.status })
145
+ render: (e) => /* @__PURE__ */ p(o, { status: e.status })
145
146
  },
146
147
  {
147
148
  key: "price",
@@ -149,9 +150,9 @@ function L() {
149
150
  align: "right",
150
151
  hideOnMobile: !0,
151
152
  sortValue: (e) => e.pricePerUnit,
152
- render: (e) => /* @__PURE__ */ y("span", {
153
+ render: (e) => /* @__PURE__ */ m("span", {
153
154
  className: "tabular-nums text-text-secondary",
154
- children: [n(e.pricePerUnit, e.currency), /* @__PURE__ */ y("span", {
155
+ children: [ee(e.pricePerUnit, e.currency), /* @__PURE__ */ m("span", {
155
156
  className: "text-text-tertiary",
156
157
  children: ["/", r(e.unit)]
157
158
  })]
@@ -160,14 +161,14 @@ function L() {
160
161
  {
161
162
  key: "delivery",
162
163
  header: "Delivered",
163
- sortValue: (e) => F(e),
164
- render: (e) => /* @__PURE__ */ y("div", {
164
+ sortValue: (e) => I(e),
165
+ render: (e) => /* @__PURE__ */ m("div", {
165
166
  className: "min-w-[9rem]",
166
- children: [/* @__PURE__ */ v(s, {
167
- value: F(e),
167
+ children: [/* @__PURE__ */ p(s, {
168
+ value: I(e),
168
169
  barClassName: "bg-[var(--color-status-success-text)]",
169
170
  className: "mb-1"
170
- }), /* @__PURE__ */ y("p", {
171
+ }), /* @__PURE__ */ m("p", {
171
172
  className: "text-xs tabular-nums text-text-tertiary",
172
173
  children: [
173
174
  i(e.deliveredVolume, e.unit),
@@ -182,7 +183,7 @@ function L() {
182
183
  header: "Updated",
183
184
  align: "right",
184
185
  hideOnMobile: !0,
185
- render: (e) => /* @__PURE__ */ v("span", {
186
+ render: (e) => /* @__PURE__ */ p("span", {
186
187
  className: "text-text-tertiary",
187
188
  children: new Date(e.updatedAt).toLocaleDateString(void 0, {
188
189
  day: "numeric",
@@ -192,292 +193,294 @@ function L() {
192
193
  })
193
194
  }
194
195
  ], $ = () => {
195
- K(I), J(null);
196
- }, ve = async () => {
197
- if (!G.reference.trim()) {
198
- J("Contract reference is required.");
196
+ q(L), Y(null);
197
+ }, xe = async () => {
198
+ if (!K.reference.trim()) {
199
+ Y("Contract reference is required.");
199
200
  return;
200
201
  }
201
- if (!G.counterparty.trim()) {
202
- J("Counterparty is required.");
202
+ if (!K.counterparty.trim()) {
203
+ Y("Counterparty is required.");
203
204
  return;
204
205
  }
205
- J(null);
206
+ Y(null), z();
206
207
  try {
207
- let e = await X.mutateAsync({
208
- reference: G.reference.trim(),
209
- counterparty: G.counterparty.trim(),
210
- commodity: G.commodity,
211
- side: G.side,
212
- pricingBasis: G.pricingBasis,
213
- pricePerUnit: G.pricePerUnit ? Number(G.pricePerUnit) : null,
214
- priceIndex: G.priceIndex.trim() || null,
215
- currency: G.currency.trim().toUpperCase() || "USD",
216
- contractedVolume: G.contractedVolume ? Number(G.contractedVolume) : null,
217
- unit: G.unit,
218
- deliveryLocation: G.deliveryLocation.trim() || null,
219
- startDate: a(G.startDate) ?? null,
220
- endDate: a(G.endDate) ?? null,
221
- notes: G.notes.trim() || null
208
+ let e = await Z.mutateAsync({
209
+ reference: K.reference.trim(),
210
+ counterparty: K.counterparty.trim(),
211
+ commodity: K.commodity,
212
+ side: K.side,
213
+ pricingBasis: K.pricingBasis,
214
+ pricePerUnit: K.pricePerUnit ? Number(K.pricePerUnit) : null,
215
+ priceIndex: K.priceIndex.trim() || null,
216
+ currency: K.currency.trim().toUpperCase() || "USD",
217
+ contractedVolume: K.contractedVolume ? Number(K.contractedVolume) : null,
218
+ unit: K.unit,
219
+ deliveryLocation: K.deliveryLocation.trim() || null,
220
+ startDate: a(K.startDate) ?? null,
221
+ endDate: a(K.endDate) ?? null,
222
+ notes: K.notes.trim() || null
222
223
  });
223
- L.success("Contract created"), W(!1), $(), P(`contracts/${e.id}`);
224
+ B(e.id), R.success("Contract created"), G(!1), $(), F(`contracts/${e.id}`);
224
225
  } catch (e) {
225
- J(e instanceof Error ? e.message : "Failed to create contract."), L.fromError(e);
226
+ Y(e instanceof Error ? e.message : "Failed to create contract."), R.fromError(e);
226
227
  }
227
228
  };
228
- return /* @__PURE__ */ y(ee, {
229
+ return /* @__PURE__ */ m(t, {
229
230
  title: "Offtake Contracts",
230
231
  description: "Commodity purchase & sale agreements — pricing, contracted volume and delivery progress.",
231
- actions: /* @__PURE__ */ y(b, {
232
- onClick: () => W(!0),
233
- children: [/* @__PURE__ */ v(g, { className: "mr-1.5 h-4 w-4" }), " New contract"]
232
+ actions: /* @__PURE__ */ m(h, {
233
+ onClick: () => G(!0),
234
+ "data-rybbit-event": "theglobalfuel.contract.create_clicked",
235
+ children: [/* @__PURE__ */ p(d, { className: "mr-1.5 h-4 w-4" }), " New contract"]
234
236
  }),
235
237
  children: [
236
- /* @__PURE__ */ y("div", {
238
+ /* @__PURE__ */ m("div", {
237
239
  className: "mb-5 flex flex-wrap items-center gap-3",
238
240
  children: [
239
- /* @__PURE__ */ v(re, {
240
- options: O,
241
- value: R,
241
+ /* @__PURE__ */ p(le, {
242
+ options: k,
243
+ value: V,
242
244
  onChange: (e) => {
243
- z(e), U.reset();
245
+ pe(e), W.reset();
244
246
  }
245
247
  }),
246
- /* @__PURE__ */ y(C, {
247
- value: B,
248
+ /* @__PURE__ */ m(C, {
249
+ value: H,
248
250
  onValueChange: (e) => {
249
- V(e), U.reset();
251
+ me(e), W.reset();
250
252
  },
251
- children: [/* @__PURE__ */ v(E, {
253
+ children: [/* @__PURE__ */ p(E, {
252
254
  className: "w-40",
253
255
  "aria-label": "Filter by side",
254
- children: /* @__PURE__ */ v(D, { placeholder: "All sides" })
255
- }), /* @__PURE__ */ y(w, { children: [/* @__PURE__ */ v(T, {
256
+ children: /* @__PURE__ */ p(D, { placeholder: "All sides" })
257
+ }), /* @__PURE__ */ m(w, { children: [/* @__PURE__ */ p(T, {
256
258
  value: "ALL",
257
259
  children: "All sides"
258
- }), k.map((e) => /* @__PURE__ */ v(T, {
260
+ }), A.map((e) => /* @__PURE__ */ p(T, {
259
261
  value: e,
260
- children: t(e)
262
+ children: n(e)
261
263
  }, e))] })]
262
264
  }),
263
- /* @__PURE__ */ y(C, {
264
- value: H,
265
+ /* @__PURE__ */ m(C, {
266
+ value: U,
265
267
  onValueChange: (e) => {
266
- pe(e), U.reset();
268
+ he(e), W.reset();
267
269
  },
268
- children: [/* @__PURE__ */ v(E, {
270
+ children: [/* @__PURE__ */ p(E, {
269
271
  className: "w-48",
270
272
  "aria-label": "Filter by commodity",
271
- children: /* @__PURE__ */ v(D, { placeholder: "All commodities" })
272
- }), /* @__PURE__ */ y(w, { children: [/* @__PURE__ */ v(T, {
273
+ children: /* @__PURE__ */ p(D, { placeholder: "All commodities" })
274
+ }), /* @__PURE__ */ m(w, { children: [/* @__PURE__ */ p(T, {
273
275
  value: "ALL",
274
276
  children: "All commodities"
275
- }), j.map((e) => /* @__PURE__ */ v(T, {
277
+ }), M.map((e) => /* @__PURE__ */ p(T, {
276
278
  value: e,
277
- children: t(e)
279
+ children: n(e)
278
280
  }, e))] })]
279
281
  })
280
282
  ]
281
283
  }),
282
- he ? /* @__PURE__ */ v(u, { label: "Loading contracts…" }) : ge ? /* @__PURE__ */ v(l, {
284
+ _e ? /* @__PURE__ */ p(re, { label: "Loading contracts…" }) : ve ? /* @__PURE__ */ p(ne, {
283
285
  message: "Couldn't load contracts.",
284
- onRetry: () => _e()
285
- }) : Z.length === 0 ? /* @__PURE__ */ v(d, {
286
+ onRetry: () => ye()
287
+ }) : Q.length === 0 ? /* @__PURE__ */ p(ie, {
286
288
  illustration: "empty-data",
287
- icon: /* @__PURE__ */ v(h, { className: "h-10 w-10" }),
289
+ icon: /* @__PURE__ */ p(u, { className: "h-10 w-10" }),
288
290
  title: "No contracts yet",
289
- description: R === "ALL" && B === "ALL" && H === "ALL" ? "Create your first offtake contract to track pricing, volume and delivery." : "No contracts match these filters.",
290
- action: /* @__PURE__ */ y(b, {
291
- onClick: () => W(!0),
292
- children: [/* @__PURE__ */ v(g, { className: "mr-1.5 h-4 w-4" }), " New contract"]
291
+ description: V === "ALL" && H === "ALL" && U === "ALL" ? "Create your first offtake contract to track pricing, volume and delivery." : "No contracts match these filters.",
292
+ action: /* @__PURE__ */ m(h, {
293
+ onClick: () => G(!0),
294
+ "data-rybbit-event": "theglobalfuel.contract.create_clicked",
295
+ children: [/* @__PURE__ */ p(d, { className: "mr-1.5 h-4 w-4" }), " New contract"]
293
296
  })
294
- }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(c, {
295
- columns: Q,
296
- rows: Z,
297
+ }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(te, {
298
+ columns: be,
299
+ rows: Q,
297
300
  rowKey: (e) => e.id,
298
- onRowClick: (e) => P(`contracts/${e.id}`),
301
+ onRowClick: (e) => F(`contracts/${e.id}`),
299
302
  rowLabel: (e) => `Open ${e.reference}`
300
- }), /* @__PURE__ */ v(ie, {
301
- page: U.page,
302
- pageSize: N,
303
- itemCount: Z.length,
304
- hasMore: Y?.pageInfo?.hasMore ?? !1,
305
- onPageChange: U.onPageChange
303
+ }), /* @__PURE__ */ p(ue, {
304
+ page: W.page,
305
+ pageSize: P,
306
+ itemCount: Q.length,
307
+ hasMore: X?.pageInfo?.hasMore ?? !1,
308
+ onPageChange: W.onPageChange
306
309
  })] }),
307
- /* @__PURE__ */ v(oe, {
308
- open: me,
310
+ /* @__PURE__ */ p(v, {
311
+ open: ge,
309
312
  onOpenChange: (e) => {
310
- W(e), e || $();
313
+ G(e), e || $();
311
314
  },
312
- children: /* @__PURE__ */ y(se, { children: [/* @__PURE__ */ y(ue, { children: [/* @__PURE__ */ v(de, { children: "New offtake contract" }), /* @__PURE__ */ v(ce, { children: "Register a commodity purchase or sale agreement with a counterparty." })] }), /* @__PURE__ */ y("form", {
315
+ children: /* @__PURE__ */ m(y, { children: [/* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(fe, { children: "New offtake contract" }), /* @__PURE__ */ p(b, { children: "Register a commodity purchase or sale agreement with a counterparty." })] }), /* @__PURE__ */ m("form", {
313
316
  onSubmit: (e) => {
314
- e.preventDefault(), ve();
317
+ e.preventDefault(), xe();
315
318
  },
316
- children: [/* @__PURE__ */ y("div", {
319
+ children: [/* @__PURE__ */ m("div", {
317
320
  className: "grid gap-4 py-2",
318
321
  children: [
319
- /* @__PURE__ */ y("div", {
322
+ /* @__PURE__ */ m("div", {
320
323
  className: "grid gap-2 sm:grid-cols-2",
321
- children: [/* @__PURE__ */ y("div", {
324
+ children: [/* @__PURE__ */ m("div", {
322
325
  className: "grid gap-1.5",
323
- children: [/* @__PURE__ */ v(S, {
326
+ children: [/* @__PURE__ */ p(_, {
324
327
  htmlFor: "reference",
325
328
  children: "Reference *"
326
- }), /* @__PURE__ */ v(x, {
329
+ }), /* @__PURE__ */ p(g, {
327
330
  id: "reference",
328
- value: G.reference,
329
- onChange: (e) => K({
330
- ...G,
331
+ value: K.reference,
332
+ onChange: (e) => q({
333
+ ...K,
331
334
  reference: e.target.value
332
335
  }),
333
336
  placeholder: "OFT-2026-0142"
334
337
  })]
335
- }), /* @__PURE__ */ y("div", {
338
+ }), /* @__PURE__ */ m("div", {
336
339
  className: "grid gap-1.5",
337
- children: [/* @__PURE__ */ v(S, {
340
+ children: [/* @__PURE__ */ p(_, {
338
341
  htmlFor: "counterparty",
339
342
  children: "Counterparty *"
340
- }), /* @__PURE__ */ v(x, {
343
+ }), /* @__PURE__ */ p(g, {
341
344
  id: "counterparty",
342
- value: G.counterparty,
343
- onChange: (e) => K({
344
- ...G,
345
+ value: K.counterparty,
346
+ onChange: (e) => q({
347
+ ...K,
345
348
  counterparty: e.target.value
346
349
  }),
347
350
  placeholder: "Vitol S.A."
348
351
  })]
349
352
  })]
350
353
  }),
351
- /* @__PURE__ */ y("div", {
354
+ /* @__PURE__ */ m("div", {
352
355
  className: "grid gap-2 sm:grid-cols-2",
353
- children: [/* @__PURE__ */ y("div", {
356
+ children: [/* @__PURE__ */ m("div", {
354
357
  className: "grid gap-1.5",
355
- children: [/* @__PURE__ */ v(S, {
358
+ children: [/* @__PURE__ */ p(_, {
356
359
  htmlFor: "commodity",
357
360
  children: "Commodity *"
358
- }), /* @__PURE__ */ y(C, {
359
- value: G.commodity,
360
- onValueChange: (e) => K({
361
- ...G,
361
+ }), /* @__PURE__ */ m(C, {
362
+ value: K.commodity,
363
+ onValueChange: (e) => q({
364
+ ...K,
362
365
  commodity: e
363
366
  }),
364
- children: [/* @__PURE__ */ v(E, {
367
+ children: [/* @__PURE__ */ p(E, {
365
368
  id: "commodity",
366
- children: /* @__PURE__ */ v(D, {})
367
- }), /* @__PURE__ */ v(w, { children: j.map((e) => /* @__PURE__ */ v(T, {
369
+ children: /* @__PURE__ */ p(D, {})
370
+ }), /* @__PURE__ */ p(w, { children: M.map((e) => /* @__PURE__ */ p(T, {
368
371
  value: e,
369
- children: t(e)
372
+ children: n(e)
370
373
  }, e)) })]
371
374
  })]
372
- }), /* @__PURE__ */ y("div", {
375
+ }), /* @__PURE__ */ m("div", {
373
376
  className: "grid gap-1.5",
374
- children: [/* @__PURE__ */ v(S, {
377
+ children: [/* @__PURE__ */ p(_, {
375
378
  htmlFor: "side",
376
379
  children: "Side"
377
- }), /* @__PURE__ */ y(C, {
378
- value: G.side,
379
- onValueChange: (e) => K({
380
- ...G,
380
+ }), /* @__PURE__ */ m(C, {
381
+ value: K.side,
382
+ onValueChange: (e) => q({
383
+ ...K,
381
384
  side: e
382
385
  }),
383
- children: [/* @__PURE__ */ v(E, {
386
+ children: [/* @__PURE__ */ p(E, {
384
387
  id: "side",
385
- children: /* @__PURE__ */ v(D, {})
386
- }), /* @__PURE__ */ v(w, { children: k.map((e) => /* @__PURE__ */ v(T, {
388
+ children: /* @__PURE__ */ p(D, {})
389
+ }), /* @__PURE__ */ p(w, { children: A.map((e) => /* @__PURE__ */ p(T, {
387
390
  value: e,
388
- children: t(e)
391
+ children: n(e)
389
392
  }, e)) })]
390
393
  })]
391
394
  })]
392
395
  }),
393
- /* @__PURE__ */ y("div", {
396
+ /* @__PURE__ */ m("div", {
394
397
  className: "grid gap-2 sm:grid-cols-2",
395
- children: [/* @__PURE__ */ y("div", {
398
+ children: [/* @__PURE__ */ m("div", {
396
399
  className: "grid gap-1.5",
397
- children: [/* @__PURE__ */ v(S, {
400
+ children: [/* @__PURE__ */ p(_, {
398
401
  htmlFor: "pricingBasis",
399
402
  children: "Pricing basis"
400
- }), /* @__PURE__ */ y(C, {
401
- value: G.pricingBasis,
402
- onValueChange: (e) => K({
403
- ...G,
403
+ }), /* @__PURE__ */ m(C, {
404
+ value: K.pricingBasis,
405
+ onValueChange: (e) => q({
406
+ ...K,
404
407
  pricingBasis: e
405
408
  }),
406
- children: [/* @__PURE__ */ v(E, {
409
+ children: [/* @__PURE__ */ p(E, {
407
410
  id: "pricingBasis",
408
- children: /* @__PURE__ */ v(D, {})
409
- }), /* @__PURE__ */ v(w, { children: A.map((e) => /* @__PURE__ */ v(T, {
411
+ children: /* @__PURE__ */ p(D, {})
412
+ }), /* @__PURE__ */ p(w, { children: j.map((e) => /* @__PURE__ */ p(T, {
410
413
  value: e,
411
- children: t(e)
414
+ children: n(e)
412
415
  }, e)) })]
413
416
  })]
414
- }), /* @__PURE__ */ y("div", {
417
+ }), /* @__PURE__ */ m("div", {
415
418
  className: "grid gap-1.5",
416
- children: [/* @__PURE__ */ v(S, {
419
+ children: [/* @__PURE__ */ p(_, {
417
420
  htmlFor: "priceIndex",
418
421
  children: "Price index"
419
- }), /* @__PURE__ */ v(x, {
422
+ }), /* @__PURE__ */ p(g, {
420
423
  id: "priceIndex",
421
- value: G.priceIndex,
422
- onChange: (e) => K({
423
- ...G,
424
+ value: K.priceIndex,
425
+ onChange: (e) => q({
426
+ ...K,
424
427
  priceIndex: e.target.value
425
428
  }),
426
429
  placeholder: "Brent, TTF, Henry Hub"
427
430
  })]
428
431
  })]
429
432
  }),
430
- /* @__PURE__ */ y("div", {
433
+ /* @__PURE__ */ m("div", {
431
434
  className: "grid gap-2 sm:grid-cols-3",
432
435
  children: [
433
- /* @__PURE__ */ y("div", {
436
+ /* @__PURE__ */ m("div", {
434
437
  className: "grid gap-1.5",
435
- children: [/* @__PURE__ */ v(S, {
438
+ children: [/* @__PURE__ */ p(_, {
436
439
  htmlFor: "pricePerUnit",
437
440
  children: "Price / unit"
438
- }), /* @__PURE__ */ v(x, {
441
+ }), /* @__PURE__ */ p(g, {
439
442
  id: "pricePerUnit",
440
443
  type: "number",
441
444
  min: "0",
442
445
  step: "any",
443
- value: G.pricePerUnit,
444
- onChange: (e) => K({
445
- ...G,
446
+ value: K.pricePerUnit,
447
+ onChange: (e) => q({
448
+ ...K,
446
449
  pricePerUnit: e.target.value
447
450
  }),
448
451
  placeholder: "82.50"
449
452
  })]
450
453
  }),
451
- /* @__PURE__ */ y("div", {
454
+ /* @__PURE__ */ m("div", {
452
455
  className: "grid gap-1.5",
453
- children: [/* @__PURE__ */ v(S, {
456
+ children: [/* @__PURE__ */ p(_, {
454
457
  htmlFor: "currency",
455
458
  children: "Currency"
456
- }), /* @__PURE__ */ v(x, {
459
+ }), /* @__PURE__ */ p(g, {
457
460
  id: "currency",
458
- value: G.currency,
459
- onChange: (e) => K({
460
- ...G,
461
+ value: K.currency,
462
+ onChange: (e) => q({
463
+ ...K,
461
464
  currency: e.target.value
462
465
  }),
463
466
  placeholder: "USD"
464
467
  })]
465
468
  }),
466
- /* @__PURE__ */ y("div", {
469
+ /* @__PURE__ */ m("div", {
467
470
  className: "grid gap-1.5",
468
- children: [/* @__PURE__ */ v(S, {
471
+ children: [/* @__PURE__ */ p(_, {
469
472
  htmlFor: "unit",
470
473
  children: "Unit"
471
- }), /* @__PURE__ */ y(C, {
472
- value: G.unit,
473
- onValueChange: (e) => K({
474
- ...G,
474
+ }), /* @__PURE__ */ m(C, {
475
+ value: K.unit,
476
+ onValueChange: (e) => q({
477
+ ...K,
475
478
  unit: e
476
479
  }),
477
- children: [/* @__PURE__ */ v(E, {
480
+ children: [/* @__PURE__ */ p(E, {
478
481
  id: "unit",
479
- children: /* @__PURE__ */ v(D, {})
480
- }), /* @__PURE__ */ v(w, { children: M.map((e) => /* @__PURE__ */ v(T, {
482
+ children: /* @__PURE__ */ p(D, {})
483
+ }), /* @__PURE__ */ p(w, { children: N.map((e) => /* @__PURE__ */ p(T, {
481
484
  value: e,
482
485
  children: r(e)
483
486
  }, e)) })]
@@ -485,105 +488,105 @@ function L() {
485
488
  })
486
489
  ]
487
490
  }),
488
- /* @__PURE__ */ y("div", {
491
+ /* @__PURE__ */ m("div", {
489
492
  className: "grid gap-2 sm:grid-cols-2",
490
- children: [/* @__PURE__ */ y("div", {
493
+ children: [/* @__PURE__ */ m("div", {
491
494
  className: "grid gap-1.5",
492
- children: [/* @__PURE__ */ v(S, {
495
+ children: [/* @__PURE__ */ p(_, {
493
496
  htmlFor: "contractedVolume",
494
497
  children: "Contracted volume"
495
- }), /* @__PURE__ */ v(x, {
498
+ }), /* @__PURE__ */ p(g, {
496
499
  id: "contractedVolume",
497
500
  type: "number",
498
501
  min: "0",
499
502
  step: "any",
500
- value: G.contractedVolume,
501
- onChange: (e) => K({
502
- ...G,
503
+ value: K.contractedVolume,
504
+ onChange: (e) => q({
505
+ ...K,
503
506
  contractedVolume: e.target.value
504
507
  }),
505
508
  placeholder: "500000"
506
509
  })]
507
- }), /* @__PURE__ */ y("div", {
510
+ }), /* @__PURE__ */ m("div", {
508
511
  className: "grid gap-1.5",
509
- children: [/* @__PURE__ */ v(S, {
512
+ children: [/* @__PURE__ */ p(_, {
510
513
  htmlFor: "deliveryLocation",
511
514
  children: "Delivery location"
512
- }), /* @__PURE__ */ v(x, {
515
+ }), /* @__PURE__ */ p(g, {
513
516
  id: "deliveryLocation",
514
- value: G.deliveryLocation,
515
- onChange: (e) => K({
516
- ...G,
517
+ value: K.deliveryLocation,
518
+ onChange: (e) => q({
519
+ ...K,
517
520
  deliveryLocation: e.target.value
518
521
  }),
519
522
  placeholder: "Rotterdam"
520
523
  })]
521
524
  })]
522
525
  }),
523
- /* @__PURE__ */ y("div", {
526
+ /* @__PURE__ */ m("div", {
524
527
  className: "grid gap-2 sm:grid-cols-2",
525
- children: [/* @__PURE__ */ y("div", {
528
+ children: [/* @__PURE__ */ m("div", {
526
529
  className: "grid gap-1.5",
527
- children: [/* @__PURE__ */ v(S, {
530
+ children: [/* @__PURE__ */ p(_, {
528
531
  htmlFor: "startDate",
529
532
  children: "Start date"
530
- }), /* @__PURE__ */ v(x, {
533
+ }), /* @__PURE__ */ p(g, {
531
534
  id: "startDate",
532
535
  type: "date",
533
- value: G.startDate,
534
- onChange: (e) => K({
535
- ...G,
536
+ value: K.startDate,
537
+ onChange: (e) => q({
538
+ ...K,
536
539
  startDate: e.target.value
537
540
  })
538
541
  })]
539
- }), /* @__PURE__ */ y("div", {
542
+ }), /* @__PURE__ */ m("div", {
540
543
  className: "grid gap-1.5",
541
- children: [/* @__PURE__ */ v(S, {
544
+ children: [/* @__PURE__ */ p(_, {
542
545
  htmlFor: "endDate",
543
546
  children: "End date"
544
- }), /* @__PURE__ */ v(x, {
547
+ }), /* @__PURE__ */ p(g, {
545
548
  id: "endDate",
546
549
  type: "date",
547
- value: G.endDate,
548
- onChange: (e) => K({
549
- ...G,
550
+ value: K.endDate,
551
+ onChange: (e) => q({
552
+ ...K,
550
553
  endDate: e.target.value
551
554
  })
552
555
  })]
553
556
  })]
554
557
  }),
555
- /* @__PURE__ */ y("div", {
558
+ /* @__PURE__ */ m("div", {
556
559
  className: "grid gap-1.5",
557
- children: [/* @__PURE__ */ v(S, {
560
+ children: [/* @__PURE__ */ p(_, {
558
561
  htmlFor: "notes",
559
562
  children: "Notes"
560
- }), /* @__PURE__ */ v(fe, {
563
+ }), /* @__PURE__ */ p(O, {
561
564
  id: "notes",
562
565
  rows: 2,
563
- value: G.notes,
564
- onChange: (e) => K({
565
- ...G,
566
+ value: K.notes,
567
+ onChange: (e) => q({
568
+ ...K,
566
569
  notes: e.target.value
567
570
  }),
568
571
  placeholder: "Optional context about this contract."
569
572
  })]
570
573
  }),
571
- q && /* @__PURE__ */ v("p", {
574
+ J && /* @__PURE__ */ p("p", {
572
575
  className: "text-sm text-status-error-text",
573
- children: q
576
+ children: J
574
577
  })
575
578
  ]
576
- }), /* @__PURE__ */ y(le, { children: [/* @__PURE__ */ v(b, {
579
+ }), /* @__PURE__ */ m(x, { children: [/* @__PURE__ */ p(h, {
577
580
  type: "button",
578
581
  variant: "outline",
579
582
  onClick: () => {
580
- W(!1), $();
583
+ G(!1), $();
581
584
  },
582
585
  children: "Cancel"
583
- }), /* @__PURE__ */ v(b, {
586
+ }), /* @__PURE__ */ p(h, {
584
587
  type: "submit",
585
- disabled: X.isPending,
586
- children: X.isPending ? "Creating…" : "Create contract"
588
+ disabled: Z.isPending,
589
+ children: Z.isPending ? "Creating…" : "Create contract"
587
590
  })] })]
588
591
  })] })
589
592
  })
@@ -591,6 +594,6 @@ function L() {
591
594
  });
592
595
  }
593
596
  //#endregion
594
- export { L as ContractsPage };
597
+ export { R as ContractsPage };
595
598
 
596
599
  //# sourceMappingURL=ContractsPage.js.map