@burdenoff/microfe-assethandler 2026.813.2 → 2026.814.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 (27) hide show
  1. package/dist/assethandler/hooks/useMaintenancePlans.d.ts +2 -0
  2. package/dist/assethandler/hooks/useMaintenancePlans.d.ts.map +1 -1
  3. package/dist/assethandler/hooks/useMaintenancePlans.js +1 -0
  4. package/dist/assethandler/hooks/useMaintenancePlans.js.map +1 -1
  5. package/dist/assethandler/ops/MaintenancePlanDialog.js +14 -7
  6. package/dist/assethandler/ops/MaintenancePlanDialog.js.map +1 -1
  7. package/dist/assethandler/pages/AssetsAssetCreatePage.d.ts.map +1 -1
  8. package/dist/assethandler/pages/AssetsAssetCreatePage.js +115 -101
  9. package/dist/assethandler/pages/AssetsAssetCreatePage.js.map +1 -1
  10. package/dist/assethandler/pages/AssetsAssetDetailPage.d.ts.map +1 -1
  11. package/dist/assethandler/pages/AssetsAssetDetailPage.js +121 -102
  12. package/dist/assethandler/pages/AssetsAssetDetailPage.js.map +1 -1
  13. package/dist/assethandler/pages/MaintenanceMaintenancePlansPage.d.ts.map +1 -1
  14. package/dist/assethandler/pages/MaintenanceMaintenancePlansPage.js +119 -114
  15. package/dist/assethandler/pages/MaintenanceMaintenancePlansPage.js.map +1 -1
  16. package/dist/assethandler/providers/AssetHandlerProvider.d.ts.map +1 -1
  17. package/dist/assethandler/providers/AssetHandlerProvider.js +1 -0
  18. package/dist/assethandler/providers/AssetHandlerProvider.js.map +1 -1
  19. package/dist/assethandler/store/assethandlerStore.d.ts +3 -0
  20. package/dist/assethandler/store/assethandlerStore.d.ts.map +1 -1
  21. package/dist/assethandler/store/assethandlerStore.js +1 -0
  22. package/dist/assethandler/store/assethandlerStore.js.map +1 -1
  23. package/dist/assethandler/utils/meter.d.ts +51 -0
  24. package/dist/assethandler/utils/meter.d.ts.map +1 -0
  25. package/dist/assethandler/utils/meter.js +51 -0
  26. package/dist/assethandler/utils/meter.js.map +1 -0
  27. package/package.json +1 -1
