@burdenoff/microfe-assethandler 2026.714.1 → 2026.714.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.
@@ -1,26 +1,27 @@
1
1
  import { useAssetHandlerStore as e } from "../store/assethandlerStore.js";
2
2
  import { useAssetHandlerNavigate as t } from "../hooks/useAssetHandlerNavigate.js";
3
- import { notify as n } from "../utils/toast.js";
4
- import { AttachmentsPanel as r } from "../components/AttachmentsPanel.js";
5
- import { CommentsPanel as i } from "../components/CommentsPanel.js";
6
- import { formatCurrencyCompact as a } from "../components/charts/chartTheme.js";
7
- import { TrendChart as o } from "../components/charts/TrendChart.js";
8
- import { BarsChart as ee } from "../components/charts/BarsChart.js";
9
- import { DonutChart as te } from "../components/charts/DonutChart.js";
10
- import { ActivityTimeline as ne } from "../components/ActivityTimeline.js";
11
- import { NotFoundState as re } from "../components/NotFoundState.js";
3
+ import { useCopy as n } from "../hooks/useCopy.js";
4
+ import { notify as r } from "../utils/toast.js";
5
+ import { AttachmentsPanel as i } from "../components/AttachmentsPanel.js";
6
+ import { CommentsPanel as a } from "../components/CommentsPanel.js";
7
+ import { formatCurrencyCompact as o } from "../components/charts/chartTheme.js";
8
+ import { TrendChart as ee } from "../components/charts/TrendChart.js";
9
+ import { BarsChart as te } from "../components/charts/BarsChart.js";
10
+ import { DonutChart as ne } from "../components/charts/DonutChart.js";
11
+ import { ActivityTimeline as re } from "../components/ActivityTimeline.js";
12
+ import { NotFoundState as ie } from "../components/NotFoundState.js";
12
13
  import { StatTile as s } from "../components/StatTile.js";
13
14
  import { ChartCard as c } from "../components/ChartCard.js";
14
15
  import "../components/index.js";
15
16
  import { useState as l } from "react";
16
- import { Archive as u, ArrowLeft as ie, Building2 as ae, Calendar as oe, DollarSign as d, Hash as f, Layers as se, MapPin as ce, Pencil as le, ShieldCheck as ue, Tag as de, Trash2 as fe, TrendingDown as pe, Truck as me, User as he, Wrench as p } from "lucide-react";
17
- import { useParams as ge } from "react-router-dom";
18
- import { gql as m } from "@apollo/client";
19
- import { useMutation as h, useQuery as _e } from "@apollo/client/react";
20
- import { Fragment as ve, jsx as g, jsxs as _ } from "react/jsx-runtime";
21
- import { Badge as ye, Button as v, Card as be, CardContent as xe, CardDescription as Se, CardHeader as Ce, CardTitle as we, EmphasisPanel as Te, GlassCard as Ee, GradientText as De, Input as y, Label as b, PagePurpose as Oe, ResponsiveDialog as x, ResponsiveDialogContent as S, ResponsiveDialogDescription as C, ResponsiveDialogFooter as w, ResponsiveDialogHeader as T, ResponsiveDialogTitle as E, Select as D, SelectContent as O, SelectItem as k, SelectTrigger as A, SelectValue as j, Tabs as ke, TabsContent as M, TabsList as Ae, TabsTrigger as N, Textarea as je } from "@burdenoff/fe-libs/ui";
17
+ import { Archive as u, ArrowLeft as ae, Building2 as oe, Calendar as se, DollarSign as d, Hash as ce, Layers as le, MapPin as ue, Pencil as de, ShieldCheck as fe, Tag as pe, Trash2 as me, TrendingDown as he, Truck as ge, User as _e, Wrench as f } from "lucide-react";
18
+ import { useParams as ve } from "react-router-dom";
19
+ import { gql as p } from "@apollo/client";
20
+ import { useMutation as m, useQuery as ye } from "@apollo/client/react";
21
+ import { Fragment as be, jsx as h, jsxs as g } from "react/jsx-runtime";
22
+ import { Badge as xe, Button as _, Card as Se, CardContent as Ce, CardDescription as we, CardHeader as Te, CardTitle as Ee, EmphasisPanel as De, GlassCard as Oe, GradientText as ke, Input as v, Label as y, PagePurpose as Ae, ResponsiveDialog as b, ResponsiveDialogContent as x, ResponsiveDialogDescription as S, ResponsiveDialogFooter as C, ResponsiveDialogHeader as w, ResponsiveDialogTitle as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A, Tabs as je, TabsContent as j, TabsList as Me, TabsTrigger as M, Textarea as Ne } from "@burdenoff/fe-libs/ui";
22
23
  //#region src/assethandler/pages/AssetsAssetDetailPage.tsx
