@quoreadmin/ui 1.7.5 → 1.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/index140.js +298 -296
  2. package/dist/index171.js +14 -14
  3. package/dist/index172.js +3 -3
  4. package/dist/index175.js +4 -4
  5. package/dist/index182.js +10 -10
  6. package/dist/index184.js +10 -10
  7. package/dist/index190.js +9 -9
  8. package/dist/index191.js +1 -1
  9. package/dist/index192.js +1 -1
  10. package/dist/index193.js +1 -1
  11. package/dist/index201.js +1 -1
  12. package/dist/index202.js +29 -84
  13. package/dist/index203.js +109 -400
  14. package/dist/index204.js +36 -22
  15. package/dist/index205.js +26 -33
  16. package/dist/index206.js +31 -111
  17. package/dist/index207.js +9 -36
  18. package/dist/index208.js +19 -26
  19. package/dist/index209.js +10 -36
  20. package/dist/index210.js +10 -9
  21. package/dist/index211.js +50 -18
  22. package/dist/index212.js +43 -10
  23. package/dist/index213.js +4 -10
  24. package/dist/index214.js +36 -48
  25. package/dist/index215.js +21 -43
  26. package/dist/index216.js +87 -3
  27. package/dist/index217.js +403 -35
  28. package/dist/index218.js +22 -21
  29. package/dist/index219.js +159 -159
  30. package/dist/index220.js +20 -228
  31. package/dist/index221.js +19 -36
  32. package/dist/index222.js +22 -10
  33. package/dist/index223.js +167 -129
  34. package/dist/index224.js +69 -19
  35. package/dist/index225.js +34 -20
  36. package/dist/index226.js +39 -21
  37. package/dist/index227.js +113 -185
  38. package/dist/index228.js +25 -57
  39. package/dist/index229.js +77 -31
  40. package/dist/index230.js +19 -39
  41. package/dist/index231.js +19 -126
  42. package/dist/index232.js +16 -34
  43. package/dist/index233.js +20 -80
  44. package/dist/index234.js +160 -19
  45. package/dist/index235.js +228 -20
  46. package/dist/index236.js +36 -19
  47. package/dist/index237.js +10 -20
  48. package/dist/index241.js +8 -8
  49. package/dist/index242.js +2 -2
  50. package/dist/index248.js +2 -2
  51. package/dist/index249.js +2 -2
  52. package/dist/index250.js +8 -8
  53. package/dist/index259.js +6 -6
  54. package/dist/index274.js +2 -2
  55. package/dist/index280.js +1 -1
  56. package/dist/index290.js +79 -1518
  57. package/dist/index291.js +22 -386
  58. package/dist/index292.js +902 -2698
  59. package/dist/index293.js +21 -85
  60. package/dist/index294.js +20 -3770
  61. package/dist/index295.js +19 -59
  62. package/dist/index296.js +67 -77
  63. package/dist/index297.js +18 -21
  64. package/dist/index298.js +18 -934
  65. package/dist/index299.js +16 -16
  66. package/dist/index300.js +13 -11
  67. package/dist/index301.js +62 -19
  68. package/dist/index302.js +1518 -69
  69. package/dist/index303.js +386 -19
  70. package/dist/index304.js +2731 -19
  71. package/dist/index305.js +85 -21
  72. package/dist/index306.js +3770 -22
  73. package/dist/index307.js +60 -63
  74. package/dist/index309.js +1 -1
  75. package/dist/index310.js +3 -3
  76. package/dist/index311.js +1 -1
  77. package/dist/index332.js +1 -1
  78. package/dist/index337.js +1 -1
  79. package/dist/index342.js +2 -2
  80. package/dist/index347.js +1 -1
  81. package/dist/index348.js +2 -2
  82. package/dist/index355.js +1 -1
  83. package/package.json +1 -1
package/dist/index140.js CHANGED
@@ -1,31 +1,31 @@
1
- import { defineComponent as dt, ref as i, computed as y, watch as F, onMounted as mt, onUnmounted as pt } from "vue";
2
- import { useI18n as vt } from "vue-i18n";
1
+ import { defineComponent as mt, ref as i, computed as y, watch as B, onMounted as vt, onUnmounted as pt } from "vue";
2
+ import { useI18n as ft } from "vue-i18n";
3
3
  import { DateTime as _ } from "./index163.js";
4
4
  import "./index186.js";