@@ -4,17 +4,18 @@ import { useAssetCategoryPresentation as n, useAssetMoney as r, useHiddenCategor
4
4
  import { useAssetHandlerNavigate as a } from "../hooks/useAssetHandlerNavigate.js";
5
5
  import { useCopy as o } from "../hooks/useCopy.js";
6
6
  import { notify as s } from "../utils/toast.js";
7
- import { TrendChart as c } from "../components/charts/TrendChart.js";
8
- import { ChartCard as ee } from "../components/ChartCard.js";
7
+ import { TrendChart as ee } from "../components/charts/TrendChart.js";
8
+ import { ChartCard as te } from "../components/ChartCard.js";
9
9
  import "../components/index.js";
10
- import { useMemo as l, useRef as u, useState as d } from "react";
11
- import { ArrowLeft as te, Info as ne, Loader2 as f, Save as p, TrendingDown as re, X as m } from "lucide-react";
12
- import { gql as h } from "@apollo/client";
13
- import { useMutation as ie } from "@apollo/client/react";
10
+ import { METER_UNIT_OPTIONS as ne, meterReadingLabel as re } from "../utils/meter.js";
11
+ import { useMemo as c, useRef as ie, useState as l } from "react";
12
+ import { ArrowLeft as ae, Info as oe, Loader2 as u, Save as d, TrendingDown as f, X as p } from "lucide-react";
13
+ import { gql as m } from "@apollo/client";
14
+ import { useMutation as h } from "@apollo/client/react";
14
15
  import { jsx as g, jsxs as _ } from "react/jsx-runtime";
15
- import { Badge as v, Button as y, GlassCard as b, GradientText as ae, Input as x, Label as S, PagePurpose as C, 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 { Badge as se, Button as v, GlassCard as y, GradientText as ce, Input as b, Label as x, PagePurpose as le, Select as S, SelectContent as C, SelectItem as w, SelectTrigger as T, SelectValue as E, Textarea as D } from "@burdenoff/fe-libs/ui";
16
17
  //#region src/assethandler/pages/AssetsAssetCreatePage.tsx
17
- var oe = h`
18
+ var O = m`
18
19
  mutation AssetHandlerCreateAsset($input: CreateAssetInput!) {
19
20
  createAsset(input: $input) {
20
21
  id
@@ -22,7 +23,7 @@ var oe = h`
22
23
  name
23
24
  }
24
25
  }
25
- `, se = [
26
+ `, k = [
26
27
  "electronics",
27
28
  "it_hardware",
28
29
  "furniture",
@@ -48,6 +49,7 @@ var oe = h`
48
49
  depreciationMethod: "STRAIGHT_LINE",
49
50
  unitsOfProductionCapacity: "",
50
51
  unitsProduced: "",
52
+ meterUnit: "",
51
53
  warrantyExpiry: "",
52
54
  supplier: "",
53
55
  department: ""
@@ -88,7 +90,7 @@ function j(e) {
88
90
  }
89
91
  return o;
90
92
  }
91
- var M = ({ title: e, description: t, children: n, glow: r }) => /* @__PURE__ */ g(b, {
93
+ var M = ({ title: e, description: t, children: n, glow: r }) => /* @__PURE__ */ g(y, {
92
94
  treatment: "glass",
93
95
  glow: r,
94
96
  className: "border-border-seam",
@@ -104,21 +106,21 @@ var M = ({ title: e, description: t, children: n, glow: r }) => /* @__PURE__ */
104
106
  })
105
107
  });
106
108
  function N() {
107
- let h = o(), b = a(), { symbol: N, compact: ce } = r(), P = i(), { labels: F, options: I } = n(), { assets: L } = e(), [R, z] = d(A), [B, V] = d([]), [H, U] = d(""), [W, G] = d({}), [K, q] = d(null), J = u(!1), le = l(() => {
108
- let e = new Set(I?.map((e) => e.id) ?? se);
109
+ let m = o(), y = a(), { symbol: N, compact: P } = r(), F = i(), { labels: ue, options: I } = n(), { assets: L } = e(), [R, z] = l(A), [B, V] = l([]), [H, U] = l(""), [W, G] = l({}), [K, q] = l(null), J = ie(!1), de = c(() => {
110
+ let e = new Set(I?.map((e) => e.id) ?? k);
109
111
  if (!I) for (let t of L) t.category && e.add(t.category);
110
- return [...e].filter((e) => !P.has(e)).sort();
112
+ return [...e].filter((e) => !F.has(e)).sort();
111
113
  }, [
112
114
  L,
113
115
  I,
114
- P
115
- ]), [ue, { loading: Y }] = ie(oe, {
116
+ F
117
+ ]), [fe, { loading: Y }] = h(O, {
116
118
  refetchQueries: ["AssetHandlerBootstrap"],
117
119
  onCompleted: (e) => {
118
- s.success(h("assethandler.assets.create.toast.title", "{{asset}} created"), h("assethandler.assets.create.toast.body", "{{name}} was registered in the inventory.", { name: e.createAsset.name })), q(null), J.current ? (J.current = !1, z(A), V([]), U(""), G({}), typeof window < "u" && window.scrollTo({
120
+ s.success(m("assethandler.assets.create.toast.title", "{{asset}} created"), m("assethandler.assets.create.toast.body", "{{name}} was registered in the inventory.", { name: e.createAsset.name })), q(null), J.current ? (J.current = !1, z(A), V([]), U(""), G({}), typeof window < "u" && window.scrollTo({
119
121
  top: 0,
120
122
  behavior: "smooth"
121
- })) : b(`/assets/${e.createAsset.id}`);
123
+ })) : y(`/assets/${e.createAsset.id}`);
122
124
  },
123
125
  onError: (e) => {
124
126
  q(null), s.error("Could not create asset", e.message);
@@ -135,9 +137,9 @@ function N() {
135
137
  }, Z = () => {
136
138
  let e = H.trim().replace(/,$/, "").trim();
137
139
  e && !B.includes(e) && V((t) => [...t, e]), U("");
138
- }, de = (e) => {
140
+ }, pe = (e) => {
139
141
  e.key === "Enter" || e.key === "," ? (e.preventDefault(), Z()) : e.key === "Backspace" && H === "" && B.length > 0 && V((e) => e.slice(0, -1));
140
- }, Q = l(() => j({
142
+ }, Q = c(() => j({
141
143
  purchaseValue: R.purchaseValue.trim() ? Number(R.purchaseValue) : null,
142
144
  salvageValue: R.salvageValue.trim() ? Number(R.salvageValue) : null,
143
145
  usefulLifeMonths: R.usefulLifeMonths.trim() ? Number(R.usefulLifeMonths) : null,
@@ -169,7 +171,7 @@ function N() {
169
171
  let n = Number(t);
170
172
  return Number.isNaN(n) ? null : n;
171
173
  }, i = (e) => e.trim() === "" ? null : new Date(e).toISOString();
172
- J.current = e, q(e ? "add" : "create"), ue({ variables: { input: {
174
+ J.current = e, q(e ? "add" : "create"), fe({ variables: { input: {
173
175
  name: R.name.trim(),
174
176
  assetNumber: R.assetNumber.trim(),
175
177
  category: R.category,
@@ -187,6 +189,7 @@ function N() {
187
189
  depreciationMethod: R.depreciationMethod,
188
190
  unitsOfProductionCapacity: r(R.unitsOfProductionCapacity),
189
191
  unitsProduced: r(R.unitsProduced),
192
+ meterUnit: R.meterUnit || null,
190
193
  warrantyExpiry: i(R.warrantyExpiry),
191
194
  supplier: R.supplier.trim() || null,
192
195
  department: R.department.trim() || null
@@ -197,20 +200,20 @@ function N() {
197
200
  children: [
198
201
  /* @__PURE__ */ _("div", {
199
202
  className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",
200
- children: [/* @__PURE__ */ g(y, {
203
+ children: [/* @__PURE__ */ g(v, {
201
204
  variant: "ghost",
202
205
  size: "icon",
203
206
  "aria-label": "Go back",
204
207
  className: "w-fit",
205
- onClick: () => b("/assets/asset-list"),
206
- children: /* @__PURE__ */ g(te, { className: "h-4 w-4" })
208
+ onClick: () => y("/assets/asset-list"),
209
+ children: /* @__PURE__ */ g(ae, { className: "h-4 w-4" })
207
210
  }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h1", {
208
211
  className: "text-2xl font-bold",
209
- children: /* @__PURE__ */ g(ae, { children: h("assethandler.assets.create.title", "Create New {{asset}}") })
212
+ children: /* @__PURE__ */ g(ce, { children: m("assethandler.assets.create.title", "Create New {{asset}}") })
210
213
  }), /* @__PURE__ */ _("p", {
211
214
  className: "text-sm text-text-secondary",
212
215
  children: [
213
- h("assethandler.assets.create.subtitle", "Register a new {{assetLower}} in the inventory"),
216
+ m("assethandler.assets.create.subtitle", "Register a new {{assetLower}} in the inventory"),
214
217
  " ",
215
218
  "· ",
216
219
  /* @__PURE__ */ g("span", {
@@ -221,10 +224,10 @@ function N() {
221
224
  ]
222
225
  })] })]
223
226
  }),
224
- /* @__PURE__ */ g(C, { children: h("assethandler.assets.create.purpose", "Register a new {{assetLower}} 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.") }),
227
+ /* @__PURE__ */ g(le, { children: m("assethandler.assets.create.purpose", "Register a new {{assetLower}} 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.") }),
225
228
  /* @__PURE__ */ _(M, {
226
229
  title: "General Information",
227
- description: h("assethandler.assets.create.general.description", "Basic {{assetLower}} details and identification"),
230
+ description: m("assethandler.assets.create.general.description", "Basic {{assetLower}} details and identification"),
228
231
  glow: !0,
229
232
  children: [
230
233
  /* @__PURE__ */ _("div", {
@@ -232,16 +235,16 @@ function N() {
232
235
  children: [/* @__PURE__ */ _("div", {
233
236
  className: "space-y-2",
234
237
  children: [
235
- /* @__PURE__ */ _(S, { children: [
236
- h("assethandler.assets.create.field.name", "{{asset}} Name"),
238
+ /* @__PURE__ */ _(x, { children: [
239
+ m("assethandler.assets.create.field.name", "{{asset}} Name"),
237
240
  " ",
238
241
  /* @__PURE__ */ g("span", {
239
242
  className: "text-status-error-text",
240
243
  children: "*"
241
244
  })
242
245
  ] }),
243
- /* @__PURE__ */ g(x, {
244
- placeholder: h("assethandler.assets.create.field.namePlaceholder", "e.g., Dell OptiPlex 7090"),
246
+ /* @__PURE__ */ g(b, {
247
+ placeholder: m("assethandler.assets.create.field.namePlaceholder", "e.g., Dell OptiPlex 7090"),
245
248
  value: R.name,
246
249
  onChange: (e) => X("name", e.target.value),
247
250
  "aria-invalid": !!W.name
@@ -254,16 +257,16 @@ function N() {
254
257
  }), /* @__PURE__ */ _("div", {
255
258
  className: "space-y-2",
256
259
  children: [
257
- /* @__PURE__ */ _(S, { children: [
258
- h("assethandler.assets.create.field.tag", "{{asset}} Tag"),
260
+ /* @__PURE__ */ _(x, { children: [
261
+ m("assethandler.assets.create.field.tag", "{{asset}} Tag"),
259
262
  " ",
260
263
  /* @__PURE__ */ g("span", {
261
264
  className: "text-status-error-text",
262
265
  children: "*"
263
266
  })
264
267
  ] }),
265
- /* @__PURE__ */ g(x, {
266
- placeholder: h("assethandler.assets.create.field.tagPlaceholder", "e.g., IT-HW-001"),
268
+ /* @__PURE__ */ g(b, {
269
+ placeholder: m("assethandler.assets.create.field.tagPlaceholder", "e.g., IT-HW-001"),
267
270
  value: R.assetNumber,
268
271
  onChange: (e) => X("assetNumber", e.target.value),
269
272
  "aria-invalid": !!W.assetNumber
@@ -277,8 +280,8 @@ function N() {
277
280
  }),
278
281
  /* @__PURE__ */ _("div", {
279
282
  className: "space-y-2",
280
- children: [/* @__PURE__ */ g(S, { children: "Description" }), /* @__PURE__ */ g(k, {
281
- placeholder: h("assethandler.assets.create.field.descriptionPlaceholder", "Brief description of the {{assetLower}}..."),
283
+ children: [/* @__PURE__ */ g(x, { children: "Description" }), /* @__PURE__ */ g(D, {
284
+ placeholder: m("assethandler.assets.create.field.descriptionPlaceholder", "Brief description of the {{assetLower}}..."),
282
285
  value: R.description,
283
286
  onChange: (e) => X("description", e.target.value),
284
287
  rows: 3
@@ -289,38 +292,38 @@ function N() {
289
292
  children: [
290
293
  /* @__PURE__ */ _("div", {
291
294
  className: "space-y-2",
292
- children: [/* @__PURE__ */ _(S, { children: ["Category ", /* @__PURE__ */ g("span", {
295
+ children: [/* @__PURE__ */ _(x, { children: ["Category ", /* @__PURE__ */ g("span", {
293
296
  className: "text-status-error-text",
294
297
  children: "*"
295
- })] }), /* @__PURE__ */ _(w, {
298
+ })] }), /* @__PURE__ */ _(S, {
296
299
  value: R.category,
297
300
  onValueChange: (e) => X("category", e),
298
- children: [/* @__PURE__ */ g(D, { children: /* @__PURE__ */ g(O, {}) }), /* @__PURE__ */ g(T, { children: le.map((e) => /* @__PURE__ */ g(E, {
301
+ children: [/* @__PURE__ */ g(T, { children: /* @__PURE__ */ g(E, {}) }), /* @__PURE__ */ g(C, { children: de.map((e) => /* @__PURE__ */ g(w, {
299
302
  value: e,
300
303
  className: "capitalize",
301
- children: I?.find((t) => t.id === e)?.label ?? t(e, F)
304
+ children: I?.find((t) => t.id === e)?.label ?? t(e, ue)
302
305
  }, e)) })]
303
306
  })]
304
307
  }),
305
308
  /* @__PURE__ */ _("div", {
306
309
  className: "space-y-2",
307
- children: [/* @__PURE__ */ g(S, { children: "Status" }), /* @__PURE__ */ _(w, {
310
+ children: [/* @__PURE__ */ g(x, { children: "Status" }), /* @__PURE__ */ _(S, {
308
311
  value: R.status,
309
312
  onValueChange: (e) => X("status", e),
310
- children: [/* @__PURE__ */ g(D, { children: /* @__PURE__ */ g(O, {}) }), /* @__PURE__ */ _(T, { children: [
311
- /* @__PURE__ */ g(E, {
313
+ children: [/* @__PURE__ */ g(T, { children: /* @__PURE__ */ g(E, {}) }), /* @__PURE__ */ _(C, { children: [
314
+ /* @__PURE__ */ g(w, {
312
315
  value: "ACTIVE",
313
316
  children: "Active"
314
317
  }),
315
- /* @__PURE__ */ g(E, {
318
+ /* @__PURE__ */ g(w, {
316
319
  value: "INACTIVE",
317
320
  children: "Inactive"
318
321
  }),
319
- /* @__PURE__ */ g(E, {
322
+ /* @__PURE__ */ g(w, {
320
323
  value: "MAINTENANCE",
321
324
  children: "Maintenance"
322
325
  }),
323
- /* @__PURE__ */ g(E, {
326
+ /* @__PURE__ */ g(w, {
324
327
  value: "RETIRED",
325
328
  children: "Retired"
326
329
  })
@@ -329,27 +332,27 @@ function N() {
329
332
  }),
330
333
  /* @__PURE__ */ _("div", {
331
334
  className: "space-y-2",
332
- children: [/* @__PURE__ */ g(S, { children: "Condition" }), /* @__PURE__ */ _(w, {
335
+ children: [/* @__PURE__ */ g(x, { children: "Condition" }), /* @__PURE__ */ _(S, {
333
336
  value: R.condition,
334
337
  onValueChange: (e) => X("condition", e),
335
- children: [/* @__PURE__ */ g(D, { children: /* @__PURE__ */ g(O, {}) }), /* @__PURE__ */ _(T, { children: [
336
- /* @__PURE__ */ g(E, {
338
+ children: [/* @__PURE__ */ g(T, { children: /* @__PURE__ */ g(E, {}) }), /* @__PURE__ */ _(C, { children: [
339
+ /* @__PURE__ */ g(w, {
337
340
  value: "EXCELLENT",
338
341
  children: "Excellent"
339
342
  }),
340
- /* @__PURE__ */ g(E, {
343
+ /* @__PURE__ */ g(w, {
341
344
  value: "GOOD",
342
345
  children: "Good"
343
346
  }),
344
- /* @__PURE__ */ g(E, {
347
+ /* @__PURE__ */ g(w, {
345
348
  value: "FAIR",
346
349
  children: "Fair"
347
350
  }),
348
- /* @__PURE__ */ g(E, {
351
+ /* @__PURE__ */ g(w, {
349
352
  value: "POOR",
350
353
  children: "Poor"
351
354
  }),
352
- /* @__PURE__ */ g(E, {
355
+ /* @__PURE__ */ g(w, {
353
356
  value: "DAMAGED",
354
357
  children: "Damaged"
355
358
  })
@@ -360,7 +363,7 @@ function N() {
360
363
  }),
361
364
  /* @__PURE__ */ _("div", {
362
365
  className: "space-y-2",
363
- children: [/* @__PURE__ */ g(S, { children: "Serial Number" }), /* @__PURE__ */ g(x, {
366
+ children: [/* @__PURE__ */ g(x, { children: "Serial Number" }), /* @__PURE__ */ g(b, {
364
367
  placeholder: "e.g., DELL-7090-X1A2B3",
365
368
  value: R.serialNumber,
366
369
  onChange: (e) => X("serialNumber", e.target.value)
@@ -378,13 +381,13 @@ function N() {
378
381
  /* @__PURE__ */ _("div", {
379
382
  className: "space-y-2",
380
383
  children: [
381
- /* @__PURE__ */ g(S, { children: "Purchase Value" }),
384
+ /* @__PURE__ */ g(x, { children: "Purchase Value" }),
382
385
  /* @__PURE__ */ _("div", {
383
386
  className: "relative",
384
387
  children: [/* @__PURE__ */ g("span", {
385
388
  className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
386
389
  children: N
387
- }), /* @__PURE__ */ g(x, {
390
+ }), /* @__PURE__ */ g(b, {
388
391
  type: "number",
389
392
  min: "0",
390
393
  step: "0.01",
@@ -403,7 +406,7 @@ function N() {
403
406
  }),
404
407
  /* @__PURE__ */ _("div", {
405
408
  className: "space-y-2",
406
- children: [/* @__PURE__ */ g(S, { children: "Purchase Date" }), /* @__PURE__ */ g(x, {
409
+ children: [/* @__PURE__ */ g(x, { children: "Purchase Date" }), /* @__PURE__ */ g(b, {
407
410
  type: "date",
408
411
  value: R.purchaseDate,
409
412
  onChange: (e) => X("purchaseDate", e.target.value)
@@ -411,7 +414,7 @@ function N() {
411
414
  }),
412
415
  /* @__PURE__ */ _("div", {
413
416
  className: "space-y-2",
414
- children: [/* @__PURE__ */ g(S, { children: "Supplier" }), /* @__PURE__ */ g(x, {
417
+ children: [/* @__PURE__ */ g(x, { children: "Supplier" }), /* @__PURE__ */ g(b, {
415
418
  placeholder: "e.g., Dell Technologies",
416
419
  value: R.supplier,
417
420
  onChange: (e) => X("supplier", e.target.value)
@@ -425,10 +428,10 @@ function N() {
425
428
  /* @__PURE__ */ _("div", {
426
429
  className: "space-y-2",
427
430
  children: [
428
- /* @__PURE__ */ g(S, { children: "Useful Life" }),
431
+ /* @__PURE__ */ g(x, { children: "Useful Life" }),
429
432
  /* @__PURE__ */ _("div", {
430
433
  className: "relative",
431
- children: [/* @__PURE__ */ g(x, {
434
+ children: [/* @__PURE__ */ g(b, {
432
435
  type: "number",
433
436
  min: "0",
434
437
  step: "1",
@@ -451,13 +454,13 @@ function N() {
451
454
  /* @__PURE__ */ _("div", {
452
455
  className: "space-y-2",
453
456
  children: [
454
- /* @__PURE__ */ g(S, { children: "Salvage Value" }),
457
+ /* @__PURE__ */ g(x, { children: "Salvage Value" }),
455
458
  /* @__PURE__ */ _("div", {
456
459
  className: "relative",
457
460
  children: [/* @__PURE__ */ g("span", {
458
461
  className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
459
462
  children: N
460
- }), /* @__PURE__ */ g(x, {
463
+ }), /* @__PURE__ */ g(b, {
461
464
  type: "number",
462
465
  min: "0",
463
466
  step: "0.01",
@@ -476,31 +479,31 @@ function N() {
476
479
  }),
477
480
  /* @__PURE__ */ _("div", {
478
481
  className: "space-y-2",
479
- children: [/* @__PURE__ */ g(S, { children: "Depreciation Method" }), /* @__PURE__ */ _(w, {
482
+ children: [/* @__PURE__ */ g(x, { children: "Depreciation Method" }), /* @__PURE__ */ _(S, {
480
483
  value: R.depreciationMethod,
481
484
  onValueChange: (e) => X("depreciationMethod", e),
482
- children: [/* @__PURE__ */ g(D, { children: /* @__PURE__ */ g(O, {}) }), /* @__PURE__ */ _(T, { children: [
483
- /* @__PURE__ */ g(E, {
485
+ children: [/* @__PURE__ */ g(T, { children: /* @__PURE__ */ g(E, {}) }), /* @__PURE__ */ _(C, { children: [
486
+ /* @__PURE__ */ g(w, {
484
487
  value: "STRAIGHT_LINE",
485
488
  children: "Straight line"
486
489
  }),
487
- /* @__PURE__ */ g(E, {
490
+ /* @__PURE__ */ g(w, {
488
491
  value: "REDUCING_BALANCE",
489
492
  children: "Reducing balance (200%)"
490
493
  }),
491
- /* @__PURE__ */ g(E, {
494
+ /* @__PURE__ */ g(w, {
492
495
  value: "DECLINING_BALANCE",
493
496
  children: "Declining balance (150%)"
494
497
  }),
495
- /* @__PURE__ */ g(E, {
498
+ /* @__PURE__ */ g(w, {
496
499
  value: "SUM_OF_YEARS_DIGITS",
497
500
  children: "Sum of years' digits"
498
501
  }),
499
- /* @__PURE__ */ g(E, {
502
+ /* @__PURE__ */ g(w, {
500
503
  value: "UNITS_OF_PRODUCTION",
501
504
  children: "Units of production"
502
505
  }),
503
- /* @__PURE__ */ g(E, {
506
+ /* @__PURE__ */ g(w, {
504
507
  value: "NONE",
505
508
  children: "None"
506
509
  })
@@ -510,20 +513,31 @@ function N() {
510
513
  ]
511
514
  }),
512
515
  R.depreciationMethod === "UNITS_OF_PRODUCTION" ? /* @__PURE__ */ _("div", {
516
+ className: "space-y-2",
517
+ children: [/* @__PURE__ */ g(x, { children: "Lifetime Capacity (units)" }), /* @__PURE__ */ g(b, {
518
+ type: "number",
519
+ min: "0",
520
+ step: "1",
521
+ placeholder: "e.g., 100000 (miles, hours, cycles…)",
522
+ value: R.unitsOfProductionCapacity,
523
+ onChange: (e) => X("unitsOfProductionCapacity", e.target.value)
524
+ })]
525
+ }) : null,
526
+ /* @__PURE__ */ _("div", {
513
527
  className: "grid gap-4 md:grid-cols-2",
514
528
  children: [/* @__PURE__ */ _("div", {
515
529
  className: "space-y-2",
516
- children: [/* @__PURE__ */ g(S, { children: "Lifetime Capacity (units)" }), /* @__PURE__ */ g(x, {
517
- type: "number",
518
- min: "0",
519
- step: "1",
520
- placeholder: "e.g., 100000 (miles, hours, cycles…)",
521
- value: R.unitsOfProductionCapacity,
522
- onChange: (e) => X("unitsOfProductionCapacity", e.target.value)
530
+ children: [/* @__PURE__ */ g(x, { children: "Meter unit" }), /* @__PURE__ */ _(S, {
531
+ value: R.meterUnit,
532
+ onValueChange: (e) => X("meterUnit", e),
533
+ children: [/* @__PURE__ */ g(T, { children: /* @__PURE__ */ g(E, { placeholder: "Not metered" }) }), /* @__PURE__ */ g(C, { children: ne.map((e) => /* @__PURE__ */ g(w, {
534
+ value: e.value,
535
+ children: e.label
536
+ }, e.value)) })]
523
537
  })]
524
538
  }), /* @__PURE__ */ _("div", {
525
539
  className: "space-y-2",
526
- children: [/* @__PURE__ */ g(S, { children: "Units Produced To Date" }), /* @__PURE__ */ g(x, {
540
+ children: [/* @__PURE__ */ g(x, { children: re(R.meterUnit) }), /* @__PURE__ */ g(b, {
527
541
  type: "number",
528
542
  min: "0",
529
543
  step: "1",
@@ -532,24 +546,24 @@ function N() {
532
546
  onChange: (e) => X("unitsProduced", e.target.value)
533
547
  })]
534
548
  })]
535
- }) : null,
549
+ }),
536
550
  /* @__PURE__ */ _("div", {
537
551
  className: "space-y-2",
538
- children: [/* @__PURE__ */ g(S, { children: "Warranty Expiry" }), /* @__PURE__ */ g(x, {
552
+ children: [/* @__PURE__ */ g(x, { children: "Warranty Expiry" }), /* @__PURE__ */ g(b, {
539
553
  type: "date",
540
554
  value: R.warrantyExpiry,
541
555
  onChange: (e) => X("warrantyExpiry", e.target.value)
542
556
  })]
543
557
  }),
544
- /* @__PURE__ */ g(ee, {
558
+ /* @__PURE__ */ g(te, {
545
559
  title: "Depreciation preview",
546
- subtitle: h("assethandler.assets.create.depreciation.subtitle", "Projected book value over the {{assetLower}}'s useful life"),
547
- icon: re,
548
- children: Q.length > 0 ? /* @__PURE__ */ g(c, {
560
+ subtitle: m("assethandler.assets.create.depreciation.subtitle", "Projected book value over the {{assetLower}}'s useful life"),
561
+ icon: f,
562
+ children: Q.length > 0 ? /* @__PURE__ */ g(ee, {
549
563
  data: Q,
550
564
  xKey: "year",
551
565
  height: 240,
552
- valueFormat: ce,
566
+ valueFormat: P,
553
567
  xTickFormat: (e) => `${e}y`,
554
568
  series: [{
555
569
  key: "bookValue",
@@ -557,7 +571,7 @@ function N() {
557
571
  }]
558
572
  }) : /* @__PURE__ */ _("div", {
559
573
  className: "flex flex-col items-center gap-2 py-10 text-center text-sm text-text-secondary",
560
- children: [/* @__PURE__ */ g(ne, { className: "h-5 w-5 text-text-muted" }), "Enter a purchase value and useful life to preview the depreciation schedule."]
574
+ children: [/* @__PURE__ */ g(oe, { className: "h-5 w-5 text-text-muted" }), "Enter a purchase value and useful life to preview the depreciation schedule."]
561
575
  })
562
576
  })
563
577
  ]
@@ -570,7 +584,7 @@ function N() {
570
584
  children: [
571
585
  /* @__PURE__ */ _("div", {
572
586
  className: "space-y-2",
573
- children: [/* @__PURE__ */ g(S, { children: "Assigned To" }), /* @__PURE__ */ g(x, {
587
+ children: [/* @__PURE__ */ g(x, { children: "Assigned To" }), /* @__PURE__ */ g(b, {
574
588
  placeholder: "e.g., john.smith@company.com",
575
589
  value: R.assignedTo,
576
590
  onChange: (e) => X("assignedTo", e.target.value)
@@ -578,7 +592,7 @@ function N() {
578
592
  }),
579
593
  /* @__PURE__ */ _("div", {
580
594
  className: "space-y-2",
581
- children: [/* @__PURE__ */ g(S, { children: "Location" }), /* @__PURE__ */ g(x, {
595
+ children: [/* @__PURE__ */ g(x, { children: "Location" }), /* @__PURE__ */ g(b, {
582
596
  placeholder: "e.g., Building A, Floor 3, Desk 15",
583
597
  value: R.locationName,
584
598
  onChange: (e) => X("locationName", e.target.value)
@@ -586,7 +600,7 @@ function N() {
586
600
  }),
587
601
  /* @__PURE__ */ _("div", {
588
602
  className: "space-y-2",
589
- children: [/* @__PURE__ */ g(S, { children: "Department" }), /* @__PURE__ */ g(x, {
603
+ children: [/* @__PURE__ */ g(x, { children: "Department" }), /* @__PURE__ */ g(b, {
590
604
  placeholder: "e.g., Engineering",
591
605
  value: R.department,
592
606
  onChange: (e) => X("department", e.target.value)
@@ -594,9 +608,9 @@ function N() {
594
608
  }),
595
609
  /* @__PURE__ */ _("div", {
596
610
  className: "space-y-2",
597
- children: [/* @__PURE__ */ g(S, { children: "Tags" }), /* @__PURE__ */ _("div", {
611
+ children: [/* @__PURE__ */ g(x, { children: "Tags" }), /* @__PURE__ */ _("div", {
598
612
  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",
599
- children: [B.map((e) => /* @__PURE__ */ _(v, {
613
+ children: [B.map((e) => /* @__PURE__ */ _(se, {
600
614
  variant: "secondary",
601
615
  className: "gap-1",
602
616
  children: [e, /* @__PURE__ */ g("button", {
@@ -604,12 +618,12 @@ function N() {
604
618
  "aria-label": `Remove ${e}`,
605
619
  onClick: () => V((t) => t.filter((t) => t !== e)),
606
620
  className: "text-text-secondary hover:text-text-primary",
607
- children: /* @__PURE__ */ g(m, { className: "h-3 w-3" })
621
+ children: /* @__PURE__ */ g(p, { className: "h-3 w-3" })
608
622
  })]
609
623
  }, e)), /* @__PURE__ */ g("input", {
610
624
  value: H,
611
625
  onChange: (e) => U(e.target.value),
612
- onKeyDown: de,
626
+ onKeyDown: pe,
613
627
  onBlur: Z,
614
628
  placeholder: B.length === 0 ? "Type a tag and press Enter" : "",
615
629
  className: "min-w-[8rem] flex-1 border-0 bg-transparent text-sm outline-none placeholder:text-text-secondary"
@@ -624,25 +638,25 @@ function N() {
624
638
  children: /* @__PURE__ */ _("div", {
625
639
  className: "mx-auto flex max-w-4xl flex-col gap-2 sm:flex-row sm:justify-end",
626
640
  children: [
627
- /* @__PURE__ */ _(y, {
641
+ /* @__PURE__ */ _(v, {
628
642
  variant: "outline",
629
643
  className: "w-full sm:w-auto",
630
- onClick: () => b("/assets/asset-list"),
644
+ onClick: () => y("/assets/asset-list"),
631
645
  disabled: Y,
632
- children: [/* @__PURE__ */ g(m, { className: "mr-2 h-4 w-4" }), "Cancel"]
646
+ children: [/* @__PURE__ */ g(p, { className: "mr-2 h-4 w-4" }), "Cancel"]
633
647
  }),
634
- /* @__PURE__ */ _(y, {
648
+ /* @__PURE__ */ _(v, {
635
649
  variant: "outline",
636
650
  className: "w-full sm:w-auto",
637
651
  onClick: () => $(!0),
638
652
  disabled: Y,
639
- children: [Y && K === "add" ? /* @__PURE__ */ g(f, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ g(p, { className: "mr-2 h-4 w-4" }), "Save & add another"]
653
+ children: [Y && K === "add" ? /* @__PURE__ */ g(u, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ g(d, { className: "mr-2 h-4 w-4" }), "Save & add another"]
640
654
  }),
641
- /* @__PURE__ */ _(y, {
655
+ /* @__PURE__ */ _(v, {
642
656
  className: "w-full sm:w-auto",
643
657
  onClick: () => $(!1),
644
658
  disabled: Y,
645
- children: [Y && K === "create" ? /* @__PURE__ */ g(f, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ g(p, { className: "mr-2 h-4 w-4" }), Y ? "Creating..." : "Create Asset"]
659
+ children: [Y && K === "create" ? /* @__PURE__ */ g(u, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ g(d, { className: "mr-2 h-4 w-4" }), Y ? "Creating..." : "Create Asset"]
646
660
  })
647
661
  ]
648
662
  })