@burdenoff/microfe-theglobalfuel 2026.704.1 → 2026.705.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 (133) hide show
  1. package/dist/node_modules/{.bun/clsx@2.1.1/node_modules/clsx → clsx}/dist/clsx.js +1 -1
  2. package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
  3. package/dist/node_modules/{.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge → tailwind-merge}/dist/bundle-mjs.js +212 -170
  4. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  5. package/dist/theglobalfuel/components/DataTable.js +37 -27
  6. package/dist/theglobalfuel/components/DataTable.js.map +1 -1
  7. package/dist/theglobalfuel/hooks/index.js +1 -0
  8. package/dist/theglobalfuel/hooks/useNotify.js +19 -0
  9. package/dist/theglobalfuel/hooks/useNotify.js.map +1 -0
  10. package/dist/theglobalfuel/hooks/useTheFiles.js +4 -1
  11. package/dist/theglobalfuel/hooks/useTheFiles.js.map +1 -1
  12. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +59 -31
  13. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -1
  14. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +367 -321
  15. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -1
  16. package/dist/theglobalfuel/pages/assets/AssetsPage.js +66 -54
  17. package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -1
  18. package/dist/theglobalfuel/pages/compliance/CompliancePage.js +346 -182
  19. package/dist/theglobalfuel/pages/compliance/CompliancePage.js.map +1 -1
  20. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js +418 -390
  21. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js.map +1 -1
  22. package/dist/theglobalfuel/pages/contracts/ContractsPage.js +238 -230
  23. package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -1
  24. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +5 -3
  25. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
  26. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js +201 -177
  27. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js.map +1 -1
  28. package/dist/theglobalfuel/pages/inventory/InventoryPage.js +271 -238
  29. package/dist/theglobalfuel/pages/inventory/InventoryPage.js.map +1 -1
  30. package/dist/theglobalfuel/pages/production/ProductionPage.js +185 -177
  31. package/dist/theglobalfuel/pages/production/ProductionPage.js.map +1 -1
  32. package/dist/theglobalfuel/pages/reserves/ReservesPage.js +160 -138
  33. package/dist/theglobalfuel/pages/reserves/ReservesPage.js.map +1 -1
  34. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js +250 -198
  35. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js.map +1 -1
  36. package/dist/theglobalfuel/utils/cn.js +2 -2
  37. package/dist/theglobalfuel/utils/formatters.js +6 -1
  38. package/dist/theglobalfuel/utils/formatters.js.map +1 -1
  39. package/dist/theglobalfuel/utils/transitions.js +70 -0
  40. package/dist/theglobalfuel/utils/transitions.js.map +1 -0
  41. package/package.json +1 -1
  42. package/dist/dev/main.d.ts +0 -2
  43. package/dist/dev/main.d.ts.map +0 -1
  44. package/dist/index.d.ts +0 -2
  45. package/dist/index.d.ts.map +0 -1
  46. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +0 -1
  47. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
  48. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts +0 -5
  49. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +0 -1
  50. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts +0 -4
  51. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +0 -1
  52. package/dist/theglobalfuel/components/DataTable.d.ts +0 -28
  53. package/dist/theglobalfuel/components/DataTable.d.ts.map +0 -1
  54. package/dist/theglobalfuel/components/EmptyState.d.ts +0 -18
  55. package/dist/theglobalfuel/components/EmptyState.d.ts.map +0 -1
  56. package/dist/theglobalfuel/components/EvidenceUpload.d.ts +0 -14
  57. package/dist/theglobalfuel/components/EvidenceUpload.d.ts.map +0 -1
  58. package/dist/theglobalfuel/components/FileLink.d.ts +0 -15
  59. package/dist/theglobalfuel/components/FileLink.d.ts.map +0 -1
  60. package/dist/theglobalfuel/components/FilterTabs.d.ts +0 -18
  61. package/dist/theglobalfuel/components/FilterTabs.d.ts.map +0 -1
  62. package/dist/theglobalfuel/components/MetricsCard.d.ts +0 -23
  63. package/dist/theglobalfuel/components/MetricsCard.d.ts.map +0 -1
  64. package/dist/theglobalfuel/components/MiniBar.d.ts +0 -16
  65. package/dist/theglobalfuel/components/MiniBar.d.ts.map +0 -1
  66. package/dist/theglobalfuel/components/PageLayout.d.ts +0 -16
  67. package/dist/theglobalfuel/components/PageLayout.d.ts.map +0 -1
  68. package/dist/theglobalfuel/components/Pagination.d.ts +0 -22
  69. package/dist/theglobalfuel/components/Pagination.d.ts.map +0 -1
  70. package/dist/theglobalfuel/components/StateViews.d.ts +0 -24
  71. package/dist/theglobalfuel/components/StateViews.d.ts.map +0 -1
  72. package/dist/theglobalfuel/components/StatusBadge.d.ts +0 -9
  73. package/dist/theglobalfuel/components/StatusBadge.d.ts.map +0 -1
  74. package/dist/theglobalfuel/components/Tabs.d.ts +0 -17
  75. package/dist/theglobalfuel/components/Tabs.d.ts.map +0 -1
  76. package/dist/theglobalfuel/components/TheDiscussion.d.ts +0 -18
  77. package/dist/theglobalfuel/components/TheDiscussion.d.ts.map +0 -1
  78. package/dist/theglobalfuel/components/TheTags.d.ts +0 -17
  79. package/dist/theglobalfuel/components/TheTags.d.ts.map +0 -1
  80. package/dist/theglobalfuel/components/index.d.ts +0 -19
  81. package/dist/theglobalfuel/components/index.d.ts.map +0 -1
  82. package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts +0 -16
  83. package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts.map +0 -1
  84. package/dist/theglobalfuel/context/index.d.ts +0 -6
  85. package/dist/theglobalfuel/context/index.d.ts.map +0 -1
  86. package/dist/theglobalfuel/hooks/index.d.ts +0 -10
  87. package/dist/theglobalfuel/hooks/index.d.ts.map +0 -1
  88. package/dist/theglobalfuel/hooks/useCursorPager.d.ts +0 -33
  89. package/dist/theglobalfuel/hooks/useCursorPager.d.ts.map +0 -1
  90. package/dist/theglobalfuel/hooks/useTheComments.d.ts +0 -36
  91. package/dist/theglobalfuel/hooks/useTheComments.d.ts.map +0 -1
  92. package/dist/theglobalfuel/hooks/useTheFiles.d.ts +0 -47
  93. package/dist/theglobalfuel/hooks/useTheFiles.d.ts.map +0 -1
  94. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +0 -75
  95. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +0 -1
  96. package/dist/theglobalfuel/hooks/useTheTags.d.ts +0 -44
  97. package/dist/theglobalfuel/hooks/useTheTags.d.ts.map +0 -1
  98. package/dist/theglobalfuel/index.d.ts +0 -9
  99. package/dist/theglobalfuel/index.d.ts.map +0 -1
  100. package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts +0 -13
  101. package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts.map +0 -1
  102. package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts +0 -10
  103. package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts.map +0 -1
  104. package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts +0 -11
  105. package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts.map +0 -1
  106. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts +0 -9
  107. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts.map +0 -1
  108. package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts +0 -8
  109. package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts.map +0 -1
  110. package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts +0 -13
  111. package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts.map +0 -1
  112. package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts +0 -12
  113. package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts.map +0 -1
  114. package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts +0 -11
  115. package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts.map +0 -1
  116. package/dist/theglobalfuel/pages/production/ProductionPage.d.ts +0 -11
  117. package/dist/theglobalfuel/pages/production/ProductionPage.d.ts.map +0 -1
  118. package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts +0 -10
  119. package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts.map +0 -1
  120. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts +0 -10
  121. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts.map +0 -1
  122. package/dist/theglobalfuel/types/index.d.ts +0 -376
  123. package/dist/theglobalfuel/types/index.d.ts.map +0 -1
  124. package/dist/theglobalfuel/utils/cn.d.ts +0 -4
  125. package/dist/theglobalfuel/utils/cn.d.ts.map +0 -1
  126. package/dist/theglobalfuel/utils/formatters.d.ts +0 -36
  127. package/dist/theglobalfuel/utils/formatters.d.ts.map +0 -1
  128. package/dist/theglobalfuel/utils/i18n.d.ts +0 -6
  129. package/dist/theglobalfuel/utils/i18n.d.ts.map +0 -1
  130. package/dist/theglobalfuel/utils/index.d.ts +0 -9
  131. package/dist/theglobalfuel/utils/index.d.ts.map +0 -1
  132. package/dist/theglobalfuel/utils/navigation.d.ts +0 -14
  133. package/dist/theglobalfuel/utils/navigation.d.ts.map +0 -1
