@burdenoff/microfe-assethandler 2026.805.1 → 2026.810.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 (23) hide show
  1. package/dist/assethandler/pages/AssetsAssetCategoriesPage.d.ts.map +1 -1
  2. package/dist/assethandler/pages/AssetsAssetCategoriesPage.js +148 -147
  3. package/dist/assethandler/pages/AssetsAssetCategoriesPage.js.map +1 -1
  4. package/dist/assethandler/pages/AssetsAssetCreatePage.d.ts.map +1 -1
  5. package/dist/assethandler/pages/AssetsAssetCreatePage.js +229 -224
  6. package/dist/assethandler/pages/AssetsAssetCreatePage.js.map +1 -1
  7. package/dist/assethandler/pages/AssetsAssetDetailPage.d.ts.map +1 -1
  8. package/dist/assethandler/pages/AssetsAssetDetailPage.js +295 -293
  9. package/dist/assethandler/pages/AssetsAssetDetailPage.js.map +1 -1
  10. package/dist/assethandler/pages/AssetsAssetListPage.d.ts.map +1 -1
  11. package/dist/assethandler/pages/AssetsAssetListPage.js +97 -95
  12. package/dist/assethandler/pages/AssetsAssetListPage.js.map +1 -1
  13. package/dist/assethandler/providers/AssetHandlerProvider.d.ts +5 -0
  14. package/dist/assethandler/providers/AssetHandlerProvider.d.ts.map +1 -1
  15. package/dist/assethandler/providers/AssetHandlerProvider.js +9 -2
  16. package/dist/assethandler/providers/AssetHandlerProvider.js.map +1 -1
  17. package/dist/assethandler/types/index.d.ts +8 -0
  18. package/dist/assethandler/types/index.d.ts.map +1 -1
  19. package/dist/assethandler/utils/categoryPresentation.d.ts +2 -0
  20. package/dist/assethandler/utils/categoryPresentation.d.ts.map +1 -0
  21. package/dist/assethandler/utils/categoryPresentation.js +8 -0
  22. package/dist/assethandler/utils/categoryPresentation.js.map +1 -0
  23. package/package.json +1 -1
@@ -1,19 +1,20 @@
1
1
  import { useAssetHandlerStore as e } from "../store/assethandlerStore.js";
2
- import { useHiddenCategoryIds as t } from "../providers/AssetHandlerProvider.js";
3
- import { useAssetHandlerNavigate as n } from "../hooks/useAssetHandlerNavigate.js";
4
- import { notify as r } from "../utils/toast.js";
5
- import { formatCurrencyCompact as i } from "../components/charts/chartTheme.js";
6
- import { TrendChart as a } from "../components/charts/TrendChart.js";
7
- import { ChartCard as o } from "../components/ChartCard.js";
2
+ import { formatAssetCategory as t } from "../utils/categoryPresentation.js";
3
+ import { useAssetCategoryPresentation as n, useHiddenCategoryIds as r } from "../providers/AssetHandlerProvider.js";
4
+ import { useAssetHandlerNavigate as i } from "../hooks/useAssetHandlerNavigate.js";
5
+ import { notify as a } from "../utils/toast.js";
6
+ import { formatCurrencyCompact as o } from "../components/charts/chartTheme.js";
7
+ import { TrendChart as s } from "../components/charts/TrendChart.js";
8
+ import { ChartCard as c } from "../components/ChartCard.js";
8
9
  import "../components/index.js";
9
- import { useMemo as s, useRef as ee, useState as c } from "react";
10
- import { ArrowLeft as l, Info as u, Loader2 as d, Save as f, TrendingDown as p, X as m } from "lucide-react";
11
- import { gql as h } from "@apollo/client";
12
- import { useMutation as te } from "@apollo/client/react";
13
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
14
- import { Badge as v, Button as y, GlassCard as b, GradientText as x, Input as S, Label as C, PagePurpose as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k, Textarea as A } from "@burdenoff/fe-libs/ui";
10
+ import { useMemo as l, useRef as ee, useState as u } from "react";
11
+ import { ArrowLeft as d, Info as te, Loader2 as f, Save as p, TrendingDown as m, X as h } from "lucide-react";
12
+ import { gql as g } from "@apollo/client";
13
+ import { useMutation as _ } from "@apollo/client/react";
14
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
15
+ import { Badge as b, Button as x, GlassCard as S, GradientText as ne, Input as C, Label as w, PagePurpose as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A, Textarea as j } from "@burdenoff/fe-libs/ui";
15
16
  //#region src/assethandler/pages/AssetsAssetCreatePage.tsx