23
- var Me = m`
24
+ var Pe = p`
24
25
  query AssetHandlerAsset($id: ID!) {
25
26
  asset(id: $id) {
26
27
  id
@@ -52,41 +53,46 @@ var Me = m`
52
53
  totalCostOfOwnership
53
54
  }
54
55
  }
55
- `, Ne = m`
56
+ `, Fe = p`
56
57
  mutation AssetHandlerUpdateAsset($id: ID!, $input: UpdateAssetInput!) {
57
58
  updateAsset(id: $id, input: $input) {
58
59
  id
59
60
  }
60
61
  }
61
- `, Pe = m`
62
+ `, Ie = p`
62
63
  mutation AssetHandlerDisposeAsset($id: ID!, $input: DisposeAssetInput!) {
63
64
  disposeAsset(id: $id, input: $input) {
64
65
  id
65
66
  status
66
67
  }
67
68
  }
68
- `, Fe = m`
69
+ `, Le = p`
69
70
  mutation AssetHandlerDeleteAsset($id: ID!) {
70
71
  deleteAsset(id: $id)
71
72
  }
72
- `, Ie = {
73
+ `, Re = {
73
74
  excellent: "text-status-success-text bg-status-success-bg-subtle",
74
75
  good: "text-status-info-text bg-status-info-bg-subtle",
75
76
  fair: "text-status-warning-text bg-status-warning-bg-subtle",
76
77
  poor: "text-status-warning-text bg-status-warning-bg-subtle",
77
78
  damaged: "text-status-error-text bg-status-error-bg-subtle"
78
- }, P = (e) => e == null ? "—" : `$${Number(e).toLocaleString(void 0, { maximumFractionDigits: 2 })}`, Le = {
79
+ }, N = (e) => e == null ? "—" : `$${Number(e).toLocaleString(void 0, { maximumFractionDigits: 2 })}`;
80
+ function ze(e) {
81
+ let t = Date.now();
82
+ return e.map((e) => e.scheduledDate).filter((e) => e != null && new Date(e).getTime() >= t).sort((e, t) => new Date(e).getTime() - new Date(t).getTime())[0];
83
+ }
84
+ var Be = {
79
85
  STRAIGHT_LINE: "Straight line",
80
86
  REDUCING_BALANCE: "Reducing balance",
81
87
  NONE: "None"
82
- }, Re = {
88
+ }, Ve = {
83
89
  active: "bg-status-success-bg-subtle text-status-success-text",
84
90
  maintenance: "bg-status-warning-bg-subtle text-status-warning-text",
85
91
  inactive: "bg-bg-sunken text-text-secondary",
86
92
  retired: "bg-bg-sunken text-text-secondary",
87
93
  disposed: "bg-status-error-bg-subtle text-status-error-text"
88
94
  };
89
- function ze(e) {
95
+ function He(e) {
90
96
  let t = e.purchaseValue, n = e.usefulLifeMonths;
91
97
  if (!t || t <= 0 || !n || n <= 0) return [];
92
98
  let r = Math.max(0, Math.min(e.salvageValue ?? 0, t)), i = (e.method ?? "straight_line").toLowerCase(), a = Math.max(1, Math.round(n / 12)), o = [];
@@ -103,7 +109,7 @@ function ze(e) {
103
109
  }
104
110
  return o;
105
111
  }
106
- function Be(e) {
112
+ function Ue(e) {
107
113
  return {
108
114
  name: e.name,
109
115
  description: e.description ?? "",
@@ -121,75 +127,75 @@ function Be(e) {
121
127
  depreciationMethod: (e.depreciationMethod ?? "STRAIGHT_LINE").toUpperCase()
122
128
  };
123
129
  }
124
- function F() {
125
- let m = t(), { assetId: F } = ge(), { maintenanceRecords: Ve } = e(), { data: He, loading: Ue, refetch: We } = _e(Me, {
126
- variables: { id: F ?? "" },
127
- skip: !F,
130
+ function P() {
131
+ let p = t(), { assetId: P } = ve(), { maintenanceRecords: We } = e(), Ge = n(), { data: Ke, loading: qe, refetch: Je } = ye(Pe, {
132
+ variables: { id: P ?? "" },
133
+ skip: !P,
128
134
  fetchPolicy: "cache-and-network"
129
- }), [Ge, R] = l(!1), [Ke, z] = l(!1), [qe, B] = l(!1), [V, H] = l(null), [U, W] = l({
135
+ }), [Ye, L] = l(!1), [Xe, R] = l(!1), [Ze, z] = l(!1), [B, Qe] = l(null), [V, H] = l({
130
136
  disposalDate: "",
131
137
  method: "",
132
138
  notes: ""
133
- }), [Je, { loading: G }] = h(Ne, {
139
+ }), [$e, { loading: U }] = m(Fe, {
134
140
  refetchQueries: ["AssetHandlerBootstrap"],
135
141
  onCompleted: () => {
136
- n.success("Asset updated", "Your changes have been saved."), R(!1), We();
142
+ r.success("Asset updated", "Your changes have been saved."), L(!1), Je();
137
143
  },
138
- onError: (e) => n.error("Could not update asset", e.message)
139
- }), [Ye, { loading: K }] = h(Pe, {
144
+ onError: (e) => r.error("Could not update asset", e.message)
145
+ }), [et, { loading: W }] = m(Ie, {
140
146
  refetchQueries: ["AssetHandlerBootstrap"],
141
147
  onCompleted: () => {
142
- n.success("Asset disposed", "The asset has been marked as disposed."), z(!1), We();
148
+ r.success("Asset disposed", "The asset has been marked as disposed."), R(!1), Je();
143
149
  },
144
- onError: (e) => n.error("Could not dispose asset", e.message)
145
- }), [Xe, { loading: q }] = h(Fe, {
150
+ onError: (e) => r.error("Could not dispose asset", e.message)
151
+ }), [tt, { loading: G }] = m(Le, {
146
152
  refetchQueries: ["AssetHandlerBootstrap"],
147
153
  onCompleted: () => {
148
- n.success("Asset deleted", "The asset has been removed from the inventory."), m("/assets/asset-list");
154
+ r.success("Asset deleted", "The asset has been removed from the inventory."), p("/assets/asset-list");
149
155
  },
150
- onError: (e) => n.error("Could not delete asset", e.message)
156
+ onError: (e) => r.error("Could not delete asset", e.message)
151
157
  });
152
- if (Ue && !He) return /* @__PURE__ */ g("div", {
158
+ if (qe && !Ke) return /* @__PURE__ */ h("div", {
153
159
  className: "space-y-3 p-6",
154
- children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ g("div", { className: "h-10 rounded-md bg-bg-sunken motion-safe:animate-vc-shimmer" }, t))
160
+ children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ h("div", { className: "h-10 rounded-md bg-bg-sunken motion-safe:animate-vc-shimmer" }, t))
155
161
  });
156
- let J = He?.asset;
157
- if (!J) return /* @__PURE__ */ g(re, {
162
+ let K = Ke?.asset;
163
+ if (!K) return /* @__PURE__ */ h(ie, {
158
164
  entityLabel: "Asset",
159
165
  description: "This asset may have been disposed or removed. Return to the inventory to find it.",
160
166
  backLabel: "Back to inventory",
161
- onBack: () => m("/assets/asset-list")
167
+ onBack: () => p("/assets/asset-list")
162
168
  });
163
- let Y = {
164
- ...J,
165
- status: J.status.toLowerCase(),
166
- condition: J.condition.toLowerCase(),
167
- category: J.category.toLowerCase()
168
- }, X = Ve.filter((e) => e.assetId === Y.id), Ze = X.filter((e) => e.status !== "completed" && e.status !== "cancelled"), Qe = Y.status === "disposed", Z = ze({
169
- purchaseValue: Y.purchaseValue,
170
- salvageValue: Y.salvageValue,
171
- usefulLifeMonths: Y.usefulLifeMonths,
172
- method: Y.depreciationMethod
173
- }), $e = Z.map((e) => e.bookValue), et = X.filter((e) => (e.actualCost ?? e.estimatedCost) != null).map((e) => ({
169
+ let q = {
170
+ ...K,
171
+ status: K.status.toLowerCase(),
172
+ condition: K.condition.toLowerCase(),
173
+ category: K.category.toLowerCase()
174
+ }, J = We.filter((e) => e.assetId === q.id), Y = J.filter((e) => e.status !== "completed" && e.status !== "cancelled"), nt = ze(Y), X = q.status === "disposed", Z = He({
175
+ purchaseValue: q.purchaseValue,
176
+ salvageValue: q.salvageValue,
177
+ usefulLifeMonths: q.usefulLifeMonths,
178
+ method: q.depreciationMethod
179
+ }), rt = Z.map((e) => e.bookValue), it = J.filter((e) => (e.actualCost ?? e.estimatedCost) != null).map((e) => ({
174
180
  label: e.scheduledDate ? new Date(e.scheduledDate).toLocaleDateString(void 0, {
175
181
  month: "short",
176
182
  year: "2-digit"
177
183
  }) : e.title.slice(0, 12),
178
184
  cost: e.actualCost ?? e.estimatedCost ?? 0
179
- })), tt = X.reduce((e, t) => e + (t.actualCost ?? t.estimatedCost ?? 0), 0), Q = Y.purchaseValue != null && tt > 0 ? [{
185
+ })), at = J.reduce((e, t) => e + (t.actualCost ?? t.estimatedCost ?? 0), 0), Q = q.purchaseValue != null && at > 0 ? [{
180
186
  name: "Purchase",
181
- value: Y.purchaseValue,
187
+ value: q.purchaseValue,
182
188
  color: "var(--color-accent-primary)"
183
189
  }, {
184
190
  name: "Maintenance",
185
- value: tt,
191
+ value: at,
186
192
  color: "var(--color-status-info-bg)"
187
- }] : [], nt = () => {
188
- H(Be(J)), R(!0);
189
- }, rt = (e) => {
190
- if (e.preventDefault(), !V) return;
191
- if (!V.name.trim()) {
192
- n.warning("Name required", "An asset must have a name.");
193
+ }] : [], ot = () => {
194
+ Qe(Ue(K)), L(!0);
195
+ }, st = (e) => {
196
+ if (e.preventDefault(), !B) return;
197
+ if (!B.name.trim()) {
198
+ r.warning("Name required", "An asset must have a name.");
193
199
  return;
194
200
  }
195
201
  let t = (e) => {
@@ -198,619 +204,624 @@ function F() {
198
204
  let n = Number(t);
199
205
  return Number.isNaN(n) ? null : n;
200
206
  };
201
- Je({ variables: {
202
- id: Y.id,
207
+ $e({ variables: {
208
+ id: q.id,
203
209
  input: {
204
- name: V.name.trim(),
205
- description: V.description.trim() || null,
206
- category: V.category.trim(),
207
- status: V.status,
208
- condition: V.condition,
209
- serialNumber: V.serialNumber.trim() || null,
210
- locationName: V.locationName.trim() || null,
211
- assignedTo: V.assignedTo.trim() || null,
212
- department: V.department.trim() || null,
213
- supplier: V.supplier.trim() || null,
214
- purchaseValue: t(V.purchaseValue),
215
- salvageValue: t(V.salvageValue),
216
- usefulLifeMonths: t(V.usefulLifeMonths),
217
- depreciationMethod: V.depreciationMethod
210
+ name: B.name.trim(),
211
+ description: B.description.trim() || null,
212
+ category: B.category.trim(),
213
+ status: B.status,
214
+ condition: B.condition,
215
+ serialNumber: B.serialNumber.trim() || null,
216
+ locationName: B.locationName.trim() || null,
217
+ assignedTo: B.assignedTo.trim() || null,
218
+ department: B.department.trim() || null,
219
+ supplier: B.supplier.trim() || null,
220
+ purchaseValue: t(B.purchaseValue),
221
+ salvageValue: t(B.salvageValue),
222
+ usefulLifeMonths: t(B.usefulLifeMonths),
223
+ depreciationMethod: B.depreciationMethod
218
224
  }
219
225
  } });
220
- }, it = (e) => {
221
- e.preventDefault(), Ye({ variables: {
222
- id: Y.id,
226
+ }, ct = (e) => {
227
+ e.preventDefault(), et({ variables: {
228
+ id: q.id,
223
229
  input: {
224
- disposalDate: U.disposalDate ? new Date(U.disposalDate).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
225
- method: U.method.trim() || null,
226
- notes: U.notes.trim() || null
230
+ disposalDate: V.disposalDate ? new Date(V.disposalDate).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
231
+ method: V.method.trim() || null,
232
+ notes: V.notes.trim() || null
227
233
  }
228
234
  } });
229
- }, $ = (e, t) => H((n) => n && {
235
+ }, $ = (e, t) => Qe((n) => n && {
230
236
  ...n,
231
237
  [e]: t
232
238
  });
233
- return /* @__PURE__ */ _("div", {
239
+ return /* @__PURE__ */ g("div", {
234
240
  className: "space-y-6 p-6",
235
241
  children: [
236
- /* @__PURE__ */ _("div", {
242
+ /* @__PURE__ */ g("div", {
237
243
  className: "flex flex-wrap items-center justify-between gap-3",
238
- children: [/* @__PURE__ */ _("div", {
244
+ children: [/* @__PURE__ */ g("div", {
239
245
  className: "flex items-center gap-4",
240
- children: [/* @__PURE__ */ g(v, {
246
+ children: [/* @__PURE__ */ h(_, {
241
247
  variant: "ghost",
242
248
  size: "icon",
243
249
  "aria-label": "Go back",
244
- onClick: () => m("/assets/asset-list"),
245
- children: /* @__PURE__ */ g(ie, { className: "h-4 w-4" })
246
- }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("div", {
250
+ onClick: () => p("/assets/asset-list"),
251
+ children: /* @__PURE__ */ h(ae, { className: "h-4 w-4" })
252
+ }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("div", {
247
253
  className: "flex items-center gap-3",
248
254
  children: [
249
- /* @__PURE__ */ g("h1", {
255
+ /* @__PURE__ */ h("h1", {
250
256
  className: "text-2xl font-bold",
251
- children: /* @__PURE__ */ g(De, { children: Y.name })
257
+ children: /* @__PURE__ */ h(ke, { children: q.name })
252
258
  }),
253
- /* @__PURE__ */ g("span", {
254
- className: `rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${Re[Y.status] ?? "bg-bg-sunken text-text-secondary"}`,
255
- children: Y.status.replace(/_/g, " ")
259
+ /* @__PURE__ */ h("span", {
260
+ className: `rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${Ve[q.status] ?? "bg-bg-sunken text-text-secondary"}`,
261
+ children: q.status.replace(/_/g, " ")
256
262
  }),
257
- /* @__PURE__ */ g("span", {
258
- className: `rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${Ie[Y.condition] ?? ""}`,
259
- children: Y.condition
263
+ /* @__PURE__ */ h("span", {
264
+ className: `rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${Re[q.condition] ?? ""}`,
265
+ children: q.condition
260
266
  })
261
267
  ]
262
- }), /* @__PURE__ */ _("p", {
268
+ }), /* @__PURE__ */ g("p", {
263
269
  className: "text-sm text-text-secondary mt-1",
264
- children: [Y.assetNumber, Y.serialNumber ? /* @__PURE__ */ _(ve, { children: [" · SN: ", Y.serialNumber] }) : null]
270
+ children: [q.assetNumber, q.serialNumber ? /* @__PURE__ */ g(be, { children: [" · SN: ", q.serialNumber] }) : null]
265
271
  })] })]
266
- }), /* @__PURE__ */ _("div", {
272
+ }), /* @__PURE__ */ g("div", {
267
273
  className: "flex items-center gap-2",
268
274
  children: [
269
- /* @__PURE__ */ _(v, {
275
+ /* @__PURE__ */ g(_, {
270
276
  size: "sm",
271
277
  variant: "outline",
272
- onClick: nt,
273
- children: [/* @__PURE__ */ g(le, { className: "mr-2 h-4 w-4" }), "Edit"]
278
+ onClick: ot,
279
+ children: [/* @__PURE__ */ h(de, { className: "mr-2 h-4 w-4" }), "Edit"]
274
280
  }),
275
- Qe ? null : /* @__PURE__ */ _(v, {
281
+ X ? null : /* @__PURE__ */ g(_, {
276
282
  size: "sm",
277
283
  variant: "outline",
278
- onClick: () => z(!0),
279
- children: [/* @__PURE__ */ g(u, { className: "mr-2 h-4 w-4" }), "Dispose"]
284
+ onClick: () => R(!0),
285
+ children: [/* @__PURE__ */ h(u, { className: "mr-2 h-4 w-4" }), "Dispose"]
280
286
  }),
281
- /* @__PURE__ */ _(v, {
287
+ /* @__PURE__ */ g(_, {
282
288
  size: "sm",
283
289
  variant: "outline",
284
290
  className: "text-status-error-text",
285
- onClick: () => B(!0),
286
- children: [/* @__PURE__ */ g(fe, { className: "mr-2 h-4 w-4" }), "Delete"]
291
+ onClick: () => z(!0),
292
+ children: [/* @__PURE__ */ h(me, { className: "mr-2 h-4 w-4" }), "Delete"]
287
293
  })
288
294
  ]
289
295
  })]
290
296
  }),
291
- /* @__PURE__ */ g(Oe, { children: "The complete profile of a single asset — its identity, condition, location, assignment, financials and maintenance history. Use this page as the asset's home base: edit its details, track its book value, and dispose of it when it reaches end of life." }),
292
- Qe ? /* @__PURE__ */ _(Te, { children: [
293
- /* @__PURE__ */ _("div", {
297
+ /* @__PURE__ */ h(Ae, { children: "The complete profile of a single asset — its identity, condition, location, assignment, financials and maintenance history. Use this page as the asset's home base: edit its details, track its book value, and dispose of it when it reaches end of life." }),
298
+ X ? /* @__PURE__ */ g(De, { children: [
299
+ /* @__PURE__ */ g("div", {
294
300
  className: "flex items-center gap-2 text-sm font-medium",
295
301
  children: [
296
- /* @__PURE__ */ g(u, { className: "h-4 w-4" }),
302
+ /* @__PURE__ */ h(u, { className: "h-4 w-4" }),
297
303
  "This asset was disposed",
298
- Y.disposalDate ? ` on ${new Date(Y.disposalDate).toLocaleDateString()}` : ""
304
+ q.disposalDate ? ` on ${new Date(q.disposalDate).toLocaleDateString()}` : ""
299
305
  ]
300
306
  }),
301
- Y.disposalMethod ? /* @__PURE__ */ _("p", {
307
+ q.disposalMethod ? /* @__PURE__ */ g("p", {
302
308
  className: "mt-1 text-sm text-text-secondary",
303
- children: ["Method: ", Y.disposalMethod]
309
+ children: ["Method: ", q.disposalMethod]
304
310
  }) : null,
305
- Y.disposalNotes ? /* @__PURE__ */ g("p", {
311
+ q.disposalNotes ? /* @__PURE__ */ h("p", {
306
312
  className: "mt-1 text-sm text-text-secondary",
307
- children: Y.disposalNotes
313
+ children: q.disposalNotes
308
314
  }) : null
309
315
  ] }) : null,
310
- /* @__PURE__ */ _("div", {
316
+ /* @__PURE__ */ g("div", {
311
317
  className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-4",
312
318
  children: [
313
- /* @__PURE__ */ g(s, {
319
+ /* @__PURE__ */ h(s, {
314
320
  hero: !0,
315
321
  label: "Current value",
316
- value: P(Y.currentValue),
317
- delta: Y.purchaseValue == null ? void 0 : `of ${P(Y.purchaseValue)}`,
322
+ value: N(q.currentValue),
323
+ delta: q.purchaseValue == null ? void 0 : `of ${N(q.purchaseValue)}`,
318
324
  deltaDirection: "neutral",
319
- spark: $e.length > 1 ? $e : void 0,
325
+ spark: rt.length > 1 ? rt : void 0,
320
326
  icon: d
321
327
  }),
322
- /* @__PURE__ */ g(s, {
328
+ /* @__PURE__ */ h(s, {
323
329
  label: "Maintenance records",
324
- value: X.length,
325
- delta: Ze.length > 0 ? `${Ze.length} open` : void 0,
330
+ value: J.length,
331
+ delta: Y.length > 0 ? `${Y.length} open` : void 0,
326
332
  deltaTone: "neutral",
327
333
  deltaDirection: "neutral",
328
- icon: p
334
+ icon: f
329
335
  }),
330
- /* @__PURE__ */ g(s, {
336
+ /* @__PURE__ */ h(s, {
331
337
  label: "Registered",
332
- value: Y.createdAt ? new Date(Y.createdAt).toLocaleDateString() : "—",
333
- icon: oe
338
+ value: q.createdAt ? new Date(q.createdAt).toLocaleDateString() : "—",
339
+ icon: se
334
340
  }),
335
- /* @__PURE__ */ g(s, {
341
+ /* @__PURE__ */ h(s, {
336
342
  label: "Location",
337
- value: Y.locationName || "—",
338
- icon: ce
343
+ value: q.locationName || "—",
344
+ icon: ue
339
345
  })
340
346
  ]
341
347
  }),
342
- /* @__PURE__ */ _("div", {
348
+ /* @__PURE__ */ g("div", {
343
349
  className: "grid gap-6 lg:grid-cols-3",
344
- children: [/* @__PURE__ */ g("div", {
350
+ children: [/* @__PURE__ */ h("div", {
345
351
  className: "min-w-0 lg:col-span-2",
346
- children: /* @__PURE__ */ _(ke, {
352
+ children: /* @__PURE__ */ g(je, {
347
353
  defaultValue: "details",
348
354
  children: [
349
- /* @__PURE__ */ _(Ae, {
355
+ /* @__PURE__ */ g(Me, {
350
356
  className: "max-w-full justify-start overflow-x-auto",
351
357
  children: [
352
- /* @__PURE__ */ g(N, {
358
+ /* @__PURE__ */ h(M, {
353
359
  value: "details",
354
360
  children: "Details"
355
361
  }),
356
- /* @__PURE__ */ g(N, {
362
+ /* @__PURE__ */ h(M, {
357
363
  value: "financial",
358
364
  children: "Financial"
359
365
  }),
360
- /* @__PURE__ */ g(N, {
366
+ /* @__PURE__ */ h(M, {
361
367
  value: "maintenance",
362
368
  children: "Maintenance"
363
369
  }),
364
- /* @__PURE__ */ g(N, {
370
+ /* @__PURE__ */ h(M, {
365
371
  value: "discussion",
366
372
  children: "Discussion"
367
373
  })
368
374
  ]
369
375
  }),
370
- /* @__PURE__ */ _(M, {
376
+ /* @__PURE__ */ g(j, {
371
377
  value: "details",
372
378
  className: "mt-4 space-y-4",
373
379
  children: [
374
- Y.description ? /* @__PURE__ */ g(I, {
380
+ q.description ? /* @__PURE__ */ h(F, {
375
381
  label: "Description",
376
- value: Y.description,
382
+ value: q.description,
377
383
  full: !0
378
384
  }) : null,
379
- /* @__PURE__ */ _("div", {
385
+ /* @__PURE__ */ g("div", {
380
386
  className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
381
387
  children: [
382
- /* @__PURE__ */ g(I, {
388
+ /* @__PURE__ */ h(F, {
383
389
  label: "Asset Tag",
384
- value: Y.assetNumber,
385
- icon: f,
390
+ value: q.assetNumber,
391
+ icon: ce,
386
392
  mono: !0
387
393
  }),
388
- /* @__PURE__ */ g(I, {
394
+ /* @__PURE__ */ h(F, {
389
395
  label: "Serial Number",
390
- value: Y.serialNumber || "—",
391
- icon: f,
396
+ value: q.serialNumber || "—",
397
+ icon: ce,
392
398
  mono: !0
393
399
  }),
394
- /* @__PURE__ */ g(I, {
400
+ /* @__PURE__ */ h(F, {
395
401
  label: "Category",
396
- value: Y.category.replace(/_/g, " "),
397
- icon: se,
402
+ value: q.category.replace(/_/g, " "),
403
+ icon: le,
398
404
  capitalize: !0
399
405
  }),
400
- /* @__PURE__ */ g(I, {
406
+ /* @__PURE__ */ h(F, {
401
407
  label: "Condition",
402
- icon: ue,
403
- children: /* @__PURE__ */ g("span", {
404
- className: `inline-flex rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${Ie[Y.condition] ?? ""}`,
405
- children: Y.condition
408
+ icon: fe,
409
+ children: /* @__PURE__ */ h("span", {
410
+ className: `inline-flex rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${Re[q.condition] ?? ""}`,
411
+ children: q.condition
406
412
  })
407
413
  }),
408
- /* @__PURE__ */ g(I, {
414
+ /* @__PURE__ */ h(F, {
409
415
  label: "Assigned To",
410
- value: Y.assignedTo || "—",
411
- icon: he
416
+ value: q.assignedTo || "—",
417
+ icon: _e
412
418
  }),
413
- /* @__PURE__ */ g(I, {
419
+ /* @__PURE__ */ h(F, {
420
+ label: Ge("assethandler.asset.detail.nextService", "Next Service"),
421
+ value: nt ? new Date(nt).toLocaleDateString() : "—",
422
+ icon: f
423
+ }),
424
+ /* @__PURE__ */ h(F, {
414
425
  label: "Department",
415
- value: Y.department || "—",
416
- icon: ae
426
+ value: q.department || "—",
427
+ icon: oe
417
428
  }),
418
- /* @__PURE__ */ g(I, {
429
+ /* @__PURE__ */ h(F, {
419
430
  label: "Location",
420
- value: Y.locationName || "—",
421
- icon: ce
431
+ value: q.locationName || "—",
432
+ icon: ue
422
433
  }),
423
- /* @__PURE__ */ g(I, {
434
+ /* @__PURE__ */ h(F, {
424
435
  label: "Supplier",
425
- value: Y.supplier || "—",
426
- icon: me
436
+ value: q.supplier || "—",
437
+ icon: ge
427
438
  }),
428
- /* @__PURE__ */ g(I, {
439
+ /* @__PURE__ */ h(F, {
429
440
  label: "Warranty Expiry",
430
- value: Y.warrantyExpiry ? new Date(Y.warrantyExpiry).toLocaleDateString() : "—",
431
- icon: oe
441
+ value: q.warrantyExpiry ? new Date(q.warrantyExpiry).toLocaleDateString() : "—",
442
+ icon: se
432
443
  })
433
444
  ]
434
445
  }),
435
- /* @__PURE__ */ g(r, {
446
+ /* @__PURE__ */ h(i, {
436
447
  entityType: "assethandler-asset",
437
- entityId: Y.id
448
+ entityId: q.id
438
449
  })
439
450
  ]
440
451
  }),
441
- /* @__PURE__ */ _(M, {
452
+ /* @__PURE__ */ g(j, {
442
453
  value: "financial",
443
454
  className: "mt-4 space-y-6",
444
455
  children: [
445
- /* @__PURE__ */ _("div", {
456
+ /* @__PURE__ */ g("div", {
446
457
  className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-4",
447
458
  children: [
448
- /* @__PURE__ */ g(s, {
459
+ /* @__PURE__ */ h(s, {
449
460
  label: "Purchase Value",
450
- value: P(Y.purchaseValue)
461
+ value: N(q.purchaseValue)
451
462
  }),
452
- /* @__PURE__ */ g(s, {
463
+ /* @__PURE__ */ h(s, {
453
464
  hero: !0,
454
465
  label: "Current Book Value",
455
- value: P(Y.currentValue)
466
+ value: N(q.currentValue)
456
467
  }),
457
- /* @__PURE__ */ g(s, {
468
+ /* @__PURE__ */ h(s, {
458
469
  label: "Accum. Depreciation",
459
- value: P(Y.accumulatedDepreciation)
470
+ value: N(q.accumulatedDepreciation)
460
471
  }),
461
- /* @__PURE__ */ g(s, {
472
+ /* @__PURE__ */ h(s, {
462
473
  label: "Total Cost of Ownership",
463
- value: P(Y.totalCostOfOwnership)
474
+ value: N(q.totalCostOfOwnership)
464
475
  })
465
476
  ]
466
477
  }),
467
- /* @__PURE__ */ _("div", {
478
+ /* @__PURE__ */ g("div", {
468
479
  className: "grid gap-4 lg:grid-cols-2",
469
- children: [/* @__PURE__ */ g(c, {
480
+ children: [/* @__PURE__ */ h(c, {
470
481
  title: "Depreciation & book value",
471
482
  subtitle: "Projected book value over the useful life",
472
- icon: pe,
473
- children: Z.length > 0 ? /* @__PURE__ */ g(o, {
483
+ icon: he,
484
+ children: Z.length > 0 ? /* @__PURE__ */ h(ee, {
474
485
  data: Z,
475
486
  xKey: "year",
476
487
  height: 260,
477
- valueFormat: a("USD"),
488
+ valueFormat: o("USD"),
478
489
  xTickFormat: (e) => `${e}y`,
479
490
  series: [{
480
491
  key: "bookValue",
481
492
  label: "Book value"
482
493
  }]
483
- }) : /* @__PURE__ */ g("div", {
494
+ }) : /* @__PURE__ */ h("div", {
484
495
  className: "py-12 text-center text-sm text-text-secondary",
485
496
  children: "Add purchase value, useful life and salvage value to see the depreciation schedule."
486
497
  })
487
- }), /* @__PURE__ */ g(c, {
498
+ }), /* @__PURE__ */ h(c, {
488
499
  title: "Key facts",
489
500
  subtitle: "Purchase & depreciation terms",
490
- children: /* @__PURE__ */ _("dl", {
501
+ children: /* @__PURE__ */ g("dl", {
491
502
  className: "overflow-hidden rounded-lg border border-border-seam text-sm",
492
503
  children: [
493
- /* @__PURE__ */ g(L, {
504
+ /* @__PURE__ */ h(I, {
494
505
  label: "Purchase Date",
495
- value: Y.purchaseDate ? new Date(Y.purchaseDate).toLocaleDateString() : "—",
506
+ value: q.purchaseDate ? new Date(q.purchaseDate).toLocaleDateString() : "—",
496
507
  striped: !0
497
508
  }),
498
- /* @__PURE__ */ g(L, {
509
+ /* @__PURE__ */ h(I, {
499
510
  label: "Useful Life",
500
- value: Y.usefulLifeMonths ? `${Y.usefulLifeMonths} months` : "—"
511
+ value: q.usefulLifeMonths ? `${q.usefulLifeMonths} months` : "—"
501
512
  }),
502
- /* @__PURE__ */ g(L, {
513
+ /* @__PURE__ */ h(I, {
503
514
  label: "Salvage Value",
504
- value: P(Y.salvageValue),
515
+ value: N(q.salvageValue),
505
516
  striped: !0
506
517
  }),
507
- /* @__PURE__ */ g(L, {
518
+ /* @__PURE__ */ h(I, {
508
519
  label: "Depreciation Method",
509
- value: Y.depreciationMethod ? Le[Y.depreciationMethod.toUpperCase()] ?? Y.depreciationMethod : "—"
520
+ value: q.depreciationMethod ? Be[q.depreciationMethod.toUpperCase()] ?? q.depreciationMethod : "—"
510
521
  }),
511
- /* @__PURE__ */ g(L, {
522
+ /* @__PURE__ */ h(I, {
512
523
  label: "Supplier",
513
- value: Y.supplier || "—",
524
+ value: q.supplier || "—",
514
525
  striped: !0
515
526
  }),
516
- /* @__PURE__ */ g(L, {
527
+ /* @__PURE__ */ h(I, {
517
528
  label: "Warranty Expiry",
518
- value: Y.warrantyExpiry ? new Date(Y.warrantyExpiry).toLocaleDateString() : "—"
529
+ value: q.warrantyExpiry ? new Date(q.warrantyExpiry).toLocaleDateString() : "—"
519
530
  })
520
531
  ]
521
532
  })
522
533
  })]
523
534
  }),
524
- Q.length > 0 ? /* @__PURE__ */ g(c, {
535
+ Q.length > 0 ? /* @__PURE__ */ h(c, {
525
536
  title: "Total cost of ownership",
526
537
  subtitle: "What drives lifetime cost",
527
538
  icon: d,
528
- children: /* @__PURE__ */ g(te, {
539
+ children: /* @__PURE__ */ h(ne, {
529
540
  data: Q,
530
541
  centerLabel: "TCO",
531
542
  centerValue: Q.reduce((e, t) => e + t.value, 0),
532
- valueFormat: a("USD"),
543
+ valueFormat: o("USD"),
533
544
  height: 220
534
545
  })
535
546
  }) : null
536
547
  ]
537
548
  }),
538
- /* @__PURE__ */ _(M, {
549
+ /* @__PURE__ */ g(j, {
539
550
  value: "maintenance",
540
551
  className: "mt-4 space-y-4",
541
- children: [et.length > 0 ? /* @__PURE__ */ g(c, {
552
+ children: [it.length > 0 ? /* @__PURE__ */ h(c, {
542
553
  title: "Maintenance cost history",
543
554
  subtitle: "Recorded cost per maintenance event",
544
- icon: p,
545
- children: /* @__PURE__ */ g(ee, {
546
- data: et,
555
+ icon: f,
556
+ children: /* @__PURE__ */ h(te, {
557
+ data: it,
547
558
  xKey: "label",
548
559
  height: 220,
549
- valueFormat: a("USD"),
560
+ valueFormat: o("USD"),
550
561
  series: [{
551
562
  key: "cost",
552
563
  label: "Cost"
553
564
  }]
554
565
  })
555
- }) : null, /* @__PURE__ */ _(be, { children: [/* @__PURE__ */ _(Ce, { children: [/* @__PURE__ */ _(we, {
566
+ }) : null, /* @__PURE__ */ g(Se, { children: [/* @__PURE__ */ g(Te, { children: [/* @__PURE__ */ g(Ee, {
556
567
  className: "flex items-center gap-2",
557
- children: [/* @__PURE__ */ g(p, { className: "h-4 w-4" }), "Maintenance History"]
558
- }), /* @__PURE__ */ _(Se, { children: [X.length, " records found"] })] }), /* @__PURE__ */ g(xe, { children: X.length === 0 ? /* @__PURE__ */ g("p", {
568
+ children: [/* @__PURE__ */ h(f, { className: "h-4 w-4" }), "Maintenance History"]
569
+ }), /* @__PURE__ */ g(we, { children: [J.length, " records found"] })] }), /* @__PURE__ */ h(Ce, { children: J.length === 0 ? /* @__PURE__ */ h("p", {
559
570
  className: "py-8 text-center text-text-secondary",
560
571
  children: "No maintenance records for this asset."
561
- }) : /* @__PURE__ */ g("div", {
572
+ }) : /* @__PURE__ */ h("div", {
562
573
  className: "space-y-3",
563
- children: X.map((e) => /* @__PURE__ */ g("div", {
574
+ children: J.map((e) => /* @__PURE__ */ h("div", {
564
575
  className: "flex items-start gap-4 rounded-lg border p-4",
565
- children: /* @__PURE__ */ _("div", {
576
+ children: /* @__PURE__ */ g("div", {
566
577
  className: "flex-1",
567
578
  children: [
568
- /* @__PURE__ */ _("div", {
579
+ /* @__PURE__ */ g("div", {
569
580
  className: "flex items-center gap-2",
570
- children: [/* @__PURE__ */ g(ye, {
581
+ children: [/* @__PURE__ */ h(xe, {
571
582
  variant: "outline",
572
583
  className: "capitalize",
573
584
  children: e.type
574
- }), /* @__PURE__ */ g("span", {
585
+ }), /* @__PURE__ */ h("span", {
575
586
  className: `rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${e.status === "completed" ? "bg-status-success-bg-subtle text-status-success-text" : "bg-status-warning-bg-subtle text-status-warning-text"}`,
576
587
  children: e.status.replace(/_/g, " ")
577
588
  })]
578
589
  }),
579
- /* @__PURE__ */ g("p", {
590
+ /* @__PURE__ */ h("p", {
580
591
  className: "mt-1 font-medium",
581
592
  children: e.title
582
593
  }),
583
- /* @__PURE__ */ g("p", {
594
+ /* @__PURE__ */ h("p", {
584
595
  className: "text-sm text-text-secondary",
585
596
  children: e.description
586
597
  }),
587
- /* @__PURE__ */ _("div", {
598
+ /* @__PURE__ */ g("div", {
588
599
  className: "mt-2 flex gap-4 text-xs text-text-secondary",
589
- children: [/* @__PURE__ */ _("span", { children: [
600
+ children: [/* @__PURE__ */ g("span", { children: [
590
601
  "Scheduled:",
591
602
  " ",
592
603
  e.scheduledDate ? new Date(e.scheduledDate).toLocaleDateString() : "—"
593
- ] }), e.actualCost != null || e.estimatedCost != null ? /* @__PURE__ */ _("span", { children: ["Cost: ", P(e.actualCost ?? e.estimatedCost)] }) : null]
604
+ ] }), e.actualCost != null || e.estimatedCost != null ? /* @__PURE__ */ g("span", { children: ["Cost: ", N(e.actualCost ?? e.estimatedCost)] }) : null]
594
605
  })
595
606
  ]
596
607
  })
597
608
  }, e.id))
598
609
  }) })] })]
599
610
  }),
600
- /* @__PURE__ */ g(M, {
611
+ /* @__PURE__ */ h(j, {
601
612
  value: "discussion",
602
613
  className: "mt-4",
603
- children: /* @__PURE__ */ g(i, {
614
+ children: /* @__PURE__ */ h(a, {
604
615
  entityType: "assethandler-asset",
605
- entityId: Y.id
616
+ entityId: q.id
606
617
  })
607
618
  })
608
619
  ]
609
620
  })
610
- }), /* @__PURE__ */ _("aside", {
621
+ }), /* @__PURE__ */ g("aside", {
611
622
  className: "space-y-6",
612
- children: [/* @__PURE__ */ g(Ee, {
623
+ children: [/* @__PURE__ */ h(Oe, {
613
624
  treatment: "glass",
614
625
  className: "border-border-seam",
615
- children: /* @__PURE__ */ _("div", {
626
+ children: /* @__PURE__ */ g("div", {
616
627
  className: "space-y-3 p-5",
617
- children: [/* @__PURE__ */ _("h3", {
628
+ children: [/* @__PURE__ */ g("h3", {
618
629
  className: "flex items-center gap-2 text-sm font-semibold",
619
- children: [/* @__PURE__ */ g(de, { className: "h-4 w-4 text-text-secondary" }), "Tags"]
620
- }), Y.tags.length === 0 ? /* @__PURE__ */ g("p", {
630
+ children: [/* @__PURE__ */ h(pe, { className: "h-4 w-4 text-text-secondary" }), "Tags"]
631
+ }), q.tags.length === 0 ? /* @__PURE__ */ h("p", {
621
632
  className: "text-xs text-text-secondary",
622
633
  children: "No tags yet"
623
- }) : /* @__PURE__ */ g("div", {
634
+ }) : /* @__PURE__ */ h("div", {
624
635
  className: "flex flex-wrap gap-1.5",
625
- children: Y.tags.map((e) => /* @__PURE__ */ g("span", {
636
+ children: q.tags.map((e) => /* @__PURE__ */ h("span", {
626
637
  className: "rounded-full bg-action-primary-bg/10 px-2.5 py-0.5 text-xs font-medium text-action-primary-bg",
627
638
  children: e
628
639
  }, e))
629
640
  })]
630
641
  })
631
- }), /* @__PURE__ */ g(ne, { resourceId: Y.id })]
642
+ }), /* @__PURE__ */ h(re, { resourceId: q.id })]
632
643
  })]
633
644
  }),
634
- /* @__PURE__ */ g(x, {
635
- open: Ge,
636
- onOpenChange: R,
637
- children: /* @__PURE__ */ _(S, {
645
+ /* @__PURE__ */ h(b, {
646
+ open: Ye,
647
+ onOpenChange: L,
648
+ children: /* @__PURE__ */ g(x, {
638
649
  className: "max-h-[85vh] overflow-y-auto sm:max-w-2xl",
639
- children: [/* @__PURE__ */ _(T, { children: [/* @__PURE__ */ g(E, { children: "Edit asset" }), /* @__PURE__ */ g(C, { children: "Update this asset's details and financials." })] }), V ? /* @__PURE__ */ _("form", {
650
+ children: [/* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, { children: "Edit asset" }), /* @__PURE__ */ h(S, { children: "Update this asset's details and financials." })] }), B ? /* @__PURE__ */ g("form", {
640
651
  className: "space-y-4",
641
- onSubmit: rt,
652
+ onSubmit: st,
642
653
  children: [
643
- /* @__PURE__ */ _("div", {
654
+ /* @__PURE__ */ g("div", {
644
655
  className: "grid gap-4 md:grid-cols-2",
645
- children: [/* @__PURE__ */ _("div", {
656
+ children: [/* @__PURE__ */ g("div", {
646
657
  className: "space-y-2",
647
- children: [/* @__PURE__ */ g(b, { children: "Name" }), /* @__PURE__ */ g(y, {
648
- value: V.name,
658
+ children: [/* @__PURE__ */ h(y, { children: "Name" }), /* @__PURE__ */ h(v, {
659
+ value: B.name,
649
660
  onChange: (e) => $("name", e.target.value)
650
661
  })]
651
- }), /* @__PURE__ */ _("div", {
662
+ }), /* @__PURE__ */ g("div", {
652
663
  className: "space-y-2",
653
- children: [/* @__PURE__ */ g(b, { children: "Category" }), /* @__PURE__ */ g(y, {
654
- value: V.category,
664
+ children: [/* @__PURE__ */ h(y, { children: "Category" }), /* @__PURE__ */ h(v, {
665
+ value: B.category,
655
666
  onChange: (e) => $("category", e.target.value)
656
667
  })]
657
668
  })]
658
669
  }),
659
- /* @__PURE__ */ _("div", {
670
+ /* @__PURE__ */ g("div", {
660
671
  className: "space-y-2",
661
- children: [/* @__PURE__ */ g(b, { children: "Description" }), /* @__PURE__ */ g(je, {
662
- value: V.description,
672
+ children: [/* @__PURE__ */ h(y, { children: "Description" }), /* @__PURE__ */ h(Ne, {
673
+ value: B.description,
663
674
  onChange: (e) => $("description", e.target.value),
664
675
  rows: 2
665
676
  })]
666
677
  }),
667
- /* @__PURE__ */ _("div", {
678
+ /* @__PURE__ */ g("div", {
668
679
  className: "grid gap-4 md:grid-cols-3",
669
680
  children: [
670
- /* @__PURE__ */ _("div", {
681
+ /* @__PURE__ */ g("div", {
671
682
  className: "space-y-2",
672
- children: [/* @__PURE__ */ g(b, { children: "Status" }), /* @__PURE__ */ _(D, {
673
- value: V.status,
683
+ children: [/* @__PURE__ */ h(y, { children: "Status" }), /* @__PURE__ */ g(E, {
684
+ value: B.status,
674
685
  onValueChange: (e) => $("status", e),
675
- children: [/* @__PURE__ */ g(A, { children: /* @__PURE__ */ g(j, {}) }), /* @__PURE__ */ _(O, { children: [
676
- /* @__PURE__ */ g(k, {
686
+ children: [/* @__PURE__ */ h(k, { children: /* @__PURE__ */ h(A, {}) }), /* @__PURE__ */ g(D, { children: [
687
+ /* @__PURE__ */ h(O, {
677
688
  value: "ACTIVE",
678
689
  children: "Active"
679
690
  }),
680
- /* @__PURE__ */ g(k, {
691
+ /* @__PURE__ */ h(O, {
681
692
  value: "INACTIVE",
682
693
  children: "Inactive"
683
694
  }),
684
- /* @__PURE__ */ g(k, {
695
+ /* @__PURE__ */ h(O, {
685
696
  value: "MAINTENANCE",
686
697
  children: "Maintenance"
687
698
  }),
688
- /* @__PURE__ */ g(k, {
699
+ /* @__PURE__ */ h(O, {
689
700
  value: "RETIRED",
690
701
  children: "Retired"
691
702
  })
692
703
  ] })]
693
704
  })]
694
705
  }),
695
- /* @__PURE__ */ _("div", {
706
+ /* @__PURE__ */ g("div", {
696
707
  className: "space-y-2",
697
- children: [/* @__PURE__ */ g(b, { children: "Condition" }), /* @__PURE__ */ _(D, {
698
- value: V.condition,
708
+ children: [/* @__PURE__ */ h(y, { children: "Condition" }), /* @__PURE__ */ g(E, {
709
+ value: B.condition,
699
710
  onValueChange: (e) => $("condition", e),
700
- children: [/* @__PURE__ */ g(A, { children: /* @__PURE__ */ g(j, {}) }), /* @__PURE__ */ _(O, { children: [
701
- /* @__PURE__ */ g(k, {
711
+ children: [/* @__PURE__ */ h(k, { children: /* @__PURE__ */ h(A, {}) }), /* @__PURE__ */ g(D, { children: [
712
+ /* @__PURE__ */ h(O, {
702
713
  value: "EXCELLENT",
703
714
  children: "Excellent"
704
715
  }),
705
- /* @__PURE__ */ g(k, {
716
+ /* @__PURE__ */ h(O, {
706
717
  value: "GOOD",
707
718
  children: "Good"
708
719
  }),
709
- /* @__PURE__ */ g(k, {
720
+ /* @__PURE__ */ h(O, {
710
721
  value: "FAIR",
711
722
  children: "Fair"
712
723
  }),
713
- /* @__PURE__ */ g(k, {
724
+ /* @__PURE__ */ h(O, {
714
725
  value: "POOR",
715
726
  children: "Poor"
716
727
  }),
717
- /* @__PURE__ */ g(k, {
728
+ /* @__PURE__ */ h(O, {
718
729
  value: "DAMAGED",
719
730
  children: "Damaged"
720
731
  })
721
732
  ] })]
722
733
  })]
723
734
  }),
724
- /* @__PURE__ */ _("div", {
735
+ /* @__PURE__ */ g("div", {
725
736
  className: "space-y-2",
726
- children: [/* @__PURE__ */ g(b, { children: "Department" }), /* @__PURE__ */ g(y, {
727
- value: V.department,
737
+ children: [/* @__PURE__ */ h(y, { children: "Department" }), /* @__PURE__ */ h(v, {
738
+ value: B.department,
728
739
  onChange: (e) => $("department", e.target.value)
729
740
  })]
730
741
  })
731
742
  ]
732
743
  }),
733
- /* @__PURE__ */ _("div", {
744
+ /* @__PURE__ */ g("div", {
734
745
  className: "grid gap-4 md:grid-cols-2",
735
746
  children: [
736
- /* @__PURE__ */ _("div", {
747
+ /* @__PURE__ */ g("div", {
737
748
  className: "space-y-2",
738
- children: [/* @__PURE__ */ g(b, { children: "Serial Number" }), /* @__PURE__ */ g(y, {
739
- value: V.serialNumber,
749
+ children: [/* @__PURE__ */ h(y, { children: "Serial Number" }), /* @__PURE__ */ h(v, {
750
+ value: B.serialNumber,
740
751
  onChange: (e) => $("serialNumber", e.target.value)
741
752
  })]
742
753
  }),
743
- /* @__PURE__ */ _("div", {
754
+ /* @__PURE__ */ g("div", {
744
755
  className: "space-y-2",
745
- children: [/* @__PURE__ */ g(b, { children: "Assigned To" }), /* @__PURE__ */ g(y, {
746
- value: V.assignedTo,
756
+ children: [/* @__PURE__ */ h(y, { children: "Assigned To" }), /* @__PURE__ */ h(v, {
757
+ value: B.assignedTo,
747
758
  onChange: (e) => $("assignedTo", e.target.value)
748
759
  })]
749
760
  }),
750
- /* @__PURE__ */ _("div", {
761
+ /* @__PURE__ */ g("div", {
751
762
  className: "space-y-2",
752
- children: [/* @__PURE__ */ g(b, { children: "Location" }), /* @__PURE__ */ g(y, {
753
- value: V.locationName,
763
+ children: [/* @__PURE__ */ h(y, { children: "Location" }), /* @__PURE__ */ h(v, {
764
+ value: B.locationName,
754
765
  onChange: (e) => $("locationName", e.target.value)
755
766
  })]
756
767
  }),
757
- /* @__PURE__ */ _("div", {
768
+ /* @__PURE__ */ g("div", {
758
769
  className: "space-y-2",
759
- children: [/* @__PURE__ */ g(b, { children: "Supplier" }), /* @__PURE__ */ g(y, {
760
- value: V.supplier,
770
+ children: [/* @__PURE__ */ h(y, { children: "Supplier" }), /* @__PURE__ */ h(v, {
771
+ value: B.supplier,
761
772
  onChange: (e) => $("supplier", e.target.value)
762
773
  })]
763
774
  })
764
775
  ]
765
776
  }),
766
- /* @__PURE__ */ _("div", {
777
+ /* @__PURE__ */ g("div", {
767
778
  className: "grid gap-4 md:grid-cols-4",
768
779
  children: [
769
- /* @__PURE__ */ _("div", {
780
+ /* @__PURE__ */ g("div", {
770
781
  className: "space-y-2",
771
- children: [/* @__PURE__ */ g(b, { children: "Purchase Value" }), /* @__PURE__ */ g(y, {
782
+ children: [/* @__PURE__ */ h(y, { children: "Purchase Value" }), /* @__PURE__ */ h(v, {
772
783
  type: "number",
773
784
  min: "0",
774
785
  step: "0.01",
775
- value: V.purchaseValue,
786
+ value: B.purchaseValue,
776
787
  onChange: (e) => $("purchaseValue", e.target.value)
777
788
  })]
778
789
  }),
779
- /* @__PURE__ */ _("div", {
790
+ /* @__PURE__ */ g("div", {
780
791
  className: "space-y-2",
781
- children: [/* @__PURE__ */ g(b, { children: "Salvage Value" }), /* @__PURE__ */ g(y, {
792
+ children: [/* @__PURE__ */ h(y, { children: "Salvage Value" }), /* @__PURE__ */ h(v, {
782
793
  type: "number",
783
794
  min: "0",
784
795
  step: "0.01",
785
- value: V.salvageValue,
796
+ value: B.salvageValue,
786
797
  onChange: (e) => $("salvageValue", e.target.value)
787
798
  })]
788
799
  }),
789
- /* @__PURE__ */ _("div", {
800
+ /* @__PURE__ */ g("div", {
790
801
  className: "space-y-2",
791
- children: [/* @__PURE__ */ g(b, { children: "Useful Life (mo)" }), /* @__PURE__ */ g(y, {
802
+ children: [/* @__PURE__ */ h(y, { children: "Useful Life (mo)" }), /* @__PURE__ */ h(v, {
792
803
  type: "number",
793
804
  min: "0",
794
805
  step: "1",
795
- value: V.usefulLifeMonths,
806
+ value: B.usefulLifeMonths,
796
807
  onChange: (e) => $("usefulLifeMonths", e.target.value)
797
808
  })]
798
809
  }),
799
- /* @__PURE__ */ _("div", {
810
+ /* @__PURE__ */ g("div", {
800
811
  className: "space-y-2",
801
- children: [/* @__PURE__ */ g(b, { children: "Depreciation" }), /* @__PURE__ */ _(D, {
802
- value: V.depreciationMethod,
812
+ children: [/* @__PURE__ */ h(y, { children: "Depreciation" }), /* @__PURE__ */ g(E, {
813
+ value: B.depreciationMethod,
803
814
  onValueChange: (e) => $("depreciationMethod", e),
804
- children: [/* @__PURE__ */ g(A, { children: /* @__PURE__ */ g(j, {}) }), /* @__PURE__ */ _(O, { children: [
805
- /* @__PURE__ */ g(k, {
815
+ children: [/* @__PURE__ */ h(k, { children: /* @__PURE__ */ h(A, {}) }), /* @__PURE__ */ g(D, { children: [
816
+ /* @__PURE__ */ h(O, {
806
817
  value: "STRAIGHT_LINE",
807
818
  children: "Straight line"
808
819
  }),
809
- /* @__PURE__ */ g(k, {
820
+ /* @__PURE__ */ h(O, {
810
821
  value: "REDUCING_BALANCE",
811
822
  children: "Reducing balance"
812
823
  }),
813
- /* @__PURE__ */ g(k, {
824
+ /* @__PURE__ */ h(O, {
814
825
  value: "NONE",
815
826
  children: "None"
816
827
  })
@@ -819,129 +830,129 @@ function F() {
819
830
  })
820
831
  ]
821
832
  }),
822
- /* @__PURE__ */ _(w, { children: [/* @__PURE__ */ g(v, {
833
+ /* @__PURE__ */ g(C, { children: [/* @__PURE__ */ h(_, {
823
834
  type: "button",
824
835
  variant: "outline",
825
- onClick: () => R(!1),
826
- disabled: G,
836
+ onClick: () => L(!1),
837
+ disabled: U,
827
838
  children: "Cancel"
828
- }), /* @__PURE__ */ g(v, {
839
+ }), /* @__PURE__ */ h(_, {
829
840
  type: "submit",
830
- disabled: G,
831
- children: G ? "Saving…" : "Save changes"
841
+ disabled: U,
842
+ children: U ? "Saving…" : "Save changes"
832
843
  })] })
833
844
  ]
834
845
  }) : null]
835
846
  })
836
847
  }),
837
- /* @__PURE__ */ g(x, {
838
- open: Ke,
839
- onOpenChange: z,
840
- children: /* @__PURE__ */ _(S, { children: [/* @__PURE__ */ _(T, { children: [/* @__PURE__ */ g(E, { children: "Dispose asset" }), /* @__PURE__ */ g(C, { children: "Record the disposal of this asset. It will be marked as disposed and removed from active inventory." })] }), /* @__PURE__ */ _("form", {
848
+ /* @__PURE__ */ h(b, {
849
+ open: Xe,
850
+ onOpenChange: R,
851
+ children: /* @__PURE__ */ g(x, { children: [/* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, { children: "Dispose asset" }), /* @__PURE__ */ h(S, { children: "Record the disposal of this asset. It will be marked as disposed and removed from active inventory." })] }), /* @__PURE__ */ g("form", {
841
852
  className: "space-y-4",
842
- onSubmit: it,
853
+ onSubmit: ct,
843
854
  children: [
844
- /* @__PURE__ */ _("div", {
855
+ /* @__PURE__ */ g("div", {
845
856
  className: "space-y-2",
846
- children: [/* @__PURE__ */ g(b, { children: "Disposal Date" }), /* @__PURE__ */ g(y, {
857
+ children: [/* @__PURE__ */ h(y, { children: "Disposal Date" }), /* @__PURE__ */ h(v, {
847
858
  type: "date",
848
- value: U.disposalDate,
849
- onChange: (e) => W((t) => ({
859
+ value: V.disposalDate,
860
+ onChange: (e) => H((t) => ({
850
861
  ...t,
851
862
  disposalDate: e.target.value
852
863
  }))
853
864
  })]
854
865
  }),
855
- /* @__PURE__ */ _("div", {
866
+ /* @__PURE__ */ g("div", {
856
867
  className: "space-y-2",
857
- children: [/* @__PURE__ */ g(b, { children: "Method" }), /* @__PURE__ */ g(y, {
868
+ children: [/* @__PURE__ */ h(y, { children: "Method" }), /* @__PURE__ */ h(v, {
858
869
  placeholder: "e.g., Sold, Recycled, Scrapped",
859
- value: U.method,
860
- onChange: (e) => W((t) => ({
870
+ value: V.method,
871
+ onChange: (e) => H((t) => ({
861
872
  ...t,
862
873
  method: e.target.value
863
874
  }))
864
875
  })]
865
876
  }),
866
- /* @__PURE__ */ _("div", {
877
+ /* @__PURE__ */ g("div", {
867
878
  className: "space-y-2",
868
- children: [/* @__PURE__ */ g(b, { children: "Notes" }), /* @__PURE__ */ g(je, {
879
+ children: [/* @__PURE__ */ h(y, { children: "Notes" }), /* @__PURE__ */ h(Ne, {
869
880
  placeholder: "Optional details about the disposal",
870
- value: U.notes,
871
- onChange: (e) => W((t) => ({
881
+ value: V.notes,
882
+ onChange: (e) => H((t) => ({
872
883
  ...t,
873
884
  notes: e.target.value
874
885
  })),
875
886
  rows: 2
876
887
  })]
877
888
  }),
878
- /* @__PURE__ */ _(w, { children: [/* @__PURE__ */ g(v, {
889
+ /* @__PURE__ */ g(C, { children: [/* @__PURE__ */ h(_, {
879
890
  type: "button",
880
891
  variant: "outline",
881
- onClick: () => z(!1),
882
- disabled: K,
892
+ onClick: () => R(!1),
893
+ disabled: W,
883
894
  children: "Cancel"
884
- }), /* @__PURE__ */ g(v, {
895
+ }), /* @__PURE__ */ h(_, {
885
896
  type: "submit",
886
- disabled: K,
887
- children: K ? "Disposing…" : "Confirm disposal"
897
+ disabled: W,
898
+ children: W ? "Disposing…" : "Confirm disposal"
888
899
  })] })
889
900
  ]
890
901
  })] })
891
902
  }),
892
- /* @__PURE__ */ g(x, {
893
- open: qe,
894
- onOpenChange: B,
895
- children: /* @__PURE__ */ _(S, { children: [/* @__PURE__ */ _(T, { children: [/* @__PURE__ */ g(E, { children: "Delete asset" }), /* @__PURE__ */ _(C, { children: [
903
+ /* @__PURE__ */ h(b, {
904
+ open: Ze,
905
+ onOpenChange: z,
906
+ children: /* @__PURE__ */ g(x, { children: [/* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, { children: "Delete asset" }), /* @__PURE__ */ g(S, { children: [
896
907
  "This removes ",
897
- /* @__PURE__ */ g("span", {
908
+ /* @__PURE__ */ h("span", {
898
909
  className: "font-medium",
899
- children: Y.name
910
+ children: q.name
900
911
  }),
901
912
  " from the inventory. This action cannot be undone."
902
- ] })] }), /* @__PURE__ */ _(w, { children: [/* @__PURE__ */ g(v, {
913
+ ] })] }), /* @__PURE__ */ g(C, { children: [/* @__PURE__ */ h(_, {
903
914
  variant: "outline",
904
- onClick: () => B(!1),
905
- disabled: q,
915
+ onClick: () => z(!1),
916
+ disabled: G,
906
917
  children: "Cancel"
907
- }), /* @__PURE__ */ g(v, {
918
+ }), /* @__PURE__ */ h(_, {
908
919
  variant: "destructive",
909
- onClick: () => void Xe({ variables: { id: Y.id } }),
910
- disabled: q,
911
- children: q ? "Deleting…" : "Delete asset"
920
+ onClick: () => void tt({ variables: { id: q.id } }),
921
+ disabled: G,
922
+ children: G ? "Deleting…" : "Delete asset"
912
923
  })] })] })
913
924
  })
914
925
  ]
915
926
  });
916
927
  }
917
- function I({ label: e, value: t, icon: n, mono: r, capitalize: i, full: a, children: o }) {
918
- return /* @__PURE__ */ _("div", {
928
+ function F({ label: e, value: t, icon: n, mono: r, capitalize: i, full: a, children: o }) {
929
+ return /* @__PURE__ */ g("div", {
919
930
  className: `rounded-lg border border-border-seam bg-bg-surface p-3.5 ${a ? "sm:col-span-2 xl:col-span-3" : ""}`,
920
- children: [/* @__PURE__ */ _("p", {
931
+ children: [/* @__PURE__ */ g("p", {
921
932
  className: "flex items-center gap-1.5 text-xs text-text-secondary",
922
- children: [n ? /* @__PURE__ */ g(n, { className: "h-3.5 w-3.5" }) : null, e]
923
- }), o ? /* @__PURE__ */ g("div", {
933
+ children: [n ? /* @__PURE__ */ h(n, { className: "h-3.5 w-3.5" }) : null, e]
934
+ }), o ? /* @__PURE__ */ h("div", {
924
935
  className: "mt-1.5",
925
936
  children: o
926
- }) : /* @__PURE__ */ g("p", {
937
+ }) : /* @__PURE__ */ h("p", {
927
938
  className: `mt-1 break-words font-medium ${r ? "font-mono text-sm" : ""} ${i ? "capitalize" : ""}`,
928
939
  children: t
929
940
  })]
930
941
  });
931
942
  }
932
- function L({ label: e, value: t, striped: n }) {
933
- return /* @__PURE__ */ _("div", {
943
+ function I({ label: e, value: t, striped: n }) {
944
+ return /* @__PURE__ */ g("div", {
934
945
  className: `flex items-center justify-between gap-4 px-3.5 py-2.5 ${n ? "bg-bg-sunken/40" : ""}`,
935
- children: [/* @__PURE__ */ g("dt", {
946
+ children: [/* @__PURE__ */ h("dt", {
936
947
  className: "shrink-0 text-text-secondary",
937
948
  children: e
938
- }), /* @__PURE__ */ g("dd", {
949
+ }), /* @__PURE__ */ h("dd", {
939
950
  className: "truncate text-right font-medium",
940
951
  children: t
941
952
  })]
942
953
  });
943
954
  }
944
955
  //#endregion
945
- export { F as AssetsAssetDetailPage };
956
+ export { P as AssetsAssetDetailPage };
946
957
 
947
958
  //# sourceMappingURL=AssetsAssetDetailPage.js.map