@@ -1,21 +1,23 @@
1
1
  import { PageLayout as e } from "../../components/PageLayout.js";
2
2
  import { MetricsCard as t } from "../../components/MetricsCard.js";
3
- import { formatDate as n, formatEnumLabel as r, formatMoney as i, formatNumber as a, formatUnit as ee, formatVolume as te } from "../../utils/formatters.js";
4
- import { StatusBadge as ne } from "../../components/StatusBadge.js";
5
- import { DataTable as re } from "../../components/DataTable.js";
6
- import { ErrorView as ie, LoadingView as ae } from "../../components/StateViews.js";
7
- import { EmptyState as oe } from "../../components/EmptyState.js";
8
- import { useTheAssets as o, useTheCreateInventoryLot as s, useTheInventoryLots as c, useTheSetInventoryLotStatus as se } from "../../hooks/useTheGlobalFuelApi.js";
9
- import { useCursorPager as ce } from "../../hooks/useCursorPager.js";
3
+ import { formatDate as n, formatEnumLabel as r, formatMoney as i, formatNumber as a, formatUnit as o, formatVolume as s, toBackendDate as ee } from "../../utils/formatters.js";
4
+ import { StatusBadge as te } from "../../components/StatusBadge.js";
5
+ import { DataTable as ne } from "../../components/DataTable.js";
6
+ import { ErrorView as re, LoadingView as ie } from "../../components/StateViews.js";
7
+ import { EmptyState as ae } from "../../components/EmptyState.js";
8
+ import { useTheAssets as oe, useTheCreateInventoryLot as se, useTheInventoryLots as c, useTheSetInventoryLotStatus as ce } from "../../hooks/useTheGlobalFuelApi.js";
9
+ import { useCursorPager as le } from "../../hooks/useCursorPager.js";
10
+ import { useNotify as ue } from "../../hooks/useNotify.js";
10
11
  import "../../hooks/index.js";
11
- import { FilterTabs as le } from "../../components/FilterTabs.js";
12
- import { Pagination as ue } from "../../components/Pagination.js";
12
+ import { INVENTORY_TRANSITIONS as de, nextStatuses as fe } from "../../utils/transitions.js";
13
+ import { FilterTabs as pe } from "../../components/FilterTabs.js";
14
+ import { Pagination as me } from "../../components/Pagination.js";
13
15
  import { useMemo as l, useState as u } from "react";
14
- import { Boxes as d, Coins as f, Layers as p, Plus as m, Warehouse as h } from "lucide-react";
15
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
16
- import { Button as y, Input as b, Label as x, ResponsiveDialog as de, ResponsiveDialogContent as S, ResponsiveDialogDescription as C, ResponsiveDialogFooter as fe, ResponsiveDialogHeader as pe, ResponsiveDialogTitle as me, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O, Textarea as k } from "@burdenoff/fe-libs/ui";
16
+ import { Boxes as d, Coins as f, Layers as he, Plus as p, Warehouse as ge } from "lucide-react";
17
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
18
+ import { Button as _, Input as v, Label as y, ResponsiveDialog as _e, ResponsiveDialogContent as ve, ResponsiveDialogDescription as ye, ResponsiveDialogFooter as b, ResponsiveDialogHeader as x, ResponsiveDialogTitle as S, Select as C, SelectContent as w, SelectItem as T, SelectTrigger as E, SelectValue as D, Textarea as O } from "@burdenoff/fe-libs/ui";
17
19
  //#region src/theglobalfuel/pages/inventory/InventoryPage.tsx
