oceanhelm 0.0.3 → 0.0.5

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 r, createElementBlock as a, normalizeClass as h, createElementVNode as t, toDisplayString as d, createCommentVNode as u, Fragment as f, renderList as g, withModifiers as C, createTextVNode as b, renderSlot as T, withDirectives as c, vShow as _, normalizeStyle as S, createStaticVNode as k, vModelText as y, vModelSelect as w, vModelCheckbox as D } from "vue";
2
- const x = (i, e) => {
3
- const l = i.__vccOpts || i;
4
- for (const [v, n] of e)
5
- l[v] = n;
6
- return l;
7
- }, P = {
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 f, withModifiers as D, createTextVNode as _, renderSlot as O, withDirectives as v, vShow as P, normalizeStyle as E, createStaticVNode as x, vModelText as w, 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 = {
8
8
  name: "ConfigurableSidebar",
9
9
  props: {
10
10
  // Brand configuration
@@ -52,7 +52,7 @@ const x = (i, e) => {
52
52
  return this.customClasses;
53
53
  },
54
54
  filteredMenuItems() {
55
- return this.menuItems.filter((i) => this.hasPermission(i));
55
+ return this.menuItems.filter((s) => this.hasPermission(s));
56
56
  }
57
57
  },
58
58
  mounted() {
@@ -60,110 +60,110 @@ const x = (i, e) => {
60
60
  },
61
61
  methods: {
62
62
  // Permission checking
63
- hasPermission(i) {
64
- return this.permissionChecker ? this.permissionChecker(i, this.userProfile) : !i.roles || i.roles.length === 0 ? !0 : i.roles.includes(this.userProfile.role);
63
+ hasPermission(s) {
64
+ return this.permissionChecker ? this.permissionChecker(s, this.userProfile) : !s.roles || s.roles.length === 0 ? !0 : s.roles.includes(this.userProfile.role);
65
65
  },
66
66
  // Navigation handling
67
- handleNavigation(i) {
68
- var e;
69
- this.$emit("navigate", i), i.href && !i.preventDefault && (i.external ? window.open(i.href, "_blank") : (e = this.$router) == null || e.push(i.href));
67
+ handleNavigation(s) {
68
+ var t;
69
+ this.$emit("navigate", s), s.href && !s.preventDefault && (s.external ? window.open(s.href, "_blank") : (t = this.$router) == null || t.push(s.href));
70
70
  },
71
71
  // Action handling
72
- handleAction(i) {
73
- this.$emit("action", i);
72
+ handleAction(s) {
73
+ this.$emit("action", s);
74
74
  },
75
75
  // Item click handling
76
- handleItemClick(i) {
77
- this.$emit("item-click", i), i.type;
76
+ handleItemClick(s) {
77
+ this.$emit("item-click", s), s.type;
78
78
  },
79
79
  // Responsive behavior
80
80
  initializeResponsiveBehavior() {
81
- const i = document.getElementById("sidebarToggle"), e = document.getElementById("sidebar"), l = document.getElementById("content");
82
- !i || !e || !l || (window.innerWidth >= 768 && (e.classList.toggle("active"), l.classList.toggle("active")), i.addEventListener("click", () => {
83
- e.classList.toggle("active"), l.classList.toggle("active");
84
- }), document.addEventListener("click", (v) => {
85
- const n = e.contains(v.target), o = i.contains(v.target);
86
- !n && !o && window.innerWidth < 768 && e.classList.contains("active") && (e.classList.remove("active"), l.classList.remove("active"));
81
+ const s = document.getElementById("sidebarToggle"), t = document.getElementById("sidebar"), u = document.getElementById("content");
82
+ !s || !t || !u || (window.innerWidth >= 768 && (t.classList.toggle("active"), u.classList.toggle("active")), s.addEventListener("click", () => {
83
+ t.classList.toggle("active"), u.classList.toggle("active");
84
+ }), document.addEventListener("click", (b) => {
85
+ const n = t.contains(b.target), a = s.contains(b.target);
86
+ !n && !a && window.innerWidth < 768 && t.classList.contains("active") && (t.classList.remove("active"), u.classList.remove("active"));
87
87
  }));
88
88
  }
89
89
  },
90
90
  emits: ["navigate", "action", "item-click"]
91
- }, M = {
91
+ }, L = {
92
92
  key: 0,
93
93
  class: "logo d-flex align-items-center left"
94
- }, E = { class: "list-unstyled components mt-4" }, V = ["onClick"], N = ["href", "onClick"], L = ["onClick"], F = {
94
+ }, j = { class: "list-unstyled components mt-4" }, $ = ["onClick"], B = ["href", "onClick"], H = ["onClick"], Q = {
95
95
  class: "dropdown-toggle",
96
96
  type: "button",
97
97
  "data-bs-toggle": "dropdown",
98
98
  "aria-expanded": "false"
99
- }, U = {
99
+ }, J = {
100
100
  class: "dropdown-menu",
101
101
  "aria-labelledby": "dropdownMenuLink"
102
- }, I = ["onClick"], R = {
102
+ }, W = ["onClick"], G = {
103
103
  key: 3,
104
104
  class: "dropdown-divider"
105
- }, O = { key: 4 };
106
- function B(i, e, l, v, n, o) {
107
- return r(), a("nav", {
105
+ }, z = { key: 4 };
106
+ function Y(s, t, u, b, n, a) {
107
+ return o(), l("nav", {
108
108
  id: "sidebar",
109
- class: h(o.sidebarClasses)
109
+ class: g(a.sidebarClasses)
110
110
  }, [
111
- l.showLogo ? (r(), a("div", M, [
112
- t("i", {
113
- class: h([l.logoIcon, "me-2"])
111
+ u.showLogo ? (o(), l("div", L, [
112
+ e("i", {
113
+ class: g([u.logoIcon, "me-2"])
114
114
  }, null, 2),
115
- t("span", null, d(l.brandName), 1)
116
- ])) : u("", !0),
117
- t("ul", E, [
118
- (r(!0), a(f, null, g(o.filteredMenuItems, (s, m) => (r(), a("li", {
119
- key: m,
120
- class: h({ active: s.active, dropdown: s.type === "dropdown" }),
121
- onClick: (p) => o.handleItemClick(s)
115
+ e("span", null, r(u.brandName), 1)
116
+ ])) : m("", !0),
117
+ e("ul", j, [
118
+ (o(!0), l(p, null, f(a.filteredMenuItems, (i, h) => (o(), l("li", {
119
+ key: h,
120
+ class: g({ active: i.active, dropdown: i.type === "dropdown" }),
121
+ onClick: (k) => a.handleItemClick(i)
122
122
  }, [
123
- s.type === "link" ? (r(), a("a", {
123
+ i.type === "link" ? (o(), l("a", {
124
124
  key: 0,
125
- href: s.href || "#",
126
- onClick: C((p) => o.handleNavigation(s), ["prevent"])
125
+ href: i.href || "#",
126
+ onClick: D((k) => a.handleNavigation(i), ["prevent"])
127
127
  }, [
128
- s.icon ? (r(), a("i", {
128
+ i.icon ? (o(), l("i", {
129
129
  key: 0,
130
- class: h(s.icon)
131
- }, null, 2)) : u("", !0),
132
- b(" " + d(s.label), 1)
133
- ], 8, N)) : s.type === "button" ? (r(), a("a", {
130
+ class: g(i.icon)
131
+ }, null, 2)) : m("", !0),
132
+ _(" " + r(i.label), 1)
133
+ ], 8, B)) : i.type === "button" ? (o(), l("a", {
134
134
  key: 1,
135
- onClick: C((p) => o.handleAction(s), ["prevent"]),
135
+ onClick: D((k) => a.handleAction(i), ["prevent"]),
136
136
  style: { cursor: "pointer" }
137
137
  }, [
138
- s.icon ? (r(), a("i", {
138
+ i.icon ? (o(), l("i", {
139
139
  key: 0,
140
- class: h(s.icon)
141
- }, null, 2)) : u("", !0),
142
- b(" " + d(s.label), 1)
143
- ], 8, L)) : s.type === "dropdown" ? (r(), a(f, { key: 2 }, [
144
- t("a", F, [
145
- s.icon ? (r(), a("i", {
140
+ class: g(i.icon)
141
+ }, null, 2)) : m("", !0),
142
+ _(" " + r(i.label), 1)
143
+ ], 8, H)) : i.type === "dropdown" ? (o(), l(p, { key: 2 }, [
144
+ e("a", Q, [
145
+ i.icon ? (o(), l("i", {
146
146
  key: 0,
147
- class: h(s.icon)
148
- }, null, 2)) : u("", !0),
149
- b(" " + d(s.label), 1)
147
+ class: g(i.icon)
148
+ }, null, 2)) : m("", !0),
149
+ _(" " + r(i.label), 1)
150
150
  ]),
151
- t("div", U, [
152
- (r(!0), a(f, null, g(s.children, (p, A) => (r(), a("a", {
151
+ e("div", J, [
152
+ (o(!0), l(p, null, f(i.children, (k, A) => (o(), l("a", {
153
153
  key: A,
154
154
  class: "dropdown-item black",
155
- onClick: C((Ei) => o.handleAction(p), ["prevent"]),
155
+ onClick: D((q) => a.handleAction(k), ["prevent"]),
156
156
  style: { cursor: "pointer" }
157
- }, d(p.label), 9, I))), 128))
157
+ }, r(k.label), 9, W))), 128))
158
158
  ])
159
- ], 64)) : s.type === "separator" ? (r(), a("div", R)) : s.type === "text" ? (r(), a("a", O, d(s.label), 1)) : u("", !0)
160
- ], 10, V))), 128))
159
+ ], 64)) : i.type === "separator" ? (o(), l("div", G)) : i.type === "text" ? (o(), l("a", z, r(i.label), 1)) : m("", !0)
160
+ ], 10, $))), 128))
161
161
  ]),
162
- T(i.$slots, "footer")
162
+ O(s.$slots, "footer")
163
163
  ], 2);
164
164
  }
165
- const H = /* @__PURE__ */ x(P, [["render", B]]);
166
- const q = {
165
+ const K = /* @__PURE__ */ S(U, [["render", Y]]);
166
+ const X = {
167
167
  name: "VesselList",
168
168
  props: {
169
169
  // Required props
@@ -210,10 +210,10 @@ const q = {
210
210
  ],
211
211
  computed: {
212
212
  activeVesselsCount() {
213
- return this.vessels.filter((i) => i.status === "Active").length;
213
+ return this.vessels.filter((s) => s.status === "Active").length;
214
214
  },
215
215
  inactiveVesselsCount() {
216
- return this.vessels.filter((i) => i.status === "Inactive").length;
216
+ return this.vessels.filter((s) => s.status === "Inactive").length;
217
217
  },
218
218
  canAddVessel() {
219
219
  return this.config.enableAdd && (this.userProfile.role === "owner" || this.userProfile.role === "staff");
@@ -228,183 +228,183 @@ const q = {
228
228
  }
229
229
  this.$emit("vessel-add");
230
230
  },
231
- handleVesselClick(i) {
232
- const e = {
233
- vessel: i,
231
+ handleVesselClick(s) {
232
+ const t = {
233
+ vessel: s,
234
234
  route: this.currentRoute,
235
- id: i.registrationNumber,
236
- name: i.name
235
+ id: s.registrationNumber,
236
+ name: s.name
237
237
  };
238
- this.currentRoute === "dashboard" ? this.$emit("vessel-click", i) : this.$emit("vessel-navigate", e);
238
+ this.currentRoute === "dashboard" ? this.$emit("vessel-click", s) : this.$emit("vessel-navigate", t);
239
239
  },
240
- handleDeleteVessel(i) {
241
- if (!this.grantAccess(i)) {
240
+ handleDeleteVessel(s) {
241
+ if (!this.grantAccess(s)) {
242
242
  this.handleAccessDenied("delete vessel");
243
243
  return;
244
244
  }
245
- this.config.enableDelete && this.$emit("vessel-delete", i);
245
+ this.config.enableDelete && this.$emit("vessel-delete", s);
246
246
  },
247
- handleToggleStatus(i) {
248
- if (!this.grantAccess(i)) {
247
+ handleToggleStatus(s) {
248
+ if (!this.grantAccess(s)) {
249
249
  this.handleAccessDenied("change vessel status");
250
250
  return;
251
251
  }
252
- this.config.enableStatusToggle && this.$emit("vessel-toggle-status", i);
252
+ this.config.enableStatusToggle && this.$emit("vessel-toggle-status", s);
253
253
  },
254
- handleEditVessel(i) {
255
- if (!this.grantAccess(i)) {
254
+ handleEditVessel(s) {
255
+ if (!this.grantAccess(s)) {
256
256
  this.handleAccessDenied("edit vessel");
257
257
  return;
258
258
  }
259
- this.config.enableEdit && this.$emit("vessel-edit", i);
259
+ this.config.enableEdit && this.$emit("vessel-edit", s);
260
260
  },
261
- handleAccessDenied(i) {
262
- this.$emit("access-denied", { action: i, userProfile: this.userProfile });
261
+ handleAccessDenied(s) {
262
+ this.$emit("access-denied", { action: s, userProfile: this.userProfile });
263
263
  },
264
264
  // Utility methods (keep these in component as they're UI-related)
265
- statusClass(i) {
266
- return `status-${(i == null ? void 0 : i.toLowerCase()) || ""}`;
265
+ statusClass(s) {
266
+ return `status-${(s == null ? void 0 : s.toLowerCase()) || ""}`;
267
267
  },
268
- grantAccess(i) {
269
- const { role: e, vessel: l } = this.userProfile;
270
- return e === "owner" || e === "staff" || e === "captain" && l === i.name;
268
+ grantAccess(s) {
269
+ const { role: t, vessel: u } = this.userProfile;
270
+ return t === "owner" || t === "staff" || t === "captain" && u === s.name;
271
271
  },
272
- getDaysToExpiry(i) {
273
- if (!i)
272
+ getDaysToExpiry(s) {
273
+ if (!s)
274
274
  return null;
275
- const e = /* @__PURE__ */ new Date(), v = new Date(i) - e;
276
- return Math.ceil(v / (1e3 * 60 * 60 * 24));
275
+ const t = /* @__PURE__ */ new Date(), b = new Date(s) - t;
276
+ return Math.ceil(b / (1e3 * 60 * 60 * 24));
277
277
  },
278
- getExpiryClass(i) {
279
- const e = this.getDaysToExpiry(i);
280
- return e === null ? "" : e < 30 ? "cert-critical" : e < 90 ? "cert-warning" : "";
278
+ getExpiryClass(s) {
279
+ const t = this.getDaysToExpiry(s);
280
+ return t === null ? "" : t < 30 ? "cert-critical" : t < 90 ? "cert-warning" : "";
281
281
  }
282
282
  }
283
- }, j = { class: "row mb-3" }, $ = { class: "col-md-4" }, Q = { class: "card border-0 shadow-sm" }, z = { class: "card-body d-flex align-items-center" }, Y = { class: "mt-2 mb-0" }, K = { class: "col-md-4" }, W = { class: "card border-0 shadow-sm" }, G = { class: "card-body d-flex align-items-center" }, J = { class: "mt-2 mb-0" }, X = {
283
+ }, 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 = {
284
284
  key: 0,
285
285
  class: "col-md-4"
286
- }, Z = {
286
+ }, de = {
287
287
  key: 0,
288
288
  class: "text-center py-4"
289
- }, ee = {
289
+ }, ue = {
290
290
  key: 1,
291
291
  class: "alert alert-primary",
292
292
  role: "alert"
293
- }, te = {
293
+ }, ce = {
294
294
  key: 2,
295
295
  class: "row"
296
- }, se = ["onClick"], ie = { class: "card-body d-flex align-items-center" }, ne = { class: "flex-grow-1" }, le = { class: "d-flex justify-content-between align-items-center mb-2" }, oe = { class: "card-title mb-0" }, re = { class: "row" }, ae = { class: "col-6" }, de = { class: "mb-0" }, ce = { class: "col-6" }, ue = { class: "mb-0" }, me = { class: "action-icon v-left delete" }, ve = ["onClick"], he = ["onClick"];
297
- function fe(i, e, l, v, n, o) {
298
- return r(), a(f, null, [
299
- t("div", j, [
300
- t("div", $, [
301
- t("div", Q, [
302
- t("div", z, [
303
- e[2] || (e[2] = t("div", { class: "rounded-circle bg-primary bg-opacity-10 p-3 me-3" }, [
304
- t("i", { class: "bi bi-check-circle-fill text-primary fs-4" })
296
+ }, 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 = { class: "col-6" }, ke = { class: "mb-0" }, _e = { class: "action-icon v-left delete" }, Ce = ["onClick"], De = ["onClick"];
297
+ function xe(s, t, u, b, n, a) {
298
+ return o(), l(p, null, [
299
+ e("div", Z, [
300
+ e("div", ee, [
301
+ e("div", te, [
302
+ e("div", se, [
303
+ t[2] || (t[2] = e("div", { class: "rounded-circle bg-primary bg-opacity-10 p-3 me-3" }, [
304
+ e("i", { class: "bi bi-check-circle-fill text-primary fs-4" })
305
305
  ], -1)),
306
- t("div", null, [
307
- e[1] || (e[1] = t("h6", { class: "mb-0" }, "Active Vessels", -1)),
308
- t("h3", Y, d(o.activeVesselsCount), 1)
306
+ e("div", null, [
307
+ t[1] || (t[1] = e("h6", { class: "mb-0" }, "Active Vessels", -1)),
308
+ e("h3", ie, r(a.activeVesselsCount), 1)
309
309
  ])
310
310
  ])
311
311
  ])
312
312
  ]),
313
- t("div", K, [
314
- t("div", W, [
315
- t("div", G, [
316
- e[4] || (e[4] = t("div", { class: "rounded-circle bg-secondary bg-opacity-10 p-3 me-3" }, [
317
- t("i", { class: "bi bi-pause-circle-fill text-secondary fs-4" })
313
+ e("div", ne, [
314
+ e("div", oe, [
315
+ e("div", le, [
316
+ t[4] || (t[4] = e("div", { class: "rounded-circle bg-secondary bg-opacity-10 p-3 me-3" }, [
317
+ e("i", { class: "bi bi-pause-circle-fill text-secondary fs-4" })
318
318
  ], -1)),
319
- t("div", null, [
320
- e[3] || (e[3] = t("h6", { class: "mb-0" }, "Inactive", -1)),
321
- t("h3", J, d(o.inactiveVesselsCount), 1)
319
+ e("div", null, [
320
+ t[3] || (t[3] = e("h6", { class: "mb-0" }, "Inactive", -1)),
321
+ e("h3", re, r(a.inactiveVesselsCount), 1)
322
322
  ])
323
323
  ])
324
324
  ])
325
325
  ]),
326
- o.canAddVessel ? (r(), a("div", X, [
327
- t("div", {
326
+ a.canAddVessel ? (o(), l("div", ae, [
327
+ e("div", {
328
328
  class: "card border-0 shadow-sm",
329
- onClick: e[0] || (e[0] = (...s) => o.handleAddVessel && o.handleAddVessel(...s))
330
- }, e[5] || (e[5] = [
331
- t("div", { class: "card-body d-flex align-items-center" }, [
332
- t("div", { class: "rounded-circle bg-success bg-opacity-10 p-3 me-3" }, [
333
- t("i", { class: "bi bi-patch-plus-fill text-success fs-4" })
329
+ onClick: t[0] || (t[0] = (...i) => a.handleAddVessel && a.handleAddVessel(...i))
330
+ }, t[5] || (t[5] = [
331
+ e("div", { class: "card-body d-flex align-items-center" }, [
332
+ e("div", { class: "rounded-circle bg-success bg-opacity-10 p-3 me-3" }, [
333
+ e("i", { class: "bi bi-patch-plus-fill text-success fs-4" })
334
334
  ]),
335
- t("div", null, [
336
- t("h6", { class: "mb-0" }, "Add New Vessel")
335
+ e("div", null, [
336
+ e("h6", { class: "mb-0" }, "Add New Vessel")
337
337
  ])
338
338
  ], -1)
339
339
  ]))
340
- ])) : u("", !0)
340
+ ])) : m("", !0)
341
341
  ]),
342
- e[11] || (e[11] = t("h4", { class: "mb-4" }, [
343
- t("i", { class: "bi bi-ship me-2" }),
344
- b("Registered Vessels")
342
+ t[11] || (t[11] = e("h4", { class: "mb-4" }, [
343
+ e("i", { class: "bi bi-ship me-2" }),
344
+ _("Registered Vessels")
345
345
  ], -1)),
346
- l.loading ? (r(), a("div", Z, e[6] || (e[6] = [
347
- t("div", {
346
+ u.loading ? (o(), l("div", de, t[6] || (t[6] = [
347
+ e("div", {
348
348
  class: "spinner-border text-primary",
349
349
  role: "status"
350
350
  }, [
351
- t("span", { class: "visually-hidden" }, "Loading...")
351
+ e("span", { class: "visually-hidden" }, "Loading...")
352
352
  ], -1),
353
- t("p", { class: "mt-2" }, "Loading vessels...", -1)
354
- ]))) : l.vessels.length ? (r(), a("div", te, [
355
- (r(!0), a(f, null, g(l.vessels, (s) => (r(), a("div", {
353
+ e("p", { class: "mt-2" }, "Loading vessels...", -1)
354
+ ]))) : u.vessels.length ? (o(), l("div", ce, [
355
+ (o(!0), l(p, null, f(u.vessels, (i) => (o(), l("div", {
356
356
  class: "col-lg-6",
357
- key: s.registrationNumber || s.id
357
+ key: i.registrationNumber || i.id
358
358
  }, [
359
- t("div", {
359
+ e("div", {
360
360
  class: "vessel-card",
361
- onClick: (m) => o.handleVesselClick(s)
361
+ onClick: (h) => a.handleVesselClick(i)
362
362
  }, [
363
- t("div", ie, [
364
- e[10] || (e[10] = t("div", { class: "vessel-icon v-left" }, [
365
- t("i", { class: "fas fa-ship" })
363
+ e("div", ve, [
364
+ t[10] || (t[10] = e("div", { class: "vessel-icon v-left" }, [
365
+ e("i", { class: "fas fa-ship" })
366
366
  ], -1)),
367
- t("div", ne, [
368
- t("div", le, [
369
- t("h5", oe, d(s.name), 1),
370
- t("span", {
371
- class: h(["vessel-status", o.statusClass(s.status)])
372
- }, d(s.status), 3)
367
+ e("div", pe, [
368
+ e("div", fe, [
369
+ e("h5", he, r(i.name), 1),
370
+ e("span", {
371
+ class: g(["vessel-status", a.statusClass(i.status)])
372
+ }, r(i.status), 3)
373
373
  ]),
374
- t("div", re, [
375
- t("div", ae, [
376
- e[8] || (e[8] = t("small", { class: "text-muted" }, "Registration #:", -1)),
377
- t("p", de, d(s.registrationNumber), 1)
374
+ e("div", ge, [
375
+ e("div", be, [
376
+ t[8] || (t[8] = e("small", { class: "text-muted" }, "Registration #:", -1)),
377
+ e("p", ye, r(i.registrationNumber), 1)
378
378
  ]),
379
- t("div", ce, [
380
- e[9] || (e[9] = t("small", { class: "text-muted" }, "Next Maintenance:", -1)),
381
- t("p", ue, d(s.nextMaintenance || "Not scheduled"), 1)
379
+ e("div", we, [
380
+ t[9] || (t[9] = e("small", { class: "text-muted" }, "Next Maintenance:", -1)),
381
+ e("p", ke, r(i.nextMaintenance || "Not scheduled"), 1)
382
382
  ])
383
383
  ])
384
384
  ])
385
385
  ]),
386
- t("div", me, [
387
- t("i", {
386
+ e("div", _e, [
387
+ e("i", {
388
388
  class: "bi bi-trash",
389
- onClick: C((m) => o.handleDeleteVessel(s), ["stop"])
390
- }, null, 8, ve)
389
+ onClick: D((h) => a.handleDeleteVessel(i), ["stop"])
390
+ }, null, 8, Ce)
391
391
  ]),
392
- t("button", {
392
+ e("button", {
393
393
  class: "btn btn-primary",
394
- onClick: C((m) => o.handleToggleStatus(s), ["stop"])
395
- }, d(s.status === "Active" ? "Mark Inactive" : "Mark Active"), 9, he)
396
- ], 8, se)
394
+ onClick: D((h) => a.handleToggleStatus(i), ["stop"])
395
+ }, r(i.status === "Active" ? "Mark Inactive" : "Mark Active"), 9, De)
396
+ ], 8, me)
397
397
  ]))), 128))
398
- ])) : (r(), a("div", ee, e[7] || (e[7] = [
399
- t("h4", { class: "alert-heading" }, "Empty Fleet!", -1),
400
- t("p", null, "You have an empty fleet, you have not added any vessel yet.", -1),
401
- t("hr", null, null, -1),
402
- t("p", { class: "mb-0" }, "Click on the add vessel button above, to start adding vessels to your fleet", -1)
398
+ ])) : (o(), l("div", ue, t[7] || (t[7] = [
399
+ e("h4", { class: "alert-heading" }, "Empty Fleet!", -1),
400
+ e("p", null, "You have an empty fleet, you have not added any vessel yet.", -1),
401
+ e("hr", null, null, -1),
402
+ e("p", { class: "mb-0" }, "Click on the add vessel button above, to start adding vessels to your fleet", -1)
403
403
  ])))
404
404
  ], 64);
405
405
  }
406
- const pe = /* @__PURE__ */ x(q, [["render", fe]]);
407
- const ge = {
406
+ const Se = /* @__PURE__ */ S(X, [["render", xe]]);
407
+ const Pe = {
408
408
  name: "DashHead",
409
409
  props: {
410
410
  name: {
@@ -429,30 +429,30 @@ const ge = {
429
429
  this.$emit("logged-in");
430
430
  }
431
431
  }
432
- }, ye = { class: "page-header d-flex justify-content-between align-items-center" }, be = { style: { "margin-left": "20px" } }, we = { class: "d-flex" };
433
- function ke(i, e, l, v, n, o) {
434
- return r(), a("div", ye, [
435
- t("h2", be, d(l.name), 1),
436
- t("div", we, [
437
- this.userProfile.role == "owner" ? (r(), a("button", {
432
+ }, Ae = { class: "page-header d-flex justify-content-between align-items-center" }, qe = { style: { "margin-left": "20px" } }, Te = { class: "d-flex" };
433
+ function Ie(s, t, u, b, n, a) {
434
+ return o(), l("div", Ae, [
435
+ e("h2", qe, r(u.name), 1),
436
+ e("div", Te, [
437
+ this.userProfile.role == "owner" ? (o(), l("button", {
438
438
  key: 0,
439
439
  class: "btn btn-outline-primary me-2",
440
- onClick: e[0] || (e[0] = (s) => o.addUser())
441
- }, e[2] || (e[2] = [
442
- t("i", { class: "bi bi-bell" }, null, -1),
443
- t("span", { class: "badge bg-danger" }, "1", -1)
444
- ]))) : u("", !0),
445
- t("button", {
440
+ onClick: t[0] || (t[0] = (i) => a.addUser())
441
+ }, t[2] || (t[2] = [
442
+ e("i", { class: "bi bi-bell" }, null, -1),
443
+ e("span", { class: "badge bg-danger" }, "1", -1)
444
+ ]))) : m("", !0),
445
+ e("button", {
446
446
  class: "btn btn-outline-primary",
447
- onClick: e[1] || (e[1] = (s) => o.loggedIn())
448
- }, e[3] || (e[3] = [
449
- t("i", { class: "bi bi-person-circle" }, null, -1)
447
+ onClick: t[1] || (t[1] = (i) => a.loggedIn())
448
+ }, t[3] || (t[3] = [
449
+ e("i", { class: "bi bi-person-circle" }, null, -1)
450
450
  ]))
451
451
  ])
452
452
  ]);
453
453
  }
454
- const Ce = /* @__PURE__ */ x(ge, [["render", ke]]);
455
- const _e = {
454
+ const Re = /* @__PURE__ */ S(Pe, [["render", Ie]]);
455
+ const Me = {
456
456
  name: "OceanHelmMaintenance",
457
457
  props: {
458
458
  vesselInfo: {
@@ -548,23 +548,23 @@ const _e = {
548
548
  watch: {
549
549
  "form.lastPerformed": "calculateNextDue",
550
550
  "form.recurrence": "calculateNextDue",
551
- "form.nextDue": function(i) {
551
+ "form.nextDue": function(s) {
552
552
  this.calculateRemainingDays();
553
553
  }
554
554
  },
555
555
  computed: {
556
556
  filteredTasks() {
557
- let i = [...this.tasks];
558
- if (this.activeFilter === "all" ? i = i.filter((e) => e.status === "Overdue" || e.status === "Soon" || e.status === "Completed") : this.activeFilter === "due" ? i = i.filter((e) => e.status === "Overdue" || e.status === "Soon") : this.activeFilter === "completed" && (i = i.filter((e) => e.status === "Completed")), this.searchQuery) {
559
- const e = this.searchQuery.toLowerCase();
560
- i = i.filter(
561
- (l) => l.component.toLowerCase().includes(e) || l.taskName.toLowerCase().includes(e) || l.assignedTo.toLowerCase().includes(e)
557
+ let s = [...this.tasks];
558
+ 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) {
559
+ const t = this.searchQuery.toLowerCase();
560
+ s = s.filter(
561
+ (u) => u.component.toLowerCase().includes(t) || u.taskName.toLowerCase().includes(t) || u.assignedTo.toLowerCase().includes(t)
562
562
  );
563
563
  }
564
- return i;
564
+ return s;
565
565
  },
566
566
  completedCount() {
567
- return this.checklists.filter((i) => i.completed);
567
+ return this.checklists.filter((s) => s.completed);
568
568
  },
569
569
  progress() {
570
570
  return Math.round(this.completedCount.length / this.checklists.length * 100);
@@ -576,61 +576,61 @@ const _e = {
576
576
  return this.checklistButtonLabel !== "Save Checklist";
577
577
  },
578
578
  totalEstimatedHours() {
579
- return this.maintenanceTasks.reduce((i, e) => i + (e.estimatedHours || 0), 0);
579
+ return this.maintenanceTasks.reduce((s, t) => s + (t.estimatedHours || 0), 0);
580
580
  }
581
581
  },
582
582
  methods: {
583
- grantAccess(i) {
584
- const e = this.userProfile;
585
- return e.role === "owner" || e.role === "staff" || e.role === "captain" && e.vessel === i;
583
+ grantAccess(s) {
584
+ const t = this.userProfile;
585
+ return t.role === "owner" || t.role === "staff" || t.role === "captain" && t.vessel === s;
586
586
  },
587
587
  deepAccess() {
588
- const i = this.userProfile;
589
- return i.role === "owner" || i.role === "captain" ? !0 : (this.$emit("access-denied", "You do not have access to do this"), !1);
588
+ const s = this.userProfile;
589
+ return s.role === "owner" || s.role === "captain" ? !0 : (this.$emit("access-denied", "You do not have access to do this"), !1);
590
590
  },
591
- deleteTask(i) {
592
- this.checklists = this.checklists.filter((e) => e.id !== i);
591
+ deleteTask(s) {
592
+ this.checklists = this.checklists.filter((t) => t.id !== s);
593
593
  },
594
- addTask(i) {
595
- i && i.preventDefault(), this.$emit("show-message", {
594
+ addTask(s) {
595
+ s && s.preventDefault(), this.$emit("show-message", {
596
596
  type: "prompt",
597
597
  title: "Add New Task",
598
598
  message: "Enter the task details",
599
- callback: (e) => {
600
- if (e) {
601
- const l = {
599
+ callback: (t) => {
600
+ if (t) {
601
+ const u = {
602
602
  id: Date.now(),
603
- text: e,
603
+ text: t,
604
604
  completed: !1
605
605
  };
606
- this.checklists.push(l);
606
+ this.checklists.push(u);
607
607
  }
608
608
  }
609
609
  });
610
610
  },
611
- setFilter(i) {
612
- this.activeFilter = i;
611
+ setFilter(s) {
612
+ this.activeFilter = s;
613
613
  },
614
- loadChecklist(i) {
614
+ loadChecklist(s) {
615
615
  this.isLoading = !0, this.$emit("generate-checklist", {
616
- component: i,
617
- callback: (e) => {
618
- this.checklists = e.map((l) => ({
619
- ...l,
616
+ component: s,
617
+ callback: (t) => {
618
+ this.checklists = t.map((u) => ({
619
+ ...u,
620
620
  completed: !1
621
621
  })), this.isLoading = !1;
622
622
  }
623
623
  });
624
624
  },
625
- showMaintenance(i) {
625
+ showMaintenance(s) {
626
626
  if (this.deepAccess()) {
627
- const e = this.tasks.find((l) => l.component === i);
628
- e && e.checklistProgress ? this.checklists = [...e.checklistProgress] : this.loadChecklist(i), this.after = e == null ? void 0 : e.after, this.currentTask = i, this.lastSection = "inventory", this.activeSection = "maintenance";
627
+ const t = this.tasks.find((u) => u.component === s);
628
+ 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";
629
629
  }
630
630
  },
631
- printMaintenance(i) {
632
- const e = this.tasks.find((l) => l.component === i);
633
- this.maintenanceTasks = [e], this.loadMaintenanceData(), this.showReport = !0, this.$nextTick(() => {
631
+ printMaintenance(s) {
632
+ const t = this.tasks.find((u) => u.component === s);
633
+ this.maintenanceTasks = [t], this.loadMaintenanceData(), this.showReport = !0, this.$nextTick(() => {
634
634
  setTimeout(() => {
635
635
  window.print(), this.showReport = !1;
636
636
  }, 100);
@@ -639,18 +639,18 @@ const _e = {
639
639
  switchSchedule() {
640
640
  this.deepAccess() && (this.activeSection = "schedule");
641
641
  },
642
- handleFiles(i) {
643
- this.imgText = i.target.files[0].name, this.form.attachments = {
644
- file: i.target.files[0]
642
+ handleFiles(s) {
643
+ this.imgText = s.target.files[0].name, this.form.attachments = {
644
+ file: s.target.files[0]
645
645
  };
646
646
  },
647
- handleImg(i) {
648
- this.fileText = i.target.files[0].name, this.fileattachments = {
649
- file: i.target.files[0]
647
+ handleImg(s) {
648
+ this.fileText = s.target.files[0].name, this.fileattachments = {
649
+ file: s.target.files[0]
650
650
  };
651
651
  },
652
652
  validateForm() {
653
- const i = [
653
+ const s = [
654
654
  "taskName",
655
655
  "description",
656
656
  "maintenanceType",
@@ -661,77 +661,77 @@ const _e = {
661
661
  "lastPerformed",
662
662
  "assignedTo"
663
663
  ];
664
- for (const e of i)
665
- if (!this.form[e])
664
+ for (const t of s)
665
+ if (!this.form[t])
666
666
  return this.$emit("show-message", {
667
667
  type: "error",
668
668
  title: "Missing info",
669
- message: `Please fill in the required field: ${e}`
669
+ message: `Please fill in the required field: ${t}`
670
670
  }), !1;
671
671
  return !0;
672
672
  },
673
- handleSectionClick(i) {
674
- this.activeSection = i.id, typeof i.onClick == "function" && i.onClick();
673
+ handleSectionClick(s) {
674
+ this.activeSection = s.id, typeof s.onClick == "function" && s.onClick();
675
675
  },
676
676
  calculateNextDue() {
677
- const i = this.form.lastPerformed ? new Date(this.form.lastPerformed) : null, e = this.form.recurrence;
678
- if (!i || !e)
677
+ const s = this.form.lastPerformed ? new Date(this.form.lastPerformed) : null, t = this.form.recurrence;
678
+ if (!s || !t)
679
679
  return;
680
- let l = new Date(i);
681
- switch (e) {
680
+ let u = new Date(s);
681
+ switch (t) {
682
682
  case "daily":
683
- l.setDate(l.getDate() + 1);
683
+ u.setDate(u.getDate() + 1);
684
684
  break;
685
685
  case "weekly":
686
- l.setDate(l.getDate() + 7);
686
+ u.setDate(u.getDate() + 7);
687
687
  break;
688
688
  case "monthly":
689
- l.setMonth(l.getMonth() + 1);
689
+ u.setMonth(u.getMonth() + 1);
690
690
  break;
691
691
  case "quarterly":
692
- l.setMonth(l.getMonth() + 3);
692
+ u.setMonth(u.getMonth() + 3);
693
693
  break;
694
694
  case "semi-annual":
695
- l.setMonth(l.getMonth() + 6);
695
+ u.setMonth(u.getMonth() + 6);
696
696
  break;
697
697
  case "annual":
698
- l.setFullYear(l.getFullYear() + 1);
698
+ u.setFullYear(u.getFullYear() + 1);
699
699
  break;
700
700
  case "once":
701
701
  case "custom":
702
702
  return;
703
703
  }
704
- this.form.nextDue = l.toISOString().split("T")[0];
704
+ this.form.nextDue = u.toISOString().split("T")[0];
705
705
  },
706
706
  calculateRemainingDays() {
707
707
  if (!this.form.nextDue) {
708
708
  this.form.remainingDays = null;
709
709
  return;
710
710
  }
711
- const i = /* @__PURE__ */ new Date(), e = new Date(this.form.nextDue);
712
- i.setHours(0, 0, 0, 0), e.setHours(0, 0, 0, 0);
713
- const l = e - i, v = Math.ceil(l / (1e3 * 60 * 60 * 24));
714
- this.form.remainingDays = `${v} Days`;
711
+ const s = /* @__PURE__ */ new Date(), t = new Date(this.form.nextDue);
712
+ s.setHours(0, 0, 0, 0), t.setHours(0, 0, 0, 0);
713
+ const u = t - s, b = Math.ceil(u / (1e3 * 60 * 60 * 24));
714
+ this.form.remainingDays = `${b} Days`;
715
715
  },
716
716
  async saveSchedule() {
717
717
  if (this.isSaving = !0, !this.validateForm()) {
718
718
  this.isSaving = !1;
719
719
  return;
720
720
  }
721
- const i = { ...this.form };
722
- if (this.form.component === "Other" && this.form.customComponent && (i.component = this.form.customComponent), i.email = this.companyInfo.email, this.tasks.some((l) => l.component === i.component)) {
721
+ const s = { ...this.form };
722
+ 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)) {
723
723
  this.$emit("show-message", {
724
724
  type: "error",
725
725
  title: "Duplicate Component",
726
- message: `A task with the component "${i.component}" already exists in maintenance`
726
+ message: `A task with the component "${s.component}" already exists in maintenance`
727
727
  }), this.isSaving = !1;
728
728
  return;
729
729
  }
730
- delete i.customComponent, this.$emit("save-schedule", {
731
- taskData: i,
732
- file: i.attachments.file,
733
- callback: (l) => {
734
- this.isSaving = !1, l && (this.loadChecklist(i.component), this.lastSection = "schedule", this.currentTask = i.component, this.resetForm(), this.activeSection = "maintenance");
730
+ delete s.customComponent, this.$emit("save-schedule", {
731
+ taskData: s,
732
+ file: s.attachments.file,
733
+ callback: (u) => {
734
+ this.isSaving = !1, u && (this.loadChecklist(s.component), this.lastSection = "schedule", this.currentTask = s.component, this.resetForm(), this.activeSection = "maintenance");
735
735
  }
736
736
  });
737
737
  },
@@ -758,21 +758,21 @@ const _e = {
758
758
  attachments: {}
759
759
  };
760
760
  },
761
- toggleTask(i) {
762
- i.completed = !i.completed;
761
+ toggleTask(s) {
762
+ s.completed = !s.completed;
763
763
  },
764
764
  async resetTasks() {
765
- const e = this.checklists.every((v) => v.completed) ? "Completed" : "In Progress", l = {
765
+ const t = this.checklists.every((b) => b.completed) ? "Completed" : "In Progress", u = {
766
766
  checklistProgress: [...this.checklists],
767
- status: e,
767
+ status: t,
768
768
  component: this.currentTask,
769
769
  after: this.after
770
770
  };
771
771
  this.$emit("update-task", {
772
- updateData: l,
772
+ updateData: u,
773
773
  file: this.fileattachments.file,
774
- callback: (v, n) => {
775
- v && (n && (this.after = n), this.fileattachments = {}, this.fileText = "Drag and drop files here or", this.refreshKey += 1, this.activeSection = "inventory");
774
+ callback: (b, n) => {
775
+ b && (n && (this.after = n), this.fileattachments = {}, this.fileText = "Drag and drop files here or", this.refreshKey += 1, this.activeSection = "inventory");
776
776
  }
777
777
  });
778
778
  },
@@ -783,24 +783,24 @@ const _e = {
783
783
  day: "numeric"
784
784
  });
785
785
  },
786
- formatDate(i) {
787
- return i ? new Date(i).toLocaleDateString("en-US", {
786
+ formatDate(s) {
787
+ return s ? new Date(s).toLocaleDateString("en-US", {
788
788
  year: "numeric",
789
789
  month: "short",
790
790
  day: "numeric"
791
791
  }) : "N/A";
792
792
  },
793
- getTaskStatusClass(i) {
794
- return i.status === "Completed" ? "completed" : i.status === "Overdue" ? "overdue" : i.status === "In Progress" ? "in-progress" : "pending";
793
+ getTaskStatusClass(s) {
794
+ return s.status === "Completed" ? "completed" : s.status === "Overdue" ? "overdue" : s.status === "In Progress" ? "in-progress" : "pending";
795
795
  },
796
- getChecklistProgress(i) {
797
- if (!i.checklistProgress || i.checklistProgress.length === 0)
796
+ getChecklistProgress(s) {
797
+ if (!s.checklistProgress || s.checklistProgress.length === 0)
798
798
  return 0;
799
- const e = i.checklistProgress.filter((l) => l.completed).length;
800
- return Math.round(e / i.checklistProgress.length * 100);
799
+ const t = s.checklistProgress.filter((u) => u.completed).length;
800
+ return Math.round(t / s.checklistProgress.length * 100);
801
801
  },
802
- getCompletedChecklistItems(i) {
803
- return i.checklistProgress ? i.checklistProgress.filter((e) => e.completed).length : 0;
802
+ getCompletedChecklistItems(s) {
803
+ return s.checklistProgress ? s.checklistProgress.filter((t) => t.completed).length : 0;
804
804
  },
805
805
  generateRecommendations() {
806
806
  return [
@@ -812,607 +812,607 @@ const _e = {
812
812
  deleteEvidence() {
813
813
  this.$emit("delete-evidence", {
814
814
  currentTask: this.currentTask,
815
- callback: (i) => {
816
- i && (this.after = null, this.fileText = "Drag and drop files here or", this.fileattachments = {}, this.refreshKey += 1);
815
+ callback: (s) => {
816
+ s && (this.after = null, this.fileText = "Drag and drop files here or", this.fileattachments = {}, this.refreshKey += 1);
817
817
  }
818
818
  });
819
819
  }
820
820
  }
821
- }, xe = { key: 0 }, Se = ["onClick"], De = { class: "content" }, Ae = {
821
+ }, Ve = { key: 0 }, Fe = ["onClick"], Ee = { class: "content" }, Ne = {
822
822
  key: 0,
823
823
  class: "loading-container"
824
- }, Te = { key: 1 }, Pe = { class: "container" }, Me = { class: "d-flex justify-content-between align-items-center" }, Ee = { class: "progress-container" }, Ve = { class: "progress-info" }, Ne = { class: "progress-bar" }, Le = { class: "checklist" }, Fe = ["onClick"], Ue = { key: 0 }, Ie = ["onClick"], Re = ["onClick"], Oe = { key: 0 }, Be = { class: "checklist" }, He = { class: "checklist-item" }, qe = { class: "attachment-area" }, je = {
824
+ }, Oe = { key: 1 }, Ue = { class: "container" }, Le = { class: "d-flex justify-content-between align-items-center" }, je = { class: "progress-container" }, $e = { class: "progress-info" }, Be = { class: "progress-bar" }, He = { class: "checklist" }, Qe = ["onClick"], Je = { key: 0 }, We = ["onClick"], Ge = ["onClick"], ze = { key: 0 }, Ye = { class: "checklist" }, Ke = { class: "checklist-item" }, Xe = { class: "attachment-area" }, Ze = {
825
825
  key: 2,
826
826
  class: "status"
827
- }, $e = { class: "form-group" }, Qe = { class: "form-group" }, ze = { class: "input-group" }, Ye = { class: "form-group" }, Ke = { class: "form-group" }, We = { class: "input-group" }, Ge = { class: "form-group" }, Je = { class: "form-group" }, Xe = { class: "input-group" }, Ze = { class: "form-group" }, et = { class: "form-group" }, tt = ["value"], st = { class: "input-group" }, it = { class: "form-group" }, nt = { class: "input-group" }, lt = { class: "form-group" }, ot = { class: "form-group" }, rt = { class: "form-group" }, at = { class: "checkbox-group" }, dt = { class: "checkbox-item" }, ct = { class: "checkbox-item" }, ut = { class: "input-group" }, mt = { class: "form-group" }, vt = { class: "form-group" }, ht = { class: "form-group" }, ft = { class: "attachment-area" }, pt = { class: "action-buttons" }, gt = ["disabled"], yt = { class: "task-table-wrapper" }, bt = { class: "table-controls" }, wt = { class: "filters" }, kt = { class: "task-table" }, Ct = ["onClick"], _t = ["onClick"], xt = { key: 0 }, St = {
827
+ }, et = { class: "form-group" }, tt = { class: "form-group" }, st = { class: "input-group" }, it = { class: "form-group" }, nt = { class: "form-group" }, ot = { class: "input-group" }, lt = { class: "form-group" }, rt = { class: "form-group" }, at = { class: "input-group" }, dt = { class: "form-group" }, ut = { class: "form-group" }, ct = ["value"], mt = { class: "input-group" }, vt = { class: "form-group" }, pt = { class: "input-group" }, ft = { class: "form-group" }, ht = { class: "form-group" }, gt = { class: "form-group" }, bt = { class: "checkbox-group" }, yt = { class: "checkbox-item" }, wt = { class: "checkbox-item" }, kt = { class: "input-group" }, _t = { class: "form-group" }, Ct = { class: "form-group" }, Dt = { class: "form-group" }, xt = { class: "attachment-area" }, St = { class: "action-buttons" }, Pt = ["disabled"], At = { class: "task-table-wrapper" }, qt = { class: "table-controls" }, Tt = { class: "filters" }, It = { class: "task-table" }, Rt = ["onClick"], Mt = ["onClick"], Vt = { key: 0 }, Ft = {
828
828
  class: "alert alert-primary",
829
829
  role: "alert"
830
- }, Dt = { class: "mb-0" }, At = {
830
+ }, Et = { class: "mb-0" }, Nt = {
831
831
  class: "report-container",
832
832
  ref: "reportContainer"
833
- }, Tt = { class: "report-info" }, Pt = { class: "info-box" }, Mt = { class: "info-box" }, Et = { class: "info-box" }, Vt = { class: "section" }, Nt = { class: "summary-grid" }, Lt = { class: "summary-card" }, Ft = { class: "summary-number" }, Ut = { class: "section" }, It = { class: "task-header" }, Rt = { class: "task-title" }, Ot = { class: "task-component" }, Bt = { class: "task-details" }, Ht = { class: "detail-item" }, qt = { class: "detail-value" }, jt = { class: "detail-item" }, $t = { class: "detail-value" }, Qt = { class: "detail-item" }, zt = { class: "detail-value" }, Yt = { class: "detail-item" }, Kt = { class: "detail-value" }, Wt = { class: "detail-item" }, Gt = { class: "detail-value" }, Jt = { class: "detail-item" }, Xt = { class: "detail-value" }, Zt = {
833
+ }, Ot = { class: "report-info" }, Ut = { class: "info-box" }, Lt = { class: "info-box" }, jt = { class: "info-box" }, $t = { class: "section" }, Bt = { class: "summary-grid" }, Ht = { class: "summary-card" }, Qt = { class: "summary-number" }, Jt = { class: "section" }, Wt = { class: "task-header" }, Gt = { class: "task-title" }, zt = { class: "task-component" }, Yt = { class: "task-details" }, Kt = { class: "detail-item" }, Xt = { class: "detail-value" }, Zt = { class: "detail-item" }, es = { class: "detail-value" }, 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 = {
834
834
  key: 0,
835
835
  style: { margin: "15px 0", padding: "10px", background: "white", "border-radius": "5px" }
836
- }, es = { class: "detail-value" }, ts = {
836
+ }, us = { class: "detail-value" }, cs = {
837
837
  key: 1,
838
838
  style: { margin: "15px 0", padding: "10px", background: "white", "border-radius": "5px" }
839
- }, ss = { class: "detail-value" }, is = {
839
+ }, ms = { class: "detail-value" }, vs = {
840
840
  key: 2,
841
841
  class: "checklist-progress"
842
- }, ns = { class: "progress-bar" }, ls = { style: { "font-size": "0.9em", color: "#666", "margin-top": "5px" } }, os = { class: "checklist-items" }, rs = { class: "checklist-icon" }, as = { class: "section" }, ds = { class: "info-box" }, cs = { class: "signature-section" }, us = { class: "signature-box" }, ms = { style: { "margin-top": "10px", color: "#666" } };
843
- function vs(i, e, l, v, n, o) {
844
- return n.ready ? (r(), a("div", xe, [
845
- t("div", null, [
846
- c(t("nav", null, [
847
- (r(!0), a(f, null, g(n.sections, (s) => (r(), a("button", {
848
- key: s.id,
849
- class: h(["nav-btn", { active: n.activeSection === s.id }]),
850
- onClick: (m) => o.handleSectionClick(s)
851
- }, d(s.icon) + " " + d(s.name), 11, Se))), 128))
842
+ }, ps = { class: "progress-bar" }, fs = { style: { "font-size": "0.9em", color: "#666", "margin-top": "5px" } }, hs = { class: "checklist-items" }, gs = { class: "checklist-icon" }, bs = { class: "section" }, ys = { class: "info-box" }, ws = { class: "signature-section" }, ks = { class: "signature-box" }, _s = { style: { "margin-top": "10px", color: "#666" } };
843
+ function Cs(s, t, u, b, n, a) {
844
+ return n.ready ? (o(), l("div", Ve, [
845
+ e("div", null, [
846
+ v(e("nav", null, [
847
+ (o(!0), l(p, null, f(n.sections, (i) => (o(), l("button", {
848
+ key: i.id,
849
+ class: g(["nav-btn", { active: n.activeSection === i.id }]),
850
+ onClick: (h) => a.handleSectionClick(i)
851
+ }, r(i.icon) + " " + r(i.name), 11, Fe))), 128))
852
852
  ], 512), [
853
- [_, !n.showReport]
853
+ [P, !n.showReport]
854
854
  ]),
855
- c(t("div", De, [
856
- c(t("section", {
857
- class: h(["form-section", { active: n.activeSection === "maintenance" }])
855
+ v(e("div", Ee, [
856
+ v(e("section", {
857
+ class: g(["form-section", { active: n.activeSection === "maintenance" }])
858
858
  }, [
859
- e[37] || (e[37] = t("h2", null, "🛠️ Maintenance Tasks", -1)),
860
- n.isLoading ? (r(), a("div", Ae, e[27] || (e[27] = [
861
- t("div", { class: "loading-spinner" }, null, -1),
862
- t("p", null, "Loading checklist...", -1)
863
- ]))) : u("", !0),
864
- n.isLoading ? u("", !0) : (r(), a("form", Te, [
865
- t("div", Pe, [
866
- t("div", Me, [
867
- e[29] || (e[29] = t("h1", null, "Maintenance Checklist", -1)),
868
- o.showAddTaskButton ? (r(), a("button", {
859
+ t[37] || (t[37] = e("h2", null, "🛠️ Maintenance Tasks", -1)),
860
+ n.isLoading ? (o(), l("div", Ne, t[27] || (t[27] = [
861
+ e("div", { class: "loading-spinner" }, null, -1),
862
+ e("p", null, "Loading checklist...", -1)
863
+ ]))) : m("", !0),
864
+ n.isLoading ? m("", !0) : (o(), l("form", Oe, [
865
+ e("div", Ue, [
866
+ e("div", Le, [
867
+ t[29] || (t[29] = e("h1", null, "Maintenance Checklist", -1)),
868
+ a.showAddTaskButton ? (o(), l("button", {
869
869
  key: 0,
870
870
  class: "btn btn-outline-custom",
871
- onClick: e[0] || (e[0] = C((s) => o.addTask(), ["prevent"]))
872
- }, e[28] || (e[28] = [
873
- b(" Manually Add Task ", -1),
874
- t("i", { class: "fas fa-plus" }, null, -1)
875
- ]))) : u("", !0)
871
+ onClick: t[0] || (t[0] = D((i) => a.addTask(), ["prevent"]))
872
+ }, t[28] || (t[28] = [
873
+ _(" Manually Add Task ", -1),
874
+ e("i", { class: "fas fa-plus" }, null, -1)
875
+ ]))) : m("", !0)
876
876
  ]),
877
- t("div", Ee, [
878
- t("div", Ve, " Progress: " + d(o.progress) + "% (" + d(o.completedCount.length) + "/" + d(n.checklists.length) + ") ", 1),
879
- t("div", Ne, [
880
- t("div", {
877
+ e("div", je, [
878
+ e("div", $e, " Progress: " + r(a.progress) + "% (" + r(a.completedCount.length) + "/" + r(n.checklists.length) + ") ", 1),
879
+ e("div", Be, [
880
+ e("div", {
881
881
  class: "progress-fill",
882
- style: S({ width: o.progress + "%" })
882
+ style: E({ width: a.progress + "%" })
883
883
  }, null, 4)
884
884
  ])
885
885
  ]),
886
- t("ul", Le, [
887
- (r(!0), a(f, null, g(n.checklists, (s) => (r(), a("li", {
888
- key: s.id,
886
+ e("ul", He, [
887
+ (o(!0), l(p, null, f(n.checklists, (i) => (o(), l("li", {
888
+ key: i.id,
889
889
  class: "checklist-item"
890
890
  }, [
891
- t("div", {
892
- class: h(["checkbox", { checked: s.completed }]),
893
- onClick: (m) => o.toggleTask(s)
891
+ e("div", {
892
+ class: g(["checkbox", { checked: i.completed }]),
893
+ onClick: (h) => a.toggleTask(i)
894
894
  }, [
895
- s.completed ? (r(), a("span", Ue, "✓")) : u("", !0)
896
- ], 10, Fe),
897
- t("span", {
898
- class: h(["task-text", { completed: s.completed }]),
899
- onClick: (m) => o.toggleTask(s)
900
- }, d(s.text), 11, Ie),
901
- o.showAddTaskButton ? (r(), a("button", {
895
+ i.completed ? (o(), l("span", Je, "✓")) : m("", !0)
896
+ ], 10, Qe),
897
+ e("span", {
898
+ class: g(["task-text", { completed: i.completed }]),
899
+ onClick: (h) => a.toggleTask(i)
900
+ }, r(i.text), 11, We),
901
+ a.showAddTaskButton ? (o(), l("button", {
902
902
  key: 0,
903
903
  class: "delete-btn",
904
- onClick: (m) => o.deleteTask(s.id),
904
+ onClick: (h) => a.deleteTask(i.id),
905
905
  title: "Delete task"
906
- }, e[30] || (e[30] = [
907
- k('<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)
908
- ]), 8, Re)) : u("", !0)
906
+ }, t[30] || (t[30] = [
907
+ 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)
908
+ ]), 8, Ge)) : m("", !0)
909
909
  ]))), 128))
910
910
  ]),
911
- n.after ? (r(), a("div", Oe, [
912
- e[33] || (e[33] = t("label", null, "Upload Image Evidence", -1)),
913
- t("ul", Be, [
914
- t("li", He, [
915
- e[32] || (e[32] = t("span", { class: "task-text" }, " Image Evidence Already Uploaded ", -1)),
916
- t("button", {
911
+ n.after ? (o(), l("div", ze, [
912
+ t[33] || (t[33] = e("label", null, "Upload Image Evidence", -1)),
913
+ e("ul", Ye, [
914
+ e("li", Ke, [
915
+ t[32] || (t[32] = e("span", { class: "task-text" }, " Image Evidence Already Uploaded ", -1)),
916
+ e("button", {
917
917
  type: "button",
918
918
  class: "delete-btn",
919
- onClick: e[1] || (e[1] = (s) => o.deleteEvidence()),
919
+ onClick: t[1] || (t[1] = (i) => a.deleteEvidence()),
920
920
  title: "Delete Image"
921
- }, e[31] || (e[31] = [
922
- k('<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)
921
+ }, t[31] || (t[31] = [
922
+ 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)
923
923
  ]))
924
924
  ])
925
925
  ])
926
- ])) : (r(), a("div", {
926
+ ])) : (o(), l("div", {
927
927
  class: "form-group",
928
928
  key: n.refreshKey || "default"
929
929
  }, [
930
- e[35] || (e[35] = t("label", null, "Upload Image Evidence", -1)),
931
- e[36] || (e[36] = t("p", null, "You can only upload one image evidence here.", -1)),
932
- t("div", qe, [
933
- t("p", null, d(n.fileText), 1),
934
- t("input", {
930
+ t[35] || (t[35] = e("label", null, "Upload Image Evidence", -1)),
931
+ t[36] || (t[36] = e("p", null, "You can only upload one image evidence here.", -1)),
932
+ e("div", Xe, [
933
+ e("p", null, r(n.fileText), 1),
934
+ e("input", {
935
935
  type: "file",
936
936
  id: "evidence-files",
937
937
  class: "file-input",
938
- onChange: e[2] || (e[2] = (...s) => o.handleImg && o.handleImg(...s))
938
+ onChange: t[2] || (t[2] = (...i) => a.handleImg && a.handleImg(...i))
939
939
  }, null, 32),
940
- e[34] || (e[34] = t("label", {
940
+ t[34] || (t[34] = e("label", {
941
941
  for: "evidence-files",
942
942
  class: "file-label"
943
943
  }, "Browse Files", -1))
944
944
  ])
945
945
  ])),
946
- o.completedCount === n.checklists.length ? (r(), a("div", je, " All tasks completed! ✅ ")) : u("", !0),
947
- t("button", {
946
+ a.completedCount === n.checklists.length ? (o(), l("div", Ze, " All tasks completed! ✅ ")) : m("", !0),
947
+ e("button", {
948
948
  class: "reset-button",
949
- onClick: e[3] || (e[3] = C((...s) => o.resetTasks && o.resetTasks(...s), ["prevent"]))
950
- }, d(o.checklistButtonLabel), 1)
949
+ onClick: t[3] || (t[3] = D((...i) => a.resetTasks && a.resetTasks(...i), ["prevent"]))
950
+ }, r(a.checklistButtonLabel), 1)
951
951
  ])
952
952
  ]))
953
953
  ], 2), [
954
- [_, n.activeSection === "maintenance"]
954
+ [P, n.activeSection === "maintenance"]
955
955
  ]),
956
- c(t("section", {
957
- class: h(["form-section", { active: n.activeSection === "schedule" }])
956
+ v(e("section", {
957
+ class: g(["form-section", { active: n.activeSection === "schedule" }])
958
958
  }, [
959
- e[62] || (e[62] = t("h2", null, "📅 Maintenance Schedule", -1)),
960
- t("form", null, [
961
- t("div", $e, [
962
- e[38] || (e[38] = t("label", { for: "task-name" }, "Task Name", -1)),
963
- c(t("input", {
959
+ t[62] || (t[62] = e("h2", null, "📅 Maintenance Schedule", -1)),
960
+ e("form", null, [
961
+ e("div", et, [
962
+ t[38] || (t[38] = e("label", { for: "task-name" }, "Task Name", -1)),
963
+ v(e("input", {
964
964
  type: "text",
965
965
  id: "task-name",
966
- "onUpdate:modelValue": e[4] || (e[4] = (s) => n.form.taskName = s),
966
+ "onUpdate:modelValue": t[4] || (t[4] = (i) => n.form.taskName = i),
967
967
  required: ""
968
968
  }, null, 512), [
969
- [y, n.form.taskName]
969
+ [w, n.form.taskName]
970
970
  ])
971
971
  ]),
972
- t("div", Qe, [
973
- e[39] || (e[39] = t("label", { for: "task-description" }, "Description", -1)),
974
- c(t("textarea", {
972
+ e("div", tt, [
973
+ t[39] || (t[39] = e("label", { for: "task-description" }, "Description", -1)),
974
+ v(e("textarea", {
975
975
  id: "task-description",
976
- "onUpdate:modelValue": e[5] || (e[5] = (s) => n.form.description = s),
976
+ "onUpdate:modelValue": t[5] || (t[5] = (i) => n.form.description = i),
977
977
  required: ""
978
978
  }, null, 512), [
979
- [y, n.form.description]
979
+ [w, n.form.description]
980
980
  ])
981
981
  ]),
982
- t("div", ze, [
983
- t("div", Ye, [
984
- e[41] || (e[41] = t("label", { for: "maintenance-type" }, "Maintenance Type", -1)),
985
- c(t("select", {
982
+ e("div", st, [
983
+ e("div", it, [
984
+ t[41] || (t[41] = e("label", { for: "maintenance-type" }, "Maintenance Type", -1)),
985
+ v(e("select", {
986
986
  id: "maintenance-type",
987
- "onUpdate:modelValue": e[6] || (e[6] = (s) => n.form.maintenanceType = s),
987
+ "onUpdate:modelValue": t[6] || (t[6] = (i) => n.form.maintenanceType = i),
988
988
  required: ""
989
- }, e[40] || (e[40] = [
990
- k('<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)
989
+ }, t[40] || (t[40] = [
990
+ 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)
991
991
  ]), 512), [
992
- [w, n.form.maintenanceType]
992
+ [C, n.form.maintenanceType]
993
993
  ])
994
994
  ]),
995
- t("div", Ke, [
996
- e[43] || (e[43] = t("label", { for: "component" }, "Component/System", -1)),
997
- c(t("select", {
995
+ e("div", nt, [
996
+ t[43] || (t[43] = e("label", { for: "component" }, "Component/System", -1)),
997
+ v(e("select", {
998
998
  id: "component",
999
- "onUpdate:modelValue": e[7] || (e[7] = (s) => n.form.component = s),
999
+ "onUpdate:modelValue": t[7] || (t[7] = (i) => n.form.component = i),
1000
1000
  required: ""
1001
- }, e[42] || (e[42] = [
1002
- k('<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)
1001
+ }, t[42] || (t[42] = [
1002
+ 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)
1003
1003
  ]), 512), [
1004
- [w, n.form.component]
1004
+ [C, n.form.component]
1005
1005
  ]),
1006
- n.form.component === "Other" ? c((r(), a("input", {
1006
+ n.form.component === "Other" ? v((o(), l("input", {
1007
1007
  key: 0,
1008
1008
  type: "text",
1009
1009
  placeholder: "Enter custom component/system",
1010
- "onUpdate:modelValue": e[8] || (e[8] = (s) => n.form.customComponent = s),
1010
+ "onUpdate:modelValue": t[8] || (t[8] = (i) => n.form.customComponent = i),
1011
1011
  style: { "margin-top": "8px" }
1012
1012
  }, null, 512)), [
1013
- [y, n.form.customComponent]
1014
- ]) : u("", !0)
1013
+ [w, n.form.customComponent]
1014
+ ]) : m("", !0)
1015
1015
  ])
1016
1016
  ]),
1017
- t("div", We, [
1018
- t("div", Ge, [
1019
- e[45] || (e[45] = t("label", { for: "priority" }, "Priority", -1)),
1020
- c(t("select", {
1017
+ e("div", ot, [
1018
+ e("div", lt, [
1019
+ t[45] || (t[45] = e("label", { for: "priority" }, "Priority", -1)),
1020
+ v(e("select", {
1021
1021
  id: "priority",
1022
- "onUpdate:modelValue": e[9] || (e[9] = (s) => n.form.priority = s),
1022
+ "onUpdate:modelValue": t[9] || (t[9] = (i) => n.form.priority = i),
1023
1023
  required: ""
1024
- }, e[44] || (e[44] = [
1025
- t("option", { value: "low" }, "Low", -1),
1026
- t("option", { value: "medium" }, "Medium", -1),
1027
- t("option", { value: "high" }, "High", -1),
1028
- t("option", { value: "critical" }, "Critical", -1)
1024
+ }, t[44] || (t[44] = [
1025
+ e("option", { value: "low" }, "Low", -1),
1026
+ e("option", { value: "medium" }, "Medium", -1),
1027
+ e("option", { value: "high" }, "High", -1),
1028
+ e("option", { value: "critical" }, "Critical", -1)
1029
1029
  ]), 512), [
1030
- [w, n.form.priority]
1030
+ [C, n.form.priority]
1031
1031
  ])
1032
1032
  ]),
1033
- t("div", Je, [
1034
- e[46] || (e[46] = t("label", { for: "status" }, "Status", -1)),
1035
- c(t("input", {
1033
+ e("div", rt, [
1034
+ t[46] || (t[46] = e("label", { for: "status" }, "Status", -1)),
1035
+ v(e("input", {
1036
1036
  type: "text",
1037
1037
  id: "status",
1038
- "onUpdate:modelValue": e[10] || (e[10] = (s) => n.form.status = s),
1038
+ "onUpdate:modelValue": t[10] || (t[10] = (i) => n.form.status = i),
1039
1039
  readonly: ""
1040
1040
  }, null, 512), [
1041
- [y, n.form.status]
1041
+ [w, n.form.status]
1042
1042
  ])
1043
1043
  ])
1044
1044
  ]),
1045
- t("div", Xe, [
1046
- t("div", Ze, [
1047
- e[47] || (e[47] = t("label", { for: "estimated-hours" }, "Estimated Hours", -1)),
1048
- c(t("input", {
1045
+ e("div", at, [
1046
+ e("div", dt, [
1047
+ t[47] || (t[47] = e("label", { for: "estimated-hours" }, "Estimated Hours", -1)),
1048
+ v(e("input", {
1049
1049
  type: "number",
1050
1050
  id: "estimated-hours",
1051
- "onUpdate:modelValue": e[11] || (e[11] = (s) => n.form.estimatedHours = s),
1051
+ "onUpdate:modelValue": t[11] || (t[11] = (i) => n.form.estimatedHours = i),
1052
1052
  min: "0",
1053
1053
  step: "0.5"
1054
1054
  }, null, 512), [
1055
- [y, n.form.estimatedHours]
1055
+ [w, n.form.estimatedHours]
1056
1056
  ])
1057
1057
  ])
1058
1058
  ]),
1059
- t("div", et, [
1060
- e[49] || (e[49] = t("label", { for: "assigned-to" }, "Assigned To", -1)),
1061
- c(t("select", {
1059
+ e("div", ut, [
1060
+ t[49] || (t[49] = e("label", { for: "assigned-to" }, "Assigned To", -1)),
1061
+ v(e("select", {
1062
1062
  id: "assigned-to",
1063
- "onUpdate:modelValue": e[12] || (e[12] = (s) => n.form.assignedTo = s)
1063
+ "onUpdate:modelValue": t[12] || (t[12] = (i) => n.form.assignedTo = i)
1064
1064
  }, [
1065
- e[48] || (e[48] = t("option", { value: "" }, "-- Select Personnel --", -1)),
1066
- (r(!0), a(f, null, g(l.vesselCrew, (s) => (r(), a("option", {
1067
- key: s.id,
1068
- value: `${s.name} - ${s.role}`
1069
- }, d(s.name) + " - " + d(s.role), 9, tt))), 128))
1065
+ t[48] || (t[48] = e("option", { value: "" }, "-- Select Personnel --", -1)),
1066
+ (o(!0), l(p, null, f(u.vesselCrew, (i) => (o(), l("option", {
1067
+ key: i.id,
1068
+ value: `${i.name} - ${i.role}`
1069
+ }, r(i.name) + " - " + r(i.role), 9, ct))), 128))
1070
1070
  ], 512), [
1071
- [w, n.form.assignedTo]
1071
+ [C, n.form.assignedTo]
1072
1072
  ])
1073
1073
  ]),
1074
- t("div", st, [
1075
- t("div", it, [
1076
- e[51] || (e[51] = t("label", { for: "recurrence-type" }, "Recurrence", -1)),
1077
- c(t("select", {
1074
+ e("div", mt, [
1075
+ e("div", vt, [
1076
+ t[51] || (t[51] = e("label", { for: "recurrence-type" }, "Recurrence", -1)),
1077
+ v(e("select", {
1078
1078
  id: "recurrence-type",
1079
- "onUpdate:modelValue": e[13] || (e[13] = (s) => n.form.recurrence = s),
1079
+ "onUpdate:modelValue": t[13] || (t[13] = (i) => n.form.recurrence = i),
1080
1080
  required: ""
1081
- }, e[50] || (e[50] = [
1082
- k('<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)
1081
+ }, t[50] || (t[50] = [
1082
+ 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)
1083
1083
  ]), 512), [
1084
- [w, n.form.recurrence]
1084
+ [C, n.form.recurrence]
1085
1085
  ])
1086
1086
  ])
1087
1087
  ]),
1088
- t("div", nt, [
1089
- t("div", lt, [
1090
- e[52] || (e[52] = t("label", { for: "last-performed" }, "Last Performed Date", -1)),
1091
- c(t("input", {
1088
+ e("div", pt, [
1089
+ e("div", ft, [
1090
+ t[52] || (t[52] = e("label", { for: "last-performed" }, "Last Performed Date", -1)),
1091
+ v(e("input", {
1092
1092
  type: "date",
1093
1093
  id: "last-performed",
1094
- "onUpdate:modelValue": e[14] || (e[14] = (s) => n.form.lastPerformed = s)
1094
+ "onUpdate:modelValue": t[14] || (t[14] = (i) => n.form.lastPerformed = i)
1095
1095
  }, null, 512), [
1096
- [y, n.form.lastPerformed]
1096
+ [w, n.form.lastPerformed]
1097
1097
  ])
1098
1098
  ]),
1099
- t("div", ot, [
1100
- e[53] || (e[53] = t("label", { for: "next-due" }, "Due Date", -1)),
1101
- c(t("input", {
1099
+ e("div", ht, [
1100
+ t[53] || (t[53] = e("label", { for: "next-due" }, "Due Date", -1)),
1101
+ v(e("input", {
1102
1102
  type: "date",
1103
1103
  id: "next-due",
1104
- "onUpdate:modelValue": e[15] || (e[15] = (s) => n.form.nextDue = s),
1104
+ "onUpdate:modelValue": t[15] || (t[15] = (i) => n.form.nextDue = i),
1105
1105
  required: ""
1106
1106
  }, null, 512), [
1107
- [y, n.form.nextDue]
1107
+ [w, n.form.nextDue]
1108
1108
  ])
1109
1109
  ])
1110
1110
  ]),
1111
- t("div", rt, [
1112
- e[56] || (e[56] = t("label", null, "Notifications", -1)),
1113
- t("div", at, [
1114
- t("div", dt, [
1115
- c(t("input", {
1111
+ e("div", gt, [
1112
+ t[56] || (t[56] = e("label", null, "Notifications", -1)),
1113
+ e("div", bt, [
1114
+ e("div", yt, [
1115
+ v(e("input", {
1116
1116
  type: "checkbox",
1117
1117
  id: "notify-email",
1118
- "onUpdate:modelValue": e[16] || (e[16] = (s) => n.form.notifyEmail = s)
1118
+ "onUpdate:modelValue": t[16] || (t[16] = (i) => n.form.notifyEmail = i)
1119
1119
  }, null, 512), [
1120
- [D, n.form.notifyEmail]
1120
+ [N, n.form.notifyEmail]
1121
1121
  ]),
1122
- e[54] || (e[54] = t("label", { for: "notify-email" }, "Email Notification", -1))
1122
+ t[54] || (t[54] = e("label", { for: "notify-email" }, "Email Notification", -1))
1123
1123
  ]),
1124
- t("div", ct, [
1125
- c(t("input", {
1124
+ e("div", wt, [
1125
+ v(e("input", {
1126
1126
  type: "checkbox",
1127
1127
  id: "notify-sms",
1128
- "onUpdate:modelValue": e[17] || (e[17] = (s) => n.form.notifySms = s)
1128
+ "onUpdate:modelValue": t[17] || (t[17] = (i) => n.form.notifySms = i)
1129
1129
  }, null, 512), [
1130
- [D, n.form.notifySms]
1130
+ [N, n.form.notifySms]
1131
1131
  ]),
1132
- e[55] || (e[55] = t("label", { for: "notify-sms" }, "SMS Notification", -1))
1132
+ t[55] || (t[55] = e("label", { for: "notify-sms" }, "SMS Notification", -1))
1133
1133
  ])
1134
1134
  ])
1135
1135
  ]),
1136
- t("div", ut, [
1137
- t("div", mt, [
1138
- e[58] || (e[58] = t("label", { for: "reminder-days" }, "Reminder (Days Before)", -1)),
1139
- c(t("select", {
1136
+ e("div", kt, [
1137
+ e("div", _t, [
1138
+ t[58] || (t[58] = e("label", { for: "reminder-days" }, "Reminder (Days Before)", -1)),
1139
+ v(e("select", {
1140
1140
  id: "reminder-days",
1141
- "onUpdate:modelValue": e[18] || (e[18] = (s) => n.form.reminderDays = s)
1142
- }, e[57] || (e[57] = [
1143
- k('<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)
1141
+ "onUpdate:modelValue": t[18] || (t[18] = (i) => n.form.reminderDays = i)
1142
+ }, t[57] || (t[57] = [
1143
+ 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)
1144
1144
  ]), 512), [
1145
- [w, n.form.reminderDays]
1145
+ [C, n.form.reminderDays]
1146
1146
  ])
1147
1147
  ])
1148
1148
  ]),
1149
- t("div", vt, [
1150
- e[59] || (e[59] = t("label", { for: "schedule-notes" }, "Notes", -1)),
1151
- c(t("textarea", {
1149
+ e("div", Ct, [
1150
+ t[59] || (t[59] = e("label", { for: "schedule-notes" }, "Notes", -1)),
1151
+ v(e("textarea", {
1152
1152
  id: "schedule-notes",
1153
- "onUpdate:modelValue": e[19] || (e[19] = (s) => n.form.notes = s)
1153
+ "onUpdate:modelValue": t[19] || (t[19] = (i) => n.form.notes = i)
1154
1154
  }, null, 512), [
1155
- [y, n.form.notes]
1155
+ [w, n.form.notes]
1156
1156
  ])
1157
1157
  ]),
1158
- t("div", ht, [
1159
- e[61] || (e[61] = t("label", null, "Attachments", -1)),
1160
- t("div", ft, [
1161
- t("p", null, d(n.imgText), 1),
1162
- t("input", {
1158
+ e("div", Dt, [
1159
+ t[61] || (t[61] = e("label", null, "Attachments", -1)),
1160
+ e("div", xt, [
1161
+ e("p", null, r(n.imgText), 1),
1162
+ e("input", {
1163
1163
  type: "file",
1164
1164
  id: "maintenance-files",
1165
1165
  class: "file-input",
1166
- onChange: e[20] || (e[20] = (...s) => o.handleFiles && o.handleFiles(...s)),
1166
+ onChange: t[20] || (t[20] = (...i) => a.handleFiles && a.handleFiles(...i)),
1167
1167
  multiple: ""
1168
1168
  }, null, 32),
1169
- e[60] || (e[60] = t("label", {
1169
+ t[60] || (t[60] = e("label", {
1170
1170
  for: "maintenance-files",
1171
1171
  class: "file-label"
1172
1172
  }, "Browse Files", -1))
1173
1173
  ])
1174
1174
  ]),
1175
- t("div", pt, [
1176
- t("button", {
1175
+ e("div", St, [
1176
+ e("button", {
1177
1177
  type: "button",
1178
1178
  class: "btn btn-primary",
1179
- onClick: e[21] || (e[21] = C((...s) => o.saveSchedule && o.saveSchedule(...s), ["prevent"])),
1179
+ onClick: t[21] || (t[21] = D((...i) => a.saveSchedule && a.saveSchedule(...i), ["prevent"])),
1180
1180
  disabled: n.isSaving
1181
- }, d(n.isSaving ? "Saving..." : "Save Schedule"), 9, gt)
1181
+ }, r(n.isSaving ? "Saving..." : "Save Schedule"), 9, Pt)
1182
1182
  ])
1183
1183
  ])
1184
1184
  ], 2), [
1185
- [_, n.activeSection === "schedule"]
1185
+ [P, n.activeSection === "schedule"]
1186
1186
  ]),
1187
- c(t("section", {
1188
- class: h(["form-section", { active: n.activeSection === "inventory" }])
1187
+ v(e("section", {
1188
+ class: g(["form-section", { active: n.activeSection === "inventory" }])
1189
1189
  }, [
1190
- e[68] || (e[68] = t("h2", null, "All Maintenance", -1)),
1191
- t("div", yt, [
1192
- t("div", bt, [
1193
- t("div", wt, [
1194
- t("button", {
1195
- class: h({ active: n.activeFilter === "due" }),
1196
- onClick: e[22] || (e[22] = (s) => o.setFilter("due"))
1190
+ t[68] || (t[68] = e("h2", null, "All Maintenance", -1)),
1191
+ e("div", At, [
1192
+ e("div", qt, [
1193
+ e("div", Tt, [
1194
+ e("button", {
1195
+ class: g({ active: n.activeFilter === "due" }),
1196
+ onClick: t[22] || (t[22] = (i) => a.setFilter("due"))
1197
1197
  }, "Due", 2),
1198
- t("button", {
1199
- class: h({ active: n.activeFilter === "all" }),
1200
- onClick: e[23] || (e[23] = (s) => o.setFilter("all"))
1198
+ e("button", {
1199
+ class: g({ active: n.activeFilter === "all" }),
1200
+ onClick: t[23] || (t[23] = (i) => a.setFilter("all"))
1201
1201
  }, "All", 2),
1202
- t("button", {
1203
- class: h({ active: n.activeFilter === "completed" }),
1204
- onClick: e[24] || (e[24] = (s) => o.setFilter("completed"))
1202
+ e("button", {
1203
+ class: g({ active: n.activeFilter === "completed" }),
1204
+ onClick: t[24] || (t[24] = (i) => a.setFilter("completed"))
1205
1205
  }, "Completed", 2),
1206
- c(t("input", {
1206
+ v(e("input", {
1207
1207
  type: "text",
1208
- "onUpdate:modelValue": e[25] || (e[25] = (s) => n.searchQuery = s),
1208
+ "onUpdate:modelValue": t[25] || (t[25] = (i) => n.searchQuery = i),
1209
1209
  placeholder: "Search..."
1210
1210
  }, null, 512), [
1211
- [y, n.searchQuery]
1211
+ [w, n.searchQuery]
1212
1212
  ])
1213
1213
  ])
1214
1214
  ]),
1215
- t("table", kt, [
1216
- e[63] || (e[63] = t("thead", null, [
1217
- t("tr", null, [
1218
- t("th", null, "Equipment"),
1219
- t("th", null, "Task Name"),
1220
- t("th", null, "Assigned To"),
1221
- t("th", null, "Intervals"),
1222
- t("th", null, "Remaining"),
1223
- t("th", null, "Next Due"),
1224
- t("th", null, "Status"),
1225
- t("th", null, "Action")
1215
+ e("table", It, [
1216
+ t[63] || (t[63] = e("thead", null, [
1217
+ e("tr", null, [
1218
+ e("th", null, "Equipment"),
1219
+ e("th", null, "Task Name"),
1220
+ e("th", null, "Assigned To"),
1221
+ e("th", null, "Intervals"),
1222
+ e("th", null, "Remaining"),
1223
+ e("th", null, "Next Due"),
1224
+ e("th", null, "Status"),
1225
+ e("th", null, "Action")
1226
1226
  ])
1227
1227
  ], -1)),
1228
- t("tbody", null, [
1229
- (r(!0), a(f, null, g(o.filteredTasks, (s) => (r(), a("tr", {
1230
- key: s.id
1228
+ e("tbody", null, [
1229
+ (o(!0), l(p, null, f(a.filteredTasks, (i) => (o(), l("tr", {
1230
+ key: i.id
1231
1231
  }, [
1232
- t("td", null, d(s.component), 1),
1233
- t("td", null, d(s.taskName), 1),
1234
- t("td", null, d(s.assignedTo), 1),
1235
- t("td", null, d(s.recurrence), 1),
1236
- t("td", null, d(s.remainingDays), 1),
1237
- t("td", null, d(s.nextDue), 1),
1238
- t("td", null, [
1239
- t("span", {
1240
- class: h(["status-badge", s.status.toLowerCase().replace(" ", "-")])
1241
- }, d(s.status), 3)
1232
+ e("td", null, r(i.component), 1),
1233
+ e("td", null, r(i.taskName), 1),
1234
+ e("td", null, r(i.assignedTo), 1),
1235
+ e("td", null, r(i.recurrence), 1),
1236
+ e("td", null, r(i.remainingDays), 1),
1237
+ e("td", null, r(i.nextDue), 1),
1238
+ e("td", null, [
1239
+ e("span", {
1240
+ class: g(["status-badge", i.status.toLowerCase().replace(" ", "-")])
1241
+ }, r(i.status), 3)
1242
1242
  ]),
1243
- t("td", null, [
1244
- s.status === "Completed" ? (r(), a("button", {
1243
+ e("td", null, [
1244
+ i.status === "Completed" ? (o(), l("button", {
1245
1245
  key: 0,
1246
- onClick: (m) => o.printMaintenance(s.component),
1246
+ onClick: (h) => a.printMaintenance(i.component),
1247
1247
  class: "status-action"
1248
- }, "Print", 8, Ct)) : (r(), a("button", {
1248
+ }, "Print", 8, Rt)) : (o(), l("button", {
1249
1249
  key: 1,
1250
- onClick: (m) => o.showMaintenance(s.component),
1250
+ onClick: (h) => a.showMaintenance(i.component),
1251
1251
  class: "status-action"
1252
- }, "Start", 8, _t))
1252
+ }, "Start", 8, Mt))
1253
1253
  ])
1254
1254
  ]))), 128))
1255
1255
  ])
1256
1256
  ]),
1257
- l.tasks.length ? u("", !0) : (r(), a("div", xt, [
1258
- t("div", St, [
1259
- e[65] || (e[65] = t("h4", { class: "alert-heading" }, "Such Empty!!!", -1)),
1260
- e[66] || (e[66] = t("p", null, "You have no maintenance, because you have not scheduled any for this ship.", -1)),
1261
- e[67] || (e[67] = t("hr", null, null, -1)),
1262
- t("p", Dt, [
1263
- e[64] || (e[64] = b("Navigate to the schedule tab, to start scheduling. Or click on this button to ", -1)),
1264
- t("button", {
1257
+ u.tasks.length ? m("", !0) : (o(), l("div", Vt, [
1258
+ e("div", Ft, [
1259
+ t[65] || (t[65] = e("h4", { class: "alert-heading" }, "Such Empty!!!", -1)),
1260
+ t[66] || (t[66] = e("p", null, "You have no maintenance, because you have not scheduled any for this ship.", -1)),
1261
+ t[67] || (t[67] = e("hr", null, null, -1)),
1262
+ e("p", Et, [
1263
+ t[64] || (t[64] = _("Navigate to the schedule tab, to start scheduling. Or click on this button to ", -1)),
1264
+ e("button", {
1265
1265
  type: "button",
1266
1266
  class: "btn btn-primary",
1267
- onClick: e[26] || (e[26] = (s) => o.switchSchedule())
1267
+ onClick: t[26] || (t[26] = (i) => a.switchSchedule())
1268
1268
  }, "Schedule")
1269
1269
  ])
1270
1270
  ])
1271
1271
  ]))
1272
1272
  ])
1273
1273
  ], 2), [
1274
- [_, n.activeSection === "inventory"]
1274
+ [P, n.activeSection === "inventory"]
1275
1275
  ])
1276
1276
  ], 512), [
1277
- [_, !n.showReport]
1277
+ [P, !n.showReport]
1278
1278
  ]),
1279
- c(t("div", At, [
1280
- e[89] || (e[89] = t("div", { class: "header" }, [
1281
- t("div", { class: "report-title" }, "MAINTENANCE TASK REPORT")
1279
+ v(e("div", Nt, [
1280
+ t[89] || (t[89] = e("div", { class: "header" }, [
1281
+ e("div", { class: "report-title" }, "MAINTENANCE TASK REPORT")
1282
1282
  ], -1)),
1283
- t("div", Tt, [
1284
- t("div", Pt, [
1285
- e[69] || (e[69] = t("div", { class: "info-label" }, "Report Generated:", -1)),
1286
- t("div", null, d(n.reportDate), 1)
1283
+ e("div", Ot, [
1284
+ e("div", Ut, [
1285
+ t[69] || (t[69] = e("div", { class: "info-label" }, "Report Generated:", -1)),
1286
+ e("div", null, r(n.reportDate), 1)
1287
1287
  ]),
1288
- t("div", Mt, [
1289
- e[70] || (e[70] = t("div", { class: "info-label" }, "Report ID:", -1)),
1290
- t("div", null, d(n.reportId), 1)
1288
+ e("div", Lt, [
1289
+ t[70] || (t[70] = e("div", { class: "info-label" }, "Report ID:", -1)),
1290
+ e("div", null, r(n.reportId), 1)
1291
1291
  ]),
1292
- t("div", Et, [
1293
- e[71] || (e[71] = t("div", { class: "info-label" }, "Total Tasks:", -1)),
1294
- t("div", null, d(n.maintenanceTasks.length), 1)
1292
+ e("div", jt, [
1293
+ t[71] || (t[71] = e("div", { class: "info-label" }, "Total Tasks:", -1)),
1294
+ e("div", null, r(n.maintenanceTasks.length), 1)
1295
1295
  ]),
1296
- e[72] || (e[72] = t("div", { class: "info-box" }, [
1297
- t("div", { class: "info-label" }, "Generated By:"),
1298
- t("div", null, "OceanHelm System")
1296
+ t[72] || (t[72] = e("div", { class: "info-box" }, [
1297
+ e("div", { class: "info-label" }, "Generated By:"),
1298
+ e("div", null, "OceanHelm System")
1299
1299
  ], -1))
1300
1300
  ]),
1301
- t("div", Vt, [
1302
- e[75] || (e[75] = t("div", { class: "section-title" }, "📊 Task Summary", -1)),
1303
- t("div", Nt, [
1304
- e[74] || (e[74] = k('<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)),
1305
- t("div", Lt, [
1306
- t("div", Ft, d(o.totalEstimatedHours), 1),
1307
- e[73] || (e[73] = t("div", { class: "summary-label" }, "Total Hours", -1))
1301
+ e("div", $t, [
1302
+ t[75] || (t[75] = e("div", { class: "section-title" }, "📊 Task Summary", -1)),
1303
+ e("div", Bt, [
1304
+ 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)),
1305
+ e("div", Ht, [
1306
+ e("div", Qt, r(a.totalEstimatedHours), 1),
1307
+ t[73] || (t[73] = e("div", { class: "summary-label" }, "Total Hours", -1))
1308
1308
  ])
1309
1309
  ])
1310
1310
  ]),
1311
- t("div", Ut, [
1312
- e[85] || (e[85] = t("div", { class: "section-title" }, "🔧 Maintenance Tasks", -1)),
1313
- (r(!0), a(f, null, g(n.maintenanceTasks, (s) => (r(), a("div", {
1314
- key: s.taskName,
1315
- class: h(["task-item", o.getTaskStatusClass(s)])
1311
+ e("div", Jt, [
1312
+ t[85] || (t[85] = e("div", { class: "section-title" }, "🔧 Maintenance Tasks", -1)),
1313
+ (o(!0), l(p, null, f(n.maintenanceTasks, (i) => (o(), l("div", {
1314
+ key: i.taskName,
1315
+ class: g(["task-item", a.getTaskStatusClass(i)])
1316
1316
  }, [
1317
- t("div", It, [
1318
- t("div", null, [
1319
- t("div", Rt, [
1320
- b(d(s.taskName) + " ", 1),
1321
- t("span", {
1322
- class: h(["maintenance-type", "type-" + s.maintenanceType])
1323
- }, d(s.maintenanceType), 3)
1317
+ e("div", Wt, [
1318
+ e("div", null, [
1319
+ e("div", Gt, [
1320
+ _(r(i.taskName) + " ", 1),
1321
+ e("span", {
1322
+ class: g(["maintenance-type", "type-" + i.maintenanceType])
1323
+ }, r(i.maintenanceType), 3)
1324
1324
  ]),
1325
- t("div", Ot, "Component: " + d(s.component), 1)
1325
+ e("div", zt, "Component: " + r(i.component), 1)
1326
1326
  ]),
1327
- t("span", {
1328
- class: h(["status-badge", "status-" + s.status.toLowerCase().replace(" ", "-")])
1329
- }, d(s.status), 3)
1327
+ e("span", {
1328
+ class: g(["status-badge", "status-" + i.status.toLowerCase().replace(" ", "-")])
1329
+ }, r(i.status), 3)
1330
1330
  ]),
1331
- t("div", Bt, [
1332
- t("div", Ht, [
1333
- e[76] || (e[76] = t("div", { class: "detail-label" }, "Assigned To", -1)),
1334
- t("div", qt, d(s.assignedTo), 1)
1331
+ e("div", Yt, [
1332
+ e("div", Kt, [
1333
+ t[76] || (t[76] = e("div", { class: "detail-label" }, "Assigned To", -1)),
1334
+ e("div", Xt, r(i.assignedTo), 1)
1335
1335
  ]),
1336
- t("div", jt, [
1337
- e[77] || (e[77] = t("div", { class: "detail-label" }, "Estimated Hours", -1)),
1338
- t("div", $t, d(s.estimatedHours) + " hours", 1)
1336
+ e("div", Zt, [
1337
+ t[77] || (t[77] = e("div", { class: "detail-label" }, "Estimated Hours", -1)),
1338
+ e("div", es, r(i.estimatedHours) + " hours", 1)
1339
1339
  ]),
1340
- t("div", Qt, [
1341
- e[78] || (e[78] = t("div", { class: "detail-label" }, "Last Performed", -1)),
1342
- t("div", zt, d(o.formatDate(s.lastPerformed)), 1)
1340
+ e("div", ts, [
1341
+ t[78] || (t[78] = e("div", { class: "detail-label" }, "Last Performed", -1)),
1342
+ e("div", ss, r(a.formatDate(i.lastPerformed)), 1)
1343
1343
  ]),
1344
- t("div", Yt, [
1345
- e[79] || (e[79] = t("div", { class: "detail-label" }, "Next Due", -1)),
1346
- t("div", Kt, d(o.formatDate(s.nextDue)), 1)
1344
+ e("div", is, [
1345
+ t[79] || (t[79] = e("div", { class: "detail-label" }, "Next Due", -1)),
1346
+ e("div", ns, r(a.formatDate(i.nextDue)), 1)
1347
1347
  ]),
1348
- t("div", Wt, [
1349
- e[80] || (e[80] = t("div", { class: "detail-label" }, "Recurrence", -1)),
1350
- t("div", Gt, d(s.recurrence), 1)
1348
+ e("div", os, [
1349
+ t[80] || (t[80] = e("div", { class: "detail-label" }, "Recurrence", -1)),
1350
+ e("div", ls, r(i.recurrence), 1)
1351
1351
  ]),
1352
- t("div", Jt, [
1353
- e[81] || (e[81] = t("div", { class: "detail-label" }, "Remaining Days", -1)),
1354
- t("div", Xt, d(s.remainingDays) + " days", 1)
1352
+ e("div", rs, [
1353
+ t[81] || (t[81] = e("div", { class: "detail-label" }, "Remaining Days", -1)),
1354
+ e("div", as, r(i.remainingDays) + " days", 1)
1355
1355
  ])
1356
1356
  ]),
1357
- s.description ? (r(), a("div", Zt, [
1358
- e[82] || (e[82] = t("div", { class: "detail-label" }, "Description", -1)),
1359
- t("div", es, d(s.description), 1)
1360
- ])) : u("", !0),
1361
- s.notes ? (r(), a("div", ts, [
1362
- e[83] || (e[83] = t("div", { class: "detail-label" }, "Notes", -1)),
1363
- t("div", ss, d(s.notes), 1)
1364
- ])) : u("", !0),
1365
- s.checklistProgress && s.checklistProgress.length > 0 ? (r(), a("div", is, [
1366
- e[84] || (e[84] = t("div", { class: "detail-label" }, "Checklist Progress", -1)),
1367
- t("div", ns, [
1368
- t("div", {
1357
+ i.description ? (o(), l("div", ds, [
1358
+ t[82] || (t[82] = e("div", { class: "detail-label" }, "Description", -1)),
1359
+ e("div", us, r(i.description), 1)
1360
+ ])) : m("", !0),
1361
+ i.notes ? (o(), l("div", cs, [
1362
+ t[83] || (t[83] = e("div", { class: "detail-label" }, "Notes", -1)),
1363
+ e("div", ms, r(i.notes), 1)
1364
+ ])) : m("", !0),
1365
+ i.checklistProgress && i.checklistProgress.length > 0 ? (o(), l("div", vs, [
1366
+ t[84] || (t[84] = e("div", { class: "detail-label" }, "Checklist Progress", -1)),
1367
+ e("div", ps, [
1368
+ e("div", {
1369
1369
  class: "progress-fill",
1370
- style: S({ width: o.getChecklistProgress(s) + "%" })
1370
+ style: E({ width: a.getChecklistProgress(i) + "%" })
1371
1371
  }, null, 4)
1372
1372
  ]),
1373
- t("div", ls, d(o.getCompletedChecklistItems(s)) + " of " + d(s.checklistProgress.length) + " items completed (" + d(o.getChecklistProgress(s)) + "%) ", 1),
1374
- t("div", os, [
1375
- (r(!0), a(f, null, g(s.checklistProgress, (m, p) => (r(), a("div", {
1376
- key: p,
1373
+ e("div", fs, r(a.getCompletedChecklistItems(i)) + " of " + r(i.checklistProgress.length) + " items completed (" + r(a.getChecklistProgress(i)) + "%) ", 1),
1374
+ e("div", hs, [
1375
+ (o(!0), l(p, null, f(i.checklistProgress, (h, k) => (o(), l("div", {
1376
+ key: k,
1377
1377
  class: "checklist-item"
1378
1378
  }, [
1379
- t("span", rs, d(m.completed ? "✅" : "⭕"), 1),
1380
- t("span", null, d(m.text || "Checklist Item " + (p + 1)), 1)
1379
+ e("span", gs, r(h.completed ? "✅" : "⭕"), 1),
1380
+ e("span", null, r(h.text || "Checklist Item " + (k + 1)), 1)
1381
1381
  ]))), 128))
1382
1382
  ])
1383
- ])) : u("", !0)
1383
+ ])) : m("", !0)
1384
1384
  ], 2))), 128))
1385
1385
  ]),
1386
- t("div", as, [
1387
- e[86] || (e[86] = t("div", { class: "section-title" }, "📋 Recommendations", -1)),
1388
- t("div", ds, [
1389
- t("ul", null, [
1390
- (r(!0), a(f, null, g(o.generateRecommendations(), (s) => (r(), a("li", { key: s }, d(s), 1))), 128))
1386
+ e("div", bs, [
1387
+ t[86] || (t[86] = e("div", { class: "section-title" }, "📋 Recommendations", -1)),
1388
+ e("div", ys, [
1389
+ e("ul", null, [
1390
+ (o(!0), l(p, null, f(a.generateRecommendations(), (i) => (o(), l("li", { key: i }, r(i), 1))), 128))
1391
1391
  ])
1392
1392
  ])
1393
1393
  ]),
1394
- t("div", cs, [
1395
- e[88] || (e[88] = t("div", { class: "signature-box" }, [
1396
- t("div", null, [
1397
- t("strong", null, "Report Generated By")
1394
+ e("div", ws, [
1395
+ t[88] || (t[88] = e("div", { class: "signature-box" }, [
1396
+ e("div", null, [
1397
+ e("strong", null, "Report Generated By")
1398
1398
  ]),
1399
- t("div", { style: { "margin-top": "10px", color: "#666" } }, "OceanHelm Maintenance System")
1399
+ e("div", { style: { "margin-top": "10px", color: "#666" } }, "OceanHelm Maintenance System")
1400
1400
  ], -1)),
1401
- t("div", us, [
1402
- e[87] || (e[87] = t("div", null, [
1403
- t("strong", null, "Date")
1401
+ e("div", ks, [
1402
+ t[87] || (t[87] = e("div", null, [
1403
+ e("strong", null, "Date")
1404
1404
  ], -1)),
1405
- t("div", ms, d(n.reportDate), 1)
1405
+ e("div", _s, r(n.reportDate), 1)
1406
1406
  ])
1407
1407
  ])
1408
1408
  ], 512), [
1409
- [_, n.showReport]
1409
+ [P, n.showReport]
1410
1410
  ])
1411
1411
  ])
1412
- ])) : u("", !0);
1412
+ ])) : m("", !0);
1413
1413
  }
1414
- const hs = /* @__PURE__ */ x(_e, [["render", vs]]);
1415
- const fs = {
1414
+ const Ds = /* @__PURE__ */ S(Me, [["render", Cs]]);
1415
+ const xs = {
1416
1416
  name: "ActivityLogs",
1417
1417
  props: {
1418
1418
  loading: Boolean,
@@ -1428,10 +1428,10 @@ const fs = {
1428
1428
  },
1429
1429
  emits: ["update:searchTerm", "update:selectedFilter", "refresh", "download", "change-page"],
1430
1430
  methods: {
1431
- formatDate(i) {
1432
- return new Date(i).toLocaleString();
1431
+ formatDate(s) {
1432
+ return new Date(s).toLocaleString();
1433
1433
  },
1434
- getBadgeClass(i) {
1434
+ getBadgeClass(s) {
1435
1435
  return {
1436
1436
  login: "badge-login",
1437
1437
  logout: "badge-logout",
@@ -1439,125 +1439,125 @@ const fs = {
1439
1439
  update: "badge-update",
1440
1440
  delete: "badge-delete",
1441
1441
  view: "badge-view"
1442
- }[i] || "badge-view";
1442
+ }[s] || "badge-view";
1443
1443
  }
1444
1444
  }
1445
- }, ps = { class: "activity-logs" }, gs = { class: "a-controls" }, ys = { class: "a-search-box" }, bs = ["value"], ws = ["value"], ks = { class: "stats-grid" }, Cs = { class: "stat-card" }, _s = { class: "value" }, xs = { class: "stat-card" }, Ss = { class: "value" }, Ds = { class: "stat-card" }, As = { class: "value" }, Ts = { class: "logs-container" }, Ps = {
1445
+ }, Ss = { class: "activity-logs" }, Ps = { class: "a-controls" }, As = { class: "a-search-box" }, qs = ["value"], Ts = ["value"], Is = { class: "stats-grid" }, Rs = { class: "stat-card" }, Ms = { class: "value" }, Vs = { class: "stat-card" }, Fs = { class: "value" }, Es = { class: "stat-card" }, Ns = { class: "value" }, Os = { class: "logs-container" }, Us = {
1446
1446
  key: 0,
1447
1447
  class: "loading"
1448
- }, Ms = {
1448
+ }, Ls = {
1449
1449
  key: 1,
1450
1450
  class: "no-logs"
1451
- }, Es = { key: 2 }, Vs = { class: "logs-table" }, Ns = { style: { color: "gray" } }, Ls = { style: { color: "gray" } }, Fs = { class: "pagination" }, Us = ["disabled"], Is = ["onClick"], Rs = ["disabled"];
1452
- function Os(i, e, l, v, n, o) {
1453
- return r(), a("div", ps, [
1454
- t("div", gs, [
1455
- t("div", ys, [
1456
- t("input", {
1451
+ }, js = { key: 2 }, $s = { class: "logs-table" }, Bs = { style: { color: "gray" } }, Hs = { style: { color: "gray" } }, Qs = { class: "pagination" }, Js = ["disabled"], Ws = ["onClick"], Gs = ["disabled"];
1452
+ function zs(s, t, u, b, n, a) {
1453
+ return o(), l("div", Ss, [
1454
+ e("div", Ps, [
1455
+ e("div", As, [
1456
+ e("input", {
1457
1457
  type: "text",
1458
1458
  placeholder: "Search activities, users, or actions...",
1459
- value: l.searchTerm,
1460
- onInput: e[0] || (e[0] = (s) => i.$emit("update:searchTerm", s.target.value))
1461
- }, null, 40, bs)
1459
+ value: u.searchTerm,
1460
+ onInput: t[0] || (t[0] = (i) => s.$emit("update:searchTerm", i.target.value))
1461
+ }, null, 40, qs)
1462
1462
  ]),
1463
- t("select", {
1463
+ e("select", {
1464
1464
  class: "filter-select",
1465
- value: l.selectedFilter,
1466
- onChange: e[1] || (e[1] = (s) => i.$emit("update:selectedFilter", s.target.value))
1467
- }, e[6] || (e[6] = [
1468
- k('<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)
1469
- ]), 40, ws),
1470
- t("button", {
1465
+ value: u.selectedFilter,
1466
+ onChange: t[1] || (t[1] = (i) => s.$emit("update:selectedFilter", i.target.value))
1467
+ }, t[6] || (t[6] = [
1468
+ 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)
1469
+ ]), 40, Ts),
1470
+ e("button", {
1471
1471
  class: "btn btn-primary",
1472
- onClick: e[2] || (e[2] = (s) => i.$emit("refresh"))
1472
+ onClick: t[2] || (t[2] = (i) => s.$emit("refresh"))
1473
1473
  }, "🔄 Refresh"),
1474
- t("button", {
1474
+ e("button", {
1475
1475
  class: "btn btn-secondary",
1476
- onClick: e[3] || (e[3] = (s) => i.$emit("download"))
1476
+ onClick: t[3] || (t[3] = (i) => s.$emit("download"))
1477
1477
  }, "📥 Download Report")
1478
1478
  ]),
1479
- t("div", ks, [
1480
- t("div", Cs, [
1481
- e[7] || (e[7] = t("h3", null, "Total Activities", -1)),
1482
- t("div", _s, d(l.totalActivities), 1)
1479
+ e("div", Is, [
1480
+ e("div", Rs, [
1481
+ t[7] || (t[7] = e("h3", null, "Total Activities", -1)),
1482
+ e("div", Ms, r(u.totalActivities), 1)
1483
1483
  ]),
1484
- t("div", xs, [
1485
- e[8] || (e[8] = t("h3", null, "Today's Activities", -1)),
1486
- t("div", Ss, d(l.todayActivities), 1)
1484
+ e("div", Vs, [
1485
+ t[8] || (t[8] = e("h3", null, "Today's Activities", -1)),
1486
+ e("div", Fs, r(u.todayActivities), 1)
1487
1487
  ]),
1488
- t("div", Ds, [
1489
- e[9] || (e[9] = t("h3", null, "Active Users", -1)),
1490
- t("div", As, d(l.activeUsers), 1)
1488
+ e("div", Es, [
1489
+ t[9] || (t[9] = e("h3", null, "Active Users", -1)),
1490
+ e("div", Ns, r(u.activeUsers), 1)
1491
1491
  ]),
1492
- e[10] || (e[10] = t("div", { class: "stat-card" }, [
1493
- t("h3", null, "Important"),
1494
- t("div", { class: "badge-danger" }, " Logs are deleted at the end of every month, please download a copy ")
1492
+ t[10] || (t[10] = e("div", { class: "stat-card" }, [
1493
+ e("h3", null, "Important"),
1494
+ e("div", { class: "badge-danger" }, " Logs are deleted at the end of every month, please download a copy ")
1495
1495
  ], -1))
1496
1496
  ]),
1497
- t("div", Ts, [
1498
- l.loading ? (r(), a("div", Ps, e[11] || (e[11] = [
1499
- t("div", { class: "spinner" }, null, -1),
1500
- t("p", null, "Loading activity logs...", -1)
1501
- ]))) : l.logs.length === 0 ? (r(), a("div", Ms, e[12] || (e[12] = [
1502
- t("h3", null, "No activities found", -1),
1503
- t("p", null, "Try adjusting your search or filter criteria", -1)
1504
- ]))) : (r(), a("div", Es, [
1505
- t("table", Vs, [
1506
- e[13] || (e[13] = t("thead", null, [
1507
- t("tr", null, [
1508
- t("th", null, "Timestamp"),
1509
- t("th", null, "User Name"),
1510
- t("th", null, "Action"),
1511
- t("th", null, "Details"),
1512
- t("th", null, "Section")
1497
+ e("div", Os, [
1498
+ u.loading ? (o(), l("div", Us, t[11] || (t[11] = [
1499
+ e("div", { class: "spinner" }, null, -1),
1500
+ e("p", null, "Loading activity logs...", -1)
1501
+ ]))) : u.logs.length === 0 ? (o(), l("div", Ls, t[12] || (t[12] = [
1502
+ e("h3", null, "No activities found", -1),
1503
+ e("p", null, "Try adjusting your search or filter criteria", -1)
1504
+ ]))) : (o(), l("div", js, [
1505
+ e("table", $s, [
1506
+ t[13] || (t[13] = e("thead", null, [
1507
+ e("tr", null, [
1508
+ e("th", null, "Timestamp"),
1509
+ e("th", null, "User Name"),
1510
+ e("th", null, "Action"),
1511
+ e("th", null, "Details"),
1512
+ e("th", null, "Section")
1513
1513
  ])
1514
1514
  ], -1)),
1515
- t("tbody", null, [
1516
- (r(!0), a(f, null, g(l.paginatedLogs, (s) => (r(), a("tr", {
1517
- key: s.id
1515
+ e("tbody", null, [
1516
+ (o(!0), l(p, null, f(u.paginatedLogs, (i) => (o(), l("tr", {
1517
+ key: i.id
1518
1518
  }, [
1519
- t("td", null, d(o.formatDate(s.timestamp)), 1),
1520
- t("td", null, [
1521
- t("div", null, d(s.user_name), 1),
1522
- t("small", Ns, d(s.email), 1)
1519
+ e("td", null, r(a.formatDate(i.timestamp)), 1),
1520
+ e("td", null, [
1521
+ e("div", null, r(i.user_name), 1),
1522
+ e("small", Bs, r(i.email), 1)
1523
1523
  ]),
1524
- t("td", null, [
1525
- t("span", {
1526
- class: h(["activity-badge", o.getBadgeClass(s.action)])
1527
- }, d(s.action), 3)
1524
+ e("td", null, [
1525
+ e("span", {
1526
+ class: g(["activity-badge", a.getBadgeClass(i.action)])
1527
+ }, r(i.action), 3)
1528
1528
  ]),
1529
- t("td", null, [
1530
- b(d(s.details.status) + " ", 1),
1531
- (r(!0), a(f, null, g(s.details.information, (m, p) => (r(), a("div", { key: p }, [
1532
- t("strong", null, d(p) + ": ", 1),
1533
- t("small", Ls, d(m.from || "") + " → " + d(m.to || m), 1)
1529
+ e("td", null, [
1530
+ _(r(i.details.status) + " ", 1),
1531
+ (o(!0), l(p, null, f(i.details.information, (h, k) => (o(), l("div", { key: k }, [
1532
+ e("strong", null, r(k) + ": ", 1),
1533
+ e("small", Hs, r(h.from || "") + " → " + r(h.to || h), 1)
1534
1534
  ]))), 128))
1535
1535
  ]),
1536
- t("td", null, d(s.table_name), 1)
1536
+ e("td", null, r(i.table_name), 1)
1537
1537
  ]))), 128))
1538
1538
  ])
1539
1539
  ]),
1540
- t("div", Fs, [
1541
- t("button", {
1542
- onClick: e[4] || (e[4] = (s) => i.$emit("change-page", l.currentPage - 1)),
1543
- disabled: l.currentPage === 1
1544
- }, " Previous ", 8, Us),
1545
- (r(!0), a(f, null, g(l.totalPages, (s) => (r(), a("button", {
1546
- key: s,
1547
- onClick: (m) => i.$emit("change-page", s),
1548
- class: h({ active: l.currentPage === s })
1549
- }, d(s), 11, Is))), 128)),
1550
- t("button", {
1551
- onClick: e[5] || (e[5] = (s) => i.$emit("change-page", l.currentPage + 1)),
1552
- disabled: l.currentPage === l.totalPages
1553
- }, " Next ", 8, Rs)
1540
+ e("div", Qs, [
1541
+ e("button", {
1542
+ onClick: t[4] || (t[4] = (i) => s.$emit("change-page", u.currentPage - 1)),
1543
+ disabled: u.currentPage === 1
1544
+ }, " Previous ", 8, Js),
1545
+ (o(!0), l(p, null, f(u.totalPages, (i) => (o(), l("button", {
1546
+ key: i,
1547
+ onClick: (h) => s.$emit("change-page", i),
1548
+ class: g({ active: u.currentPage === i })
1549
+ }, r(i), 11, Ws))), 128)),
1550
+ e("button", {
1551
+ onClick: t[5] || (t[5] = (i) => s.$emit("change-page", u.currentPage + 1)),
1552
+ disabled: u.currentPage === u.totalPages
1553
+ }, " Next ", 8, Gs)
1554
1554
  ])
1555
1555
  ]))
1556
1556
  ])
1557
1557
  ]);
1558
1558
  }
1559
- const Bs = /* @__PURE__ */ x(fs, [["render", Os]]);
1560
- const Hs = {
1559
+ const Ys = /* @__PURE__ */ S(xs, [["render", zs]]);
1560
+ const Ks = {
1561
1561
  name: "CrewManagement",
1562
1562
  props: {
1563
1563
  // Required props
@@ -1631,9 +1631,9 @@ const Hs = {
1631
1631
  return this.vesselName ? `Current Crew for ${this.vesselName}` : "All Fleet Crew";
1632
1632
  },
1633
1633
  filteredCrew() {
1634
- return this.crew.filter((i) => {
1635
- const e = this.searchQuery === "" || i.name.toLowerCase().includes(this.searchQuery.toLowerCase()) || i.role.toLowerCase().includes(this.searchQuery.toLowerCase()) || i.vessel && i.vessel.toLowerCase().includes(this.searchQuery.toLowerCase()), l = this.filterStatus === "all" || i.status === this.filterStatus;
1636
- return e && l;
1634
+ return this.crew.filter((s) => {
1635
+ 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;
1636
+ return t && u;
1637
1637
  });
1638
1638
  },
1639
1639
  canAddCrew() {
@@ -1651,15 +1651,15 @@ const Hs = {
1651
1651
  },
1652
1652
  methods: {
1653
1653
  // Permission checking
1654
- hasPermission(i) {
1655
- var v;
1656
- const { role: e } = this.userProfile;
1657
- return ((v = {
1654
+ hasPermission(s) {
1655
+ var b;
1656
+ const { role: t } = this.userProfile;
1657
+ return ((b = {
1658
1658
  owner: ["add", "edit", "delete", "assign", "view"],
1659
1659
  staff: ["add", "edit", "assign", "view"],
1660
1660
  captain: ["assign", "view"],
1661
1661
  viewer: ["view"]
1662
- }[e]) == null ? void 0 : v.includes(i)) || !1;
1662
+ }[t]) == null ? void 0 : b.includes(s)) || !1;
1663
1663
  },
1664
1664
  // Event handlers
1665
1665
  handleToggleAddForm() {
@@ -1678,47 +1678,47 @@ const Hs = {
1678
1678
  handleAddCrewMember() {
1679
1679
  if (!this.validateForm())
1680
1680
  return;
1681
- const i = this.newCrew.certifications.filter(
1682
- (v) => v.name.trim() !== "" && v.expiryDate !== ""
1683
- ), e = this.newCrew.role === "Other" ? this.newCrew.customRole : this.newCrew.role, l = {
1681
+ const s = this.newCrew.certifications.filter(
1682
+ (b) => b.name.trim() !== "" && b.expiryDate !== ""
1683
+ ), t = this.newCrew.role === "Other" ? this.newCrew.customRole : this.newCrew.role, u = {
1684
1684
  name: this.newCrew.name,
1685
- role: e,
1685
+ role: t,
1686
1686
  status: this.newCrew.status,
1687
- certifications: i,
1687
+ certifications: s,
1688
1688
  notes: this.newCrew.notes,
1689
1689
  vessel: this.vesselName,
1690
1690
  email: this.newCrew.email,
1691
1691
  onBoard: this.newCrew.onBoard,
1692
1692
  nextShift: this.newCrew.nextShift
1693
1693
  };
1694
- this.$emit("crew-add", l), this.resetForm(), this.showAddForm = !1;
1694
+ this.$emit("crew-add", u), this.resetForm(), this.showAddForm = !1;
1695
1695
  },
1696
1696
  handleCancelForm() {
1697
1697
  this.showAddForm = !1, this.resetForm();
1698
1698
  },
1699
- handleDeleteCrew(i) {
1699
+ handleDeleteCrew(s) {
1700
1700
  if (!this.canDeleteCrew) {
1701
1701
  this.$emit("access-denied", { action: "delete crew", userProfile: this.userProfile });
1702
1702
  return;
1703
1703
  }
1704
- this.$emit("crew-delete", i);
1704
+ this.$emit("crew-delete", s);
1705
1705
  },
1706
- handleAssignShift(i) {
1706
+ handleAssignShift(s) {
1707
1707
  if (!this.canAssignShift) {
1708
1708
  this.$emit("access-denied", { action: "assign shift", userProfile: this.userProfile });
1709
1709
  return;
1710
1710
  }
1711
- this.$emit("crew-assign-shift", i);
1711
+ this.$emit("crew-assign-shift", s);
1712
1712
  },
1713
- handleAddCertification(i) {
1713
+ handleAddCertification(s) {
1714
1714
  if (!this.canEditCrew) {
1715
1715
  this.$emit("access-denied", { action: "add certification", userProfile: this.userProfile });
1716
1716
  return;
1717
1717
  }
1718
- this.$emit("crew-add-certification", i);
1718
+ this.$emit("crew-add-certification", s);
1719
1719
  },
1720
- handleViewCertification(i, e) {
1721
- this.$emit("crew-view-certification", { certification: i, member: e });
1720
+ handleViewCertification(s, t) {
1721
+ this.$emit("crew-view-certification", { certification: s, member: t });
1722
1722
  },
1723
1723
  // Form management
1724
1724
  resetForm() {
@@ -1736,305 +1736,1172 @@ const Hs = {
1736
1736
  },
1737
1737
  validateForm() {
1738
1738
  this.formErrors = {};
1739
- const i = {
1739
+ const s = {
1740
1740
  name: "Full Name",
1741
1741
  email: "Email Address"
1742
1742
  };
1743
- return Object.keys(i).forEach((e) => {
1744
- (!this.newCrew[e] || this.newCrew[e].trim() === "") && (this.formErrors[e] = `${i[e]} is required`);
1743
+ return Object.keys(s).forEach((t) => {
1744
+ (!this.newCrew[t] || this.newCrew[t].trim() === "") && (this.formErrors[t] = `${s[t]} is required`);
1745
1745
  }), 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;
1746
1746
  },
1747
- isValidEmail(i) {
1748
- return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i);
1747
+ isValidEmail(s) {
1748
+ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s);
1749
1749
  },
1750
1750
  addCertificationEntry() {
1751
1751
  this.newCrew.certifications.push({ name: "", expiryDate: "" });
1752
1752
  },
1753
- removeCertification(i) {
1754
- this.newCrew.certifications.splice(i, 1);
1753
+ removeCertification(s) {
1754
+ this.newCrew.certifications.splice(s, 1);
1755
1755
  },
1756
1756
  // Utility methods
1757
- formatStatus(i) {
1758
- return i ? i.charAt(0).toUpperCase() + i.slice(1) : "";
1757
+ formatStatus(s) {
1758
+ return s ? s.charAt(0).toUpperCase() + s.slice(1) : "";
1759
1759
  },
1760
- getStatusClass(i) {
1760
+ getStatusClass(s) {
1761
1761
  return {
1762
1762
  available: "status-available",
1763
1763
  onduty: "status-onduty",
1764
1764
  unavailable: "status-unavailable"
1765
- }[i] || "";
1765
+ }[s] || "";
1766
1766
  },
1767
- getCertificationClass(i) {
1768
- const e = this.getExpiryStatus(i);
1767
+ getCertificationClass(s) {
1768
+ const t = this.getExpiryStatus(s);
1769
1769
  return {
1770
1770
  expired: "text-danger",
1771
1771
  expiringSoon: "text-warning",
1772
1772
  valid: "text-success"
1773
- }[e] || "";
1773
+ }[t] || "";
1774
1774
  },
1775
- getExpiryStatus(i) {
1776
- if (!i)
1775
+ getExpiryStatus(s) {
1776
+ if (!s)
1777
1777
  return "none";
1778
- const e = new Date(i), l = /* @__PURE__ */ new Date(), v = /* @__PURE__ */ new Date();
1779
- return v.setMonth(l.getMonth() + 1), e <= l ? "expired" : e <= v ? "expiringSoon" : "valid";
1778
+ const t = new Date(s), u = /* @__PURE__ */ new Date(), b = /* @__PURE__ */ new Date();
1779
+ return b.setMonth(u.getMonth() + 1), t <= u ? "expired" : t <= b ? "expiringSoon" : "valid";
1780
1780
  }
1781
1781
  }
1782
- }, qs = { class: "crew-management" }, js = {
1782
+ }, Xs = { class: "crew-management" }, Zs = {
1783
1783
  key: 0,
1784
1784
  class: "wave-bg"
1785
- }, $s = { class: "crew-section" }, Qs = { class: "section-header" }, zs = { class: "search-filter" }, Ys = {
1785
+ }, ei = { class: "crew-section" }, ti = { class: "crew-section-header" }, si = { class: "search-filter" }, ii = {
1786
1786
  key: 0,
1787
1787
  class: "loading-state"
1788
- }, Ks = {
1788
+ }, ni = {
1789
1789
  key: 1,
1790
1790
  class: "crew-grid"
1791
- }, Ws = { class: "crew-name" }, Gs = { class: "crew-role" }, Js = { class: "crew-certifications" }, Xs = ["onClick"], Zs = ["onClick"], ei = { class: "crew-availability" }, ti = { class: "crew-availability" }, si = { class: "action-buttons" }, ii = {
1791
+ }, oi = { class: "crew-name" }, li = { class: "crew-role" }, ri = { class: "crew-certifications" }, ai = ["onClick"], di = ["onClick"], ui = { class: "crew-availability" }, ci = { class: "crew-availability" }, mi = { class: "action-buttons" }, vi = {
1792
1792
  key: 0,
1793
1793
  class: "status-available crew-availability vcard"
1794
- }, ni = {
1794
+ }, pi = {
1795
1795
  key: 1,
1796
1796
  class: "status-unavailable crew-availability vcard"
1797
- }, li = ["onClick"], oi = ["onClick"], ri = {
1797
+ }, fi = ["onClick"], hi = ["onClick"], gi = {
1798
1798
  key: 2,
1799
1799
  class: "no-results"
1800
- }, ai = {
1800
+ }, bi = {
1801
1801
  key: 3,
1802
1802
  class: "add-crew-form"
1803
- }, di = { class: "form-row" }, ci = { class: "form-group" }, ui = {
1803
+ }, yi = { class: "form-row" }, wi = { class: "form-group" }, ki = {
1804
1804
  key: 0,
1805
1805
  class: "error-message"
1806
- }, mi = { class: "form-group" }, vi = ["value"], hi = { class: "form-row" }, fi = { class: "form-group" }, pi = { class: "form-group" }, gi = {
1806
+ }, _i = { class: "form-group" }, Ci = ["value"], Di = { class: "form-row" }, xi = { class: "form-group" }, Si = { class: "form-group" }, Pi = {
1807
1807
  key: 0,
1808
1808
  class: "error-message"
1809
- }, yi = { class: "certification-section" }, bi = { class: "form-row" }, wi = { class: "form-group" }, ki = ["onUpdate:modelValue"], Ci = { class: "form-group" }, _i = ["onUpdate:modelValue"], xi = { class: "form-group" }, Si = ["onClick"], Di = { class: "form-row" }, Ai = { class: "form-group" }, Ti = { class: "form-actions" };
1810
- function Pi(i, e, l, v, n, o) {
1811
- return r(), a("div", qs, [
1812
- l.config.showWaveBackground ? (r(), a("div", js)) : u("", !0),
1813
- t("div", $s, [
1814
- t("div", Qs, [
1815
- t("h2", null, d(o.sectionTitle), 1),
1816
- o.canAddCrew ? (r(), a("button", {
1809
+ }, Ai = { class: "certification-section" }, qi = { class: "form-row" }, Ti = { class: "form-group" }, Ii = ["onUpdate:modelValue"], Ri = { class: "form-group" }, Mi = ["onUpdate:modelValue"], Vi = { class: "form-group" }, Fi = ["onClick"], Ei = { class: "form-row" }, Ni = { class: "form-group" }, Oi = { class: "form-actions" };
1810
+ function Ui(s, t, u, b, n, a) {
1811
+ return o(), l("div", Xs, [
1812
+ u.config.showWaveBackground ? (o(), l("div", Zs)) : m("", !0),
1813
+ e("div", ei, [
1814
+ e("div", ti, [
1815
+ e("h2", null, r(a.sectionTitle), 1),
1816
+ a.canAddCrew ? (o(), l("button", {
1817
1817
  key: 0,
1818
1818
  class: "btn btn-primary",
1819
- onClick: e[0] || (e[0] = (...s) => o.handleToggleAddForm && o.handleToggleAddForm(...s))
1820
- }, d(n.showAddForm ? "Cancel" : "+ Add Crew Member"), 1)) : u("", !0)
1819
+ onClick: t[0] || (t[0] = (...i) => a.handleToggleAddForm && a.handleToggleAddForm(...i))
1820
+ }, r(n.showAddForm ? "Cancel" : "+ Add Crew Member"), 1)) : m("", !0)
1821
1821
  ]),
1822
- t("div", zs, [
1823
- c(t("input", {
1822
+ e("div", si, [
1823
+ v(e("input", {
1824
1824
  type: "text",
1825
1825
  placeholder: "Search crew by name or role...",
1826
- "onUpdate:modelValue": e[1] || (e[1] = (s) => n.searchQuery = s),
1827
- onInput: e[2] || (e[2] = (...s) => o.handleSearch && o.handleSearch(...s))
1826
+ "onUpdate:modelValue": t[1] || (t[1] = (i) => n.searchQuery = i),
1827
+ onInput: t[2] || (t[2] = (...i) => a.handleSearch && a.handleSearch(...i))
1828
1828
  }, null, 544), [
1829
- [y, n.searchQuery]
1829
+ [w, n.searchQuery]
1830
1830
  ]),
1831
- c(t("select", {
1832
- "onUpdate:modelValue": e[3] || (e[3] = (s) => n.filterStatus = s),
1833
- onChange: e[4] || (e[4] = (...s) => o.handleFilter && o.handleFilter(...s))
1834
- }, e[14] || (e[14] = [
1835
- t("option", { value: "all" }, "All Statuses", -1),
1836
- t("option", { value: "available" }, "Available", -1),
1837
- t("option", { value: "onduty" }, "On Duty", -1),
1838
- t("option", { value: "unavailable" }, "Unavailable", -1)
1831
+ v(e("select", {
1832
+ "onUpdate:modelValue": t[3] || (t[3] = (i) => n.filterStatus = i),
1833
+ onChange: t[4] || (t[4] = (...i) => a.handleFilter && a.handleFilter(...i))
1834
+ }, t[14] || (t[14] = [
1835
+ e("option", { value: "all" }, "All Statuses", -1),
1836
+ e("option", { value: "available" }, "Available", -1),
1837
+ e("option", { value: "onduty" }, "On Duty", -1),
1838
+ e("option", { value: "unavailable" }, "Unavailable", -1)
1839
1839
  ]), 544), [
1840
- [w, n.filterStatus]
1840
+ [C, n.filterStatus]
1841
1841
  ])
1842
1842
  ]),
1843
- l.loading ? (r(), a("div", Ys, e[15] || (e[15] = [
1844
- t("div", {
1843
+ u.loading ? (o(), l("div", ii, t[15] || (t[15] = [
1844
+ e("div", {
1845
1845
  class: "spinner-border text-primary",
1846
1846
  role: "status"
1847
1847
  }, [
1848
- t("span", { class: "visually-hidden" }, "Loading crew...")
1848
+ e("span", { class: "visually-hidden" }, "Loading crew...")
1849
1849
  ], -1),
1850
- t("p", null, "Loading crew members...", -1)
1851
- ]))) : o.filteredCrew.length > 0 ? (r(), a("div", Ks, [
1852
- (r(!0), a(f, null, g(o.filteredCrew, (s) => (r(), a("div", {
1853
- key: s.id,
1854
- class: h(["crew-card", { unavailable: s.status === "unavailable" }])
1850
+ e("p", null, "Loading crew members...", -1)
1851
+ ]))) : a.filteredCrew.length > 0 ? (o(), l("div", ni, [
1852
+ (o(!0), l(p, null, f(a.filteredCrew, (i) => (o(), l("div", {
1853
+ key: i.id,
1854
+ class: g(["crew-card", { unavailable: i.status === "unavailable" }])
1855
1855
  }, [
1856
- t("div", {
1857
- class: h(["status-badge", o.getStatusClass(s.status)])
1858
- }, d(o.formatStatus(s.status)), 3),
1859
- t("div", Ws, d(s.name), 1),
1860
- t("div", Gs, d(s.role), 1),
1861
- t("div", Js, [
1862
- (r(!0), a(f, null, g(s.certifications, (m) => (r(), a("div", {
1863
- key: m.name,
1864
- class: h(["certification-tag", o.getCertificationClass(m.expiryDate)]),
1865
- onClick: (p) => o.handleViewCertification(m, s)
1866
- }, d(m.name), 11, Xs))), 128)),
1867
- o.canEditCrew ? (r(), a("i", {
1856
+ e("div", {
1857
+ class: g(["status-badge", a.getStatusClass(i.status)])
1858
+ }, r(a.formatStatus(i.status)), 3),
1859
+ e("div", oi, r(i.name), 1),
1860
+ e("div", li, r(i.role), 1),
1861
+ e("div", ri, [
1862
+ (o(!0), l(p, null, f(i.certifications, (h) => (o(), l("div", {
1863
+ key: h.name,
1864
+ class: g(["certification-tag", a.getCertificationClass(h.expiryDate)]),
1865
+ onClick: (k) => a.handleViewCertification(h, i)
1866
+ }, r(h.name), 11, ai))), 128)),
1867
+ a.canEditCrew ? (o(), l("i", {
1868
1868
  key: 0,
1869
1869
  class: "bi bi-patch-plus-fill icon",
1870
- onClick: (m) => o.handleAddCertification(s)
1871
- }, null, 8, Zs)) : u("", !0)
1870
+ onClick: (h) => a.handleAddCertification(i)
1871
+ }, null, 8, di)) : m("", !0)
1872
1872
  ]),
1873
- t("div", ei, [
1874
- e[16] || (e[16] = t("strong", null, "Embarkation Date:", -1)),
1875
- b(" " + d(s.nextShift || "Not Scheduled"), 1)
1873
+ e("div", ui, [
1874
+ t[16] || (t[16] = e("strong", null, "Embarkation Date:", -1)),
1875
+ _(" " + r(i.nextShift || "Not Scheduled"), 1)
1876
1876
  ]),
1877
- t("div", ti, [
1878
- e[17] || (e[17] = t("strong", null, "Expected Days Onboard (in days):", -1)),
1879
- b(" " + d(s.onBoard || "Not Scheduled"), 1)
1877
+ e("div", ci, [
1878
+ t[17] || (t[17] = e("strong", null, "Expected Days Onboard (in days):", -1)),
1879
+ _(" " + r(i.onBoard || "Not Scheduled"), 1)
1880
1880
  ]),
1881
- t("div", si, [
1882
- s.vessel ? (r(), a("div", ii, " Vessel: " + d(s.vessel), 1)) : (r(), a("div", ni, " Vessel: Unassigned ")),
1883
- o.canAssignShift ? (r(), a("button", {
1881
+ e("div", mi, [
1882
+ i.vessel ? (o(), l("div", vi, " Vessel: " + r(i.vessel), 1)) : (o(), l("div", pi, " Vessel: Unassigned ")),
1883
+ a.canAssignShift ? (o(), l("button", {
1884
1884
  key: 2,
1885
1885
  class: "btn btn-primary",
1886
- onClick: (m) => o.handleAssignShift(s)
1887
- }, " Assign Shift ", 8, li)) : u("", !0)
1886
+ onClick: (h) => a.handleAssignShift(i)
1887
+ }, " Assign Shift ", 8, fi)) : m("", !0)
1888
1888
  ]),
1889
- o.canDeleteCrew ? (r(), a("i", {
1889
+ a.canDeleteCrew ? (o(), l("i", {
1890
1890
  key: 0,
1891
1891
  class: "bi bi-trash icon delete-icon",
1892
- onClick: (m) => o.handleDeleteCrew(s)
1893
- }, null, 8, oi)) : u("", !0)
1892
+ onClick: (h) => a.handleDeleteCrew(i)
1893
+ }, null, 8, hi)) : m("", !0)
1894
1894
  ], 2))), 128))
1895
- ])) : l.loading ? u("", !0) : (r(), a("div", ri, d(l.crew.length === 0 ? "No crew members found." : "No crew members found matching your search criteria."), 1)),
1896
- n.showAddForm ? (r(), a("div", ai, [
1897
- e[28] || (e[28] = t("h2", null, "Add New Crew Member", -1)),
1898
- t("div", di, [
1899
- t("div", ci, [
1900
- e[18] || (e[18] = t("label", { for: "crew-name" }, "Full Name *", -1)),
1901
- c(t("input", {
1895
+ ])) : u.loading ? m("", !0) : (o(), l("div", gi, r(u.crew.length === 0 ? "No crew members found." : "No crew members found matching your search criteria."), 1)),
1896
+ n.showAddForm ? (o(), l("div", bi, [
1897
+ t[28] || (t[28] = e("h2", null, "Add New Crew Member", -1)),
1898
+ e("div", yi, [
1899
+ e("div", wi, [
1900
+ t[18] || (t[18] = e("label", { for: "crew-name" }, "Full Name *", -1)),
1901
+ v(e("input", {
1902
1902
  type: "text",
1903
1903
  id: "crew-name",
1904
- "onUpdate:modelValue": e[5] || (e[5] = (s) => n.newCrew.name = s),
1905
- class: h({ error: n.formErrors.name })
1904
+ "onUpdate:modelValue": t[5] || (t[5] = (i) => n.newCrew.name = i),
1905
+ class: g({ error: n.formErrors.name })
1906
1906
  }, null, 2), [
1907
- [y, n.newCrew.name]
1907
+ [w, n.newCrew.name]
1908
1908
  ]),
1909
- n.formErrors.name ? (r(), a("div", ui, d(n.formErrors.name), 1)) : u("", !0)
1909
+ n.formErrors.name ? (o(), l("div", ki, r(n.formErrors.name), 1)) : m("", !0)
1910
1910
  ]),
1911
- t("div", mi, [
1912
- e[20] || (e[20] = t("label", { for: "crew-role" }, "Role/Position *", -1)),
1913
- c(t("select", {
1911
+ e("div", _i, [
1912
+ t[20] || (t[20] = e("label", { for: "crew-role" }, "Role/Position *", -1)),
1913
+ v(e("select", {
1914
1914
  id: "crew-role",
1915
- "onUpdate:modelValue": e[6] || (e[6] = (s) => n.newCrew.role = s)
1915
+ "onUpdate:modelValue": t[6] || (t[6] = (i) => n.newCrew.role = i)
1916
1916
  }, [
1917
- (r(!0), a(f, null, g(l.availableRoles, (s) => (r(), a("option", {
1918
- key: s,
1919
- value: s
1920
- }, d(s), 9, vi))), 128)),
1921
- e[19] || (e[19] = t("option", { value: "Other" }, "Other", -1))
1917
+ (o(!0), l(p, null, f(u.availableRoles, (i) => (o(), l("option", {
1918
+ key: i,
1919
+ value: i
1920
+ }, r(i), 9, Ci))), 128)),
1921
+ t[19] || (t[19] = e("option", { value: "Other" }, "Other", -1))
1922
1922
  ], 512), [
1923
- [w, n.newCrew.role]
1923
+ [C, n.newCrew.role]
1924
1924
  ]),
1925
- n.newCrew.role === "Other" ? c((r(), a("input", {
1925
+ n.newCrew.role === "Other" ? v((o(), l("input", {
1926
1926
  key: 0,
1927
1927
  type: "text",
1928
1928
  placeholder: "Enter custom role",
1929
- "onUpdate:modelValue": e[7] || (e[7] = (s) => n.newCrew.customRole = s),
1929
+ "onUpdate:modelValue": t[7] || (t[7] = (i) => n.newCrew.customRole = i),
1930
1930
  style: { "margin-top": "8px" }
1931
1931
  }, null, 512)), [
1932
- [y, n.newCrew.customRole]
1933
- ]) : u("", !0)
1932
+ [w, n.newCrew.customRole]
1933
+ ]) : m("", !0)
1934
1934
  ])
1935
1935
  ]),
1936
- t("div", hi, [
1937
- t("div", fi, [
1938
- e[22] || (e[22] = t("label", { for: "crew-status" }, "Status *", -1)),
1939
- c(t("select", {
1936
+ e("div", Di, [
1937
+ e("div", xi, [
1938
+ t[22] || (t[22] = e("label", { for: "crew-status" }, "Status *", -1)),
1939
+ v(e("select", {
1940
1940
  id: "crew-status",
1941
- "onUpdate:modelValue": e[8] || (e[8] = (s) => n.newCrew.status = s)
1942
- }, e[21] || (e[21] = [
1943
- t("option", { value: "available" }, "Available", -1),
1944
- t("option", { value: "onduty" }, "On Duty", -1),
1945
- t("option", { value: "unavailable" }, "Unavailable", -1)
1941
+ "onUpdate:modelValue": t[8] || (t[8] = (i) => n.newCrew.status = i)
1942
+ }, t[21] || (t[21] = [
1943
+ e("option", { value: "available" }, "Available", -1),
1944
+ e("option", { value: "onduty" }, "On Duty", -1),
1945
+ e("option", { value: "unavailable" }, "Unavailable", -1)
1946
1946
  ]), 512), [
1947
- [w, n.newCrew.status]
1947
+ [C, n.newCrew.status]
1948
1948
  ])
1949
1949
  ]),
1950
- t("div", pi, [
1951
- e[23] || (e[23] = t("label", { for: "crew-email" }, "Email Address *", -1)),
1952
- c(t("input", {
1950
+ e("div", Si, [
1951
+ t[23] || (t[23] = e("label", { for: "crew-email" }, "Email Address *", -1)),
1952
+ v(e("input", {
1953
1953
  type: "email",
1954
1954
  id: "crew-email",
1955
- "onUpdate:modelValue": e[9] || (e[9] = (s) => n.newCrew.email = s),
1956
- class: h({ error: n.formErrors.email })
1955
+ "onUpdate:modelValue": t[9] || (t[9] = (i) => n.newCrew.email = i),
1956
+ class: g({ error: n.formErrors.email })
1957
1957
  }, null, 2), [
1958
- [y, n.newCrew.email]
1958
+ [w, n.newCrew.email]
1959
1959
  ]),
1960
- n.formErrors.email ? (r(), a("div", gi, d(n.formErrors.email), 1)) : u("", !0)
1960
+ n.formErrors.email ? (o(), l("div", Pi, r(n.formErrors.email), 1)) : m("", !0)
1961
1961
  ])
1962
1962
  ]),
1963
- t("div", yi, [
1964
- e[26] || (e[26] = t("h3", null, "Certifications", -1)),
1965
- (r(!0), a(f, null, g(n.newCrew.certifications, (s, m) => (r(), a("div", {
1966
- key: m,
1963
+ e("div", Ai, [
1964
+ t[26] || (t[26] = e("h3", null, "Certifications", -1)),
1965
+ (o(!0), l(p, null, f(n.newCrew.certifications, (i, h) => (o(), l("div", {
1966
+ key: h,
1967
1967
  class: "certification-entry"
1968
1968
  }, [
1969
- t("div", bi, [
1970
- t("div", wi, [
1971
- e[24] || (e[24] = t("label", null, "Certification Name", -1)),
1972
- c(t("input", {
1969
+ e("div", qi, [
1970
+ e("div", Ti, [
1971
+ t[24] || (t[24] = e("label", null, "Certification Name", -1)),
1972
+ v(e("input", {
1973
1973
  type: "text",
1974
- "onUpdate:modelValue": (p) => s.name = p,
1974
+ "onUpdate:modelValue": (k) => i.name = k,
1975
1975
  placeholder: "Enter certification name"
1976
- }, null, 8, ki), [
1977
- [y, s.name]
1976
+ }, null, 8, Ii), [
1977
+ [w, i.name]
1978
1978
  ])
1979
1979
  ]),
1980
- t("div", Ci, [
1981
- e[25] || (e[25] = t("label", null, "Expiry Date", -1)),
1982
- c(t("input", {
1980
+ e("div", Ri, [
1981
+ t[25] || (t[25] = e("label", null, "Expiry Date", -1)),
1982
+ v(e("input", {
1983
1983
  type: "date",
1984
- "onUpdate:modelValue": (p) => s.expiryDate = p
1985
- }, null, 8, _i), [
1986
- [y, s.expiryDate]
1984
+ "onUpdate:modelValue": (k) => i.expiryDate = k
1985
+ }, null, 8, Mi), [
1986
+ [w, i.expiryDate]
1987
1987
  ])
1988
1988
  ]),
1989
- t("div", xi, [
1990
- n.newCrew.certifications.length > 1 ? (r(), a("button", {
1989
+ e("div", Vi, [
1990
+ n.newCrew.certifications.length > 1 ? (o(), l("button", {
1991
1991
  key: 0,
1992
1992
  type: "button",
1993
1993
  class: "btn btn-danger btn-sm",
1994
- onClick: (p) => o.removeCertification(m)
1995
- }, " Remove ", 8, Si)) : u("", !0)
1994
+ onClick: (k) => a.removeCertification(h)
1995
+ }, " Remove ", 8, Fi)) : m("", !0)
1996
1996
  ])
1997
1997
  ])
1998
1998
  ]))), 128)),
1999
- t("button", {
1999
+ e("button", {
2000
2000
  type: "button",
2001
2001
  class: "btn btn-secondary btn-sm",
2002
- onClick: e[10] || (e[10] = (...s) => o.addCertificationEntry && o.addCertificationEntry(...s))
2002
+ onClick: t[10] || (t[10] = (...i) => a.addCertificationEntry && a.addCertificationEntry(...i))
2003
2003
  }, " + Add More Certification ")
2004
2004
  ]),
2005
- t("div", Di, [
2006
- t("div", Ai, [
2007
- e[27] || (e[27] = t("label", { for: "crew-notes" }, "Notes", -1)),
2008
- c(t("textarea", {
2005
+ e("div", Ei, [
2006
+ e("div", Ni, [
2007
+ t[27] || (t[27] = e("label", { for: "crew-notes" }, "Notes", -1)),
2008
+ v(e("textarea", {
2009
2009
  id: "crew-notes",
2010
2010
  rows: "3",
2011
- "onUpdate:modelValue": e[11] || (e[11] = (s) => n.newCrew.notes = s)
2011
+ "onUpdate:modelValue": t[11] || (t[11] = (i) => n.newCrew.notes = i)
2012
2012
  }, null, 512), [
2013
- [y, n.newCrew.notes]
2013
+ [w, n.newCrew.notes]
2014
2014
  ])
2015
2015
  ])
2016
2016
  ]),
2017
- t("div", Ti, [
2018
- t("button", {
2017
+ e("div", Oi, [
2018
+ e("button", {
2019
2019
  class: "btn btn-secondary",
2020
- onClick: e[12] || (e[12] = (...s) => o.handleCancelForm && o.handleCancelForm(...s))
2020
+ onClick: t[12] || (t[12] = (...i) => a.handleCancelForm && a.handleCancelForm(...i))
2021
2021
  }, "Cancel"),
2022
- t("button", {
2022
+ e("button", {
2023
2023
  class: "btn btn-primary",
2024
- onClick: e[13] || (e[13] = (...s) => o.handleAddCrewMember && o.handleAddCrewMember(...s))
2024
+ onClick: t[13] || (t[13] = (...i) => a.handleAddCrewMember && a.handleAddCrewMember(...i))
2025
2025
  }, "Add Crew Member")
2026
2026
  ])
2027
- ])) : u("", !0)
2027
+ ])) : m("", !0)
2028
2028
  ])
2029
2029
  ]);
2030
2030
  }
2031
- const Mi = /* @__PURE__ */ x(Hs, [["render", Pi]]), Ni = (i = {}) => ({
2032
- brandName: i.brandName || "OceanHelm",
2033
- logoIcon: i.logoIcon || "bi bi-water",
2034
- showLogo: i.showLogo !== !1,
2035
- responsive: i.responsive !== !1,
2036
- ...i
2037
- }), Li = [
2031
+ const Li = /* @__PURE__ */ S(Ks, [["render", Ui]]);
2032
+ const ji = {
2033
+ name: "RequisitionSystem",
2034
+ props: {
2035
+ userProfile: {
2036
+ type: Object,
2037
+ required: !0
2038
+ },
2039
+ userRole: {
2040
+ type: String,
2041
+ required: !0
2042
+ },
2043
+ requisitions: {
2044
+ type: Array,
2045
+ default: () => []
2046
+ },
2047
+ vessels: {
2048
+ type: Array,
2049
+ default: () => []
2050
+ }
2051
+ },
2052
+ emits: [
2053
+ "submit-requisition",
2054
+ "submit-info-response",
2055
+ "approve-requisition",
2056
+ "decline-requisition",
2057
+ "info-requisition",
2058
+ "create-po",
2059
+ "open-po",
2060
+ "finish-po",
2061
+ "accept-delivery"
2062
+ ],
2063
+ data() {
2064
+ return {
2065
+ activeTab: "workflow",
2066
+ isPrinting: !1,
2067
+ infoResponse: "",
2068
+ // Tabs with visibility rules
2069
+ tabs: [
2070
+ { name: "new-requisition", label: "New Requisition", roles: ["requisitor"] },
2071
+ { name: "my-requisitions", label: "My Requisitions", roles: ["requisitor"] },
2072
+ { name: "all-requisitions", label: "All Requisitions", roles: ["requisitor", "supervisor", "captain", "owner", "purchaser"] },
2073
+ { name: "approvals", label: "Pending Approvals", roles: ["owner", "supervisor", "captain"] },
2074
+ { name: "purchasing", label: "Purchasing Queue", roles: ["purchaser"] },
2075
+ { name: "receiving", label: "Receiving", roles: ["requisitor"] },
2076
+ { name: "workflow", label: "Workflow Guide", roles: ["requisitor", "supervisor", "owner", "purchaser", "captain"] }
2077
+ ],
2078
+ // Form State
2079
+ form: {
2080
+ requestor: "",
2081
+ department: "",
2082
+ project: "",
2083
+ neededDate: "",
2084
+ justification: "",
2085
+ items: []
2086
+ },
2087
+ poDetails: {
2088
+ editing: !1,
2089
+ items: []
2090
+ },
2091
+ vendorInfo: {},
2092
+ justificationText: "",
2093
+ currentItemIndex: null,
2094
+ showJustificationModal: !1,
2095
+ // common fields
2096
+ requisitionFields: [
2097
+ { label: "Requestor", value: (s) => s.requestor },
2098
+ { label: "Department", value: (s) => s.department },
2099
+ { label: "Project", value: (s) => s.project || "N/A" },
2100
+ { label: "Submitted", value: (s) => s.submittedDate },
2101
+ { label: "Items", value: (s) => `${s.items.length} item(s)` }
2102
+ ],
2103
+ // Fields for My Requisitions display
2104
+ requisitionFieldsMap: {
2105
+ approved: [
2106
+ { label: "Approved By", value: (s) => s.approvedBy }
2107
+ ],
2108
+ declined: [
2109
+ { label: "Declined By", value: (s) => s.declinedBy },
2110
+ { label: "Rejection Reason", value: (s) => s.rejectionReason }
2111
+ ],
2112
+ "info-requested": [
2113
+ { label: "Info Requester", value: (s) => s.infoRequestedBy },
2114
+ { label: "Requested Info", value: (s) => s.requestedInfo }
2115
+ ]
2116
+ },
2117
+ // Options
2118
+ departments: [
2119
+ "Marine Operations",
2120
+ "Engineering",
2121
+ "Maintenance",
2122
+ "Safety & Compliance",
2123
+ "Logistics",
2124
+ "Administration",
2125
+ "Engine Room"
2126
+ ],
2127
+ priorities: [
2128
+ "Urgent - Same Day",
2129
+ "High - Within 3 Days",
2130
+ "Normal - Within 1 Week",
2131
+ "Low - Within 2 Weeks"
2132
+ ],
2133
+ units: ["Pieces", "Kilograms", "Liters", "Meters", "Sets", "Boxes"]
2134
+ };
2135
+ },
2136
+ computed: {
2137
+ visibleTabs() {
2138
+ return this.tabs.filter((s) => s.roles.includes(this.userRole));
2139
+ },
2140
+ subTotal() {
2141
+ return (this.poDetails.items || []).reduce((s, t) => s + t.unitPrice * t.qty, 0);
2142
+ },
2143
+ reviewRequisitions() {
2144
+ return this.requisitions.filter((s) => s.status === "under-review");
2145
+ },
2146
+ poRequisitions() {
2147
+ return this.requisitions.filter((s) => s.status === "approved");
2148
+ },
2149
+ awaitingDelivery() {
2150
+ return this.requisitions.filter((s) => s.status === "po-created");
2151
+ },
2152
+ currentItem() {
2153
+ return this.currentItemIndex !== null ? this.poDetails.items[this.currentItemIndex] : null;
2154
+ },
2155
+ myRequisitions() {
2156
+ const s = this.userProfile.id || this.userProfile.profile_id;
2157
+ return this.requisitions.filter((t) => t.profile_id == s);
2158
+ }
2159
+ },
2160
+ methods: {
2161
+ setActiveTab(s) {
2162
+ this.activeTab = s;
2163
+ },
2164
+ getOptional(s) {
2165
+ return typeof s == "number" ? s.toFixed(2) : "0.00";
2166
+ },
2167
+ getRequisitionFields(s) {
2168
+ const t = this.requisitionFieldsMap[s.status] || [];
2169
+ return [...this.requisitionFields || [], ...t];
2170
+ },
2171
+ addItem() {
2172
+ this.form.items.push({
2173
+ id: "",
2174
+ desc: "",
2175
+ qty: 1,
2176
+ unit: "Pieces",
2177
+ cost: 0
2178
+ });
2179
+ },
2180
+ removeItem(s) {
2181
+ this.form.items.splice(s, 1);
2182
+ },
2183
+ startEdit(s) {
2184
+ this.poDetails.items[s].editing = !0, this.poDetails.items[s].tempPrice = this.poDetails.items[s].unitPrice;
2185
+ },
2186
+ cancelEdit(s) {
2187
+ this.poDetails.items[s].editing = !1, this.poDetails.items[s].tempPrice = this.poDetails.items[s].unitPrice;
2188
+ },
2189
+ savePrice(s) {
2190
+ const t = this.poDetails.items[s];
2191
+ t.tempPrice !== t.cost ? (this.currentItemIndex = s, this.showJustificationModal = !0) : (t.unitPrice = t.tempPrice, t.editing = !1);
2192
+ },
2193
+ confirmPriceChange() {
2194
+ if (!this.justificationText.trim()) {
2195
+ alert("Please provide a justification for the price change.");
2196
+ return;
2197
+ }
2198
+ const s = this.poDetails.items[this.currentItemIndex];
2199
+ s.unitPrice = s.tempPrice, s.cost = s.tempPrice, s.justification = this.justificationText.trim(), s.editing = !1, this.closeJustificationModal();
2200
+ },
2201
+ closeJustificationModal() {
2202
+ this.showJustificationModal = !1, this.currentItemIndex = null, this.justificationText = "";
2203
+ },
2204
+ // Event handlers that emit to parent
2205
+ handleSubmitRequisition() {
2206
+ const s = this.collectFormData("under-review");
2207
+ this.$emit("submit-requisition", s), this.resetForm();
2208
+ },
2209
+ handleSubmitInfoResponse(s) {
2210
+ if (!this.infoResponse || this.infoResponse.trim() === "") {
2211
+ alert("Please enter a response before submitting.");
2212
+ return;
2213
+ }
2214
+ this.$emit("submit-info-response", { req: s, response: this.infoResponse }), this.infoResponse = "";
2215
+ },
2216
+ handleApproveRequisition(s) {
2217
+ this.$emit("approve-requisition", s);
2218
+ },
2219
+ handleDeclineRequisition(s) {
2220
+ this.$emit("decline-requisition", s);
2221
+ },
2222
+ handleInfoRequisition(s) {
2223
+ this.$emit("info-requisition", s);
2224
+ },
2225
+ handleCreatePO(s) {
2226
+ this.$emit("create-po", s);
2227
+ },
2228
+ handleOpenPO(s) {
2229
+ this.$emit("open-po", s);
2230
+ },
2231
+ handleFinishPO(s) {
2232
+ this.$emit("finish-po", s);
2233
+ },
2234
+ handleAcceptDelivery(s) {
2235
+ this.$emit("accept-delivery", s);
2236
+ },
2237
+ collectFormData(s) {
2238
+ return {
2239
+ id: "REQ-" + Date.now(),
2240
+ requestor: this.userProfile.full_name,
2241
+ department: this.form.department,
2242
+ project: this.form.project,
2243
+ neededDate: this.form.neededDate,
2244
+ justification: this.form.justification,
2245
+ items: this.form.items.map((t) => ({ ...t })),
2246
+ status: s,
2247
+ submittedDate: (/* @__PURE__ */ new Date()).toLocaleDateString(),
2248
+ profile_id: this.userProfile.id || this.userProfile.profile_id
2249
+ };
2250
+ },
2251
+ resetForm() {
2252
+ this.form = {
2253
+ requestor: "",
2254
+ department: "",
2255
+ project: "",
2256
+ neededDate: "",
2257
+ justification: "",
2258
+ items: []
2259
+ }, this.addItem();
2260
+ },
2261
+ // Methods for updating PO details from parent
2262
+ updatePODetails(s) {
2263
+ this.poDetails = s, this.getNumber();
2264
+ for (let t of this.poDetails.items)
2265
+ t.tempPrice = t.cost, t.unitPrice = t.cost, t.subTotal = t.unitPrice * t.qty;
2266
+ },
2267
+ updateVendorInfo(s) {
2268
+ this.vendorInfo = s;
2269
+ },
2270
+ setPrintingMode(s) {
2271
+ this.isPrinting = s;
2272
+ },
2273
+ getNumber() {
2274
+ return (this.poDetails.items || []).map((s, t) => s.itemNumber = t + 1);
2275
+ }
2276
+ },
2277
+ created() {
2278
+ this.addItem();
2279
+ }
2280
+ }, $i = { class: "s-container container" }, Bi = { class: "nav-tabs" }, Hi = ["onClick"], Qi = {
2281
+ key: 0,
2282
+ class: "tab-content active"
2283
+ }, Ji = { class: "form-grid" }, Wi = { class: "form-group" }, Gi = ["value"], zi = { class: "form-group" }, Yi = ["value"], Ki = { class: "form-group" }, Xi = ["value"], Zi = { class: "form-group" }, en = { class: "form-group" }, tn = { class: "items-section" }, sn = { class: "items-header" }, nn = { class: "form-group" }, on = ["onUpdate:modelValue"], ln = { class: "form-group" }, rn = ["onUpdate:modelValue"], an = { class: "form-group" }, dn = ["onUpdate:modelValue"], un = { class: "form-group" }, cn = ["onUpdate:modelValue"], mn = ["value"], vn = { class: "form-group" }, pn = ["onUpdate:modelValue"], fn = ["onClick"], hn = {
2284
+ key: 1,
2285
+ class: "tab-content active"
2286
+ }, gn = { class: "requisition-list" }, bn = { class: "requisition-header" }, yn = { class: "requisition-id" }, wn = { class: "requisition-details" }, kn = { class: "detail-label" }, _n = { class: "detail-value" }, Cn = {
2287
+ key: 0,
2288
+ class: "form-group comments-section"
2289
+ }, Dn = ["onClick"], xn = {
2290
+ key: 2,
2291
+ class: "tab-content active"
2292
+ }, Sn = { class: "requisition-list" }, Pn = { class: "requisition-header" }, An = { class: "requisition-id" }, qn = { class: "requisition-details" }, Tn = { class: "detail-label" }, In = { class: "detail-value" }, Rn = {
2293
+ key: 0,
2294
+ class: "form-group comments-section"
2295
+ }, Mn = ["onClick"], Vn = {
2296
+ key: 3,
2297
+ class: "tab-content active"
2298
+ }, Fn = {
2299
+ class: "requisition-list",
2300
+ id: "approvalsQueue"
2301
+ }, En = { class: "requisition-header" }, Nn = { class: "requisition-id" }, On = { class: "requisition-details" }, Un = { class: "detail-label" }, Ln = { class: "detail-value" }, jn = { class: "detail-item" }, $n = { class: "detail-value" }, Bn = { class: "detail-item" }, Hn = { class: "item-list" }, Qn = ["onClick"], Jn = ["onClick"], Wn = ["onClick"], Gn = {
2302
+ key: 4,
2303
+ class: "tab-content active"
2304
+ }, zn = {
2305
+ class: "requisition-list",
2306
+ id: "purchasingQueue"
2307
+ }, Yn = { class: "requisition-header" }, Kn = { class: "requisition-id" }, Xn = { class: "requisition-details" }, Zn = { class: "detail-label" }, eo = { class: "detail-value" }, to = { class: "detail-item" }, so = { class: "detail-value" }, io = { class: "detail-item" }, no = { class: "item-list" }, oo = ["onClick"], lo = {
2308
+ key: 5,
2309
+ class: "tab-content active"
2310
+ }, ro = {
2311
+ class: "requisition-list",
2312
+ id: "receivingQueue"
2313
+ }, ao = { class: "requisition-header" }, uo = { class: "requisition-id" }, co = { class: "requisition-details" }, mo = { class: "detail-label" }, vo = { class: "detail-value" }, po = { class: "detail-item" }, fo = { class: "detail-value" }, ho = { class: "detail-item" }, go = { class: "item-list" }, bo = ["onClick"], yo = {
2314
+ key: 6,
2315
+ class: "tab-content active"
2316
+ }, wo = {
2317
+ class: "po-content",
2318
+ id: "po-content"
2319
+ }, ko = { class: "po-header" }, _o = { class: "company-info" }, Co = { class: "info-row" }, Do = { class: "info-value" }, xo = { class: "info-row" }, So = { class: "info-value" }, 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: "company-info" }, Vo = { class: "info-row" }, Fo = { class: "info-value" }, Eo = { class: "info-row" }, No = { class: "info-value" }, Oo = { class: "info-row" }, Uo = { class: "info-value" }, Lo = { class: "info-row" }, jo = { class: "info-value" }, $o = { class: "info-row" }, Bo = { class: "info-value" }, Ho = { class: "items-section" }, Qo = { class: "items-table" }, Jo = { key: 0 }, Wo = { key: 0 }, Go = {
2320
+ key: 0,
2321
+ class: "price-change-indicator"
2322
+ }, zo = ["onUpdate:modelValue"], Yo = { key: 0 }, Ko = ["onClick"], Xo = { key: 1 }, Zo = ["onClick"], el = ["onClick"], tl = {
2323
+ key: 0,
2324
+ class: "justification-note"
2325
+ }, sl = { class: "totals" }, il = { class: "total-row" }, nl = { class: "total-row" }, ol = { class: "total-row" }, ll = { class: "total-row grand-total" }, rl = { class: "modal-content" }, al = { style: { "margin-bottom": "15px", color: "#666" } }, dl = { class: "modal-buttons" }, ul = ["disabled"], cl = {
2326
+ key: 7,
2327
+ class: "tab-content active"
2328
+ };
2329
+ function ml(s, t, u, b, n, a) {
2330
+ var i, h, k, A, q, T, I, R, M, V, F;
2331
+ return o(), l("div", $i, [
2332
+ t[62] || (t[62] = e("div", { class: "header" }, [
2333
+ e("h1", null, "OceanHelm Requisition System"),
2334
+ e("p", null, "Streamlined Material Request & Ordering Process")
2335
+ ], -1)),
2336
+ e("div", Bi, [
2337
+ (o(!0), l(p, null, f(a.visibleTabs, (d) => (o(), l("button", {
2338
+ key: d.name,
2339
+ class: g(["nav-tab", { active: n.activeTab === d.name }]),
2340
+ onClick: (c) => a.setActiveTab(d.name)
2341
+ }, r(d.label), 11, Hi))), 128))
2342
+ ]),
2343
+ n.activeTab === "new-requisition" ? (o(), l("div", Qi, [
2344
+ e("form", {
2345
+ onSubmit: t[5] || (t[5] = D((...d) => a.handleSubmitRequisition && a.handleSubmitRequisition(...d), ["prevent"]))
2346
+ }, [
2347
+ e("div", Ji, [
2348
+ e("div", Wi, [
2349
+ t[12] || (t[12] = e("label", null, "Requestor Name *", -1)),
2350
+ e("input", {
2351
+ type: "text",
2352
+ value: u.userProfile.full_name,
2353
+ readonly: "",
2354
+ required: "",
2355
+ class: "form-control"
2356
+ }, null, 8, Gi)
2357
+ ]),
2358
+ e("div", zi, [
2359
+ t[14] || (t[14] = e("label", null, "Department *", -1)),
2360
+ v(e("select", {
2361
+ "onUpdate:modelValue": t[0] || (t[0] = (d) => n.form.department = d),
2362
+ required: ""
2363
+ }, [
2364
+ t[13] || (t[13] = e("option", { value: "" }, "Select Department", -1)),
2365
+ (o(!0), l(p, null, f(n.departments, (d) => (o(), l("option", {
2366
+ key: d,
2367
+ value: d
2368
+ }, r(d), 9, Yi))), 128))
2369
+ ], 512), [
2370
+ [C, n.form.department]
2371
+ ])
2372
+ ]),
2373
+ e("div", Ki, [
2374
+ t[16] || (t[16] = e("label", null, "Vessel *", -1)),
2375
+ v(e("select", {
2376
+ "onUpdate:modelValue": t[1] || (t[1] = (d) => n.form.project = d),
2377
+ class: "form-control",
2378
+ required: ""
2379
+ }, [
2380
+ t[15] || (t[15] = e("option", {
2381
+ disabled: "",
2382
+ value: ""
2383
+ }, "Select a vessel", -1)),
2384
+ (o(!0), l(p, null, f(u.vessels, (d) => (o(), l("option", {
2385
+ key: d.id,
2386
+ value: d.name
2387
+ }, r(d.name), 9, Xi))), 128))
2388
+ ], 512), [
2389
+ [C, n.form.project]
2390
+ ])
2391
+ ]),
2392
+ e("div", Zi, [
2393
+ t[17] || (t[17] = e("label", null, "Date Needed *", -1)),
2394
+ v(e("input", {
2395
+ type: "date",
2396
+ "onUpdate:modelValue": t[2] || (t[2] = (d) => n.form.neededDate = d),
2397
+ required: ""
2398
+ }, null, 512), [
2399
+ [w, n.form.neededDate]
2400
+ ])
2401
+ ])
2402
+ ]),
2403
+ e("div", en, [
2404
+ t[18] || (t[18] = e("label", null, "Business Justification *", -1)),
2405
+ v(e("textarea", {
2406
+ "onUpdate:modelValue": t[3] || (t[3] = (d) => n.form.justification = d),
2407
+ placeholder: "Explain why these materials are needed...",
2408
+ required: ""
2409
+ }, null, 512), [
2410
+ [w, n.form.justification]
2411
+ ])
2412
+ ]),
2413
+ e("div", tn, [
2414
+ e("div", sn, [
2415
+ t[19] || (t[19] = e("h3", null, "Requested Items", -1)),
2416
+ e("button", {
2417
+ type: "button",
2418
+ class: "add-item-btn",
2419
+ onClick: t[4] || (t[4] = (...d) => a.addItem && a.addItem(...d))
2420
+ }, "+ Add Item")
2421
+ ]),
2422
+ e("div", null, [
2423
+ (o(!0), l(p, null, f(n.form.items, (d, c) => (o(), l("div", {
2424
+ key: c,
2425
+ class: "item-row"
2426
+ }, [
2427
+ e("div", nn, [
2428
+ t[20] || (t[20] = e("label", null, "Item Code *", -1)),
2429
+ v(e("input", {
2430
+ type: "text",
2431
+ "onUpdate:modelValue": (y) => d.id = y,
2432
+ required: ""
2433
+ }, null, 8, on), [
2434
+ [w, d.id]
2435
+ ])
2436
+ ]),
2437
+ e("div", ln, [
2438
+ t[21] || (t[21] = e("label", null, "Item Description *", -1)),
2439
+ v(e("input", {
2440
+ type: "text",
2441
+ "onUpdate:modelValue": (y) => d.desc = y,
2442
+ required: ""
2443
+ }, null, 8, rn), [
2444
+ [w, d.desc]
2445
+ ])
2446
+ ]),
2447
+ e("div", an, [
2448
+ t[22] || (t[22] = e("label", null, "Quantity *", -1)),
2449
+ v(e("input", {
2450
+ type: "number",
2451
+ "onUpdate:modelValue": (y) => d.qty = y,
2452
+ min: "1",
2453
+ required: ""
2454
+ }, null, 8, dn), [
2455
+ [
2456
+ w,
2457
+ d.qty,
2458
+ void 0,
2459
+ { number: !0 }
2460
+ ]
2461
+ ])
2462
+ ]),
2463
+ e("div", un, [
2464
+ t[23] || (t[23] = e("label", null, "Unit *", -1)),
2465
+ v(e("select", {
2466
+ "onUpdate:modelValue": (y) => d.unit = y,
2467
+ required: ""
2468
+ }, [
2469
+ (o(!0), l(p, null, f(n.units, (y) => (o(), l("option", {
2470
+ key: y,
2471
+ value: y
2472
+ }, r(y), 9, mn))), 128))
2473
+ ], 8, cn), [
2474
+ [C, d.unit]
2475
+ ])
2476
+ ]),
2477
+ e("div", vn, [
2478
+ t[24] || (t[24] = e("label", null, "Est. Unit Cost *", -1)),
2479
+ v(e("input", {
2480
+ type: "number",
2481
+ "onUpdate:modelValue": (y) => d.cost = y,
2482
+ step: "0.01",
2483
+ placeholder: "0.00",
2484
+ required: ""
2485
+ }, null, 8, pn), [
2486
+ [
2487
+ w,
2488
+ d.cost,
2489
+ void 0,
2490
+ { number: !0 }
2491
+ ]
2492
+ ])
2493
+ ]),
2494
+ e("button", {
2495
+ type: "button",
2496
+ class: "remove-item-btn",
2497
+ onClick: (y) => a.removeItem(c)
2498
+ }, "Remove", 8, fn)
2499
+ ]))), 128))
2500
+ ])
2501
+ ]),
2502
+ t[25] || (t[25] = e("div", { class: "action-buttons" }, [
2503
+ e("button", {
2504
+ type: "submit",
2505
+ class: "btn btn-primary-req"
2506
+ }, "Submit Requisition")
2507
+ ], -1))
2508
+ ], 32)
2509
+ ])) : m("", !0),
2510
+ n.activeTab === "all-requisitions" ? (o(), l("div", hn, [
2511
+ e("div", gn, [
2512
+ (o(!0), l(p, null, f(u.requisitions, (d) => (o(), l("div", {
2513
+ key: d.id,
2514
+ class: "requisition-card"
2515
+ }, [
2516
+ e("div", bn, [
2517
+ e("div", yn, r(d.id), 1),
2518
+ e("div", {
2519
+ class: g(["status-badge", `status-${d.status}`])
2520
+ }, r(d.status), 3)
2521
+ ]),
2522
+ e("div", wn, [
2523
+ (o(!0), l(p, null, f(a.getRequisitionFields(d), (c) => (o(), l("div", {
2524
+ class: "detail-item",
2525
+ key: c.label
2526
+ }, [
2527
+ e("div", kn, r(c.label), 1),
2528
+ e("div", _n, r(c.value(d)), 1)
2529
+ ]))), 128))
2530
+ ]),
2531
+ d.status === "po-created" || d.status === "delivered" ? (o(), l("div", Cn, [
2532
+ e("button", {
2533
+ onClick: (c) => a.handleOpenPO(d.id),
2534
+ class: "add-item-btn comments-section"
2535
+ }, " Print PO ", 8, Dn)
2536
+ ])) : m("", !0)
2537
+ ]))), 128))
2538
+ ])
2539
+ ])) : m("", !0),
2540
+ n.activeTab === "my-requisitions" ? (o(), l("div", xn, [
2541
+ e("div", Sn, [
2542
+ (o(!0), l(p, null, f(a.myRequisitions, (d) => (o(), l("div", {
2543
+ key: d.id,
2544
+ class: "requisition-card"
2545
+ }, [
2546
+ e("div", Pn, [
2547
+ e("div", An, r(d.id), 1),
2548
+ e("div", {
2549
+ class: g(["status-badge", `status-${d.status}`])
2550
+ }, r(d.status), 3)
2551
+ ]),
2552
+ e("div", qn, [
2553
+ (o(!0), l(p, null, f(a.getRequisitionFields(d), (c) => (o(), l("div", {
2554
+ class: "detail-item",
2555
+ key: c.label
2556
+ }, [
2557
+ e("div", Tn, r(c.label), 1),
2558
+ e("div", In, r(c.value(d)), 1)
2559
+ ]))), 128))
2560
+ ]),
2561
+ d.status === "info-requested" ? (o(), l("div", Rn, [
2562
+ t[26] || (t[26] = e("label", { class: "detail-label" }, "Your Response", -1)),
2563
+ v(e("textarea", {
2564
+ "onUpdate:modelValue": t[6] || (t[6] = (c) => n.infoResponse = c),
2565
+ class: "response-textarea",
2566
+ placeholder: "Submit more info..."
2567
+ }, null, 512), [
2568
+ [w, n.infoResponse]
2569
+ ]),
2570
+ e("button", {
2571
+ onClick: (c) => a.handleSubmitInfoResponse(d),
2572
+ class: "add-item-btn comments-section"
2573
+ }, " Submit Info ", 8, Mn)
2574
+ ])) : m("", !0)
2575
+ ]))), 128))
2576
+ ])
2577
+ ])) : m("", !0),
2578
+ n.activeTab === "approvals" ? (o(), l("div", Vn, [
2579
+ t[29] || (t[29] = e("div", { style: { "margin-bottom": "20px" } }, [
2580
+ e("h3", { style: { color: "#1e40af", "margin-bottom": "15px" } }, "Department Supervisor Dashboard"),
2581
+ e("div", { style: { background: "#fef3c7", padding: "15px", "border-radius": "10px", "border-left": "4px solid #f59e0b" } }, [
2582
+ e("strong", null, "Role:"),
2583
+ _(" Department Supervisor - Review requests for accuracy, necessity, and budget compliance ")
2584
+ ])
2585
+ ], -1)),
2586
+ e("div", Fn, [
2587
+ (o(!0), l(p, null, f(a.reviewRequisitions, (d) => (o(), l("div", {
2588
+ key: d.id,
2589
+ class: "requisition-card"
2590
+ }, [
2591
+ e("div", En, [
2592
+ e("div", Nn, r(d.id), 1)
2593
+ ]),
2594
+ e("div", On, [
2595
+ (o(!0), l(p, null, f(n.requisitionFields, (c) => (o(), l("div", {
2596
+ class: "detail-item",
2597
+ key: c.label
2598
+ }, [
2599
+ e("div", Un, r(c.label), 1),
2600
+ e("div", Ln, r(c.value(d)), 1)
2601
+ ]))), 128))
2602
+ ]),
2603
+ e("div", jn, [
2604
+ t[27] || (t[27] = e("div", { class: "detail-label" }, "Justification", -1)),
2605
+ e("div", $n, r(d.justification || "N/A"), 1)
2606
+ ]),
2607
+ e("div", Bn, [
2608
+ t[28] || (t[28] = e("div", { class: "detail-label" }, "Items", -1)),
2609
+ e("ul", Hn, [
2610
+ (o(!0), l(p, null, f(d.items, (c, y) => (o(), l("li", { key: y }, r(c.desc) + " - " + r(c.qty) + " " + r(c.unit) + " @ ₦" + r(c.cost.toFixed(2)) + " each ", 1))), 128))
2611
+ ])
2612
+ ]),
2613
+ e("button", {
2614
+ type: "button",
2615
+ class: "add-item-btn",
2616
+ onClick: (c) => a.handleApproveRequisition(d.id)
2617
+ }, "Approve", 8, Qn),
2618
+ e("button", {
2619
+ type: "button",
2620
+ class: "marginbox btn-reject",
2621
+ onClick: (c) => a.handleDeclineRequisition(d.id)
2622
+ }, "Decline", 8, Jn),
2623
+ e("button", {
2624
+ type: "button",
2625
+ class: "marginbox btn-request",
2626
+ onClick: (c) => a.handleInfoRequisition(d.id)
2627
+ }, "Request Info", 8, Wn)
2628
+ ]))), 128))
2629
+ ])
2630
+ ])) : m("", !0),
2631
+ n.activeTab === "purchasing" ? (o(), l("div", Gn, [
2632
+ t[32] || (t[32] = e("div", { style: { "margin-bottom": "20px" } }, [
2633
+ e("h3", { style: { color: "#1e40af", "margin-bottom": "15px" } }, "Purchasing Department Dashboard"),
2634
+ e("div", { style: { background: "#dbeafe", padding: "15px", "border-radius": "10px", "border-left": "4px solid #3b82f6" } }, [
2635
+ e("strong", null, "Role:"),
2636
+ _(" Purchasing Team - Convert approved requisitions to Purchase Orders ")
2637
+ ])
2638
+ ], -1)),
2639
+ e("div", zn, [
2640
+ (o(!0), l(p, null, f(a.poRequisitions, (d) => (o(), l("div", {
2641
+ key: d.id,
2642
+ class: "requisition-card"
2643
+ }, [
2644
+ e("div", Yn, [
2645
+ e("div", Kn, r(d.id), 1)
2646
+ ]),
2647
+ e("div", Xn, [
2648
+ (o(!0), l(p, null, f(n.requisitionFields, (c) => (o(), l("div", {
2649
+ class: "detail-item",
2650
+ key: c.label
2651
+ }, [
2652
+ e("div", Zn, r(c.label), 1),
2653
+ e("div", eo, r(c.value(d)), 1)
2654
+ ]))), 128))
2655
+ ]),
2656
+ e("div", to, [
2657
+ t[30] || (t[30] = e("div", { class: "detail-label" }, "Justification", -1)),
2658
+ e("div", so, r(d.justification || "N/A"), 1)
2659
+ ]),
2660
+ e("div", io, [
2661
+ t[31] || (t[31] = e("div", { class: "detail-label" }, "Items", -1)),
2662
+ e("ul", no, [
2663
+ (o(!0), l(p, null, f(d.items, (c, y) => (o(), l("li", { key: y }, r(c.desc) + " - " + r(c.qty) + " " + r(c.unit) + " @ ₦" + r(c.cost.toFixed(2)) + " each ", 1))), 128))
2664
+ ])
2665
+ ]),
2666
+ e("button", {
2667
+ type: "button",
2668
+ class: "add-item-btn",
2669
+ onClick: (c) => a.handleCreatePO(d.id)
2670
+ }, "Create PO", 8, oo)
2671
+ ]))), 128))
2672
+ ])
2673
+ ])) : m("", !0),
2674
+ n.activeTab === "receiving" ? (o(), l("div", lo, [
2675
+ t[35] || (t[35] = e("div", { style: { "margin-bottom": "20px" } }, [
2676
+ e("h3", { style: { color: "#1e40af", "margin-bottom": "15px" } }, "Receiving & Inventory Dashboard"),
2677
+ e("div", { style: { background: "#dcfce7", padding: "15px", "border-radius": "10px", "border-left": "4px solid #10b981" } }, [
2678
+ e("strong", null, "Role:"),
2679
+ _(" Warehouse Team - Process incoming deliveries and update inventory ")
2680
+ ])
2681
+ ], -1)),
2682
+ e("div", ro, [
2683
+ (o(!0), l(p, null, f(a.awaitingDelivery, (d) => (o(), l("div", {
2684
+ key: d.id,
2685
+ class: "requisition-card"
2686
+ }, [
2687
+ e("div", ao, [
2688
+ e("div", uo, r(d.id), 1)
2689
+ ]),
2690
+ e("div", co, [
2691
+ (o(!0), l(p, null, f(n.requisitionFields, (c) => (o(), l("div", {
2692
+ class: "detail-item",
2693
+ key: c.label
2694
+ }, [
2695
+ e("div", mo, r(c.label), 1),
2696
+ e("div", vo, r(c.value(d)), 1)
2697
+ ]))), 128))
2698
+ ]),
2699
+ e("div", po, [
2700
+ t[33] || (t[33] = e("div", { class: "detail-label" }, "Justification", -1)),
2701
+ e("div", fo, r(d.justification || "N/A"), 1)
2702
+ ]),
2703
+ e("div", ho, [
2704
+ t[34] || (t[34] = e("div", { class: "detail-label" }, "Items", -1)),
2705
+ e("ul", go, [
2706
+ (o(!0), l(p, null, f(d.items, (c, y) => (o(), l("li", { key: y }, r(c.desc) + " - " + r(c.qty) + " " + r(c.unit) + " @ ₦" + r(c.cost.toFixed(2)) + " each ", 1))), 128))
2707
+ ])
2708
+ ]),
2709
+ e("button", {
2710
+ type: "button",
2711
+ class: "add-item-btn",
2712
+ onClick: (c) => a.handleAcceptDelivery(d.id)
2713
+ }, "Accept Delivery", 8, bo)
2714
+ ]))), 128))
2715
+ ])
2716
+ ])) : m("", !0),
2717
+ n.activeTab === "po" ? (o(), l("div", yo, [
2718
+ e("div", wo, [
2719
+ e("div", ko, [
2720
+ e("div", _o, [
2721
+ t[41] || (t[41] = e("h3", null, "Vendor Information", -1)),
2722
+ e("div", Co, [
2723
+ t[36] || (t[36] = e("span", { class: "info-label" }, "Company:", -1)),
2724
+ e("span", Do, r(n.vendorInfo.company || ((i = n.poDetails.vendorInfo) == null ? void 0 : i.company)), 1)
2725
+ ]),
2726
+ e("div", xo, [
2727
+ t[37] || (t[37] = e("span", { class: "info-label" }, "Contact:", -1)),
2728
+ e("span", So, r(n.vendorInfo.contact || ((h = n.poDetails.vendorInfo) == null ? void 0 : h.contact)), 1)
2729
+ ]),
2730
+ e("div", Po, [
2731
+ t[38] || (t[38] = e("span", { class: "info-label" }, "Email:", -1)),
2732
+ e("span", Ao, r(n.vendorInfo.email || ((k = n.poDetails.vendorInfo) == null ? void 0 : k.email)), 1)
2733
+ ]),
2734
+ e("div", qo, [
2735
+ t[39] || (t[39] = e("span", { class: "info-label" }, "Phone:", -1)),
2736
+ e("span", To, r(n.vendorInfo.phone || ((A = n.poDetails.vendorInfo) == null ? void 0 : A.phone)), 1)
2737
+ ]),
2738
+ e("div", Io, [
2739
+ t[40] || (t[40] = e("span", { class: "info-label" }, "Address:", -1)),
2740
+ e("span", Ro, r(n.vendorInfo.address || ((q = n.poDetails.vendorInfo) == null ? void 0 : q.address)), 1)
2741
+ ])
2742
+ ]),
2743
+ e("div", Mo, [
2744
+ t[47] || (t[47] = e("h3", null, "Purchase Order Details", -1)),
2745
+ e("div", Vo, [
2746
+ t[42] || (t[42] = e("span", { class: "info-label" }, "PO Number:", -1)),
2747
+ e("span", Fo, r(n.poDetails.id), 1)
2748
+ ]),
2749
+ e("div", Eo, [
2750
+ t[43] || (t[43] = e("span", { class: "info-label" }, "Date:", -1)),
2751
+ e("span", No, r(n.vendorInfo.poDate || ((T = n.poDetails.vendorInfo) == null ? void 0 : T.poDate)), 1)
2752
+ ]),
2753
+ e("div", Oo, [
2754
+ t[44] || (t[44] = e("span", { class: "info-label" }, "Requested By:", -1)),
2755
+ e("span", Uo, r(n.vendorInfo.poApproved || ((I = n.poDetails.vendorInfo) == null ? void 0 : I.poApproved)), 1)
2756
+ ]),
2757
+ e("div", Lo, [
2758
+ t[45] || (t[45] = e("span", { class: "info-label" }, "Department:", -1)),
2759
+ e("span", jo, "PO-" + r(n.poDetails.department), 1)
2760
+ ]),
2761
+ e("div", $o, [
2762
+ t[46] || (t[46] = e("span", { class: "info-label" }, "Delivery Date:", -1)),
2763
+ e("span", Bo, r(n.poDetails.neededDate), 1)
2764
+ ])
2765
+ ])
2766
+ ]),
2767
+ e("div", Ho, [
2768
+ t[57] || (t[57] = e("h2", { class: "section-title" }, "Order Items", -1)),
2769
+ e("table", Qo, [
2770
+ e("thead", null, [
2771
+ e("tr", null, [
2772
+ t[48] || (t[48] = e("th", null, "Item #", -1)),
2773
+ t[49] || (t[49] = e("th", null, "Description", -1)),
2774
+ t[50] || (t[50] = e("th", null, "Quantity", -1)),
2775
+ t[51] || (t[51] = e("th", null, "Unit Price", -1)),
2776
+ t[52] || (t[52] = e("th", null, "Total", -1)),
2777
+ n.isPrinting ? m("", !0) : (o(), l("th", Jo, "Actions"))
2778
+ ])
2779
+ ]),
2780
+ e("tbody", null, [
2781
+ (o(!0), l(p, null, f(n.poDetails.items || [], (d, c) => (o(), l("tr", { key: c }, [
2782
+ e("td", null, r(d.itemNumber), 1),
2783
+ e("td", null, r(d.desc), 1),
2784
+ e("td", null, r(d.qty), 1),
2785
+ e("td", null, [
2786
+ d.editing ? v((o(), l("input", {
2787
+ key: 1,
2788
+ "onUpdate:modelValue": (y) => d.tempPrice = y,
2789
+ type: "number",
2790
+ step: "0.01",
2791
+ class: g(["price-input", { "price-changed": d.cost !== d.tempPrice }])
2792
+ }, null, 10, zo)), [
2793
+ [
2794
+ w,
2795
+ d.tempPrice,
2796
+ void 0,
2797
+ { number: !0 }
2798
+ ]
2799
+ ]) : (o(), l("span", Wo, [
2800
+ _(" $" + r(d.cost.toFixed(2)) + " ", 1),
2801
+ d.cost !== d.unitPrice ? (o(), l("span", Go, "!")) : m("", !0)
2802
+ ]))
2803
+ ]),
2804
+ e("td", null, "$" + r((d.unitPrice * d.qty).toFixed(2)), 1),
2805
+ n.isPrinting ? m("", !0) : (o(), l("td", Yo, [
2806
+ d.editing ? (o(), l("div", Xo, [
2807
+ e("button", {
2808
+ onClick: (y) => a.savePrice(c),
2809
+ class: "save-btn"
2810
+ }, "Save", 8, Zo),
2811
+ e("button", {
2812
+ onClick: (y) => a.cancelEdit(c),
2813
+ class: "cancel-btn"
2814
+ }, "Cancel", 8, el)
2815
+ ])) : (o(), l("button", {
2816
+ key: 0,
2817
+ onClick: (y) => a.startEdit(c),
2818
+ class: "edit-btn"
2819
+ }, " Edit Price ", 8, Ko))
2820
+ ]))
2821
+ ]))), 128))
2822
+ ])
2823
+ ]),
2824
+ (o(!0), l(p, null, f(n.poDetails.items || [], (d, c) => (o(), l("div", {
2825
+ key: "note-" + c
2826
+ }, [
2827
+ d.justification ? (o(), l("div", tl, [
2828
+ e("strong", null, "Price Change Justification (Item " + r(d.itemNumber) + "):", 1),
2829
+ _(" " + r(d.justification), 1)
2830
+ ])) : m("", !0)
2831
+ ]))), 128)),
2832
+ e("div", sl, [
2833
+ e("div", il, [
2834
+ t[53] || (t[53] = e("span", null, "Subtotal:", -1)),
2835
+ e("span", null, "$" + r(a.subTotal.toFixed(2)), 1)
2836
+ ]),
2837
+ e("div", nl, [
2838
+ t[54] || (t[54] = e("span", null, "Tax (%):", -1)),
2839
+ e("span", null, "$" + r(a.getOptional(n.vendorInfo.tax)), 1)
2840
+ ]),
2841
+ e("div", ol, [
2842
+ t[55] || (t[55] = e("span", null, "Shipping:", -1)),
2843
+ e("span", null, "$" + r(a.getOptional(n.vendorInfo.shipping)), 1)
2844
+ ]),
2845
+ e("div", ll, [
2846
+ t[56] || (t[56] = e("span", null, "Grand Total:", -1)),
2847
+ e("span", null, "$" + r((a.subTotal + a.getOptional(n.vendorInfo.tax) + a.getOptional(n.vendorInfo.shipping)).toFixed(2)), 1)
2848
+ ])
2849
+ ])
2850
+ ])
2851
+ ]),
2852
+ n.showJustificationModal ? (o(), l("div", {
2853
+ key: 0,
2854
+ class: "justification-modal",
2855
+ onClick: t[10] || (t[10] = D((...d) => a.closeJustificationModal && a.closeJustificationModal(...d), ["self"]))
2856
+ }, [
2857
+ e("div", rl, [
2858
+ t[60] || (t[60] = e("h3", null, "Price Change Justification Required", -1)),
2859
+ e("p", al, [
2860
+ t[58] || (t[58] = _(" Please provide a justification for changing the price from ", -1)),
2861
+ e("strong", null, "$" + r((M = (R = a.currentItem) == null ? void 0 : R.cost) == null ? void 0 : M.toFixed(2)), 1),
2862
+ t[59] || (t[59] = _(" to ", -1)),
2863
+ e("strong", null, "$" + r((F = (V = a.currentItem) == null ? void 0 : V.tempPrice) == null ? void 0 : F.toFixed(2)), 1)
2864
+ ]),
2865
+ v(e("textarea", {
2866
+ "onUpdate:modelValue": t[7] || (t[7] = (d) => n.justificationText = d),
2867
+ class: "justification-textarea",
2868
+ placeholder: "Enter justification for price change...",
2869
+ required: ""
2870
+ }, null, 512), [
2871
+ [w, n.justificationText]
2872
+ ]),
2873
+ e("div", dl, [
2874
+ e("button", {
2875
+ onClick: t[8] || (t[8] = (...d) => a.closeJustificationModal && a.closeJustificationModal(...d)),
2876
+ class: "cancel-btn"
2877
+ }, "Cancel"),
2878
+ e("button", {
2879
+ onClick: t[9] || (t[9] = (...d) => a.confirmPriceChange && a.confirmPriceChange(...d)),
2880
+ class: "save-btn",
2881
+ disabled: !n.justificationText.trim()
2882
+ }, " Confirm Change ", 8, ul)
2883
+ ])
2884
+ ])
2885
+ ])) : m("", !0),
2886
+ n.isPrinting ? m("", !0) : (o(), l("button", {
2887
+ key: 1,
2888
+ type: "button",
2889
+ class: "add-item-btn",
2890
+ onClick: t[11] || (t[11] = (d) => a.handleFinishPO(n.poDetails.id))
2891
+ }, "Approve PO"))
2892
+ ])) : m("", !0),
2893
+ n.activeTab === "workflow" ? (o(), l("div", cl, t[61] || (t[61] = [
2894
+ 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)
2895
+ ]))) : m("", !0)
2896
+ ]);
2897
+ }
2898
+ const vl = /* @__PURE__ */ S(ji, [["render", ml]]), fl = (s = {}) => ({
2899
+ brandName: s.brandName || "OceanHelm",
2900
+ logoIcon: s.logoIcon || "bi bi-water",
2901
+ showLogo: s.showLogo !== !1,
2902
+ responsive: s.responsive !== !1,
2903
+ ...s
2904
+ }), hl = [
2038
2905
  {
2039
2906
  type: "link",
2040
2907
  label: "Dashboard",
@@ -2110,21 +2977,22 @@ const Mi = /* @__PURE__ */ x(Hs, [["render", Pi]]), Ni = (i = {}) => ({
2110
2977
  icon: "bi bi-question-circle",
2111
2978
  action: "help"
2112
2979
  }
2113
- ], Fi = (i, e) => !i.roles || i.roles.length === 0 ? !0 : i.roles.includes(e == null ? void 0 : e.role), Ui = {
2114
- install(i, e = {}) {
2115
- i.component("ConfigurableSidebar", H), i.component("VesselLists", pe), i.component("DashHead", Ce), i.component("ActivityLogs", Bs), i.component("CrewManagement", Mi), i.component("OceanHelmMaintenance", hs), i.provide("sidebarConfig", e);
2980
+ ], gl = (s, t) => !s.roles || s.roles.length === 0 ? !0 : s.roles.includes(t == null ? void 0 : t.role), bl = {
2981
+ install(s, t = {}) {
2982
+ s.component("ConfigurableSidebar", K), s.component("VesselLists", Se), s.component("DashHead", Re), s.component("ActivityLogs", Ys), s.component("CrewManagement", Li), s.component("RequisitionSystem", vl), s.component("OceanHelmMaintenance", Ds), s.provide("sidebarConfig", t);
2116
2983
  }
2117
2984
  };
2118
2985
  export {
2119
- Bs as ActivityLogs,
2120
- H as ConfigurableSidebar,
2121
- Mi as CrewManagement,
2122
- Ce as DashHead,
2123
- hs as OceanHelmMaintenance,
2124
- pe as VesselList,
2125
- Ni as createSidebarConfig,
2126
- Ui as default,
2127
- Li as defaultMenuItems,
2128
- Fi as defaultPermissionChecker
2986
+ Ys as ActivityLogs,
2987
+ K as ConfigurableSidebar,
2988
+ Li as CrewManagement,
2989
+ Re as DashHead,
2990
+ Ds as OceanHelmMaintenance,
2991
+ vl as RequisitionSystem,
2992
+ Se as VesselList,
2993
+ fl as createSidebarConfig,
2994
+ bl as default,
2995
+ hl as defaultMenuItems,
2996
+ gl as defaultPermissionChecker
2129
2997
  };
2130
2998
  //# sourceMappingURL=oceanhelm.es.js.map