@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.
- package/dist/index.js +3 -1
- package/dist/theglobalfuel/TheGlobalFuelRoutes.js +1 -1
- package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -1
- package/dist/theglobalfuel/hooks/index.js +1 -0
- package/dist/theglobalfuel/hooks/useTheAnalytics.js +45 -0
- package/dist/theglobalfuel/hooks/useTheAnalytics.js.map +1 -0
- package/dist/theglobalfuel/index.js +2 -0
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +284 -279
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -1
- package/dist/theglobalfuel/pages/assets/AssetsPage.js +141 -138
- package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractsPage.js +234 -231
- package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +243 -238
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
- package/dist/theglobalfuel/pages/provenance/ProvenancePage.js +13 -13
- package/dist/theglobalfuel/pages/provenance/ProvenancePage.js.map +1 -1
- package/dist/theglobalfuel/services/assistantApi.js +225 -0
- package/dist/theglobalfuel/services/assistantApi.js.map +1 -0
- package/dist/theglobalfuel/services/createSandboxAssistantTransport.js +120 -0
- package/dist/theglobalfuel/services/createSandboxAssistantTransport.js.map +1 -0
- package/dist/theglobalfuel/utils/pageContext.js +65 -0
- package/dist/theglobalfuel/utils/pageContext.js.map +1 -0
- package/package.json +5 -1
- package/dist/node_modules/clsx/dist/clsx.js +0 -18
- package/dist/node_modules/clsx/dist/clsx.js.map +0 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -1716
- 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
|
|
3
|
-
import { formatEnumLabel as
|
|
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
|
|
7
|
-
import { ErrorView as
|
|
8
|
-
import { EmptyState as
|
|
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
|
|
11
|
-
import { useCursorPager as
|
|
12
|
-
import { useNotify as
|
|
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
|
|
15
|
-
import { Pagination as
|
|
16
|
-
import { useMemo as
|
|
17
|
-
import { FileSignature as
|
|
18
|
-
import { Fragment as
|
|
19
|
-
import { Button as
|
|
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
|
|
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
|
-
],
|
|
55
|
+
], A = ["BUY", "SELL"], j = [
|
|
55
56
|
"FIXED",
|
|
56
57
|
"INDEX_LINKED",
|
|
57
58
|
"FORMULA",
|
|
58
59
|
"SPOT"
|
|
59
|
-
],
|
|
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
|
-
],
|
|
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
|
-
],
|
|
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
|
|
98
|
-
let { navigateTo:
|
|
99
|
-
status:
|
|
100
|
-
side:
|
|
101
|
-
commodity:
|
|
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:
|
|
104
|
-
offset:
|
|
104
|
+
limit: P,
|
|
105
|
+
offset: W.page * P
|
|
105
106
|
}
|
|
106
|
-
}),
|
|
107
|
+
}), Z = c(), Q = de(() => X?.items ?? [], [X]), be = [
|
|
107
108
|
{
|
|
108
109
|
key: "reference",
|
|
109
110
|
header: "Contract",
|
|
110
|
-
render: (e) => /* @__PURE__ */
|
|
111
|
+
render: (e) => /* @__PURE__ */ m("div", {
|
|
111
112
|
className: "flex items-center gap-3",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
115
|
-
}), /* @__PURE__ */
|
|
115
|
+
children: /* @__PURE__ */ p(u, { className: "h-4 w-4" })
|
|
116
|
+
}), /* @__PURE__ */ m("div", {
|
|
116
117
|
className: "min-w-0",
|
|
117
|
-
children: [/* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ p("p", {
|
|
118
119
|
className: "truncate font-semibold text-text-primary",
|
|
119
120
|
children: e.reference
|
|
120
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
137
|
+
render: (e) => /* @__PURE__ */ p("span", {
|
|
137
138
|
className: "text-text-secondary",
|
|
138
|
-
children:
|
|
139
|
+
children: n(e.commodity)
|
|
139
140
|
})
|
|
140
141
|
},
|
|
141
142
|
{
|
|
142
143
|
key: "status",
|
|
143
144
|
header: "Status",
|
|
144
|
-
render: (e) => /* @__PURE__ */
|
|
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__ */
|
|
153
|
+
render: (e) => /* @__PURE__ */ m("span", {
|
|
153
154
|
className: "tabular-nums text-text-secondary",
|
|
154
|
-
children: [
|
|
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) =>
|
|
164
|
-
render: (e) => /* @__PURE__ */
|
|
164
|
+
sortValue: (e) => I(e),
|
|
165
|
+
render: (e) => /* @__PURE__ */ m("div", {
|
|
165
166
|
className: "min-w-[9rem]",
|
|
166
|
-
children: [/* @__PURE__ */
|
|
167
|
-
value:
|
|
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__ */
|
|
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__ */
|
|
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
|
-
|
|
196
|
-
},
|
|
197
|
-
if (!
|
|
198
|
-
|
|
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 (!
|
|
202
|
-
|
|
202
|
+
if (!K.counterparty.trim()) {
|
|
203
|
+
Y("Counterparty is required.");
|
|
203
204
|
return;
|
|
204
205
|
}
|
|
205
|
-
|
|
206
|
+
Y(null), z();
|
|
206
207
|
try {
|
|
207
|
-
let e = await
|
|
208
|
-
reference:
|
|
209
|
-
counterparty:
|
|
210
|
-
commodity:
|
|
211
|
-
side:
|
|
212
|
-
pricingBasis:
|
|
213
|
-
pricePerUnit:
|
|
214
|
-
priceIndex:
|
|
215
|
-
currency:
|
|
216
|
-
contractedVolume:
|
|
217
|
-
unit:
|
|
218
|
-
deliveryLocation:
|
|
219
|
-
startDate: a(
|
|
220
|
-
endDate: a(
|
|
221
|
-
notes:
|
|
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
|
-
|
|
224
|
+
B(e.id), R.success("Contract created"), G(!1), $(), F(`contracts/${e.id}`);
|
|
224
225
|
} catch (e) {
|
|
225
|
-
|
|
226
|
+
Y(e instanceof Error ? e.message : "Failed to create contract."), R.fromError(e);
|
|
226
227
|
}
|
|
227
228
|
};
|
|
228
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
232
|
-
onClick: () =>
|
|
233
|
-
|
|
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__ */
|
|
238
|
+
/* @__PURE__ */ m("div", {
|
|
237
239
|
className: "mb-5 flex flex-wrap items-center gap-3",
|
|
238
240
|
children: [
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
-
options:
|
|
241
|
-
value:
|
|
241
|
+
/* @__PURE__ */ p(le, {
|
|
242
|
+
options: k,
|
|
243
|
+
value: V,
|
|
242
244
|
onChange: (e) => {
|
|
243
|
-
|
|
245
|
+
pe(e), W.reset();
|
|
244
246
|
}
|
|
245
247
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
value:
|
|
248
|
+
/* @__PURE__ */ m(C, {
|
|
249
|
+
value: H,
|
|
248
250
|
onValueChange: (e) => {
|
|
249
|
-
|
|
251
|
+
me(e), W.reset();
|
|
250
252
|
},
|
|
251
|
-
children: [/* @__PURE__ */
|
|
253
|
+
children: [/* @__PURE__ */ p(E, {
|
|
252
254
|
className: "w-40",
|
|
253
255
|
"aria-label": "Filter by side",
|
|
254
|
-
children: /* @__PURE__ */
|
|
255
|
-
}), /* @__PURE__ */
|
|
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
|
-
}),
|
|
260
|
+
}), A.map((e) => /* @__PURE__ */ p(T, {
|
|
259
261
|
value: e,
|
|
260
|
-
children:
|
|
262
|
+
children: n(e)
|
|
261
263
|
}, e))] })]
|
|
262
264
|
}),
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
-
value:
|
|
265
|
+
/* @__PURE__ */ m(C, {
|
|
266
|
+
value: U,
|
|
265
267
|
onValueChange: (e) => {
|
|
266
|
-
|
|
268
|
+
he(e), W.reset();
|
|
267
269
|
},
|
|
268
|
-
children: [/* @__PURE__ */
|
|
270
|
+
children: [/* @__PURE__ */ p(E, {
|
|
269
271
|
className: "w-48",
|
|
270
272
|
"aria-label": "Filter by commodity",
|
|
271
|
-
children: /* @__PURE__ */
|
|
272
|
-
}), /* @__PURE__ */
|
|
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
|
-
}),
|
|
277
|
+
}), M.map((e) => /* @__PURE__ */ p(T, {
|
|
276
278
|
value: e,
|
|
277
|
-
children:
|
|
279
|
+
children: n(e)
|
|
278
280
|
}, e))] })]
|
|
279
281
|
})
|
|
280
282
|
]
|
|
281
283
|
}),
|
|
282
|
-
|
|
284
|
+
_e ? /* @__PURE__ */ p(re, { label: "Loading contracts…" }) : ve ? /* @__PURE__ */ p(ne, {
|
|
283
285
|
message: "Couldn't load contracts.",
|
|
284
|
-
onRetry: () =>
|
|
285
|
-
}) :
|
|
286
|
+
onRetry: () => ye()
|
|
287
|
+
}) : Q.length === 0 ? /* @__PURE__ */ p(ie, {
|
|
286
288
|
illustration: "empty-data",
|
|
287
|
-
icon: /* @__PURE__ */
|
|
289
|
+
icon: /* @__PURE__ */ p(u, { className: "h-10 w-10" }),
|
|
288
290
|
title: "No contracts yet",
|
|
289
|
-
description:
|
|
290
|
-
action: /* @__PURE__ */
|
|
291
|
-
onClick: () =>
|
|
292
|
-
|
|
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__ */
|
|
295
|
-
columns:
|
|
296
|
-
rows:
|
|
297
|
+
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(te, {
|
|
298
|
+
columns: be,
|
|
299
|
+
rows: Q,
|
|
297
300
|
rowKey: (e) => e.id,
|
|
298
|
-
onRowClick: (e) =>
|
|
301
|
+
onRowClick: (e) => F(`contracts/${e.id}`),
|
|
299
302
|
rowLabel: (e) => `Open ${e.reference}`
|
|
300
|
-
}), /* @__PURE__ */
|
|
301
|
-
page:
|
|
302
|
-
pageSize:
|
|
303
|
-
itemCount:
|
|
304
|
-
hasMore:
|
|
305
|
-
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
|
|
308
|
-
open:
|
|
310
|
+
/* @__PURE__ */ p(v, {
|
|
311
|
+
open: ge,
|
|
309
312
|
onOpenChange: (e) => {
|
|
310
|
-
|
|
313
|
+
G(e), e || $();
|
|
311
314
|
},
|
|
312
|
-
children: /* @__PURE__ */ y
|
|
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(),
|
|
317
|
+
e.preventDefault(), xe();
|
|
315
318
|
},
|
|
316
|
-
children: [/* @__PURE__ */
|
|
319
|
+
children: [/* @__PURE__ */ m("div", {
|
|
317
320
|
className: "grid gap-4 py-2",
|
|
318
321
|
children: [
|
|
319
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ m("div", {
|
|
320
323
|
className: "grid gap-2 sm:grid-cols-2",
|
|
321
|
-
children: [/* @__PURE__ */
|
|
324
|
+
children: [/* @__PURE__ */ m("div", {
|
|
322
325
|
className: "grid gap-1.5",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
326
|
+
children: [/* @__PURE__ */ p(_, {
|
|
324
327
|
htmlFor: "reference",
|
|
325
328
|
children: "Reference *"
|
|
326
|
-
}), /* @__PURE__ */
|
|
329
|
+
}), /* @__PURE__ */ p(g, {
|
|
327
330
|
id: "reference",
|
|
328
|
-
value:
|
|
329
|
-
onChange: (e) =>
|
|
330
|
-
...
|
|
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__ */
|
|
338
|
+
}), /* @__PURE__ */ m("div", {
|
|
336
339
|
className: "grid gap-1.5",
|
|
337
|
-
children: [/* @__PURE__ */
|
|
340
|
+
children: [/* @__PURE__ */ p(_, {
|
|
338
341
|
htmlFor: "counterparty",
|
|
339
342
|
children: "Counterparty *"
|
|
340
|
-
}), /* @__PURE__ */
|
|
343
|
+
}), /* @__PURE__ */ p(g, {
|
|
341
344
|
id: "counterparty",
|
|
342
|
-
value:
|
|
343
|
-
onChange: (e) =>
|
|
344
|
-
...
|
|
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__ */
|
|
354
|
+
/* @__PURE__ */ m("div", {
|
|
352
355
|
className: "grid gap-2 sm:grid-cols-2",
|
|
353
|
-
children: [/* @__PURE__ */
|
|
356
|
+
children: [/* @__PURE__ */ m("div", {
|
|
354
357
|
className: "grid gap-1.5",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
358
|
+
children: [/* @__PURE__ */ p(_, {
|
|
356
359
|
htmlFor: "commodity",
|
|
357
360
|
children: "Commodity *"
|
|
358
|
-
}), /* @__PURE__ */
|
|
359
|
-
value:
|
|
360
|
-
onValueChange: (e) =>
|
|
361
|
-
...
|
|
361
|
+
}), /* @__PURE__ */ m(C, {
|
|
362
|
+
value: K.commodity,
|
|
363
|
+
onValueChange: (e) => q({
|
|
364
|
+
...K,
|
|
362
365
|
commodity: e
|
|
363
366
|
}),
|
|
364
|
-
children: [/* @__PURE__ */
|
|
367
|
+
children: [/* @__PURE__ */ p(E, {
|
|
365
368
|
id: "commodity",
|
|
366
|
-
children: /* @__PURE__ */
|
|
367
|
-
}), /* @__PURE__ */
|
|
369
|
+
children: /* @__PURE__ */ p(D, {})
|
|
370
|
+
}), /* @__PURE__ */ p(w, { children: M.map((e) => /* @__PURE__ */ p(T, {
|
|
368
371
|
value: e,
|
|
369
|
-
children:
|
|
372
|
+
children: n(e)
|
|
370
373
|
}, e)) })]
|
|
371
374
|
})]
|
|
372
|
-
}), /* @__PURE__ */
|
|
375
|
+
}), /* @__PURE__ */ m("div", {
|
|
373
376
|
className: "grid gap-1.5",
|
|
374
|
-
children: [/* @__PURE__ */
|
|
377
|
+
children: [/* @__PURE__ */ p(_, {
|
|
375
378
|
htmlFor: "side",
|
|
376
379
|
children: "Side"
|
|
377
|
-
}), /* @__PURE__ */
|
|
378
|
-
value:
|
|
379
|
-
onValueChange: (e) =>
|
|
380
|
-
...
|
|
380
|
+
}), /* @__PURE__ */ m(C, {
|
|
381
|
+
value: K.side,
|
|
382
|
+
onValueChange: (e) => q({
|
|
383
|
+
...K,
|
|
381
384
|
side: e
|
|
382
385
|
}),
|
|
383
|
-
children: [/* @__PURE__ */
|
|
386
|
+
children: [/* @__PURE__ */ p(E, {
|
|
384
387
|
id: "side",
|
|
385
|
-
children: /* @__PURE__ */
|
|
386
|
-
}), /* @__PURE__ */
|
|
388
|
+
children: /* @__PURE__ */ p(D, {})
|
|
389
|
+
}), /* @__PURE__ */ p(w, { children: A.map((e) => /* @__PURE__ */ p(T, {
|
|
387
390
|
value: e,
|
|
388
|
-
children:
|
|
391
|
+
children: n(e)
|
|
389
392
|
}, e)) })]
|
|
390
393
|
})]
|
|
391
394
|
})]
|
|
392
395
|
}),
|
|
393
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ m("div", {
|
|
394
397
|
className: "grid gap-2 sm:grid-cols-2",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
398
|
+
children: [/* @__PURE__ */ m("div", {
|
|
396
399
|
className: "grid gap-1.5",
|
|
397
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ p(_, {
|
|
398
401
|
htmlFor: "pricingBasis",
|
|
399
402
|
children: "Pricing basis"
|
|
400
|
-
}), /* @__PURE__ */
|
|
401
|
-
value:
|
|
402
|
-
onValueChange: (e) =>
|
|
403
|
-
...
|
|
403
|
+
}), /* @__PURE__ */ m(C, {
|
|
404
|
+
value: K.pricingBasis,
|
|
405
|
+
onValueChange: (e) => q({
|
|
406
|
+
...K,
|
|
404
407
|
pricingBasis: e
|
|
405
408
|
}),
|
|
406
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ p(E, {
|
|
407
410
|
id: "pricingBasis",
|
|
408
|
-
children: /* @__PURE__ */
|
|
409
|
-
}), /* @__PURE__ */
|
|
411
|
+
children: /* @__PURE__ */ p(D, {})
|
|
412
|
+
}), /* @__PURE__ */ p(w, { children: j.map((e) => /* @__PURE__ */ p(T, {
|
|
410
413
|
value: e,
|
|
411
|
-
children:
|
|
414
|
+
children: n(e)
|
|
412
415
|
}, e)) })]
|
|
413
416
|
})]
|
|
414
|
-
}), /* @__PURE__ */
|
|
417
|
+
}), /* @__PURE__ */ m("div", {
|
|
415
418
|
className: "grid gap-1.5",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
419
|
+
children: [/* @__PURE__ */ p(_, {
|
|
417
420
|
htmlFor: "priceIndex",
|
|
418
421
|
children: "Price index"
|
|
419
|
-
}), /* @__PURE__ */
|
|
422
|
+
}), /* @__PURE__ */ p(g, {
|
|
420
423
|
id: "priceIndex",
|
|
421
|
-
value:
|
|
422
|
-
onChange: (e) =>
|
|
423
|
-
...
|
|
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__ */
|
|
433
|
+
/* @__PURE__ */ m("div", {
|
|
431
434
|
className: "grid gap-2 sm:grid-cols-3",
|
|
432
435
|
children: [
|
|
433
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ m("div", {
|
|
434
437
|
className: "grid gap-1.5",
|
|
435
|
-
children: [/* @__PURE__ */
|
|
438
|
+
children: [/* @__PURE__ */ p(_, {
|
|
436
439
|
htmlFor: "pricePerUnit",
|
|
437
440
|
children: "Price / unit"
|
|
438
|
-
}), /* @__PURE__ */
|
|
441
|
+
}), /* @__PURE__ */ p(g, {
|
|
439
442
|
id: "pricePerUnit",
|
|
440
443
|
type: "number",
|
|
441
444
|
min: "0",
|
|
442
445
|
step: "any",
|
|
443
|
-
value:
|
|
444
|
-
onChange: (e) =>
|
|
445
|
-
...
|
|
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__ */
|
|
454
|
+
/* @__PURE__ */ m("div", {
|
|
452
455
|
className: "grid gap-1.5",
|
|
453
|
-
children: [/* @__PURE__ */
|
|
456
|
+
children: [/* @__PURE__ */ p(_, {
|
|
454
457
|
htmlFor: "currency",
|
|
455
458
|
children: "Currency"
|
|
456
|
-
}), /* @__PURE__ */
|
|
459
|
+
}), /* @__PURE__ */ p(g, {
|
|
457
460
|
id: "currency",
|
|
458
|
-
value:
|
|
459
|
-
onChange: (e) =>
|
|
460
|
-
...
|
|
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__ */
|
|
469
|
+
/* @__PURE__ */ m("div", {
|
|
467
470
|
className: "grid gap-1.5",
|
|
468
|
-
children: [/* @__PURE__ */
|
|
471
|
+
children: [/* @__PURE__ */ p(_, {
|
|
469
472
|
htmlFor: "unit",
|
|
470
473
|
children: "Unit"
|
|
471
|
-
}), /* @__PURE__ */
|
|
472
|
-
value:
|
|
473
|
-
onValueChange: (e) =>
|
|
474
|
-
...
|
|
474
|
+
}), /* @__PURE__ */ m(C, {
|
|
475
|
+
value: K.unit,
|
|
476
|
+
onValueChange: (e) => q({
|
|
477
|
+
...K,
|
|
475
478
|
unit: e
|
|
476
479
|
}),
|
|
477
|
-
children: [/* @__PURE__ */
|
|
480
|
+
children: [/* @__PURE__ */ p(E, {
|
|
478
481
|
id: "unit",
|
|
479
|
-
children: /* @__PURE__ */
|
|
480
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
491
|
+
/* @__PURE__ */ m("div", {
|
|
489
492
|
className: "grid gap-2 sm:grid-cols-2",
|
|
490
|
-
children: [/* @__PURE__ */
|
|
493
|
+
children: [/* @__PURE__ */ m("div", {
|
|
491
494
|
className: "grid gap-1.5",
|
|
492
|
-
children: [/* @__PURE__ */
|
|
495
|
+
children: [/* @__PURE__ */ p(_, {
|
|
493
496
|
htmlFor: "contractedVolume",
|
|
494
497
|
children: "Contracted volume"
|
|
495
|
-
}), /* @__PURE__ */
|
|
498
|
+
}), /* @__PURE__ */ p(g, {
|
|
496
499
|
id: "contractedVolume",
|
|
497
500
|
type: "number",
|
|
498
501
|
min: "0",
|
|
499
502
|
step: "any",
|
|
500
|
-
value:
|
|
501
|
-
onChange: (e) =>
|
|
502
|
-
...
|
|
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__ */
|
|
510
|
+
}), /* @__PURE__ */ m("div", {
|
|
508
511
|
className: "grid gap-1.5",
|
|
509
|
-
children: [/* @__PURE__ */
|
|
512
|
+
children: [/* @__PURE__ */ p(_, {
|
|
510
513
|
htmlFor: "deliveryLocation",
|
|
511
514
|
children: "Delivery location"
|
|
512
|
-
}), /* @__PURE__ */
|
|
515
|
+
}), /* @__PURE__ */ p(g, {
|
|
513
516
|
id: "deliveryLocation",
|
|
514
|
-
value:
|
|
515
|
-
onChange: (e) =>
|
|
516
|
-
...
|
|
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__ */
|
|
526
|
+
/* @__PURE__ */ m("div", {
|
|
524
527
|
className: "grid gap-2 sm:grid-cols-2",
|
|
525
|
-
children: [/* @__PURE__ */
|
|
528
|
+
children: [/* @__PURE__ */ m("div", {
|
|
526
529
|
className: "grid gap-1.5",
|
|
527
|
-
children: [/* @__PURE__ */
|
|
530
|
+
children: [/* @__PURE__ */ p(_, {
|
|
528
531
|
htmlFor: "startDate",
|
|
529
532
|
children: "Start date"
|
|
530
|
-
}), /* @__PURE__ */
|
|
533
|
+
}), /* @__PURE__ */ p(g, {
|
|
531
534
|
id: "startDate",
|
|
532
535
|
type: "date",
|
|
533
|
-
value:
|
|
534
|
-
onChange: (e) =>
|
|
535
|
-
...
|
|
536
|
+
value: K.startDate,
|
|
537
|
+
onChange: (e) => q({
|
|
538
|
+
...K,
|
|
536
539
|
startDate: e.target.value
|
|
537
540
|
})
|
|
538
541
|
})]
|
|
539
|
-
}), /* @__PURE__ */
|
|
542
|
+
}), /* @__PURE__ */ m("div", {
|
|
540
543
|
className: "grid gap-1.5",
|
|
541
|
-
children: [/* @__PURE__ */
|
|
544
|
+
children: [/* @__PURE__ */ p(_, {
|
|
542
545
|
htmlFor: "endDate",
|
|
543
546
|
children: "End date"
|
|
544
|
-
}), /* @__PURE__ */
|
|
547
|
+
}), /* @__PURE__ */ p(g, {
|
|
545
548
|
id: "endDate",
|
|
546
549
|
type: "date",
|
|
547
|
-
value:
|
|
548
|
-
onChange: (e) =>
|
|
549
|
-
...
|
|
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__ */
|
|
558
|
+
/* @__PURE__ */ m("div", {
|
|
556
559
|
className: "grid gap-1.5",
|
|
557
|
-
children: [/* @__PURE__ */
|
|
560
|
+
children: [/* @__PURE__ */ p(_, {
|
|
558
561
|
htmlFor: "notes",
|
|
559
562
|
children: "Notes"
|
|
560
|
-
}), /* @__PURE__ */
|
|
563
|
+
}), /* @__PURE__ */ p(O, {
|
|
561
564
|
id: "notes",
|
|
562
565
|
rows: 2,
|
|
563
|
-
value:
|
|
564
|
-
onChange: (e) =>
|
|
565
|
-
...
|
|
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
|
-
|
|
574
|
+
J && /* @__PURE__ */ p("p", {
|
|
572
575
|
className: "text-sm text-status-error-text",
|
|
573
|
-
children:
|
|
576
|
+
children: J
|
|
574
577
|
})
|
|
575
578
|
]
|
|
576
|
-
}), /* @__PURE__ */
|
|
579
|
+
}), /* @__PURE__ */ m(x, { children: [/* @__PURE__ */ p(h, {
|
|
577
580
|
type: "button",
|
|
578
581
|
variant: "outline",
|
|
579
582
|
onClick: () => {
|
|
580
|
-
|
|
583
|
+
G(!1), $();
|
|
581
584
|
},
|
|
582
585
|
children: "Cancel"
|
|
583
|
-
}), /* @__PURE__ */
|
|
586
|
+
}), /* @__PURE__ */ p(h, {
|
|
584
587
|
type: "submit",
|
|
585
|
-
disabled:
|
|
586
|
-
children:
|
|
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 {
|
|
597
|
+
export { R as ContractsPage };
|
|
595
598
|
|
|
596
599
|
//# sourceMappingURL=ContractsPage.js.map
|