5
- import ft from "./index2.js";
6
- import ht from "./index3.js";
7
- import yt from "./index4.js";
8
- import gt from "./index21.js";
9
- import _t from "./index28.js";
10
- import wt from "./index39.js";
11
- import It from "./index20.js";
12
- import Dt from "./index46.js";
13
- import Tt from "./index47.js";
14
- import Ot from "./index49.js";
15
- import z from "./index187.js";
16
- const Bt = dt({
5
+ import ht from "./index2.js";
6
+ import yt from "./index3.js";
7
+ import gt from "./index4.js";
8
+ import _t from "./index21.js";
9
+ import wt from "./index28.js";
10
+ import It from "./index39.js";
11
+ import Dt from "./index20.js";
12
+ import Tt from "./index46.js";
13
+ import Ot from "./index47.js";
14
+ import kt from "./index49.js";
15
+ import K from "./index187.js";
16
+ const Gt = mt({
17
17
  name: "QRoomDetailsPopover",
18
18
  components: {
19
- QAccordion: ft,
20
- QActivityItem: ht,
21
- QAvatar: yt,
22
- QDatePicker: It,
23
- QDivider: gt,
24
- QIcon: _t,
25
- QPopover: wt,
26
- QTag: Dt,
27
- QTextarea: Tt,
28
- QTooltip: Ot
19
+ QAccordion: ht,
20
+ QActivityItem: yt,
21
+ QAvatar: gt,
22
+ QDatePicker: Dt,
23
+ QDivider: _t,
24
+ QIcon: wt,
25
+ QPopover: It,
26
+ QTag: Tt,
27
+ QTextarea: Ot,
28
+ QTooltip: kt
29
29
  },
30
30
  props: {
31
31
  id: {
@@ -145,8 +145,8 @@ const Bt = dt({
145
145
  }
146
146
  },
147
147
  emits: ["create:callback", "create:todo", "refresh:pms", "show:toast", "toggle"],
148
- setup(n, { emit: h }) {
149
- const { t: c } = vt(), l = i(null), ie = i(!1), ue = i("left"), K = i([
148
+ setup(s, { emit: h }) {
149
+ const { t: c } = ft(), r = i(null), ie = i(!1), ue = i("left"), X = i([
150
150
  {
151
151
  id: 1,
152
152
  label: c("HC_DEPARTMENT")
@@ -162,7 +162,7 @@ const Bt = dt({
162
162
  label: c("HC_ANYONE")
163
163
  // need to localize
164
164
  }
165
- ]), A = i(""), v = i({
165
+ ]), A = i(""), p = i({
166
166
  checkInDate: /* @__PURE__ */ new Date(),
167
167
  checkOutDate: /* @__PURE__ */ new Date(),
168
168
  guestEmail: "",
@@ -170,19 +170,19 @@ const Bt = dt({
170
170
  guestMood: null,
171
171
  guestName: "",
172
172
  guestPhone: "",
173
- inHouse: !!l.value?.tokenId || !1,
173
+ inHouse: !!r.value?.tokenId || !1,
174
174
  problem: null,
175
175
  notes: "",
176
- tokenId: l.value?.tokenId
177
- }), B = i(250), G = i(290), N = i([]), we = i([]), X = i(!0), Z = i(!0), M = i({
176
+ tokenId: r.value?.tokenId
177
+ }), G = i(250), W = i(290), N = i([]), we = i([]), Z = i(!0), ee = i(!0), M = i({
178
178
  info: !0,
179
179
  tickets: !0,
180
180
  comments: !0
181
- }), ee = i(!0), Ae = i(n.guestDetails), T = i([]), b = i({
181
+ }), te = i(!0), be = i(s.guestDetails), T = i([]), b = i({
182
182
  pms: !1,
183
183
  roomNotices: !1,
184
184
  tickets: !1
185
- }), C = i([]), ce = i([]), de = i("bottom"), te = i(null), R = i(!1), W = i(!1), U = i(""), me = i(!1), S = i(!1), O = i(null), j = i(null), be = 3e4, u = i({
185
+ }), C = i([]), ce = i([]), de = i("bottom"), R = i(null), H = i(!1), U = i(!1), j = i(""), me = i(!1), S = i(!1), O = i(null), $ = i(null), Ce = 3e4, u = i({
186
186
  assignType: null,
187
187
  department: null,
188
188
  due: /* @__PURE__ */ new Date(),
@@ -192,7 +192,7 @@ const Bt = dt({
192
192
  requestedBy: null,
193
193
  when: null,
194
194
  where: null
195
- }), $ = i([
195
+ }), Q = i([
196
196
  {
197
197
  id: 0,
198
198
  label: c("HC_STAFF_MEMBER")
@@ -203,12 +203,12 @@ const Bt = dt({
203
203
  label: c("HC_HOTEL_GUEST")
204
204
  // need to localize
205
205
  }
206
- ]), Ce = i(!1), k = i(null), w = i({
206
+ ]), Ne = i(!1), k = i(null), w = i({
207
207
  endDate: /* @__PURE__ */ new Date(),
208
208
  issue: null,
209
209
  notes: "",
210
210
  startDate: /* @__PURE__ */ new Date()
211
- }), ae = i([]), oe = i(!1), E = i([]), H = i([]), Ne = i([
211
+ }), ae = i([]), oe = i(!1), E = i([]), L = i([]), Me = i([
212
212
  {
213
213
  label: c("HC_COMPLAINT"),
214
214
  id: "complaint"
@@ -225,7 +225,7 @@ const Bt = dt({
225
225
  label: c("HC_WORK_ORDER"),
226
226
  id: "work_order"
227
227
  }
228
- ]), Q = i(), L = i(null), p = i({
228
+ ]), J = i(), P = i(null), v = i({
229
229
  assignType: null,
230
230
  department: null,
231
231
  due: /* @__PURE__ */ new Date(),
@@ -234,8 +234,8 @@ const Bt = dt({
234
234
  notes: "",
235
235
  person: null,
236
236
  requestedBy: null
237
- }), pe = i([]), P = i([]), q = i([]), ve = y(() => {
238
- switch (l.value.cleaning?.name || l.value.cleaningStatus) {
237
+ }), ve = i([]), q = i([]), x = i([]), pe = y(() => {
238
+ switch (r.value.cleaning?.name || r.value.cleaningStatus) {
239
239
  case "CLEAN":
240
240
  case "INSPECTED":
241
241
  return "CLEAN";
@@ -247,13 +247,13 @@ const Bt = dt({
247
247
  default:
248
248
  return "";
249
249
  }
250
- }), Me = y(() => ve.value === "CLEAN" ? "blue-10" : ve.value === "DIRTY" ? "red-10" : "gray-30"), Re = y(() => {
251
- const e = l.value.cleaning?.name || l.value.cleaningStatus;
250
+ }), Re = y(() => pe.value === "CLEAN" ? "blue-10" : pe.value === "DIRTY" ? "red-10" : "gray-30"), He = y(() => {
251
+ const e = r.value.cleaning?.name || r.value.cleaningStatus;
252
252
  return e ? c(`HC_${e}`) : "";
253
- }), He = y(() => {
254
- const e = A.value.toLowerCase();
255
- return n.quickReplies.filter((a) => a.toLowerCase().match(e));
256
253
  }), Le = y(() => {
254
+ const e = A.value.toLowerCase();
255
+ return s.quickReplies.filter((a) => a.toLowerCase().match(e));
256
+ }), Pe = y(() => {
257
257
  if (!C.value.length) return [];
258
258
  const e = [];
259
259
  let a = null;
@@ -262,12 +262,12 @@ const Bt = dt({
262
262
  t.dateUtc,
263
263
  "yyyy-MM-dd HH:mm:ss",
264
264
  { zone: "utc" }
265
- ).setZone(n.propertyTimeZone), s = o.toFormat("yyyy-MM-dd-HH");
266
- s !== a && (e.push({
265
+ ).setZone(s.propertyTimeZone), n = o.toFormat("yyyy-MM-dd-HH");
266
+ n !== a && (e.push({
267
267
  type: "separator",
268
268
  label: o.toFormat("ccc, LLL d 'at' h:mma").replace("AM", "am").replace("PM", "pm"),
269
- hourKey: s
270
- }), a = s), e.push({
269
+ hourKey: n
270
+ }), a = n), e.push({
271
271
  type: "message",
272
272
  ...t,
273
273
  formattedTime: o.toFormat("h:mma").replace("AM", "am").replace("PM", "pm")
@@ -275,9 +275,9 @@ const Bt = dt({
275
275
  }), e;
276
276
  }), Ie = y(() => E.value.length ? !!E.value.find(
277
277
  (a) => a.type === "complaint"
278
- ) : !1), Pe = y(() => E.value.length ? !!E.value.find(
278
+ ) : !1), qe = y(() => E.value.length ? !!E.value.find(
279
279
  (a) => a.type === "callback"
280
- ) : !1), qe = y(() => {
280
+ ) : !1), xe = y(() => {
281
281
  let e = [];
282
282
  return T.value[0] && T.value[0].options === void 0 ? T.value.forEach((a) => {
283
283
  e.push({
@@ -285,15 +285,15 @@ const Bt = dt({
285
285
  label: a.display_name
286
286
  });
287
287
  }) : e = T.value, e;
288
- }), De = y(() => l.value.occupancy?.name === "OCCUPIED" || l.value.occupancyStatus === "OCCUPIED"), xe = y(() => De.value && Ie.value ? "HK_ROOM_STATUS_Occupied_Complaint" : "HK_ROOM_STATUS_Occupied"), Fe = y(() => {
288
+ }), De = y(() => r.value.occupancy?.name === "OCCUPIED" || r.value.occupancyStatus === "OCCUPIED"), Fe = y(() => De.value && Ie.value ? "HK_ROOM_STATUS_Occupied_Complaint" : "HK_ROOM_STATUS_Occupied"), Be = y(() => {
289
289
  switch (k.value?.id) {
290
290
  case "request":
291
291
  case "work_order":
292
- return K.value[0];
292
+ return X.value[0];
293
293
  default:
294
294
  return null;
295
295
  }
296
- }), Be = y(() => {
296
+ }), Ge = y(() => {
297
297
  if (N.value)
298
298
  switch (k.value?.id) {
299
299
  case "request":
@@ -304,30 +304,30 @@ const Bt = dt({
304
304
  return null;
305
305
  }
306
306
  return null;
307
- }), Ge = y(() => {
307
+ }), We = y(() => {
308
308
  switch (k.value?.id) {
309
309
  case "request":
310
- return $.value[1];
310
+ return Q.value[1];
311
311
  case "work_order":
312
- return $.value[0];
312
+ return Q.value[0];
313
313
  default:
314
314
  return null;
315
315
  }
316
- }), We = y(() => {
316
+ }), Ue = y(() => {
317
317
  let e = "";
318
- if (l.value && l.value.reservations[0]) {
318
+ if (r.value && r.value.reservations[0]) {
319
319
  const a = _.fromISO(
320
- l.value.reservations[0].arrivalDate
321
- ), t = a.toFormat("MMM"), o = a.day, s = a.year, r = _.fromISO(
322
- l.value.reservations[0].departureDate
323
- ), d = r.toFormat("MMM"), m = r.day, f = r.year;
324
- e += t + " " + o, s !== f && (e += ", " + s), t === d ? e += "-" + m : e += " - " + d + " " + m, e += ", " + f;
320
+ r.value.reservations[0].arrivalDate
321
+ ), t = a.toFormat("MMM"), o = a.day, n = a.year, l = _.fromISO(
322
+ r.value.reservations[0].departureDate
323
+ ), d = l.toFormat("MMM"), m = l.day, f = l.year;
324
+ e += t + " " + o, n !== f && (e += ", " + n), t === d ? e += "-" + m : e += " - " + d + " " + m, e += ", " + f;
325
325
  }
326
326
  return e;
327
- }), Ue = y(() => {
327
+ }), je = y(() => {
328
328
  let e = ae.value;
329
329
  return e = [...new Set(e)], e;
330
- }), je = y(() => {
330
+ }), $e = y(() => {
331
331
  const e = k.value?.id;
332
332
  if (!e)
333
333
  return !1;
@@ -335,29 +335,29 @@ const Bt = dt({
335
335
  case "room_notice":
336
336
  return w.value.issue && w.value.startDate && w.value.endDate;
337
337
  case "complaint":
338
- return v.value.problem && v.value.guestName && v.value.guestMood;
338
+ return p.value.problem && p.value.guestName && p.value.guestMood;
339
339
  case "work_order":
340
- return p.value.item && p.value.issue && p.value.requestedBy && p.value.due && (p.value.assignType && p.value.assignType.id === 0 || p.value.assignType && p.value.assignType.id === 1 && p.value.department || p.value.assignType && p.value.assignType.id === 2 && p.value.person);
340
+ return v.value.item && v.value.issue && v.value.requestedBy && v.value.due && (v.value.assignType && v.value.assignType.id === 0 || v.value.assignType && v.value.assignType.id === 1 && v.value.department || v.value.assignType && v.value.assignType.id === 2 && v.value.person);
341
341
  case "request": {
342
- const a = u.value.item && u.value.requestedBy && u.value.due && (u.value.assignType && u.value.assignType.id === 0 || u.value.assignType && u.value.assignType.id === 1 && u.value.department || u.value.assignType && u.value.assignType.id === 2 && u.value.person), t = n.allowWhenWhere ? u.value.when && u.value.where : !0;
342
+ const a = u.value.item && u.value.requestedBy && u.value.due && (u.value.assignType && u.value.assignType.id === 0 || u.value.assignType && u.value.assignType.id === 1 && u.value.department || u.value.assignType && u.value.assignType.id === 2 && u.value.person), t = s.allowWhenWhere ? u.value.when && u.value.where : !0;
343
343
  return a && t;
344
344
  }
345
345
  default:
346
346
  return !1;
347
347
  }
348
348
  }), Te = () => {
349
- oe.value = !1, R.value = !1, ie.value = !1, T.value = [], ce.value = [], pe.value = [], P.value = [], q.value = [], k.value = null, w.value.issue = null, w.value.startDate = /* @__PURE__ */ new Date(), w.value.endDate = /* @__PURE__ */ new Date(), w.value.notes = "", v.value.guestName = "", v.value.guestEmail = "", v.value.guestPhone = "", v.value.guestMood = null, v.value.guestLoyalty = "", v.value.problem = null, v.value.checkInDate = /* @__PURE__ */ new Date(), v.value.checkOutDate = /* @__PURE__ */ new Date(), v.value.notes = "", p.value.assignType = null, p.value.department = null, p.value.person = null, p.value.due = /* @__PURE__ */ new Date(), p.value.item = null, p.value.issue = null, p.value.notes = "", u.value.assignType = null, u.value.department = null, u.value.person = null, u.value.due = /* @__PURE__ */ new Date(), u.value.item = null, u.value.notes = "", u.value.when = null, u.value.where = null;
350
- }, $e = async () => {
351
- h("create:callback", l.value), h("toggle", !1);
352
- }, x = (e) => {
349
+ oe.value = !1, H.value = !1, ie.value = !1, T.value = [], ce.value = [], ve.value = [], q.value = [], x.value = [], k.value = null, w.value.issue = null, w.value.startDate = /* @__PURE__ */ new Date(), w.value.endDate = /* @__PURE__ */ new Date(), w.value.notes = "", p.value.guestName = "", p.value.guestEmail = "", p.value.guestPhone = "", p.value.guestMood = null, p.value.guestLoyalty = "", p.value.problem = null, p.value.checkInDate = /* @__PURE__ */ new Date(), p.value.checkOutDate = /* @__PURE__ */ new Date(), p.value.notes = "", v.value.assignType = null, v.value.department = null, v.value.person = null, v.value.due = /* @__PURE__ */ new Date(), v.value.item = null, v.value.issue = null, v.value.notes = "", u.value.assignType = null, u.value.department = null, u.value.person = null, u.value.due = /* @__PURE__ */ new Date(), u.value.item = null, u.value.notes = "", u.value.when = null, u.value.where = null;
350
+ }, Qe = async () => {
351
+ h("create:callback", r.value), h("toggle", !1);
352
+ }, F = (e) => {
353
353
  const a = [];
354
354
  (Array.isArray(e) ? e : Object.values(e)).forEach((o) => {
355
- const s = o.senderType || o.sender_type, r = o.senderName || "", d = o.senderId || o.sender_id, m = o.profileImg || o.profile_img, f = r ? r.split(" ") : ["", ""], g = o.user_first_name || o.guest_first_name || f[0] || "", V = o.user_last_name || o.guest_last_name || f.slice(1).join(" ") || "", re = g && V ? `${g} ${V}` : g || "Auto-Reply", le = s === "system" || s === "user", I = s === "guest";
355
+ const n = o.senderType || o.sender_type, l = o.senderName || "", d = o.senderId || o.sender_id, m = o.profileImg || o.profile_img, f = l ? l.split(" ") : ["", ""], g = o.user_first_name || o.guest_first_name || f[0] || "", z = o.user_last_name || o.guest_last_name || f.slice(1).join(" ") || "", re = g && z ? `${g} ${z}` : g || "Auto-Reply", le = n === "system" || n === "user", I = n === "guest";
356
356
  let D = {
357
357
  id: o.id,
358
- isPropertyEmployee: s === "user",
358
+ isPropertyEmployee: n === "user",
359
359
  isSent: !!o.sent,
360
- isSystemMessage: s === "system",
360
+ isSystemMessage: n === "system",
361
361
  isStaffMessage: le,
362
362
  isGuestMessage: I,
363
363
  comment: o.content,
@@ -367,19 +367,19 @@ const Bt = dt({
367
367
  icon: "",
368
368
  id: d || "system-message",
369
369
  initials: "",
370
- lastName: V || "",
370
+ lastName: z || "",
371
371
  name: re,
372
372
  src: m || ""
373
373
  }
374
374
  };
375
375
  D.user.firstName && D.user.lastName ? D.user.initials = D.user.firstName[0] + D.user.lastName[0] : D.user.firstName && (D.user.initials = D.user.firstName[0]), le && (D.user.icon = "property-fill"), a.push(D);
376
376
  }), C.value = a;
377
- }, Qe = (e) => {
377
+ }, Je = (e) => {
378
378
  if (!e || e.length === 0) return;
379
379
  (Array.isArray(e) ? e : Object.values(e)).forEach((t) => {
380
380
  if (C.value.some((D) => D.id === t.id))
381
381
  return;
382
- const o = t.senderType || t.sender_type, s = t.senderName || "", r = t.senderId || t.sender_id, d = t.profileImg || t.profile_img, m = s ? s.split(" ") : ["", ""], f = t.user_first_name || t.guest_first_name || m[0] || "", g = t.user_last_name || t.guest_last_name || m.slice(1).join(" ") || "", V = f && g ? `${f} ${g}` : f || "Auto-Reply", re = o === "system" || o === "user", le = o === "guest";
382
+ const o = t.senderType || t.sender_type, n = t.senderName || "", l = t.senderId || t.sender_id, d = t.profileImg || t.profile_img, m = n ? n.split(" ") : ["", ""], f = t.user_first_name || t.guest_first_name || m[0] || "", g = t.user_last_name || t.guest_last_name || m.slice(1).join(" ") || "", z = f && g ? `${f} ${g}` : f || "Auto-Reply", re = o === "system" || o === "user", le = o === "guest";
383
383
  let I = {
384
384
  id: t.id,
385
385
  isPropertyEmployee: o === "user",
@@ -392,19 +392,19 @@ const Bt = dt({
392
392
  user: {
393
393
  firstName: f || "Auto-Reply",
394
394
  icon: "",
395
- id: r || "system-message",
395
+ id: l || "system-message",
396
396
  initials: "",
397
397
  lastName: g || "",
398
- name: V,
398
+ name: z,
399
399
  src: d || ""
400
400
  }
401
401
  };
402
402
  I.user.firstName && I.user.lastName ? I.user.initials = I.user.firstName[0] + I.user.lastName[0] : I.user.firstName && (I.user.initials = I.user.firstName[0]), re && (I.user.icon = "property-fill"), C.value.push(I);
403
403
  });
404
404
  }, fe = async (e = !1) => {
405
- if (n.showComments && l.value.tokenId)
405
+ if (s.showComments && r.value.tokenId)
406
406
  try {
407
- let a = `/api/client/connect/getMessages.php?tokenId=${l.value.tokenId}`;
407
+ let a = `/api/client/connect/getMessages.php?tokenId=${r.value.tokenId}`;
408
408
  e && O.value !== null && (a += `&lastMsgId=${O.value}`);
409
409
  const o = await (await fetch(a, {
410
410
  method: "GET",
@@ -413,14 +413,14 @@ const Bt = dt({
413
413
  if (o.status === "error")
414
414
  throw new Error(o.message || "Failed to get messages");
415
415
  if (S.value = !o.closed, o.messages && o.messages.length > 0) {
416
- O.value = o.messages[o.messages.length - 1].id, e ? Qe(o.messages) : x(o.messages);
417
- const s = setTimeout(Y, 100);
418
- H.value.push(s);
419
- } else e || x(o.messages || []);
416
+ O.value = o.messages[o.messages.length - 1].id, e ? Je(o.messages) : F(o.messages);
417
+ const n = setTimeout(V, 100);
418
+ L.value.push(n);
419
+ } else e || F(o.messages || []);
420
420
  } catch (a) {
421
421
  console.error("getChatMessages error:", a);
422
422
  }
423
- }, Je = (e) => {
423
+ }, Ye = (e) => {
424
424
  const a = _.utc(), t = _.fromFormat(e, "yyyy-MM-dd HH:mm:ss", { zone: "utc" }), o = a.diff(
425
425
  t,
426
426
  [
@@ -430,11 +430,11 @@ const Bt = dt({
430
430
  "hours",
431
431
  "minutes"
432
432
  ]
433
- ), s = Math.floor(o.years), r = Math.floor(o.months), d = Math.floor(o.days), m = Math.floor(o.hours), f = Math.floor(o.minutes);
434
- if (s)
435
- return s === 1 ? c("HC_ONE_YEAR_AGO") : c("HC_X_YEARS_AGO", { years: s });
436
- if (r)
437
- return r === 1 ? c("HC_ONE_MONTH_AGO") : c("HC_X_MONTHS_AGO", { months: r });
433
+ ), n = Math.floor(o.years), l = Math.floor(o.months), d = Math.floor(o.days), m = Math.floor(o.hours), f = Math.floor(o.minutes);
434
+ if (n)
435
+ return n === 1 ? c("HC_ONE_YEAR_AGO") : c("HC_X_YEARS_AGO", { years: n });
436
+ if (l)
437
+ return l === 1 ? c("HC_ONE_MONTH_AGO") : c("HC_X_MONTHS_AGO", { months: l });
438
438
  if (d)
439
439
  return d === 1 ? c("HC_ONE_DAY_AGO") : c("HC_X_DAYS_AGO", { days: d });
440
440
  if (m)
@@ -443,14 +443,14 @@ const Bt = dt({
443
443
  return f === 1 ? c("HC_ONE_MINUTE_AGO") : c("HC_X_MINUTES_AGO", { minutes: f });
444
444
  if (f === 0)
445
445
  return c("HC_A_MOMENT_AGO");
446
- }, Ye = async () => {
447
- n.showGuestDetails && se(), ne(), J(), h("refresh:pms", l.value);
446
+ }, Ve = async () => {
447
+ s.showGuestDetails && se(), ne(), Y(), h("refresh:pms", r.value);
448
448
  }, se = async () => {
449
449
  try {
450
450
  b.value.pms = !0;
451
451
  const e = new AbortController(), a = setTimeout(() => e.abort(), 45e3);
452
- H.value.push(a);
453
- const t = n.pmsBaseUrl;
452
+ L.value.push(a);
453
+ const t = s.pmsBaseUrl;
454
454
  if (!t)
455
455
  throw new Error("PMS base URL is required");
456
456
  const o = {
@@ -459,21 +459,21 @@ const Bt = dt({
459
459
  return g.length === 2 && g.pop()?.split(";").shift() || "";
460
460
  })(),
461
461
  "Content-Type": "application/json"
462
- }, s = l.value?.qv2Rooms?.qRoomId || l.value?.id || n.room.id, r = await fetch(
463
- `${t}/vendors/properties/statuses/${n.propertyId}/rooms`,
462
+ }, n = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room.id, l = await fetch(
463
+ `${t}/vendors/properties/statuses/${s.propertyId}/rooms`,
464
464
  {
465
465
  method: "POST",
466
466
  headers: o,
467
467
  signal: e.signal,
468
- body: JSON.stringify({ roomsIds: [s] })
468
+ body: JSON.stringify({ roomsIds: [n] })
469
469
  }
470
470
  );
471
- clearTimeout(a), r.ok || ke(r);
472
- const d = await r.json(), m = d.data?.pmsRooms || d.data?.rooms || d.rooms || [];
473
- te.value = m, m.length > 0 ? l.value = {
471
+ clearTimeout(a), l.ok || ke(l);
472
+ const d = await l.json(), m = d.data?.pmsRooms || d.data?.rooms || d.rooms || [];
473
+ R.value = m, m.length > 0 ? r.value = {
474
474
  ...m[0],
475
- tokenId: m[0].tokenId || n.room.tokenId
476
- } : l.value = n.room, b.value.pms = !1;
475
+ tokenId: m[0].tokenId || s.room.tokenId
476
+ } : r.value = s.room, b.value.pms = !1;
477
477
  } catch (e) {
478
478
  return b.value.pms = !1, h("show:toast", {
479
479
  show: !0,
@@ -486,7 +486,7 @@ const Bt = dt({
486
486
  try {
487
487
  b.value.roomNotices = !0;
488
488
  const e = await fetch(
489
- "/api/client/common/getRoomNotices.php?propertyId=" + n.propertyId + "&roomIds=[" + n.room.id + "]"
489
+ "/api/client/common/getRoomNotices.php?propertyId=" + s.propertyId + "&roomIds=[" + s.room.id + "]"
490
490
  );
491
491
  if (!e.ok)
492
492
  throw new Error(`HTTP error! status: ${e.status}`);
@@ -505,7 +505,7 @@ const Bt = dt({
505
505
  }, he = async () => {
506
506
  try {
507
507
  const e = new FormData();
508
- e.append("property_id", n.propertyId), e.append("filter", "tasks_new");
508
+ e.append("property_id", s.propertyId), e.append("filter", "tasks_new");
509
509
  const [a, t] = await Promise.all([
510
510
  fetch("/api/client/common/getDepartments.php", {
511
511
  method: "POST"
@@ -514,18 +514,18 @@ const Bt = dt({
514
514
  method: "POST",
515
515
  body: e
516
516
  })
517
- ]), o = await a.json(), s = await t.json();
518
- if (o.departments && (o.departments.forEach((r) => {
519
- r.label = r.display_name;
520
- }), N.value = o.departments), s.users) {
521
- const r = [];
517
+ ]), o = await a.json(), n = await t.json();
518
+ if (o.departments && (o.departments.forEach((l) => {
519
+ l.label = l.display_name;
520
+ }), N.value = o.departments), n.users) {
521
+ const l = [];
522
522
  let d = {
523
523
  group: "",
524
524
  options: []
525
525
  };
526
- s.users.forEach((m) => {
527
- m.translated_department !== d.group && (d.group && r.push({ ...d }), d.group = m.translated_department, d.options = []), d.options.push(m);
528
- }), d.group && r.push({ ...d }), we.value = r;
526
+ n.users.forEach((m) => {
527
+ m.translated_department !== d.group && (d.group && l.push({ ...d }), d.group = m.translated_department, d.options = []), d.options.push(m);
528
+ }), d.group && l.push({ ...d }), we.value = l;
529
529
  }
530
530
  } catch (e) {
531
531
  console.error("Error getting shared data:", e), h("show:toast", {
@@ -538,7 +538,7 @@ const Bt = dt({
538
538
  }, Oe = async () => {
539
539
  try {
540
540
  const a = await (await fetch(
541
- `/api/client/connect/getStayDetails.php?tokenId=${l.value.tokenId}`,
541
+ `/api/client/connect/getStayDetails.php?tokenId=${r.value.tokenId}`,
542
542
  {
543
543
  method: "GET",
544
544
  credentials: "include"
@@ -546,9 +546,9 @@ const Bt = dt({
546
546
  )).json();
547
547
  if (a.status === "error")
548
548
  throw new Error(a.message || "Failed to get stay details");
549
- a.userName && (v.value.guestName = a.userName), a.cellPhone && (v.value.guestPhone = a.cellPhone), a.email && (v.value.guestEmail = a.email), a.checkIn && (v.value.checkInDate = _.fromISO(
549
+ a.userName && (p.value.guestName = a.userName), a.cellPhone && (p.value.guestPhone = a.cellPhone), a.email && (p.value.guestEmail = a.email), a.checkIn && (p.value.checkInDate = _.fromISO(
550
550
  a.checkIn
551
- ).toJSDate()), a.checkOut && (v.value.checkOutDate = _.fromISO(
551
+ ).toJSDate()), a.checkOut && (p.value.checkOutDate = _.fromISO(
552
552
  a.checkOut
553
553
  ).toJSDate());
554
554
  } catch (e) {
@@ -559,7 +559,7 @@ const Bt = dt({
559
559
  icon: "exclamation-circle"
560
560
  });
561
561
  }
562
- }, Ve = (e) => {
562
+ }, ze = (e) => {
563
563
  switch (e) {
564
564
  case "complaint":
565
565
  return "red-30";
@@ -572,7 +572,7 @@ const Bt = dt({
572
572
  case "task":
573
573
  return "green-20";
574
574
  }
575
- }, ze = (e) => {
575
+ }, Ke = (e) => {
576
576
  switch (e) {
577
577
  case "complaint":
578
578
  return "face-frown";
@@ -585,11 +585,11 @@ const Bt = dt({
585
585
  case "task":
586
586
  return "check";
587
587
  }
588
- }, J = async () => {
588
+ }, Y = async () => {
589
589
  try {
590
590
  b.value.tickets = !0;
591
591
  const e = await fetch(
592
- "/api/client/common/getAllToDos.php?propertyId=" + n.propertyId + "&roomIds=[" + n.room.id + "]"
592
+ "/api/client/common/getAllToDos.php?propertyId=" + s.propertyId + "&roomIds=[" + s.room.id + "]"
593
593
  );
594
594
  if (!e.ok)
595
595
  throw new Error(`HTTP error! status: ${e.status}`);
@@ -614,34 +614,34 @@ const Bt = dt({
614
614
  t = { code: e.status, message: a };
615
615
  }
616
616
  return t.code === 401 ? (window.location.href = "/logout.php?unauthorized=1", { error: t }) : t;
617
- }, Ke = (e) => {
617
+ }, Xe = (e) => {
618
618
  const a = document.querySelectorAll(".pulse");
619
619
  if (a && a.length) {
620
- const t = l.value?.qv2Rooms?.qRoomId || l.value?.id || n.room?.id, o = document.getElementById("room-" + t), s = o?.classList;
620
+ const t = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, o = document.getElementById("room-" + t), n = o?.classList;
621
621
  switch (e) {
622
622
  case "room_notice":
623
- (s?.contains("roombox_unsel") || s?.contains("roombox_unsel_active")) && (o?.classList.remove(), o?.classList.add("roomnoticeroombox_sel"));
623
+ (n?.contains("roombox_unsel") || n?.contains("roombox_unsel_active")) && (o?.classList.remove(), o?.classList.add("roomnoticeroombox_sel"));
624
624
  break;
625
625
  case "complaint":
626
- !s?.contains("smsroombox_sel") && !s?.contains("callbackroombox_sel") && (o?.classList.remove(), o?.classList.add("complaintsroombox_sel"));
626
+ !n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && (o?.classList.remove(), o?.classList.add("complaintsroombox_sel"));
627
627
  break;
628
628
  case "request":
629
- !s?.contains("smsroombox_sel") && !s?.contains("callbackroombox_sel") && !s?.contains("complaintsroombox_sel") && (o?.classList.remove(), o?.classList.add("guestrequestroombox_sel"));
629
+ !n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && !n?.contains("complaintsroombox_sel") && (o?.classList.remove(), o?.classList.add("guestrequestroombox_sel"));
630
630
  break;
631
631
  case "work_order":
632
- !s?.contains("smsroombox_sel") && !s?.contains("callbackroombox_sel") && !s?.contains("complaintsroombox_sel") && !s?.contains("guestrequestroombox_sel") && (o?.classList.remove(), o?.classList.add("workordersroombox_sel"));
632
+ !n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && !n?.contains("complaintsroombox_sel") && !n?.contains("guestrequestroombox_sel") && (o?.classList.remove(), o?.classList.add("workordersroombox_sel"));
633
633
  break;
634
634
  }
635
- const r = setTimeout(() => {
635
+ const l = setTimeout(() => {
636
636
  a.forEach((d) => {
637
637
  d.classList.remove("pulse");
638
638
  });
639
639
  }, 4500);
640
- H.value.push(r);
640
+ L.value.push(l);
641
641
  }
642
- }, Xe = () => {
642
+ }, Ze = () => {
643
643
  window.open("/guest/overview.php", "_blank");
644
- }, Ze = (e) => {
644
+ }, et = (e) => {
645
645
  let a = "";
646
646
  switch (e.type) {
647
647
  case "complaint":
@@ -663,55 +663,55 @@ const Bt = dt({
663
663
  return "#";
664
664
  }
665
665
  window.open(a, "_blank");
666
- }, et = async () => {
667
- const e = l.value?.qv2Rooms?.qRoomId || l.value?.id || n.room?.id, a = l.value?.qv2Rooms?.qRoomName || l.value?.name || n.room?.name, t = {
666
+ }, tt = async () => {
667
+ const e = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, a = r.value?.qv2Rooms?.qRoomName || r.value?.name || s.room?.name, t = {
668
668
  type: k.value?.id,
669
- propertyId: n.propertyId,
670
- userId: L.value,
669
+ propertyId: s.propertyId,
670
+ userId: P.value,
671
671
  areaId: e,
672
672
  areaName: a
673
673
  };
674
674
  switch (k.value?.id) {
675
675
  case "complaint":
676
- t.tokenId = l.value.tokenId, t.problemId = v.value.problem.id, t.guestName = v.value.guestName, t.guestPhone = v.value.guestPhone, t.guestEmail = v.value.guestEmail, t.guestLoyalty = v.value.guestLoyalty, t.guestMood = v.value.guestMood.id, t.checkInDate = _.fromJSDate(v.value.checkInDate).toFormat(
676
+ t.tokenId = r.value.tokenId, t.problemId = p.value.problem.id, t.guestName = p.value.guestName, t.guestPhone = p.value.guestPhone, t.guestEmail = p.value.guestEmail, t.guestLoyalty = p.value.guestLoyalty, t.guestMood = p.value.guestMood.id, t.checkInDate = _.fromJSDate(p.value.checkInDate).toFormat(
677
677
  "yyyy-MM-dd"
678
- ), t.checkOutDate = _.fromJSDate(v.value.checkOutDate).toFormat(
678
+ ), t.checkOutDate = _.fromJSDate(p.value.checkOutDate).toFormat(
679
679
  "yyyy-MM-dd"
680
- ), t.notes = v.value.notes, t.inHouse = 2, t.source = "dashboard", h("create:todo", t);
680
+ ), t.notes = p.value.notes, t.inHouse = 2, t.source = "dashboard", h("create:todo", t);
681
681
  break;
682
682
  case "request":
683
- t.itemId = u.value.item.id, t.assignType = u.value.assignType.id, t.occupied = u.value.requestedBy.id, t.notes = u.value.notes, t.dueDate = _.fromJSDate(u.value.due).toFormat("yyyy-MM-dd"), u.value.assignType.id === 1 && (t.department = u.value.department.id), u.value.assignType.id === 2 && (t.person = u.value.person.id), n.allowWhenWhere && (t.requestWhen = u.value.when ? u.value.when.id : "", t.requestWhere = u.value.where ? u.value.where.id : ""), h("create:todo", t);
683
+ t.itemId = u.value.item.id, t.assignType = u.value.assignType.id, t.occupied = u.value.requestedBy.id, t.notes = u.value.notes, t.dueDate = _.fromJSDate(u.value.due).toFormat("yyyy-MM-dd"), u.value.assignType.id === 1 && (t.department = u.value.department.id), u.value.assignType.id === 2 && (t.person = u.value.person.id), s.allowWhenWhere && (t.requestWhen = u.value.when ? u.value.when.id : "", t.requestWhere = u.value.where ? u.value.where.id : ""), h("create:todo", t);
684
684
  break;
685
685
  case "room_notice":
686
686
  t.issueId = w.value.issue.id, t.startDate = _.fromJSDate(w.value.startDate).toFormat("yyyy-MM-dd"), t.endDate = _.fromJSDate(w.value.endDate).toFormat("yyyy-MM-dd"), t.notes = w.value.notes, t.sendPush = "1", h("create:todo", t);
687
687
  break;
688
688
  case "work_order":
689
- t.itemId = p.value.item.id, t.issueId = p.value.issue.id, t.assignType = p.value.assignType.id, t.occupied = p.value.requestedBy.id, t.notes = p.value.notes, t.dueDate = _.fromJSDate(p.value.due).toFormat("yyyy-MM-dd"), p.value.assignType.id === 1 && (t.department = p.value.department.id), p.value.assignType.id === 2 && (t.person = p.value.person.id), h("create:todo", t);
689
+ t.itemId = v.value.item.id, t.issueId = v.value.issue.id, t.assignType = v.value.assignType.id, t.occupied = v.value.requestedBy.id, t.notes = v.value.notes, t.dueDate = _.fromJSDate(v.value.due).toFormat("yyyy-MM-dd"), v.value.assignType.id === 1 && (t.department = v.value.department.id), v.value.assignType.id === 2 && (t.person = v.value.person.id), h("create:todo", t);
690
690
  break;
691
691
  }
692
- }, tt = (e) => {
693
- ge(), _e(), n.hover && h("toggle", e);
694
692
  }, at = (e) => {
693
+ ge(), _e(), s.hover && h("toggle", e);
694
+ }, ot = (e) => {
695
695
  Se(), A.value = e;
696
- }, ot = async (e) => {
697
- if (console.log("selected:", e), k.value = e, T.value = [], w.value.issue = null, v.value.problem = null, p.value.item = null, p.value.issue = null, u.value.item = null, !k.value)
696
+ }, st = async (e) => {
697
+ if (console.log("selected:", e), k.value = e, T.value = [], w.value.issue = null, p.value.problem = null, v.value.item = null, v.value.issue = null, u.value.item = null, !k.value)
698
698
  return;
699
- const a = l.value?.qv2Rooms?.qRoomId || l.value?.id || n.room?.id, t = new FormData();
700
- switch (t.append("property_id", n.propertyId), t.append("area_id", a), e.id) {
699
+ const a = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, t = new FormData();
700
+ switch (t.append("property_id", s.propertyId), t.append("area_id", a), e.id) {
701
701
  case "complaint":
702
702
  try {
703
- l.value.tokenId && await Oe();
704
- const s = await (await fetch("/api/client/common/getComplaintProblemsByPropertyId.php", {
703
+ r.value.tokenId && await Oe();
704
+ const n = await (await fetch("/api/client/common/getComplaintProblemsByPropertyId.php", {
705
705
  method: "POST",
706
706
  body: t
707
707
  })).json();
708
- s.items && (T.value = s.items);
709
- const r = await z.post(
708
+ n.items && (T.value = n.items);
709
+ const l = await K.post(
710
710
  "/api/client/common/getComplaintMoods.php"
711
711
  );
712
- r.data.items.forEach((d) => {
712
+ l.data.items.forEach((d) => {
713
713
  d.label = d.display_name;
714
- }), ce.value = r.data.items;
714
+ }), ce.value = l.data.items;
715
715
  } catch (o) {
716
716
  console.error("Error loading complaint options:", o), h("show:toast", {
717
717
  show: !0,
@@ -723,11 +723,11 @@ const Bt = dt({
723
723
  break;
724
724
  case "room_notice":
725
725
  try {
726
- const s = await (await fetch("/api/client/common/getRoomNoticeIssuesByPropertyId.php", {
726
+ const n = await (await fetch("/api/client/common/getRoomNoticeIssuesByPropertyId.php", {
727
727
  method: "POST",
728
728
  body: t
729
729
  })).json();
730
- s.items && (T.value = s.items);
730
+ n.items && (T.value = n.items);
731
731
  } catch (o) {
732
732
  console.error("Error loading room notice options:", o), h("show:toast", {
733
733
  show: !0,
@@ -739,35 +739,35 @@ const Bt = dt({
739
739
  break;
740
740
  case "request":
741
741
  try {
742
- u.value.requestedBy = $.value[1], u.value.assignType = K.value[0];
743
- const s = await (await fetch("/api/client/common/getHousekeepingItemsByPropertyId.php", {
742
+ u.value.requestedBy = Q.value[1], u.value.assignType = X.value[0];
743
+ const n = await (await fetch("/api/client/common/getHousekeepingItemsByPropertyId.php", {
744
744
  method: "POST",
745
745
  body: t
746
746
  })).json();
747
- if (s.items && (T.value = s.items), await he(), u.value.department = N.value.find(
748
- (r) => parseInt(r.id) === 4
749
- ), n.allowWhenWhere)
747
+ if (n.items && (T.value = n.items), await he(), u.value.department = N.value.find(
748
+ (l) => parseInt(l.id) === 4
749
+ ), s.allowWhenWhere)
750
750
  try {
751
- const r = new FormData();
752
- r.append("property_id", n.propertyId);
751
+ const l = new FormData();
752
+ l.append("property_id", s.propertyId);
753
753
  const m = await (await fetch(
754
754
  "/api/client/common/getWhenWhereOptions.php",
755
755
  {
756
756
  method: "POST",
757
- body: r
757
+ body: l
758
758
  }
759
759
  )).json();
760
- m.when && Array.isArray(m.when) ? P.value = m.when.map((f) => ({
760
+ m.when && Array.isArray(m.when) ? q.value = m.when.map((f) => ({
761
761
  id: f.id,
762
762
  label: f.name,
763
763
  value: f.id
764
- })) : P.value = [], m.where && Array.isArray(m.where) ? q.value = m.where.map((f) => ({
764
+ })) : q.value = [], m.where && Array.isArray(m.where) ? x.value = m.where.map((f) => ({
765
765
  id: f.id,
766
766
  label: f.name,
767
767
  value: f.id
768
- })) : q.value = [];
769
- } catch (r) {
770
- console.error("Error loading When/Where options:", r), P.value = [], q.value = [], h("show:toast", {
768
+ })) : x.value = [];
769
+ } catch (l) {
770
+ console.error("Error loading When/Where options:", l), q.value = [], x.value = [], h("show:toast", {
771
771
  show: !0,
772
772
  message: c("HC_FAILED_TO_LOAD_WHEN_WHERE_OPTIONS"),
773
773
  variant: "error",
@@ -785,19 +785,19 @@ const Bt = dt({
785
785
  break;
786
786
  case "work_order":
787
787
  try {
788
- p.value.requestedBy = $.value[0], p.value.assignType = K.value[0];
789
- const s = await (await fetch("/api/client/common/getItemsByRoomId.php", {
788
+ v.value.requestedBy = Q.value[0], v.value.assignType = X.value[0];
789
+ const n = await (await fetch("/api/client/common/getItemsByRoomId.php", {
790
790
  method: "POST",
791
791
  body: t
792
- })).json(), r = [];
792
+ })).json(), l = [];
793
793
  let d = {
794
794
  group: "",
795
795
  options: []
796
796
  };
797
- s.items && (s.items.forEach((m) => {
798
- m.section_name !== d.group && (d.group && r.push({ ...d }), d.group = m.section_name, d.options = []), m.label && d.options.push(m);
799
- }), d.group && r.push({ ...d })), T.value = r, await Promise.all([
800
- z.post(
797
+ n.items && (n.items.forEach((m) => {
798
+ m.section_name !== d.group && (d.group && l.push({ ...d }), d.group = m.section_name, d.options = []), m.label && d.options.push(m);
799
+ }), d.group && l.push({ ...d })), T.value = l, await Promise.all([
800
+ K.post(
801
801
  "/api/client/common/getWorkOrderIssues.php"
802
802
  ),
803
803
  he()
@@ -805,8 +805,8 @@ const Bt = dt({
805
805
  const f = m[0];
806
806
  f.data.issues.forEach((g) => {
807
807
  g.label = g.display_name;
808
- }), pe.value = f.data.issues;
809
- }), p.value.department = N.value.find(
808
+ }), ve.value = f.data.issues;
809
+ }), v.value.department = N.value.find(
810
810
  (m) => parseInt(m.id) === 2
811
811
  );
812
812
  } catch (o) {
@@ -821,23 +821,23 @@ const Bt = dt({
821
821
  default:
822
822
  return;
823
823
  }
824
- }, st = () => {
824
+ }, nt = () => {
825
825
  oe.value = !oe.value, ie.value = !1;
826
826
  }, Ee = () => {
827
827
  const e = document.getElementById("comment-field"), a = document.getElementById("hidden-text");
828
828
  e.style.height = a?.offsetHeight + "px";
829
- }, Y = () => {
829
+ }, V = () => {
830
830
  const e = document.getElementById("comments-container");
831
831
  e?.scroll({
832
832
  top: e.scrollHeight,
833
833
  behavior: "smooth"
834
834
  });
835
- }, nt = async (e) => {
836
- if (e && e.type === "keydown" && e.preventDefault(), l.value.tokenId && A.value && !R.value)
835
+ }, rt = async (e) => {
836
+ if (e && e.type === "keydown" && e.preventDefault(), r.value.tokenId && A.value && !H.value)
837
837
  try {
838
838
  const a = new FormData();
839
- a.append("tokenId", l.value.tokenId), a.append("content", A.value), a.append("senderId", L.value || "");
840
- const t = await z.post(
839
+ a.append("tokenId", r.value.tokenId), a.append("content", A.value), a.append("senderId", P.value || "");
840
+ const t = await K.post(
841
841
  "/api/client/connect/sendMessage.php",
842
842
  a
843
843
  );
@@ -850,7 +850,7 @@ const Bt = dt({
850
850
  });
851
851
  return;
852
852
  }
853
- A.value = "", S.value = !t.data.closed, t.data.messages && (x(t.data.messages), t.data.messages.length > 0 && (O.value = t.data.messages[t.data.messages.length - 1].id)), Y();
853
+ A.value = "", S.value = !t.data.closed, t.data.messages && (F(t.data.messages), t.data.messages.length > 0 && (O.value = t.data.messages[t.data.messages.length - 1].id)), V();
854
854
  } catch (a) {
855
855
  console.error("sendChatMessage error:", a), h("show:toast", {
856
856
  show: !0,
@@ -859,12 +859,12 @@ const Bt = dt({
859
859
  icon: "exclamation-circle"
860
860
  });
861
861
  }
862
- }, rt = async () => {
863
- if (!(!l.value.tokenId || !L.value))
862
+ }, lt = async () => {
863
+ if (!(!r.value.tokenId || !P.value))
864
864
  try {
865
865
  const e = S.value ? "/api/client/connect/closeConversation.php" : "/api/client/connect/openConversation.php", a = new FormData();
866
- a.append("tokenId", l.value.tokenId), a.append("userId", L.value), S.value && O.value !== null && a.append("lastMsgId", O.value.toString());
867
- const t = await z.post(e, a);
866
+ a.append("tokenId", r.value.tokenId), a.append("userId", P.value), S.value && O.value !== null && a.append("lastMsgId", O.value.toString());
867
+ const t = await K.post(e, a);
868
868
  if (t.data.status === "error") {
869
869
  h("show:toast", {
870
870
  show: !0,
@@ -874,7 +874,7 @@ const Bt = dt({
874
874
  });
875
875
  return;
876
876
  }
877
- S.value = !t.data.closed, t.data.messages && (x(t.data.messages), t.data.messages.length > 0 && (O.value = t.data.messages[t.data.messages.length - 1].id)), h("show:toast", {
877
+ S.value = !t.data.closed, t.data.messages && (F(t.data.messages), t.data.messages.length > 0 && (O.value = t.data.messages[t.data.messages.length - 1].id)), h("show:toast", {
878
878
  show: !0,
879
879
  message: S.value ? c("HC_CONVERSATION_REOPENED") : c("HC_CONVERSATION_CLOSED"),
880
880
  variant: "success",
@@ -888,13 +888,13 @@ const Bt = dt({
888
888
  icon: "exclamation-circle"
889
889
  });
890
890
  }
891
- }, lt = async () => {
892
- if (n.isTestEnvironment && !(!l.value?.tokenId || !U.value.trim())) {
891
+ }, it = async () => {
892
+ if (s.isTestEnvironment && !(!r.value?.tokenId || !j.value.trim())) {
893
893
  me.value = !0;
894
894
  try {
895
895
  const e = new FormData();
896
- e.append("tokenId", l.value.tokenId), e.append("content", U.value.trim());
897
- const a = await z.post(
896
+ e.append("tokenId", r.value.tokenId), e.append("content", j.value.trim());
897
+ const a = await K.post(
898
898
  "/api/client/connect/simulateInbound.php",
899
899
  e
900
900
  );
@@ -907,7 +907,7 @@ const Bt = dt({
907
907
  });
908
908
  return;
909
909
  }
910
- a.data.messages && (x(a.data.messages), S.value = !a.data.closed, a.data.messages.length > 0 && (O.value = a.data.messages[a.data.messages.length - 1].id)), U.value = "", W.value = !1, Y(), h("show:toast", {
910
+ a.data.messages && (F(a.data.messages), S.value = !a.data.closed, a.data.messages.length > 0 && (O.value = a.data.messages[a.data.messages.length - 1].id)), j.value = "", U.value = !1, V(), h("show:toast", {
911
911
  show: !0,
912
912
  message: c("HC_SIMULATED_GUEST_REPLY"),
913
913
  variant: "success",
@@ -924,77 +924,79 @@ const Bt = dt({
924
924
  me.value = !1;
925
925
  }
926
926
  }
927
- }, it = () => {
928
- W.value = !W.value, W.value || (U.value = "");
929
927
  }, ut = () => {
930
- j.value || (j.value = setInterval(() => {
928
+ U.value = !U.value, U.value || (j.value = "");
929
+ }, ct = () => {
930
+ $.value || ($.value = setInterval(() => {
931
931
  document.visibilityState === "visible" && fe(!0);
932
- }, be));
932
+ }, Ce));
933
933
  }, ye = () => {
934
- j.value && (clearInterval(j.value), j.value = null);
934
+ $.value && (clearInterval($.value), $.value = null);
935
935
  }, ge = () => {
936
- if (n.align === "left" || n.align === "right") {
937
- const e = Q.value?.getBoundingClientRect().left, a = window.innerWidth;
938
- ue.value = a - e < G.value ? "right" : "left";
936
+ if (s.align === "left" || s.align === "right") {
937
+ const e = J.value?.getBoundingClientRect().left, a = window.innerWidth;
938
+ ue.value = a - e < W.value ? "right" : "left";
939
939
  } else {
940
- const e = Q.value?.getBoundingClientRect().top, a = window.innerHeight;
941
- ue.value = a - e < B.value ? "bottom" : "top";
940
+ const e = J.value?.getBoundingClientRect().top, a = window.innerHeight;
941
+ ue.value = a - e < G.value ? "bottom" : "top";
942
942
  }
943
943
  }, _e = () => {
944
- if (n.position === "top" || n.position === "bottom") {
945
- const e = Q.value?.getBoundingClientRect().top, a = window.innerHeight;
946
- de.value = a - e < B.value ? "top" : "bottom";
944
+ if (s.position === "top" || s.position === "bottom") {
945
+ const e = J.value?.getBoundingClientRect().top, a = window.innerHeight;
946
+ de.value = a - e < G.value ? "top" : "bottom";
947
947
  } else {
948
- const e = Q.value?.getBoundingClientRect().left, a = window.innerWidth;
949
- de.value = a - e < G.value ? "left" : "right";
948
+ const e = J.value?.getBoundingClientRect().left, a = window.innerWidth;
949
+ de.value = a - e < W.value ? "left" : "right";
950
950
  }
951
951
  }, Se = () => {
952
- R.value = !R.value, R.value ? (A.value = "", M.value.info = Z.value, M.value.tickets = ee.value, M.value.comments = X.value, Z.value = !1, ee.value = !1, document.getElementById("comment-field")?.focus()) : (Z.value = M.value.info, ee.value = M.value.tickets, X.value = M.value.comments);
953
- }, ct = async (e, a) => {
954
- const t = l.value?.qv2Rooms?.qRoomId || l.value?.id || n.room?.id, o = new FormData();
955
- if (o.append("property_id", n.propertyId), o.append("room_ids", JSON.stringify([t])), await J(), E.value) {
956
- const s = [];
957
- E.value.forEach((r) => {
958
- r.id === e && r.type === a ? s.unshift({
959
- ...r,
952
+ H.value = !H.value, H.value ? (A.value = "", M.value.info = ee.value, M.value.tickets = te.value, M.value.comments = Z.value, ee.value = !1, te.value = !1, document.getElementById("comment-field")?.focus()) : (ee.value = M.value.info, te.value = M.value.tickets, Z.value = M.value.comments);
953
+ }, dt = async (e, a) => {
954
+ const t = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, o = new FormData();
955
+ if (o.append("property_id", s.propertyId), o.append("room_ids", JSON.stringify([t])), await Y(), E.value) {
956
+ const n = [];
957
+ E.value.forEach((l) => {
958
+ l.id === e && l.type === a ? n.unshift({
959
+ ...l,
960
960
  isNew: !0
961
- }) : s.push({
962
- ...r,
961
+ }) : n.push({
962
+ ...l,
963
963
  isNew: !1
964
964
  });
965
- }), s.sort((r, d) => r.id === e ? -1 : d.id === e ? 1 : 0), E.value = [...s];
965
+ }), n.sort((l, d) => l.id === e ? -1 : d.id === e ? 1 : 0), E.value = [...n];
966
966
  }
967
967
  };
968
- return F(() => n.open, () => {
969
- if (n.open && n.showComments && C.value.length) {
970
- const e = setTimeout(Y, 500);
971
- H.value.push(e);
968
+ B(() => s.open, () => {
969
+ if (s.open && s.showComments && C.value.length) {
970
+ const e = setTimeout(V, 500);
971
+ L.value.push(e);
972
972
  }
973
- n.open || (Te(), ye(), O.value = null, C.value = [], S.value = !1);
974
- }), F(
975
- () => [n.open, n.showComments, X.value, l.value?.tokenId],
973
+ s.open || (Te(), ye(), O.value = null, C.value = [], S.value = !1);
974
+ }), B(
975
+ () => [s.open, s.showComments, Z.value, r.value?.tokenId],
976
976
  ([e, a, t, o]) => {
977
- e && a && t && o ? ut() : ye();
977
+ e && a && t && o ? ct() : ye();
978
978
  }
979
- ), F(A, () => {
979
+ ), B(A, () => {
980
980
  const e = setTimeout(Ee, 100);
981
- H.value.push(e);
982
- }), F(() => n.allowWhenWhere, (e, a) => {
983
- a === !0 && e === !1 && (u.value.when = null, u.value.where = null, P.value = [], q.value = []);
984
- }), F(() => n.open, async (e, a) => {
985
- e && !a && (n.showGuestDetails && !te.value ? await se() : l.value || (l.value = n.room), J(), ne(), n.showComments && fe());
986
- }), F(
987
- () => n.room.id,
981
+ L.value.push(e);
982
+ }), B(() => s.allowWhenWhere, (e, a) => {
983
+ a === !0 && e === !1 && (u.value.when = null, u.value.where = null, q.value = [], x.value = []);
984
+ });
985
+ const Ae = () => !!(s.room.reservations || s.room.cleaning || s.room.occupancy);
986
+ return B(() => s.open, async (e, a) => {
987
+ e && !a && (Ae() ? (r.value = s.room, R.value = [s.room]) : s.showGuestDetails && !R.value ? await se() : r.value || (r.value = s.room), Y(), ne(), s.showComments && fe());
988
+ }), B(
989
+ () => s.room.id,
988
990
  (e, a) => {
989
- e !== a && (l.value = n.room, te.value = null, n.open && (n.showGuestDetails && se(), J(), ne()));
991
+ e !== a && (r.value = s.room, R.value = null, s.open && (Ae() ? R.value = [s.room] : s.showGuestDetails && se(), Y(), ne()));
990
992
  }
991
- ), mt(async () => {
993
+ ), vt(async () => {
992
994
  const e = JSON.parse(
993
995
  window.localStorage.getItem("authenticated")
994
996
  );
995
- L.value = e?.user?.id || window.userId || "", l.value = n.room, n.size === "sm" && (B.value = 140, G.value = 160), n.size === "lg" && (B.value = 250, G.value = 440), ge(), _e();
997
+ P.value = e?.user?.id || window.userId || "", r.value = s.room, s.size === "sm" && (G.value = 140, W.value = 160), s.size === "lg" && (G.value = 250, W.value = 440), ge(), _e();
996
998
  }), pt(() => {
997
- H.value.forEach((e) => {
999
+ L.value.forEach((e) => {
998
1000
  clearTimeout(e);
999
1001
  }), ye();
1000
1002
  }), {
@@ -1002,102 +1004,102 @@ const Bt = dt({
1002
1004
  // Refs
1003
1005
  actionMenuOpen: ie,
1004
1006
  alignment: ue,
1005
- assignTypes: K,
1007
+ assignTypes: X,
1006
1008
  comment: A,
1007
- complaint: v,
1008
- componentHeight: B,
1009
- componentWidth: G,
1009
+ complaint: p,
1010
+ componentHeight: G,
1011
+ componentWidth: W,
1010
1012
  departments: N,
1011
1013
  departmentUsers: we,
1012
- expandComments: X,
1013
- expandGuestInfo: Z,
1014
+ expandComments: Z,
1015
+ expandGuestInfo: ee,
1014
1016
  expandedStates: M,
1015
- expandTickets: ee,
1016
- guestDetailsData: Ae,
1017
+ expandTickets: te,
1018
+ guestDetailsData: be,
1017
1019
  itemOptions: T,
1018
1020
  loading: b,
1019
1021
  messages: C,
1020
1022
  moodOptions: ce,
1021
- pmsData: te,
1023
+ pmsData: R,
1022
1024
  positioning: de,
1023
- quickReplyOpen: R,
1025
+ quickReplyOpen: H,
1024
1026
  request: u,
1025
- requestedByOptions: $,
1026
- requestLoading: Ce,
1027
+ requestedByOptions: Q,
1028
+ requestLoading: Ne,
1027
1029
  requestType: k,
1028
- roomDetailsData: l,
1030
+ roomDetailsData: r,
1029
1031
  roomNotice: w,
1030
1032
  roomNotices: ae,
1031
1033
  showCreateRequest: oe,
1032
1034
  ticketsList: E,
1033
- todoOptions: Ne,
1034
- trigger: Q,
1035
- userId: L,
1036
- workOrder: p,
1037
- workOrderIssues: pe,
1038
- whenOptions: P,
1039
- whereOptions: q,
1035
+ todoOptions: Me,
1036
+ trigger: J,
1037
+ userId: P,
1038
+ workOrder: v,
1039
+ workOrderIssues: ve,
1040
+ whenOptions: q,
1041
+ whereOptions: x,
1040
1042
  // Guest Connect state
1041
1043
  isConversationOpen: S,
1042
1044
  lastMessageId: O,
1043
1045
  // Simulate Guest Reply state (test environments only)
1044
- simulateOpen: W,
1045
- simulateContent: U,
1046
+ simulateOpen: U,
1047
+ simulateContent: j,
1046
1048
  simulateLoading: me,
1047
1049
  // Computed
1048
- cleanliness: ve,
1049
- cleanlinessColor: Me,
1050
- cleanlinessTooltipContent: Re,
1051
- filteredReplies: He,
1052
- groupedMessages: Le,
1053
- hasGuestCallback: Pe,
1050
+ cleanliness: pe,
1051
+ cleanlinessColor: Re,
1052
+ cleanlinessTooltipContent: He,
1053
+ filteredReplies: Le,
1054
+ groupedMessages: Pe,
1055
+ hasGuestCallback: qe,
1054
1056
  hasComplaint: Ie,
1055
- itemOptionsList: qe,
1057
+ itemOptionsList: xe,
1056
1058
  occupied: De,
1057
- occupancyTooltipContent: xe,
1058
- selectedAssignType: Fe,
1059
- selectedDepartment: Be,
1060
- selectedRequestedBy: Ge,
1061
- stayDetails: We,
1062
- tagsList: Ue,
1063
- validateToDo: je,
1059
+ occupancyTooltipContent: Fe,
1060
+ selectedAssignType: Be,
1061
+ selectedDepartment: Ge,
1062
+ selectedRequestedBy: We,
1063
+ stayDetails: Ue,
1064
+ tagsList: je,
1065
+ validateToDo: $e,
1064
1066
  // Methods
1065
1067
  closeRequest: Te,
1066
- createCallback: $e,
1067
- createMessageList: x,
1068
+ createCallback: Qe,
1069
+ createMessageList: F,
1068
1070
  getChatMessages: fe,
1069
- getHowLongAgo: Je,
1071
+ getHowLongAgo: Ye,
1070
1072
  getPMSData: se,
1071
1073
  getRoomNotices: ne,
1072
1074
  getSharedData: he,
1073
1075
  getStayDetails: Oe,
1074
- getTicketColor: Ve,
1075
- getTicketIcon: ze,
1076
- getTickets: J,
1076
+ getTicketColor: ze,
1077
+ getTicketIcon: Ke,
1078
+ getTickets: Y,
1077
1079
  handleFailedResponse: ke,
1078
- handlePulse: Ke,
1079
- onClickEditConnectGuest: Xe,
1080
- onClickTicket: Ze,
1081
- onCreateRequestSubmit: et,
1082
- onHoverToggle: tt,
1083
- onSelectQuickReply: at,
1084
- onSelectToDo: ot,
1085
- openRequest: st,
1086
- refreshPMSData: Ye,
1080
+ handlePulse: Xe,
1081
+ onClickEditConnectGuest: Ze,
1082
+ onClickTicket: et,
1083
+ onCreateRequestSubmit: tt,
1084
+ onHoverToggle: at,
1085
+ onSelectQuickReply: ot,
1086
+ onSelectToDo: st,
1087
+ openRequest: nt,
1088
+ refreshPMSData: Ve,
1087
1089
  resizeTextarea: Ee,
1088
- scrollToConnectBottom: Y,
1089
- sendChatMessage: nt,
1090
+ scrollToConnectBottom: V,
1091
+ sendChatMessage: rt,
1090
1092
  setAlignment: ge,
1091
1093
  setPositioning: _e,
1092
- toggleMarkOpenClose: rt,
1094
+ toggleMarkOpenClose: lt,
1093
1095
  toggleQuickReply: Se,
1094
- updateTickets: ct,
1096
+ updateTickets: dt,
1095
1097
  // Simulate Guest Reply methods (test environments only)
1096
- simulateGuestReply: lt,
1097
- toggleSimulateOpen: it
1098
+ simulateGuestReply: it,
1099
+ toggleSimulateOpen: ut
1098
1100
  };
1099
1101
  }
1100
1102
  });
1101
1103
  export {
1102
- Bt as default
1104
+ Gt as default
1103
1105
  };