18
- var A = [
20
+ var k = [
19
21
  {
20
22
  value: "ALL",
21
23
  label: "All"
@@ -40,13 +42,7 @@ var A = [
40
42
  value: "WRITTEN_OFF",
41
43
  label: "Written off"
42
44
  }
43
- ], j = [
44
- "AVAILABLE",
45
- "RESERVED",
46
- "IN_TRANSIT",
47
- "CONSUMED",
48
- "WRITTEN_OFF"
49
- ], M = [
45
+ ], A = "__none__", j = [
50
46
  "CRUDE_OIL",
51
47
  "NATURAL_GAS",
52
48
  "LNG",
@@ -60,7 +56,7 @@ var A = [
60
56
  "GOLD",
61
57
  "LITHIUM",
62
58
  "RARE_EARTH"
63
- ], N = [
59
+ ], M = [
64
60
  "BARRELS",
65
61
  "CUBIC_METERS",
66
62
  "TONNES",
@@ -68,7 +64,7 @@ var A = [
68
64
  "MWH",
69
65
  "GJ",
70
66
  "MCF"
71
- ], P = 25, F = (e) => e.quantity * e.unitValue, I = {
67
+ ], N = 25, P = (e) => e.quantity * e.unitValue, F = {
72
68
  lotCode: "",
73
69
  commodity: "CRUDE_OIL",
74
70
  assetId: "",
@@ -81,49 +77,55 @@ var A = [
81
77
  producedAt: "",
82
78
  notes: ""
83
79
  };
84
- function L() {
85
- let [L, R] = u("ALL"), [z, he] = u("ALL"), B = ce(), [ge, V] = u(!1), [H, U] = u(I), [W, G] = u(null), { data: K, isLoading: _e, isError: ve, refetch: ye } = c({
86
- status: L === "ALL" ? void 0 : L,
87
- commodity: z === "ALL" ? void 0 : z,
80
+ function I() {
81
+ let [I, be] = u("ALL"), [L, xe] = u("ALL"), R = le(), [Se, z] = u(!1), [B, V] = u(F), [H, U] = u(null), [Ce, W] = u(null), G = ue(), { data: K, isLoading: we, isError: Te, refetch: Ee } = c({
82
+ status: I === "ALL" ? void 0 : I,
83
+ commodity: L === "ALL" ? void 0 : L,
88
84
  pagination: {
89
- limit: P,
90
- cursor: B.cursor
85
+ limit: N,
86
+ cursor: R.cursor
91
87
  }
92
- }), q = c({ pagination: { limit: 200 } }), J = o({ pagination: { limit: 200 } }), Y = s(), be = se(), X = l(() => K?.items ?? [], [K]), Z = l(() => {
88
+ }), q = c({ pagination: { limit: 200 } }), J = oe({ pagination: { limit: 200 } }), Y = se(), De = ce(), X = l(() => K?.items ?? [], [K]), Z = l(() => {
93
89
  let e = {};
94
90
  for (let t of J.data?.items ?? []) e[t.id] = t.code ? `${t.name} · ${t.code}` : t.name;
95
91
  return e;
96
92
  }, [J.data]), Q = l(() => {
97
- let e = q.data?.items ?? [], t = e.filter((e) => e.status === "AVAILABLE"), n = t.reduce((e, t) => e + (t.quantity ?? 0), 0), r = /* @__PURE__ */ new Map();
93
+ let e = q.data?.items ?? [], t = e.filter((e) => e.status === "AVAILABLE"), n = /* @__PURE__ */ new Map();
94
+ for (let e of t) n.set(e.unit, (n.get(e.unit) ?? 0) + (e.quantity ?? 0));
95
+ let r = null, i = 0;
96
+ for (let [e, t] of n) t > i && (i = t, r = e);
97
+ let a = /* @__PURE__ */ new Map();
98
98
  for (let e of t) {
99
99
  let t = e.currency || "USD";
100
- r.set(t, (r.get(t) ?? 0) + F(e));
100
+ a.set(t, (a.get(t) ?? 0) + P(e));
101
101
  }
102
- let i = "USD", a = 0;
103
- for (let [e, t] of r) t > a && (a = t, i = e);
102
+ let o = "USD", s = 0;
103
+ for (let [e, t] of a) t > s && (s = t, o = e);
104
104
  return {
105
105
  totalLots: e.length,
106
106
  availableCount: t.length,
107
- onHandQty: n,
108
- topCurrency: i,
109
- topValue: a,
110
- otherCurrencies: Math.max(0, r.size - 1)
107
+ qtyByUnit: n,
108
+ topUnit: r,
109
+ topUnitQty: i,
110
+ topCurrency: o,
111
+ topValue: s,
112
+ otherCurrencies: Math.max(0, a.size - 1)
111
113
  };
112
- }, [q.data]), xe = [
114
+ }, [q.data]), Oe = [
113
115
  {
114
116
  key: "lotCode",
115
117
  header: "Lot",
116
- render: (e) => /* @__PURE__ */ v("div", {
118
+ render: (e) => /* @__PURE__ */ g("div", {
117
119
  className: "flex items-center gap-3",
118
- children: [/* @__PURE__ */ _("div", {
120
+ children: [/* @__PURE__ */ h("div", {
119
121
  className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent",
120
- children: /* @__PURE__ */ _(d, { className: "h-4 w-4" })
121
- }), /* @__PURE__ */ v("div", {
122
+ children: /* @__PURE__ */ h(d, { className: "h-4 w-4" })
123
+ }), /* @__PURE__ */ g("div", {
122
124
  className: "min-w-0",
123
- children: [/* @__PURE__ */ _("p", {
125
+ children: [/* @__PURE__ */ h("p", {
124
126
  className: "truncate font-semibold text-text-primary",
125
127
  children: e.lotCode
126
- }), e.assetId && Z[e.assetId] && /* @__PURE__ */ _("p", {
128
+ }), e.assetId && Z[e.assetId] && /* @__PURE__ */ h("p", {
127
129
  className: "truncate text-xs text-text-tertiary",
128
130
  children: Z[e.assetId]
129
131
  })]
@@ -134,7 +136,7 @@ function L() {
134
136
  key: "commodity",
135
137
  header: "Commodity",
136
138
  hideOnMobile: !0,
137
- render: (e) => /* @__PURE__ */ _("span", {
139
+ render: (e) => /* @__PURE__ */ h("span", {
138
140
  className: "text-text-secondary",
139
141
  children: r(e.commodity)
140
142
  })
@@ -144,9 +146,9 @@ function L() {
144
146
  header: "Quantity",
145
147
  align: "right",
146
148
  sortValue: (e) => e.quantity,
147
- render: (e) => /* @__PURE__ */ _("span", {
149
+ render: (e) => /* @__PURE__ */ h("span", {
148
150
  className: "tabular-nums text-text-primary",
149
- children: te(e.quantity, e.unit)
151
+ children: s(e.quantity, e.unit)
150
152
  })
151
153
  },
152
154
  {
@@ -155,10 +157,10 @@ function L() {
155
157
  align: "right",
156
158
  hideOnMobile: !0,
157
159
  sortValue: (e) => e.grade ?? -1,
158
- render: (e) => e.grade == null ? /* @__PURE__ */ _("span", {
160
+ render: (e) => e.grade == null ? /* @__PURE__ */ h("span", {
159
161
  className: "text-text-tertiary",
160
162
  children: "—"
161
- }) : /* @__PURE__ */ _("span", {
163
+ }) : /* @__PURE__ */ h("span", {
162
164
  className: "tabular-nums text-text-secondary",
163
165
  children: a(e.grade)
164
166
  })
@@ -166,16 +168,16 @@ function L() {
166
168
  {
167
169
  key: "status",
168
170
  header: "Status",
169
- render: (e) => /* @__PURE__ */ _(ne, { status: e.status })
171
+ render: (e) => /* @__PURE__ */ h(te, { status: e.status })
170
172
  },
171
173
  {
172
174
  key: "location",
173
175
  header: "Location",
174
176
  hideOnMobile: !0,
175
- render: (e) => e.location ? /* @__PURE__ */ _("span", {
177
+ render: (e) => e.location ? /* @__PURE__ */ h("span", {
176
178
  className: "text-text-secondary",
177
179
  children: e.location
178
- }) : /* @__PURE__ */ _("span", {
180
+ }) : /* @__PURE__ */ h("span", {
179
181
  className: "text-text-tertiary",
180
182
  children: "—"
181
183
  })
@@ -185,10 +187,10 @@ function L() {
185
187
  header: "Value",
186
188
  align: "right",
187
189
  hideOnMobile: !0,
188
- sortValue: (e) => F(e),
189
- render: (e) => /* @__PURE__ */ _("span", {
190
+ sortValue: (e) => P(e),
191
+ render: (e) => /* @__PURE__ */ h("span", {
190
192
  className: "tabular-nums text-text-secondary",
191
- children: i(F(e), e.currency)
193
+ children: i(P(e), e.currency)
192
194
  })
193
195
  },
194
196
  {
@@ -197,7 +199,7 @@ function L() {
197
199
  align: "right",
198
200
  hideOnMobile: !0,
199
201
  sortValue: (e) => e.producedAt ? new Date(e.producedAt).getTime() : 0,
200
- render: (e) => /* @__PURE__ */ _("span", {
202
+ render: (e) => /* @__PURE__ */ h("span", {
201
203
  className: "text-text-tertiary",
202
204
  children: n(e.producedAt)
203
205
  })
@@ -206,60 +208,83 @@ function L() {
206
208
  key: "setStatus",
207
209
  header: "",
208
210
  align: "right",
209
- render: (e) => /* @__PURE__ */ v(w, {
210
- value: e.status,
211
- onValueChange: (t) => be.mutate({
212
- id: e.id,
213
- status: t
214
- }),
215
- children: [/* @__PURE__ */ _(D, {
216
- className: "h-8 w-36",
217
- "aria-label": `Change status for lot ${e.lotCode}`,
218
- children: /* @__PURE__ */ _(O, {})
219
- }), /* @__PURE__ */ _(T, { children: j.map((e) => /* @__PURE__ */ _(E, {
220
- value: e,
221
- children: r(e)
222
- }, e)) })]
223
- })
211
+ render: (e) => {
212
+ let t = fe(de, e.status), n = t.length === 0, i = Ce === e.id;
213
+ return /* @__PURE__ */ g(C, {
214
+ value: e.status,
215
+ disabled: n || i,
216
+ onValueChange: (t) => {
217
+ W(e.id), De.mutate({
218
+ id: e.id,
219
+ status: t
220
+ }, {
221
+ onSuccess: () => G.success("Lot status updated"),
222
+ onError: (e) => G.fromError(e),
223
+ onSettled: () => W(null)
224
+ });
225
+ },
226
+ children: [/* @__PURE__ */ h(E, {
227
+ className: "h-8 w-36",
228
+ "aria-label": `Change status for lot ${e.lotCode}`,
229
+ children: /* @__PURE__ */ h(D, {})
230
+ }), /* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, {
231
+ value: e.status,
232
+ disabled: !0,
233
+ children: r(e.status)
234
+ }), t.map((e) => /* @__PURE__ */ h(T, {
235
+ value: e,
236
+ children: r(e)
237
+ }, e))] })]
238
+ });
239
+ }
224
240
  }
225
241
  ], $ = () => {
226
- U(I), G(null);
227
- }, Se = async () => {
228
- if (!H.lotCode.trim()) {
229
- G("Lot code is required.");
242
+ V(F), U(null);
243
+ }, ke = async () => {
244
+ if (!B.lotCode.trim()) {
245
+ U("Lot code is required.");
230
246
  return;
231
247
  }
232
- if (!H.quantity) {
233
- G("Quantity is required.");
248
+ let e = Number(B.quantity);
249
+ if (!B.quantity || Number.isNaN(e) || e <= 0) {
250
+ U("Enter a quantity greater than zero."), G.error("Enter a quantity greater than zero.");
234
251
  return;
235
252
  }
236
- G(null);
253
+ U(null);
237
254
  try {
238
255
  await Y.mutateAsync({
239
- lotCode: H.lotCode.trim(),
240
- commodity: H.commodity,
241
- assetId: H.assetId || null,
242
- quantity: Number(H.quantity),
243
- unit: H.unit,
244
- grade: H.grade ? Number(H.grade) : null,
245
- location: H.location.trim() || null,
246
- unitValue: H.unitValue ? Number(H.unitValue) : null,
247
- currency: H.currency.trim() || "USD",
248
- producedAt: H.producedAt ? new Date(H.producedAt).toISOString() : null,
249
- notes: H.notes.trim() || null
250
- }), V(!1), $();
256
+ lotCode: B.lotCode.trim(),
257
+ commodity: B.commodity,
258
+ assetId: B.assetId || null,
259
+ quantity: e,
260
+ unit: B.unit,
261
+ grade: B.grade ? Number(B.grade) : null,
262
+ location: B.location.trim() || null,
263
+ unitValue: B.unitValue ? Number(B.unitValue) : null,
264
+ currency: B.currency.trim() || "USD",
265
+ producedAt: ee(B.producedAt) ?? null,
266
+ notes: B.notes.trim() || null
267
+ }), G.success("Inventory lot created"), z(!1), $();
251
268
  } catch (e) {
252
- G(e instanceof Error ? e.message : "Failed to create inventory lot.");
269
+ U(e instanceof Error ? e.message : "Failed to create inventory lot."), G.fromError(e);
253
270
  }
254
- }, Ce = q.data && Q.availableCount > 0 ? /* @__PURE__ */ v("p", {
255
- className: "text-xs text-text-tertiary",
256
- children: [
257
- "across ",
258
- Q.availableCount,
259
- " available ",
260
- Q.availableCount === 1 ? "lot" : "lots"
261
- ]
262
- }) : void 0, we = q.data && Q.otherCurrencies > 0 ? /* @__PURE__ */ v("p", {
271
+ }, Ae = (() => {
272
+ if (q.data) {
273
+ if (Q.qtyByUnit.size > 1) return /* @__PURE__ */ h("p", {
274
+ className: "text-xs text-text-tertiary",
275
+ children: [...Q.qtyByUnit.entries()].sort((e, t) => t[1] - e[1]).map(([e, t]) => s(t, e)).join(" · ")
276
+ });
277
+ if (Q.availableCount > 0) return /* @__PURE__ */ g("p", {
278
+ className: "text-xs text-text-tertiary",
279
+ children: [
280
+ "across ",
281
+ Q.availableCount,
282
+ " available ",
283
+ Q.availableCount === 1 ? "lot" : "lots"
284
+ ]
285
+ });
286
+ }
287
+ })(), je = q.data && Q.otherCurrencies > 0 ? /* @__PURE__ */ g("p", {
263
288
  className: "text-xs text-text-tertiary",
264
289
  children: [
265
290
  "in ",
@@ -271,210 +296,216 @@ function L() {
271
296
  Q.otherCurrencies === 1 ? "currency" : "currencies"
272
297
  ]
273
298
  }) : void 0;
274
- return /* @__PURE__ */ v(e, {
299
+ return /* @__PURE__ */ g(e, {
275
300
  title: "Inventory",
276
301
  description: "Commodity inventory lots — on-hand quantity, grade, location & book value across the portfolio.",
277
- actions: /* @__PURE__ */ v(y, {
278
- onClick: () => V(!0),
279
- children: [/* @__PURE__ */ _(m, { className: "mr-1.5 h-4 w-4" }), " New lot"]
302
+ actions: /* @__PURE__ */ g(_, {
303
+ onClick: () => z(!0),
304
+ children: [/* @__PURE__ */ h(p, { className: "mr-1.5 h-4 w-4" }), " New lot"]
280
305
  }),
281
306
  children: [
282
- /* @__PURE__ */ v("div", {
307
+ /* @__PURE__ */ g("div", {
283
308
  className: "mb-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
284
309
  children: [
285
- /* @__PURE__ */ _(t, {
286
- icon: /* @__PURE__ */ _(h, { className: "h-5 w-5" }),
310
+ /* @__PURE__ */ h(t, {
311
+ icon: /* @__PURE__ */ h(ge, { className: "h-5 w-5" }),
287
312
  value: q.data ? a(Q.totalLots) : "—",
288
313
  label: "Inventory lots",
289
314
  featured: !0,
290
- footer: q.data ? /* @__PURE__ */ v("p", {
315
+ footer: q.data ? /* @__PURE__ */ g("p", {
291
316
  className: "text-xs text-text-tertiary",
292
317
  children: [a(Q.availableCount), " available"]
293
318
  }) : void 0
294
319
  }),
295
- /* @__PURE__ */ _(t, {
296
- icon: /* @__PURE__ */ _(p, { className: "h-5 w-5" }),
297
- value: q.data ? a(Q.onHandQty) : "—",
320
+ /* @__PURE__ */ h(t, {
321
+ icon: /* @__PURE__ */ h(he, { className: "h-5 w-5" }),
322
+ value: q.data ? s(Q.topUnitQty, Q.topUnit) : "—",
298
323
  label: "On-hand quantity",
299
324
  accent: "success",
300
- footer: Ce
325
+ footer: Ae
301
326
  }),
302
- /* @__PURE__ */ _(t, {
303
- icon: /* @__PURE__ */ _(f, { className: "h-5 w-5" }),
327
+ /* @__PURE__ */ h(t, {
328
+ icon: /* @__PURE__ */ h(f, { className: "h-5 w-5" }),
304
329
  value: q.data ? i(Q.topValue, Q.topCurrency) : "—",
305
330
  label: "Inventory value",
306
- footer: we
331
+ footer: je
307
332
  })
308
333
  ]
309
334
  }),
310
- /* @__PURE__ */ v("div", {
335
+ /* @__PURE__ */ g("div", {
311
336
  className: "mb-5 flex flex-wrap items-center gap-3",
312
- children: [/* @__PURE__ */ _(le, {
313
- options: A,
314
- value: L,
337
+ children: [/* @__PURE__ */ h(pe, {
338
+ options: k,
339
+ value: I,
315
340
  onChange: (e) => {
316
- R(e), B.reset();
341
+ be(e), R.reset();
317
342
  }
318
- }), /* @__PURE__ */ v(w, {
319
- value: z,
343
+ }), /* @__PURE__ */ g(C, {
344
+ value: L,
320
345
  onValueChange: (e) => {
321
- he(e), B.reset();
346
+ xe(e), R.reset();
322
347
  },
323
- children: [/* @__PURE__ */ _(D, {
348
+ children: [/* @__PURE__ */ h(E, {
324
349
  className: "w-48",
325
- children: /* @__PURE__ */ _(O, { placeholder: "All commodities" })
326
- }), /* @__PURE__ */ v(T, { children: [/* @__PURE__ */ _(E, {
350
+ "aria-label": "Filter by commodity",
351
+ children: /* @__PURE__ */ h(D, { placeholder: "All commodities" })
352
+ }), /* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, {
327
353
  value: "ALL",
328
354
  children: "All commodities"
329
- }), M.map((e) => /* @__PURE__ */ _(E, {
355
+ }), j.map((e) => /* @__PURE__ */ h(T, {
330
356
  value: e,
331
357
  children: r(e)
332
358
  }, e))] })]
333
359
  })]
334
360
  }),
335
- _e ? /* @__PURE__ */ _(ae, { label: "Loading inventory…" }) : ve ? /* @__PURE__ */ _(ie, {
361
+ we ? /* @__PURE__ */ h(ie, { label: "Loading inventory…" }) : Te ? /* @__PURE__ */ h(re, {
336
362
  message: "Couldn't load inventory lots.",
337
- onRetry: () => ye()
338
- }) : X.length === 0 ? /* @__PURE__ */ _(oe, {
363
+ onRetry: () => Ee()
364
+ }) : X.length === 0 ? /* @__PURE__ */ h(ae, {
339
365
  illustration: "empty-data",
340
- icon: /* @__PURE__ */ _(d, { className: "h-10 w-10" }),
366
+ icon: /* @__PURE__ */ h(d, { className: "h-10 w-10" }),
341
367
  title: "No inventory lots yet",
342
- description: L === "ALL" && z === "ALL" ? "Create your first inventory lot to track on-hand commodity quantity, grade and value." : "No lots match these filters.",
343
- action: /* @__PURE__ */ v(y, {
344
- onClick: () => V(!0),
345
- children: [/* @__PURE__ */ _(m, { className: "mr-1.5 h-4 w-4" }), " New lot"]
368
+ description: I === "ALL" && L === "ALL" ? "Create your first inventory lot to track on-hand commodity quantity, grade and value." : "No lots match these filters.",
369
+ action: /* @__PURE__ */ g(_, {
370
+ onClick: () => z(!0),
371
+ children: [/* @__PURE__ */ h(p, { className: "mr-1.5 h-4 w-4" }), " New lot"]
346
372
  })
347
- }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(re, {
348
- columns: xe,
373
+ }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(ne, {
374
+ columns: Oe,
349
375
  rows: X,
350
376
  rowKey: (e) => e.id
351
- }), /* @__PURE__ */ _(ue, {
352
- page: B.page,
353
- pageSize: P,
377
+ }), /* @__PURE__ */ h(me, {
378
+ page: R.page,
379
+ pageSize: N,
354
380
  itemCount: X.length,
355
381
  hasMore: K?.pageInfo?.hasMore ?? !1,
356
- onPageChange: (e) => B.onPageChange(e, K?.pageInfo?.cursor)
382
+ onPageChange: (e) => R.onPageChange(e, K?.pageInfo?.cursor)
357
383
  })] }),
358
- /* @__PURE__ */ _(de, {
359
- open: ge,
384
+ /* @__PURE__ */ h(_e, {
385
+ open: Se,
360
386
  onOpenChange: (e) => {
361
- V(e), e || $();
387
+ z(e), e || $();
362
388
  },
363
- children: /* @__PURE__ */ v(S, { children: [
364
- /* @__PURE__ */ v(pe, { children: [/* @__PURE__ */ _(me, { children: "New inventory lot" }), /* @__PURE__ */ _(C, { children: "Register an on-hand quantity of a commodity — optionally attributed to a producing asset." })] }),
365
- /* @__PURE__ */ v("div", {
389
+ children: /* @__PURE__ */ g(ve, { children: [/* @__PURE__ */ g(x, { children: [/* @__PURE__ */ h(S, { children: "New inventory lot" }), /* @__PURE__ */ h(ye, { children: "Register an on-hand quantity of a commodity — optionally attributed to a producing asset." })] }), /* @__PURE__ */ g("form", {
390
+ onSubmit: (e) => {
391
+ e.preventDefault(), ke();
392
+ },
393
+ children: [/* @__PURE__ */ g("div", {
366
394
  className: "grid gap-4 py-2",
367
395
  children: [
368
- /* @__PURE__ */ v("div", {
396
+ /* @__PURE__ */ g("div", {
369
397
  className: "grid gap-2 sm:grid-cols-2",
370
- children: [/* @__PURE__ */ v("div", {
398
+ children: [/* @__PURE__ */ g("div", {
371
399
  className: "grid gap-1.5",
372
- children: [/* @__PURE__ */ _(x, {
400
+ children: [/* @__PURE__ */ h(y, {
373
401
  htmlFor: "lotCode",
374
402
  children: "Lot code *"
375
- }), /* @__PURE__ */ _(b, {
403
+ }), /* @__PURE__ */ h(v, {
376
404
  id: "lotCode",
377
- value: H.lotCode,
378
- onChange: (e) => U({
379
- ...H,
405
+ value: B.lotCode,
406
+ onChange: (e) => V({
407
+ ...B,
380
408
  lotCode: e.target.value
381
409
  }),
382
410
  placeholder: "LOT-2026-0042"
383
411
  })]
384
- }), /* @__PURE__ */ v("div", {
412
+ }), /* @__PURE__ */ g("div", {
385
413
  className: "grid gap-1.5",
386
- children: [/* @__PURE__ */ _(x, {
414
+ children: [/* @__PURE__ */ h(y, {
387
415
  htmlFor: "commodity",
388
416
  children: "Commodity *"
389
- }), /* @__PURE__ */ v(w, {
390
- value: H.commodity,
391
- onValueChange: (e) => U({
392
- ...H,
417
+ }), /* @__PURE__ */ g(C, {
418
+ value: B.commodity,
419
+ onValueChange: (e) => V({
420
+ ...B,
393
421
  commodity: e
394
422
  }),
395
- children: [/* @__PURE__ */ _(D, {
423
+ children: [/* @__PURE__ */ h(E, {
396
424
  id: "commodity",
397
- children: /* @__PURE__ */ _(O, {})
398
- }), /* @__PURE__ */ _(T, { children: M.map((e) => /* @__PURE__ */ _(E, {
425
+ children: /* @__PURE__ */ h(D, {})
426
+ }), /* @__PURE__ */ h(w, { children: j.map((e) => /* @__PURE__ */ h(T, {
399
427
  value: e,
400
428
  children: r(e)
401
429
  }, e)) })]
402
430
  })]
403
431
  })]
404
432
  }),
405
- /* @__PURE__ */ v("div", {
433
+ /* @__PURE__ */ g("div", {
406
434
  className: "grid gap-1.5",
407
- children: [/* @__PURE__ */ _(x, {
435
+ children: [/* @__PURE__ */ h(y, {
408
436
  htmlFor: "assetId",
409
437
  children: "Produced by asset"
410
- }), /* @__PURE__ */ v(w, {
411
- value: H.assetId,
412
- onValueChange: (e) => U({
413
- ...H,
414
- assetId: e
438
+ }), /* @__PURE__ */ g(C, {
439
+ value: B.assetId || A,
440
+ onValueChange: (e) => V({
441
+ ...B,
442
+ assetId: e === A ? "" : e
415
443
  }),
416
- children: [/* @__PURE__ */ _(D, {
444
+ children: [/* @__PURE__ */ h(E, {
417
445
  id: "assetId",
418
- children: /* @__PURE__ */ _(O, { placeholder: "Optional — link to a producing asset" })
419
- }), /* @__PURE__ */ _(T, { children: Object.entries(Z).map(([e, t]) => /* @__PURE__ */ _(E, {
446
+ children: /* @__PURE__ */ h(D, { placeholder: "Optional — link to a producing asset" })
447
+ }), /* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, {
448
+ value: A,
449
+ children: "None"
450
+ }), Object.entries(Z).map(([e, t]) => /* @__PURE__ */ h(T, {
420
451
  value: e,
421
452
  children: t
422
- }, e)) })]
453
+ }, e))] })]
423
454
  })]
424
455
  }),
425
- /* @__PURE__ */ v("div", {
456
+ /* @__PURE__ */ g("div", {
426
457
  className: "grid gap-2 sm:grid-cols-3",
427
458
  children: [
428
- /* @__PURE__ */ v("div", {
459
+ /* @__PURE__ */ g("div", {
429
460
  className: "grid gap-1.5",
430
- children: [/* @__PURE__ */ _(x, {
461
+ children: [/* @__PURE__ */ h(y, {
431
462
  htmlFor: "quantity",
432
463
  children: "Quantity *"
433
- }), /* @__PURE__ */ _(b, {
464
+ }), /* @__PURE__ */ h(v, {
434
465
  id: "quantity",
435
466
  type: "number",
436
467
  min: "0",
437
468
  step: "any",
438
- value: H.quantity,
439
- onChange: (e) => U({
440
- ...H,
469
+ value: B.quantity,
470
+ onChange: (e) => V({
471
+ ...B,
441
472
  quantity: e.target.value
442
473
  }),
443
474
  placeholder: "120000"
444
475
  })]
445
476
  }),
446
- /* @__PURE__ */ v("div", {
477
+ /* @__PURE__ */ g("div", {
447
478
  className: "grid gap-1.5",
448
- children: [/* @__PURE__ */ _(x, {
479
+ children: [/* @__PURE__ */ h(y, {
449
480
  htmlFor: "unit",
450
481
  children: "Unit"
451
- }), /* @__PURE__ */ v(w, {
452
- value: H.unit,
453
- onValueChange: (e) => U({
454
- ...H,
482
+ }), /* @__PURE__ */ g(C, {
483
+ value: B.unit,
484
+ onValueChange: (e) => V({
485
+ ...B,
455
486
  unit: e
456
487
  }),
457
- children: [/* @__PURE__ */ _(D, {
488
+ children: [/* @__PURE__ */ h(E, {
458
489
  id: "unit",
459
- children: /* @__PURE__ */ _(O, {})
460
- }), /* @__PURE__ */ _(T, { children: N.map((e) => /* @__PURE__ */ _(E, {
490
+ children: /* @__PURE__ */ h(D, {})
491
+ }), /* @__PURE__ */ h(w, { children: M.map((e) => /* @__PURE__ */ h(T, {
461
492
  value: e,
462
- children: ee(e)
493
+ children: o(e)
463
494
  }, e)) })]
464
495
  })]
465
496
  }),
466
- /* @__PURE__ */ v("div", {
497
+ /* @__PURE__ */ g("div", {
467
498
  className: "grid gap-1.5",
468
- children: [/* @__PURE__ */ _(x, {
499
+ children: [/* @__PURE__ */ h(y, {
469
500
  htmlFor: "grade",
470
501
  children: "Grade"
471
- }), /* @__PURE__ */ _(b, {
502
+ }), /* @__PURE__ */ h(v, {
472
503
  id: "grade",
473
504
  type: "number",
474
505
  step: "any",
475
- value: H.grade,
476
- onChange: (e) => U({
477
- ...H,
506
+ value: B.grade,
507
+ onChange: (e) => V({
508
+ ...B,
478
509
  grade: e.target.value
479
510
  }),
480
511
  placeholder: "0.32"
@@ -482,111 +513,113 @@ function L() {
482
513
  })
483
514
  ]
484
515
  }),
485
- /* @__PURE__ */ v("div", {
516
+ /* @__PURE__ */ g("div", {
486
517
  className: "grid gap-2 sm:grid-cols-3",
487
518
  children: [
488
- /* @__PURE__ */ v("div", {
519
+ /* @__PURE__ */ g("div", {
489
520
  className: "grid gap-1.5",
490
- children: [/* @__PURE__ */ _(x, {
521
+ children: [/* @__PURE__ */ h(y, {
491
522
  htmlFor: "unitValue",
492
523
  children: "Unit value"
493
- }), /* @__PURE__ */ _(b, {
524
+ }), /* @__PURE__ */ h(v, {
494
525
  id: "unitValue",
495
526
  type: "number",
496
527
  min: "0",
497
528
  step: "any",
498
- value: H.unitValue,
499
- onChange: (e) => U({
500
- ...H,
529
+ value: B.unitValue,
530
+ onChange: (e) => V({
531
+ ...B,
501
532
  unitValue: e.target.value
502
533
  }),
503
534
  placeholder: "82.50"
504
535
  })]
505
536
  }),
506
- /* @__PURE__ */ v("div", {
537
+ /* @__PURE__ */ g("div", {
507
538
  className: "grid gap-1.5",
508
- children: [/* @__PURE__ */ _(x, {
539
+ children: [/* @__PURE__ */ h(y, {
509
540
  htmlFor: "currency",
510
541
  children: "Currency"
511
- }), /* @__PURE__ */ _(b, {
542
+ }), /* @__PURE__ */ h(v, {
512
543
  id: "currency",
513
- value: H.currency,
514
- onChange: (e) => U({
515
- ...H,
544
+ value: B.currency,
545
+ onChange: (e) => V({
546
+ ...B,
516
547
  currency: e.target.value
517
548
  }),
518
549
  placeholder: "USD"
519
550
  })]
520
551
  }),
521
- /* @__PURE__ */ v("div", {
552
+ /* @__PURE__ */ g("div", {
522
553
  className: "grid gap-1.5",
523
- children: [/* @__PURE__ */ _(x, {
554
+ children: [/* @__PURE__ */ h(y, {
524
555
  htmlFor: "producedAt",
525
556
  children: "Produced at"
526
- }), /* @__PURE__ */ _(b, {
557
+ }), /* @__PURE__ */ h(v, {
527
558
  id: "producedAt",
528
559
  type: "date",
529
- value: H.producedAt,
530
- onChange: (e) => U({
531
- ...H,
560
+ value: B.producedAt,
561
+ onChange: (e) => V({
562
+ ...B,
532
563
  producedAt: e.target.value
533
564
  })
534
565
  })]
535
566
  })
536
567
  ]
537
568
  }),
538
- /* @__PURE__ */ v("div", {
569
+ /* @__PURE__ */ g("div", {
539
570
  className: "grid gap-1.5",
540
- children: [/* @__PURE__ */ _(x, {
571
+ children: [/* @__PURE__ */ h(y, {
541
572
  htmlFor: "location",
542
573
  children: "Location"
543
- }), /* @__PURE__ */ _(b, {
574
+ }), /* @__PURE__ */ h(v, {
544
575
  id: "location",
545
- value: H.location,
546
- onChange: (e) => U({
547
- ...H,
576
+ value: B.location,
577
+ onChange: (e) => V({
578
+ ...B,
548
579
  location: e.target.value
549
580
  }),
550
581
  placeholder: "Rotterdam Tank Farm 3"
551
582
  })]
552
583
  }),
553
- /* @__PURE__ */ v("div", {
584
+ /* @__PURE__ */ g("div", {
554
585
  className: "grid gap-1.5",
555
- children: [/* @__PURE__ */ _(x, {
586
+ children: [/* @__PURE__ */ h(y, {
556
587
  htmlFor: "notes",
557
588
  children: "Notes"
558
- }), /* @__PURE__ */ _(k, {
589
+ }), /* @__PURE__ */ h(O, {
559
590
  id: "notes",
560
591
  rows: 2,
561
- value: H.notes,
562
- onChange: (e) => U({
563
- ...H,
592
+ value: B.notes,
593
+ onChange: (e) => V({
594
+ ...B,
564
595
  notes: e.target.value
565
596
  }),
566
597
  placeholder: "Optional context about this lot."
567
598
  })]
568
599
  }),
569
- W && /* @__PURE__ */ _("p", {
600
+ H && /* @__PURE__ */ h("p", {
570
601
  className: "text-sm text-status-error-text",
571
- children: W
602
+ children: H
572
603
  })
573
604
  ]
574
- }),
575
- /* @__PURE__ */ v(fe, { children: [/* @__PURE__ */ _(y, {
605
+ }), /* @__PURE__ */ g(b, { children: [/* @__PURE__ */ h(_, {
606
+ type: "button",
576
607
  variant: "outline",
577
- onClick: () => V(!1),
608
+ onClick: () => {
609
+ z(!1), $();
610
+ },
578
611
  children: "Cancel"
579
- }), /* @__PURE__ */ _(y, {
580
- onClick: Se,
612
+ }), /* @__PURE__ */ h(_, {
613
+ type: "submit",
581
614
  disabled: Y.isPending,
582
615
  children: Y.isPending ? "Creating…" : "Create lot"
583
- })] })
584
- ] })
616
+ })] })]
617
+ })] })
585
618
  })
586
619
  ]
587
620
  });
588
621
  }
589
622
  //#endregion
590
- export { L as InventoryPage };
623
+ export { I as InventoryPage };
591
624
 
592
625
  //# sourceMappingURL=InventoryPage.js.map