@quoreadmin/ui 1.7.4 → 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.
- package/dist/index140.js +311 -306
- package/dist/index175.js +4 -4
- package/dist/index182.js +8 -8
- package/dist/index184.js +8 -8
- package/dist/index187.js +17 -17
- package/dist/index190.js +26 -26
- package/dist/index191.js +1 -1
- package/dist/index192.js +1 -1
- package/dist/index195.js +2 -2
- package/dist/index197.js +14 -14
- package/dist/index198.js +1 -1
- package/dist/index199.js +1 -1
- package/dist/index200.js +3 -3
- package/dist/index201.js +6 -6
- package/dist/index205.js +2 -2
- package/dist/index219.js +155 -121
- package/dist/index220.js +19 -37
- package/dist/index221.js +20 -80
- package/dist/index222.js +15 -13
- package/dist/index223.js +198 -19
- package/dist/index224.js +68 -18
- package/dist/index225.js +34 -20
- package/dist/index226.js +39 -19
- package/dist/index227.js +122 -156
- package/dist/index228.js +35 -225
- package/dist/index229.js +80 -37
- package/dist/index230.js +20 -10
- package/dist/index231.js +19 -160
- package/dist/index232.js +10 -10
- package/dist/index233.js +13 -15
- package/dist/index234.js +156 -194
- package/dist/index235.js +224 -66
- package/dist/index236.js +37 -34
- package/dist/index237.js +9 -39
- package/dist/index238.js +22 -3632
- package/dist/index239.js +22 -55
- package/dist/index240.js +20 -77
- package/dist/index241.js +823 -39
- package/dist/index242.js +685 -198
- package/dist/index243.js +175 -9
- package/dist/index244.js +22 -57
- package/dist/index245.js +20 -61
- package/dist/index246.js +20 -54
- package/dist/index247.js +3 -75
- package/dist/index248.js +171 -707
- package/dist/index249.js +128 -34
- package/dist/index250.js +1214 -55
- package/dist/index251.js +20 -11
- package/dist/index252.js +22 -705
- package/dist/index253.js +22 -820
- package/dist/index254.js +22 -15
- package/dist/index255.js +13 -15
- package/dist/index256.js +12 -12
- package/dist/index257.js +2 -836
- package/dist/index258.js +2 -702
- package/dist/index259.js +3626 -170
- package/dist/index260.js +55 -22
- package/dist/index261.js +77 -20
- package/dist/index262.js +52 -20
- package/dist/index263.js +215 -3
- package/dist/index264.js +10 -187
- package/dist/index265.js +52 -128
- package/dist/index266.js +52 -1214
- package/dist/index267.js +54 -20
- package/dist/index268.js +75 -22
- package/dist/index269.js +722 -21
- package/dist/index270.js +39 -29
- package/dist/index271.js +64 -20
- package/dist/index272.js +11 -20
- package/dist/index273.js +705 -2
- package/dist/index274.js +820 -2
- package/dist/index279.js +54 -2
- package/dist/index281.js +26 -3
- package/dist/index282.js +21 -26
- package/dist/index283.js +21 -53
- package/dist/index284.js +16 -26
- package/dist/index285.js +17 -22
- package/dist/index286.js +22 -21
- package/dist/index287.js +2 -16
- package/dist/index288.js +3 -17
- package/dist/index289.js +27 -23
- package/dist/index290.js +79 -1518
- package/dist/index291.js +22 -386
- package/dist/index292.js +902 -2698
- package/dist/index293.js +21 -85
- package/dist/index294.js +20 -3770
- package/dist/index295.js +19 -59
- package/dist/index296.js +69 -15
- package/dist/index297.js +19 -84
- package/dist/index298.js +18 -201
- package/dist/index299.js +22 -246
- package/dist/index300.js +21 -234
- package/dist/index301.js +63 -6
- package/dist/index302.js +1507 -123
- package/dist/index303.js +379 -61
- package/dist/index304.js +2725 -81
- package/dist/index305.js +83 -26
- package/dist/index306.js +3770 -9
- package/dist/index307.js +57 -72
- package/dist/index308.js +15 -4
- package/dist/index309.js +84 -2
- package/dist/index310.js +193 -74
- package/dist/index311.js +246 -54
- package/dist/index312.js +233 -4
- package/dist/index313.js +5 -4
- package/dist/index314.js +121 -166
- package/dist/index315.js +63 -58
- package/dist/index316.js +85 -73
- package/dist/index317.js +25 -75
- package/dist/index318.js +8 -21
- package/dist/index319.js +66 -926
- package/dist/index320.js +3 -21
- package/dist/index321.js +2 -20
- package/dist/index322.js +82 -19
- package/dist/index323.js +51 -66
- package/dist/index324.js +6 -19
- package/dist/index325.js +5 -19
- package/dist/index326.js +178 -21
- package/dist/index327.js +62 -21
- package/dist/index328.js +74 -62
- package/dist/index353.js +19 -20
- package/dist/index354.js +19 -55
- package/dist/index355.js +63 -28
- package/dist/index356.js +37 -7
- package/dist/index357.js +18 -49
- package/dist/index358.js +56 -6
- package/dist/index359.js +27 -10
- package/dist/index360.js +7 -7
- package/dist/index361.js +51 -27
- package/dist/index362.js +6 -2
- package/dist/index363.js +11 -69
- package/dist/index364.js +6 -166
- package/dist/index365.js +28 -20
- package/dist/index366.js +2 -20
- package/dist/index367.js +67 -61
- package/dist/index368.js +166 -36
- package/dist/index369.js +16 -100
- package/dist/index370.js +100 -90
- package/dist/index371.js +91 -98
- package/dist/index372.js +97 -30
- package/dist/index373.js +30 -10
- package/dist/index374.js +10 -3
- package/dist/index375.js +3 -3
- package/dist/index376.js +4 -13
- package/dist/index377.js +13 -7
- package/dist/index378.js +7 -12
- package/dist/index379.js +11 -4
- package/dist/index380.js +5 -33
- package/dist/index381.js +33 -31
- package/dist/index382.js +29 -26
- package/dist/index383.js +26 -59
- package/dist/index384.js +60 -16
- package/dist/index385.js +1 -1
- package/dist/index390.js +1 -1
- package/dist/index391.js +2 -2
- package/dist/src/components/room-details-popover/room-details-popover.d.ts +4 -1
- package/package.json +1 -1
package/dist/index140.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
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
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
const
|
|
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:
|
|
20
|
-
QActivityItem:
|
|
21
|
-
QAvatar:
|
|
22
|
-
QDatePicker:
|
|
23
|
-
QDivider:
|
|
24
|
-
QIcon:
|
|
25
|
-
QPopover:
|
|
26
|
-
QTag:
|
|
27
|
-
QTextarea:
|
|
28
|
-
QTooltip:
|
|
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(
|
|
149
|
-
const { t: c } =
|
|
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
|
-
]),
|
|
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: !!
|
|
173
|
+
inHouse: !!r.value?.tokenId || !1,
|
|
174
174
|
problem: null,
|
|
175
175
|
notes: "",
|
|
176
|
-
tokenId:
|
|
177
|
-
}),
|
|
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
|
-
}),
|
|
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 =
|
|
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
|
-
}),
|
|
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
|
-
]),
|
|
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 =
|
|
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
|
-
]),
|
|
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
|
-
}),
|
|
238
|
-
switch (
|
|
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,10 +247,13 @@ const Bt = dt({
|
|
|
247
247
|
default:
|
|
248
248
|
return "";
|
|
249
249
|
}
|
|
250
|
-
}),
|
|
251
|
-
const e =
|
|
252
|
-
return
|
|
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
|
+
return e ? c(`HC_${e}`) : "";
|
|
253
253
|
}), Le = y(() => {
|
|
254
|
+
const e = A.value.toLowerCase();
|
|
255
|
+
return s.quickReplies.filter((a) => a.toLowerCase().match(e));
|
|
256
|
+
}), Pe = y(() => {
|
|
254
257
|
if (!C.value.length) return [];
|
|
255
258
|
const e = [];
|
|
256
259
|
let a = null;
|
|
@@ -259,12 +262,12 @@ const Bt = dt({
|
|
|
259
262
|
t.dateUtc,
|
|
260
263
|
"yyyy-MM-dd HH:mm:ss",
|
|
261
264
|
{ zone: "utc" }
|
|
262
|
-
).setZone(
|
|
263
|
-
|
|
265
|
+
).setZone(s.propertyTimeZone), n = o.toFormat("yyyy-MM-dd-HH");
|
|
266
|
+
n !== a && (e.push({
|
|
264
267
|
type: "separator",
|
|
265
268
|
label: o.toFormat("ccc, LLL d 'at' h:mma").replace("AM", "am").replace("PM", "pm"),
|
|
266
|
-
hourKey:
|
|
267
|
-
}), a =
|
|
269
|
+
hourKey: n
|
|
270
|
+
}), a = n), e.push({
|
|
268
271
|
type: "message",
|
|
269
272
|
...t,
|
|
270
273
|
formattedTime: o.toFormat("h:mma").replace("AM", "am").replace("PM", "pm")
|
|
@@ -272,9 +275,9 @@ const Bt = dt({
|
|
|
272
275
|
}), e;
|
|
273
276
|
}), Ie = y(() => E.value.length ? !!E.value.find(
|
|
274
277
|
(a) => a.type === "complaint"
|
|
275
|
-
) : !1),
|
|
278
|
+
) : !1), qe = y(() => E.value.length ? !!E.value.find(
|
|
276
279
|
(a) => a.type === "callback"
|
|
277
|
-
) : !1),
|
|
280
|
+
) : !1), xe = y(() => {
|
|
278
281
|
let e = [];
|
|
279
282
|
return T.value[0] && T.value[0].options === void 0 ? T.value.forEach((a) => {
|
|
280
283
|
e.push({
|
|
@@ -282,49 +285,49 @@ const Bt = dt({
|
|
|
282
285
|
label: a.display_name
|
|
283
286
|
});
|
|
284
287
|
}) : e = T.value, e;
|
|
285
|
-
}), De = 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(() => {
|
|
286
289
|
switch (k.value?.id) {
|
|
287
290
|
case "request":
|
|
288
291
|
case "work_order":
|
|
289
|
-
return
|
|
292
|
+
return X.value[0];
|
|
290
293
|
default:
|
|
291
294
|
return null;
|
|
292
295
|
}
|
|
293
|
-
}),
|
|
294
|
-
if (
|
|
296
|
+
}), Ge = y(() => {
|
|
297
|
+
if (N.value)
|
|
295
298
|
switch (k.value?.id) {
|
|
296
299
|
case "request":
|
|
297
|
-
return
|
|
300
|
+
return N.value.find((e) => parseInt(e.id) === 4);
|
|
298
301
|
case "work_order":
|
|
299
|
-
return
|
|
302
|
+
return N.value.find((e) => parseInt(e.id) === 2);
|
|
300
303
|
default:
|
|
301
304
|
return null;
|
|
302
305
|
}
|
|
303
306
|
return null;
|
|
304
|
-
}),
|
|
307
|
+
}), We = y(() => {
|
|
305
308
|
switch (k.value?.id) {
|
|
306
309
|
case "request":
|
|
307
|
-
return
|
|
310
|
+
return Q.value[1];
|
|
308
311
|
case "work_order":
|
|
309
|
-
return
|
|
312
|
+
return Q.value[0];
|
|
310
313
|
default:
|
|
311
314
|
return null;
|
|
312
315
|
}
|
|
313
|
-
}),
|
|
316
|
+
}), Ue = y(() => {
|
|
314
317
|
let e = "";
|
|
315
|
-
if (
|
|
318
|
+
if (r.value && r.value.reservations[0]) {
|
|
316
319
|
const a = _.fromISO(
|
|
317
|
-
|
|
318
|
-
), t = a.toFormat("MMM"), o = a.day,
|
|
319
|
-
|
|
320
|
-
), d =
|
|
321
|
-
e += t + " " + o,
|
|
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;
|
|
322
325
|
}
|
|
323
326
|
return e;
|
|
324
|
-
}),
|
|
327
|
+
}), je = y(() => {
|
|
325
328
|
let e = ae.value;
|
|
326
329
|
return e = [...new Set(e)], e;
|
|
327
|
-
}),
|
|
330
|
+
}), $e = y(() => {
|
|
328
331
|
const e = k.value?.id;
|
|
329
332
|
if (!e)
|
|
330
333
|
return !1;
|
|
@@ -332,29 +335,29 @@ const Bt = dt({
|
|
|
332
335
|
case "room_notice":
|
|
333
336
|
return w.value.issue && w.value.startDate && w.value.endDate;
|
|
334
337
|
case "complaint":
|
|
335
|
-
return
|
|
338
|
+
return p.value.problem && p.value.guestName && p.value.guestMood;
|
|
336
339
|
case "work_order":
|
|
337
|
-
return
|
|
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);
|
|
338
341
|
case "request": {
|
|
339
|
-
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 =
|
|
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;
|
|
340
343
|
return a && t;
|
|
341
344
|
}
|
|
342
345
|
default:
|
|
343
346
|
return !1;
|
|
344
347
|
}
|
|
345
348
|
}), Te = () => {
|
|
346
|
-
oe.value = !1,
|
|
347
|
-
},
|
|
348
|
-
h("create:callback",
|
|
349
|
-
},
|
|
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) => {
|
|
350
353
|
const a = [];
|
|
351
354
|
(Array.isArray(e) ? e : Object.values(e)).forEach((o) => {
|
|
352
|
-
const
|
|
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";
|
|
353
356
|
let D = {
|
|
354
357
|
id: o.id,
|
|
355
|
-
isPropertyEmployee:
|
|
358
|
+
isPropertyEmployee: n === "user",
|
|
356
359
|
isSent: !!o.sent,
|
|
357
|
-
isSystemMessage:
|
|
360
|
+
isSystemMessage: n === "system",
|
|
358
361
|
isStaffMessage: le,
|
|
359
362
|
isGuestMessage: I,
|
|
360
363
|
comment: o.content,
|
|
@@ -364,19 +367,19 @@ const Bt = dt({
|
|
|
364
367
|
icon: "",
|
|
365
368
|
id: d || "system-message",
|
|
366
369
|
initials: "",
|
|
367
|
-
lastName:
|
|
370
|
+
lastName: z || "",
|
|
368
371
|
name: re,
|
|
369
372
|
src: m || ""
|
|
370
373
|
}
|
|
371
374
|
};
|
|
372
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);
|
|
373
376
|
}), C.value = a;
|
|
374
|
-
},
|
|
377
|
+
}, Je = (e) => {
|
|
375
378
|
if (!e || e.length === 0) return;
|
|
376
379
|
(Array.isArray(e) ? e : Object.values(e)).forEach((t) => {
|
|
377
380
|
if (C.value.some((D) => D.id === t.id))
|
|
378
381
|
return;
|
|
379
|
-
const o = t.senderType || t.sender_type,
|
|
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";
|
|
380
383
|
let I = {
|
|
381
384
|
id: t.id,
|
|
382
385
|
isPropertyEmployee: o === "user",
|
|
@@ -389,19 +392,19 @@ const Bt = dt({
|
|
|
389
392
|
user: {
|
|
390
393
|
firstName: f || "Auto-Reply",
|
|
391
394
|
icon: "",
|
|
392
|
-
id:
|
|
395
|
+
id: l || "system-message",
|
|
393
396
|
initials: "",
|
|
394
397
|
lastName: g || "",
|
|
395
|
-
name:
|
|
398
|
+
name: z,
|
|
396
399
|
src: d || ""
|
|
397
400
|
}
|
|
398
401
|
};
|
|
399
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);
|
|
400
403
|
});
|
|
401
404
|
}, fe = async (e = !1) => {
|
|
402
|
-
if (
|
|
405
|
+
if (s.showComments && r.value.tokenId)
|
|
403
406
|
try {
|
|
404
|
-
let a = `/api/client/connect/getMessages.php?tokenId=${
|
|
407
|
+
let a = `/api/client/connect/getMessages.php?tokenId=${r.value.tokenId}`;
|
|
405
408
|
e && O.value !== null && (a += `&lastMsgId=${O.value}`);
|
|
406
409
|
const o = await (await fetch(a, {
|
|
407
410
|
method: "GET",
|
|
@@ -409,15 +412,15 @@ const Bt = dt({
|
|
|
409
412
|
})).json();
|
|
410
413
|
if (o.status === "error")
|
|
411
414
|
throw new Error(o.message || "Failed to get messages");
|
|
412
|
-
if (
|
|
413
|
-
O.value = o.messages[o.messages.length - 1].id, e ?
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
} else e ||
|
|
415
|
+
if (S.value = !o.closed, o.messages && o.messages.length > 0) {
|
|
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 || []);
|
|
417
420
|
} catch (a) {
|
|
418
421
|
console.error("getChatMessages error:", a);
|
|
419
422
|
}
|
|
420
|
-
},
|
|
423
|
+
}, Ye = (e) => {
|
|
421
424
|
const a = _.utc(), t = _.fromFormat(e, "yyyy-MM-dd HH:mm:ss", { zone: "utc" }), o = a.diff(
|
|
422
425
|
t,
|
|
423
426
|
[
|
|
@@ -427,11 +430,11 @@ const Bt = dt({
|
|
|
427
430
|
"hours",
|
|
428
431
|
"minutes"
|
|
429
432
|
]
|
|
430
|
-
),
|
|
431
|
-
if (
|
|
432
|
-
return
|
|
433
|
-
if (
|
|
434
|
-
return
|
|
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 });
|
|
435
438
|
if (d)
|
|
436
439
|
return d === 1 ? c("HC_ONE_DAY_AGO") : c("HC_X_DAYS_AGO", { days: d });
|
|
437
440
|
if (m)
|
|
@@ -440,14 +443,14 @@ const Bt = dt({
|
|
|
440
443
|
return f === 1 ? c("HC_ONE_MINUTE_AGO") : c("HC_X_MINUTES_AGO", { minutes: f });
|
|
441
444
|
if (f === 0)
|
|
442
445
|
return c("HC_A_MOMENT_AGO");
|
|
443
|
-
},
|
|
444
|
-
|
|
446
|
+
}, Ve = async () => {
|
|
447
|
+
s.showGuestDetails && se(), ne(), Y(), h("refresh:pms", r.value);
|
|
445
448
|
}, se = async () => {
|
|
446
449
|
try {
|
|
447
450
|
b.value.pms = !0;
|
|
448
451
|
const e = new AbortController(), a = setTimeout(() => e.abort(), 45e3);
|
|
449
|
-
|
|
450
|
-
const t =
|
|
452
|
+
L.value.push(a);
|
|
453
|
+
const t = s.pmsBaseUrl;
|
|
451
454
|
if (!t)
|
|
452
455
|
throw new Error("PMS base URL is required");
|
|
453
456
|
const o = {
|
|
@@ -456,21 +459,21 @@ const Bt = dt({
|
|
|
456
459
|
return g.length === 2 && g.pop()?.split(";").shift() || "";
|
|
457
460
|
})(),
|
|
458
461
|
"Content-Type": "application/json"
|
|
459
|
-
},
|
|
460
|
-
`${t}/vendors/properties/statuses/${
|
|
462
|
+
}, n = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room.id, l = await fetch(
|
|
463
|
+
`${t}/vendors/properties/statuses/${s.propertyId}/rooms`,
|
|
461
464
|
{
|
|
462
465
|
method: "POST",
|
|
463
466
|
headers: o,
|
|
464
467
|
signal: e.signal,
|
|
465
|
-
body: JSON.stringify({ roomsIds: [
|
|
468
|
+
body: JSON.stringify({ roomsIds: [n] })
|
|
466
469
|
}
|
|
467
470
|
);
|
|
468
|
-
clearTimeout(a),
|
|
469
|
-
const d = await
|
|
470
|
-
|
|
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 = {
|
|
471
474
|
...m[0],
|
|
472
|
-
tokenId: m[0].tokenId ||
|
|
473
|
-
} :
|
|
475
|
+
tokenId: m[0].tokenId || s.room.tokenId
|
|
476
|
+
} : r.value = s.room, b.value.pms = !1;
|
|
474
477
|
} catch (e) {
|
|
475
478
|
return b.value.pms = !1, h("show:toast", {
|
|
476
479
|
show: !0,
|
|
@@ -483,7 +486,7 @@ const Bt = dt({
|
|
|
483
486
|
try {
|
|
484
487
|
b.value.roomNotices = !0;
|
|
485
488
|
const e = await fetch(
|
|
486
|
-
"/api/client/common/getRoomNotices.php?propertyId=" +
|
|
489
|
+
"/api/client/common/getRoomNotices.php?propertyId=" + s.propertyId + "&roomIds=[" + s.room.id + "]"
|
|
487
490
|
);
|
|
488
491
|
if (!e.ok)
|
|
489
492
|
throw new Error(`HTTP error! status: ${e.status}`);
|
|
@@ -502,7 +505,7 @@ const Bt = dt({
|
|
|
502
505
|
}, he = async () => {
|
|
503
506
|
try {
|
|
504
507
|
const e = new FormData();
|
|
505
|
-
e.append("property_id",
|
|
508
|
+
e.append("property_id", s.propertyId), e.append("filter", "tasks_new");
|
|
506
509
|
const [a, t] = await Promise.all([
|
|
507
510
|
fetch("/api/client/common/getDepartments.php", {
|
|
508
511
|
method: "POST"
|
|
@@ -511,18 +514,18 @@ const Bt = dt({
|
|
|
511
514
|
method: "POST",
|
|
512
515
|
body: e
|
|
513
516
|
})
|
|
514
|
-
]), o = await a.json(),
|
|
515
|
-
if (o.departments && (o.departments.forEach((
|
|
516
|
-
|
|
517
|
-
}),
|
|
518
|
-
const
|
|
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 = [];
|
|
519
522
|
let d = {
|
|
520
523
|
group: "",
|
|
521
524
|
options: []
|
|
522
525
|
};
|
|
523
|
-
|
|
524
|
-
m.translated_department !== d.group && (d.group &&
|
|
525
|
-
}), d.group &&
|
|
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;
|
|
526
529
|
}
|
|
527
530
|
} catch (e) {
|
|
528
531
|
console.error("Error getting shared data:", e), h("show:toast", {
|
|
@@ -535,7 +538,7 @@ const Bt = dt({
|
|
|
535
538
|
}, Oe = async () => {
|
|
536
539
|
try {
|
|
537
540
|
const a = await (await fetch(
|
|
538
|
-
`/api/client/connect/getStayDetails.php?tokenId=${
|
|
541
|
+
`/api/client/connect/getStayDetails.php?tokenId=${r.value.tokenId}`,
|
|
539
542
|
{
|
|
540
543
|
method: "GET",
|
|
541
544
|
credentials: "include"
|
|
@@ -543,9 +546,9 @@ const Bt = dt({
|
|
|
543
546
|
)).json();
|
|
544
547
|
if (a.status === "error")
|
|
545
548
|
throw new Error(a.message || "Failed to get stay details");
|
|
546
|
-
a.userName && (
|
|
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(
|
|
547
550
|
a.checkIn
|
|
548
|
-
).toJSDate()), a.checkOut && (
|
|
551
|
+
).toJSDate()), a.checkOut && (p.value.checkOutDate = _.fromISO(
|
|
549
552
|
a.checkOut
|
|
550
553
|
).toJSDate());
|
|
551
554
|
} catch (e) {
|
|
@@ -556,7 +559,7 @@ const Bt = dt({
|
|
|
556
559
|
icon: "exclamation-circle"
|
|
557
560
|
});
|
|
558
561
|
}
|
|
559
|
-
},
|
|
562
|
+
}, ze = (e) => {
|
|
560
563
|
switch (e) {
|
|
561
564
|
case "complaint":
|
|
562
565
|
return "red-30";
|
|
@@ -569,7 +572,7 @@ const Bt = dt({
|
|
|
569
572
|
case "task":
|
|
570
573
|
return "green-20";
|
|
571
574
|
}
|
|
572
|
-
},
|
|
575
|
+
}, Ke = (e) => {
|
|
573
576
|
switch (e) {
|
|
574
577
|
case "complaint":
|
|
575
578
|
return "face-frown";
|
|
@@ -582,11 +585,11 @@ const Bt = dt({
|
|
|
582
585
|
case "task":
|
|
583
586
|
return "check";
|
|
584
587
|
}
|
|
585
|
-
},
|
|
588
|
+
}, Y = async () => {
|
|
586
589
|
try {
|
|
587
590
|
b.value.tickets = !0;
|
|
588
591
|
const e = await fetch(
|
|
589
|
-
"/api/client/common/getAllToDos.php?propertyId=" +
|
|
592
|
+
"/api/client/common/getAllToDos.php?propertyId=" + s.propertyId + "&roomIds=[" + s.room.id + "]"
|
|
590
593
|
);
|
|
591
594
|
if (!e.ok)
|
|
592
595
|
throw new Error(`HTTP error! status: ${e.status}`);
|
|
@@ -611,34 +614,34 @@ const Bt = dt({
|
|
|
611
614
|
t = { code: e.status, message: a };
|
|
612
615
|
}
|
|
613
616
|
return t.code === 401 ? (window.location.href = "/logout.php?unauthorized=1", { error: t }) : t;
|
|
614
|
-
},
|
|
617
|
+
}, Xe = (e) => {
|
|
615
618
|
const a = document.querySelectorAll(".pulse");
|
|
616
619
|
if (a && a.length) {
|
|
617
|
-
const t =
|
|
620
|
+
const t = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, o = document.getElementById("room-" + t), n = o?.classList;
|
|
618
621
|
switch (e) {
|
|
619
622
|
case "room_notice":
|
|
620
|
-
(
|
|
623
|
+
(n?.contains("roombox_unsel") || n?.contains("roombox_unsel_active")) && (o?.classList.remove(), o?.classList.add("roomnoticeroombox_sel"));
|
|
621
624
|
break;
|
|
622
625
|
case "complaint":
|
|
623
|
-
!
|
|
626
|
+
!n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && (o?.classList.remove(), o?.classList.add("complaintsroombox_sel"));
|
|
624
627
|
break;
|
|
625
628
|
case "request":
|
|
626
|
-
!
|
|
629
|
+
!n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && !n?.contains("complaintsroombox_sel") && (o?.classList.remove(), o?.classList.add("guestrequestroombox_sel"));
|
|
627
630
|
break;
|
|
628
631
|
case "work_order":
|
|
629
|
-
!
|
|
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"));
|
|
630
633
|
break;
|
|
631
634
|
}
|
|
632
|
-
const
|
|
635
|
+
const l = setTimeout(() => {
|
|
633
636
|
a.forEach((d) => {
|
|
634
637
|
d.classList.remove("pulse");
|
|
635
638
|
});
|
|
636
639
|
}, 4500);
|
|
637
|
-
|
|
640
|
+
L.value.push(l);
|
|
638
641
|
}
|
|
639
|
-
},
|
|
642
|
+
}, Ze = () => {
|
|
640
643
|
window.open("/guest/overview.php", "_blank");
|
|
641
|
-
},
|
|
644
|
+
}, et = (e) => {
|
|
642
645
|
let a = "";
|
|
643
646
|
switch (e.type) {
|
|
644
647
|
case "complaint":
|
|
@@ -660,55 +663,55 @@ const Bt = dt({
|
|
|
660
663
|
return "#";
|
|
661
664
|
}
|
|
662
665
|
window.open(a, "_blank");
|
|
663
|
-
},
|
|
664
|
-
const e =
|
|
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 = {
|
|
665
668
|
type: k.value?.id,
|
|
666
|
-
propertyId:
|
|
667
|
-
userId:
|
|
669
|
+
propertyId: s.propertyId,
|
|
670
|
+
userId: P.value,
|
|
668
671
|
areaId: e,
|
|
669
672
|
areaName: a
|
|
670
673
|
};
|
|
671
674
|
switch (k.value?.id) {
|
|
672
675
|
case "complaint":
|
|
673
|
-
t.tokenId =
|
|
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(
|
|
674
677
|
"yyyy-MM-dd"
|
|
675
|
-
), t.checkOutDate = _.fromJSDate(
|
|
678
|
+
), t.checkOutDate = _.fromJSDate(p.value.checkOutDate).toFormat(
|
|
676
679
|
"yyyy-MM-dd"
|
|
677
|
-
), t.notes =
|
|
680
|
+
), t.notes = p.value.notes, t.inHouse = 2, t.source = "dashboard", h("create:todo", t);
|
|
678
681
|
break;
|
|
679
682
|
case "request":
|
|
680
|
-
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),
|
|
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);
|
|
681
684
|
break;
|
|
682
685
|
case "room_notice":
|
|
683
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);
|
|
684
687
|
break;
|
|
685
688
|
case "work_order":
|
|
686
|
-
t.itemId =
|
|
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);
|
|
687
690
|
break;
|
|
688
691
|
}
|
|
689
|
-
}, tt = (e) => {
|
|
690
|
-
ge(), _e(), n.hover && h("toggle", e);
|
|
691
692
|
}, at = (e) => {
|
|
692
|
-
|
|
693
|
-
}, ot =
|
|
694
|
-
|
|
693
|
+
ge(), _e(), s.hover && h("toggle", e);
|
|
694
|
+
}, ot = (e) => {
|
|
695
|
+
Se(), A.value = e;
|
|
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)
|
|
695
698
|
return;
|
|
696
|
-
const a =
|
|
697
|
-
switch (t.append("property_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) {
|
|
698
701
|
case "complaint":
|
|
699
702
|
try {
|
|
700
|
-
|
|
701
|
-
const
|
|
703
|
+
r.value.tokenId && await Oe();
|
|
704
|
+
const n = await (await fetch("/api/client/common/getComplaintProblemsByPropertyId.php", {
|
|
702
705
|
method: "POST",
|
|
703
706
|
body: t
|
|
704
707
|
})).json();
|
|
705
|
-
|
|
706
|
-
const
|
|
708
|
+
n.items && (T.value = n.items);
|
|
709
|
+
const l = await K.post(
|
|
707
710
|
"/api/client/common/getComplaintMoods.php"
|
|
708
711
|
);
|
|
709
|
-
|
|
712
|
+
l.data.items.forEach((d) => {
|
|
710
713
|
d.label = d.display_name;
|
|
711
|
-
}), ce.value =
|
|
714
|
+
}), ce.value = l.data.items;
|
|
712
715
|
} catch (o) {
|
|
713
716
|
console.error("Error loading complaint options:", o), h("show:toast", {
|
|
714
717
|
show: !0,
|
|
@@ -720,11 +723,11 @@ const Bt = dt({
|
|
|
720
723
|
break;
|
|
721
724
|
case "room_notice":
|
|
722
725
|
try {
|
|
723
|
-
const
|
|
726
|
+
const n = await (await fetch("/api/client/common/getRoomNoticeIssuesByPropertyId.php", {
|
|
724
727
|
method: "POST",
|
|
725
728
|
body: t
|
|
726
729
|
})).json();
|
|
727
|
-
|
|
730
|
+
n.items && (T.value = n.items);
|
|
728
731
|
} catch (o) {
|
|
729
732
|
console.error("Error loading room notice options:", o), h("show:toast", {
|
|
730
733
|
show: !0,
|
|
@@ -736,35 +739,35 @@ const Bt = dt({
|
|
|
736
739
|
break;
|
|
737
740
|
case "request":
|
|
738
741
|
try {
|
|
739
|
-
u.value.requestedBy =
|
|
740
|
-
const
|
|
742
|
+
u.value.requestedBy = Q.value[1], u.value.assignType = X.value[0];
|
|
743
|
+
const n = await (await fetch("/api/client/common/getHousekeepingItemsByPropertyId.php", {
|
|
741
744
|
method: "POST",
|
|
742
745
|
body: t
|
|
743
746
|
})).json();
|
|
744
|
-
if (
|
|
745
|
-
(
|
|
746
|
-
),
|
|
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)
|
|
747
750
|
try {
|
|
748
|
-
const
|
|
749
|
-
|
|
751
|
+
const l = new FormData();
|
|
752
|
+
l.append("property_id", s.propertyId);
|
|
750
753
|
const m = await (await fetch(
|
|
751
754
|
"/api/client/common/getWhenWhereOptions.php",
|
|
752
755
|
{
|
|
753
756
|
method: "POST",
|
|
754
|
-
body:
|
|
757
|
+
body: l
|
|
755
758
|
}
|
|
756
759
|
)).json();
|
|
757
|
-
m.when && Array.isArray(m.when) ?
|
|
760
|
+
m.when && Array.isArray(m.when) ? q.value = m.when.map((f) => ({
|
|
758
761
|
id: f.id,
|
|
759
762
|
label: f.name,
|
|
760
763
|
value: f.id
|
|
761
|
-
})) :
|
|
764
|
+
})) : q.value = [], m.where && Array.isArray(m.where) ? x.value = m.where.map((f) => ({
|
|
762
765
|
id: f.id,
|
|
763
766
|
label: f.name,
|
|
764
767
|
value: f.id
|
|
765
|
-
})) :
|
|
766
|
-
} catch (
|
|
767
|
-
console.error("Error loading When/Where options:",
|
|
768
|
+
})) : x.value = [];
|
|
769
|
+
} catch (l) {
|
|
770
|
+
console.error("Error loading When/Where options:", l), q.value = [], x.value = [], h("show:toast", {
|
|
768
771
|
show: !0,
|
|
769
772
|
message: c("HC_FAILED_TO_LOAD_WHEN_WHERE_OPTIONS"),
|
|
770
773
|
variant: "error",
|
|
@@ -782,19 +785,19 @@ const Bt = dt({
|
|
|
782
785
|
break;
|
|
783
786
|
case "work_order":
|
|
784
787
|
try {
|
|
785
|
-
|
|
786
|
-
const
|
|
788
|
+
v.value.requestedBy = Q.value[0], v.value.assignType = X.value[0];
|
|
789
|
+
const n = await (await fetch("/api/client/common/getItemsByRoomId.php", {
|
|
787
790
|
method: "POST",
|
|
788
791
|
body: t
|
|
789
|
-
})).json(),
|
|
792
|
+
})).json(), l = [];
|
|
790
793
|
let d = {
|
|
791
794
|
group: "",
|
|
792
795
|
options: []
|
|
793
796
|
};
|
|
794
|
-
|
|
795
|
-
m.section_name !== d.group && (d.group &&
|
|
796
|
-
}), d.group &&
|
|
797
|
-
|
|
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(
|
|
798
801
|
"/api/client/common/getWorkOrderIssues.php"
|
|
799
802
|
),
|
|
800
803
|
he()
|
|
@@ -802,8 +805,8 @@ const Bt = dt({
|
|
|
802
805
|
const f = m[0];
|
|
803
806
|
f.data.issues.forEach((g) => {
|
|
804
807
|
g.label = g.display_name;
|
|
805
|
-
}),
|
|
806
|
-
}),
|
|
808
|
+
}), ve.value = f.data.issues;
|
|
809
|
+
}), v.value.department = N.value.find(
|
|
807
810
|
(m) => parseInt(m.id) === 2
|
|
808
811
|
);
|
|
809
812
|
} catch (o) {
|
|
@@ -818,23 +821,23 @@ const Bt = dt({
|
|
|
818
821
|
default:
|
|
819
822
|
return;
|
|
820
823
|
}
|
|
821
|
-
},
|
|
824
|
+
}, nt = () => {
|
|
822
825
|
oe.value = !oe.value, ie.value = !1;
|
|
823
826
|
}, Ee = () => {
|
|
824
827
|
const e = document.getElementById("comment-field"), a = document.getElementById("hidden-text");
|
|
825
828
|
e.style.height = a?.offsetHeight + "px";
|
|
826
|
-
},
|
|
829
|
+
}, V = () => {
|
|
827
830
|
const e = document.getElementById("comments-container");
|
|
828
831
|
e?.scroll({
|
|
829
832
|
top: e.scrollHeight,
|
|
830
833
|
behavior: "smooth"
|
|
831
834
|
});
|
|
832
|
-
},
|
|
833
|
-
if (e && e.type === "keydown" && e.preventDefault(),
|
|
835
|
+
}, rt = async (e) => {
|
|
836
|
+
if (e && e.type === "keydown" && e.preventDefault(), r.value.tokenId && A.value && !H.value)
|
|
834
837
|
try {
|
|
835
838
|
const a = new FormData();
|
|
836
|
-
a.append("tokenId",
|
|
837
|
-
const t = await
|
|
839
|
+
a.append("tokenId", r.value.tokenId), a.append("content", A.value), a.append("senderId", P.value || "");
|
|
840
|
+
const t = await K.post(
|
|
838
841
|
"/api/client/connect/sendMessage.php",
|
|
839
842
|
a
|
|
840
843
|
);
|
|
@@ -847,7 +850,7 @@ const Bt = dt({
|
|
|
847
850
|
});
|
|
848
851
|
return;
|
|
849
852
|
}
|
|
850
|
-
|
|
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();
|
|
851
854
|
} catch (a) {
|
|
852
855
|
console.error("sendChatMessage error:", a), h("show:toast", {
|
|
853
856
|
show: !0,
|
|
@@ -856,12 +859,12 @@ const Bt = dt({
|
|
|
856
859
|
icon: "exclamation-circle"
|
|
857
860
|
});
|
|
858
861
|
}
|
|
859
|
-
},
|
|
860
|
-
if (!(!
|
|
862
|
+
}, lt = async () => {
|
|
863
|
+
if (!(!r.value.tokenId || !P.value))
|
|
861
864
|
try {
|
|
862
|
-
const e =
|
|
863
|
-
a.append("tokenId",
|
|
864
|
-
const t = await
|
|
865
|
+
const e = S.value ? "/api/client/connect/closeConversation.php" : "/api/client/connect/openConversation.php", a = new FormData();
|
|
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);
|
|
865
868
|
if (t.data.status === "error") {
|
|
866
869
|
h("show:toast", {
|
|
867
870
|
show: !0,
|
|
@@ -871,9 +874,9 @@ const Bt = dt({
|
|
|
871
874
|
});
|
|
872
875
|
return;
|
|
873
876
|
}
|
|
874
|
-
|
|
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", {
|
|
875
878
|
show: !0,
|
|
876
|
-
message:
|
|
879
|
+
message: S.value ? c("HC_CONVERSATION_REOPENED") : c("HC_CONVERSATION_CLOSED"),
|
|
877
880
|
variant: "success",
|
|
878
881
|
icon: "check-circle"
|
|
879
882
|
});
|
|
@@ -885,13 +888,13 @@ const Bt = dt({
|
|
|
885
888
|
icon: "exclamation-circle"
|
|
886
889
|
});
|
|
887
890
|
}
|
|
888
|
-
},
|
|
889
|
-
if (
|
|
891
|
+
}, it = async () => {
|
|
892
|
+
if (s.isTestEnvironment && !(!r.value?.tokenId || !j.value.trim())) {
|
|
890
893
|
me.value = !0;
|
|
891
894
|
try {
|
|
892
895
|
const e = new FormData();
|
|
893
|
-
e.append("tokenId",
|
|
894
|
-
const a = await
|
|
896
|
+
e.append("tokenId", r.value.tokenId), e.append("content", j.value.trim());
|
|
897
|
+
const a = await K.post(
|
|
895
898
|
"/api/client/connect/simulateInbound.php",
|
|
896
899
|
e
|
|
897
900
|
);
|
|
@@ -904,7 +907,7 @@ const Bt = dt({
|
|
|
904
907
|
});
|
|
905
908
|
return;
|
|
906
909
|
}
|
|
907
|
-
a.data.messages && (
|
|
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", {
|
|
908
911
|
show: !0,
|
|
909
912
|
message: c("HC_SIMULATED_GUEST_REPLY"),
|
|
910
913
|
variant: "success",
|
|
@@ -921,77 +924,79 @@ const Bt = dt({
|
|
|
921
924
|
me.value = !1;
|
|
922
925
|
}
|
|
923
926
|
}
|
|
924
|
-
}, it = () => {
|
|
925
|
-
W.value = !W.value, W.value || (U.value = "");
|
|
926
927
|
}, ut = () => {
|
|
927
|
-
|
|
928
|
+
U.value = !U.value, U.value || (j.value = "");
|
|
929
|
+
}, ct = () => {
|
|
930
|
+
$.value || ($.value = setInterval(() => {
|
|
928
931
|
document.visibilityState === "visible" && fe(!0);
|
|
929
|
-
},
|
|
932
|
+
}, Ce));
|
|
930
933
|
}, ye = () => {
|
|
931
|
-
|
|
934
|
+
$.value && (clearInterval($.value), $.value = null);
|
|
932
935
|
}, ge = () => {
|
|
933
|
-
if (
|
|
934
|
-
const e =
|
|
935
|
-
ue.value = a - e <
|
|
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";
|
|
936
939
|
} else {
|
|
937
|
-
const e =
|
|
938
|
-
ue.value = a - e <
|
|
940
|
+
const e = J.value?.getBoundingClientRect().top, a = window.innerHeight;
|
|
941
|
+
ue.value = a - e < G.value ? "bottom" : "top";
|
|
939
942
|
}
|
|
940
943
|
}, _e = () => {
|
|
941
|
-
if (
|
|
942
|
-
const e =
|
|
943
|
-
de.value = a - e <
|
|
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";
|
|
944
947
|
} else {
|
|
945
|
-
const e =
|
|
946
|
-
de.value = a - e <
|
|
948
|
+
const e = J.value?.getBoundingClientRect().left, a = window.innerWidth;
|
|
949
|
+
de.value = a - e < W.value ? "left" : "right";
|
|
947
950
|
}
|
|
948
|
-
},
|
|
949
|
-
|
|
950
|
-
},
|
|
951
|
-
const t =
|
|
952
|
-
if (o.append("property_id",
|
|
953
|
-
const
|
|
954
|
-
E.value.forEach((
|
|
955
|
-
|
|
956
|
-
...
|
|
951
|
+
}, Se = () => {
|
|
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,
|
|
957
960
|
isNew: !0
|
|
958
|
-
}) :
|
|
959
|
-
...
|
|
961
|
+
}) : n.push({
|
|
962
|
+
...l,
|
|
960
963
|
isNew: !1
|
|
961
964
|
});
|
|
962
|
-
}),
|
|
965
|
+
}), n.sort((l, d) => l.id === e ? -1 : d.id === e ? 1 : 0), E.value = [...n];
|
|
963
966
|
}
|
|
964
967
|
};
|
|
965
|
-
|
|
966
|
-
if (
|
|
967
|
-
const e = setTimeout(
|
|
968
|
-
|
|
968
|
+
B(() => s.open, () => {
|
|
969
|
+
if (s.open && s.showComments && C.value.length) {
|
|
970
|
+
const e = setTimeout(V, 500);
|
|
971
|
+
L.value.push(e);
|
|
969
972
|
}
|
|
970
|
-
|
|
971
|
-
}),
|
|
972
|
-
() => [
|
|
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],
|
|
973
976
|
([e, a, t, o]) => {
|
|
974
|
-
e && a && t && o ?
|
|
977
|
+
e && a && t && o ? ct() : ye();
|
|
975
978
|
}
|
|
976
|
-
),
|
|
979
|
+
), B(A, () => {
|
|
977
980
|
const e = setTimeout(Ee, 100);
|
|
978
|
-
|
|
979
|
-
}),
|
|
980
|
-
a === !0 && e === !1 && (u.value.when = null, u.value.where = null,
|
|
981
|
-
})
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
()
|
|
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,
|
|
985
990
|
(e, a) => {
|
|
986
|
-
e !== a && (
|
|
991
|
+
e !== a && (r.value = s.room, R.value = null, s.open && (Ae() ? R.value = [s.room] : s.showGuestDetails && se(), Y(), ne()));
|
|
987
992
|
}
|
|
988
|
-
),
|
|
993
|
+
), vt(async () => {
|
|
989
994
|
const e = JSON.parse(
|
|
990
995
|
window.localStorage.getItem("authenticated")
|
|
991
996
|
);
|
|
992
|
-
|
|
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();
|
|
993
998
|
}), pt(() => {
|
|
994
|
-
|
|
999
|
+
L.value.forEach((e) => {
|
|
995
1000
|
clearTimeout(e);
|
|
996
1001
|
}), ye();
|
|
997
1002
|
}), {
|
|
@@ -999,102 +1004,102 @@ const Bt = dt({
|
|
|
999
1004
|
// Refs
|
|
1000
1005
|
actionMenuOpen: ie,
|
|
1001
1006
|
alignment: ue,
|
|
1002
|
-
assignTypes:
|
|
1003
|
-
comment:
|
|
1004
|
-
complaint:
|
|
1005
|
-
componentHeight:
|
|
1006
|
-
componentWidth:
|
|
1007
|
-
departments:
|
|
1007
|
+
assignTypes: X,
|
|
1008
|
+
comment: A,
|
|
1009
|
+
complaint: p,
|
|
1010
|
+
componentHeight: G,
|
|
1011
|
+
componentWidth: W,
|
|
1012
|
+
departments: N,
|
|
1008
1013
|
departmentUsers: we,
|
|
1009
|
-
expandComments:
|
|
1010
|
-
expandGuestInfo:
|
|
1011
|
-
expandedStates:
|
|
1012
|
-
expandTickets:
|
|
1013
|
-
guestDetailsData:
|
|
1014
|
+
expandComments: Z,
|
|
1015
|
+
expandGuestInfo: ee,
|
|
1016
|
+
expandedStates: M,
|
|
1017
|
+
expandTickets: te,
|
|
1018
|
+
guestDetailsData: be,
|
|
1014
1019
|
itemOptions: T,
|
|
1015
1020
|
loading: b,
|
|
1016
1021
|
messages: C,
|
|
1017
1022
|
moodOptions: ce,
|
|
1018
|
-
pmsData:
|
|
1023
|
+
pmsData: R,
|
|
1019
1024
|
positioning: de,
|
|
1020
|
-
quickReplyOpen:
|
|
1025
|
+
quickReplyOpen: H,
|
|
1021
1026
|
request: u,
|
|
1022
|
-
requestedByOptions:
|
|
1023
|
-
requestLoading:
|
|
1027
|
+
requestedByOptions: Q,
|
|
1028
|
+
requestLoading: Ne,
|
|
1024
1029
|
requestType: k,
|
|
1025
|
-
roomDetailsData:
|
|
1030
|
+
roomDetailsData: r,
|
|
1026
1031
|
roomNotice: w,
|
|
1027
1032
|
roomNotices: ae,
|
|
1028
1033
|
showCreateRequest: oe,
|
|
1029
1034
|
ticketsList: E,
|
|
1030
1035
|
todoOptions: Me,
|
|
1031
|
-
trigger:
|
|
1032
|
-
userId:
|
|
1033
|
-
workOrder:
|
|
1034
|
-
workOrderIssues:
|
|
1035
|
-
whenOptions:
|
|
1036
|
-
whereOptions:
|
|
1036
|
+
trigger: J,
|
|
1037
|
+
userId: P,
|
|
1038
|
+
workOrder: v,
|
|
1039
|
+
workOrderIssues: ve,
|
|
1040
|
+
whenOptions: q,
|
|
1041
|
+
whereOptions: x,
|
|
1037
1042
|
// Guest Connect state
|
|
1038
|
-
isConversationOpen:
|
|
1043
|
+
isConversationOpen: S,
|
|
1039
1044
|
lastMessageId: O,
|
|
1040
1045
|
// Simulate Guest Reply state (test environments only)
|
|
1041
|
-
simulateOpen:
|
|
1042
|
-
simulateContent:
|
|
1046
|
+
simulateOpen: U,
|
|
1047
|
+
simulateContent: j,
|
|
1043
1048
|
simulateLoading: me,
|
|
1044
1049
|
// Computed
|
|
1045
|
-
cleanliness:
|
|
1046
|
-
cleanlinessColor:
|
|
1047
|
-
cleanlinessTooltipContent:
|
|
1048
|
-
filteredReplies:
|
|
1049
|
-
groupedMessages:
|
|
1050
|
-
hasGuestCallback:
|
|
1050
|
+
cleanliness: pe,
|
|
1051
|
+
cleanlinessColor: Re,
|
|
1052
|
+
cleanlinessTooltipContent: He,
|
|
1053
|
+
filteredReplies: Le,
|
|
1054
|
+
groupedMessages: Pe,
|
|
1055
|
+
hasGuestCallback: qe,
|
|
1051
1056
|
hasComplaint: Ie,
|
|
1052
|
-
itemOptionsList:
|
|
1057
|
+
itemOptionsList: xe,
|
|
1053
1058
|
occupied: De,
|
|
1054
|
-
occupancyTooltipContent:
|
|
1055
|
-
selectedAssignType:
|
|
1056
|
-
selectedDepartment:
|
|
1057
|
-
selectedRequestedBy:
|
|
1058
|
-
stayDetails:
|
|
1059
|
-
tagsList:
|
|
1060
|
-
validateToDo:
|
|
1059
|
+
occupancyTooltipContent: Fe,
|
|
1060
|
+
selectedAssignType: Be,
|
|
1061
|
+
selectedDepartment: Ge,
|
|
1062
|
+
selectedRequestedBy: We,
|
|
1063
|
+
stayDetails: Ue,
|
|
1064
|
+
tagsList: je,
|
|
1065
|
+
validateToDo: $e,
|
|
1061
1066
|
// Methods
|
|
1062
1067
|
closeRequest: Te,
|
|
1063
|
-
createCallback:
|
|
1064
|
-
createMessageList:
|
|
1068
|
+
createCallback: Qe,
|
|
1069
|
+
createMessageList: F,
|
|
1065
1070
|
getChatMessages: fe,
|
|
1066
|
-
getHowLongAgo:
|
|
1071
|
+
getHowLongAgo: Ye,
|
|
1067
1072
|
getPMSData: se,
|
|
1068
1073
|
getRoomNotices: ne,
|
|
1069
1074
|
getSharedData: he,
|
|
1070
1075
|
getStayDetails: Oe,
|
|
1071
|
-
getTicketColor:
|
|
1072
|
-
getTicketIcon:
|
|
1073
|
-
getTickets:
|
|
1076
|
+
getTicketColor: ze,
|
|
1077
|
+
getTicketIcon: Ke,
|
|
1078
|
+
getTickets: Y,
|
|
1074
1079
|
handleFailedResponse: ke,
|
|
1075
|
-
handlePulse:
|
|
1076
|
-
onClickEditConnectGuest:
|
|
1077
|
-
onClickTicket:
|
|
1078
|
-
onCreateRequestSubmit:
|
|
1079
|
-
onHoverToggle:
|
|
1080
|
-
onSelectQuickReply:
|
|
1081
|
-
onSelectToDo:
|
|
1082
|
-
openRequest:
|
|
1083
|
-
refreshPMSData:
|
|
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,
|
|
1084
1089
|
resizeTextarea: Ee,
|
|
1085
|
-
scrollToConnectBottom:
|
|
1086
|
-
sendChatMessage:
|
|
1090
|
+
scrollToConnectBottom: V,
|
|
1091
|
+
sendChatMessage: rt,
|
|
1087
1092
|
setAlignment: ge,
|
|
1088
1093
|
setPositioning: _e,
|
|
1089
|
-
toggleMarkOpenClose:
|
|
1090
|
-
toggleQuickReply:
|
|
1091
|
-
updateTickets:
|
|
1094
|
+
toggleMarkOpenClose: lt,
|
|
1095
|
+
toggleQuickReply: Se,
|
|
1096
|
+
updateTickets: dt,
|
|
1092
1097
|
// Simulate Guest Reply methods (test environments only)
|
|
1093
|
-
simulateGuestReply:
|
|
1094
|
-
toggleSimulateOpen:
|
|
1098
|
+
simulateGuestReply: it,
|
|
1099
|
+
toggleSimulateOpen: ut
|
|
1095
1100
|
};
|
|
1096
1101
|
}
|
|
1097
1102
|
});
|
|
1098
1103
|
export {
|
|
1099
|
-
|
|
1104
|
+
Gt as default
|
|
1100
1105
|
};
|