oceanhelm 0.0.8 → 0.0.10

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,10 +1,10 @@
1
- import { openBlock as o, createElementBlock as l, normalizeClass as g, createElementVNode as e, toDisplayString as r, createCommentVNode as m, Fragment as p, renderList as h, withModifiers as D, createTextVNode as _, renderSlot as O, withDirectives as v, vShow as P, normalizeStyle as E, createStaticVNode as x, vModelText as k, vModelSelect as C, vModelCheckbox as N } from "vue";
2
- const S = (s, t) => {
3
- const u = s.__vccOpts || s;
4
- for (const [b, n] of t)
5
- u[b] = n;
6
- return u;
7
- }, U = {
1
+ import { openBlock as l, createElementBlock as r, normalizeClass as b, createElementVNode as t, toDisplayString as a, createCommentVNode as c, Fragment as f, renderList as g, withModifiers as D, createTextVNode as w, renderSlot as L, withDirectives as h, vShow as A, normalizeStyle as N, createStaticVNode as x, vModelText as k, vModelSelect as _, vModelCheckbox as E } from "vue";
2
+ const S = (s, e) => {
3
+ const d = s.__vccOpts || s;
4
+ for (const [p, n] of e)
5
+ d[p] = n;
6
+ return d;
7
+ }, O = {
8
8
  name: "ConfigurableSidebar",
9
9
  props: {
10
10
  // Brand configuration
@@ -52,7 +52,7 @@ const S = (s, t) => {
52
52
  return this.customClasses;
53
53
  },
54
54
  filteredMenuItems() {
55
- return this.menuItems.filter((s) => this.hasPermission(s) ? s.type === "dropdown" && s.children ? s.children.some((t) => this.hasPermission(t)) : !0 : !1);
55
+ return this.menuItems.filter((s) => this.hasPermission(s) ? s.type === "dropdown" && s.children ? s.children.some((e) => this.hasPermission(e)) : !0 : !1);
56
56
  }
57
57
  },
58
58
  mounted() {
@@ -61,7 +61,7 @@ const S = (s, t) => {
61
61
  methods: {
62
62
  // Get filtered children for dropdown items
63
63
  getFilteredChildren(s) {
64
- return s.children ? s.children.filter((t) => this.hasPermission(t)) : [];
64
+ return s.children ? s.children.filter((e) => this.hasPermission(e)) : [];
65
65
  },
66
66
  // Permission checking
67
67
  hasPermission(s) {
@@ -69,8 +69,8 @@ const S = (s, t) => {
69
69
  },
70
70
  // Navigation handling
71
71
  handleNavigation(s) {
72
- var t;
73
- this.$emit("navigate", s), s.href && !s.preventDefault && (s.external ? window.open(s.href, "_blank") : (t = this.$router) == null || t.push(s.href));
72
+ var e;
73
+ this.$emit("navigate", s), s.href && !s.preventDefault && (s.external ? window.open(s.href, "_blank") : (e = this.$router) == null || e.push(s.href));
74
74
  },
75
75
  // Action handling
76
76
  handleAction(s) {
@@ -82,92 +82,89 @@ const S = (s, t) => {
82
82
  },
83
83
  // Responsive behavior
84
84
  initializeResponsiveBehavior() {
85
- const s = document.getElementById("sidebarToggle"), t = document.getElementById("sidebar"), u = document.getElementById("content");
86
- !s || !t || !u || (window.innerWidth >= 768 && (t.classList.toggle("active"), u.classList.toggle("active")), s.addEventListener("click", () => {
87
- t.classList.toggle("active"), u.classList.toggle("active");
88
- }), document.addEventListener("click", (b) => {
89
- const n = t.contains(b.target), a = s.contains(b.target);
90
- !n && !a && window.innerWidth < 768 && t.classList.contains("active") && (t.classList.remove("active"), u.classList.remove("active"));
85
+ const s = document.getElementById("sidebarToggle"), e = document.getElementById("sidebar"), d = document.getElementById("content");
86
+ !s || !e || !d || (window.innerWidth >= 768 && (e.classList.toggle("active"), d.classList.toggle("active")), s.addEventListener("click", () => {
87
+ e.classList.toggle("active"), d.classList.toggle("active");
88
+ }), document.addEventListener("click", (p) => {
89
+ const n = e.contains(p.target), o = s.contains(p.target);
90
+ !n && !o && window.innerWidth < 768 && e.classList.contains("active") && (e.classList.remove("active"), d.classList.remove("active"));
91
91
  }));
92
92
  }
93
93
  },
94
94
  emits: ["navigate", "action", "item-click"]
95
- }, L = {
95
+ }, U = {
96
96
  key: 0,
97
97
  class: "logo d-flex align-items-center left"
98
- }, $ = { class: "list-unstyled components mt-4" }, j = ["onClick"], B = ["href", "onClick"], H = ["onClick"], Q = {
98
+ }, $ = { style: { "margin-left": "45px" } }, j = { class: "list-unstyled components mt-4" }, B = ["onClick"], H = ["href", "onClick"], Q = ["onClick"], J = {
99
99
  class: "dropdown-toggle",
100
100
  type: "button",
101
101
  "data-bs-toggle": "dropdown",
102
102
  "aria-expanded": "false"
103
- }, J = {
103
+ }, W = {
104
104
  class: "dropdown-menu",
105
105
  "aria-labelledby": "dropdownMenuLink"
106
- }, W = ["onClick"], G = {
106
+ }, K = ["onClick"], z = {
107
107
  key: 3,
108
108
  class: "dropdown-divider"
109
- }, z = { key: 4 };
110
- function Y(s, t, u, b, n, a) {
111
- return o(), l("nav", {
109
+ }, G = { key: 4 };
110
+ function Y(s, e, d, p, n, o) {
111
+ return l(), r("nav", {
112
112
  id: "sidebar",
113
- class: g(a.sidebarClasses)
113
+ class: b(o.sidebarClasses)
114
114
  }, [
115
- u.showLogo ? (o(), l("div", L, [
116
- e("i", {
117
- class: g([u.logoIcon, "me-2"])
118
- }, null, 2),
119
- e("span", null, r(u.brandName), 1)
120
- ])) : m("", !0),
121
- e("ul", $, [
122
- (o(!0), l(p, null, h(a.filteredMenuItems, (i, f) => (o(), l("li", {
123
- key: f,
124
- class: g({ active: i.active, dropdown: i.type === "dropdown" }),
125
- onClick: (y) => a.handleItemClick(i)
115
+ d.showLogo ? (l(), r("div", U, [
116
+ t("span", $, a(d.brandName), 1)
117
+ ])) : c("", !0),
118
+ t("ul", j, [
119
+ (l(!0), r(f, null, g(o.filteredMenuItems, (i, m) => (l(), r("li", {
120
+ key: m,
121
+ class: b({ active: i.active, dropdown: i.type === "dropdown" }),
122
+ onClick: (y) => o.handleItemClick(i)
126
123
  }, [
127
- i.type === "link" ? (o(), l("a", {
124
+ i.type === "link" ? (l(), r("a", {
128
125
  key: 0,
129
126
  href: i.href || "#",
130
- onClick: D((y) => a.handleNavigation(i), ["prevent"])
127
+ onClick: D((y) => o.handleNavigation(i), ["prevent"])
131
128
  }, [
132
- i.icon ? (o(), l("i", {
129
+ i.icon ? (l(), r("i", {
133
130
  key: 0,
134
- class: g(i.icon)
135
- }, null, 2)) : m("", !0),
136
- _(" " + r(i.label), 1)
137
- ], 8, B)) : i.type === "button" ? (o(), l("a", {
131
+ class: b(i.icon)
132
+ }, null, 2)) : c("", !0),
133
+ w(" " + a(i.label), 1)
134
+ ], 8, H)) : i.type === "button" ? (l(), r("a", {
138
135
  key: 1,
139
- onClick: D((y) => a.handleAction(i), ["prevent"]),
136
+ onClick: D((y) => o.handleAction(i), ["prevent"]),
140
137
  style: { cursor: "pointer" }
141
138
  }, [
142
- i.icon ? (o(), l("i", {
139
+ i.icon ? (l(), r("i", {
143
140
  key: 0,
144
- class: g(i.icon)
145
- }, null, 2)) : m("", !0),
146
- _(" " + r(i.label), 1)
147
- ], 8, H)) : i.type === "dropdown" ? (o(), l(p, { key: 2 }, [
148
- e("a", Q, [
149
- i.icon ? (o(), l("i", {
141
+ class: b(i.icon)
142
+ }, null, 2)) : c("", !0),
143
+ w(" " + a(i.label), 1)
144
+ ], 8, Q)) : i.type === "dropdown" ? (l(), r(f, { key: 2 }, [
145
+ t("a", J, [
146
+ i.icon ? (l(), r("i", {
150
147
  key: 0,
151
- class: g(i.icon)
152
- }, null, 2)) : m("", !0),
153
- _(" " + r(i.label), 1)
148
+ class: b(i.icon)
149
+ }, null, 2)) : c("", !0),
150
+ w(" " + a(i.label), 1)
154
151
  ]),
155
- e("div", J, [
156
- (o(!0), l(p, null, h(a.getFilteredChildren(i), (y, A) => (o(), l("a", {
157
- key: A,
152
+ t("div", W, [
153
+ (l(!0), r(f, null, g(o.getFilteredChildren(i), (y, P) => (l(), r("a", {
154
+ key: P,
158
155
  class: "dropdown-item black",
159
- onClick: D((q) => a.handleAction(y), ["prevent"]),
156
+ onClick: D((T) => o.handleAction(y), ["prevent"]),
160
157
  style: { cursor: "pointer" }
161
- }, r(y.label), 9, W))), 128))
158
+ }, a(y.label), 9, K))), 128))
162
159
  ])
163
- ], 64)) : i.type === "separator" ? (o(), l("div", G)) : i.type === "text" ? (o(), l("a", z, r(i.label), 1)) : m("", !0)
164
- ], 10, j))), 128))
160
+ ], 64)) : i.type === "separator" ? (l(), r("div", z)) : i.type === "text" ? (l(), r("a", G, a(i.label), 1)) : c("", !0)
161
+ ], 10, B))), 128))
165
162
  ]),
166
- O(s.$slots, "footer")
163
+ L(s.$slots, "footer")
167
164
  ], 2);
168
165
  }
169
- const K = /* @__PURE__ */ S(U, [["render", Y]]);
170
- const X = {
166
+ const X = /* @__PURE__ */ S(O, [["render", Y]]);
167
+ const Z = {
171
168
  name: "VesselList",
172
169
  props: {
173
170
  // Required props
@@ -203,6 +200,12 @@ const X = {
203
200
  })
204
201
  }
205
202
  },
203
+ data() {
204
+ return {
205
+ activeFilter: "All"
206
+ // 'All', 'Active', or 'Inactive'
207
+ };
208
+ },
206
209
  emits: [
207
210
  "vessel-add",
208
211
  "vessel-click",
@@ -220,11 +223,21 @@ const X = {
220
223
  inactiveVesselsCount() {
221
224
  return this.vessels.filter((s) => s.status === "Inactive").length;
222
225
  },
226
+ filteredVessels() {
227
+ return this.activeFilter === "All" ? this.vessels : this.vessels.filter((s) => s.status === this.activeFilter);
228
+ },
223
229
  canAddVessel() {
224
230
  return this.config.enableAdd && (this.userProfile.role === "owner" || this.userProfile.role === "staff");
225
231
  }
226
232
  },
227
233
  methods: {
234
+ // Filter methods
235
+ filterVessels(s) {
236
+ this.activeFilter = s;
237
+ },
238
+ clearFilter() {
239
+ this.activeFilter = "All";
240
+ },
228
241
  // Event handlers that emit to parent
229
242
  handleAddVessel() {
230
243
  if (!this.canAddVessel) {
@@ -234,13 +247,13 @@ const X = {
234
247
  this.$emit("vessel-add");
235
248
  },
236
249
  handleVesselClick(s) {
237
- const t = {
250
+ const e = {
238
251
  vessel: s,
239
252
  route: this.currentRoute,
240
253
  id: s.registrationNumber,
241
254
  name: s.name
242
255
  };
243
- this.grantAccess(s) ? this.currentRoute === "dashboard" ? this.$emit("vessel-click", s) : this.$emit("vessel-navigate", t) : this.handleAccessDenied("this protected route");
256
+ this.grantAccess(s) ? this.currentRoute === "dashboard" ? this.$emit("vessel-click", s) : this.$emit("vessel-navigate", e) : this.handleAccessDenied("this protected route");
244
257
  },
245
258
  handleDeleteVessel(s) {
246
259
  if (!this.grantAccess(s)) {
@@ -270,175 +283,210 @@ const X = {
270
283
  statusClass(s) {
271
284
  return `status-${(s == null ? void 0 : s.toLowerCase()) || ""}`;
272
285
  },
273
- getDuration(s, t) {
274
- const u = /* @__PURE__ */ new Date(), b = new Date(s), n = u - b;
286
+ getDuration(s, e) {
287
+ const d = /* @__PURE__ */ new Date(), p = new Date(s), n = d - p;
275
288
  if (n < 0)
276
289
  return "Invalid (future date)";
277
- const a = Math.floor(n / (1e3 * 60 * 60)), i = Math.floor(a / 24), f = a % 24;
290
+ const o = Math.floor(n / (1e3 * 60 * 60)), i = Math.floor(o / 24), m = o % 24;
278
291
  let y = "";
279
- return i > 0 && (y += `${i} day${i > 1 ? "s" : ""}`), f > 0 && (y += (y ? " " : "") + `${f} hr${f > 1 ? "s" : ""}`), y || "0 hr";
292
+ return i > 0 && (y += `${i} day${i > 1 ? "s" : ""}`), m > 0 && (y += (y ? " " : "") + `${m} hr${m > 1 ? "s" : ""}`), y || "0 hr";
280
293
  },
281
294
  setVesselDate(s) {
282
295
  this.$emit("date-change", s);
283
296
  },
284
297
  grantAccess(s) {
285
- const { role: t, vessel: u } = this.userProfile;
286
- return t === "owner" || t === "staff" || t === "captain" && u === s.name;
298
+ const { role: e, vessel: d } = this.userProfile;
299
+ return e === "owner" || e === "staff" || e === "captain" && d === s.name;
287
300
  },
288
301
  getDaysToExpiry(s) {
289
302
  if (!s)
290
303
  return null;
291
- const t = /* @__PURE__ */ new Date(), b = new Date(s) - t;
292
- return Math.ceil(b / (1e3 * 60 * 60 * 24));
304
+ const e = /* @__PURE__ */ new Date(), p = new Date(s) - e;
305
+ return Math.ceil(p / (1e3 * 60 * 60 * 24));
293
306
  },
294
307
  getExpiryClass(s) {
295
- const t = this.getDaysToExpiry(s);
296
- return t === null ? "" : t < 30 ? "cert-critical" : t < 90 ? "cert-warning" : "";
308
+ const e = this.getDaysToExpiry(s);
309
+ return e === null ? "" : e < 30 ? "cert-critical" : e < 90 ? "cert-warning" : "";
297
310
  }
298
311
  }
299
- }, Z = { class: "row mb-3" }, ee = { class: "col-md-4" }, te = { class: "card border-0 shadow-sm" }, se = { class: "card-body d-flex align-items-center" }, ie = { class: "mt-2 mb-0" }, ne = { class: "col-md-4" }, oe = { class: "card border-0 shadow-sm" }, le = { class: "card-body d-flex align-items-center" }, re = { class: "mt-2 mb-0" }, ae = {
312
+ }, ee = { class: "row mb-3" }, te = { class: "col-md-4" }, se = { class: "card-body d-flex align-items-center" }, ie = { class: "mt-2 mb-0" }, ne = { class: "col-md-4" }, oe = { class: "card-body d-flex align-items-center" }, le = { class: "mt-2 mb-0" }, re = {
300
313
  key: 0,
301
314
  class: "col-md-4"
302
- }, de = {
315
+ }, ae = { class: "d-flex justify-content-between align-items-center mb-4" }, de = {
303
316
  key: 0,
304
- class: "text-center py-4"
317
+ class: "alert alert-info mb-3",
318
+ role: "alert"
305
319
  }, ue = {
306
320
  key: 1,
307
- class: "alert alert-primary",
308
- role: "alert"
321
+ class: "text-center py-4"
309
322
  }, ce = {
310
323
  key: 2,
324
+ class: "alert alert-primary",
325
+ role: "alert"
326
+ }, me = {
327
+ key: 3,
328
+ class: "alert alert-warning",
329
+ role: "alert"
330
+ }, ve = { class: "alert-heading" }, pe = { class: "mb-0" }, he = {
331
+ key: 4,
311
332
  class: "row"
312
- }, me = ["onClick"], ve = { class: "card-body d-flex align-items-center" }, pe = { class: "flex-grow-1" }, fe = { class: "d-flex justify-content-between align-items-center mb-2" }, he = { class: "card-title mb-0" }, ge = { class: "row" }, be = { class: "col-6" }, ye = { class: "mb-0" }, we = {
333
+ }, fe = ["onClick"], ge = { class: "card-body d-flex align-items-center" }, be = { class: "flex-grow-1" }, ye = { class: "d-flex justify-content-between align-items-center mb-2" }, we = { class: "card-title mb-0" }, ke = { class: "row" }, Ce = { class: "col-6" }, _e = { class: "mb-0" }, De = {
313
334
  key: 0,
314
335
  class: "col-6"
315
- }, ke = { class: "mb-0" }, _e = { class: "mb-0" }, Ce = {
336
+ }, xe = { class: "mb-0" }, Se = { class: "mb-0" }, Ae = {
316
337
  key: 1,
317
338
  class: "col-6"
318
- }, De = { class: "text-muted" }, xe = ["onClick"], Se = { class: "action-icon v-left delete" }, Pe = ["onClick"], Ae = ["onClick"];
319
- function qe(s, t, u, b, n, a) {
320
- return o(), l(p, null, [
321
- e("div", Z, [
322
- e("div", ee, [
323
- e("div", te, [
324
- e("div", se, [
325
- t[2] || (t[2] = e("div", { class: "rounded-circle bg-primary bg-opacity-10 p-3 me-3" }, [
326
- e("i", { class: "bi bi-check-circle-fill text-primary fs-4" })
339
+ }, Pe = { class: "text-muted" }, Te = ["onClick"], qe = { class: "action-icon v-left delete" }, Ie = ["onClick"], Fe = ["onClick"];
340
+ function Re(s, e, d, p, n, o) {
341
+ return l(), r(f, null, [
342
+ t("div", ee, [
343
+ t("div", te, [
344
+ t("div", {
345
+ class: b(["card border-0 shadow-sm", { "border-primary border-2": n.activeFilter === "Active" }]),
346
+ onClick: e[0] || (e[0] = (i) => o.filterVessels("Active")),
347
+ style: { cursor: "pointer" }
348
+ }, [
349
+ t("div", se, [
350
+ e[5] || (e[5] = t("div", { class: "rounded-circle bg-primary bg-opacity-10 p-3 me-3" }, [
351
+ t("i", { class: "bi bi-check-circle-fill text-primary fs-4" })
327
352
  ], -1)),
328
- e("div", null, [
329
- t[1] || (t[1] = e("h6", { class: "mb-0" }, "Active Vessels", -1)),
330
- e("h3", ie, r(a.activeVesselsCount), 1)
353
+ t("div", null, [
354
+ e[4] || (e[4] = t("h6", { class: "mb-0" }, "Active Vessels", -1)),
355
+ t("h3", ie, a(o.activeVesselsCount), 1)
331
356
  ])
332
357
  ])
333
- ])
358
+ ], 2)
334
359
  ]),
335
- e("div", ne, [
336
- e("div", oe, [
337
- e("div", le, [
338
- t[4] || (t[4] = e("div", { class: "rounded-circle bg-secondary bg-opacity-10 p-3 me-3" }, [
339
- e("i", { class: "bi bi-pause-circle-fill text-secondary fs-4" })
360
+ t("div", ne, [
361
+ t("div", {
362
+ class: b(["card border-0 shadow-sm", { "border-secondary border-2": n.activeFilter === "Inactive" }]),
363
+ onClick: e[1] || (e[1] = (i) => o.filterVessels("Inactive")),
364
+ style: { cursor: "pointer" }
365
+ }, [
366
+ t("div", oe, [
367
+ e[7] || (e[7] = t("div", { class: "rounded-circle bg-secondary bg-opacity-10 p-3 me-3" }, [
368
+ t("i", { class: "bi bi-pause-circle-fill text-secondary fs-4" })
340
369
  ], -1)),
341
- e("div", null, [
342
- t[3] || (t[3] = e("h6", { class: "mb-0" }, "Inactive", -1)),
343
- e("h3", re, r(a.inactiveVesselsCount), 1)
370
+ t("div", null, [
371
+ e[6] || (e[6] = t("h6", { class: "mb-0" }, "Inactive", -1)),
372
+ t("h3", le, a(o.inactiveVesselsCount), 1)
344
373
  ])
345
374
  ])
346
- ])
375
+ ], 2)
347
376
  ]),
348
- a.canAddVessel ? (o(), l("div", ae, [
349
- e("div", {
377
+ o.canAddVessel ? (l(), r("div", re, [
378
+ t("div", {
350
379
  class: "card border-0 shadow-sm",
351
- onClick: t[0] || (t[0] = (...i) => a.handleAddVessel && a.handleAddVessel(...i))
352
- }, t[5] || (t[5] = [
353
- e("div", { class: "card-body d-flex align-items-center" }, [
354
- e("div", { class: "rounded-circle bg-success bg-opacity-10 p-3 me-3" }, [
355
- e("i", { class: "bi bi-patch-plus-fill text-success fs-4" })
380
+ onClick: e[2] || (e[2] = (...i) => o.handleAddVessel && o.handleAddVessel(...i)),
381
+ style: { cursor: "pointer" }
382
+ }, e[8] || (e[8] = [
383
+ t("div", { class: "card-body d-flex align-items-center" }, [
384
+ t("div", { class: "rounded-circle bg-success bg-opacity-10 p-3 me-3" }, [
385
+ t("i", { class: "bi bi-patch-plus-fill text-success fs-4" })
356
386
  ]),
357
- e("div", null, [
358
- e("h6", { class: "mb-0" }, "Add New Vessel")
387
+ t("div", null, [
388
+ t("h6", { class: "mb-0" }, "Add New Vessel")
359
389
  ])
360
390
  ], -1)
361
391
  ]))
362
- ])) : m("", !0)
392
+ ])) : c("", !0)
363
393
  ]),
364
- t[12] || (t[12] = e("h4", { class: "mb-4" }, [
365
- e("i", { class: "bi bi-ship me-2" }),
366
- _("Registered Vessels")
367
- ], -1)),
368
- u.loading ? (o(), l("div", de, t[6] || (t[6] = [
369
- e("div", {
394
+ t("div", ae, [
395
+ e[10] || (e[10] = t("h4", { class: "mb-0" }, [
396
+ t("i", { class: "bi bi-ship me-2" }),
397
+ w("Registered Vessels")
398
+ ], -1)),
399
+ n.activeFilter !== "All" ? (l(), r("button", {
400
+ key: 0,
401
+ class: "btn btn-sm btn-outline-secondary",
402
+ onClick: e[3] || (e[3] = (...i) => o.clearFilter && o.clearFilter(...i))
403
+ }, e[9] || (e[9] = [
404
+ t("i", { class: "bi bi-x-circle me-1" }, null, -1),
405
+ w("Clear Filter ", -1)
406
+ ]))) : c("", !0)
407
+ ]),
408
+ n.activeFilter !== "All" ? (l(), r("div", de, [
409
+ e[11] || (e[11] = w(" Showing ", -1)),
410
+ t("strong", null, a(n.activeFilter), 1),
411
+ w(" vessels (" + a(o.filteredVessels.length) + ") ", 1)
412
+ ])) : c("", !0),
413
+ d.loading ? (l(), r("div", ue, e[12] || (e[12] = [
414
+ t("div", {
370
415
  class: "spinner-border text-primary",
371
416
  role: "status"
372
417
  }, [
373
- e("span", { class: "visually-hidden" }, "Loading...")
418
+ t("span", { class: "visually-hidden" }, "Loading...")
374
419
  ], -1),
375
- e("p", { class: "mt-2" }, "Loading vessels...", -1)
376
- ]))) : u.vessels.length ? (o(), l("div", ce, [
377
- (o(!0), l(p, null, h(u.vessels, (i) => (o(), l("div", {
420
+ t("p", { class: "mt-2" }, "Loading vessels...", -1)
421
+ ]))) : !o.filteredVessels.length && n.activeFilter === "All" ? (l(), r("div", ce, e[13] || (e[13] = [
422
+ t("h4", { class: "alert-heading" }, "Empty Fleet!", -1),
423
+ t("p", null, "You have an empty fleet, you have not added any vessel yet.", -1),
424
+ t("hr", null, null, -1),
425
+ t("p", { class: "mb-0" }, "Click on the add vessel button above, to start adding vessels to your fleet", -1)
426
+ ]))) : !o.filteredVessels.length && n.activeFilter !== "All" ? (l(), r("div", me, [
427
+ t("h4", ve, "No " + a(n.activeFilter) + " Vessels", 1),
428
+ t("p", pe, "There are no " + a(n.activeFilter.toLowerCase()) + " vessels in your fleet.", 1)
429
+ ])) : (l(), r("div", he, [
430
+ (l(!0), r(f, null, g(o.filteredVessels, (i) => (l(), r("div", {
378
431
  class: "col-lg-6",
379
432
  key: i.registrationNumber || i.id
380
433
  }, [
381
- e("div", {
434
+ t("div", {
382
435
  class: "vessel-card",
383
- onClick: (f) => a.handleVesselClick(i)
436
+ onClick: (m) => o.handleVesselClick(i)
384
437
  }, [
385
- e("div", ve, [
386
- t[11] || (t[11] = e("div", { class: "vessel-icon v-left" }, [
387
- e("i", { class: "fas fa-ship" })
438
+ t("div", ge, [
439
+ e[17] || (e[17] = t("div", { class: "vessel-icon v-left" }, [
440
+ t("i", { class: "fas fa-ship" })
388
441
  ], -1)),
389
- e("div", pe, [
390
- e("div", fe, [
391
- e("h5", he, r(i.name), 1),
392
- e("span", {
393
- class: g(["vessel-status", a.statusClass(i.status)])
394
- }, r(i.status), 3)
442
+ t("div", be, [
443
+ t("div", ye, [
444
+ t("h5", we, a(i.name), 1),
445
+ t("span", {
446
+ class: b(["vessel-status", o.statusClass(i.status)])
447
+ }, a(i.status), 3)
395
448
  ]),
396
- e("div", ge, [
397
- e("div", be, [
398
- t[8] || (t[8] = e("small", { class: "text-muted" }, "Registration #:", -1)),
399
- e("p", ye, r(i.registrationNumber), 1)
449
+ t("div", ke, [
450
+ t("div", Ce, [
451
+ e[14] || (e[14] = t("small", { class: "text-muted" }, "Registration #:", -1)),
452
+ t("p", _e, a(i.registrationNumber), 1)
400
453
  ]),
401
- i.date ? (o(), l("div", we, [
402
- i.status === "Active" ? (o(), l(p, { key: 0 }, [
403
- t[9] || (t[9] = e("small", { class: "text-muted" }, "Active Duration:", -1)),
404
- e("p", ke, r(a.getDuration(i.date, i.registrationNumber)), 1)
405
- ], 64)) : (o(), l(p, { key: 1 }, [
406
- t[10] || (t[10] = e("small", { class: "text-muted" }, "Inactive Duration:", -1)),
407
- e("p", _e, r(a.getDuration(i.date, i.registrationNumber)), 1)
454
+ i.date ? (l(), r("div", De, [
455
+ i.status === "Active" ? (l(), r(f, { key: 0 }, [
456
+ e[15] || (e[15] = t("small", { class: "text-muted" }, "Active Duration:", -1)),
457
+ t("p", xe, a(o.getDuration(i.date, i.registrationNumber)), 1)
458
+ ], 64)) : (l(), r(f, { key: 1 }, [
459
+ e[16] || (e[16] = t("small", { class: "text-muted" }, "Inactive Duration:", -1)),
460
+ t("p", Se, a(o.getDuration(i.date, i.registrationNumber)), 1)
408
461
  ], 64))
409
- ])) : (o(), l("div", Ce, [
410
- e("small", De, r(i.status) + " Duration:", 1),
411
- e("button", {
462
+ ])) : (l(), r("div", Ae, [
463
+ t("small", Pe, a(i.status) + " Duration:", 1),
464
+ t("button", {
412
465
  type: "button",
413
466
  class: "btn btn-outline-primary btn-sm mt-1",
414
- onClick: D((f) => a.setVesselDate(i.registrationNumber), ["stop"])
415
- }, " Set Date ", 8, xe)
467
+ onClick: D((m) => o.setVesselDate(i.registrationNumber), ["stop"])
468
+ }, " Set Date ", 8, Te)
416
469
  ]))
417
470
  ])
418
471
  ])
419
472
  ]),
420
- e("div", Se, [
421
- e("i", {
473
+ t("div", qe, [
474
+ t("i", {
422
475
  class: "bi bi-trash",
423
- onClick: D((f) => a.handleDeleteVessel(i), ["stop"])
424
- }, null, 8, Pe)
476
+ onClick: D((m) => o.handleDeleteVessel(i), ["stop"])
477
+ }, null, 8, Ie)
425
478
  ]),
426
- e("button", {
479
+ t("button", {
427
480
  class: "btn btn-primary",
428
- onClick: D((f) => a.handleToggleStatus(i), ["stop"])
429
- }, r(i.status === "Active" ? "Mark Inactive" : "Mark Active"), 9, Ae)
430
- ], 8, me)
481
+ onClick: D((m) => o.handleToggleStatus(i), ["stop"])
482
+ }, a(i.status === "Active" ? "Mark Inactive" : "Mark Active"), 9, Fe)
483
+ ], 8, fe)
431
484
  ]))), 128))
432
- ])) : (o(), l("div", ue, t[7] || (t[7] = [
433
- e("h4", { class: "alert-heading" }, "Empty Fleet!", -1),
434
- e("p", null, "You have an empty fleet, you have not added any vessel yet.", -1),
435
- e("hr", null, null, -1),
436
- e("p", { class: "mb-0" }, "Click on the add vessel button above, to start adding vessels to your fleet", -1)
437
- ])))
485
+ ]))
438
486
  ], 64);
439
487
  }
440
- const Te = /* @__PURE__ */ S(X, [["render", qe]]);
441
- const Ie = {
488
+ const Ve = /* @__PURE__ */ S(Z, [["render", Re]]);
489
+ const Me = {
442
490
  name: "DashHead",
443
491
  props: {
444
492
  name: {
@@ -463,29 +511,29 @@ const Ie = {
463
511
  this.$emit("logged-in");
464
512
  }
465
513
  }
466
- }, Re = { class: "page-header d-flex justify-content-between align-items-center" }, Me = { style: { "margin-left": "20px" } }, Ve = { class: "d-flex" };
467
- function Fe(s, t, u, b, n, a) {
468
- return o(), l("div", Re, [
469
- e("h2", Me, r(u.name), 1),
470
- e("div", Ve, [
471
- this.userProfile.role == "owner" ? (o(), l("button", {
514
+ }, Ne = { class: "page-header d-flex justify-content-between align-items-center" }, Ee = { style: { "margin-left": "20px" } }, Le = { class: "d-flex" };
515
+ function Oe(s, e, d, p, n, o) {
516
+ return l(), r("div", Ne, [
517
+ t("h4", Ee, a(d.name), 1),
518
+ t("div", Le, [
519
+ this.userProfile.role == "owner" ? (l(), r("button", {
472
520
  key: 0,
473
521
  class: "btn btn-outline-primary me-2",
474
- onClick: t[0] || (t[0] = (i) => a.addUser())
475
- }, t[2] || (t[2] = [
476
- e("i", { class: "bi bi-bell" }, null, -1),
477
- e("span", { class: "badge bg-danger" }, "1", -1)
478
- ]))) : m("", !0),
479
- e("button", {
522
+ onClick: e[0] || (e[0] = (i) => o.addUser())
523
+ }, e[2] || (e[2] = [
524
+ t("i", { class: "bi bi-bell" }, null, -1),
525
+ t("span", { class: "badge bg-danger" }, "1", -1)
526
+ ]))) : c("", !0),
527
+ t("button", {
480
528
  class: "btn btn-outline-primary",
481
- onClick: t[1] || (t[1] = (i) => a.loggedIn())
482
- }, t[3] || (t[3] = [
483
- e("i", { class: "bi bi-person-circle" }, null, -1)
529
+ onClick: e[1] || (e[1] = (i) => o.loggedIn())
530
+ }, e[3] || (e[3] = [
531
+ t("i", { class: "bi bi-person-circle" }, null, -1)
484
532
  ]))
485
533
  ])
486
534
  ]);
487
535
  }
488
- const Ee = /* @__PURE__ */ S(Ie, [["render", Fe]]), Ne = {
536
+ const Ue = /* @__PURE__ */ S(Me, [["render", Oe]]), $e = {
489
537
  name: "OceanHelmMaintenance",
490
538
  props: {
491
539
  vesselInfo: {
@@ -588,10 +636,10 @@ const Ee = /* @__PURE__ */ S(Ie, [["render", Fe]]), Ne = {
588
636
  computed: {
589
637
  filteredTasks() {
590
638
  let s = [...this.tasks];
591
- if (this.activeFilter === "all" ? s = s.filter((t) => t.status === "Overdue" || t.status === "Soon" || t.status === "Completed") : this.activeFilter === "due" ? s = s.filter((t) => t.status === "Overdue" || t.status === "Soon") : this.activeFilter === "completed" && (s = s.filter((t) => t.status === "Completed")), this.searchQuery) {
592
- const t = this.searchQuery.toLowerCase();
639
+ if (this.activeFilter === "all" ? s = s.filter((e) => e.status === "Overdue" || e.status === "Soon" || e.status === "Completed") : this.activeFilter === "due" ? s = s.filter((e) => e.status === "Overdue" || e.status === "Soon") : this.activeFilter === "completed" && (s = s.filter((e) => e.status === "Completed")), this.searchQuery) {
640
+ const e = this.searchQuery.toLowerCase();
593
641
  s = s.filter(
594
- (u) => u.component.toLowerCase().includes(t) || u.taskName.toLowerCase().includes(t) || u.assignedTo.toLowerCase().includes(t)
642
+ (d) => d.component.toLowerCase().includes(e) || d.taskName.toLowerCase().includes(e) || d.assignedTo.toLowerCase().includes(e)
595
643
  );
596
644
  }
597
645
  return s;
@@ -609,34 +657,34 @@ const Ee = /* @__PURE__ */ S(Ie, [["render", Fe]]), Ne = {
609
657
  return this.checklistButtonLabel !== "Save Checklist";
610
658
  },
611
659
  totalEstimatedHours() {
612
- return this.maintenanceTasks.reduce((s, t) => s + (t.estimatedHours || 0), 0);
660
+ return this.maintenanceTasks.reduce((s, e) => s + (e.estimatedHours || 0), 0);
613
661
  }
614
662
  },
615
663
  methods: {
616
664
  grantAccess(s) {
617
- const t = this.userProfile;
618
- return t.role === "owner" || t.role === "staff" || t.role === "captain" && t.vessel === s;
665
+ const e = this.userProfile;
666
+ return e.role === "owner" || e.role === "staff" || e.role === "captain" && e.vessel === s;
619
667
  },
620
668
  deepAccess() {
621
669
  const s = this.userProfile;
622
670
  return s.role === "owner" || s.role === "captain" ? !0 : (this.$emit("access-denied", "You do not have access to do this"), !1);
623
671
  },
624
672
  deleteTask(s) {
625
- this.checklists = this.checklists.filter((t) => t.id !== s);
673
+ this.checklists = this.checklists.filter((e) => e.id !== s);
626
674
  },
627
675
  addTask(s) {
628
676
  s && s.preventDefault(), this.$emit("show-message", {
629
677
  type: "prompt",
630
678
  title: "Add New Task",
631
679
  message: "Enter the task details",
632
- callback: (t) => {
633
- if (t) {
634
- const u = {
680
+ callback: (e) => {
681
+ if (e) {
682
+ const d = {
635
683
  id: Date.now(),
636
- text: t,
684
+ text: e,
637
685
  completed: !1
638
686
  };
639
- this.checklists.push(u);
687
+ this.checklists.push(d);
640
688
  }
641
689
  }
642
690
  });
@@ -647,9 +695,9 @@ const Ee = /* @__PURE__ */ S(Ie, [["render", Fe]]), Ne = {
647
695
  loadChecklist(s) {
648
696
  this.isLoading = !0, this.$emit("generate-checklist", {
649
697
  component: s,
650
- callback: (t) => {
651
- this.checklists = t.map((u) => ({
652
- ...u,
698
+ callback: (e) => {
699
+ this.checklists = e.map((d) => ({
700
+ ...d,
653
701
  completed: !1
654
702
  })), this.isLoading = !1;
655
703
  }
@@ -657,13 +705,13 @@ const Ee = /* @__PURE__ */ S(Ie, [["render", Fe]]), Ne = {
657
705
  },
658
706
  showMaintenance(s) {
659
707
  if (this.deepAccess()) {
660
- const t = this.tasks.find((u) => u.component === s);
661
- t && t.checklistProgress ? this.checklists = [...t.checklistProgress] : this.loadChecklist(s), this.after = t == null ? void 0 : t.after, this.currentTask = s, this.lastSection = "inventory", this.activeSection = "maintenance";
708
+ const e = this.tasks.find((d) => d.component === s);
709
+ e && e.checklistProgress ? this.checklists = [...e.checklistProgress] : this.loadChecklist(s), this.after = e == null ? void 0 : e.after, this.currentTask = s, this.lastSection = "inventory", this.activeSection = "maintenance";
662
710
  }
663
711
  },
664
712
  printMaintenance(s) {
665
- const t = this.tasks.find((u) => u.component === s);
666
- this.maintenanceTasks = [t], this.loadMaintenanceData(), this.showReport = !0, this.$nextTick(() => {
713
+ const e = this.tasks.find((d) => d.component === s);
714
+ this.maintenanceTasks = [e], this.loadMaintenanceData(), this.showReport = !0, this.$nextTick(() => {
667
715
  setTimeout(() => {
668
716
  window.print(), this.showReport = !1;
669
717
  }, 100);
@@ -694,12 +742,12 @@ const Ee = /* @__PURE__ */ S(Ie, [["render", Fe]]), Ne = {
694
742
  "lastPerformed",
695
743
  "assignedTo"
696
744
  ];
697
- for (const t of s)
698
- if (!this.form[t])
745
+ for (const e of s)
746
+ if (!this.form[e])
699
747
  return this.$emit("show-message", {
700
748
  type: "error",
701
749
  title: "Missing info",
702
- message: `Please fill in the required field: ${t}`
750
+ message: `Please fill in the required field: ${e}`
703
751
  }), !1;
704
752
  return !0;
705
753
  },
@@ -707,44 +755,44 @@ const Ee = /* @__PURE__ */ S(Ie, [["render", Fe]]), Ne = {
707
755
  this.activeSection = s.id, typeof s.onClick == "function" && s.onClick();
708
756
  },
709
757
  calculateNextDue() {
710
- const s = this.form.lastPerformed ? new Date(this.form.lastPerformed) : null, t = this.form.recurrence;
711
- if (!s || !t)
758
+ const s = this.form.lastPerformed ? new Date(this.form.lastPerformed) : null, e = this.form.recurrence;
759
+ if (!s || !e)
712
760
  return;
713
- let u = new Date(s);
714
- switch (t) {
761
+ let d = new Date(s);
762
+ switch (e) {
715
763
  case "daily":
716
- u.setDate(u.getDate() + 1);
764
+ d.setDate(d.getDate() + 1);
717
765
  break;
718
766
  case "weekly":
719
- u.setDate(u.getDate() + 7);
767
+ d.setDate(d.getDate() + 7);
720
768
  break;
721
769
  case "monthly":
722
- u.setMonth(u.getMonth() + 1);
770
+ d.setMonth(d.getMonth() + 1);
723
771
  break;
724
772
  case "quarterly":
725
- u.setMonth(u.getMonth() + 3);
773
+ d.setMonth(d.getMonth() + 3);
726
774
  break;
727
775
  case "semi-annual":
728
- u.setMonth(u.getMonth() + 6);
776
+ d.setMonth(d.getMonth() + 6);
729
777
  break;
730
778
  case "annual":
731
- u.setFullYear(u.getFullYear() + 1);
779
+ d.setFullYear(d.getFullYear() + 1);
732
780
  break;
733
781
  case "once":
734
782
  case "custom":
735
783
  return;
736
784
  }
737
- this.form.nextDue = u.toISOString().split("T")[0];
785
+ this.form.nextDue = d.toISOString().split("T")[0];
738
786
  },
739
787
  calculateRemainingDays() {
740
788
  if (!this.form.nextDue) {
741
789
  this.form.remainingDays = null;
742
790
  return;
743
791
  }
744
- const s = /* @__PURE__ */ new Date(), t = new Date(this.form.nextDue);
745
- s.setHours(0, 0, 0, 0), t.setHours(0, 0, 0, 0);
746
- const u = t - s, b = Math.ceil(u / (1e3 * 60 * 60 * 24));
747
- this.form.remainingDays = `${b} Days`;
792
+ const s = /* @__PURE__ */ new Date(), e = new Date(this.form.nextDue);
793
+ s.setHours(0, 0, 0, 0), e.setHours(0, 0, 0, 0);
794
+ const d = e - s, p = Math.ceil(d / (1e3 * 60 * 60 * 24));
795
+ this.form.remainingDays = `${p} Days`;
748
796
  },
749
797
  async saveSchedule() {
750
798
  if (this.isSaving = !0, !this.validateForm()) {
@@ -752,7 +800,7 @@ const Ee = /* @__PURE__ */ S(Ie, [["render", Fe]]), Ne = {
752
800
  return;
753
801
  }
754
802
  const s = { ...this.form };
755
- if (this.form.component === "Other" && this.form.customComponent && (s.component = this.form.customComponent), s.email = this.companyInfo.email, this.tasks.some((u) => u.component === s.component)) {
803
+ if (this.form.component === "Other" && this.form.customComponent && (s.component = this.form.customComponent), s.email = this.companyInfo.email, this.tasks.some((d) => d.component === s.component)) {
756
804
  this.$emit("show-message", {
757
805
  type: "error",
758
806
  title: "Duplicate Component",
@@ -763,8 +811,8 @@ const Ee = /* @__PURE__ */ S(Ie, [["render", Fe]]), Ne = {
763
811
  delete s.customComponent, this.$emit("save-schedule", {
764
812
  taskData: s,
765
813
  file: s.attachments.file,
766
- callback: (u) => {
767
- this.isSaving = !1, u && (this.loadChecklist(s.component), this.lastSection = "schedule", this.currentTask = s.component, this.resetForm(), this.activeSection = "maintenance");
814
+ callback: (d) => {
815
+ this.isSaving = !1, d && (this.loadChecklist(s.component), this.lastSection = "schedule", this.currentTask = s.component, this.resetForm(), this.activeSection = "maintenance");
768
816
  }
769
817
  });
770
818
  },
@@ -795,18 +843,18 @@ const Ee = /* @__PURE__ */ S(Ie, [["render", Fe]]), Ne = {
795
843
  s.completed = !s.completed;
796
844
  },
797
845
  async resetTasks() {
798
- const t = this.checklists.every((b) => b.completed) ? "Completed" : "Soon", u = {
846
+ const e = this.checklists.every((p) => p.completed) ? "Completed" : "Soon", d = {
799
847
  checklistProgress: [...this.checklists],
800
- status: t,
848
+ status: e,
801
849
  component: this.currentTask,
802
850
  after: this.after
803
851
  };
804
852
  this.$emit("update-task", {
805
- updateData: u,
853
+ updateData: d,
806
854
  file: this.fileattachments.file,
807
855
  tasks: this.tasks,
808
- callback: (b, n) => {
809
- b && (n && (this.after = n), this.fileattachments = {}, this.fileText = "Drag and drop files here or", this.refreshKey += 1, this.activeSection = "inventory");
856
+ callback: (p, n) => {
857
+ p && (n && (this.after = n), this.fileattachments = {}, this.fileText = "Drag and drop files here or", this.refreshKey += 1, this.activeSection = "inventory");
810
858
  }
811
859
  });
812
860
  },
@@ -830,11 +878,11 @@ const Ee = /* @__PURE__ */ S(Ie, [["render", Fe]]), Ne = {
830
878
  getChecklistProgress(s) {
831
879
  if (!s.checklistProgress || s.checklistProgress.length === 0)
832
880
  return 0;
833
- const t = s.checklistProgress.filter((u) => u.completed).length;
834
- return Math.round(t / s.checklistProgress.length * 100);
881
+ const e = s.checklistProgress.filter((d) => d.completed).length;
882
+ return Math.round(e / s.checklistProgress.length * 100);
835
883
  },
836
884
  getCompletedChecklistItems(s) {
837
- return s.checklistProgress ? s.checklistProgress.filter((t) => t.completed).length : 0;
885
+ return s.checklistProgress ? s.checklistProgress.filter((e) => e.completed).length : 0;
838
886
  },
839
887
  generateRecommendations() {
840
888
  return [
@@ -852,237 +900,237 @@ const Ee = /* @__PURE__ */ S(Ie, [["render", Fe]]), Ne = {
852
900
  });
853
901
  }
854
902
  }
855
- }, Oe = { key: 0 }, Ue = ["onClick"], Le = { class: "content" }, $e = {
903
+ }, je = { key: 0 }, Be = ["onClick"], He = { class: "content" }, Qe = {
856
904
  key: 0,
857
905
  class: "loading-container"
858
- }, je = { key: 1 }, Be = { class: "container" }, He = { class: "d-flex justify-content-between align-items-center" }, Qe = { class: "progress-container" }, Je = { class: "progress-info" }, We = { class: "progress-bar" }, Ge = { class: "checklist" }, ze = ["onClick"], Ye = { key: 0 }, Ke = ["onClick"], Xe = ["onClick"], Ze = { key: 0 }, et = { class: "checklist" }, tt = { class: "checklist-item" }, st = { class: "attachment-area" }, it = {
906
+ }, Je = { key: 1 }, We = { class: "container" }, Ke = { class: "d-flex justify-content-between align-items-center" }, ze = { class: "progress-container" }, Ge = { class: "progress-info" }, Ye = { class: "progress-bar" }, Xe = { class: "checklist" }, Ze = ["onClick"], et = { key: 0 }, tt = ["onClick"], st = ["onClick"], it = { key: 0 }, nt = { class: "checklist" }, ot = { class: "checklist-item" }, lt = { class: "attachment-area" }, rt = {
859
907
  key: 2,
860
908
  class: "status"
861
- }, nt = { class: "form-group" }, ot = { class: "form-group" }, lt = { class: "input-group" }, rt = { class: "form-group" }, at = { class: "form-group" }, dt = { class: "input-group" }, ut = { class: "form-group" }, ct = { class: "form-group" }, mt = { class: "input-group" }, vt = { class: "form-group" }, pt = { class: "form-group" }, ft = ["value"], ht = { class: "input-group" }, gt = { class: "form-group" }, bt = { class: "input-group" }, yt = { class: "form-group" }, wt = { class: "form-group" }, kt = { class: "form-group" }, _t = { class: "checkbox-group" }, Ct = { class: "checkbox-item" }, Dt = { class: "checkbox-item" }, xt = { class: "input-group" }, St = { class: "form-group" }, Pt = { class: "form-group" }, At = { class: "form-group" }, qt = { class: "attachment-area" }, Tt = { class: "action-buttons" }, It = ["disabled"], Rt = { class: "task-table-wrapper" }, Mt = { class: "table-controls" }, Vt = { class: "filters" }, Ft = { class: "task-table" }, Et = ["onClick"], Nt = ["onClick"], Ot = { key: 0 }, Ut = {
909
+ }, at = { class: "form-group" }, dt = { class: "form-group" }, ut = { class: "input-group" }, ct = { class: "form-group" }, mt = { class: "form-group" }, vt = { class: "input-group" }, pt = { class: "form-group" }, ht = { class: "form-group" }, ft = { class: "input-group" }, gt = { class: "form-group" }, bt = { class: "form-group" }, yt = ["value"], wt = { class: "input-group" }, kt = { class: "form-group" }, Ct = { class: "input-group" }, _t = { class: "form-group" }, Dt = { class: "form-group" }, xt = { class: "form-group" }, St = { class: "checkbox-group" }, At = { class: "checkbox-item" }, Pt = { class: "checkbox-item" }, Tt = { class: "input-group" }, qt = { class: "form-group" }, It = { class: "form-group" }, Ft = { class: "form-group" }, Rt = { class: "attachment-area" }, Vt = { class: "action-buttons" }, Mt = ["disabled"], Nt = { class: "task-table-wrapper" }, Et = { class: "table-controls" }, Lt = { class: "filters" }, Ot = { class: "task-table" }, Ut = ["onClick"], $t = ["onClick"], jt = { key: 0 }, Bt = {
862
910
  class: "alert alert-primary",
863
911
  role: "alert"
864
- }, Lt = { class: "mb-0" }, $t = {
912
+ }, Ht = { class: "mb-0" }, Qt = {
865
913
  class: "report-container",
866
914
  ref: "reportContainer"
867
- }, jt = { class: "report-info" }, Bt = { class: "info-box" }, Ht = { class: "info-box" }, Qt = { class: "info-box" }, Jt = { class: "section" }, Wt = { class: "summary-grid" }, Gt = { class: "summary-card" }, zt = { class: "summary-number" }, Yt = { class: "section" }, Kt = { class: "task-header" }, Xt = { class: "task-title" }, Zt = { class: "task-component" }, es = { class: "task-details" }, ts = { class: "detail-item" }, ss = { class: "detail-value" }, is = { class: "detail-item" }, ns = { class: "detail-value" }, os = { class: "detail-item" }, ls = { class: "detail-value" }, rs = { class: "detail-item" }, as = { class: "detail-value" }, ds = { class: "detail-item" }, us = { class: "detail-value" }, cs = { class: "detail-item" }, ms = { class: "detail-value" }, vs = {
915
+ }, Jt = { class: "report-info" }, Wt = { class: "info-box" }, Kt = { class: "info-box" }, zt = { class: "info-box" }, Gt = { class: "section" }, Yt = { class: "summary-grid" }, Xt = { class: "summary-card" }, Zt = { class: "summary-number" }, es = { class: "section" }, ts = { class: "task-header" }, ss = { class: "task-title" }, is = { class: "task-component" }, ns = { class: "task-details" }, os = { class: "detail-item" }, ls = { class: "detail-value" }, rs = { class: "detail-item" }, as = { class: "detail-value" }, ds = { class: "detail-item" }, us = { class: "detail-value" }, cs = { class: "detail-item" }, ms = { class: "detail-value" }, vs = { class: "detail-item" }, ps = { class: "detail-value" }, hs = { class: "detail-item" }, fs = { class: "detail-value" }, gs = {
868
916
  key: 0,
869
917
  style: { margin: "15px 0", padding: "10px", background: "white", "border-radius": "5px" }
870
- }, ps = { class: "detail-value" }, fs = {
918
+ }, bs = { class: "detail-value" }, ys = {
871
919
  key: 1,
872
920
  style: { margin: "15px 0", padding: "10px", background: "white", "border-radius": "5px" }
873
- }, hs = { class: "detail-value" }, gs = {
921
+ }, ws = { class: "detail-value" }, ks = {
874
922
  key: 2,
875
923
  class: "checklist-progress"
876
- }, bs = { class: "progress-bar" }, ys = { style: { "font-size": "0.9em", color: "#666", "margin-top": "5px" } }, ws = { class: "checklist-items" }, ks = { class: "checklist-icon" }, _s = { class: "section" }, Cs = { class: "info-box" }, Ds = { class: "signature-section" }, xs = { class: "signature-box" }, Ss = { style: { "margin-top": "10px", color: "#666" } };
877
- function Ps(s, t, u, b, n, a) {
878
- return n.ready ? (o(), l("div", Oe, [
879
- e("div", null, [
880
- v(e("nav", null, [
881
- (o(!0), l(p, null, h(n.sections, (i) => (o(), l("button", {
924
+ }, Cs = { class: "progress-bar" }, _s = { style: { "font-size": "0.9em", color: "#666", "margin-top": "5px" } }, Ds = { class: "checklist-items" }, xs = { class: "checklist-icon" }, Ss = { class: "section" }, As = { class: "info-box" }, Ps = { class: "signature-section" }, Ts = { class: "signature-box" }, qs = { style: { "margin-top": "10px", color: "#666" } };
925
+ function Is(s, e, d, p, n, o) {
926
+ return n.ready ? (l(), r("div", je, [
927
+ t("div", null, [
928
+ h(t("nav", null, [
929
+ (l(!0), r(f, null, g(n.sections, (i) => (l(), r("button", {
882
930
  key: i.id,
883
- class: g(["nav-btn", { active: n.activeSection === i.id }]),
884
- onClick: (f) => a.handleSectionClick(i)
885
- }, r(i.icon) + " " + r(i.name), 11, Ue))), 128))
931
+ class: b(["nav-btn", { active: n.activeSection === i.id }]),
932
+ onClick: (m) => o.handleSectionClick(i)
933
+ }, a(i.icon) + " " + a(i.name), 11, Be))), 128))
886
934
  ], 512), [
887
- [P, !n.showReport]
935
+ [A, !n.showReport]
888
936
  ]),
889
- v(e("div", Le, [
890
- v(e("section", {
891
- class: g(["form-section", { active: n.activeSection === "maintenance" }])
937
+ h(t("div", He, [
938
+ h(t("section", {
939
+ class: b(["form-section", { active: n.activeSection === "maintenance" }])
892
940
  }, [
893
- t[37] || (t[37] = e("h2", null, "🛠️ Maintenance Tasks", -1)),
894
- n.isLoading ? (o(), l("div", $e, t[27] || (t[27] = [
895
- e("div", { class: "loading-spinner" }, null, -1),
896
- e("p", null, "Loading checklist...", -1)
897
- ]))) : m("", !0),
898
- n.isLoading ? m("", !0) : (o(), l("form", je, [
899
- e("div", Be, [
900
- e("div", He, [
901
- t[29] || (t[29] = e("h1", null, "Maintenance Checklist", -1)),
902
- a.showAddTaskButton ? (o(), l("button", {
941
+ e[37] || (e[37] = t("h2", null, "🛠️ Maintenance Tasks", -1)),
942
+ n.isLoading ? (l(), r("div", Qe, e[27] || (e[27] = [
943
+ t("div", { class: "loading-spinner" }, null, -1),
944
+ t("p", null, "Loading checklist...", -1)
945
+ ]))) : c("", !0),
946
+ n.isLoading ? c("", !0) : (l(), r("form", Je, [
947
+ t("div", We, [
948
+ t("div", Ke, [
949
+ e[29] || (e[29] = t("h1", null, "Maintenance Checklist", -1)),
950
+ o.showAddTaskButton ? (l(), r("button", {
903
951
  key: 0,
904
952
  class: "btn btn-outline-custom",
905
- onClick: t[0] || (t[0] = D((i) => a.addTask(), ["prevent"]))
906
- }, t[28] || (t[28] = [
907
- _(" Manually Add Task ", -1),
908
- e("i", { class: "fas fa-plus" }, null, -1)
909
- ]))) : m("", !0)
953
+ onClick: e[0] || (e[0] = D((i) => o.addTask(), ["prevent"]))
954
+ }, e[28] || (e[28] = [
955
+ w(" Manually Add Task ", -1),
956
+ t("i", { class: "fas fa-plus" }, null, -1)
957
+ ]))) : c("", !0)
910
958
  ]),
911
- e("div", Qe, [
912
- e("div", Je, " Progress: " + r(a.progress) + "% (" + r(a.completedCount.length) + "/" + r(n.checklists.length) + ") ", 1),
913
- e("div", We, [
914
- e("div", {
959
+ t("div", ze, [
960
+ t("div", Ge, " Progress: " + a(o.progress) + "% (" + a(o.completedCount.length) + "/" + a(n.checklists.length) + ") ", 1),
961
+ t("div", Ye, [
962
+ t("div", {
915
963
  class: "progress-fill",
916
- style: E({ width: a.progress + "%" })
964
+ style: N({ width: o.progress + "%" })
917
965
  }, null, 4)
918
966
  ])
919
967
  ]),
920
- e("ul", Ge, [
921
- (o(!0), l(p, null, h(n.checklists, (i) => (o(), l("li", {
968
+ t("ul", Xe, [
969
+ (l(!0), r(f, null, g(n.checklists, (i) => (l(), r("li", {
922
970
  key: i.id,
923
971
  class: "checklist-item"
924
972
  }, [
925
- e("div", {
926
- class: g(["checkbox", { checked: i.completed }]),
927
- onClick: (f) => a.toggleTask(i)
973
+ t("div", {
974
+ class: b(["checkbox", { checked: i.completed }]),
975
+ onClick: (m) => o.toggleTask(i)
928
976
  }, [
929
- i.completed ? (o(), l("span", Ye, "✓")) : m("", !0)
930
- ], 10, ze),
931
- e("span", {
932
- class: g(["task-text", { completed: i.completed }]),
933
- onClick: (f) => a.toggleTask(i)
934
- }, r(i.text), 11, Ke),
935
- a.showAddTaskButton ? (o(), l("button", {
977
+ i.completed ? (l(), r("span", et, "✓")) : c("", !0)
978
+ ], 10, Ze),
979
+ t("span", {
980
+ class: b(["task-text", { completed: i.completed }]),
981
+ onClick: (m) => o.toggleTask(i)
982
+ }, a(i.text), 11, tt),
983
+ o.showAddTaskButton ? (l(), r("button", {
936
984
  key: 0,
937
985
  class: "delete-btn",
938
- onClick: (f) => a.deleteTask(i.id),
986
+ onClick: (m) => o.deleteTask(i.id),
939
987
  title: "Delete task"
940
- }, t[30] || (t[30] = [
988
+ }, e[30] || (e[30] = [
941
989
  x('<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3,6 5,6 21,6"></polyline><path d="m19,6v14a2,2 0 0,1 -2,2H7a2,2 0 0,1 -2,-2V6m3,0V4a2,2 0 0,1 2,-2h4a2,2 0 0,1 2,2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>', 1)
942
- ]), 8, Xe)) : m("", !0)
990
+ ]), 8, st)) : c("", !0)
943
991
  ]))), 128))
944
992
  ]),
945
- n.after ? (o(), l("div", Ze, [
946
- t[33] || (t[33] = e("label", null, "Upload Image Evidence", -1)),
947
- e("ul", et, [
948
- e("li", tt, [
949
- t[32] || (t[32] = e("span", { class: "task-text" }, " Image Evidence Already Uploaded ", -1)),
950
- e("button", {
993
+ n.after ? (l(), r("div", it, [
994
+ e[33] || (e[33] = t("label", null, "Upload Image Evidence", -1)),
995
+ t("ul", nt, [
996
+ t("li", ot, [
997
+ e[32] || (e[32] = t("span", { class: "task-text" }, " Image Evidence Already Uploaded ", -1)),
998
+ t("button", {
951
999
  type: "button",
952
1000
  class: "delete-btn",
953
- onClick: t[1] || (t[1] = (i) => a.deleteEvidence()),
1001
+ onClick: e[1] || (e[1] = (i) => o.deleteEvidence()),
954
1002
  title: "Delete Image"
955
- }, t[31] || (t[31] = [
1003
+ }, e[31] || (e[31] = [
956
1004
  x('<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3,6 5,6 21,6"></polyline><path d="m19,6v14a2,2 0 0,1 -2,2H7a2,2 0 0,1 -2,-2V6m3,0V4a2,2 0 0,1 2,-2h4a2,2 0 0,1 2,2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>', 1)
957
1005
  ]))
958
1006
  ])
959
1007
  ])
960
- ])) : (o(), l("div", {
1008
+ ])) : (l(), r("div", {
961
1009
  class: "form-group",
962
1010
  key: n.refreshKey || "default"
963
1011
  }, [
964
- t[35] || (t[35] = e("label", null, "Upload Image Evidence", -1)),
965
- t[36] || (t[36] = e("p", null, "You can only upload one image evidence here.", -1)),
966
- e("div", st, [
967
- e("p", null, r(n.fileText), 1),
968
- e("input", {
1012
+ e[35] || (e[35] = t("label", null, "Upload Image Evidence", -1)),
1013
+ e[36] || (e[36] = t("p", null, "You can only upload one image evidence here.", -1)),
1014
+ t("div", lt, [
1015
+ t("p", null, a(n.fileText), 1),
1016
+ t("input", {
969
1017
  type: "file",
970
1018
  id: "evidence-files",
971
1019
  class: "file-input",
972
- onChange: t[2] || (t[2] = (...i) => a.handleImg && a.handleImg(...i))
1020
+ onChange: e[2] || (e[2] = (...i) => o.handleImg && o.handleImg(...i))
973
1021
  }, null, 32),
974
- t[34] || (t[34] = e("label", {
1022
+ e[34] || (e[34] = t("label", {
975
1023
  for: "evidence-files",
976
1024
  class: "file-label"
977
1025
  }, "Browse Files", -1))
978
1026
  ])
979
1027
  ])),
980
- a.completedCount === n.checklists.length ? (o(), l("div", it, " All tasks completed! ✅ ")) : m("", !0),
981
- e("button", {
1028
+ o.completedCount === n.checklists.length ? (l(), r("div", rt, " All tasks completed! ✅ ")) : c("", !0),
1029
+ t("button", {
982
1030
  class: "reset-button",
983
- onClick: t[3] || (t[3] = D((...i) => a.resetTasks && a.resetTasks(...i), ["prevent"]))
984
- }, r(a.checklistButtonLabel), 1)
1031
+ onClick: e[3] || (e[3] = D((...i) => o.resetTasks && o.resetTasks(...i), ["prevent"]))
1032
+ }, a(o.checklistButtonLabel), 1)
985
1033
  ])
986
1034
  ]))
987
1035
  ], 2), [
988
- [P, n.activeSection === "maintenance"]
1036
+ [A, n.activeSection === "maintenance"]
989
1037
  ]),
990
- v(e("section", {
991
- class: g(["form-section", { active: n.activeSection === "schedule" }])
1038
+ h(t("section", {
1039
+ class: b(["form-section", { active: n.activeSection === "schedule" }])
992
1040
  }, [
993
- t[62] || (t[62] = e("h2", null, "📅 Maintenance Schedule", -1)),
994
- e("form", null, [
995
- e("div", nt, [
996
- t[38] || (t[38] = e("label", { for: "task-name" }, "Task Name", -1)),
997
- v(e("input", {
1041
+ e[62] || (e[62] = t("h2", null, "📅 Maintenance Schedule", -1)),
1042
+ t("form", null, [
1043
+ t("div", at, [
1044
+ e[38] || (e[38] = t("label", { for: "task-name" }, "Task Name", -1)),
1045
+ h(t("input", {
998
1046
  type: "text",
999
1047
  id: "task-name",
1000
- "onUpdate:modelValue": t[4] || (t[4] = (i) => n.form.taskName = i),
1048
+ "onUpdate:modelValue": e[4] || (e[4] = (i) => n.form.taskName = i),
1001
1049
  required: ""
1002
1050
  }, null, 512), [
1003
1051
  [k, n.form.taskName]
1004
1052
  ])
1005
1053
  ]),
1006
- e("div", ot, [
1007
- t[39] || (t[39] = e("label", { for: "task-description" }, "Description", -1)),
1008
- v(e("textarea", {
1054
+ t("div", dt, [
1055
+ e[39] || (e[39] = t("label", { for: "task-description" }, "Description", -1)),
1056
+ h(t("textarea", {
1009
1057
  id: "task-description",
1010
- "onUpdate:modelValue": t[5] || (t[5] = (i) => n.form.description = i),
1058
+ "onUpdate:modelValue": e[5] || (e[5] = (i) => n.form.description = i),
1011
1059
  required: ""
1012
1060
  }, null, 512), [
1013
1061
  [k, n.form.description]
1014
1062
  ])
1015
1063
  ]),
1016
- e("div", lt, [
1017
- e("div", rt, [
1018
- t[41] || (t[41] = e("label", { for: "maintenance-type" }, "Maintenance Type", -1)),
1019
- v(e("select", {
1064
+ t("div", ut, [
1065
+ t("div", ct, [
1066
+ e[41] || (e[41] = t("label", { for: "maintenance-type" }, "Maintenance Type", -1)),
1067
+ h(t("select", {
1020
1068
  id: "maintenance-type",
1021
- "onUpdate:modelValue": t[6] || (t[6] = (i) => n.form.maintenanceType = i),
1069
+ "onUpdate:modelValue": e[6] || (e[6] = (i) => n.form.maintenanceType = i),
1022
1070
  required: ""
1023
- }, t[40] || (t[40] = [
1071
+ }, e[40] || (e[40] = [
1024
1072
  x('<option value="">-- Select Type --</option><option value="preventive">Preventive</option><option value="corrective">Corrective</option><option value="predictive">Predictive</option><option value="condition">Condition-Based</option>', 5)
1025
1073
  ]), 512), [
1026
- [C, n.form.maintenanceType]
1074
+ [_, n.form.maintenanceType]
1027
1075
  ])
1028
1076
  ]),
1029
- e("div", at, [
1030
- t[43] || (t[43] = e("label", { for: "component" }, "Component/System", -1)),
1031
- v(e("select", {
1077
+ t("div", mt, [
1078
+ e[43] || (e[43] = t("label", { for: "component" }, "Component/System", -1)),
1079
+ h(t("select", {
1032
1080
  id: "component",
1033
- "onUpdate:modelValue": t[7] || (t[7] = (i) => n.form.component = i),
1081
+ "onUpdate:modelValue": e[7] || (e[7] = (i) => n.form.component = i),
1034
1082
  required: ""
1035
- }, t[42] || (t[42] = [
1083
+ }, e[42] || (e[42] = [
1036
1084
  x('<option value="">-- Select Component --</option><option value="engine">Engine</option><option value="hull">Hull</option><option value="electronics">Electronics</option><option value="deck">Deck Machinery</option><option value="plumbing">Plumbing</option><option value="electrical">Electrical</option><option value="hvac">HVAC</option><option value="safety">Safety Systems</option><option value="Other">Other</option>', 10)
1037
1085
  ]), 512), [
1038
- [C, n.form.component]
1086
+ [_, n.form.component]
1039
1087
  ]),
1040
- n.form.component === "Other" ? v((o(), l("input", {
1088
+ n.form.component === "Other" ? h((l(), r("input", {
1041
1089
  key: 0,
1042
1090
  type: "text",
1043
1091
  placeholder: "Enter custom component/system",
1044
- "onUpdate:modelValue": t[8] || (t[8] = (i) => n.form.customComponent = i),
1092
+ "onUpdate:modelValue": e[8] || (e[8] = (i) => n.form.customComponent = i),
1045
1093
  style: { "margin-top": "8px" }
1046
1094
  }, null, 512)), [
1047
1095
  [k, n.form.customComponent]
1048
- ]) : m("", !0)
1096
+ ]) : c("", !0)
1049
1097
  ])
1050
1098
  ]),
1051
- e("div", dt, [
1052
- e("div", ut, [
1053
- t[45] || (t[45] = e("label", { for: "priority" }, "Priority", -1)),
1054
- v(e("select", {
1099
+ t("div", vt, [
1100
+ t("div", pt, [
1101
+ e[45] || (e[45] = t("label", { for: "priority" }, "Priority", -1)),
1102
+ h(t("select", {
1055
1103
  id: "priority",
1056
- "onUpdate:modelValue": t[9] || (t[9] = (i) => n.form.priority = i),
1104
+ "onUpdate:modelValue": e[9] || (e[9] = (i) => n.form.priority = i),
1057
1105
  required: ""
1058
- }, t[44] || (t[44] = [
1059
- e("option", { value: "low" }, "Low", -1),
1060
- e("option", { value: "medium" }, "Medium", -1),
1061
- e("option", { value: "high" }, "High", -1),
1062
- e("option", { value: "critical" }, "Critical", -1)
1106
+ }, e[44] || (e[44] = [
1107
+ t("option", { value: "low" }, "Low", -1),
1108
+ t("option", { value: "medium" }, "Medium", -1),
1109
+ t("option", { value: "high" }, "High", -1),
1110
+ t("option", { value: "critical" }, "Critical", -1)
1063
1111
  ]), 512), [
1064
- [C, n.form.priority]
1112
+ [_, n.form.priority]
1065
1113
  ])
1066
1114
  ]),
1067
- e("div", ct, [
1068
- t[46] || (t[46] = e("label", { for: "status" }, "Status", -1)),
1069
- v(e("input", {
1115
+ t("div", ht, [
1116
+ e[46] || (e[46] = t("label", { for: "status" }, "Status", -1)),
1117
+ h(t("input", {
1070
1118
  type: "text",
1071
1119
  id: "status",
1072
- "onUpdate:modelValue": t[10] || (t[10] = (i) => n.form.status = i),
1120
+ "onUpdate:modelValue": e[10] || (e[10] = (i) => n.form.status = i),
1073
1121
  readonly: ""
1074
1122
  }, null, 512), [
1075
1123
  [k, n.form.status]
1076
1124
  ])
1077
1125
  ])
1078
1126
  ]),
1079
- e("div", mt, [
1080
- e("div", vt, [
1081
- t[47] || (t[47] = e("label", { for: "estimated-hours" }, "Estimated Hours", -1)),
1082
- v(e("input", {
1127
+ t("div", ft, [
1128
+ t("div", gt, [
1129
+ e[47] || (e[47] = t("label", { for: "estimated-hours" }, "Estimated Hours", -1)),
1130
+ h(t("input", {
1083
1131
  type: "number",
1084
1132
  id: "estimated-hours",
1085
- "onUpdate:modelValue": t[11] || (t[11] = (i) => n.form.estimatedHours = i),
1133
+ "onUpdate:modelValue": e[11] || (e[11] = (i) => n.form.estimatedHours = i),
1086
1134
  min: "0",
1087
1135
  step: "0.5"
1088
1136
  }, null, 512), [
@@ -1090,363 +1138,363 @@ function Ps(s, t, u, b, n, a) {
1090
1138
  ])
1091
1139
  ])
1092
1140
  ]),
1093
- e("div", pt, [
1094
- t[49] || (t[49] = e("label", { for: "assigned-to" }, "Assigned To", -1)),
1095
- v(e("select", {
1141
+ t("div", bt, [
1142
+ e[49] || (e[49] = t("label", { for: "assigned-to" }, "Assigned To", -1)),
1143
+ h(t("select", {
1096
1144
  id: "assigned-to",
1097
- "onUpdate:modelValue": t[12] || (t[12] = (i) => n.form.assignedTo = i)
1145
+ "onUpdate:modelValue": e[12] || (e[12] = (i) => n.form.assignedTo = i)
1098
1146
  }, [
1099
- t[48] || (t[48] = e("option", { value: "" }, "-- Select Personnel --", -1)),
1100
- (o(!0), l(p, null, h(u.vesselCrew, (i) => (o(), l("option", {
1147
+ e[48] || (e[48] = t("option", { value: "" }, "-- Select Personnel --", -1)),
1148
+ (l(!0), r(f, null, g(d.vesselCrew, (i) => (l(), r("option", {
1101
1149
  key: i.id,
1102
1150
  value: `${i.name} - ${i.role}`
1103
- }, r(i.name) + " - " + r(i.role), 9, ft))), 128))
1151
+ }, a(i.name) + " - " + a(i.role), 9, yt))), 128))
1104
1152
  ], 512), [
1105
- [C, n.form.assignedTo]
1153
+ [_, n.form.assignedTo]
1106
1154
  ])
1107
1155
  ]),
1108
- e("div", ht, [
1109
- e("div", gt, [
1110
- t[51] || (t[51] = e("label", { for: "recurrence-type" }, "Recurrence", -1)),
1111
- v(e("select", {
1156
+ t("div", wt, [
1157
+ t("div", kt, [
1158
+ e[51] || (e[51] = t("label", { for: "recurrence-type" }, "Recurrence", -1)),
1159
+ h(t("select", {
1112
1160
  id: "recurrence-type",
1113
- "onUpdate:modelValue": t[13] || (t[13] = (i) => n.form.recurrence = i),
1161
+ "onUpdate:modelValue": e[13] || (e[13] = (i) => n.form.recurrence = i),
1114
1162
  required: ""
1115
- }, t[50] || (t[50] = [
1163
+ }, e[50] || (e[50] = [
1116
1164
  x('<option value="once">One-time</option><option value="daily">Daily</option><option value="weekly">Weekly</option><option value="monthly">Monthly</option><option value="quarterly">Quarterly</option><option value="semi-annual">Semi-annually</option><option value="annual">Annually</option><option value="custom">Custom Interval</option>', 8)
1117
1165
  ]), 512), [
1118
- [C, n.form.recurrence]
1166
+ [_, n.form.recurrence]
1119
1167
  ])
1120
1168
  ])
1121
1169
  ]),
1122
- e("div", bt, [
1123
- e("div", yt, [
1124
- t[52] || (t[52] = e("label", { for: "last-performed" }, "Last Performed Date", -1)),
1125
- v(e("input", {
1170
+ t("div", Ct, [
1171
+ t("div", _t, [
1172
+ e[52] || (e[52] = t("label", { for: "last-performed" }, "Last Performed Date", -1)),
1173
+ h(t("input", {
1126
1174
  type: "date",
1127
1175
  id: "last-performed",
1128
- "onUpdate:modelValue": t[14] || (t[14] = (i) => n.form.lastPerformed = i)
1176
+ "onUpdate:modelValue": e[14] || (e[14] = (i) => n.form.lastPerformed = i)
1129
1177
  }, null, 512), [
1130
1178
  [k, n.form.lastPerformed]
1131
1179
  ])
1132
1180
  ]),
1133
- e("div", wt, [
1134
- t[53] || (t[53] = e("label", { for: "next-due" }, "Due Date", -1)),
1135
- v(e("input", {
1181
+ t("div", Dt, [
1182
+ e[53] || (e[53] = t("label", { for: "next-due" }, "Due Date", -1)),
1183
+ h(t("input", {
1136
1184
  type: "date",
1137
1185
  id: "next-due",
1138
- "onUpdate:modelValue": t[15] || (t[15] = (i) => n.form.nextDue = i),
1186
+ "onUpdate:modelValue": e[15] || (e[15] = (i) => n.form.nextDue = i),
1139
1187
  required: ""
1140
1188
  }, null, 512), [
1141
1189
  [k, n.form.nextDue]
1142
1190
  ])
1143
1191
  ])
1144
1192
  ]),
1145
- e("div", kt, [
1146
- t[56] || (t[56] = e("label", null, "Notifications", -1)),
1147
- e("div", _t, [
1148
- e("div", Ct, [
1149
- v(e("input", {
1193
+ t("div", xt, [
1194
+ e[56] || (e[56] = t("label", null, "Notifications", -1)),
1195
+ t("div", St, [
1196
+ t("div", At, [
1197
+ h(t("input", {
1150
1198
  type: "checkbox",
1151
1199
  id: "notify-email",
1152
- "onUpdate:modelValue": t[16] || (t[16] = (i) => n.form.notifyEmail = i)
1200
+ "onUpdate:modelValue": e[16] || (e[16] = (i) => n.form.notifyEmail = i)
1153
1201
  }, null, 512), [
1154
- [N, n.form.notifyEmail]
1202
+ [E, n.form.notifyEmail]
1155
1203
  ]),
1156
- t[54] || (t[54] = e("label", { for: "notify-email" }, "Email Notification", -1))
1204
+ e[54] || (e[54] = t("label", { for: "notify-email" }, "Email Notification", -1))
1157
1205
  ]),
1158
- e("div", Dt, [
1159
- v(e("input", {
1206
+ t("div", Pt, [
1207
+ h(t("input", {
1160
1208
  type: "checkbox",
1161
1209
  id: "notify-sms",
1162
- "onUpdate:modelValue": t[17] || (t[17] = (i) => n.form.notifySms = i)
1210
+ "onUpdate:modelValue": e[17] || (e[17] = (i) => n.form.notifySms = i)
1163
1211
  }, null, 512), [
1164
- [N, n.form.notifySms]
1212
+ [E, n.form.notifySms]
1165
1213
  ]),
1166
- t[55] || (t[55] = e("label", { for: "notify-sms" }, "SMS Notification", -1))
1214
+ e[55] || (e[55] = t("label", { for: "notify-sms" }, "SMS Notification", -1))
1167
1215
  ])
1168
1216
  ])
1169
1217
  ]),
1170
- e("div", xt, [
1171
- e("div", St, [
1172
- t[58] || (t[58] = e("label", { for: "reminder-days" }, "Reminder (Days Before)", -1)),
1173
- v(e("select", {
1218
+ t("div", Tt, [
1219
+ t("div", qt, [
1220
+ e[58] || (e[58] = t("label", { for: "reminder-days" }, "Reminder (Days Before)", -1)),
1221
+ h(t("select", {
1174
1222
  id: "reminder-days",
1175
- "onUpdate:modelValue": t[18] || (t[18] = (i) => n.form.reminderDays = i)
1176
- }, t[57] || (t[57] = [
1223
+ "onUpdate:modelValue": e[18] || (e[18] = (i) => n.form.reminderDays = i)
1224
+ }, e[57] || (e[57] = [
1177
1225
  x('<option value="1">1 day</option><option value="3">3 days</option><option value="7">1 week</option><option value="14">2 weeks</option><option value="30">1 month</option>', 5)
1178
1226
  ]), 512), [
1179
- [C, n.form.reminderDays]
1227
+ [_, n.form.reminderDays]
1180
1228
  ])
1181
1229
  ])
1182
1230
  ]),
1183
- e("div", Pt, [
1184
- t[59] || (t[59] = e("label", { for: "schedule-notes" }, "Notes", -1)),
1185
- v(e("textarea", {
1231
+ t("div", It, [
1232
+ e[59] || (e[59] = t("label", { for: "schedule-notes" }, "Notes", -1)),
1233
+ h(t("textarea", {
1186
1234
  id: "schedule-notes",
1187
- "onUpdate:modelValue": t[19] || (t[19] = (i) => n.form.notes = i)
1235
+ "onUpdate:modelValue": e[19] || (e[19] = (i) => n.form.notes = i)
1188
1236
  }, null, 512), [
1189
1237
  [k, n.form.notes]
1190
1238
  ])
1191
1239
  ]),
1192
- e("div", At, [
1193
- t[61] || (t[61] = e("label", null, "Attachments", -1)),
1194
- e("div", qt, [
1195
- e("p", null, r(n.imgText), 1),
1196
- e("input", {
1240
+ t("div", Ft, [
1241
+ e[61] || (e[61] = t("label", null, "Attachments", -1)),
1242
+ t("div", Rt, [
1243
+ t("p", null, a(n.imgText), 1),
1244
+ t("input", {
1197
1245
  type: "file",
1198
1246
  id: "maintenance-files",
1199
1247
  class: "file-input",
1200
- onChange: t[20] || (t[20] = (...i) => a.handleFiles && a.handleFiles(...i)),
1248
+ onChange: e[20] || (e[20] = (...i) => o.handleFiles && o.handleFiles(...i)),
1201
1249
  multiple: ""
1202
1250
  }, null, 32),
1203
- t[60] || (t[60] = e("label", {
1251
+ e[60] || (e[60] = t("label", {
1204
1252
  for: "maintenance-files",
1205
1253
  class: "file-label"
1206
1254
  }, "Browse Files", -1))
1207
1255
  ])
1208
1256
  ]),
1209
- e("div", Tt, [
1210
- e("button", {
1257
+ t("div", Vt, [
1258
+ t("button", {
1211
1259
  type: "button",
1212
1260
  class: "btn btn-primary",
1213
- onClick: t[21] || (t[21] = D((...i) => a.saveSchedule && a.saveSchedule(...i), ["prevent"])),
1261
+ onClick: e[21] || (e[21] = D((...i) => o.saveSchedule && o.saveSchedule(...i), ["prevent"])),
1214
1262
  disabled: n.isSaving
1215
- }, r(n.isSaving ? "Saving..." : "Save Schedule"), 9, It)
1263
+ }, a(n.isSaving ? "Saving..." : "Save Schedule"), 9, Mt)
1216
1264
  ])
1217
1265
  ])
1218
1266
  ], 2), [
1219
- [P, n.activeSection === "schedule"]
1267
+ [A, n.activeSection === "schedule"]
1220
1268
  ]),
1221
- v(e("section", {
1222
- class: g(["form-section", { active: n.activeSection === "inventory" }])
1269
+ h(t("section", {
1270
+ class: b(["form-section", { active: n.activeSection === "inventory" }])
1223
1271
  }, [
1224
- t[68] || (t[68] = e("h2", null, "All Maintenance", -1)),
1225
- e("div", Rt, [
1226
- e("div", Mt, [
1227
- e("div", Vt, [
1228
- e("button", {
1229
- class: g({ active: n.activeFilter === "due" }),
1230
- onClick: t[22] || (t[22] = (i) => a.setFilter("due"))
1272
+ e[68] || (e[68] = t("h2", null, "All Maintenance", -1)),
1273
+ t("div", Nt, [
1274
+ t("div", Et, [
1275
+ t("div", Lt, [
1276
+ t("button", {
1277
+ class: b({ active: n.activeFilter === "due" }),
1278
+ onClick: e[22] || (e[22] = (i) => o.setFilter("due"))
1231
1279
  }, "Due", 2),
1232
- e("button", {
1233
- class: g({ active: n.activeFilter === "all" }),
1234
- onClick: t[23] || (t[23] = (i) => a.setFilter("all"))
1280
+ t("button", {
1281
+ class: b({ active: n.activeFilter === "all" }),
1282
+ onClick: e[23] || (e[23] = (i) => o.setFilter("all"))
1235
1283
  }, "All", 2),
1236
- e("button", {
1237
- class: g({ active: n.activeFilter === "completed" }),
1238
- onClick: t[24] || (t[24] = (i) => a.setFilter("completed"))
1284
+ t("button", {
1285
+ class: b({ active: n.activeFilter === "completed" }),
1286
+ onClick: e[24] || (e[24] = (i) => o.setFilter("completed"))
1239
1287
  }, "Completed", 2),
1240
- v(e("input", {
1288
+ h(t("input", {
1241
1289
  type: "text",
1242
- "onUpdate:modelValue": t[25] || (t[25] = (i) => n.searchQuery = i),
1290
+ "onUpdate:modelValue": e[25] || (e[25] = (i) => n.searchQuery = i),
1243
1291
  placeholder: "Search..."
1244
1292
  }, null, 512), [
1245
1293
  [k, n.searchQuery]
1246
1294
  ])
1247
1295
  ])
1248
1296
  ]),
1249
- e("table", Ft, [
1250
- t[63] || (t[63] = e("thead", null, [
1251
- e("tr", null, [
1252
- e("th", null, "Equipment"),
1253
- e("th", null, "Task Name"),
1254
- e("th", null, "Assigned To"),
1255
- e("th", null, "Intervals"),
1256
- e("th", null, "Remaining"),
1257
- e("th", null, "Next Due"),
1258
- e("th", null, "Status"),
1259
- e("th", null, "Action")
1297
+ t("table", Ot, [
1298
+ e[63] || (e[63] = t("thead", null, [
1299
+ t("tr", null, [
1300
+ t("th", null, "Equipment"),
1301
+ t("th", null, "Task Name"),
1302
+ t("th", null, "Assigned To"),
1303
+ t("th", null, "Intervals"),
1304
+ t("th", null, "Remaining"),
1305
+ t("th", null, "Next Due"),
1306
+ t("th", null, "Status"),
1307
+ t("th", null, "Action")
1260
1308
  ])
1261
1309
  ], -1)),
1262
- e("tbody", null, [
1263
- (o(!0), l(p, null, h(a.filteredTasks, (i) => (o(), l("tr", {
1310
+ t("tbody", null, [
1311
+ (l(!0), r(f, null, g(o.filteredTasks, (i) => (l(), r("tr", {
1264
1312
  key: i.id
1265
1313
  }, [
1266
- e("td", null, r(i.component), 1),
1267
- e("td", null, r(i.taskName), 1),
1268
- e("td", null, r(i.assignedTo), 1),
1269
- e("td", null, r(i.recurrence), 1),
1270
- e("td", null, r(i.remainingDays), 1),
1271
- e("td", null, r(i.nextDue), 1),
1272
- e("td", null, [
1273
- e("span", {
1274
- class: g(["status-badge", i.status.toLowerCase().replace(" ", "-")])
1275
- }, r(i.status), 3)
1314
+ t("td", null, a(i.component), 1),
1315
+ t("td", null, a(i.taskName), 1),
1316
+ t("td", null, a(i.assignedTo), 1),
1317
+ t("td", null, a(i.recurrence), 1),
1318
+ t("td", null, a(i.remainingDays), 1),
1319
+ t("td", null, a(i.nextDue), 1),
1320
+ t("td", null, [
1321
+ t("span", {
1322
+ class: b(["status-badge", i.status.toLowerCase().replace(" ", "-")])
1323
+ }, a(i.status), 3)
1276
1324
  ]),
1277
- e("td", null, [
1278
- i.status === "Completed" ? (o(), l("button", {
1325
+ t("td", null, [
1326
+ i.status === "Completed" ? (l(), r("button", {
1279
1327
  key: 0,
1280
- onClick: (f) => a.printMaintenance(i.component),
1328
+ onClick: (m) => o.printMaintenance(i.component),
1281
1329
  class: "status-action"
1282
- }, "Print", 8, Et)) : (o(), l("button", {
1330
+ }, "Print", 8, Ut)) : (l(), r("button", {
1283
1331
  key: 1,
1284
- onClick: (f) => a.showMaintenance(i.component),
1332
+ onClick: (m) => o.showMaintenance(i.component),
1285
1333
  class: "status-action"
1286
- }, "Start", 8, Nt))
1334
+ }, "Start", 8, $t))
1287
1335
  ])
1288
1336
  ]))), 128))
1289
1337
  ])
1290
1338
  ]),
1291
- u.tasks.length ? m("", !0) : (o(), l("div", Ot, [
1292
- e("div", Ut, [
1293
- t[65] || (t[65] = e("h4", { class: "alert-heading" }, "Such Empty!!!", -1)),
1294
- t[66] || (t[66] = e("p", null, "You have no maintenance, because you have not scheduled any for this ship.", -1)),
1295
- t[67] || (t[67] = e("hr", null, null, -1)),
1296
- e("p", Lt, [
1297
- t[64] || (t[64] = _("Navigate to the schedule tab, to start scheduling. Or click on this button to ", -1)),
1298
- e("button", {
1339
+ d.tasks.length ? c("", !0) : (l(), r("div", jt, [
1340
+ t("div", Bt, [
1341
+ e[65] || (e[65] = t("h4", { class: "alert-heading" }, "Such Empty!!!", -1)),
1342
+ e[66] || (e[66] = t("p", null, "You have no maintenance, because you have not scheduled any for this ship.", -1)),
1343
+ e[67] || (e[67] = t("hr", null, null, -1)),
1344
+ t("p", Ht, [
1345
+ e[64] || (e[64] = w("Navigate to the schedule tab, to start scheduling. Or click on this button to ", -1)),
1346
+ t("button", {
1299
1347
  type: "button",
1300
1348
  class: "btn btn-primary",
1301
- onClick: t[26] || (t[26] = (i) => a.switchSchedule())
1349
+ onClick: e[26] || (e[26] = (i) => o.switchSchedule())
1302
1350
  }, "Schedule")
1303
1351
  ])
1304
1352
  ])
1305
1353
  ]))
1306
1354
  ])
1307
1355
  ], 2), [
1308
- [P, n.activeSection === "inventory"]
1356
+ [A, n.activeSection === "inventory"]
1309
1357
  ])
1310
1358
  ], 512), [
1311
- [P, !n.showReport]
1359
+ [A, !n.showReport]
1312
1360
  ]),
1313
- v(e("div", $t, [
1314
- t[89] || (t[89] = e("div", { class: "header" }, [
1315
- e("div", { class: "report-title" }, "MAINTENANCE TASK REPORT")
1361
+ h(t("div", Qt, [
1362
+ e[89] || (e[89] = t("div", { class: "header" }, [
1363
+ t("div", { class: "report-title" }, "MAINTENANCE TASK REPORT")
1316
1364
  ], -1)),
1317
- e("div", jt, [
1318
- e("div", Bt, [
1319
- t[69] || (t[69] = e("div", { class: "info-label" }, "Report Generated:", -1)),
1320
- e("div", null, r(n.reportDate), 1)
1365
+ t("div", Jt, [
1366
+ t("div", Wt, [
1367
+ e[69] || (e[69] = t("div", { class: "info-label" }, "Report Generated:", -1)),
1368
+ t("div", null, a(n.reportDate), 1)
1321
1369
  ]),
1322
- e("div", Ht, [
1323
- t[70] || (t[70] = e("div", { class: "info-label" }, "Report ID:", -1)),
1324
- e("div", null, r(n.reportId), 1)
1370
+ t("div", Kt, [
1371
+ e[70] || (e[70] = t("div", { class: "info-label" }, "Report ID:", -1)),
1372
+ t("div", null, a(n.reportId), 1)
1325
1373
  ]),
1326
- e("div", Qt, [
1327
- t[71] || (t[71] = e("div", { class: "info-label" }, "Total Tasks:", -1)),
1328
- e("div", null, r(n.maintenanceTasks.length), 1)
1374
+ t("div", zt, [
1375
+ e[71] || (e[71] = t("div", { class: "info-label" }, "Total Tasks:", -1)),
1376
+ t("div", null, a(n.maintenanceTasks.length), 1)
1329
1377
  ]),
1330
- t[72] || (t[72] = e("div", { class: "info-box" }, [
1331
- e("div", { class: "info-label" }, "Generated By:"),
1332
- e("div", null, "OceanHelm System")
1378
+ e[72] || (e[72] = t("div", { class: "info-box" }, [
1379
+ t("div", { class: "info-label" }, "Generated By:"),
1380
+ t("div", null, "OceanHelm System")
1333
1381
  ], -1))
1334
1382
  ]),
1335
- e("div", Jt, [
1336
- t[75] || (t[75] = e("div", { class: "section-title" }, "📊 Task Summary", -1)),
1337
- e("div", Wt, [
1338
- t[74] || (t[74] = x('<div class="summary-card"><div class="summary-number">1</div><div class="summary-label">Completed</div></div><div class="summary-card"><div class="summary-number">0</div><div class="summary-label">Pending</div></div><div class="summary-card"><div class="summary-number">0</div><div class="summary-label">Overdue</div></div>', 3)),
1339
- e("div", Gt, [
1340
- e("div", zt, r(a.totalEstimatedHours), 1),
1341
- t[73] || (t[73] = e("div", { class: "summary-label" }, "Total Hours", -1))
1383
+ t("div", Gt, [
1384
+ e[75] || (e[75] = t("div", { class: "section-title" }, "📊 Task Summary", -1)),
1385
+ t("div", Yt, [
1386
+ e[74] || (e[74] = x('<div class="summary-card"><div class="summary-number">1</div><div class="summary-label">Completed</div></div><div class="summary-card"><div class="summary-number">0</div><div class="summary-label">Pending</div></div><div class="summary-card"><div class="summary-number">0</div><div class="summary-label">Overdue</div></div>', 3)),
1387
+ t("div", Xt, [
1388
+ t("div", Zt, a(o.totalEstimatedHours), 1),
1389
+ e[73] || (e[73] = t("div", { class: "summary-label" }, "Total Hours", -1))
1342
1390
  ])
1343
1391
  ])
1344
1392
  ]),
1345
- e("div", Yt, [
1346
- t[85] || (t[85] = e("div", { class: "section-title" }, "🔧 Maintenance Tasks", -1)),
1347
- (o(!0), l(p, null, h(n.maintenanceTasks, (i) => (o(), l("div", {
1393
+ t("div", es, [
1394
+ e[85] || (e[85] = t("div", { class: "section-title" }, "🔧 Maintenance Tasks", -1)),
1395
+ (l(!0), r(f, null, g(n.maintenanceTasks, (i) => (l(), r("div", {
1348
1396
  key: i.taskName,
1349
- class: g(["task-item", a.getTaskStatusClass(i)])
1397
+ class: b(["task-item", o.getTaskStatusClass(i)])
1350
1398
  }, [
1351
- e("div", Kt, [
1352
- e("div", null, [
1353
- e("div", Xt, [
1354
- _(r(i.taskName) + " ", 1),
1355
- e("span", {
1356
- class: g(["maintenance-type", "type-" + i.maintenanceType])
1357
- }, r(i.maintenanceType), 3)
1399
+ t("div", ts, [
1400
+ t("div", null, [
1401
+ t("div", ss, [
1402
+ w(a(i.taskName) + " ", 1),
1403
+ t("span", {
1404
+ class: b(["maintenance-type", "type-" + i.maintenanceType])
1405
+ }, a(i.maintenanceType), 3)
1358
1406
  ]),
1359
- e("div", Zt, "Component: " + r(i.component), 1)
1407
+ t("div", is, "Component: " + a(i.component), 1)
1360
1408
  ]),
1361
- e("span", {
1362
- class: g(["status-badge", "status-" + i.status.toLowerCase().replace(" ", "-")])
1363
- }, r(i.status), 3)
1409
+ t("span", {
1410
+ class: b(["status-badge", "status-" + i.status.toLowerCase().replace(" ", "-")])
1411
+ }, a(i.status), 3)
1364
1412
  ]),
1365
- e("div", es, [
1366
- e("div", ts, [
1367
- t[76] || (t[76] = e("div", { class: "detail-label" }, "Assigned To", -1)),
1368
- e("div", ss, r(i.assignedTo), 1)
1413
+ t("div", ns, [
1414
+ t("div", os, [
1415
+ e[76] || (e[76] = t("div", { class: "detail-label" }, "Assigned To", -1)),
1416
+ t("div", ls, a(i.assignedTo), 1)
1369
1417
  ]),
1370
- e("div", is, [
1371
- t[77] || (t[77] = e("div", { class: "detail-label" }, "Estimated Hours", -1)),
1372
- e("div", ns, r(i.estimatedHours) + " hours", 1)
1418
+ t("div", rs, [
1419
+ e[77] || (e[77] = t("div", { class: "detail-label" }, "Estimated Hours", -1)),
1420
+ t("div", as, a(i.estimatedHours) + " hours", 1)
1373
1421
  ]),
1374
- e("div", os, [
1375
- t[78] || (t[78] = e("div", { class: "detail-label" }, "Last Performed", -1)),
1376
- e("div", ls, r(a.formatDate(i.lastPerformed)), 1)
1422
+ t("div", ds, [
1423
+ e[78] || (e[78] = t("div", { class: "detail-label" }, "Last Performed", -1)),
1424
+ t("div", us, a(o.formatDate(i.lastPerformed)), 1)
1377
1425
  ]),
1378
- e("div", rs, [
1379
- t[79] || (t[79] = e("div", { class: "detail-label" }, "Next Due", -1)),
1380
- e("div", as, r(a.formatDate(i.nextDue)), 1)
1426
+ t("div", cs, [
1427
+ e[79] || (e[79] = t("div", { class: "detail-label" }, "Next Due", -1)),
1428
+ t("div", ms, a(o.formatDate(i.nextDue)), 1)
1381
1429
  ]),
1382
- e("div", ds, [
1383
- t[80] || (t[80] = e("div", { class: "detail-label" }, "Recurrence", -1)),
1384
- e("div", us, r(i.recurrence), 1)
1430
+ t("div", vs, [
1431
+ e[80] || (e[80] = t("div", { class: "detail-label" }, "Recurrence", -1)),
1432
+ t("div", ps, a(i.recurrence), 1)
1385
1433
  ]),
1386
- e("div", cs, [
1387
- t[81] || (t[81] = e("div", { class: "detail-label" }, "Remaining Days", -1)),
1388
- e("div", ms, r(i.remainingDays) + " days", 1)
1434
+ t("div", hs, [
1435
+ e[81] || (e[81] = t("div", { class: "detail-label" }, "Remaining Days", -1)),
1436
+ t("div", fs, a(i.remainingDays) + " days", 1)
1389
1437
  ])
1390
1438
  ]),
1391
- i.description ? (o(), l("div", vs, [
1392
- t[82] || (t[82] = e("div", { class: "detail-label" }, "Description", -1)),
1393
- e("div", ps, r(i.description), 1)
1394
- ])) : m("", !0),
1395
- i.notes ? (o(), l("div", fs, [
1396
- t[83] || (t[83] = e("div", { class: "detail-label" }, "Notes", -1)),
1397
- e("div", hs, r(i.notes), 1)
1398
- ])) : m("", !0),
1399
- i.checklistProgress && i.checklistProgress.length > 0 ? (o(), l("div", gs, [
1400
- t[84] || (t[84] = e("div", { class: "detail-label" }, "Checklist Progress", -1)),
1401
- e("div", bs, [
1402
- e("div", {
1439
+ i.description ? (l(), r("div", gs, [
1440
+ e[82] || (e[82] = t("div", { class: "detail-label" }, "Description", -1)),
1441
+ t("div", bs, a(i.description), 1)
1442
+ ])) : c("", !0),
1443
+ i.notes ? (l(), r("div", ys, [
1444
+ e[83] || (e[83] = t("div", { class: "detail-label" }, "Notes", -1)),
1445
+ t("div", ws, a(i.notes), 1)
1446
+ ])) : c("", !0),
1447
+ i.checklistProgress && i.checklistProgress.length > 0 ? (l(), r("div", ks, [
1448
+ e[84] || (e[84] = t("div", { class: "detail-label" }, "Checklist Progress", -1)),
1449
+ t("div", Cs, [
1450
+ t("div", {
1403
1451
  class: "progress-fill",
1404
- style: E({ width: a.getChecklistProgress(i) + "%" })
1452
+ style: N({ width: o.getChecklistProgress(i) + "%" })
1405
1453
  }, null, 4)
1406
1454
  ]),
1407
- e("div", ys, r(a.getCompletedChecklistItems(i)) + " of " + r(i.checklistProgress.length) + " items completed (" + r(a.getChecklistProgress(i)) + "%) ", 1),
1408
- e("div", ws, [
1409
- (o(!0), l(p, null, h(i.checklistProgress, (f, y) => (o(), l("div", {
1455
+ t("div", _s, a(o.getCompletedChecklistItems(i)) + " of " + a(i.checklistProgress.length) + " items completed (" + a(o.getChecklistProgress(i)) + "%) ", 1),
1456
+ t("div", Ds, [
1457
+ (l(!0), r(f, null, g(i.checklistProgress, (m, y) => (l(), r("div", {
1410
1458
  key: y,
1411
1459
  class: "checklist-item"
1412
1460
  }, [
1413
- e("span", ks, r(f.completed ? "✅" : "⭕"), 1),
1414
- e("span", null, r(f.text || "Checklist Item " + (y + 1)), 1)
1461
+ t("span", xs, a(m.completed ? "✅" : "⭕"), 1),
1462
+ t("span", null, a(m.text || "Checklist Item " + (y + 1)), 1)
1415
1463
  ]))), 128))
1416
1464
  ])
1417
- ])) : m("", !0)
1465
+ ])) : c("", !0)
1418
1466
  ], 2))), 128))
1419
1467
  ]),
1420
- e("div", _s, [
1421
- t[86] || (t[86] = e("div", { class: "section-title" }, "📋 Recommendations", -1)),
1422
- e("div", Cs, [
1423
- e("ul", null, [
1424
- (o(!0), l(p, null, h(a.generateRecommendations(), (i) => (o(), l("li", { key: i }, r(i), 1))), 128))
1468
+ t("div", Ss, [
1469
+ e[86] || (e[86] = t("div", { class: "section-title" }, "📋 Recommendations", -1)),
1470
+ t("div", As, [
1471
+ t("ul", null, [
1472
+ (l(!0), r(f, null, g(o.generateRecommendations(), (i) => (l(), r("li", { key: i }, a(i), 1))), 128))
1425
1473
  ])
1426
1474
  ])
1427
1475
  ]),
1428
- e("div", Ds, [
1429
- t[88] || (t[88] = e("div", { class: "signature-box" }, [
1430
- e("div", null, [
1431
- e("strong", null, "Report Generated By")
1476
+ t("div", Ps, [
1477
+ e[88] || (e[88] = t("div", { class: "signature-box" }, [
1478
+ t("div", null, [
1479
+ t("strong", null, "Report Generated By")
1432
1480
  ]),
1433
- e("div", { style: { "margin-top": "10px", color: "#666" } }, "OceanHelm Maintenance System")
1481
+ t("div", { style: { "margin-top": "10px", color: "#666" } }, "OceanHelm Maintenance System")
1434
1482
  ], -1)),
1435
- e("div", xs, [
1436
- t[87] || (t[87] = e("div", null, [
1437
- e("strong", null, "Date")
1483
+ t("div", Ts, [
1484
+ e[87] || (e[87] = t("div", null, [
1485
+ t("strong", null, "Date")
1438
1486
  ], -1)),
1439
- e("div", Ss, r(n.reportDate), 1)
1487
+ t("div", qs, a(n.reportDate), 1)
1440
1488
  ])
1441
1489
  ])
1442
1490
  ], 512), [
1443
- [P, n.showReport]
1491
+ [A, n.showReport]
1444
1492
  ])
1445
1493
  ])
1446
- ])) : m("", !0);
1494
+ ])) : c("", !0);
1447
1495
  }
1448
- const As = /* @__PURE__ */ S(Ne, [["render", Ps]]);
1449
- const qs = {
1496
+ const Fs = /* @__PURE__ */ S($e, [["render", Is]]);
1497
+ const Rs = {
1450
1498
  name: "ActivityLogs",
1451
1499
  props: {
1452
1500
  loading: Boolean,
@@ -1476,125 +1524,124 @@ const qs = {
1476
1524
  }[s] || "badge-view";
1477
1525
  }
1478
1526
  }
1479
- }, Ts = { class: "activity-logs" }, Is = { class: "a-controls" }, Rs = { class: "a-search-box" }, Ms = ["value"], Vs = ["value"], Fs = { class: "stats-grid" }, Es = { class: "stat-card" }, Ns = { class: "value" }, Os = { class: "stat-card" }, Us = { class: "value" }, Ls = { class: "stat-card" }, $s = { class: "value" }, js = { class: "logs-container" }, Bs = {
1527
+ }, Vs = { class: "activity-logs" }, Ms = { class: "a-controls" }, Ns = { class: "a-search-box" }, Es = ["value"], Ls = ["value"], Os = { class: "stats-grid" }, Us = { class: "stat-card" }, $s = { class: "value" }, js = { class: "stat-card" }, Bs = { class: "value" }, Hs = { class: "stat-card" }, Qs = { class: "value" }, Js = { class: "logs-container" }, Ws = {
1480
1528
  key: 0,
1481
1529
  class: "loading"
1482
- }, Hs = {
1530
+ }, Ks = {
1483
1531
  key: 1,
1484
1532
  class: "no-logs"
1485
- }, Qs = { key: 2 }, Js = { class: "logs-table" }, Ws = { style: { color: "gray" } }, Gs = { style: { color: "gray" } }, zs = { class: "pagination" }, Ys = ["disabled"], Ks = ["onClick"], Xs = ["disabled"];
1486
- function Zs(s, t, u, b, n, a) {
1487
- return o(), l("div", Ts, [
1488
- e("div", Is, [
1489
- e("div", Rs, [
1490
- e("input", {
1533
+ }, zs = { key: 2 }, Gs = { class: "logs-table" }, Ys = { style: { color: "gray" } }, Xs = { style: { color: "gray" } }, Zs = { class: "pagination" }, ei = ["disabled"], ti = ["onClick"], si = ["disabled"];
1534
+ function ii(s, e, d, p, n, o) {
1535
+ return l(), r("div", Vs, [
1536
+ t("div", Ms, [
1537
+ t("div", Ns, [
1538
+ t("input", {
1491
1539
  type: "text",
1492
1540
  placeholder: "Search activities, users, or actions...",
1493
- value: u.searchTerm,
1494
- onInput: t[0] || (t[0] = (i) => s.$emit("update:searchTerm", i.target.value))
1495
- }, null, 40, Ms)
1541
+ value: d.searchTerm,
1542
+ onInput: e[0] || (e[0] = (i) => s.$emit("update:searchTerm", i.target.value))
1543
+ }, null, 40, Es)
1496
1544
  ]),
1497
- e("select", {
1545
+ t("select", {
1498
1546
  class: "filter-select",
1499
- value: u.selectedFilter,
1500
- onChange: t[1] || (t[1] = (i) => s.$emit("update:selectedFilter", i.target.value))
1501
- }, t[6] || (t[6] = [
1547
+ value: d.selectedFilter,
1548
+ onChange: e[1] || (e[1] = (i) => s.$emit("update:selectedFilter", i.target.value))
1549
+ }, e[6] || (e[6] = [
1502
1550
  x('<option value="all">All Activities</option><option value="login">Login</option><option value="logout">Logout</option><option value="create">Create</option><option value="update">Update</option><option value="delete">Delete</option><option value="view">View</option>', 7)
1503
- ]), 40, Vs),
1504
- e("button", {
1551
+ ]), 40, Ls),
1552
+ t("button", {
1505
1553
  class: "btn btn-primary",
1506
- onClick: t[2] || (t[2] = (i) => s.$emit("refresh"))
1554
+ onClick: e[2] || (e[2] = (i) => s.$emit("refresh"))
1507
1555
  }, "🔄 Refresh"),
1508
- e("button", {
1556
+ t("button", {
1509
1557
  class: "btn btn-secondary",
1510
- onClick: t[3] || (t[3] = (i) => s.$emit("download"))
1558
+ onClick: e[3] || (e[3] = (i) => s.$emit("download"))
1511
1559
  }, "📥 Download Report")
1512
1560
  ]),
1513
- e("div", Fs, [
1514
- e("div", Es, [
1515
- t[7] || (t[7] = e("h3", null, "Total Activities", -1)),
1516
- e("div", Ns, r(u.totalActivities), 1)
1561
+ t("div", Os, [
1562
+ t("div", Us, [
1563
+ e[7] || (e[7] = t("h3", null, "Total Activities", -1)),
1564
+ t("div", $s, a(d.totalActivities), 1)
1517
1565
  ]),
1518
- e("div", Os, [
1519
- t[8] || (t[8] = e("h3", null, "Today's Activities", -1)),
1520
- e("div", Us, r(u.todayActivities), 1)
1566
+ t("div", js, [
1567
+ e[8] || (e[8] = t("h3", null, "Today's Activities", -1)),
1568
+ t("div", Bs, a(d.todayActivities), 1)
1521
1569
  ]),
1522
- e("div", Ls, [
1523
- t[9] || (t[9] = e("h3", null, "Active Users", -1)),
1524
- e("div", $s, r(u.activeUsers), 1)
1570
+ t("div", Hs, [
1571
+ e[9] || (e[9] = t("h3", null, "Active Users", -1)),
1572
+ t("div", Qs, a(d.activeUsers), 1)
1525
1573
  ]),
1526
- t[10] || (t[10] = e("div", { class: "stat-card" }, [
1527
- e("h3", null, "Important"),
1528
- e("div", { class: "badge-danger" }, " Logs are deleted at the end of every month, please download a copy ")
1574
+ e[10] || (e[10] = t("div", { class: "stat-card" }, [
1575
+ t("h3", null, "Important"),
1576
+ t("div", { class: "badge-danger" }, " Logs are deleted at the end of every month, please download a copy ")
1529
1577
  ], -1))
1530
1578
  ]),
1531
- e("div", js, [
1532
- u.loading ? (o(), l("div", Bs, t[11] || (t[11] = [
1533
- e("div", { class: "spinner" }, null, -1),
1534
- e("p", null, "Loading activity logs...", -1)
1535
- ]))) : u.logs.length === 0 ? (o(), l("div", Hs, t[12] || (t[12] = [
1536
- e("h3", null, "No activities found", -1),
1537
- e("p", null, "Try adjusting your search or filter criteria", -1)
1538
- ]))) : (o(), l("div", Qs, [
1539
- e("table", Js, [
1540
- t[13] || (t[13] = e("thead", null, [
1541
- e("tr", null, [
1542
- e("th", null, "Timestamp"),
1543
- e("th", null, "User Name"),
1544
- e("th", null, "Action"),
1545
- e("th", null, "Details"),
1546
- e("th", null, "Section")
1579
+ t("div", Js, [
1580
+ d.loading ? (l(), r("div", Ws, e[11] || (e[11] = [
1581
+ t("div", { class: "spinner" }, null, -1),
1582
+ t("p", null, "Loading activity logs...", -1)
1583
+ ]))) : d.logs.length === 0 ? (l(), r("div", Ks, e[12] || (e[12] = [
1584
+ t("h3", null, "No activities found", -1),
1585
+ t("p", null, "Try adjusting your search or filter criteria", -1)
1586
+ ]))) : (l(), r("div", zs, [
1587
+ t("table", Gs, [
1588
+ e[13] || (e[13] = t("thead", null, [
1589
+ t("tr", null, [
1590
+ t("th", null, "Timestamp"),
1591
+ t("th", null, "User Name"),
1592
+ t("th", null, "Action"),
1593
+ t("th", null, "Details"),
1594
+ t("th", null, "Section")
1547
1595
  ])
1548
1596
  ], -1)),
1549
- e("tbody", null, [
1550
- (o(!0), l(p, null, h(u.paginatedLogs, (i) => (o(), l("tr", {
1597
+ t("tbody", null, [
1598
+ (l(!0), r(f, null, g(d.paginatedLogs, (i) => (l(), r("tr", {
1551
1599
  key: i.id
1552
1600
  }, [
1553
- e("td", null, r(a.formatDate(i.timestamp)), 1),
1554
- e("td", null, [
1555
- e("div", null, r(i.user_name), 1),
1556
- e("small", Ws, r(i.email), 1)
1601
+ t("td", null, a(o.formatDate(i.timestamp)), 1),
1602
+ t("td", null, [
1603
+ t("div", null, a(i.user_name), 1),
1604
+ t("small", Ys, a(i.email), 1)
1557
1605
  ]),
1558
- e("td", null, [
1559
- e("span", {
1560
- class: g(["activity-badge", a.getBadgeClass(i.action)])
1561
- }, r(i.action), 3)
1606
+ t("td", null, [
1607
+ t("span", {
1608
+ class: b(["activity-badge", o.getBadgeClass(i.action)])
1609
+ }, a(i.action), 3)
1562
1610
  ]),
1563
- e("td", null, [
1564
- _(r(i.details.status) + " ", 1),
1565
- (o(!0), l(p, null, h(i.details.information, (f, y) => (o(), l("div", { key: y }, [
1566
- e("strong", null, r(y) + ": ", 1),
1567
- e("small", Gs, r(f.from || "") + " → " + r(f.to || f), 1)
1611
+ t("td", null, [
1612
+ w(a(i.details.status) + " ", 1),
1613
+ (l(!0), r(f, null, g(i.details.information, (m, y) => (l(), r("div", { key: y }, [
1614
+ t("strong", null, a(y) + ": ", 1),
1615
+ t("small", Xs, a(m.from || "") + " → " + a(m.to || m), 1)
1568
1616
  ]))), 128))
1569
1617
  ]),
1570
- e("td", null, r(i.table_name), 1)
1618
+ t("td", null, a(i.table_name), 1)
1571
1619
  ]))), 128))
1572
1620
  ])
1573
1621
  ]),
1574
- e("div", zs, [
1575
- e("button", {
1576
- onClick: t[4] || (t[4] = (i) => s.$emit("change-page", u.currentPage - 1)),
1577
- disabled: u.currentPage === 1
1578
- }, " Previous ", 8, Ys),
1579
- (o(!0), l(p, null, h(u.totalPages, (i) => (o(), l("button", {
1622
+ t("div", Zs, [
1623
+ t("button", {
1624
+ onClick: e[4] || (e[4] = (i) => s.$emit("change-page", d.currentPage - 1)),
1625
+ disabled: d.currentPage === 1
1626
+ }, " Previous ", 8, ei),
1627
+ (l(!0), r(f, null, g(d.totalPages, (i) => (l(), r("button", {
1580
1628
  key: i,
1581
- onClick: (f) => s.$emit("change-page", i),
1582
- class: g({ active: u.currentPage === i })
1583
- }, r(i), 11, Ks))), 128)),
1584
- e("button", {
1585
- onClick: t[5] || (t[5] = (i) => s.$emit("change-page", u.currentPage + 1)),
1586
- disabled: u.currentPage === u.totalPages
1587
- }, " Next ", 8, Xs)
1629
+ onClick: (m) => s.$emit("change-page", i),
1630
+ class: b({ active: d.currentPage === i })
1631
+ }, a(i), 11, ti))), 128)),
1632
+ t("button", {
1633
+ onClick: e[5] || (e[5] = (i) => s.$emit("change-page", d.currentPage + 1)),
1634
+ disabled: d.currentPage === d.totalPages
1635
+ }, " Next ", 8, si)
1588
1636
  ])
1589
1637
  ]))
1590
1638
  ])
1591
1639
  ]);
1592
1640
  }
1593
- const ei = /* @__PURE__ */ S(qs, [["render", Zs]]);
1594
- const ti = {
1641
+ const ni = /* @__PURE__ */ S(Rs, [["render", ii]]);
1642
+ const oi = {
1595
1643
  name: "CrewManagement",
1596
1644
  props: {
1597
- // Required props
1598
1645
  crew: {
1599
1646
  type: Array,
1600
1647
  required: !0,
@@ -1608,7 +1655,6 @@ const ti = {
1608
1655
  type: Object,
1609
1656
  default: () => ({ role: "viewer" })
1610
1657
  },
1611
- // Optional props
1612
1658
  loading: {
1613
1659
  type: Boolean,
1614
1660
  default: !1
@@ -1617,7 +1663,6 @@ const ti = {
1617
1663
  type: Array,
1618
1664
  default: () => ["Captain", "First Officer", "Engineer", "Deckhand", "Mechanic", "Cook"]
1619
1665
  },
1620
- // Configuration props
1621
1666
  config: {
1622
1667
  type: Object,
1623
1668
  default: () => ({
@@ -1635,11 +1680,13 @@ const ti = {
1635
1680
  "crew-edit",
1636
1681
  "crew-delete",
1637
1682
  "crew-assign-shift",
1683
+ "crew-deboard",
1638
1684
  "crew-add-certification",
1639
1685
  "crew-view-certification",
1640
1686
  "search-changed",
1641
1687
  "filter-changed",
1642
- "access-denied"
1688
+ "access-denied",
1689
+ "upload-cert-image"
1643
1690
  ],
1644
1691
  data() {
1645
1692
  return {
@@ -1647,13 +1694,26 @@ const ti = {
1647
1694
  filterStatus: "all",
1648
1695
  showAddForm: !1,
1649
1696
  formErrors: {},
1697
+ expandedLogs: [],
1698
+ showTimesheet: !1,
1699
+ timesheetFilter: "all",
1700
+ timesheetSearch: "",
1701
+ timesheetSortKey: "timestamp",
1702
+ timesheetSortOrder: "desc",
1650
1703
  newCrew: {
1651
1704
  name: "",
1652
1705
  role: "Deckhand",
1653
1706
  customRole: "",
1654
1707
  status: "available",
1655
1708
  nextShift: "",
1656
- certifications: [{ name: "", expiryDate: "" }],
1709
+ certifications: [{
1710
+ name: "",
1711
+ expiryDate: "",
1712
+ imageFile: null,
1713
+ imagePreview: null,
1714
+ imageName: "",
1715
+ imageType: ""
1716
+ }],
1657
1717
  notes: "",
1658
1718
  email: "",
1659
1719
  onBoard: ""
@@ -1666,10 +1726,46 @@ const ti = {
1666
1726
  },
1667
1727
  filteredCrew() {
1668
1728
  return this.crew.filter((s) => {
1669
- const t = this.searchQuery === "" || s.name.toLowerCase().includes(this.searchQuery.toLowerCase()) || s.role.toLowerCase().includes(this.searchQuery.toLowerCase()) || s.vessel && s.vessel.toLowerCase().includes(this.searchQuery.toLowerCase()), u = this.filterStatus === "all" || s.status === this.filterStatus;
1670
- return t && u;
1729
+ const e = this.searchQuery === "" || s.name.toLowerCase().includes(this.searchQuery.toLowerCase()) || s.role.toLowerCase().includes(this.searchQuery.toLowerCase()) || s.vessel && s.vessel.toLowerCase().includes(this.searchQuery.toLowerCase()), d = this.filterStatus === "all" || s.status === this.filterStatus;
1730
+ return e && d;
1731
+ });
1732
+ },
1733
+ allTimesheetEntries() {
1734
+ const s = [];
1735
+ return this.crew.forEach((e) => {
1736
+ e.log && e.log.length > 0 && e.log.forEach((d, p) => {
1737
+ s.push({
1738
+ ...d,
1739
+ crewName: e.name,
1740
+ role: e.role,
1741
+ crewId: e.id,
1742
+ uniqueId: `${e.id}-${p}`
1743
+ });
1744
+ });
1745
+ }), s.sort((e, d) => {
1746
+ const p = new Date(e.timestamp), n = new Date(d.timestamp);
1747
+ return this.timesheetSortOrder === "desc" ? n - p : p - n;
1671
1748
  });
1672
1749
  },
1750
+ filteredTimesheetEntries() {
1751
+ let s = this.allTimesheetEntries;
1752
+ if (this.timesheetFilter !== "all" && (s = s.filter((e) => e.action === this.timesheetFilter)), this.timesheetSearch) {
1753
+ const e = this.timesheetSearch.toLowerCase();
1754
+ s = s.filter(
1755
+ (d) => d.crewName.toLowerCase().includes(e) || d.role.toLowerCase().includes(e) || d.action.toLowerCase().includes(e) || d.vessel && d.vessel.toLowerCase().includes(e) || d.notes && d.notes.toLowerCase().includes(e)
1756
+ );
1757
+ }
1758
+ return this.sortTimesheetEntries(s);
1759
+ },
1760
+ uniqueCrewCount() {
1761
+ return new Set(this.filteredTimesheetEntries.map((e) => e.crewId)).size;
1762
+ },
1763
+ timesheetDateRange() {
1764
+ if (this.filteredTimesheetEntries.length === 0)
1765
+ return "N/A";
1766
+ const s = this.filteredTimesheetEntries.map((n) => new Date(n.timestamp)), e = new Date(Math.min(...s)), d = new Date(Math.max(...s)), p = (n) => n.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
1767
+ return `${p(e)} - ${p(d)}`;
1768
+ },
1673
1769
  canAddCrew() {
1674
1770
  return this.config.enableAdd && this.hasPermission("add");
1675
1771
  },
@@ -1681,22 +1777,22 @@ const ti = {
1681
1777
  },
1682
1778
  canAssignShift() {
1683
1779
  return this.config.enableAssignShift && this.hasPermission("assign");
1780
+ },
1781
+ canDeboardCrew() {
1782
+ return this.config.enableAssignShift && this.hasPermission("assign");
1684
1783
  }
1685
1784
  },
1686
1785
  methods: {
1687
- // Permission checking
1688
1786
  hasPermission(s) {
1689
- const { role: t, vessel: u } = this.userProfile, b = u === this.vesselName;
1690
- let a = {
1787
+ const { role: e, vessel: d } = this.userProfile, p = d === this.vesselName;
1788
+ let o = {
1691
1789
  owner: ["add", "edit", "delete", "assign", "view"],
1692
1790
  staff: ["add", "edit", "assign", "view"],
1693
1791
  captain: ["assign", "view"],
1694
- // default for captain
1695
1792
  viewer: ["view"]
1696
- }[t] || [];
1697
- return t === "captain" && b && (a = [...a, "add"]), a.includes(s);
1793
+ }[e] || [];
1794
+ return e === "captain" && p && (o = [...o, "add"]), o.includes(s);
1698
1795
  },
1699
- // Event handlers
1700
1796
  handleToggleAddForm() {
1701
1797
  if (!this.canAddCrew) {
1702
1798
  this.$emit("access-denied", { action: "add crew", userProfile: this.userProfile });
@@ -1710,23 +1806,83 @@ const ti = {
1710
1806
  handleFilter() {
1711
1807
  this.$emit("filter-changed", this.filterStatus);
1712
1808
  },
1713
- handleAddCrewMember() {
1809
+ filterTimesheet() {
1810
+ },
1811
+ sortTimesheet(s) {
1812
+ this.timesheetSortKey === s ? this.timesheetSortOrder = this.timesheetSortOrder === "asc" ? "desc" : "asc" : (this.timesheetSortKey = s, this.timesheetSortOrder = "asc");
1813
+ },
1814
+ sortTimesheetEntries(s) {
1815
+ const e = [...s];
1816
+ return e.sort((d, p) => {
1817
+ let n, o;
1818
+ switch (this.timesheetSortKey) {
1819
+ case "timestamp":
1820
+ n = new Date(d.timestamp), o = new Date(p.timestamp);
1821
+ break;
1822
+ case "crewName":
1823
+ n = d.crewName.toLowerCase(), o = p.crewName.toLowerCase();
1824
+ break;
1825
+ case "role":
1826
+ n = d.role.toLowerCase(), o = p.role.toLowerCase();
1827
+ break;
1828
+ case "action":
1829
+ n = d.action.toLowerCase(), o = p.action.toLowerCase();
1830
+ break;
1831
+ default:
1832
+ return 0;
1833
+ }
1834
+ return n < o ? this.timesheetSortOrder === "asc" ? -1 : 1 : n > o ? this.timesheetSortOrder === "asc" ? 1 : -1 : 0;
1835
+ }), e;
1836
+ },
1837
+ getTimesheetRowClass(s) {
1838
+ return `timesheet-row-${s.toLowerCase().replace(/\s+/g, "-")}`;
1839
+ },
1840
+ async handleAddCrewMember() {
1714
1841
  if (!this.validateForm())
1715
1842
  return;
1716
1843
  const s = this.newCrew.certifications.filter(
1717
- (b) => b.name.trim() !== "" && b.expiryDate !== ""
1718
- ), t = this.newCrew.role === "Other" ? this.newCrew.customRole : this.newCrew.role, u = {
1844
+ (n) => n.name.trim() !== "" && n.expiryDate !== "" && n.imageFile !== null
1845
+ );
1846
+ if (s.length === 0) {
1847
+ alert("Please add at least one complete certification with name, expiry date, and image.");
1848
+ return;
1849
+ }
1850
+ const e = this.newCrew.role === "Other" ? this.newCrew.customRole : this.newCrew.role, d = await Promise.all(
1851
+ s.map(async (n, o) => {
1852
+ const i = await this.uploadCertificationImage(n.imageFile, this.newCrew.email);
1853
+ return {
1854
+ name: n.name,
1855
+ expiryDate: n.expiryDate,
1856
+ imageName: n.imageName,
1857
+ imageType: n.imageType,
1858
+ imageUrl: i.publicUrl
1859
+ // Add the public URL here
1860
+ };
1861
+ })
1862
+ ), p = {
1719
1863
  name: this.newCrew.name,
1720
- role: t,
1864
+ role: e,
1721
1865
  status: this.newCrew.status,
1722
- certifications: s,
1866
+ certifications: d,
1723
1867
  notes: this.newCrew.notes,
1724
1868
  vessel: this.vesselName,
1725
1869
  email: this.newCrew.email,
1726
1870
  onBoard: this.newCrew.onBoard,
1727
1871
  nextShift: this.newCrew.nextShift
1728
1872
  };
1729
- this.$emit("crew-add", u), this.resetForm(), this.showAddForm = !1;
1873
+ this.$emit("crew-add", p), this.resetForm(), this.showAddForm = !1;
1874
+ },
1875
+ // Add this helper method to handle the upload:
1876
+ async uploadCertificationImage(s, e) {
1877
+ return new Promise((d, p) => {
1878
+ this.$emit("upload-cert-image", {
1879
+ file: s,
1880
+ email: e,
1881
+ callback: (n) => {
1882
+ n.error ? p(n.error) : d(n);
1883
+ }
1884
+ });
1885
+ });
1730
1886
  },
1731
1887
  handleCancelForm() {
1732
1888
  this.showAddForm = !1, this.resetForm();
@@ -1745,6 +1901,22 @@ const ti = {
1745
1901
  }
1746
1902
  this.$emit("crew-assign-shift", s);
1747
1903
  },
1904
+ handleDeboardCrew(s) {
1905
+ if (!this.canDeboardCrew) {
1906
+ this.$emit("access-denied", { action: "deboard crew", userProfile: this.userProfile });
1907
+ return;
1908
+ }
1909
+ let e = null;
1910
+ if (s.nextShift) {
1911
+ const d = new Date(s.nextShift), n = Math.abs(/* @__PURE__ */ new Date() - d);
1912
+ e = Math.ceil(n / (1e3 * 60 * 60 * 24));
1913
+ }
1914
+ this.$emit("crew-deboard", { member: s, duration: e });
1915
+ },
1916
+ toggleCrewLog(s) {
1917
+ const e = this.expandedLogs.indexOf(s);
1918
+ e > -1 ? this.expandedLogs.splice(e, 1) : this.expandedLogs.push(s);
1919
+ },
1748
1920
  handleAddCertification(s) {
1749
1921
  if (!this.canEditCrew) {
1750
1922
  this.$emit("access-denied", { action: "add certification", userProfile: this.userProfile });
@@ -1752,10 +1924,9 @@ const ti = {
1752
1924
  }
1753
1925
  this.$emit("crew-add-certification", s);
1754
1926
  },
1755
- handleViewCertification(s, t) {
1756
- this.$emit("crew-view-certification", { certification: s, member: t });
1927
+ handleViewCertification(s, e) {
1928
+ this.$emit("crew-view-certification", { certification: s, member: e });
1757
1929
  },
1758
- // Form management
1759
1930
  resetForm() {
1760
1931
  this.newCrew = {
1761
1932
  name: "",
@@ -1763,7 +1934,14 @@ const ti = {
1763
1934
  customRole: "",
1764
1935
  status: "available",
1765
1936
  nextShift: "",
1766
- certifications: [{ name: "", expiryDate: "" }],
1937
+ certifications: [{
1938
+ name: "",
1939
+ expiryDate: "",
1940
+ imageFile: null,
1941
+ imagePreview: null,
1942
+ imageName: "",
1943
+ imageType: ""
1944
+ }],
1767
1945
  notes: "",
1768
1946
  email: "",
1769
1947
  onBoard: ""
@@ -1775,20 +1953,45 @@ const ti = {
1775
1953
  name: "Full Name",
1776
1954
  email: "Email Address"
1777
1955
  };
1778
- return Object.keys(s).forEach((t) => {
1779
- (!this.newCrew[t] || this.newCrew[t].trim() === "") && (this.formErrors[t] = `${s[t]} is required`);
1956
+ return Object.keys(s).forEach((e) => {
1957
+ (!this.newCrew[e] || this.newCrew[e].trim() === "") && (this.formErrors[e] = `${s[e]} is required`);
1780
1958
  }), this.newCrew.email && !this.isValidEmail(this.newCrew.email) && (this.formErrors.email = "Please enter a valid email address"), this.newCrew.role === "Other" && (!this.newCrew.customRole || this.newCrew.customRole.trim() === "") && (this.formErrors.customRole = 'Custom role is required when "Other" is selected'), Object.keys(this.formErrors).length === 0;
1781
1959
  },
1782
1960
  isValidEmail(s) {
1783
1961
  return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s);
1784
1962
  },
1785
1963
  addCertificationEntry() {
1786
- this.newCrew.certifications.push({ name: "", expiryDate: "" });
1964
+ this.newCrew.certifications.push({
1965
+ name: "",
1966
+ expiryDate: "",
1967
+ imageFile: null,
1968
+ imagePreview: null,
1969
+ imageName: "",
1970
+ imageType: ""
1971
+ });
1787
1972
  },
1788
1973
  removeCertification(s) {
1789
1974
  this.newCrew.certifications.splice(s, 1);
1790
1975
  },
1791
- // Utility methods
1976
+ handleCertImageUpload(s, e) {
1977
+ const d = s.target.files[0];
1978
+ if (!d)
1979
+ return;
1980
+ const p = this.newCrew.certifications[e];
1981
+ if (p.imageFile = d, p.imageName = d.name, p.imageType = d.type.includes("pdf") ? "pdf" : "image", p.imageType === "image") {
1982
+ const n = new FileReader();
1983
+ n.onload = (o) => {
1984
+ p.imagePreview = o.target.result;
1985
+ }, n.readAsDataURL(d);
1986
+ } else
1987
+ p.imagePreview = "pdf";
1988
+ },
1989
+ removeCertImage(s) {
1990
+ const e = this.newCrew.certifications[s];
1991
+ e.imageFile = null, e.imagePreview = null, e.imageName = "", e.imageType = "";
1992
+ const d = document.getElementById("cert-image-" + s);
1993
+ d && (d.value = "");
1994
+ },
1792
1995
  formatStatus(s) {
1793
1996
  return s ? s.charAt(0).toUpperCase() + s.slice(1) : "";
1794
1997
  },
@@ -1800,271 +2003,512 @@ const ti = {
1800
2003
  }[s] || "";
1801
2004
  },
1802
2005
  getCertificationClass(s) {
1803
- const t = this.getExpiryStatus(s);
2006
+ const e = this.getExpiryStatus(s);
1804
2007
  return {
1805
2008
  expired: "text-danger",
1806
2009
  expiringSoon: "text-warning",
1807
2010
  valid: "text-success"
1808
- }[t] || "";
2011
+ }[e] || "";
1809
2012
  },
1810
2013
  getExpiryStatus(s) {
1811
2014
  if (!s)
1812
2015
  return "none";
1813
- const t = new Date(s), u = /* @__PURE__ */ new Date(), b = /* @__PURE__ */ new Date();
1814
- return b.setMonth(u.getMonth() + 1), t <= u ? "expired" : t <= b ? "expiringSoon" : "valid";
2016
+ const e = new Date(s), d = /* @__PURE__ */ new Date(), p = /* @__PURE__ */ new Date();
2017
+ return p.setMonth(d.getMonth() + 1), e <= d ? "expired" : e <= p ? "expiringSoon" : "valid";
2018
+ },
2019
+ formatLogDate(s) {
2020
+ return s ? new Date(s).toLocaleDateString("en-US", {
2021
+ year: "numeric",
2022
+ month: "short",
2023
+ day: "numeric",
2024
+ hour: "2-digit",
2025
+ minute: "2-digit"
2026
+ }) : "";
2027
+ },
2028
+ getLogActionClass(s) {
2029
+ return {
2030
+ Embarked: "log-action-embark",
2031
+ Deboarded: "log-action-deboard",
2032
+ Assigned: "log-action-assign",
2033
+ "Status Changed": "log-action-status"
2034
+ }[s] || "";
2035
+ },
2036
+ getLogIcon(s) {
2037
+ return {
2038
+ Embarked: "bi bi-box-arrow-in-right",
2039
+ Deboarded: "bi bi-box-arrow-left",
2040
+ Assigned: "bi bi-calendar-check",
2041
+ "Status Changed": "bi bi-arrow-repeat"
2042
+ }[s] || "bi bi-circle-fill";
1815
2043
  }
1816
2044
  }
1817
- }, si = { class: "crew-management" }, ii = {
2045
+ }, li = { class: "crew-management" }, ri = {
1818
2046
  key: 0,
1819
2047
  class: "wave-bg"
1820
- }, ni = { class: "crew-section" }, oi = { class: "crew-section-header" }, li = { class: "search-filter" }, ri = {
2048
+ }, ai = { class: "crew-section" }, di = { class: "crew-section-header" }, ui = { class: "crew-subhead" }, ci = {
1821
2049
  key: 0,
2050
+ class: "search-filter"
2051
+ }, mi = {
2052
+ key: 1,
1822
2053
  class: "loading-state"
1823
- }, ai = {
2054
+ }, vi = {
2055
+ key: 2,
2056
+ class: "timesheet-view"
2057
+ }, pi = { class: "timesheet-header" }, hi = { class: "timesheet-controls" }, fi = { class: "timesheet-summary" }, gi = { class: "summary-card" }, bi = { class: "summary-value" }, yi = { class: "summary-card" }, wi = { class: "summary-value" }, ki = { class: "summary-card" }, Ci = { class: "summary-value" }, _i = {
2058
+ key: 0,
2059
+ class: "no-results"
2060
+ }, Di = {
1824
2061
  key: 1,
2062
+ class: "timesheet-table-container"
2063
+ }, xi = { class: "timesheet-table" }, Si = { class: "timestamp-cell" }, Ai = { class: "crew-name-cell" }, Pi = { class: "role-cell" }, Ti = { class: "action-cell" }, qi = { class: "vessel-cell" }, Ii = { class: "duration-cell" }, Fi = { class: "notes-cell" }, Ri = {
2064
+ key: 3,
1825
2065
  class: "crew-grid"
1826
- }, di = { class: "crew-name" }, ui = { class: "crew-role" }, ci = { class: "crew-certifications" }, mi = ["onClick"], vi = ["onClick"], pi = { class: "crew-availability" }, fi = { class: "crew-availability" }, hi = { class: "action-buttons" }, gi = {
2066
+ }, Vi = { class: "crew-name" }, Mi = { class: "crew-role" }, Ni = { class: "crew-certifications" }, Ei = ["onClick"], Li = ["onClick"], Oi = { class: "crew-availability" }, Ui = { class: "crew-availability" }, $i = { class: "action-buttons" }, ji = {
1827
2067
  key: 0,
1828
2068
  class: "status-available crew-availability vcard"
1829
- }, bi = {
2069
+ }, Bi = {
1830
2070
  key: 1,
1831
2071
  class: "status-unavailable crew-availability vcard"
1832
- }, yi = ["onClick"], wi = ["onClick"], ki = {
1833
- key: 2,
2072
+ }, Hi = ["onClick"], Qi = ["onClick"], Ji = { class: "crew-footer" }, Wi = {
2073
+ key: 0,
2074
+ class: "crew-log-toggle"
2075
+ }, Ki = ["onClick"], zi = ["onClick"], Gi = {
2076
+ key: 0,
2077
+ class: "crew-log"
2078
+ }, Yi = { class: "log-date" }, Xi = { class: "log-details" }, Zi = { key: 0 }, en = { key: 1 }, tn = {
2079
+ key: 0,
2080
+ class: "log-notes"
2081
+ }, sn = {
2082
+ key: 4,
1834
2083
  class: "no-results"
1835
- }, _i = {
1836
- key: 3,
2084
+ }, nn = {
2085
+ key: 5,
1837
2086
  class: "add-crew-form"
1838
- }, Ci = { class: "form-row" }, Di = { class: "form-group" }, xi = {
2087
+ }, on = { class: "form-row" }, ln = { class: "form-group" }, rn = {
1839
2088
  key: 0,
1840
2089
  class: "error-message"
1841
- }, Si = { class: "form-group" }, Pi = ["value"], Ai = { class: "form-row" }, qi = { class: "form-group" }, Ti = { class: "form-group" }, Ii = {
2090
+ }, an = { class: "form-group" }, dn = ["value"], un = { class: "form-row" }, cn = { class: "form-group" }, mn = { class: "form-group" }, vn = {
1842
2091
  key: 0,
1843
2092
  class: "error-message"
1844
- }, Ri = { class: "certification-section" }, Mi = { class: "form-row" }, Vi = { class: "form-group" }, Fi = ["onUpdate:modelValue"], Ei = { class: "form-group" }, Ni = ["onUpdate:modelValue"], Oi = { class: "form-group" }, Ui = ["onClick"], Li = { class: "form-row" }, $i = { class: "form-group" }, ji = { class: "form-actions" };
1845
- function Bi(s, t, u, b, n, a) {
1846
- return o(), l("div", si, [
1847
- u.config.showWaveBackground ? (o(), l("div", ii)) : m("", !0),
1848
- e("div", ni, [
1849
- e("div", oi, [
1850
- e("h2", null, r(a.sectionTitle), 1),
1851
- a.canAddCrew ? (o(), l("button", {
2093
+ }, pn = { class: "certification-section" }, hn = { class: "form-row" }, fn = { class: "form-group" }, gn = ["onUpdate:modelValue"], bn = { class: "form-group" }, yn = ["onUpdate:modelValue"], wn = { class: "form-group" }, kn = { class: "image-upload-wrapper" }, Cn = ["id", "onChange"], _n = ["for"], Dn = {
2094
+ key: 0,
2095
+ class: "image-preview"
2096
+ }, xn = ["src"], Sn = {
2097
+ key: 1,
2098
+ class: "pdf-preview"
2099
+ }, An = ["onClick"], Pn = {
2100
+ key: 1,
2101
+ class: "file-name"
2102
+ }, Tn = {
2103
+ class: "form-group",
2104
+ style: { display: "flex", "align-items": "flex-end" }
2105
+ }, qn = ["onClick"], In = { class: "form-row" }, Fn = { class: "form-group" }, Rn = { class: "form-actions" };
2106
+ function Vn(s, e, d, p, n, o) {
2107
+ return l(), r("div", li, [
2108
+ d.config.showWaveBackground ? (l(), r("div", ri)) : c("", !0),
2109
+ t("div", ai, [
2110
+ t("div", di, [
2111
+ t("h4", ui, a(o.sectionTitle), 1),
2112
+ o.canAddCrew ? (l(), r("button", {
1852
2113
  key: 0,
1853
2114
  class: "btn btn-primary",
1854
- onClick: t[0] || (t[0] = (...i) => a.handleToggleAddForm && a.handleToggleAddForm(...i))
1855
- }, r(n.showAddForm ? "Cancel" : "+ Add Crew Member"), 1)) : m("", !0)
2115
+ onClick: e[0] || (e[0] = (...i) => o.handleToggleAddForm && o.handleToggleAddForm(...i))
2116
+ }, a(n.showAddForm ? "Cancel" : "+ Add Crew Member"), 1)) : c("", !0)
1856
2117
  ]),
1857
- e("div", li, [
1858
- v(e("input", {
2118
+ n.showAddForm ? c("", !0) : (l(), r("div", ci, [
2119
+ h(t("input", {
1859
2120
  type: "text",
1860
2121
  placeholder: "Search crew by name or role...",
1861
- "onUpdate:modelValue": t[1] || (t[1] = (i) => n.searchQuery = i),
1862
- onInput: t[2] || (t[2] = (...i) => a.handleSearch && a.handleSearch(...i))
2122
+ "onUpdate:modelValue": e[1] || (e[1] = (i) => n.searchQuery = i),
2123
+ onInput: e[2] || (e[2] = (...i) => o.handleSearch && o.handleSearch(...i))
1863
2124
  }, null, 544), [
1864
2125
  [k, n.searchQuery]
1865
2126
  ]),
1866
- v(e("select", {
1867
- "onUpdate:modelValue": t[3] || (t[3] = (i) => n.filterStatus = i),
1868
- onChange: t[4] || (t[4] = (...i) => a.handleFilter && a.handleFilter(...i))
1869
- }, t[14] || (t[14] = [
1870
- e("option", { value: "all" }, "All Statuses", -1),
1871
- e("option", { value: "available" }, "Available", -1),
1872
- e("option", { value: "onduty" }, "On Duty", -1),
1873
- e("option", { value: "unavailable" }, "Unavailable", -1)
2127
+ h(t("select", {
2128
+ "onUpdate:modelValue": e[3] || (e[3] = (i) => n.filterStatus = i),
2129
+ onChange: e[4] || (e[4] = (...i) => o.handleFilter && o.handleFilter(...i))
2130
+ }, e[22] || (e[22] = [
2131
+ t("option", { value: "all" }, "All Statuses", -1),
2132
+ t("option", { value: "available" }, "Available", -1),
2133
+ t("option", { value: "onduty" }, "On Duty", -1),
2134
+ t("option", { value: "unavailable" }, "Unavailable", -1)
1874
2135
  ]), 544), [
1875
- [C, n.filterStatus]
2136
+ [_, n.filterStatus]
2137
+ ]),
2138
+ t("button", {
2139
+ class: "btn btn-secondary",
2140
+ onClick: e[5] || (e[5] = (i) => n.showTimesheet = !n.showTimesheet)
2141
+ }, [
2142
+ t("i", {
2143
+ class: b(n.showTimesheet ? "bi bi-grid-3x3-gap" : "bi bi-table")
2144
+ }, null, 2),
2145
+ w(" " + a(n.showTimesheet ? "Show Crew Cards" : "Show Timesheet"), 1)
1876
2146
  ])
1877
- ]),
1878
- u.loading ? (o(), l("div", ri, t[15] || (t[15] = [
1879
- e("div", {
2147
+ ])),
2148
+ d.loading && !n.showAddForm ? (l(), r("div", mi, e[23] || (e[23] = [
2149
+ t("div", {
1880
2150
  class: "spinner-border text-primary",
1881
2151
  role: "status"
1882
2152
  }, [
1883
- e("span", { class: "visually-hidden" }, "Loading crew...")
2153
+ t("span", { class: "visually-hidden" }, "Loading crew...")
1884
2154
  ], -1),
1885
- e("p", null, "Loading crew members...", -1)
1886
- ]))) : a.filteredCrew.length > 0 ? (o(), l("div", ai, [
1887
- (o(!0), l(p, null, h(a.filteredCrew, (i) => (o(), l("div", {
2155
+ t("p", null, "Loading crew members...", -1)
2156
+ ]))) : n.showTimesheet && !n.showAddForm ? (l(), r("div", vi, [
2157
+ t("div", pi, [
2158
+ e[25] || (e[25] = t("h3", null, [
2159
+ t("i", { class: "bi bi-table" }),
2160
+ w(" Crew Activity Timesheet")
2161
+ ], -1)),
2162
+ t("div", hi, [
2163
+ h(t("select", {
2164
+ "onUpdate:modelValue": e[6] || (e[6] = (i) => n.timesheetFilter = i),
2165
+ onChange: e[7] || (e[7] = (...i) => o.filterTimesheet && o.filterTimesheet(...i))
2166
+ }, e[24] || (e[24] = [
2167
+ x('<option value="all">All Activities</option><option value="Embarked">Embarked Only</option><option value="Deboarded">Deboarded Only</option><option value="Assigned">Assigned Only</option><option value="Status Changed">Status Changes Only</option>', 5)
2168
+ ]), 544), [
2169
+ [_, n.timesheetFilter]
2170
+ ]),
2171
+ h(t("input", {
2172
+ type: "text",
2173
+ "onUpdate:modelValue": e[8] || (e[8] = (i) => n.timesheetSearch = i),
2174
+ placeholder: "Search timesheet...",
2175
+ class: "timesheet-search"
2176
+ }, null, 512), [
2177
+ [k, n.timesheetSearch]
2178
+ ])
2179
+ ])
2180
+ ]),
2181
+ t("div", fi, [
2182
+ t("div", gi, [
2183
+ e[26] || (e[26] = t("span", { class: "summary-label" }, "Total Entries:", -1)),
2184
+ t("span", bi, a(o.filteredTimesheetEntries.length), 1)
2185
+ ]),
2186
+ t("div", yi, [
2187
+ e[27] || (e[27] = t("span", { class: "summary-label" }, "Crew Members:", -1)),
2188
+ t("span", wi, a(o.uniqueCrewCount), 1)
2189
+ ]),
2190
+ t("div", ki, [
2191
+ e[28] || (e[28] = t("span", { class: "summary-label" }, "Date Range:", -1)),
2192
+ t("span", Ci, a(o.timesheetDateRange), 1)
2193
+ ])
2194
+ ]),
2195
+ o.filteredTimesheetEntries.length === 0 ? (l(), r("div", _i, " No timesheet entries found. ")) : (l(), r("div", Di, [
2196
+ t("table", xi, [
2197
+ t("thead", null, [
2198
+ t("tr", null, [
2199
+ t("th", {
2200
+ onClick: e[9] || (e[9] = (i) => o.sortTimesheet("timestamp"))
2201
+ }, e[29] || (e[29] = [
2202
+ w(" Date/Time ", -1),
2203
+ t("i", { class: "bi bi-arrow-down-up" }, null, -1)
2204
+ ])),
2205
+ t("th", {
2206
+ onClick: e[10] || (e[10] = (i) => o.sortTimesheet("crewName"))
2207
+ }, e[30] || (e[30] = [
2208
+ w(" Crew Member ", -1),
2209
+ t("i", { class: "bi bi-arrow-down-up" }, null, -1)
2210
+ ])),
2211
+ t("th", {
2212
+ onClick: e[11] || (e[11] = (i) => o.sortTimesheet("role"))
2213
+ }, e[31] || (e[31] = [
2214
+ w(" Role ", -1),
2215
+ t("i", { class: "bi bi-arrow-down-up" }, null, -1)
2216
+ ])),
2217
+ t("th", {
2218
+ onClick: e[12] || (e[12] = (i) => o.sortTimesheet("action"))
2219
+ }, e[32] || (e[32] = [
2220
+ w(" Action ", -1),
2221
+ t("i", { class: "bi bi-arrow-down-up" }, null, -1)
2222
+ ])),
2223
+ e[33] || (e[33] = t("th", null, "Vessel", -1)),
2224
+ e[34] || (e[34] = t("th", null, "Duration", -1)),
2225
+ e[35] || (e[35] = t("th", null, "Notes", -1))
2226
+ ])
2227
+ ]),
2228
+ t("tbody", null, [
2229
+ (l(!0), r(f, null, g(o.filteredTimesheetEntries, (i) => (l(), r("tr", {
2230
+ key: i.uniqueId,
2231
+ class: b(o.getTimesheetRowClass(i.action))
2232
+ }, [
2233
+ t("td", Si, a(o.formatLogDate(i.timestamp)), 1),
2234
+ t("td", Ai, [
2235
+ t("strong", null, a(i.crewName), 1)
2236
+ ]),
2237
+ t("td", Pi, a(i.role), 1),
2238
+ t("td", Ti, [
2239
+ t("span", {
2240
+ class: b(["action-badge", o.getLogActionClass(i.action)])
2241
+ }, [
2242
+ t("i", {
2243
+ class: b(o.getLogIcon(i.action))
2244
+ }, null, 2),
2245
+ w(" " + a(i.action), 1)
2246
+ ], 2)
2247
+ ]),
2248
+ t("td", qi, a(i.vessel || "N/A"), 1),
2249
+ t("td", Ii, a(i.duration ? i.duration + " days" : "N/A"), 1),
2250
+ t("td", Fi, a(i.notes || "-"), 1)
2251
+ ], 2))), 128))
2252
+ ])
2253
+ ])
2254
+ ]))
2255
+ ])) : o.filteredCrew.length > 0 && !n.showAddForm ? (l(), r("div", Ri, [
2256
+ (l(!0), r(f, null, g(o.filteredCrew, (i) => (l(), r("div", {
1888
2257
  key: i.id,
1889
- class: g(["crew-card", { unavailable: i.status === "unavailable" }])
2258
+ class: b(["crew-card", { unavailable: i.status === "unavailable" }])
1890
2259
  }, [
1891
- e("div", {
1892
- class: g(["crew-status-badge", a.getStatusClass(i.status)])
1893
- }, r(a.formatStatus(i.status)), 3),
1894
- e("div", di, r(i.name), 1),
1895
- e("div", ui, r(i.role), 1),
1896
- e("div", ci, [
1897
- (o(!0), l(p, null, h(i.certifications, (f) => (o(), l("div", {
1898
- key: f.name,
1899
- class: g(["certification-tag", a.getCertificationClass(f.expiryDate)]),
1900
- onClick: (y) => a.handleViewCertification(f, i)
1901
- }, r(f.name), 11, mi))), 128)),
1902
- a.canEditCrew ? (o(), l("i", {
2260
+ t("div", {
2261
+ class: b(["crew-status-badge", o.getStatusClass(i.status)])
2262
+ }, a(o.formatStatus(i.status)), 3),
2263
+ t("div", Vi, a(i.name), 1),
2264
+ t("div", Mi, a(i.role), 1),
2265
+ t("div", Ni, [
2266
+ (l(!0), r(f, null, g(i.certifications, (m) => (l(), r("div", {
2267
+ key: m.name,
2268
+ class: b(["certification-tag", o.getCertificationClass(m.expiryDate)]),
2269
+ onClick: (y) => o.handleViewCertification(m, i)
2270
+ }, a(m.name), 11, Ei))), 128)),
2271
+ o.canEditCrew ? (l(), r("i", {
1903
2272
  key: 0,
1904
2273
  class: "bi bi-patch-plus-fill icon",
1905
- onClick: (f) => a.handleAddCertification(i)
1906
- }, null, 8, vi)) : m("", !0)
2274
+ onClick: (m) => o.handleAddCertification(i)
2275
+ }, null, 8, Li)) : c("", !0)
1907
2276
  ]),
1908
- e("div", pi, [
1909
- t[16] || (t[16] = e("strong", null, "Embarkation Date:", -1)),
1910
- _(" " + r(i.nextShift || "Not Scheduled"), 1)
2277
+ t("div", Oi, [
2278
+ e[36] || (e[36] = t("strong", null, "Embarkation Date:", -1)),
2279
+ w(" " + a(i.nextShift || "Not Scheduled"), 1)
1911
2280
  ]),
1912
- e("div", fi, [
1913
- t[17] || (t[17] = e("strong", null, "Expected Days Onboard (in days):", -1)),
1914
- _(" " + r(i.onBoard || "Not Scheduled"), 1)
2281
+ t("div", Ui, [
2282
+ e[37] || (e[37] = t("strong", null, "Expected Days Onboard (in days):", -1)),
2283
+ w(" " + a(i.onBoard || "Not Scheduled"), 1)
1915
2284
  ]),
1916
- e("div", hi, [
1917
- i.vessel ? (o(), l("div", gi, " Vessel: " + r(i.vessel), 1)) : (o(), l("div", bi, " Vessel: Unassigned ")),
1918
- a.canAssignShift ? (o(), l("button", {
2285
+ t("div", $i, [
2286
+ i.vessel ? (l(), r("div", ji, " Vessel: " + a(i.vessel), 1)) : (l(), r("div", Bi, " Vessel: Unassigned ")),
2287
+ o.canAssignShift && i.status !== "onduty" ? (l(), r("button", {
1919
2288
  key: 2,
1920
2289
  class: "btn btn-primary",
1921
- onClick: (f) => a.handleAssignShift(i)
1922
- }, " Assign Shift ", 8, yi)) : m("", !0)
2290
+ onClick: (m) => o.handleAssignShift(i)
2291
+ }, " Assign Shift ", 8, Hi)) : c("", !0),
2292
+ o.canDeboardCrew && i.status === "onduty" ? (l(), r("button", {
2293
+ key: 3,
2294
+ class: "btn btn-warning",
2295
+ onClick: (m) => o.handleDeboardCrew(i)
2296
+ }, " Deboard ", 8, Qi)) : c("", !0)
1923
2297
  ]),
1924
- a.canDeleteCrew ? (o(), l("i", {
1925
- key: 0,
1926
- class: "bi bi-trash icon delete-icon",
1927
- onClick: (f) => a.handleDeleteCrew(i)
1928
- }, null, 8, wi)) : m("", !0)
2298
+ t("div", Ji, [
2299
+ i.log && i.log.length > 0 ? (l(), r("div", Wi, [
2300
+ t("button", {
2301
+ class: "btn btn-link btn-sm log-toggle-btn",
2302
+ onClick: (m) => o.toggleCrewLog(i.id)
2303
+ }, [
2304
+ e[38] || (e[38] = t("i", { class: "bi bi-clock-history" }, null, -1)),
2305
+ w(" View Log (" + a(i.log.length) + ") ", 1)
2306
+ ], 8, Ki)
2307
+ ])) : c("", !0),
2308
+ o.canDeleteCrew ? (l(), r("i", {
2309
+ key: 1,
2310
+ class: "bi bi-trash icon delete-icon",
2311
+ onClick: (m) => o.handleDeleteCrew(i)
2312
+ }, null, 8, zi)) : c("", !0)
2313
+ ]),
2314
+ n.expandedLogs.includes(i.id) ? (l(), r("div", Gi, [
2315
+ e[39] || (e[39] = t("h4", null, "Crew Activity Log", -1)),
2316
+ (l(!0), r(f, null, g(i.log, (m, y) => (l(), r("div", {
2317
+ key: y,
2318
+ class: "log-entry"
2319
+ }, [
2320
+ t("div", Yi, a(o.formatLogDate(m.timestamp)), 1),
2321
+ t("div", {
2322
+ class: b(["log-action", o.getLogActionClass(m.action)])
2323
+ }, [
2324
+ t("i", {
2325
+ class: b(o.getLogIcon(m.action))
2326
+ }, null, 2),
2327
+ w(" " + a(m.action), 1)
2328
+ ], 2),
2329
+ t("div", Xi, [
2330
+ m.vessel ? (l(), r("span", Zi, "Vessel: " + a(m.vessel), 1)) : c("", !0),
2331
+ m.duration ? (l(), r("span", en, " | Duration: " + a(m.duration) + " days", 1)) : c("", !0)
2332
+ ]),
2333
+ m.notes ? (l(), r("div", tn, a(m.notes), 1)) : c("", !0)
2334
+ ]))), 128))
2335
+ ])) : c("", !0)
1929
2336
  ], 2))), 128))
1930
- ])) : u.loading ? m("", !0) : (o(), l("div", ki, r(u.crew.length === 0 ? "No crew members found." : "No crew members found matching your search criteria."), 1)),
1931
- n.showAddForm ? (o(), l("div", _i, [
1932
- t[28] || (t[28] = e("h2", null, "Add New Crew Member", -1)),
1933
- e("div", Ci, [
1934
- e("div", Di, [
1935
- t[18] || (t[18] = e("label", { for: "crew-name" }, "Full Name *", -1)),
1936
- v(e("input", {
2337
+ ])) : !d.loading && !n.showTimesheet && !n.showAddForm ? (l(), r("div", sn, a(d.crew.length === 0 ? "No crew members found." : "No crew members found matching your search criteria."), 1)) : c("", !0),
2338
+ n.showAddForm ? (l(), r("div", nn, [
2339
+ e[54] || (e[54] = t("h2", null, "Add New Crew Member", -1)),
2340
+ t("div", on, [
2341
+ t("div", ln, [
2342
+ e[40] || (e[40] = t("label", { for: "crew-name" }, "Full Name *", -1)),
2343
+ h(t("input", {
1937
2344
  type: "text",
1938
2345
  id: "crew-name",
1939
- "onUpdate:modelValue": t[5] || (t[5] = (i) => n.newCrew.name = i),
1940
- class: g({ error: n.formErrors.name })
2346
+ "onUpdate:modelValue": e[13] || (e[13] = (i) => n.newCrew.name = i),
2347
+ class: b({ error: n.formErrors.name })
1941
2348
  }, null, 2), [
1942
2349
  [k, n.newCrew.name]
1943
2350
  ]),
1944
- n.formErrors.name ? (o(), l("div", xi, r(n.formErrors.name), 1)) : m("", !0)
2351
+ n.formErrors.name ? (l(), r("div", rn, a(n.formErrors.name), 1)) : c("", !0)
1945
2352
  ]),
1946
- e("div", Si, [
1947
- t[20] || (t[20] = e("label", { for: "crew-role" }, "Role/Position *", -1)),
1948
- v(e("select", {
2353
+ t("div", an, [
2354
+ e[42] || (e[42] = t("label", { for: "crew-role" }, "Role/Position *", -1)),
2355
+ h(t("select", {
1949
2356
  id: "crew-role",
1950
- "onUpdate:modelValue": t[6] || (t[6] = (i) => n.newCrew.role = i)
2357
+ "onUpdate:modelValue": e[14] || (e[14] = (i) => n.newCrew.role = i)
1951
2358
  }, [
1952
- (o(!0), l(p, null, h(u.availableRoles, (i) => (o(), l("option", {
2359
+ (l(!0), r(f, null, g(d.availableRoles, (i) => (l(), r("option", {
1953
2360
  key: i,
1954
2361
  value: i
1955
- }, r(i), 9, Pi))), 128)),
1956
- t[19] || (t[19] = e("option", { value: "Other" }, "Other", -1))
2362
+ }, a(i), 9, dn))), 128)),
2363
+ e[41] || (e[41] = t("option", { value: "Other" }, "Other", -1))
1957
2364
  ], 512), [
1958
- [C, n.newCrew.role]
2365
+ [_, n.newCrew.role]
1959
2366
  ]),
1960
- n.newCrew.role === "Other" ? v((o(), l("input", {
2367
+ n.newCrew.role === "Other" ? h((l(), r("input", {
1961
2368
  key: 0,
1962
2369
  type: "text",
1963
2370
  placeholder: "Enter custom role",
1964
- "onUpdate:modelValue": t[7] || (t[7] = (i) => n.newCrew.customRole = i),
2371
+ "onUpdate:modelValue": e[15] || (e[15] = (i) => n.newCrew.customRole = i),
1965
2372
  style: { "margin-top": "8px" }
1966
2373
  }, null, 512)), [
1967
2374
  [k, n.newCrew.customRole]
1968
- ]) : m("", !0)
2375
+ ]) : c("", !0)
1969
2376
  ])
1970
2377
  ]),
1971
- e("div", Ai, [
1972
- e("div", qi, [
1973
- t[22] || (t[22] = e("label", { for: "crew-status" }, "Status *", -1)),
1974
- v(e("select", {
2378
+ t("div", un, [
2379
+ t("div", cn, [
2380
+ e[44] || (e[44] = t("label", { for: "crew-status" }, "Status *", -1)),
2381
+ h(t("select", {
1975
2382
  id: "crew-status",
1976
- "onUpdate:modelValue": t[8] || (t[8] = (i) => n.newCrew.status = i)
1977
- }, t[21] || (t[21] = [
1978
- e("option", { value: "available" }, "Available", -1),
1979
- e("option", { value: "onduty" }, "On Duty", -1),
1980
- e("option", { value: "unavailable" }, "Unavailable", -1)
2383
+ "onUpdate:modelValue": e[16] || (e[16] = (i) => n.newCrew.status = i)
2384
+ }, e[43] || (e[43] = [
2385
+ t("option", { value: "available" }, "Available", -1),
2386
+ t("option", { value: "onduty" }, "On Duty", -1),
2387
+ t("option", { value: "unavailable" }, "Unavailable", -1)
1981
2388
  ]), 512), [
1982
- [C, n.newCrew.status]
2389
+ [_, n.newCrew.status]
1983
2390
  ])
1984
2391
  ]),
1985
- e("div", Ti, [
1986
- t[23] || (t[23] = e("label", { for: "crew-email" }, "Email Address *", -1)),
1987
- v(e("input", {
2392
+ t("div", mn, [
2393
+ e[45] || (e[45] = t("label", { for: "crew-email" }, "Email Address *", -1)),
2394
+ h(t("input", {
1988
2395
  type: "email",
1989
2396
  id: "crew-email",
1990
- "onUpdate:modelValue": t[9] || (t[9] = (i) => n.newCrew.email = i),
1991
- class: g({ error: n.formErrors.email })
2397
+ "onUpdate:modelValue": e[17] || (e[17] = (i) => n.newCrew.email = i),
2398
+ class: b({ error: n.formErrors.email })
1992
2399
  }, null, 2), [
1993
2400
  [k, n.newCrew.email]
1994
2401
  ]),
1995
- n.formErrors.email ? (o(), l("div", Ii, r(n.formErrors.email), 1)) : m("", !0)
2402
+ n.formErrors.email ? (l(), r("div", vn, a(n.formErrors.email), 1)) : c("", !0)
1996
2403
  ])
1997
2404
  ]),
1998
- e("div", Ri, [
1999
- t[26] || (t[26] = e("h3", null, "Certifications", -1)),
2000
- (o(!0), l(p, null, h(n.newCrew.certifications, (i, f) => (o(), l("div", {
2001
- key: f,
2405
+ t("div", pn, [
2406
+ e[52] || (e[52] = t("h3", null, "Certifications", -1)),
2407
+ (l(!0), r(f, null, g(n.newCrew.certifications, (i, m) => (l(), r("div", {
2408
+ key: m,
2002
2409
  class: "certification-entry"
2003
2410
  }, [
2004
- e("div", Mi, [
2005
- e("div", Vi, [
2006
- t[24] || (t[24] = e("label", null, "Certification Name", -1)),
2007
- v(e("input", {
2411
+ t("div", hn, [
2412
+ t("div", fn, [
2413
+ e[46] || (e[46] = t("label", null, "Certification Name *", -1)),
2414
+ h(t("input", {
2008
2415
  type: "text",
2009
2416
  "onUpdate:modelValue": (y) => i.name = y,
2010
2417
  placeholder: "Enter certification name"
2011
- }, null, 8, Fi), [
2418
+ }, null, 8, gn), [
2012
2419
  [k, i.name]
2013
2420
  ])
2014
2421
  ]),
2015
- e("div", Ei, [
2016
- t[25] || (t[25] = e("label", null, "Expiry Date", -1)),
2017
- v(e("input", {
2422
+ t("div", bn, [
2423
+ e[47] || (e[47] = t("label", null, "Expiry Date *", -1)),
2424
+ h(t("input", {
2018
2425
  type: "date",
2019
2426
  "onUpdate:modelValue": (y) => i.expiryDate = y
2020
- }, null, 8, Ni), [
2427
+ }, null, 8, yn), [
2021
2428
  [k, i.expiryDate]
2022
2429
  ])
2023
2430
  ]),
2024
- e("div", Oi, [
2025
- n.newCrew.certifications.length > 1 ? (o(), l("button", {
2431
+ t("div", wn, [
2432
+ e[51] || (e[51] = t("label", null, "Certificate Image *", -1)),
2433
+ t("div", kn, [
2434
+ t("input", {
2435
+ type: "file",
2436
+ id: "cert-image-" + m,
2437
+ onChange: (y) => o.handleCertImageUpload(y, m),
2438
+ accept: "image/*,.pdf",
2439
+ class: "file-input"
2440
+ }, null, 40, Cn),
2441
+ t("label", {
2442
+ for: "cert-image-" + m,
2443
+ class: "file-input-label"
2444
+ }, [
2445
+ e[48] || (e[48] = t("i", { class: "bi bi-cloud-upload" }, null, -1)),
2446
+ w(" " + a(i.imagePreview ? "Change File" : "Upload File"), 1)
2447
+ ], 8, _n),
2448
+ i.imagePreview ? (l(), r("div", Dn, [
2449
+ i.imageType !== "pdf" ? (l(), r("img", {
2450
+ key: 0,
2451
+ src: i.imagePreview,
2452
+ alt: "Certificate preview"
2453
+ }, null, 8, xn)) : (l(), r("div", Sn, [
2454
+ e[49] || (e[49] = t("i", { class: "bi bi-file-pdf" }, null, -1)),
2455
+ t("span", null, a(i.imageName), 1)
2456
+ ])),
2457
+ t("button", {
2458
+ type: "button",
2459
+ class: "btn-remove-image",
2460
+ onClick: (y) => o.removeCertImage(m)
2461
+ }, e[50] || (e[50] = [
2462
+ t("i", { class: "bi bi-x-circle" }, null, -1)
2463
+ ]), 8, An)
2464
+ ])) : c("", !0),
2465
+ i.imageName ? (l(), r("small", Pn, a(i.imageName), 1)) : c("", !0)
2466
+ ])
2467
+ ]),
2468
+ t("div", Tn, [
2469
+ n.newCrew.certifications.length > 1 ? (l(), r("button", {
2026
2470
  key: 0,
2027
2471
  type: "button",
2028
2472
  class: "btn btn-danger btn-sm",
2029
- onClick: (y) => a.removeCertification(f)
2030
- }, " Remove ", 8, Ui)) : m("", !0)
2473
+ onClick: (y) => o.removeCertification(m)
2474
+ }, " Remove ", 8, qn)) : c("", !0)
2031
2475
  ])
2032
2476
  ])
2033
2477
  ]))), 128)),
2034
- e("button", {
2478
+ t("button", {
2035
2479
  type: "button",
2036
2480
  class: "btn btn-secondary btn-sm",
2037
- onClick: t[10] || (t[10] = (...i) => a.addCertificationEntry && a.addCertificationEntry(...i))
2481
+ onClick: e[18] || (e[18] = (...i) => o.addCertificationEntry && o.addCertificationEntry(...i))
2038
2482
  }, " + Add More Certification ")
2039
2483
  ]),
2040
- e("div", Li, [
2041
- e("div", $i, [
2042
- t[27] || (t[27] = e("label", { for: "crew-notes" }, "Notes", -1)),
2043
- v(e("textarea", {
2484
+ t("div", In, [
2485
+ t("div", Fn, [
2486
+ e[53] || (e[53] = t("label", { for: "crew-notes" }, "Notes", -1)),
2487
+ h(t("textarea", {
2044
2488
  id: "crew-notes",
2045
2489
  rows: "3",
2046
- "onUpdate:modelValue": t[11] || (t[11] = (i) => n.newCrew.notes = i)
2490
+ "onUpdate:modelValue": e[19] || (e[19] = (i) => n.newCrew.notes = i)
2047
2491
  }, null, 512), [
2048
2492
  [k, n.newCrew.notes]
2049
2493
  ])
2050
2494
  ])
2051
2495
  ]),
2052
- e("div", ji, [
2053
- e("button", {
2496
+ t("div", Rn, [
2497
+ t("button", {
2054
2498
  class: "btn btn-secondary",
2055
- onClick: t[12] || (t[12] = (...i) => a.handleCancelForm && a.handleCancelForm(...i))
2499
+ onClick: e[20] || (e[20] = (...i) => o.handleCancelForm && o.handleCancelForm(...i))
2056
2500
  }, "Cancel"),
2057
- e("button", {
2501
+ t("button", {
2058
2502
  class: "btn btn-primary",
2059
- onClick: t[13] || (t[13] = (...i) => a.handleAddCrewMember && a.handleAddCrewMember(...i))
2503
+ onClick: e[21] || (e[21] = (...i) => o.handleAddCrewMember && o.handleAddCrewMember(...i))
2060
2504
  }, "Add Crew Member")
2061
2505
  ])
2062
- ])) : m("", !0)
2506
+ ])) : c("", !0)
2063
2507
  ])
2064
2508
  ]);
2065
2509
  }
2066
- const Hi = /* @__PURE__ */ S(ti, [["render", Bi]]);
2067
- const Qi = {
2510
+ const Mn = /* @__PURE__ */ S(oi, [["render", Vn]]);
2511
+ const Nn = {
2068
2512
  name: "RequisitionSystem",
2069
2513
  props: {
2070
2514
  userProfile: {
@@ -2105,7 +2549,7 @@ const Qi = {
2105
2549
  { name: "new-requisition", label: "New Requisition", roles: ["requisitor"] },
2106
2550
  { name: "my-requisitions", label: "My Requisitions", roles: ["requisitor"] },
2107
2551
  { name: "all-requisitions", label: "All Requisitions", roles: ["requisitor", "supervisor", "captain", "owner", "purchaser"] },
2108
- { name: "approvals", label: "Pending Approvals", roles: ["owner", "supervisor", "captain"] },
2552
+ { name: "approvals", label: "Pending Approvals", roles: ["owner", "supervisor"] },
2109
2553
  { name: "purchasing", label: "Purchasing Queue", roles: ["purchaser"] },
2110
2554
  { name: "receiving", label: "Receiving", roles: ["requisitor"] },
2111
2555
  { name: "workflow", label: "Workflow Guide", roles: ["requisitor", "supervisor", "owner", "purchaser", "captain"] }
@@ -2173,7 +2617,7 @@ const Qi = {
2173
2617
  return this.tabs.filter((s) => s.roles.includes(this.userRole));
2174
2618
  },
2175
2619
  subTotal() {
2176
- return (this.poDetails.items || []).reduce((s, t) => s + t.unitPrice * t.qty, 0);
2620
+ return (this.poDetails.items || []).reduce((s, e) => s + e.unitPrice * e.qty, 0);
2177
2621
  },
2178
2622
  reviewRequisitions() {
2179
2623
  return this.requisitions.filter((s) => s.status === "under-review");
@@ -2189,7 +2633,7 @@ const Qi = {
2189
2633
  },
2190
2634
  myRequisitions() {
2191
2635
  const s = this.userProfile.id || this.userProfile.profile_id;
2192
- return this.requisitions.filter((t) => t.profile_id == s);
2636
+ return this.requisitions.filter((e) => e.profile_id == s);
2193
2637
  }
2194
2638
  },
2195
2639
  methods: {
@@ -2200,8 +2644,8 @@ const Qi = {
2200
2644
  return typeof s == "number" ? s.toFixed(2) : "0.00";
2201
2645
  },
2202
2646
  getRequisitionFields(s) {
2203
- const t = this.requisitionFieldsMap[s.status] || [];
2204
- return [...this.requisitionFields || [], ...t];
2647
+ const e = this.requisitionFieldsMap[s.status] || [];
2648
+ return [...this.requisitionFields || [], ...e];
2205
2649
  },
2206
2650
  addItem() {
2207
2651
  this.form.items.push({
@@ -2222,8 +2666,8 @@ const Qi = {
2222
2666
  this.poDetails.items[s].editing = !1, this.poDetails.items[s].tempPrice = this.poDetails.items[s].unitPrice;
2223
2667
  },
2224
2668
  savePrice(s) {
2225
- const t = this.poDetails.items[s];
2226
- t.tempPrice !== t.cost ? (this.currentItemIndex = s, this.showJustificationModal = !0) : (t.unitPrice = t.tempPrice, t.editing = !1);
2669
+ const e = this.poDetails.items[s];
2670
+ e.tempPrice !== e.cost ? (this.currentItemIndex = s, this.showJustificationModal = !0) : (e.unitPrice = e.tempPrice, e.editing = !1);
2227
2671
  },
2228
2672
  confirmPriceChange() {
2229
2673
  if (!this.justificationText.trim()) {
@@ -2277,7 +2721,7 @@ const Qi = {
2277
2721
  project: this.form.project,
2278
2722
  neededDate: this.form.neededDate,
2279
2723
  justification: this.form.justification,
2280
- items: this.form.items.map((t) => ({ ...t })),
2724
+ items: this.form.items.map((e) => ({ ...e })),
2281
2725
  status: s,
2282
2726
  submittedDate: (/* @__PURE__ */ new Date()).toLocaleDateString(),
2283
2727
  profile_id: this.userProfile.id || this.userProfile.profile_id
@@ -2296,8 +2740,8 @@ const Qi = {
2296
2740
  // Methods for updating PO details from parent
2297
2741
  updatePODetails(s) {
2298
2742
  this.poDetails = s, this.getNumber();
2299
- for (let t of this.poDetails.items)
2300
- t.tempPrice = t.cost, t.unitPrice = t.cost, t.subTotal = t.unitPrice * t.qty;
2743
+ for (let e of this.poDetails.items)
2744
+ e.tempPrice = e.cost, e.unitPrice = e.cost, e.subTotal = e.unitPrice * e.qty;
2301
2745
  },
2302
2746
  updateVendorInfo(s) {
2303
2747
  this.vendorInfo = s;
@@ -2306,640 +2750,640 @@ const Qi = {
2306
2750
  this.isPrinting = s;
2307
2751
  },
2308
2752
  getNumber() {
2309
- return (this.poDetails.items || []).map((s, t) => s.itemNumber = t + 1);
2753
+ return (this.poDetails.items || []).map((s, e) => s.itemNumber = e + 1);
2310
2754
  }
2311
2755
  },
2312
2756
  created() {
2313
2757
  this.addItem();
2314
2758
  }
2315
- }, Ji = { class: "s-container container" }, Wi = { class: "nav-tabs" }, Gi = ["onClick"], zi = {
2759
+ }, En = { class: "s-container container" }, Ln = { class: "nav-tabs" }, On = ["onClick"], Un = {
2316
2760
  key: 0,
2317
2761
  class: "tab-content active"
2318
- }, Yi = { class: "form-grid" }, Ki = { class: "form-group" }, Xi = ["value"], Zi = { class: "form-group" }, en = ["value"], tn = { class: "form-group" }, sn = ["value"], nn = { class: "form-group" }, on = { class: "form-group" }, ln = { class: "items-section" }, rn = { class: "items-header" }, an = { class: "form-group" }, dn = ["onUpdate:modelValue"], un = { class: "form-group" }, cn = ["onUpdate:modelValue"], mn = { class: "form-group" }, vn = ["onUpdate:modelValue"], pn = { class: "form-group" }, fn = ["onUpdate:modelValue"], hn = ["value"], gn = { class: "form-group" }, bn = ["onUpdate:modelValue"], yn = ["onClick"], wn = {
2762
+ }, $n = { class: "form-grid" }, jn = { class: "form-group" }, Bn = ["value"], Hn = { class: "form-group" }, Qn = ["value"], Jn = { class: "form-group" }, Wn = ["value"], Kn = { class: "form-group" }, zn = { class: "form-group" }, Gn = { class: "items-section" }, Yn = { class: "items-header" }, Xn = { class: "form-group" }, Zn = ["onUpdate:modelValue"], eo = { class: "form-group" }, to = ["onUpdate:modelValue"], so = { class: "form-group" }, io = ["onUpdate:modelValue"], no = { class: "form-group" }, oo = ["onUpdate:modelValue"], lo = ["value"], ro = { class: "form-group" }, ao = ["onUpdate:modelValue"], uo = ["onClick"], co = {
2319
2763
  key: 1,
2320
2764
  class: "tab-content active"
2321
- }, kn = { class: "requisition-list" }, _n = { class: "requisition-header" }, Cn = { class: "requisition-id" }, Dn = { class: "requisition-details" }, xn = { class: "detail-label" }, Sn = { class: "detail-value" }, Pn = {
2765
+ }, mo = { class: "requisition-list" }, vo = { class: "requisition-header" }, po = { class: "requisition-id" }, ho = { class: "requisition-details" }, fo = { class: "detail-label" }, go = { class: "detail-value" }, bo = {
2322
2766
  key: 0,
2323
2767
  class: "form-group comments-section"
2324
- }, An = ["onClick"], qn = {
2768
+ }, yo = ["onClick"], wo = {
2325
2769
  key: 2,
2326
2770
  class: "tab-content active"
2327
- }, Tn = { class: "requisition-list" }, In = { class: "requisition-header" }, Rn = { class: "requisition-id" }, Mn = { class: "requisition-details" }, Vn = { class: "detail-label" }, Fn = { class: "detail-value" }, En = {
2771
+ }, ko = { class: "requisition-list" }, Co = { class: "requisition-header" }, _o = { class: "requisition-id" }, Do = { class: "requisition-details" }, xo = { class: "detail-label" }, So = { class: "detail-value" }, Ao = {
2328
2772
  key: 0,
2329
2773
  class: "form-group comments-section"
2330
- }, Nn = ["onClick"], On = {
2774
+ }, Po = ["onClick"], To = {
2331
2775
  key: 3,
2332
2776
  class: "tab-content active"
2333
- }, Un = {
2777
+ }, qo = {
2334
2778
  class: "requisition-list",
2335
2779
  id: "approvalsQueue"
2336
- }, Ln = { class: "requisition-header" }, $n = { class: "requisition-id" }, jn = { class: "requisition-details" }, Bn = { class: "detail-label" }, Hn = { class: "detail-value" }, Qn = { class: "detail-item" }, Jn = { class: "detail-value" }, Wn = { class: "detail-item" }, Gn = { class: "item-list" }, zn = ["onClick"], Yn = ["onClick"], Kn = ["onClick"], Xn = {
2780
+ }, Io = { class: "requisition-header" }, Fo = { class: "requisition-id" }, Ro = { class: "requisition-details" }, Vo = { class: "detail-label" }, Mo = { class: "detail-value" }, No = { class: "detail-item" }, Eo = { class: "detail-value" }, Lo = { class: "detail-item" }, Oo = { class: "item-list" }, Uo = ["onClick"], $o = ["onClick"], jo = ["onClick"], Bo = {
2337
2781
  key: 4,
2338
2782
  class: "tab-content active"
2339
- }, Zn = {
2783
+ }, Ho = {
2340
2784
  class: "requisition-list",
2341
2785
  id: "purchasingQueue"
2342
- }, eo = { class: "requisition-header" }, to = { class: "requisition-id" }, so = { class: "requisition-details" }, io = { class: "detail-label" }, no = { class: "detail-value" }, oo = { class: "detail-item" }, lo = { class: "detail-value" }, ro = { class: "detail-item" }, ao = { class: "item-list" }, uo = ["onClick"], co = {
2786
+ }, Qo = { class: "requisition-header" }, Jo = { class: "requisition-id" }, Wo = { class: "requisition-details" }, Ko = { class: "detail-label" }, zo = { class: "detail-value" }, Go = { class: "detail-item" }, Yo = { class: "detail-value" }, Xo = { class: "detail-item" }, Zo = { class: "item-list" }, el = ["onClick"], tl = {
2343
2787
  key: 5,
2344
2788
  class: "tab-content active"
2345
- }, mo = {
2789
+ }, sl = {
2346
2790
  class: "requisition-list",
2347
2791
  id: "receivingQueue"
2348
- }, vo = { class: "requisition-header" }, po = { class: "requisition-id" }, fo = { class: "requisition-details" }, ho = { class: "detail-label" }, go = { class: "detail-value" }, bo = { class: "detail-item" }, yo = { class: "detail-value" }, wo = { class: "detail-item" }, ko = { class: "item-list" }, _o = ["onClick"], Co = {
2792
+ }, il = { class: "requisition-header" }, nl = { class: "requisition-id" }, ol = { class: "requisition-details" }, ll = { class: "detail-label" }, rl = { class: "detail-value" }, al = { class: "detail-item" }, dl = { class: "detail-value" }, ul = { class: "detail-item" }, cl = { class: "item-list" }, ml = ["onClick"], vl = {
2349
2793
  key: 6,
2350
2794
  class: "tab-content active"
2351
- }, Do = {
2795
+ }, pl = {
2352
2796
  class: "po-content",
2353
2797
  id: "po-content"
2354
- }, xo = { class: "po-header" }, So = { class: "company-info" }, Po = { class: "info-row" }, Ao = { class: "info-value" }, qo = { class: "info-row" }, To = { class: "info-value" }, Io = { class: "info-row" }, Ro = { class: "info-value" }, Mo = { class: "info-row" }, Vo = { class: "info-value" }, Fo = { class: "info-row" }, Eo = { class: "info-value" }, No = { class: "company-info" }, Oo = { class: "info-row" }, Uo = { class: "info-value" }, Lo = { class: "info-row" }, $o = { class: "info-value" }, jo = { class: "info-row" }, Bo = { class: "info-value" }, Ho = { class: "info-row" }, Qo = { class: "info-value" }, Jo = { class: "info-row" }, Wo = { class: "info-value" }, Go = { class: "items-section" }, zo = { class: "items-table" }, Yo = { key: 0 }, Ko = { key: 0 }, Xo = {
2798
+ }, hl = { class: "po-header" }, fl = { class: "company-info" }, gl = { class: "info-row" }, bl = { class: "info-value" }, yl = { class: "info-row" }, wl = { class: "info-value" }, kl = { class: "info-row" }, Cl = { class: "info-value" }, _l = { class: "info-row" }, Dl = { class: "info-value" }, xl = { class: "info-row" }, Sl = { class: "info-value" }, Al = { class: "company-info" }, Pl = { class: "info-row" }, Tl = { class: "info-value" }, ql = { class: "info-row" }, Il = { class: "info-value" }, Fl = { class: "info-row" }, Rl = { class: "info-value" }, Vl = { class: "info-row" }, Ml = { class: "info-value" }, Nl = { class: "info-row" }, El = { class: "info-value" }, Ll = { class: "items-section" }, Ol = { class: "items-table" }, Ul = { key: 0 }, $l = { key: 0 }, jl = {
2355
2799
  key: 0,
2356
2800
  class: "price-change-indicator"
2357
- }, Zo = ["onUpdate:modelValue"], el = { key: 0 }, tl = ["onClick"], sl = { key: 1 }, il = ["onClick"], nl = ["onClick"], ol = {
2801
+ }, Bl = ["onUpdate:modelValue"], Hl = { key: 0 }, Ql = ["onClick"], Jl = { key: 1 }, Wl = ["onClick"], Kl = ["onClick"], zl = {
2358
2802
  key: 0,
2359
2803
  class: "justification-note"
2360
- }, ll = { class: "totals" }, rl = { class: "total-row" }, al = { class: "total-row" }, dl = { class: "total-row" }, ul = { class: "total-row grand-total" }, cl = { class: "modal-content" }, ml = { style: { "margin-bottom": "15px", color: "#666" } }, vl = { class: "modal-buttons" }, pl = ["disabled"], fl = {
2804
+ }, Gl = { class: "totals" }, Yl = { class: "total-row" }, Xl = { class: "total-row" }, Zl = { class: "total-row" }, er = { class: "total-row grand-total" }, tr = { class: "modal-content" }, sr = { style: { "margin-bottom": "15px", color: "#666" } }, ir = { class: "modal-buttons" }, nr = ["disabled"], or = {
2361
2805
  key: 7,
2362
2806
  class: "tab-content active"
2363
2807
  };
2364
- function hl(s, t, u, b, n, a) {
2365
- var i, f, y, A, q, T, I, R, M, V, F;
2366
- return o(), l("div", Ji, [
2367
- t[62] || (t[62] = e("div", { class: "header" }, [
2368
- e("h1", null, "OceanHelm Requisition System"),
2369
- e("p", null, "Streamlined Material Request & Ordering Process")
2808
+ function lr(s, e, d, p, n, o) {
2809
+ var i, m, y, P, T, q, I, F, R, V, M;
2810
+ return l(), r("div", En, [
2811
+ e[62] || (e[62] = t("div", { class: "header" }, [
2812
+ t("h1", null, "OceanHelm Requisition System"),
2813
+ t("p", null, "Streamlined Material Request & Ordering Process")
2370
2814
  ], -1)),
2371
- e("div", Wi, [
2372
- (o(!0), l(p, null, h(a.visibleTabs, (d) => (o(), l("button", {
2373
- key: d.name,
2374
- class: g(["nav-tab", { active: n.activeTab === d.name }]),
2375
- onClick: (c) => a.setActiveTab(d.name)
2376
- }, r(d.label), 11, Gi))), 128))
2815
+ t("div", Ln, [
2816
+ (l(!0), r(f, null, g(o.visibleTabs, (u) => (l(), r("button", {
2817
+ key: u.name,
2818
+ class: b(["nav-tab", { active: n.activeTab === u.name }]),
2819
+ onClick: (v) => o.setActiveTab(u.name)
2820
+ }, a(u.label), 11, On))), 128))
2377
2821
  ]),
2378
- n.activeTab === "new-requisition" ? (o(), l("div", zi, [
2379
- e("form", {
2380
- onSubmit: t[5] || (t[5] = D((...d) => a.handleSubmitRequisition && a.handleSubmitRequisition(...d), ["prevent"]))
2822
+ n.activeTab === "new-requisition" ? (l(), r("div", Un, [
2823
+ t("form", {
2824
+ onSubmit: e[5] || (e[5] = D((...u) => o.handleSubmitRequisition && o.handleSubmitRequisition(...u), ["prevent"]))
2381
2825
  }, [
2382
- e("div", Yi, [
2383
- e("div", Ki, [
2384
- t[12] || (t[12] = e("label", null, "Requestor Name *", -1)),
2385
- e("input", {
2826
+ t("div", $n, [
2827
+ t("div", jn, [
2828
+ e[12] || (e[12] = t("label", null, "Requestor Name *", -1)),
2829
+ t("input", {
2386
2830
  type: "text",
2387
- value: u.userProfile.full_name,
2831
+ value: d.userProfile.full_name,
2388
2832
  readonly: "",
2389
2833
  required: "",
2390
2834
  class: "form-control"
2391
- }, null, 8, Xi)
2835
+ }, null, 8, Bn)
2392
2836
  ]),
2393
- e("div", Zi, [
2394
- t[14] || (t[14] = e("label", null, "Department *", -1)),
2395
- v(e("select", {
2396
- "onUpdate:modelValue": t[0] || (t[0] = (d) => n.form.department = d),
2837
+ t("div", Hn, [
2838
+ e[14] || (e[14] = t("label", null, "Department *", -1)),
2839
+ h(t("select", {
2840
+ "onUpdate:modelValue": e[0] || (e[0] = (u) => n.form.department = u),
2397
2841
  required: ""
2398
2842
  }, [
2399
- t[13] || (t[13] = e("option", { value: "" }, "Select Department", -1)),
2400
- (o(!0), l(p, null, h(n.departments, (d) => (o(), l("option", {
2401
- key: d,
2402
- value: d
2403
- }, r(d), 9, en))), 128))
2843
+ e[13] || (e[13] = t("option", { value: "" }, "Select Department", -1)),
2844
+ (l(!0), r(f, null, g(n.departments, (u) => (l(), r("option", {
2845
+ key: u,
2846
+ value: u
2847
+ }, a(u), 9, Qn))), 128))
2404
2848
  ], 512), [
2405
- [C, n.form.department]
2849
+ [_, n.form.department]
2406
2850
  ])
2407
2851
  ]),
2408
- e("div", tn, [
2409
- t[16] || (t[16] = e("label", null, "Vessel *", -1)),
2410
- v(e("select", {
2411
- "onUpdate:modelValue": t[1] || (t[1] = (d) => n.form.project = d),
2852
+ t("div", Jn, [
2853
+ e[16] || (e[16] = t("label", null, "Vessel *", -1)),
2854
+ h(t("select", {
2855
+ "onUpdate:modelValue": e[1] || (e[1] = (u) => n.form.project = u),
2412
2856
  class: "form-control",
2413
2857
  required: ""
2414
2858
  }, [
2415
- t[15] || (t[15] = e("option", {
2859
+ e[15] || (e[15] = t("option", {
2416
2860
  disabled: "",
2417
2861
  value: ""
2418
2862
  }, "Select a vessel", -1)),
2419
- (o(!0), l(p, null, h(u.vessels, (d) => (o(), l("option", {
2420
- key: d.id,
2421
- value: d.name
2422
- }, r(d.name), 9, sn))), 128))
2863
+ (l(!0), r(f, null, g(d.vessels, (u) => (l(), r("option", {
2864
+ key: u.id,
2865
+ value: u.name
2866
+ }, a(u.name), 9, Wn))), 128))
2423
2867
  ], 512), [
2424
- [C, n.form.project]
2868
+ [_, n.form.project]
2425
2869
  ])
2426
2870
  ]),
2427
- e("div", nn, [
2428
- t[17] || (t[17] = e("label", null, "Date Needed *", -1)),
2429
- v(e("input", {
2871
+ t("div", Kn, [
2872
+ e[17] || (e[17] = t("label", null, "Date Needed *", -1)),
2873
+ h(t("input", {
2430
2874
  type: "date",
2431
- "onUpdate:modelValue": t[2] || (t[2] = (d) => n.form.neededDate = d),
2875
+ "onUpdate:modelValue": e[2] || (e[2] = (u) => n.form.neededDate = u),
2432
2876
  required: ""
2433
2877
  }, null, 512), [
2434
2878
  [k, n.form.neededDate]
2435
2879
  ])
2436
2880
  ])
2437
2881
  ]),
2438
- e("div", on, [
2439
- t[18] || (t[18] = e("label", null, "Business Justification *", -1)),
2440
- v(e("textarea", {
2441
- "onUpdate:modelValue": t[3] || (t[3] = (d) => n.form.justification = d),
2882
+ t("div", zn, [
2883
+ e[18] || (e[18] = t("label", null, "Business Justification *", -1)),
2884
+ h(t("textarea", {
2885
+ "onUpdate:modelValue": e[3] || (e[3] = (u) => n.form.justification = u),
2442
2886
  placeholder: "Explain why these materials are needed...",
2443
2887
  required: ""
2444
2888
  }, null, 512), [
2445
2889
  [k, n.form.justification]
2446
2890
  ])
2447
2891
  ]),
2448
- e("div", ln, [
2449
- e("div", rn, [
2450
- t[19] || (t[19] = e("h3", null, "Requested Items", -1)),
2451
- e("button", {
2892
+ t("div", Gn, [
2893
+ t("div", Yn, [
2894
+ e[19] || (e[19] = t("h3", null, "Requested Items", -1)),
2895
+ t("button", {
2452
2896
  type: "button",
2453
2897
  class: "add-item-btn",
2454
- onClick: t[4] || (t[4] = (...d) => a.addItem && a.addItem(...d))
2898
+ onClick: e[4] || (e[4] = (...u) => o.addItem && o.addItem(...u))
2455
2899
  }, "+ Add Item")
2456
2900
  ]),
2457
- e("div", null, [
2458
- (o(!0), l(p, null, h(n.form.items, (d, c) => (o(), l("div", {
2459
- key: c,
2901
+ t("div", null, [
2902
+ (l(!0), r(f, null, g(n.form.items, (u, v) => (l(), r("div", {
2903
+ key: v,
2460
2904
  class: "item-row"
2461
2905
  }, [
2462
- e("div", an, [
2463
- t[20] || (t[20] = e("label", null, "Item Code *", -1)),
2464
- v(e("input", {
2906
+ t("div", Xn, [
2907
+ e[20] || (e[20] = t("label", null, "Item Code *", -1)),
2908
+ h(t("input", {
2465
2909
  type: "text",
2466
- "onUpdate:modelValue": (w) => d.id = w,
2910
+ "onUpdate:modelValue": (C) => u.id = C,
2467
2911
  required: ""
2468
- }, null, 8, dn), [
2469
- [k, d.id]
2912
+ }, null, 8, Zn), [
2913
+ [k, u.id]
2470
2914
  ])
2471
2915
  ]),
2472
- e("div", un, [
2473
- t[21] || (t[21] = e("label", null, "Item Description *", -1)),
2474
- v(e("input", {
2916
+ t("div", eo, [
2917
+ e[21] || (e[21] = t("label", null, "Item Description *", -1)),
2918
+ h(t("input", {
2475
2919
  type: "text",
2476
- "onUpdate:modelValue": (w) => d.desc = w,
2920
+ "onUpdate:modelValue": (C) => u.desc = C,
2477
2921
  required: ""
2478
- }, null, 8, cn), [
2479
- [k, d.desc]
2922
+ }, null, 8, to), [
2923
+ [k, u.desc]
2480
2924
  ])
2481
2925
  ]),
2482
- e("div", mn, [
2483
- t[22] || (t[22] = e("label", null, "Quantity *", -1)),
2484
- v(e("input", {
2926
+ t("div", so, [
2927
+ e[22] || (e[22] = t("label", null, "Quantity *", -1)),
2928
+ h(t("input", {
2485
2929
  type: "number",
2486
- "onUpdate:modelValue": (w) => d.qty = w,
2930
+ "onUpdate:modelValue": (C) => u.qty = C,
2487
2931
  min: "1",
2488
2932
  required: ""
2489
- }, null, 8, vn), [
2933
+ }, null, 8, io), [
2490
2934
  [
2491
2935
  k,
2492
- d.qty,
2936
+ u.qty,
2493
2937
  void 0,
2494
2938
  { number: !0 }
2495
2939
  ]
2496
2940
  ])
2497
2941
  ]),
2498
- e("div", pn, [
2499
- t[23] || (t[23] = e("label", null, "Unit *", -1)),
2500
- v(e("select", {
2501
- "onUpdate:modelValue": (w) => d.unit = w,
2942
+ t("div", no, [
2943
+ e[23] || (e[23] = t("label", null, "Unit *", -1)),
2944
+ h(t("select", {
2945
+ "onUpdate:modelValue": (C) => u.unit = C,
2502
2946
  required: ""
2503
2947
  }, [
2504
- (o(!0), l(p, null, h(n.units, (w) => (o(), l("option", {
2505
- key: w,
2506
- value: w
2507
- }, r(w), 9, hn))), 128))
2508
- ], 8, fn), [
2509
- [C, d.unit]
2948
+ (l(!0), r(f, null, g(n.units, (C) => (l(), r("option", {
2949
+ key: C,
2950
+ value: C
2951
+ }, a(C), 9, lo))), 128))
2952
+ ], 8, oo), [
2953
+ [_, u.unit]
2510
2954
  ])
2511
2955
  ]),
2512
- e("div", gn, [
2513
- t[24] || (t[24] = e("label", null, "Est. Unit Cost *", -1)),
2514
- v(e("input", {
2956
+ t("div", ro, [
2957
+ e[24] || (e[24] = t("label", null, "Est. Unit Cost *", -1)),
2958
+ h(t("input", {
2515
2959
  type: "number",
2516
- "onUpdate:modelValue": (w) => d.cost = w,
2960
+ "onUpdate:modelValue": (C) => u.cost = C,
2517
2961
  step: "0.01",
2518
2962
  placeholder: "0.00",
2519
2963
  required: ""
2520
- }, null, 8, bn), [
2964
+ }, null, 8, ao), [
2521
2965
  [
2522
2966
  k,
2523
- d.cost,
2967
+ u.cost,
2524
2968
  void 0,
2525
2969
  { number: !0 }
2526
2970
  ]
2527
2971
  ])
2528
2972
  ]),
2529
- e("button", {
2973
+ t("button", {
2530
2974
  type: "button",
2531
2975
  class: "remove-item-btn",
2532
- onClick: (w) => a.removeItem(c)
2533
- }, "Remove", 8, yn)
2976
+ onClick: (C) => o.removeItem(v)
2977
+ }, "Remove", 8, uo)
2534
2978
  ]))), 128))
2535
2979
  ])
2536
2980
  ]),
2537
- t[25] || (t[25] = e("div", { class: "action-buttons" }, [
2538
- e("button", {
2981
+ e[25] || (e[25] = t("div", { class: "action-buttons" }, [
2982
+ t("button", {
2539
2983
  type: "submit",
2540
2984
  class: "btn btn-primary-req"
2541
2985
  }, "Submit Requisition")
2542
2986
  ], -1))
2543
2987
  ], 32)
2544
- ])) : m("", !0),
2545
- n.activeTab === "all-requisitions" ? (o(), l("div", wn, [
2546
- e("div", kn, [
2547
- (o(!0), l(p, null, h(u.requisitions, (d) => (o(), l("div", {
2548
- key: d.id,
2988
+ ])) : c("", !0),
2989
+ n.activeTab === "all-requisitions" ? (l(), r("div", co, [
2990
+ t("div", mo, [
2991
+ (l(!0), r(f, null, g(d.requisitions, (u) => (l(), r("div", {
2992
+ key: u.id,
2549
2993
  class: "requisition-card"
2550
2994
  }, [
2551
- e("div", _n, [
2552
- e("div", Cn, r(d.id), 1),
2553
- e("div", {
2554
- class: g(["status-badge", `status-${d.status}`])
2555
- }, r(d.status), 3)
2995
+ t("div", vo, [
2996
+ t("div", po, a(u.id), 1),
2997
+ t("div", {
2998
+ class: b(["status-badge", `status-${u.status}`])
2999
+ }, a(u.status), 3)
2556
3000
  ]),
2557
- e("div", Dn, [
2558
- (o(!0), l(p, null, h(a.getRequisitionFields(d), (c) => (o(), l("div", {
3001
+ t("div", ho, [
3002
+ (l(!0), r(f, null, g(o.getRequisitionFields(u), (v) => (l(), r("div", {
2559
3003
  class: "detail-item",
2560
- key: c.label
3004
+ key: v.label
2561
3005
  }, [
2562
- e("div", xn, r(c.label), 1),
2563
- e("div", Sn, r(c.value(d)), 1)
3006
+ t("div", fo, a(v.label), 1),
3007
+ t("div", go, a(v.value(u)), 1)
2564
3008
  ]))), 128))
2565
3009
  ]),
2566
- d.status === "po-created" || d.status === "delivered" ? (o(), l("div", Pn, [
2567
- e("button", {
2568
- onClick: (c) => a.handleOpenPO(d.id),
3010
+ u.status === "po-created" || u.status === "delivered" ? (l(), r("div", bo, [
3011
+ t("button", {
3012
+ onClick: (v) => o.handleOpenPO(u.id),
2569
3013
  class: "add-item-btn comments-section"
2570
- }, " Print PO ", 8, An)
2571
- ])) : m("", !0)
3014
+ }, " Print PO ", 8, yo)
3015
+ ])) : c("", !0)
2572
3016
  ]))), 128))
2573
3017
  ])
2574
- ])) : m("", !0),
2575
- n.activeTab === "my-requisitions" ? (o(), l("div", qn, [
2576
- e("div", Tn, [
2577
- (o(!0), l(p, null, h(a.myRequisitions, (d) => (o(), l("div", {
2578
- key: d.id,
3018
+ ])) : c("", !0),
3019
+ n.activeTab === "my-requisitions" ? (l(), r("div", wo, [
3020
+ t("div", ko, [
3021
+ (l(!0), r(f, null, g(o.myRequisitions, (u) => (l(), r("div", {
3022
+ key: u.id,
2579
3023
  class: "requisition-card"
2580
3024
  }, [
2581
- e("div", In, [
2582
- e("div", Rn, r(d.id), 1),
2583
- e("div", {
2584
- class: g(["status-badge", `status-${d.status}`])
2585
- }, r(d.status), 3)
3025
+ t("div", Co, [
3026
+ t("div", _o, a(u.id), 1),
3027
+ t("div", {
3028
+ class: b(["status-badge", `status-${u.status}`])
3029
+ }, a(u.status), 3)
2586
3030
  ]),
2587
- e("div", Mn, [
2588
- (o(!0), l(p, null, h(a.getRequisitionFields(d), (c) => (o(), l("div", {
3031
+ t("div", Do, [
3032
+ (l(!0), r(f, null, g(o.getRequisitionFields(u), (v) => (l(), r("div", {
2589
3033
  class: "detail-item",
2590
- key: c.label
3034
+ key: v.label
2591
3035
  }, [
2592
- e("div", Vn, r(c.label), 1),
2593
- e("div", Fn, r(c.value(d)), 1)
3036
+ t("div", xo, a(v.label), 1),
3037
+ t("div", So, a(v.value(u)), 1)
2594
3038
  ]))), 128))
2595
3039
  ]),
2596
- d.status === "info-requested" ? (o(), l("div", En, [
2597
- t[26] || (t[26] = e("label", { class: "detail-label" }, "Your Response", -1)),
2598
- v(e("textarea", {
2599
- "onUpdate:modelValue": t[6] || (t[6] = (c) => n.infoResponse = c),
3040
+ u.status === "info-requested" ? (l(), r("div", Ao, [
3041
+ e[26] || (e[26] = t("label", { class: "detail-label" }, "Your Response", -1)),
3042
+ h(t("textarea", {
3043
+ "onUpdate:modelValue": e[6] || (e[6] = (v) => n.infoResponse = v),
2600
3044
  class: "response-textarea",
2601
3045
  placeholder: "Submit more info..."
2602
3046
  }, null, 512), [
2603
3047
  [k, n.infoResponse]
2604
3048
  ]),
2605
- e("button", {
2606
- onClick: (c) => a.handleSubmitInfoResponse(d),
3049
+ t("button", {
3050
+ onClick: (v) => o.handleSubmitInfoResponse(u),
2607
3051
  class: "add-item-btn comments-section"
2608
- }, " Submit Info ", 8, Nn)
2609
- ])) : m("", !0)
3052
+ }, " Submit Info ", 8, Po)
3053
+ ])) : c("", !0)
2610
3054
  ]))), 128))
2611
3055
  ])
2612
- ])) : m("", !0),
2613
- n.activeTab === "approvals" ? (o(), l("div", On, [
2614
- t[29] || (t[29] = e("div", { style: { "margin-bottom": "20px" } }, [
2615
- e("h3", { style: { color: "#1e40af", "margin-bottom": "15px" } }, "Department Supervisor Dashboard"),
2616
- e("div", { style: { background: "#fef3c7", padding: "15px", "border-radius": "10px", "border-left": "4px solid #f59e0b" } }, [
2617
- e("strong", null, "Role:"),
2618
- _(" Department Supervisor - Review requests for accuracy, necessity, and budget compliance ")
3056
+ ])) : c("", !0),
3057
+ n.activeTab === "approvals" ? (l(), r("div", To, [
3058
+ e[29] || (e[29] = t("div", { style: { "margin-bottom": "20px" } }, [
3059
+ t("h3", { style: { color: "#1e40af", "margin-bottom": "15px" } }, "Department Supervisor Dashboard"),
3060
+ t("div", { style: { background: "#fef3c7", padding: "15px", "border-radius": "10px", "border-left": "4px solid #f59e0b" } }, [
3061
+ t("strong", null, "Role:"),
3062
+ w(" Department Supervisor - Review requests for accuracy, necessity, and budget compliance ")
2619
3063
  ])
2620
3064
  ], -1)),
2621
- e("div", Un, [
2622
- (o(!0), l(p, null, h(a.reviewRequisitions, (d) => (o(), l("div", {
2623
- key: d.id,
3065
+ t("div", qo, [
3066
+ (l(!0), r(f, null, g(o.reviewRequisitions, (u) => (l(), r("div", {
3067
+ key: u.id,
2624
3068
  class: "requisition-card"
2625
3069
  }, [
2626
- e("div", Ln, [
2627
- e("div", $n, r(d.id), 1)
3070
+ t("div", Io, [
3071
+ t("div", Fo, a(u.id), 1)
2628
3072
  ]),
2629
- e("div", jn, [
2630
- (o(!0), l(p, null, h(n.requisitionFields, (c) => (o(), l("div", {
3073
+ t("div", Ro, [
3074
+ (l(!0), r(f, null, g(n.requisitionFields, (v) => (l(), r("div", {
2631
3075
  class: "detail-item",
2632
- key: c.label
3076
+ key: v.label
2633
3077
  }, [
2634
- e("div", Bn, r(c.label), 1),
2635
- e("div", Hn, r(c.value(d)), 1)
3078
+ t("div", Vo, a(v.label), 1),
3079
+ t("div", Mo, a(v.value(u)), 1)
2636
3080
  ]))), 128))
2637
3081
  ]),
2638
- e("div", Qn, [
2639
- t[27] || (t[27] = e("div", { class: "detail-label" }, "Justification", -1)),
2640
- e("div", Jn, r(d.justification || "N/A"), 1)
3082
+ t("div", No, [
3083
+ e[27] || (e[27] = t("div", { class: "detail-label" }, "Justification", -1)),
3084
+ t("div", Eo, a(u.justification || "N/A"), 1)
2641
3085
  ]),
2642
- e("div", Wn, [
2643
- t[28] || (t[28] = e("div", { class: "detail-label" }, "Items", -1)),
2644
- e("ul", Gn, [
2645
- (o(!0), l(p, null, h(d.items, (c, w) => (o(), l("li", { key: w }, r(c.desc) + " - " + r(c.qty) + " " + r(c.unit) + " @ ₦" + r(c.cost.toFixed(2)) + " each ", 1))), 128))
3086
+ t("div", Lo, [
3087
+ e[28] || (e[28] = t("div", { class: "detail-label" }, "Items", -1)),
3088
+ t("ul", Oo, [
3089
+ (l(!0), r(f, null, g(u.items, (v, C) => (l(), r("li", { key: C }, a(v.desc) + " - " + a(v.qty) + " " + a(v.unit) + " @ ₦" + a(v.cost.toFixed(2)) + " each ", 1))), 128))
2646
3090
  ])
2647
3091
  ]),
2648
- e("button", {
3092
+ t("button", {
2649
3093
  type: "button",
2650
3094
  class: "add-item-btn",
2651
- onClick: (c) => a.handleApproveRequisition(d.id)
2652
- }, "Approve", 8, zn),
2653
- e("button", {
3095
+ onClick: (v) => o.handleApproveRequisition(u.id)
3096
+ }, "Approve", 8, Uo),
3097
+ t("button", {
2654
3098
  type: "button",
2655
3099
  class: "marginbox btn-reject",
2656
- onClick: (c) => a.handleDeclineRequisition(d.id)
2657
- }, "Decline", 8, Yn),
2658
- e("button", {
3100
+ onClick: (v) => o.handleDeclineRequisition(u.id)
3101
+ }, "Decline", 8, $o),
3102
+ t("button", {
2659
3103
  type: "button",
2660
3104
  class: "marginbox btn-request",
2661
- onClick: (c) => a.handleInfoRequisition(d.id)
2662
- }, "Request Info", 8, Kn)
3105
+ onClick: (v) => o.handleInfoRequisition(u.id)
3106
+ }, "Request Info", 8, jo)
2663
3107
  ]))), 128))
2664
3108
  ])
2665
- ])) : m("", !0),
2666
- n.activeTab === "purchasing" ? (o(), l("div", Xn, [
2667
- t[32] || (t[32] = e("div", { style: { "margin-bottom": "20px" } }, [
2668
- e("h3", { style: { color: "#1e40af", "margin-bottom": "15px" } }, "Purchasing Department Dashboard"),
2669
- e("div", { style: { background: "#dbeafe", padding: "15px", "border-radius": "10px", "border-left": "4px solid #3b82f6" } }, [
2670
- e("strong", null, "Role:"),
2671
- _(" Purchasing Team - Convert approved requisitions to Purchase Orders ")
3109
+ ])) : c("", !0),
3110
+ n.activeTab === "purchasing" ? (l(), r("div", Bo, [
3111
+ e[32] || (e[32] = t("div", { style: { "margin-bottom": "20px" } }, [
3112
+ t("h3", { style: { color: "#1e40af", "margin-bottom": "15px" } }, "Purchasing Department Dashboard"),
3113
+ t("div", { style: { background: "#dbeafe", padding: "15px", "border-radius": "10px", "border-left": "4px solid #3b82f6" } }, [
3114
+ t("strong", null, "Role:"),
3115
+ w(" Purchasing Team - Convert approved requisitions to Purchase Orders ")
2672
3116
  ])
2673
3117
  ], -1)),
2674
- e("div", Zn, [
2675
- (o(!0), l(p, null, h(a.poRequisitions, (d) => (o(), l("div", {
2676
- key: d.id,
3118
+ t("div", Ho, [
3119
+ (l(!0), r(f, null, g(o.poRequisitions, (u) => (l(), r("div", {
3120
+ key: u.id,
2677
3121
  class: "requisition-card"
2678
3122
  }, [
2679
- e("div", eo, [
2680
- e("div", to, r(d.id), 1)
3123
+ t("div", Qo, [
3124
+ t("div", Jo, a(u.id), 1)
2681
3125
  ]),
2682
- e("div", so, [
2683
- (o(!0), l(p, null, h(n.requisitionFields, (c) => (o(), l("div", {
3126
+ t("div", Wo, [
3127
+ (l(!0), r(f, null, g(n.requisitionFields, (v) => (l(), r("div", {
2684
3128
  class: "detail-item",
2685
- key: c.label
3129
+ key: v.label
2686
3130
  }, [
2687
- e("div", io, r(c.label), 1),
2688
- e("div", no, r(c.value(d)), 1)
3131
+ t("div", Ko, a(v.label), 1),
3132
+ t("div", zo, a(v.value(u)), 1)
2689
3133
  ]))), 128))
2690
3134
  ]),
2691
- e("div", oo, [
2692
- t[30] || (t[30] = e("div", { class: "detail-label" }, "Justification", -1)),
2693
- e("div", lo, r(d.justification || "N/A"), 1)
3135
+ t("div", Go, [
3136
+ e[30] || (e[30] = t("div", { class: "detail-label" }, "Justification", -1)),
3137
+ t("div", Yo, a(u.justification || "N/A"), 1)
2694
3138
  ]),
2695
- e("div", ro, [
2696
- t[31] || (t[31] = e("div", { class: "detail-label" }, "Items", -1)),
2697
- e("ul", ao, [
2698
- (o(!0), l(p, null, h(d.items, (c, w) => (o(), l("li", { key: w }, r(c.desc) + " - " + r(c.qty) + " " + r(c.unit) + " @ ₦" + r(c.cost.toFixed(2)) + " each ", 1))), 128))
3139
+ t("div", Xo, [
3140
+ e[31] || (e[31] = t("div", { class: "detail-label" }, "Items", -1)),
3141
+ t("ul", Zo, [
3142
+ (l(!0), r(f, null, g(u.items, (v, C) => (l(), r("li", { key: C }, a(v.desc) + " - " + a(v.qty) + " " + a(v.unit) + " @ ₦" + a(v.cost.toFixed(2)) + " each ", 1))), 128))
2699
3143
  ])
2700
3144
  ]),
2701
- e("button", {
3145
+ t("button", {
2702
3146
  type: "button",
2703
3147
  class: "add-item-btn",
2704
- onClick: (c) => a.handleCreatePO(d.id)
2705
- }, "Create PO", 8, uo)
3148
+ onClick: (v) => o.handleCreatePO(u.id)
3149
+ }, "Create PO", 8, el)
2706
3150
  ]))), 128))
2707
3151
  ])
2708
- ])) : m("", !0),
2709
- n.activeTab === "receiving" ? (o(), l("div", co, [
2710
- t[35] || (t[35] = e("div", { style: { "margin-bottom": "20px" } }, [
2711
- e("h3", { style: { color: "#1e40af", "margin-bottom": "15px" } }, "Receiving & Inventory Dashboard"),
2712
- e("div", { style: { background: "#dcfce7", padding: "15px", "border-radius": "10px", "border-left": "4px solid #10b981" } }, [
2713
- e("strong", null, "Role:"),
2714
- _(" Warehouse Team - Process incoming deliveries and update inventory ")
3152
+ ])) : c("", !0),
3153
+ n.activeTab === "receiving" ? (l(), r("div", tl, [
3154
+ e[35] || (e[35] = t("div", { style: { "margin-bottom": "20px" } }, [
3155
+ t("h3", { style: { color: "#1e40af", "margin-bottom": "15px" } }, "Receiving & Inventory Dashboard"),
3156
+ t("div", { style: { background: "#dcfce7", padding: "15px", "border-radius": "10px", "border-left": "4px solid #10b981" } }, [
3157
+ t("strong", null, "Role:"),
3158
+ w(" Warehouse Team - Process incoming deliveries and update inventory ")
2715
3159
  ])
2716
3160
  ], -1)),
2717
- e("div", mo, [
2718
- (o(!0), l(p, null, h(a.awaitingDelivery, (d) => (o(), l("div", {
2719
- key: d.id,
3161
+ t("div", sl, [
3162
+ (l(!0), r(f, null, g(o.awaitingDelivery, (u) => (l(), r("div", {
3163
+ key: u.id,
2720
3164
  class: "requisition-card"
2721
3165
  }, [
2722
- e("div", vo, [
2723
- e("div", po, r(d.id), 1)
3166
+ t("div", il, [
3167
+ t("div", nl, a(u.id), 1)
2724
3168
  ]),
2725
- e("div", fo, [
2726
- (o(!0), l(p, null, h(n.requisitionFields, (c) => (o(), l("div", {
3169
+ t("div", ol, [
3170
+ (l(!0), r(f, null, g(n.requisitionFields, (v) => (l(), r("div", {
2727
3171
  class: "detail-item",
2728
- key: c.label
3172
+ key: v.label
2729
3173
  }, [
2730
- e("div", ho, r(c.label), 1),
2731
- e("div", go, r(c.value(d)), 1)
3174
+ t("div", ll, a(v.label), 1),
3175
+ t("div", rl, a(v.value(u)), 1)
2732
3176
  ]))), 128))
2733
3177
  ]),
2734
- e("div", bo, [
2735
- t[33] || (t[33] = e("div", { class: "detail-label" }, "Justification", -1)),
2736
- e("div", yo, r(d.justification || "N/A"), 1)
3178
+ t("div", al, [
3179
+ e[33] || (e[33] = t("div", { class: "detail-label" }, "Justification", -1)),
3180
+ t("div", dl, a(u.justification || "N/A"), 1)
2737
3181
  ]),
2738
- e("div", wo, [
2739
- t[34] || (t[34] = e("div", { class: "detail-label" }, "Items", -1)),
2740
- e("ul", ko, [
2741
- (o(!0), l(p, null, h(d.items, (c, w) => (o(), l("li", { key: w }, r(c.desc) + " - " + r(c.qty) + " " + r(c.unit) + " @ ₦" + r(c.cost.toFixed(2)) + " each ", 1))), 128))
3182
+ t("div", ul, [
3183
+ e[34] || (e[34] = t("div", { class: "detail-label" }, "Items", -1)),
3184
+ t("ul", cl, [
3185
+ (l(!0), r(f, null, g(u.items, (v, C) => (l(), r("li", { key: C }, a(v.desc) + " - " + a(v.qty) + " " + a(v.unit) + " @ ₦" + a(v.cost.toFixed(2)) + " each ", 1))), 128))
2742
3186
  ])
2743
3187
  ]),
2744
- e("button", {
3188
+ t("button", {
2745
3189
  type: "button",
2746
3190
  class: "add-item-btn",
2747
- onClick: (c) => a.handleAcceptDelivery(d.id)
2748
- }, "Accept Delivery", 8, _o)
3191
+ onClick: (v) => o.handleAcceptDelivery(u.id)
3192
+ }, "Accept Delivery", 8, ml)
2749
3193
  ]))), 128))
2750
3194
  ])
2751
- ])) : m("", !0),
2752
- n.activeTab === "po" ? (o(), l("div", Co, [
2753
- e("div", Do, [
2754
- e("div", xo, [
2755
- e("div", So, [
2756
- t[41] || (t[41] = e("h3", null, "Vendor Information", -1)),
2757
- e("div", Po, [
2758
- t[36] || (t[36] = e("span", { class: "info-label" }, "Company:", -1)),
2759
- e("span", Ao, r(n.vendorInfo.company || ((i = n.poDetails.vendorInfo) == null ? void 0 : i.company)), 1)
3195
+ ])) : c("", !0),
3196
+ n.activeTab === "po" ? (l(), r("div", vl, [
3197
+ t("div", pl, [
3198
+ t("div", hl, [
3199
+ t("div", fl, [
3200
+ e[41] || (e[41] = t("h3", null, "Vendor Information", -1)),
3201
+ t("div", gl, [
3202
+ e[36] || (e[36] = t("span", { class: "info-label" }, "Company:", -1)),
3203
+ t("span", bl, a(n.vendorInfo.company || ((i = n.poDetails.vendorInfo) == null ? void 0 : i.company)), 1)
2760
3204
  ]),
2761
- e("div", qo, [
2762
- t[37] || (t[37] = e("span", { class: "info-label" }, "Contact:", -1)),
2763
- e("span", To, r(n.vendorInfo.contact || ((f = n.poDetails.vendorInfo) == null ? void 0 : f.contact)), 1)
3205
+ t("div", yl, [
3206
+ e[37] || (e[37] = t("span", { class: "info-label" }, "Contact:", -1)),
3207
+ t("span", wl, a(n.vendorInfo.contact || ((m = n.poDetails.vendorInfo) == null ? void 0 : m.contact)), 1)
2764
3208
  ]),
2765
- e("div", Io, [
2766
- t[38] || (t[38] = e("span", { class: "info-label" }, "Email:", -1)),
2767
- e("span", Ro, r(n.vendorInfo.email || ((y = n.poDetails.vendorInfo) == null ? void 0 : y.email)), 1)
3209
+ t("div", kl, [
3210
+ e[38] || (e[38] = t("span", { class: "info-label" }, "Email:", -1)),
3211
+ t("span", Cl, a(n.vendorInfo.email || ((y = n.poDetails.vendorInfo) == null ? void 0 : y.email)), 1)
2768
3212
  ]),
2769
- e("div", Mo, [
2770
- t[39] || (t[39] = e("span", { class: "info-label" }, "Phone:", -1)),
2771
- e("span", Vo, r(n.vendorInfo.phone || ((A = n.poDetails.vendorInfo) == null ? void 0 : A.phone)), 1)
3213
+ t("div", _l, [
3214
+ e[39] || (e[39] = t("span", { class: "info-label" }, "Phone:", -1)),
3215
+ t("span", Dl, a(n.vendorInfo.phone || ((P = n.poDetails.vendorInfo) == null ? void 0 : P.phone)), 1)
2772
3216
  ]),
2773
- e("div", Fo, [
2774
- t[40] || (t[40] = e("span", { class: "info-label" }, "Address:", -1)),
2775
- e("span", Eo, r(n.vendorInfo.address || ((q = n.poDetails.vendorInfo) == null ? void 0 : q.address)), 1)
3217
+ t("div", xl, [
3218
+ e[40] || (e[40] = t("span", { class: "info-label" }, "Address:", -1)),
3219
+ t("span", Sl, a(n.vendorInfo.address || ((T = n.poDetails.vendorInfo) == null ? void 0 : T.address)), 1)
2776
3220
  ])
2777
3221
  ]),
2778
- e("div", No, [
2779
- t[47] || (t[47] = e("h3", null, "Purchase Order Details", -1)),
2780
- e("div", Oo, [
2781
- t[42] || (t[42] = e("span", { class: "info-label" }, "PO Number:", -1)),
2782
- e("span", Uo, r(n.poDetails.id), 1)
3222
+ t("div", Al, [
3223
+ e[47] || (e[47] = t("h3", null, "Purchase Order Details", -1)),
3224
+ t("div", Pl, [
3225
+ e[42] || (e[42] = t("span", { class: "info-label" }, "PO Number:", -1)),
3226
+ t("span", Tl, a(n.poDetails.id), 1)
2783
3227
  ]),
2784
- e("div", Lo, [
2785
- t[43] || (t[43] = e("span", { class: "info-label" }, "Date:", -1)),
2786
- e("span", $o, r(n.vendorInfo.poDate || ((T = n.poDetails.vendorInfo) == null ? void 0 : T.poDate)), 1)
3228
+ t("div", ql, [
3229
+ e[43] || (e[43] = t("span", { class: "info-label" }, "Date:", -1)),
3230
+ t("span", Il, a(n.vendorInfo.poDate || ((q = n.poDetails.vendorInfo) == null ? void 0 : q.poDate)), 1)
2787
3231
  ]),
2788
- e("div", jo, [
2789
- t[44] || (t[44] = e("span", { class: "info-label" }, "Requested By:", -1)),
2790
- e("span", Bo, r(n.vendorInfo.poApproved || ((I = n.poDetails.vendorInfo) == null ? void 0 : I.poApproved)), 1)
3232
+ t("div", Fl, [
3233
+ e[44] || (e[44] = t("span", { class: "info-label" }, "Requested By:", -1)),
3234
+ t("span", Rl, a(n.vendorInfo.poApproved || ((I = n.poDetails.vendorInfo) == null ? void 0 : I.poApproved)), 1)
2791
3235
  ]),
2792
- e("div", Ho, [
2793
- t[45] || (t[45] = e("span", { class: "info-label" }, "Department:", -1)),
2794
- e("span", Qo, "PO-" + r(n.poDetails.department), 1)
3236
+ t("div", Vl, [
3237
+ e[45] || (e[45] = t("span", { class: "info-label" }, "Department:", -1)),
3238
+ t("span", Ml, "PO-" + a(n.poDetails.department), 1)
2795
3239
  ]),
2796
- e("div", Jo, [
2797
- t[46] || (t[46] = e("span", { class: "info-label" }, "Delivery Date:", -1)),
2798
- e("span", Wo, r(n.poDetails.neededDate), 1)
3240
+ t("div", Nl, [
3241
+ e[46] || (e[46] = t("span", { class: "info-label" }, "Delivery Date:", -1)),
3242
+ t("span", El, a(n.poDetails.neededDate), 1)
2799
3243
  ])
2800
3244
  ])
2801
3245
  ]),
2802
- e("div", Go, [
2803
- t[57] || (t[57] = e("h2", { class: "section-title" }, "Order Items", -1)),
2804
- e("table", zo, [
2805
- e("thead", null, [
2806
- e("tr", null, [
2807
- t[48] || (t[48] = e("th", null, "Item #", -1)),
2808
- t[49] || (t[49] = e("th", null, "Description", -1)),
2809
- t[50] || (t[50] = e("th", null, "Quantity", -1)),
2810
- t[51] || (t[51] = e("th", null, "Unit Price", -1)),
2811
- t[52] || (t[52] = e("th", null, "Total", -1)),
2812
- n.isPrinting ? m("", !0) : (o(), l("th", Yo, "Actions"))
3246
+ t("div", Ll, [
3247
+ e[57] || (e[57] = t("h2", { class: "section-title" }, "Order Items", -1)),
3248
+ t("table", Ol, [
3249
+ t("thead", null, [
3250
+ t("tr", null, [
3251
+ e[48] || (e[48] = t("th", null, "Item #", -1)),
3252
+ e[49] || (e[49] = t("th", null, "Description", -1)),
3253
+ e[50] || (e[50] = t("th", null, "Quantity", -1)),
3254
+ e[51] || (e[51] = t("th", null, "Unit Price", -1)),
3255
+ e[52] || (e[52] = t("th", null, "Total", -1)),
3256
+ n.isPrinting ? c("", !0) : (l(), r("th", Ul, "Actions"))
2813
3257
  ])
2814
3258
  ]),
2815
- e("tbody", null, [
2816
- (o(!0), l(p, null, h(n.poDetails.items || [], (d, c) => (o(), l("tr", { key: c }, [
2817
- e("td", null, r(d.itemNumber), 1),
2818
- e("td", null, r(d.desc), 1),
2819
- e("td", null, r(d.qty), 1),
2820
- e("td", null, [
2821
- d.editing ? v((o(), l("input", {
3259
+ t("tbody", null, [
3260
+ (l(!0), r(f, null, g(n.poDetails.items || [], (u, v) => (l(), r("tr", { key: v }, [
3261
+ t("td", null, a(u.itemNumber), 1),
3262
+ t("td", null, a(u.desc), 1),
3263
+ t("td", null, a(u.qty), 1),
3264
+ t("td", null, [
3265
+ u.editing ? h((l(), r("input", {
2822
3266
  key: 1,
2823
- "onUpdate:modelValue": (w) => d.tempPrice = w,
3267
+ "onUpdate:modelValue": (C) => u.tempPrice = C,
2824
3268
  type: "number",
2825
3269
  step: "0.01",
2826
- class: g(["price-input", { "price-changed": d.cost !== d.tempPrice }])
2827
- }, null, 10, Zo)), [
3270
+ class: b(["price-input", { "price-changed": u.cost !== u.tempPrice }])
3271
+ }, null, 10, Bl)), [
2828
3272
  [
2829
3273
  k,
2830
- d.tempPrice,
3274
+ u.tempPrice,
2831
3275
  void 0,
2832
3276
  { number: !0 }
2833
3277
  ]
2834
- ]) : (o(), l("span", Ko, [
2835
- _(" $" + r(d.cost.toFixed(2)) + " ", 1),
2836
- d.cost !== d.unitPrice ? (o(), l("span", Xo, "!")) : m("", !0)
3278
+ ]) : (l(), r("span", $l, [
3279
+ w(" $" + a(u.cost.toFixed(2)) + " ", 1),
3280
+ u.cost !== u.unitPrice ? (l(), r("span", jl, "!")) : c("", !0)
2837
3281
  ]))
2838
3282
  ]),
2839
- e("td", null, "$" + r((d.unitPrice * d.qty).toFixed(2)), 1),
2840
- n.isPrinting ? m("", !0) : (o(), l("td", el, [
2841
- d.editing ? (o(), l("div", sl, [
2842
- e("button", {
2843
- onClick: (w) => a.savePrice(c),
3283
+ t("td", null, "$" + a((u.unitPrice * u.qty).toFixed(2)), 1),
3284
+ n.isPrinting ? c("", !0) : (l(), r("td", Hl, [
3285
+ u.editing ? (l(), r("div", Jl, [
3286
+ t("button", {
3287
+ onClick: (C) => o.savePrice(v),
2844
3288
  class: "save-btn"
2845
- }, "Save", 8, il),
2846
- e("button", {
2847
- onClick: (w) => a.cancelEdit(c),
3289
+ }, "Save", 8, Wl),
3290
+ t("button", {
3291
+ onClick: (C) => o.cancelEdit(v),
2848
3292
  class: "cancel-btn"
2849
- }, "Cancel", 8, nl)
2850
- ])) : (o(), l("button", {
3293
+ }, "Cancel", 8, Kl)
3294
+ ])) : (l(), r("button", {
2851
3295
  key: 0,
2852
- onClick: (w) => a.startEdit(c),
3296
+ onClick: (C) => o.startEdit(v),
2853
3297
  class: "edit-btn"
2854
- }, " Edit Price ", 8, tl))
3298
+ }, " Edit Price ", 8, Ql))
2855
3299
  ]))
2856
3300
  ]))), 128))
2857
3301
  ])
2858
3302
  ]),
2859
- (o(!0), l(p, null, h(n.poDetails.items || [], (d, c) => (o(), l("div", {
2860
- key: "note-" + c
3303
+ (l(!0), r(f, null, g(n.poDetails.items || [], (u, v) => (l(), r("div", {
3304
+ key: "note-" + v
2861
3305
  }, [
2862
- d.justification ? (o(), l("div", ol, [
2863
- e("strong", null, "Price Change Justification (Item " + r(d.itemNumber) + "):", 1),
2864
- _(" " + r(d.justification), 1)
2865
- ])) : m("", !0)
3306
+ u.justification ? (l(), r("div", zl, [
3307
+ t("strong", null, "Price Change Justification (Item " + a(u.itemNumber) + "):", 1),
3308
+ w(" " + a(u.justification), 1)
3309
+ ])) : c("", !0)
2866
3310
  ]))), 128)),
2867
- e("div", ll, [
2868
- e("div", rl, [
2869
- t[53] || (t[53] = e("span", null, "Subtotal:", -1)),
2870
- e("span", null, "$" + r(a.subTotal.toFixed(2)), 1)
3311
+ t("div", Gl, [
3312
+ t("div", Yl, [
3313
+ e[53] || (e[53] = t("span", null, "Subtotal:", -1)),
3314
+ t("span", null, "$" + a(o.subTotal.toFixed(2)), 1)
2871
3315
  ]),
2872
- e("div", al, [
2873
- t[54] || (t[54] = e("span", null, "Tax (%):", -1)),
2874
- e("span", null, "$" + r(a.getOptional(n.vendorInfo.tax)), 1)
3316
+ t("div", Xl, [
3317
+ e[54] || (e[54] = t("span", null, "Tax (%):", -1)),
3318
+ t("span", null, "$" + a(o.getOptional(n.vendorInfo.tax)), 1)
2875
3319
  ]),
2876
- e("div", dl, [
2877
- t[55] || (t[55] = e("span", null, "Shipping:", -1)),
2878
- e("span", null, "$" + r(a.getOptional(n.vendorInfo.shipping)), 1)
3320
+ t("div", Zl, [
3321
+ e[55] || (e[55] = t("span", null, "Shipping:", -1)),
3322
+ t("span", null, "$" + a(o.getOptional(n.vendorInfo.shipping)), 1)
2879
3323
  ]),
2880
- e("div", ul, [
2881
- t[56] || (t[56] = e("span", null, "Grand Total:", -1)),
2882
- e("span", null, "$" + r((a.subTotal + a.getOptional(n.vendorInfo.tax) + a.getOptional(n.vendorInfo.shipping)).toFixed(2)), 1)
3324
+ t("div", er, [
3325
+ e[56] || (e[56] = t("span", null, "Grand Total:", -1)),
3326
+ t("span", null, "$" + a((o.subTotal + o.getOptional(n.vendorInfo.tax) + o.getOptional(n.vendorInfo.shipping)).toFixed(2)), 1)
2883
3327
  ])
2884
3328
  ])
2885
3329
  ])
2886
3330
  ]),
2887
- n.showJustificationModal ? (o(), l("div", {
3331
+ n.showJustificationModal ? (l(), r("div", {
2888
3332
  key: 0,
2889
3333
  class: "justification-modal",
2890
- onClick: t[10] || (t[10] = D((...d) => a.closeJustificationModal && a.closeJustificationModal(...d), ["self"]))
3334
+ onClick: e[10] || (e[10] = D((...u) => o.closeJustificationModal && o.closeJustificationModal(...u), ["self"]))
2891
3335
  }, [
2892
- e("div", cl, [
2893
- t[60] || (t[60] = e("h3", null, "Price Change Justification Required", -1)),
2894
- e("p", ml, [
2895
- t[58] || (t[58] = _(" Please provide a justification for changing the price from ", -1)),
2896
- e("strong", null, "$" + r((M = (R = a.currentItem) == null ? void 0 : R.cost) == null ? void 0 : M.toFixed(2)), 1),
2897
- t[59] || (t[59] = _(" to ", -1)),
2898
- e("strong", null, "$" + r((F = (V = a.currentItem) == null ? void 0 : V.tempPrice) == null ? void 0 : F.toFixed(2)), 1)
3336
+ t("div", tr, [
3337
+ e[60] || (e[60] = t("h3", null, "Price Change Justification Required", -1)),
3338
+ t("p", sr, [
3339
+ e[58] || (e[58] = w(" Please provide a justification for changing the price from ", -1)),
3340
+ t("strong", null, "$" + a((R = (F = o.currentItem) == null ? void 0 : F.cost) == null ? void 0 : R.toFixed(2)), 1),
3341
+ e[59] || (e[59] = w(" to ", -1)),
3342
+ t("strong", null, "$" + a((M = (V = o.currentItem) == null ? void 0 : V.tempPrice) == null ? void 0 : M.toFixed(2)), 1)
2899
3343
  ]),
2900
- v(e("textarea", {
2901
- "onUpdate:modelValue": t[7] || (t[7] = (d) => n.justificationText = d),
3344
+ h(t("textarea", {
3345
+ "onUpdate:modelValue": e[7] || (e[7] = (u) => n.justificationText = u),
2902
3346
  class: "justification-textarea",
2903
3347
  placeholder: "Enter justification for price change...",
2904
3348
  required: ""
2905
3349
  }, null, 512), [
2906
3350
  [k, n.justificationText]
2907
3351
  ]),
2908
- e("div", vl, [
2909
- e("button", {
2910
- onClick: t[8] || (t[8] = (...d) => a.closeJustificationModal && a.closeJustificationModal(...d)),
3352
+ t("div", ir, [
3353
+ t("button", {
3354
+ onClick: e[8] || (e[8] = (...u) => o.closeJustificationModal && o.closeJustificationModal(...u)),
2911
3355
  class: "cancel-btn"
2912
3356
  }, "Cancel"),
2913
- e("button", {
2914
- onClick: t[9] || (t[9] = (...d) => a.confirmPriceChange && a.confirmPriceChange(...d)),
3357
+ t("button", {
3358
+ onClick: e[9] || (e[9] = (...u) => o.confirmPriceChange && o.confirmPriceChange(...u)),
2915
3359
  class: "save-btn",
2916
3360
  disabled: !n.justificationText.trim()
2917
- }, " Confirm Change ", 8, pl)
3361
+ }, " Confirm Change ", 8, nr)
2918
3362
  ])
2919
3363
  ])
2920
- ])) : m("", !0),
2921
- n.isPrinting ? m("", !0) : (o(), l("button", {
3364
+ ])) : c("", !0),
3365
+ n.isPrinting ? c("", !0) : (l(), r("button", {
2922
3366
  key: 1,
2923
3367
  type: "button",
2924
3368
  class: "add-item-btn",
2925
- onClick: t[11] || (t[11] = (d) => a.handleFinishPO(n.poDetails.id))
3369
+ onClick: e[11] || (e[11] = (u) => o.handleFinishPO(n.poDetails.id))
2926
3370
  }, "Approve PO"))
2927
- ])) : m("", !0),
2928
- n.activeTab === "workflow" ? (o(), l("div", fl, t[61] || (t[61] = [
3371
+ ])) : c("", !0),
3372
+ n.activeTab === "workflow" ? (l(), r("div", or, e[61] || (e[61] = [
2929
3373
  x('<div class="workflow-steps"><div class="workflow-step"><div class="step-icon completed">1</div><div class="step-title">Request Submitted</div></div><div class="workflow-step"><div class="step-icon active">2</div><div class="step-title">Department Review</div></div><div class="workflow-step"><div class="step-icon">3</div><div class="step-title">Management Approval</div></div><div class="workflow-step"><div class="step-icon">4</div><div class="step-title">Purchase Order Created</div></div><div class="workflow-step"><div class="step-icon">5</div><div class="step-title">Order Fulfilled</div></div></div><div style="background:white;padding:30px;border-radius:15px;margin-top:20px;"><h3 style="color:#1e40af;margin-bottom:20px;">Requisition Workflow Process</h3><div style="line-height:1.8;color:#374151;"><p><strong>Step 1: Request Identification</strong><br> Department or individual identifies need for materials, equipment, or services.</p><p><strong>Step 2: Requisition Creation</strong><br> Complete requisition form with detailed specifications, quantities, and business justification.</p><p><strong>Step 3: Department Review</strong><br> Department supervisor reviews request for accuracy, necessity, and budget compliance.</p><p><strong>Step 4: Management Approval</strong><br> Based on cost thresholds, appropriate management level provides approval.</p><p><strong>Step 5: Purchase Order Generation</strong><br> Purchasing team converts approved requisition into formal Purchase Order (PO).</p><p><strong>Step 6: Vendor Processing</strong><br> PO sent to vendor, order processed, and delivery scheduled.</p><p><strong>Step 7: Receipt &amp; Inventory</strong><br> Goods received, inspected, and entered into inventory system.</p></div></div>', 2)
2930
- ]))) : m("", !0)
3374
+ ]))) : c("", !0)
2931
3375
  ]);
2932
3376
  }
2933
- const gl = /* @__PURE__ */ S(Qi, [["render", hl]]), yl = (s = {}) => ({
3377
+ const rr = /* @__PURE__ */ S(Nn, [["render", lr]]), dr = (s = {}) => ({
2934
3378
  brandName: s.brandName || "OceanHelm",
2935
3379
  logoIcon: s.logoIcon || "bi bi-water",
2936
3380
  showLogo: s.showLogo !== !1,
2937
3381
  responsive: s.responsive !== !1,
2938
3382
  ...s
2939
- }), wl = [
3383
+ }), ur = [
2940
3384
  {
2941
3385
  type: "link",
2942
- label: "Dashboard",
3386
+ label: "Home",
2943
3387
  icon: "bi bi-speedometer2",
2944
3388
  href: "/app/dashboard",
2945
3389
  active: !0
@@ -2952,10 +3396,51 @@ const gl = /* @__PURE__ */ S(Qi, [["render", hl]]), yl = (s = {}) => ({
2952
3396
  roles: ["owner"]
2953
3397
  // Role-based visibility
2954
3398
  },
3399
+ {
3400
+ type: "link",
3401
+ label: "People Manager",
3402
+ icon: "bi bi-person-plus",
3403
+ href: "/app/people-manager",
3404
+ roles: ["owner"]
3405
+ // Role-based visibility
3406
+ },
2955
3407
  {
2956
3408
  type: "text",
2957
- label: "Services"
3409
+ label: "Modules"
3410
+ },
3411
+ {
3412
+ type: "dropdown",
3413
+ label: "Compliance",
3414
+ icon: "bi bi-list-ul",
3415
+ children: [
3416
+ {
3417
+ label: "Vessel Certification",
3418
+ action: "vessel-cert"
3419
+ },
3420
+ {
3421
+ type: "separator"
3422
+ },
3423
+ {
3424
+ label: "Crew Certification",
3425
+ action: "crew-cert"
3426
+ },
3427
+ {
3428
+ type: "separator"
3429
+ },
3430
+ {
3431
+ label: "Reports",
3432
+ action: "reports"
3433
+ }
3434
+ ]
3435
+ },
3436
+ /*
3437
+ {
3438
+ type: 'link',
3439
+ label: 'Business Intelligence',
3440
+ icon: 'bi bi-graph-up-arrow',
3441
+ href: '/app/analytics'
2958
3442
  },
3443
+ */
2959
3444
  {
2960
3445
  type: "button",
2961
3446
  label: "Maintenance",
@@ -3018,22 +3503,22 @@ const gl = /* @__PURE__ */ S(Qi, [["render", hl]]), yl = (s = {}) => ({
3018
3503
  icon: "bi bi-question-circle",
3019
3504
  action: "help"
3020
3505
  }
3021
- ], kl = (s, t) => !s.roles || s.roles.length === 0 ? !0 : s.roles.includes(t == null ? void 0 : t.role), _l = {
3022
- install(s, t = {}) {
3023
- s.component("ConfigurableSidebar", K), s.component("VesselLists", Te), s.component("DashHead", Ee), s.component("ActivityLogs", ei), s.component("CrewManagement", Hi), s.component("RequisitionSystem", gl), s.component("OceanHelmMaintenance", As), s.provide("sidebarConfig", t);
3506
+ ], cr = (s, e) => !s.roles || s.roles.length === 0 ? !0 : s.roles.includes(e == null ? void 0 : e.role), mr = {
3507
+ install(s, e = {}) {
3508
+ s.component("ConfigurableSidebar", X), s.component("VesselLists", Ve), s.component("DashHead", Ue), s.component("ActivityLogs", ni), s.component("CrewManagement", Mn), s.component("RequisitionSystem", rr), s.component("OceanHelmMaintenance", Fs), s.provide("sidebarConfig", e);
3024
3509
  }
3025
3510
  };
3026
3511
  export {
3027
- ei as ActivityLogs,
3028
- K as ConfigurableSidebar,
3029
- Hi as CrewManagement,
3030
- Ee as DashHead,
3031
- As as OceanHelmMaintenance,
3032
- gl as RequisitionSystem,
3033
- Te as VesselList,
3034
- yl as createSidebarConfig,
3035
- _l as default,
3036
- wl as defaultMenuItems,
3037
- kl as defaultPermissionChecker
3512
+ ni as ActivityLogs,
3513
+ X as ConfigurableSidebar,
3514
+ Mn as CrewManagement,
3515
+ Ue as DashHead,
3516
+ Fs as OceanHelmMaintenance,
3517
+ rr as RequisitionSystem,
3518
+ Ve as VesselList,
3519
+ dr as createSidebarConfig,
3520
+ mr as default,
3521
+ ur as defaultMenuItems,
3522
+ cr as defaultPermissionChecker
3038
3523
  };
3039
3524
  //# sourceMappingURL=oceanhelm.es.js.map