16
- var j = h`
17
+ var re = g`
17
18
  mutation AssetHandlerCreateAsset($input: CreateAssetInput!) {
18
19
  createAsset(input: $input) {
19
20
  id
@@ -21,7 +22,7 @@ var j = h`
21
22
  name
22
23
  }
23
24
  }
24
- `, M = [
25
+ `, ie = [
25
26
  "electronics",
26
27
  "it_hardware",
27
28
  "furniture",
@@ -30,7 +31,7 @@ var j = h`
30
31
  "software",
31
32
  "networking",
32
33
  "servers"
33
- ], N = {
34
+ ], M = {
34
35
  name: "",
35
36
  description: "",
36
37
  category: "it_hardware",
@@ -51,7 +52,7 @@ var j = h`
51
52
  supplier: "",
52
53
  department: ""
53
54
  };
54
- function P(e) {
55
+ function N(e) {
55
56
  let t = e.purchaseValue, n = e.usefulLifeMonths;
56
57
  if (!t || t <= 0 || !n || n <= 0) return [];
57
58
  let r = Math.max(0, Math.min(e.salvageValue ?? 0, t)), i = e.method.toLowerCase(), a = Math.max(1, Math.round(n / 12));
@@ -87,127 +88,131 @@ function P(e) {
87
88
  }
88
89
  return o;
89
90
  }
90
- var F = ({ title: e, description: t, children: n, glow: r }) => /* @__PURE__ */ g(b, {
91
+ var P = ({ title: e, description: t, children: n, glow: r }) => /* @__PURE__ */ v(S, {
91
92
  treatment: "glass",
92
93
  glow: r,
93
94
  className: "border-border-seam",
94
- children: /* @__PURE__ */ _("div", {
95
+ children: /* @__PURE__ */ y("div", {
95
96
  className: "space-y-4 p-5 sm:p-6",
96
- children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h2", {
97
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h2", {
97
98
  className: "text-lg font-semibold",
98
99
  children: e
99
- }), t ? /* @__PURE__ */ g("p", {
100
+ }), t ? /* @__PURE__ */ v("p", {
100
101
  className: "mt-0.5 text-sm text-text-secondary",
101
102
  children: t
102
103
  }) : null] }), n]
103
104
  })
104
105
  });
105
- function I() {
106
- let h = n(), b = t(), { assets: I } = e(), [L, R] = c(N), [z, B] = c([]), [V, H] = c(""), [U, W] = c({}), [G, K] = c(null), q = ee(!1), J = s(() => {
107
- let e = new Set(M);
108
- for (let t of I) t.category && e.add(t.category);
109
- return [...e].filter((e) => !b.has(e)).sort();
110
- }, [I, b]), [ne, { loading: Y }] = te(j, {
106
+ function F() {
107
+ let g = i(), S = r(), { labels: F, options: I } = n(), { assets: L } = e(), [R, z] = u(M), [B, V] = u([]), [H, U] = u(""), [W, G] = u({}), [K, q] = u(null), J = ee(!1), ae = l(() => {
108
+ let e = new Set(I?.map((e) => e.id) ?? ie);
109
+ if (!I) for (let t of L) t.category && e.add(t.category);
110
+ return [...e].filter((e) => !S.has(e)).sort();
111
+ }, [
112
+ L,
113
+ I,
114
+ S
115
+ ]), [oe, { loading: Y }] = _(re, {
111
116
  refetchQueries: ["AssetHandlerBootstrap"],
112
117
  onCompleted: (e) => {
113
- r.success("Asset created", `${e.createAsset.name} was registered in the inventory.`), K(null), q.current ? (q.current = !1, R(N), B([]), H(""), W({}), typeof window < "u" && window.scrollTo({
118
+ a.success("Asset created", `${e.createAsset.name} was registered in the inventory.`), q(null), J.current ? (J.current = !1, z(M), V([]), U(""), G({}), typeof window < "u" && window.scrollTo({
114
119
  top: 0,
115
120
  behavior: "smooth"
116
- })) : h(`/assets/${e.createAsset.id}`);
121
+ })) : g(`/assets/${e.createAsset.id}`);
117
122
  },
118
123
  onError: (e) => {
119
- K(null), r.error("Could not create asset", e.message);
124
+ q(null), a.error("Could not create asset", e.message);
120
125
  }
121
126
  }), X = (e, t) => {
122
- R((n) => ({
127
+ z((n) => ({
123
128
  ...n,
124
129
  [e]: t
125
- })), W((t) => {
130
+ })), G((t) => {
126
131
  if (!t[e]) return t;
127
132
  let n = { ...t };
128
133
  return delete n[e], n;
129
134
  });
130
135
  }, Z = () => {
131
- let e = V.trim().replace(/,$/, "").trim();
132
- e && !z.includes(e) && B((t) => [...t, e]), H("");
133
- }, re = (e) => {
134
- e.key === "Enter" || e.key === "," ? (e.preventDefault(), Z()) : e.key === "Backspace" && V === "" && z.length > 0 && B((e) => e.slice(0, -1));
135
- }, Q = s(() => P({
136
- purchaseValue: L.purchaseValue.trim() ? Number(L.purchaseValue) : null,
137
- salvageValue: L.salvageValue.trim() ? Number(L.salvageValue) : null,
138
- usefulLifeMonths: L.usefulLifeMonths.trim() ? Number(L.usefulLifeMonths) : null,
139
- method: L.depreciationMethod,
140
- unitsOfProductionCapacity: L.unitsOfProductionCapacity.trim() ? Number(L.unitsOfProductionCapacity) : null,
141
- unitsProduced: L.unitsProduced.trim() ? Number(L.unitsProduced) : null
136
+ let e = H.trim().replace(/,$/, "").trim();
137
+ e && !B.includes(e) && V((t) => [...t, e]), U("");
138
+ }, se = (e) => {
139
+ e.key === "Enter" || e.key === "," ? (e.preventDefault(), Z()) : e.key === "Backspace" && H === "" && B.length > 0 && V((e) => e.slice(0, -1));
140
+ }, Q = l(() => N({
141
+ purchaseValue: R.purchaseValue.trim() ? Number(R.purchaseValue) : null,
142
+ salvageValue: R.salvageValue.trim() ? Number(R.salvageValue) : null,
143
+ usefulLifeMonths: R.usefulLifeMonths.trim() ? Number(R.usefulLifeMonths) : null,
144
+ method: R.depreciationMethod,
145
+ unitsOfProductionCapacity: R.unitsOfProductionCapacity.trim() ? Number(R.unitsOfProductionCapacity) : null,
146
+ unitsProduced: R.unitsProduced.trim() ? Number(R.unitsProduced) : null
142
147
  }), [
143
- L.purchaseValue,
144
- L.salvageValue,
145
- L.usefulLifeMonths,
146
- L.depreciationMethod,
147
- L.unitsOfProductionCapacity,
148
- L.unitsProduced
148
+ R.purchaseValue,
149
+ R.salvageValue,
150
+ R.usefulLifeMonths,
151
+ R.depreciationMethod,
152
+ R.unitsOfProductionCapacity,
153
+ R.unitsProduced
149
154
  ]), $ = (e) => {
150
155
  let t = {};
151
- L.name.trim() || (t.name = "Asset name is required"), L.assetNumber.trim() || (t.assetNumber = "Asset tag is required"), L.category.trim() || (t.category = "Category is required");
156
+ R.name.trim() || (t.name = "Asset name is required"), R.assetNumber.trim() || (t.assetNumber = "Asset tag is required"), R.category.trim() || (t.category = "Category is required");
152
157
  let n = (e, n, r) => {
153
158
  if (e.trim() === "") return;
154
159
  let i = Number(e);
155
160
  (Number.isNaN(i) || i < 0) && (t[r] = `${n} must be a positive number`);
156
161
  };
157
- if (n(L.purchaseValue, "Purchase value", "purchaseValue"), n(L.salvageValue, "Salvage value", "salvageValue"), n(L.usefulLifeMonths, "Useful life", "usefulLifeMonths"), W(t), Object.keys(t).length > 0) {
158
- r.warning("Missing required fields", "Fill in the highlighted fields and try again.");
162
+ if (n(R.purchaseValue, "Purchase value", "purchaseValue"), n(R.salvageValue, "Salvage value", "salvageValue"), n(R.usefulLifeMonths, "Useful life", "usefulLifeMonths"), G(t), Object.keys(t).length > 0) {
163
+ a.warning("Missing required fields", "Fill in the highlighted fields and try again.");
159
164
  return;
160
165
  }
161
- let i = (e) => {
166
+ let r = (e) => {
162
167
  let t = e.trim();
163
168
  if (t === "") return null;
164
169
  let n = Number(t);
165
170
  return Number.isNaN(n) ? null : n;
166
- }, a = (e) => e.trim() === "" ? null : new Date(e).toISOString();
167
- q.current = e, K(e ? "add" : "create"), ne({ variables: { input: {
168
- name: L.name.trim(),
169
- assetNumber: L.assetNumber.trim(),
170
- category: L.category,
171
- status: L.status,
172
- condition: L.condition,
173
- description: L.description.trim() || null,
174
- serialNumber: L.serialNumber.trim() || null,
175
- locationName: L.locationName.trim() || null,
176
- assignedTo: L.assignedTo.trim() || null,
177
- tags: z,
178
- purchaseValue: i(L.purchaseValue),
179
- purchaseDate: a(L.purchaseDate),
180
- usefulLifeMonths: i(L.usefulLifeMonths),
181
- salvageValue: i(L.salvageValue),
182
- depreciationMethod: L.depreciationMethod,
183
- unitsOfProductionCapacity: i(L.unitsOfProductionCapacity),
184
- unitsProduced: i(L.unitsProduced),
185
- warrantyExpiry: a(L.warrantyExpiry),
186
- supplier: L.supplier.trim() || null,
187
- department: L.department.trim() || null
171
+ }, i = (e) => e.trim() === "" ? null : new Date(e).toISOString();
172
+ J.current = e, q(e ? "add" : "create"), oe({ variables: { input: {
173
+ name: R.name.trim(),
174
+ assetNumber: R.assetNumber.trim(),
175
+ category: R.category,
176
+ status: R.status,
177
+ condition: R.condition,
178
+ description: R.description.trim() || null,
179
+ serialNumber: R.serialNumber.trim() || null,
180
+ locationName: R.locationName.trim() || null,
181
+ assignedTo: R.assignedTo.trim() || null,
182
+ tags: B,
183
+ purchaseValue: r(R.purchaseValue),
184
+ purchaseDate: i(R.purchaseDate),
185
+ usefulLifeMonths: r(R.usefulLifeMonths),
186
+ salvageValue: r(R.salvageValue),
187
+ depreciationMethod: R.depreciationMethod,
188
+ unitsOfProductionCapacity: r(R.unitsOfProductionCapacity),
189
+ unitsProduced: r(R.unitsProduced),
190
+ warrantyExpiry: i(R.warrantyExpiry),
191
+ supplier: R.supplier.trim() || null,
192
+ department: R.department.trim() || null
188
193
  } } });
189
194
  };
190
- return /* @__PURE__ */ _("div", {
195
+ return /* @__PURE__ */ y("div", {
191
196
  className: "mx-auto max-w-4xl space-y-6 p-4 pb-28 sm:p-6 sm:pb-28",
192
197
  children: [
193
- /* @__PURE__ */ _("div", {
198
+ /* @__PURE__ */ y("div", {
194
199
  className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",
195
- children: [/* @__PURE__ */ g(y, {
200
+ children: [/* @__PURE__ */ v(x, {
196
201
  variant: "ghost",
197
202
  size: "icon",
198
203
  "aria-label": "Go back",
199
204
  className: "w-fit",
200
- onClick: () => h("/assets/asset-list"),
201
- children: /* @__PURE__ */ g(l, { className: "h-4 w-4" })
202
- }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h1", {
205
+ onClick: () => g("/assets/asset-list"),
206
+ children: /* @__PURE__ */ v(d, { className: "h-4 w-4" })
207
+ }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h1", {
203
208
  className: "text-2xl font-bold",
204
- children: /* @__PURE__ */ g(x, { children: "Create New Asset" })
205
- }), /* @__PURE__ */ _("p", {
209
+ children: /* @__PURE__ */ v(ne, { children: "Create New Asset" })
210
+ }), /* @__PURE__ */ y("p", {
206
211
  className: "text-sm text-text-secondary",
207
212
  children: [
208
213
  "Register a new asset in the inventory ·",
209
214
  " ",
210
- /* @__PURE__ */ g("span", {
215
+ /* @__PURE__ */ v("span", {
211
216
  className: "text-status-error-text",
212
217
  children: "*"
213
218
  }),
@@ -215,127 +220,127 @@ function I() {
215
220
  ]
216
221
  })] })]
217
222
  }),
218
- /* @__PURE__ */ g(w, { children: "Register a new asset so it can be tracked, maintained and assigned from day one. Capture its identity, category and condition, then its financials and location — the more you fill in now, the better your reports and audits later." }),
219
- /* @__PURE__ */ _(F, {
223
+ /* @__PURE__ */ v(T, { children: "Register a new asset so it can be tracked, maintained and assigned from day one. Capture its identity, category and condition, then its financials and location — the more you fill in now, the better your reports and audits later." }),
224
+ /* @__PURE__ */ y(P, {
220
225
  title: "General Information",
221
226
  description: "Basic asset details and identification",
222
227
  glow: !0,
223
228
  children: [
224
- /* @__PURE__ */ _("div", {
229
+ /* @__PURE__ */ y("div", {
225
230
  className: "grid gap-4 md:grid-cols-2",
226
- children: [/* @__PURE__ */ _("div", {
231
+ children: [/* @__PURE__ */ y("div", {
227
232
  className: "space-y-2",
228
233
  children: [
229
- /* @__PURE__ */ _(C, { children: ["Asset Name ", /* @__PURE__ */ g("span", {
234
+ /* @__PURE__ */ y(w, { children: ["Asset Name ", /* @__PURE__ */ v("span", {
230
235
  className: "text-status-error-text",
231
236
  children: "*"
232
237
  })] }),
233
- /* @__PURE__ */ g(S, {
238
+ /* @__PURE__ */ v(C, {
234
239
  placeholder: "e.g., Dell OptiPlex 7090",
235
- value: L.name,
240
+ value: R.name,
236
241
  onChange: (e) => X("name", e.target.value),
237
- "aria-invalid": !!U.name
242
+ "aria-invalid": !!W.name
238
243
  }),
239
- U.name ? /* @__PURE__ */ g("p", {
244
+ W.name ? /* @__PURE__ */ v("p", {
240
245
  className: "text-xs text-status-error-text",
241
- children: U.name
246
+ children: W.name
242
247
  }) : null
243
248
  ]
244
- }), /* @__PURE__ */ _("div", {
249
+ }), /* @__PURE__ */ y("div", {
245
250
  className: "space-y-2",
246
251
  children: [
247
- /* @__PURE__ */ _(C, { children: ["Asset Tag ", /* @__PURE__ */ g("span", {
252
+ /* @__PURE__ */ y(w, { children: ["Asset Tag ", /* @__PURE__ */ v("span", {
248
253
  className: "text-status-error-text",
249
254
  children: "*"
250
255
  })] }),
251
- /* @__PURE__ */ g(S, {
256
+ /* @__PURE__ */ v(C, {
252
257
  placeholder: "e.g., IT-HW-001",
253
- value: L.assetNumber,
258
+ value: R.assetNumber,
254
259
  onChange: (e) => X("assetNumber", e.target.value),
255
- "aria-invalid": !!U.assetNumber
260
+ "aria-invalid": !!W.assetNumber
256
261
  }),
257
- U.assetNumber ? /* @__PURE__ */ g("p", {
262
+ W.assetNumber ? /* @__PURE__ */ v("p", {
258
263
  className: "text-xs text-status-error-text",
259
- children: U.assetNumber
264
+ children: W.assetNumber
260
265
  }) : null
261
266
  ]
262
267
  })]
263
268
  }),
264
- /* @__PURE__ */ _("div", {
269
+ /* @__PURE__ */ y("div", {
265
270
  className: "space-y-2",
266
- children: [/* @__PURE__ */ g(C, { children: "Description" }), /* @__PURE__ */ g(A, {
271
+ children: [/* @__PURE__ */ v(w, { children: "Description" }), /* @__PURE__ */ v(j, {
267
272
  placeholder: "Brief description of the asset...",
268
- value: L.description,
273
+ value: R.description,
269
274
  onChange: (e) => X("description", e.target.value),
270
275
  rows: 3
271
276
  })]
272
277
  }),
273
- /* @__PURE__ */ _("div", {
278
+ /* @__PURE__ */ y("div", {
274
279
  className: "grid gap-4 md:grid-cols-3",
275
280
  children: [
276
- /* @__PURE__ */ _("div", {
281
+ /* @__PURE__ */ y("div", {
277
282
  className: "space-y-2",
278
- children: [/* @__PURE__ */ _(C, { children: ["Category ", /* @__PURE__ */ g("span", {
283
+ children: [/* @__PURE__ */ y(w, { children: ["Category ", /* @__PURE__ */ v("span", {
279
284
  className: "text-status-error-text",
280
285
  children: "*"
281
- })] }), /* @__PURE__ */ _(T, {
282
- value: L.category,
286
+ })] }), /* @__PURE__ */ y(E, {
287
+ value: R.category,
283
288
  onValueChange: (e) => X("category", e),
284
- children: [/* @__PURE__ */ g(O, { children: /* @__PURE__ */ g(k, {}) }), /* @__PURE__ */ g(E, { children: J.map((e) => /* @__PURE__ */ g(D, {
289
+ children: [/* @__PURE__ */ v(k, { children: /* @__PURE__ */ v(A, {}) }), /* @__PURE__ */ v(D, { children: ae.map((e) => /* @__PURE__ */ v(O, {
285
290
  value: e,
286
291
  className: "capitalize",
287
- children: e.replace(/_/g, " ")
292
+ children: I?.find((t) => t.id === e)?.label ?? t(e, F)
288
293
  }, e)) })]
289
294
  })]
290
295
  }),
291
- /* @__PURE__ */ _("div", {
296
+ /* @__PURE__ */ y("div", {
292
297
  className: "space-y-2",
293
- children: [/* @__PURE__ */ g(C, { children: "Status" }), /* @__PURE__ */ _(T, {
294
- value: L.status,
298
+ children: [/* @__PURE__ */ v(w, { children: "Status" }), /* @__PURE__ */ y(E, {
299
+ value: R.status,
295
300
  onValueChange: (e) => X("status", e),
296
- children: [/* @__PURE__ */ g(O, { children: /* @__PURE__ */ g(k, {}) }), /* @__PURE__ */ _(E, { children: [
297
- /* @__PURE__ */ g(D, {
301
+ children: [/* @__PURE__ */ v(k, { children: /* @__PURE__ */ v(A, {}) }), /* @__PURE__ */ y(D, { children: [
302
+ /* @__PURE__ */ v(O, {
298
303
  value: "ACTIVE",
299
304
  children: "Active"
300
305
  }),
301
- /* @__PURE__ */ g(D, {
306
+ /* @__PURE__ */ v(O, {
302
307
  value: "INACTIVE",
303
308
  children: "Inactive"
304
309
  }),
305
- /* @__PURE__ */ g(D, {
310
+ /* @__PURE__ */ v(O, {
306
311
  value: "MAINTENANCE",
307
312
  children: "Maintenance"
308
313
  }),
309
- /* @__PURE__ */ g(D, {
314
+ /* @__PURE__ */ v(O, {
310
315
  value: "RETIRED",
311
316
  children: "Retired"
312
317
  })
313
318
  ] })]
314
319
  })]
315
320
  }),
316
- /* @__PURE__ */ _("div", {
321
+ /* @__PURE__ */ y("div", {
317
322
  className: "space-y-2",
318
- children: [/* @__PURE__ */ g(C, { children: "Condition" }), /* @__PURE__ */ _(T, {
319
- value: L.condition,
323
+ children: [/* @__PURE__ */ v(w, { children: "Condition" }), /* @__PURE__ */ y(E, {
324
+ value: R.condition,
320
325
  onValueChange: (e) => X("condition", e),
321
- children: [/* @__PURE__ */ g(O, { children: /* @__PURE__ */ g(k, {}) }), /* @__PURE__ */ _(E, { children: [
322
- /* @__PURE__ */ g(D, {
326
+ children: [/* @__PURE__ */ v(k, { children: /* @__PURE__ */ v(A, {}) }), /* @__PURE__ */ y(D, { children: [
327
+ /* @__PURE__ */ v(O, {
323
328
  value: "EXCELLENT",
324
329
  children: "Excellent"
325
330
  }),
326
- /* @__PURE__ */ g(D, {
331
+ /* @__PURE__ */ v(O, {
327
332
  value: "GOOD",
328
333
  children: "Good"
329
334
  }),
330
- /* @__PURE__ */ g(D, {
335
+ /* @__PURE__ */ v(O, {
331
336
  value: "FAIR",
332
337
  children: "Fair"
333
338
  }),
334
- /* @__PURE__ */ g(D, {
339
+ /* @__PURE__ */ v(O, {
335
340
  value: "POOR",
336
341
  children: "Poor"
337
342
  }),
338
- /* @__PURE__ */ g(D, {
343
+ /* @__PURE__ */ v(O, {
339
344
  value: "DAMAGED",
340
345
  children: "Damaged"
341
346
  })
@@ -344,149 +349,149 @@ function I() {
344
349
  })
345
350
  ]
346
351
  }),
347
- /* @__PURE__ */ _("div", {
352
+ /* @__PURE__ */ y("div", {
348
353
  className: "space-y-2",
349
- children: [/* @__PURE__ */ g(C, { children: "Serial Number" }), /* @__PURE__ */ g(S, {
354
+ children: [/* @__PURE__ */ v(w, { children: "Serial Number" }), /* @__PURE__ */ v(C, {
350
355
  placeholder: "e.g., DELL-7090-X1A2B3",
351
- value: L.serialNumber,
356
+ value: R.serialNumber,
352
357
  onChange: (e) => X("serialNumber", e.target.value)
353
358
  })]
354
359
  })
355
360
  ]
356
361
  }),
357
- /* @__PURE__ */ _(F, {
362
+ /* @__PURE__ */ y(P, {
358
363
  title: "Financial Details",
359
364
  description: "Purchase and depreciation data powers book value, TCO and finance reports",
360
365
  children: [
361
- /* @__PURE__ */ _("div", {
366
+ /* @__PURE__ */ y("div", {
362
367
  className: "grid gap-4 md:grid-cols-3",
363
368
  children: [
364
- /* @__PURE__ */ _("div", {
369
+ /* @__PURE__ */ y("div", {
365
370
  className: "space-y-2",
366
371
  children: [
367
- /* @__PURE__ */ g(C, { children: "Purchase Value" }),
368
- /* @__PURE__ */ _("div", {
372
+ /* @__PURE__ */ v(w, { children: "Purchase Value" }),
373
+ /* @__PURE__ */ y("div", {
369
374
  className: "relative",
370
- children: [/* @__PURE__ */ g("span", {
375
+ children: [/* @__PURE__ */ v("span", {
371
376
  className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
372
377
  children: "$"
373
- }), /* @__PURE__ */ g(S, {
378
+ }), /* @__PURE__ */ v(C, {
374
379
  type: "number",
375
380
  min: "0",
376
381
  step: "0.01",
377
382
  placeholder: "1200",
378
383
  className: "pl-7",
379
- value: L.purchaseValue,
384
+ value: R.purchaseValue,
380
385
  onChange: (e) => X("purchaseValue", e.target.value),
381
- "aria-invalid": !!U.purchaseValue
386
+ "aria-invalid": !!W.purchaseValue
382
387
  })]
383
388
  }),
384
- U.purchaseValue ? /* @__PURE__ */ g("p", {
389
+ W.purchaseValue ? /* @__PURE__ */ v("p", {
385
390
  className: "text-xs text-status-error-text",
386
- children: U.purchaseValue
391
+ children: W.purchaseValue
387
392
  }) : null
388
393
  ]
389
394
  }),
390
- /* @__PURE__ */ _("div", {
395
+ /* @__PURE__ */ y("div", {
391
396
  className: "space-y-2",
392
- children: [/* @__PURE__ */ g(C, { children: "Purchase Date" }), /* @__PURE__ */ g(S, {
397
+ children: [/* @__PURE__ */ v(w, { children: "Purchase Date" }), /* @__PURE__ */ v(C, {
393
398
  type: "date",
394
- value: L.purchaseDate,
399
+ value: R.purchaseDate,
395
400
  onChange: (e) => X("purchaseDate", e.target.value)
396
401
  })]
397
402
  }),
398
- /* @__PURE__ */ _("div", {
403
+ /* @__PURE__ */ y("div", {
399
404
  className: "space-y-2",
400
- children: [/* @__PURE__ */ g(C, { children: "Supplier" }), /* @__PURE__ */ g(S, {
405
+ children: [/* @__PURE__ */ v(w, { children: "Supplier" }), /* @__PURE__ */ v(C, {
401
406
  placeholder: "e.g., Dell Technologies",
402
- value: L.supplier,
407
+ value: R.supplier,
403
408
  onChange: (e) => X("supplier", e.target.value)
404
409
  })]
405
410
  })
406
411
  ]
407
412
  }),
408
- /* @__PURE__ */ _("div", {
413
+ /* @__PURE__ */ y("div", {
409
414
  className: "grid gap-4 md:grid-cols-3",
410
415
  children: [
411
- /* @__PURE__ */ _("div", {
416
+ /* @__PURE__ */ y("div", {
412
417
  className: "space-y-2",
413
418
  children: [
414
- /* @__PURE__ */ g(C, { children: "Useful Life" }),
415
- /* @__PURE__ */ _("div", {
419
+ /* @__PURE__ */ v(w, { children: "Useful Life" }),
420
+ /* @__PURE__ */ y("div", {
416
421
  className: "relative",
417
- children: [/* @__PURE__ */ g(S, {
422
+ children: [/* @__PURE__ */ v(C, {
418
423
  type: "number",
419
424
  min: "0",
420
425
  step: "1",
421
426
  placeholder: "60",
422
427
  className: "pr-16",
423
- value: L.usefulLifeMonths,
428
+ value: R.usefulLifeMonths,
424
429
  onChange: (e) => X("usefulLifeMonths", e.target.value),
425
- "aria-invalid": !!U.usefulLifeMonths
426
- }), /* @__PURE__ */ g("span", {
430
+ "aria-invalid": !!W.usefulLifeMonths
431
+ }), /* @__PURE__ */ v("span", {
427
432
  className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
428
433
  children: "months"
429
434
  })]
430
435
  }),
431
- U.usefulLifeMonths ? /* @__PURE__ */ g("p", {
436
+ W.usefulLifeMonths ? /* @__PURE__ */ v("p", {
432
437
  className: "text-xs text-status-error-text",
433
- children: U.usefulLifeMonths
438
+ children: W.usefulLifeMonths
434
439
  }) : null
435
440
  ]
436
441
  }),
437
- /* @__PURE__ */ _("div", {
442
+ /* @__PURE__ */ y("div", {
438
443
  className: "space-y-2",
439
444
  children: [
440
- /* @__PURE__ */ g(C, { children: "Salvage Value" }),
441
- /* @__PURE__ */ _("div", {
445
+ /* @__PURE__ */ v(w, { children: "Salvage Value" }),
446
+ /* @__PURE__ */ y("div", {
442
447
  className: "relative",
443
- children: [/* @__PURE__ */ g("span", {
448
+ children: [/* @__PURE__ */ v("span", {
444
449
  className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
445
450
  children: "$"
446
- }), /* @__PURE__ */ g(S, {
451
+ }), /* @__PURE__ */ v(C, {
447
452
  type: "number",
448
453
  min: "0",
449
454
  step: "0.01",
450
455
  placeholder: "100",
451
456
  className: "pl-7",
452
- value: L.salvageValue,
457
+ value: R.salvageValue,
453
458
  onChange: (e) => X("salvageValue", e.target.value),
454
- "aria-invalid": !!U.salvageValue
459
+ "aria-invalid": !!W.salvageValue
455
460
  })]
456
461
  }),
457
- U.salvageValue ? /* @__PURE__ */ g("p", {
462
+ W.salvageValue ? /* @__PURE__ */ v("p", {
458
463
  className: "text-xs text-status-error-text",
459
- children: U.salvageValue
464
+ children: W.salvageValue
460
465
  }) : null
461
466
  ]
462
467
  }),
463
- /* @__PURE__ */ _("div", {
468
+ /* @__PURE__ */ y("div", {
464
469
  className: "space-y-2",
465
- children: [/* @__PURE__ */ g(C, { children: "Depreciation Method" }), /* @__PURE__ */ _(T, {
466
- value: L.depreciationMethod,
470
+ children: [/* @__PURE__ */ v(w, { children: "Depreciation Method" }), /* @__PURE__ */ y(E, {
471
+ value: R.depreciationMethod,
467
472
  onValueChange: (e) => X("depreciationMethod", e),
468
- children: [/* @__PURE__ */ g(O, { children: /* @__PURE__ */ g(k, {}) }), /* @__PURE__ */ _(E, { children: [
469
- /* @__PURE__ */ g(D, {
473
+ children: [/* @__PURE__ */ v(k, { children: /* @__PURE__ */ v(A, {}) }), /* @__PURE__ */ y(D, { children: [
474
+ /* @__PURE__ */ v(O, {
470
475
  value: "STRAIGHT_LINE",
471
476
  children: "Straight line"
472
477
  }),
473
- /* @__PURE__ */ g(D, {
478
+ /* @__PURE__ */ v(O, {
474
479
  value: "REDUCING_BALANCE",
475
480
  children: "Reducing balance (200%)"
476
481
  }),
477
- /* @__PURE__ */ g(D, {
482
+ /* @__PURE__ */ v(O, {
478
483
  value: "DECLINING_BALANCE",
479
484
  children: "Declining balance (150%)"
480
485
  }),
481
- /* @__PURE__ */ g(D, {
486
+ /* @__PURE__ */ v(O, {
482
487
  value: "SUM_OF_YEARS_DIGITS",
483
488
  children: "Sum of years' digits"
484
489
  }),
485
- /* @__PURE__ */ g(D, {
490
+ /* @__PURE__ */ v(O, {
486
491
  value: "UNITS_OF_PRODUCTION",
487
492
  children: "Units of production"
488
493
  }),
489
- /* @__PURE__ */ g(D, {
494
+ /* @__PURE__ */ v(O, {
490
495
  value: "NONE",
491
496
  children: "None"
492
497
  })
@@ -495,109 +500,109 @@ function I() {
495
500
  })
496
501
  ]
497
502
  }),
498
- L.depreciationMethod === "UNITS_OF_PRODUCTION" ? /* @__PURE__ */ _("div", {
503
+ R.depreciationMethod === "UNITS_OF_PRODUCTION" ? /* @__PURE__ */ y("div", {
499
504
  className: "grid gap-4 md:grid-cols-2",
500
- children: [/* @__PURE__ */ _("div", {
505
+ children: [/* @__PURE__ */ y("div", {
501
506
  className: "space-y-2",
502
- children: [/* @__PURE__ */ g(C, { children: "Lifetime Capacity (units)" }), /* @__PURE__ */ g(S, {
507
+ children: [/* @__PURE__ */ v(w, { children: "Lifetime Capacity (units)" }), /* @__PURE__ */ v(C, {
503
508
  type: "number",
504
509
  min: "0",
505
510
  step: "1",
506
511
  placeholder: "e.g., 100000 (miles, hours, cycles…)",
507
- value: L.unitsOfProductionCapacity,
512
+ value: R.unitsOfProductionCapacity,
508
513
  onChange: (e) => X("unitsOfProductionCapacity", e.target.value)
509
514
  })]
510
- }), /* @__PURE__ */ _("div", {
515
+ }), /* @__PURE__ */ y("div", {
511
516
  className: "space-y-2",
512
- children: [/* @__PURE__ */ g(C, { children: "Units Produced To Date" }), /* @__PURE__ */ g(S, {
517
+ children: [/* @__PURE__ */ v(w, { children: "Units Produced To Date" }), /* @__PURE__ */ v(C, {
513
518
  type: "number",
514
519
  min: "0",
515
520
  step: "1",
516
521
  placeholder: "0",
517
- value: L.unitsProduced,
522
+ value: R.unitsProduced,
518
523
  onChange: (e) => X("unitsProduced", e.target.value)
519
524
  })]
520
525
  })]
521
526
  }) : null,
522
- /* @__PURE__ */ _("div", {
527
+ /* @__PURE__ */ y("div", {
523
528
  className: "space-y-2",
524
- children: [/* @__PURE__ */ g(C, { children: "Warranty Expiry" }), /* @__PURE__ */ g(S, {
529
+ children: [/* @__PURE__ */ v(w, { children: "Warranty Expiry" }), /* @__PURE__ */ v(C, {
525
530
  type: "date",
526
- value: L.warrantyExpiry,
531
+ value: R.warrantyExpiry,
527
532
  onChange: (e) => X("warrantyExpiry", e.target.value)
528
533
  })]
529
534
  }),
530
- /* @__PURE__ */ g(o, {
535
+ /* @__PURE__ */ v(c, {
531
536
  title: "Depreciation preview",
532
537
  subtitle: "Projected book value over the asset's useful life",
533
- icon: p,
534
- children: Q.length > 0 ? /* @__PURE__ */ g(a, {
538
+ icon: m,
539
+ children: Q.length > 0 ? /* @__PURE__ */ v(s, {
535
540
  data: Q,
536
541
  xKey: "year",
537
542
  height: 240,
538
- valueFormat: i("USD"),
543
+ valueFormat: o("USD"),
539
544
  xTickFormat: (e) => `${e}y`,
540
545
  series: [{
541
546
  key: "bookValue",
542
547
  label: "Book value"
543
548
  }]
544
- }) : /* @__PURE__ */ _("div", {
549
+ }) : /* @__PURE__ */ y("div", {
545
550
  className: "flex flex-col items-center gap-2 py-10 text-center text-sm text-text-secondary",
546
- children: [/* @__PURE__ */ g(u, { className: "h-5 w-5 text-text-muted" }), "Enter a purchase value and useful life to preview the depreciation schedule."]
551
+ children: [/* @__PURE__ */ v(te, { className: "h-5 w-5 text-text-muted" }), "Enter a purchase value and useful life to preview the depreciation schedule."]
547
552
  })
548
553
  })
549
554
  ]
550
555
  }),
551
- /* @__PURE__ */ g(F, {
556
+ /* @__PURE__ */ v(P, {
552
557
  title: "Assignment & Location",
553
558
  description: "Who holds it and where it lives",
554
- children: /* @__PURE__ */ _("div", {
559
+ children: /* @__PURE__ */ y("div", {
555
560
  className: "grid gap-4 md:grid-cols-2",
556
561
  children: [
557
- /* @__PURE__ */ _("div", {
562
+ /* @__PURE__ */ y("div", {
558
563
  className: "space-y-2",
559
- children: [/* @__PURE__ */ g(C, { children: "Assigned To" }), /* @__PURE__ */ g(S, {
564
+ children: [/* @__PURE__ */ v(w, { children: "Assigned To" }), /* @__PURE__ */ v(C, {
560
565
  placeholder: "e.g., john.smith@company.com",
561
- value: L.assignedTo,
566
+ value: R.assignedTo,
562
567
  onChange: (e) => X("assignedTo", e.target.value)
563
568
  })]
564
569
  }),
565
- /* @__PURE__ */ _("div", {
570
+ /* @__PURE__ */ y("div", {
566
571
  className: "space-y-2",
567
- children: [/* @__PURE__ */ g(C, { children: "Location" }), /* @__PURE__ */ g(S, {
572
+ children: [/* @__PURE__ */ v(w, { children: "Location" }), /* @__PURE__ */ v(C, {
568
573
  placeholder: "e.g., Building A, Floor 3, Desk 15",
569
- value: L.locationName,
574
+ value: R.locationName,
570
575
  onChange: (e) => X("locationName", e.target.value)
571
576
  })]
572
577
  }),
573
- /* @__PURE__ */ _("div", {
578
+ /* @__PURE__ */ y("div", {
574
579
  className: "space-y-2",
575
- children: [/* @__PURE__ */ g(C, { children: "Department" }), /* @__PURE__ */ g(S, {
580
+ children: [/* @__PURE__ */ v(w, { children: "Department" }), /* @__PURE__ */ v(C, {
576
581
  placeholder: "e.g., Engineering",
577
- value: L.department,
582
+ value: R.department,
578
583
  onChange: (e) => X("department", e.target.value)
579
584
  })]
580
585
  }),
581
- /* @__PURE__ */ _("div", {
586
+ /* @__PURE__ */ y("div", {
582
587
  className: "space-y-2",
583
- children: [/* @__PURE__ */ g(C, { children: "Tags" }), /* @__PURE__ */ _("div", {
588
+ children: [/* @__PURE__ */ v(w, { children: "Tags" }), /* @__PURE__ */ y("div", {
584
589
  className: "flex flex-wrap items-center gap-1.5 rounded-md border border-border-strong bg-bg-surface px-2 py-1.5 focus-within:border-action-primary-bg",
585
- children: [z.map((e) => /* @__PURE__ */ _(v, {
590
+ children: [B.map((e) => /* @__PURE__ */ y(b, {
586
591
  variant: "secondary",
587
592
  className: "gap-1",
588
- children: [e, /* @__PURE__ */ g("button", {
593
+ children: [e, /* @__PURE__ */ v("button", {
589
594
  type: "button",
590
595
  "aria-label": `Remove ${e}`,
591
- onClick: () => B((t) => t.filter((t) => t !== e)),
596
+ onClick: () => V((t) => t.filter((t) => t !== e)),
592
597
  className: "text-text-secondary hover:text-text-primary",
593
- children: /* @__PURE__ */ g(m, { className: "h-3 w-3" })
598
+ children: /* @__PURE__ */ v(h, { className: "h-3 w-3" })
594
599
  })]
595
- }, e)), /* @__PURE__ */ g("input", {
596
- value: V,
597
- onChange: (e) => H(e.target.value),
598
- onKeyDown: re,
600
+ }, e)), /* @__PURE__ */ v("input", {
601
+ value: H,
602
+ onChange: (e) => U(e.target.value),
603
+ onKeyDown: se,
599
604
  onBlur: Z,
600
- placeholder: z.length === 0 ? "Type a tag and press Enter" : "",
605
+ placeholder: B.length === 0 ? "Type a tag and press Enter" : "",
601
606
  className: "min-w-[8rem] flex-1 border-0 bg-transparent text-sm outline-none placeholder:text-text-secondary"
602
607
  })]
603
608
  })]
@@ -605,30 +610,30 @@ function I() {
605
610
  ]
606
611
  })
607
612
  }),
608
- /* @__PURE__ */ g("div", {
613
+ /* @__PURE__ */ v("div", {
609
614
  className: "sticky bottom-0 -mx-4 mt-6 border-t border-border-seam bg-bg-surface/95 px-4 py-3 backdrop-blur sm:-mx-6 sm:px-6",
610
- children: /* @__PURE__ */ _("div", {
615
+ children: /* @__PURE__ */ y("div", {
611
616
  className: "mx-auto flex max-w-4xl flex-col gap-2 sm:flex-row sm:justify-end",
612
617
  children: [
613
- /* @__PURE__ */ _(y, {
618
+ /* @__PURE__ */ y(x, {
614
619
  variant: "outline",
615
620
  className: "w-full sm:w-auto",
616
- onClick: () => h("/assets/asset-list"),
621
+ onClick: () => g("/assets/asset-list"),
617
622
  disabled: Y,
618
- children: [/* @__PURE__ */ g(m, { className: "mr-2 h-4 w-4" }), "Cancel"]
623
+ children: [/* @__PURE__ */ v(h, { className: "mr-2 h-4 w-4" }), "Cancel"]
619
624
  }),
620
- /* @__PURE__ */ _(y, {
625
+ /* @__PURE__ */ y(x, {
621
626
  variant: "outline",
622
627
  className: "w-full sm:w-auto",
623
628
  onClick: () => $(!0),
624
629
  disabled: Y,
625
- children: [Y && G === "add" ? /* @__PURE__ */ g(d, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ g(f, { className: "mr-2 h-4 w-4" }), "Save & add another"]
630
+ children: [Y && K === "add" ? /* @__PURE__ */ v(f, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ v(p, { className: "mr-2 h-4 w-4" }), "Save & add another"]
626
631
  }),
627
- /* @__PURE__ */ _(y, {
632
+ /* @__PURE__ */ y(x, {
628
633
  className: "w-full sm:w-auto",
629
634
  onClick: () => $(!1),
630
635
  disabled: Y,
631
- children: [Y && G === "create" ? /* @__PURE__ */ g(d, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ g(f, { className: "mr-2 h-4 w-4" }), Y ? "Creating..." : "Create Asset"]
636
+ children: [Y && K === "create" ? /* @__PURE__ */ v(f, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ v(p, { className: "mr-2 h-4 w-4" }), Y ? "Creating..." : "Create Asset"]
632
637
  })
633
638
  ]
634
639
  })
@@ -637,6 +642,6 @@ function I() {
637
642
  });
638
643
  }
639
644
  //#endregion
640
- export { I as AssetsAssetCreatePage };
645
+ export { F as AssetsAssetCreatePage };
641
646
 
642
647
  //# sourceMappingURL=AssetsAssetCreatePage.js.map