@quoreadmin/ui 1.8.7 → 1.8.9
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/index.css +1 -1
- package/dist/index127.js +21 -20
- package/dist/index142.js +241 -230
- package/dist/index144.js +1 -1
- package/dist/index174.js +14 -14
- package/dist/index175.js +3 -3
- package/dist/index178.js +4 -4
- package/dist/index185.js +10 -10
- package/dist/index187.js +10 -10
- package/dist/index189.js +1190 -36
- package/dist/index191.js +36 -1190
- package/dist/{index190.js → index192.js} +17 -17
- package/dist/index193.js +28 -28
- package/dist/index194.js +2 -2
- package/dist/index195.js +2 -2
- package/dist/index196.js +1 -1
- package/dist/index198.js +2 -2
- package/dist/index200.js +14 -14
- package/dist/index201.js +1 -1
- package/dist/index202.js +1 -1
- package/dist/index203.js +3 -3
- package/dist/index204.js +6 -6
- package/dist/index205.js +29 -84
- package/dist/index206.js +109 -400
- package/dist/index207.js +36 -22
- package/dist/index208.js +26 -33
- package/dist/index209.js +31 -111
- package/dist/index210.js +50 -35
- package/dist/index211.js +43 -26
- package/dist/index212.js +3 -35
- package/dist/index213.js +9 -51
- package/dist/index214.js +18 -42
- package/dist/index215.js +10 -4
- package/dist/index216.js +10 -9
- package/dist/index217.js +38 -18
- package/dist/index218.js +21 -10
- package/dist/index219.js +127 -10
- package/dist/index220.js +36 -37
- package/dist/index221.js +407 -21
- package/dist/index222.js +80 -161
- package/dist/index223.js +20 -228
- package/dist/index224.js +82 -31
- package/dist/index225.js +20 -10
- package/dist/index226.js +19 -160
- package/dist/index227.js +10 -10
- package/dist/index228.js +8 -8
- package/dist/index229.js +22 -22
- package/dist/index230.js +156 -194
- package/dist/index231.js +224 -66
- package/dist/index232.js +37 -34
- package/dist/index233.js +9 -39
- package/dist/index234.js +3618 -109
- package/dist/index235.js +49 -32
- package/dist/index236.js +70 -73
- package/dist/index237.js +52 -20
- package/dist/index238.js +215 -20
- package/dist/index239.js +10 -20
- package/dist/index240.js +57 -20
- package/dist/index241.js +49 -241
- package/dist/index242.js +53 -7
- package/dist/index243.js +71 -134
- package/dist/index244.js +718 -75
- package/dist/index245.js +30 -3624
- package/dist/index246.js +41 -32
- package/dist/index247.js +10 -76
- package/dist/index248.js +694 -41
- package/dist/index249.js +812 -207
- package/dist/index250.js +161 -10
- package/dist/index251.js +20 -57
- package/dist/index252.js +22 -61
- package/dist/index253.js +192 -47
- package/dist/index254.js +66 -71
- package/dist/index255.js +33 -725
- package/dist/index256.js +36 -38
- package/dist/index257.js +22 -64
- package/dist/index258.js +22 -11
- package/dist/index259.js +20 -705
- package/dist/index260.js +792 -776
- package/dist/index261.js +701 -21
- package/dist/index262.js +176 -22
- package/dist/index263.js +15 -13
- package/dist/index264.js +20 -836
- package/dist/index265.js +19 -701
- package/dist/index266.js +3 -176
- package/dist/index267.js +186 -21
- package/dist/index268.js +132 -19
- package/dist/index269.js +1223 -20
- package/dist/index270.js +20 -3
- package/dist/index271.js +21 -186
- package/dist/index272.js +21 -132
- package/dist/index273.js +29 -1223
- package/dist/index274.js +12 -12
- package/dist/index275.js +13 -15
- package/dist/index276.js +2 -22
- package/dist/index277.js +2 -29
- package/dist/index278.js +253 -20
- package/dist/index279.js +8 -20
- package/dist/index280.js +138 -2
- package/dist/index281.js +83 -2
- package/dist/index282.js +2 -54
- package/dist/index283.js +1 -1
- package/dist/index284.js +1534 -26
- package/dist/index285.js +386 -22
- package/dist/index286.js +2731 -22
- package/dist/index287.js +86 -16
- package/dist/index288.js +3792 -17
- package/dist/index289.js +59 -22
- package/dist/index290.js +15 -3
- package/dist/index291.js +81 -24
- package/dist/index292.js +202 -2
- package/dist/index293.js +220 -1508
- package/dist/index294.js +242 -366
- package/dist/index295.js +4 -2729
- package/dist/index296.js +137 -83
- package/dist/index297.js +69 -3788
- package/dist/index298.js +83 -56
- package/dist/index299.js +29 -15
- package/dist/index300.js +14 -82
- package/dist/index301.js +64 -191
- package/dist/index302.js +3 -245
- package/dist/index303.js +2 -262
- package/dist/index304.js +82 -5
- package/dist/index305.js +45 -132
- package/dist/index306.js +4 -71
- package/dist/index307.js +4 -86
- package/dist/index308.js +176 -26
- package/dist/index309.js +61 -14
- package/dist/index310.js +75 -75
- package/dist/index311.js +53 -3
- package/dist/index312.js +26 -2
- package/dist/index313.js +21 -82
- package/dist/index314.js +21 -52
- package/dist/index315.js +16 -6
- package/dist/index316.js +16 -4
- package/dist/index317.js +22 -178
- package/dist/index318.js +3 -63
- package/dist/index319.js +27 -75
- package/dist/index320.js +1 -1
- package/dist/index322.js +2 -2
- package/dist/index326.js +1 -1
- package/dist/index327.js +1 -1
- package/dist/index328.js +1 -1
- package/dist/index331.js +1 -1
- package/dist/index332.js +1 -1
- package/dist/index333.js +18 -8
- package/dist/index334.js +56 -12
- package/dist/index335.js +27 -53
- package/dist/index336.js +6 -11
- package/dist/index337.js +50 -12
- package/dist/index338.js +7 -58
- package/dist/index339.js +10 -50
- package/dist/index340.js +7 -31
- package/dist/index341.js +28 -2
- package/dist/index342.js +2 -5
- package/dist/index343.js +70 -2
- package/dist/index344.js +165 -21
- package/dist/index345.js +8 -40
- package/dist/index346.js +13 -2
- package/dist/index347.js +55 -11
- package/dist/index348.js +10 -18
- package/dist/index349.js +14 -10
- package/dist/index350.js +58 -10
- package/dist/index351.js +51 -16
- package/dist/index352.js +31 -2
- package/dist/index353.js +2 -9
- package/dist/index354.js +5 -10
- package/dist/index355.js +2 -14
- package/dist/index356.js +23 -19
- package/dist/index357.js +40 -56
- package/dist/index358.js +2 -29
- package/dist/index359.js +11 -7
- package/dist/index360.js +17 -49
- package/dist/index361.js +9 -6
- package/dist/index362.js +10 -12
- package/dist/index363.js +16 -6
- package/dist/index364.js +2 -28
- package/dist/index365.js +9 -2
- package/dist/index366.js +10 -70
- package/dist/index367.js +12 -165
- package/dist/index37.js +3 -3
- package/dist/index370.js +1 -1
- package/dist/index371.js +1 -1
- package/dist/index372.js +95 -98
- package/dist/index373.js +100 -90
- package/dist/index374.js +30 -97
- package/dist/index375.js +10 -30
- package/dist/index376.js +3 -10
- package/dist/index377.js +3 -3
- package/dist/index378.js +13 -4
- package/dist/index379.js +7 -13
- package/dist/index380.js +12 -7
- package/dist/index381.js +4 -11
- package/dist/index382.js +33 -5
- package/dist/index383.js +31 -33
- package/dist/index384.js +26 -29
- package/dist/index385.js +59 -26
- package/dist/index386.js +91 -61
- package/dist/index387.js +1 -1
- package/dist/index388.js +1 -1
- package/dist/index393.js +1 -1
- package/dist/index394.js +2 -2
- package/dist/index44.js +304 -293
- package/dist/src/components/page-header/page-header.stories.d.ts +18 -0
- package/dist/src/components/page-header/page-header.vue.d.ts +2 -0
- package/dist/src/components/room-details-popover/room-details-popover.d.ts +24 -7
- package/package.json +1 -1
package/dist/index142.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
1
|
+
import { defineComponent as yt, ref as i, computed as g, watch as B, onMounted as gt, onUnmounted as _t } from "vue";
|
|
2
|
+
import { useI18n as wt } from "vue-i18n";
|
|
3
3
|
import { DateTime as w } from "./index166.js";
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
const
|
|
4
|
+
import "./index191.js";
|
|
5
|
+
import It from "./index2.js";
|
|
6
|
+
import Tt from "./index3.js";
|
|
7
|
+
import Dt from "./index4.js";
|
|
8
|
+
import Ot from "./index21.js";
|
|
9
|
+
import kt from "./index28.js";
|
|
10
|
+
import Et from "./index40.js";
|
|
11
|
+
import At from "./index20.js";
|
|
12
|
+
import St from "./index47.js";
|
|
13
|
+
import bt from "./index48.js";
|
|
14
|
+
import Ct from "./index50.js";
|
|
15
|
+
import z from "./index192.js";
|
|
16
|
+
const Nt = 996, Yt = yt({
|
|
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: It,
|
|
20
|
+
QActivityItem: Tt,
|
|
21
|
+
QAvatar: Dt,
|
|
22
|
+
QDatePicker: At,
|
|
23
|
+
QDivider: Ot,
|
|
24
|
+
QIcon: kt,
|
|
25
|
+
QPopover: Et,
|
|
26
|
+
QTag: St,
|
|
27
|
+
QTextarea: bt,
|
|
28
|
+
QTooltip: Ct
|
|
29
29
|
},
|
|
30
30
|
props: {
|
|
31
31
|
id: {
|
|
@@ -124,6 +124,11 @@ const Wt = pt({
|
|
|
124
124
|
default: "",
|
|
125
125
|
required: !0
|
|
126
126
|
},
|
|
127
|
+
/** Property-level clean initiative (e.g. Greener Stay) from Hub; passed by PM app when room data does not include it */
|
|
128
|
+
cleanInitiativeInfo: {
|
|
129
|
+
type: Object,
|
|
130
|
+
default: null
|
|
131
|
+
},
|
|
127
132
|
allowWhenWhere: {
|
|
128
133
|
type: Boolean,
|
|
129
134
|
default: !1
|
|
@@ -165,7 +170,7 @@ const Wt = pt({
|
|
|
165
170
|
},
|
|
166
171
|
emits: ["create:callback", "create:todo", "refresh:pms", "show:toast", "toggle"],
|
|
167
172
|
setup(s, { emit: f }) {
|
|
168
|
-
const { t: u } =
|
|
173
|
+
const { t: u } = wt(), r = i(null), ue = i(!1), ce = i("left"), X = i([
|
|
169
174
|
{
|
|
170
175
|
id: 1,
|
|
171
176
|
label: u("HC_DEPARTMENT")
|
|
@@ -178,7 +183,7 @@ const Wt = pt({
|
|
|
178
183
|
id: 0,
|
|
179
184
|
label: u("HC_ANYONE")
|
|
180
185
|
}
|
|
181
|
-
]),
|
|
186
|
+
]), b = i(""), p = i({
|
|
182
187
|
checkInDate: /* @__PURE__ */ new Date(),
|
|
183
188
|
checkOutDate: /* @__PURE__ */ new Date(),
|
|
184
189
|
guestEmail: "",
|
|
@@ -186,15 +191,15 @@ const Wt = pt({
|
|
|
186
191
|
guestMood: null,
|
|
187
192
|
guestName: "",
|
|
188
193
|
guestPhone: "",
|
|
189
|
-
inHouse: !!
|
|
194
|
+
inHouse: !!r.value?.tokenId || !1,
|
|
190
195
|
problem: null,
|
|
191
196
|
notes: "",
|
|
192
|
-
tokenId:
|
|
193
|
-
}), G =
|
|
197
|
+
tokenId: r.value?.tokenId
|
|
198
|
+
}), G = i(250), U = i(290), N = i([]), Te = i([]), Z = i(!0), ee = i(!0), M = i({
|
|
194
199
|
info: !0,
|
|
195
200
|
tickets: !0,
|
|
196
201
|
comments: !0
|
|
197
|
-
}), te =
|
|
202
|
+
}), te = i(!0), Ne = i(s.guestDetails), O = i([]), y = i({
|
|
198
203
|
actionItems: !1,
|
|
199
204
|
activity: !1,
|
|
200
205
|
conversationToggle: !1,
|
|
@@ -203,7 +208,7 @@ const Wt = pt({
|
|
|
203
208
|
roomNotices: !1,
|
|
204
209
|
sendingMessage: !1,
|
|
205
210
|
tickets: !1
|
|
206
|
-
}), C =
|
|
211
|
+
}), C = i([]), de = i([]), me = i("bottom"), R = i(null), H = i(!1), W = i(!1), j = i(""), ve = i(!1), S = i(!1), k = i(null), $ = i(null), Me = 3e4, d = i({
|
|
207
212
|
assignType: null,
|
|
208
213
|
department: null,
|
|
209
214
|
due: /* @__PURE__ */ new Date(),
|
|
@@ -213,7 +218,7 @@ const Wt = pt({
|
|
|
213
218
|
requestedBy: null,
|
|
214
219
|
when: null,
|
|
215
220
|
where: null
|
|
216
|
-
}), Q =
|
|
221
|
+
}), Q = i([
|
|
217
222
|
{
|
|
218
223
|
id: 0,
|
|
219
224
|
label: u("HC_STAFF_MEMBER")
|
|
@@ -222,12 +227,12 @@ const Wt = pt({
|
|
|
222
227
|
id: 1,
|
|
223
228
|
label: u("HC_HOTEL_GUEST")
|
|
224
229
|
}
|
|
225
|
-
]), pe =
|
|
230
|
+
]), pe = i(!1), E = i(null), I = i({
|
|
226
231
|
endDate: /* @__PURE__ */ new Date(),
|
|
227
232
|
issue: null,
|
|
228
233
|
notes: "",
|
|
229
234
|
startDate: /* @__PURE__ */ new Date()
|
|
230
|
-
}), ae =
|
|
235
|
+
}), ae = i([]), oe = i(!1), fe = i([]), Re = i(!0), A = i([]), L = i([]), He = i([
|
|
231
236
|
{
|
|
232
237
|
label: u("HC_COMPLAINT"),
|
|
233
238
|
id: "complaint"
|
|
@@ -244,7 +249,7 @@ const Wt = pt({
|
|
|
244
249
|
label: u("HC_WORK_ORDER"),
|
|
245
250
|
id: "work_order"
|
|
246
251
|
}
|
|
247
|
-
]),
|
|
252
|
+
]), Y = i(), P = i(null), v = i({
|
|
248
253
|
assignType: null,
|
|
249
254
|
department: null,
|
|
250
255
|
due: /* @__PURE__ */ new Date(),
|
|
@@ -253,8 +258,8 @@ const Wt = pt({
|
|
|
253
258
|
notes: "",
|
|
254
259
|
person: null,
|
|
255
260
|
requestedBy: null
|
|
256
|
-
}), he =
|
|
257
|
-
switch (
|
|
261
|
+
}), he = i([]), q = i([]), x = i([]), Le = g(() => {
|
|
262
|
+
switch (r.value.cleaning?.name) {
|
|
258
263
|
case "CLEAN":
|
|
259
264
|
case "INSPECTED":
|
|
260
265
|
return "CLEAN";
|
|
@@ -266,10 +271,13 @@ const Wt = pt({
|
|
|
266
271
|
default:
|
|
267
272
|
return "";
|
|
268
273
|
}
|
|
269
|
-
}), Pe =
|
|
270
|
-
const e =
|
|
274
|
+
}), Pe = g(() => {
|
|
275
|
+
const e = r.value?.hkTaskTypeId || s.room?.hkTaskTypeId;
|
|
276
|
+
return Number(e) === Nt;
|
|
277
|
+
}), qe = g(() => s.cleanInitiativeInfo?.cleanInitiativeName ?? r.value?.cleanInitiativeInfo?.cleanInitiativeName ?? "Greener Stay"), xe = g(() => s.cleanInitiativeInfo?.imgUrl ?? r.value?.cleanInitiativeInfo?.imgUrl ?? ""), Fe = g(() => {
|
|
278
|
+
const e = b.value.toLowerCase();
|
|
271
279
|
return s.quickReplies.filter((t) => t.toLowerCase().match(e));
|
|
272
|
-
}),
|
|
280
|
+
}), Be = g(() => {
|
|
273
281
|
if (!C.value.length) return [];
|
|
274
282
|
const e = [];
|
|
275
283
|
let t = null;
|
|
@@ -289,11 +297,11 @@ const Wt = pt({
|
|
|
289
297
|
formattedTime: o.toFormat("h:mma").replace("AM", "am").replace("PM", "pm")
|
|
290
298
|
});
|
|
291
299
|
}), e;
|
|
292
|
-
}), De =
|
|
300
|
+
}), De = g(() => A.value.length ? !!A.value.find(
|
|
293
301
|
(t) => t.type === "complaint"
|
|
294
|
-
) : !1),
|
|
302
|
+
) : !1), Ge = g(() => A.value.length ? !!A.value.find(
|
|
295
303
|
(t) => t.type === "callback"
|
|
296
|
-
) : !1),
|
|
304
|
+
) : !1), Ue = g(() => {
|
|
297
305
|
let e = [];
|
|
298
306
|
return O.value[0] && O.value[0].options === void 0 ? O.value.forEach((t) => {
|
|
299
307
|
e.push({
|
|
@@ -301,7 +309,7 @@ const Wt = pt({
|
|
|
301
309
|
label: t.display_name
|
|
302
310
|
});
|
|
303
311
|
}) : e = O.value, e;
|
|
304
|
-
}), Oe =
|
|
312
|
+
}), Oe = g(() => r.value.occupancy?.name === "OCCUPIED"), We = g(() => Oe.value && De.value ? "HK_ROOM_STATUS_Occupied_Complaint" : "HK_ROOM_STATUS_Occupied"), je = g(() => {
|
|
305
313
|
switch (E.value?.id) {
|
|
306
314
|
case "request":
|
|
307
315
|
case "work_order":
|
|
@@ -309,18 +317,18 @@ const Wt = pt({
|
|
|
309
317
|
default:
|
|
310
318
|
return null;
|
|
311
319
|
}
|
|
312
|
-
}),
|
|
313
|
-
if (
|
|
320
|
+
}), $e = g(() => {
|
|
321
|
+
if (N.value)
|
|
314
322
|
switch (E.value?.id) {
|
|
315
323
|
case "request":
|
|
316
|
-
return
|
|
324
|
+
return N.value.find((e) => parseInt(e.id) === 4);
|
|
317
325
|
case "work_order":
|
|
318
|
-
return
|
|
326
|
+
return N.value.find((e) => parseInt(e.id) === 2);
|
|
319
327
|
default:
|
|
320
328
|
return null;
|
|
321
329
|
}
|
|
322
330
|
return null;
|
|
323
|
-
}),
|
|
331
|
+
}), Qe = g(() => {
|
|
324
332
|
switch (E.value?.id) {
|
|
325
333
|
case "request":
|
|
326
334
|
return Q.value[1];
|
|
@@ -329,21 +337,21 @@ const Wt = pt({
|
|
|
329
337
|
default:
|
|
330
338
|
return null;
|
|
331
339
|
}
|
|
332
|
-
}),
|
|
340
|
+
}), Ye = g(() => {
|
|
333
341
|
let e = "";
|
|
334
|
-
if (
|
|
342
|
+
if (r.value && r.value.reservations[0]) {
|
|
335
343
|
const t = w.fromISO(
|
|
336
|
-
|
|
337
|
-
), a = t.toFormat("MMM"), o = t.day, n = t.year,
|
|
338
|
-
|
|
339
|
-
), c =
|
|
344
|
+
r.value.reservations[0].arrivalDate
|
|
345
|
+
), a = t.toFormat("MMM"), o = t.day, n = t.year, l = w.fromISO(
|
|
346
|
+
r.value.reservations[0].departureDate
|
|
347
|
+
), c = l.toFormat("MMM"), m = l.day, h = l.year;
|
|
340
348
|
e += a + " " + o, n !== h && (e += ", " + n), a === c ? e += "-" + m : e += " - " + c + " " + m, e += ", " + h;
|
|
341
349
|
}
|
|
342
350
|
return e;
|
|
343
|
-
}),
|
|
351
|
+
}), Ve = g(() => {
|
|
344
352
|
let e = ae.value;
|
|
345
353
|
return e = [...new Set(e)], e;
|
|
346
|
-
}),
|
|
354
|
+
}), Je = g(() => {
|
|
347
355
|
const e = E.value?.id;
|
|
348
356
|
if (!e)
|
|
349
357
|
return !1;
|
|
@@ -360,13 +368,13 @@ const Wt = pt({
|
|
|
360
368
|
return !1;
|
|
361
369
|
}
|
|
362
370
|
}), ke = () => {
|
|
363
|
-
oe.value = !1,
|
|
364
|
-
},
|
|
365
|
-
f("create:callback",
|
|
371
|
+
oe.value = !1, H.value = !1, ue.value = !1, pe.value = !1, O.value = [], de.value = [], he.value = [], q.value = [], x.value = [], E.value = null, I.value.issue = null, I.value.startDate = /* @__PURE__ */ new Date(), I.value.endDate = /* @__PURE__ */ new Date(), I.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 = "", d.value.assignType = null, d.value.department = null, d.value.person = null, d.value.due = /* @__PURE__ */ new Date(), d.value.item = null, d.value.notes = "", d.value.when = null, d.value.where = null;
|
|
372
|
+
}, Ke = async () => {
|
|
373
|
+
f("create:callback", r.value), f("toggle", !1);
|
|
366
374
|
}, F = (e) => {
|
|
367
375
|
const t = [];
|
|
368
376
|
(Array.isArray(e) ? e : Object.values(e)).forEach((o) => {
|
|
369
|
-
const n = o.senderType || o.sender_type,
|
|
377
|
+
const n = o.senderType || o.sender_type, l = o.senderName || "", c = o.senderId || o.sender_id, m = o.profileImg || o.profile_img, h = l ? l.split(" ") : ["", ""], _ = o.user_first_name || o.guest_first_name || h[0] || "", K = o.user_last_name || o.guest_last_name || h.slice(1).join(" ") || "", le = _ && K ? `${_} ${K}` : _ || "Auto-Reply", ie = n === "system" || n === "user", T = n === "guest";
|
|
370
378
|
let D = {
|
|
371
379
|
id: o.id,
|
|
372
380
|
isPropertyEmployee: n === "user",
|
|
@@ -377,23 +385,23 @@ const Wt = pt({
|
|
|
377
385
|
comment: o.content,
|
|
378
386
|
dateUtc: o.sent || o.created,
|
|
379
387
|
user: {
|
|
380
|
-
firstName:
|
|
388
|
+
firstName: _ || "Auto-Reply",
|
|
381
389
|
icon: "",
|
|
382
390
|
id: c || "system-message",
|
|
383
391
|
initials: "",
|
|
384
|
-
lastName:
|
|
392
|
+
lastName: K || "",
|
|
385
393
|
name: le,
|
|
386
394
|
src: m || ""
|
|
387
395
|
}
|
|
388
396
|
};
|
|
389
397
|
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]), ie && (D.user.icon = "property-fill"), t.push(D);
|
|
390
398
|
}), C.value = t;
|
|
391
|
-
},
|
|
399
|
+
}, ze = (e) => {
|
|
392
400
|
if (!e || e.length === 0) return;
|
|
393
401
|
(Array.isArray(e) ? e : Object.values(e)).forEach((a) => {
|
|
394
402
|
if (C.value.some((D) => D.id === a.id))
|
|
395
403
|
return;
|
|
396
|
-
const o = a.senderType || a.sender_type, n = a.senderName || "",
|
|
404
|
+
const o = a.senderType || a.sender_type, n = a.senderName || "", l = a.senderId || a.sender_id, c = a.profileImg || a.profile_img, m = n ? n.split(" ") : ["", ""], h = a.user_first_name || a.guest_first_name || m[0] || "", _ = a.user_last_name || a.guest_last_name || m.slice(1).join(" ") || "", K = h && _ ? `${h} ${_}` : h || "Auto-Reply", le = o === "system" || o === "user", ie = o === "guest";
|
|
397
405
|
let T = {
|
|
398
406
|
id: a.id,
|
|
399
407
|
isPropertyEmployee: o === "user",
|
|
@@ -406,20 +414,20 @@ const Wt = pt({
|
|
|
406
414
|
user: {
|
|
407
415
|
firstName: h || "Auto-Reply",
|
|
408
416
|
icon: "",
|
|
409
|
-
id:
|
|
417
|
+
id: l || "system-message",
|
|
410
418
|
initials: "",
|
|
411
|
-
lastName:
|
|
412
|
-
name:
|
|
419
|
+
lastName: _ || "",
|
|
420
|
+
name: K,
|
|
413
421
|
src: c || ""
|
|
414
422
|
}
|
|
415
423
|
};
|
|
416
424
|
T.user.firstName && T.user.lastName ? T.user.initials = T.user.firstName[0] + T.user.lastName[0] : T.user.firstName && (T.user.initials = T.user.firstName[0]), le && (T.user.icon = "property-fill"), C.value.push(T);
|
|
417
425
|
});
|
|
418
426
|
}, ye = async (e = !1) => {
|
|
419
|
-
if (s.showComments &&
|
|
427
|
+
if (s.showComments && r.value.tokenId) {
|
|
420
428
|
e || (y.value.messages = !0);
|
|
421
429
|
try {
|
|
422
|
-
let t = `/api/client/connect/getMessages.php?tokenId=${
|
|
430
|
+
let t = `/api/client/connect/getMessages.php?tokenId=${r.value.tokenId}`;
|
|
423
431
|
e && k.value !== null && (t += `&lastMsgId=${k.value}`);
|
|
424
432
|
const o = await (await fetch(t, {
|
|
425
433
|
method: "GET",
|
|
@@ -427,10 +435,10 @@ const Wt = pt({
|
|
|
427
435
|
})).json();
|
|
428
436
|
if (o.status === "error")
|
|
429
437
|
throw new Error(o.message || "Failed to get messages");
|
|
430
|
-
if (
|
|
431
|
-
k.value = o.messages[o.messages.length - 1].id, e ?
|
|
432
|
-
const n = setTimeout(
|
|
433
|
-
|
|
438
|
+
if (S.value = !o.closed, o.messages && o.messages.length > 0) {
|
|
439
|
+
k.value = o.messages[o.messages.length - 1].id, e ? ze(o.messages) : F(o.messages);
|
|
440
|
+
const n = setTimeout(J, 100);
|
|
441
|
+
L.value.push(n);
|
|
434
442
|
} else e || F(o.messages || []);
|
|
435
443
|
} catch (t) {
|
|
436
444
|
console.error("getChatMessages error:", t);
|
|
@@ -438,7 +446,7 @@ const Wt = pt({
|
|
|
438
446
|
e || (y.value.messages = !1);
|
|
439
447
|
}
|
|
440
448
|
}
|
|
441
|
-
},
|
|
449
|
+
}, Xe = (e) => {
|
|
442
450
|
const t = w.utc(), a = w.fromFormat(e, "yyyy-MM-dd HH:mm:ss", { zone: "utc" }), o = t.diff(
|
|
443
451
|
a,
|
|
444
452
|
[
|
|
@@ -448,11 +456,11 @@ const Wt = pt({
|
|
|
448
456
|
"hours",
|
|
449
457
|
"minutes"
|
|
450
458
|
]
|
|
451
|
-
), n = Math.floor(o.years),
|
|
459
|
+
), n = Math.floor(o.years), l = Math.floor(o.months), c = Math.floor(o.days), m = Math.floor(o.hours), h = Math.floor(o.minutes);
|
|
452
460
|
if (n)
|
|
453
461
|
return n === 1 ? u("HC_ONE_YEAR_AGO") : u("HC_X_YEARS_AGO", { years: n });
|
|
454
|
-
if (
|
|
455
|
-
return
|
|
462
|
+
if (l)
|
|
463
|
+
return l === 1 ? u("HC_ONE_MONTH_AGO") : u("HC_X_MONTHS_AGO", { months: l });
|
|
456
464
|
if (c)
|
|
457
465
|
return c === 1 ? u("HC_ONE_DAY_AGO") : u("HC_X_DAYS_AGO", { days: c });
|
|
458
466
|
if (m)
|
|
@@ -461,23 +469,23 @@ const Wt = pt({
|
|
|
461
469
|
return h === 1 ? u("HC_ONE_MINUTE_AGO") : u("HC_X_MINUTES_AGO", { minutes: h });
|
|
462
470
|
if (h === 0)
|
|
463
471
|
return u("HC_A_MOMENT_AGO");
|
|
464
|
-
},
|
|
465
|
-
s.showGuestDetails && se(), ne(),
|
|
472
|
+
}, Ze = async () => {
|
|
473
|
+
s.showGuestDetails && se(), ne(), V(), re(), f("refresh:pms", r.value);
|
|
466
474
|
}, se = async () => {
|
|
467
475
|
try {
|
|
468
476
|
y.value.pms = !0;
|
|
469
477
|
const e = new AbortController(), t = setTimeout(() => e.abort(), 45e3);
|
|
470
|
-
|
|
478
|
+
L.value.push(t);
|
|
471
479
|
const a = s.pmsBaseUrl;
|
|
472
480
|
if (!a)
|
|
473
481
|
throw new Error("PMS base URL is required");
|
|
474
482
|
const o = {
|
|
475
483
|
Authorization: "Bearer " + (() => {
|
|
476
|
-
const
|
|
477
|
-
return
|
|
484
|
+
const _ = `; ${document.cookie}`.split("; QV2Auth=");
|
|
485
|
+
return _.length === 2 && _.pop()?.split(";").shift() || "";
|
|
478
486
|
})(),
|
|
479
487
|
"Content-Type": "application/json"
|
|
480
|
-
}, n =
|
|
488
|
+
}, n = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room.id, l = await fetch(
|
|
481
489
|
`${a}/vendors/properties/statuses/${s.propertyId}/rooms`,
|
|
482
490
|
{
|
|
483
491
|
method: "POST",
|
|
@@ -486,12 +494,12 @@ const Wt = pt({
|
|
|
486
494
|
body: JSON.stringify({ roomsIds: [n] })
|
|
487
495
|
}
|
|
488
496
|
);
|
|
489
|
-
clearTimeout(t),
|
|
490
|
-
const c = await
|
|
491
|
-
R.value = m, m.length > 0 ?
|
|
497
|
+
clearTimeout(t), l.ok || Ae(l);
|
|
498
|
+
const c = await l.json(), m = c.data?.pmsRooms || c.data?.rooms || c.rooms || [];
|
|
499
|
+
R.value = m, m.length > 0 ? r.value = {
|
|
492
500
|
...m[0],
|
|
493
501
|
tokenId: m[0].tokenId || s.room.tokenId
|
|
494
|
-
} :
|
|
502
|
+
} : r.value = s.room, y.value.pms = !1;
|
|
495
503
|
} catch (e) {
|
|
496
504
|
return y.value.pms = !1, f("show:toast", {
|
|
497
505
|
show: !0,
|
|
@@ -533,17 +541,17 @@ const Wt = pt({
|
|
|
533
541
|
body: e
|
|
534
542
|
})
|
|
535
543
|
]), o = await t.json(), n = await a.json();
|
|
536
|
-
if (o.departments && (o.departments.forEach((
|
|
537
|
-
|
|
538
|
-
}),
|
|
539
|
-
const
|
|
544
|
+
if (o.departments && (o.departments.forEach((l) => {
|
|
545
|
+
l.label = l.display_name;
|
|
546
|
+
}), N.value = o.departments), n.users) {
|
|
547
|
+
const l = [];
|
|
540
548
|
let c = {
|
|
541
549
|
group: "",
|
|
542
550
|
options: []
|
|
543
551
|
};
|
|
544
552
|
n.users.forEach((m) => {
|
|
545
|
-
m.translated_department !== c.group && (c.group &&
|
|
546
|
-
}), c.group &&
|
|
553
|
+
m.translated_department !== c.group && (c.group && l.push({ ...c }), c.group = m.translated_department, c.options = []), c.options.push(m);
|
|
554
|
+
}), c.group && l.push({ ...c }), Te.value = l;
|
|
547
555
|
}
|
|
548
556
|
} catch (e) {
|
|
549
557
|
console.error("Error getting shared data:", e), f("show:toast", {
|
|
@@ -556,7 +564,7 @@ const Wt = pt({
|
|
|
556
564
|
}, Ee = async () => {
|
|
557
565
|
try {
|
|
558
566
|
const t = await (await fetch(
|
|
559
|
-
`/api/client/connect/getStayDetails.php?tokenId=${
|
|
567
|
+
`/api/client/connect/getStayDetails.php?tokenId=${r.value.tokenId}`,
|
|
560
568
|
{
|
|
561
569
|
method: "GET",
|
|
562
570
|
credentials: "include"
|
|
@@ -577,7 +585,7 @@ const Wt = pt({
|
|
|
577
585
|
icon: "exclamation-circle"
|
|
578
586
|
});
|
|
579
587
|
}
|
|
580
|
-
},
|
|
588
|
+
}, et = (e) => {
|
|
581
589
|
switch (e) {
|
|
582
590
|
case "complaint":
|
|
583
591
|
return "red-30";
|
|
@@ -590,7 +598,7 @@ const Wt = pt({
|
|
|
590
598
|
case "task":
|
|
591
599
|
return "green-20";
|
|
592
600
|
}
|
|
593
|
-
},
|
|
601
|
+
}, tt = (e) => {
|
|
594
602
|
switch (e) {
|
|
595
603
|
case "complaint":
|
|
596
604
|
return "face-frown";
|
|
@@ -603,7 +611,7 @@ const Wt = pt({
|
|
|
603
611
|
case "task":
|
|
604
612
|
return "check";
|
|
605
613
|
}
|
|
606
|
-
},
|
|
614
|
+
}, V = async () => {
|
|
607
615
|
try {
|
|
608
616
|
y.value.tickets = !0;
|
|
609
617
|
const e = await fetch(
|
|
@@ -627,7 +635,7 @@ const Wt = pt({
|
|
|
627
635
|
if (s.showActivity)
|
|
628
636
|
try {
|
|
629
637
|
y.value.activity = !0;
|
|
630
|
-
const e =
|
|
638
|
+
const e = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, t = await fetch(
|
|
631
639
|
"/api/client/common/getCleaningsInspections.php?propertyId=" + s.propertyId + "&areaId=" + e
|
|
632
640
|
);
|
|
633
641
|
if (!t.ok)
|
|
@@ -653,10 +661,10 @@ const Wt = pt({
|
|
|
653
661
|
a = { code: e.status, message: t };
|
|
654
662
|
}
|
|
655
663
|
return a.code === 401 ? (window.location.href = "/logout.php?unauthorized=1", { error: a }) : a;
|
|
656
|
-
},
|
|
664
|
+
}, at = (e) => {
|
|
657
665
|
const t = document.querySelectorAll(".pulse");
|
|
658
666
|
if (t && t.length) {
|
|
659
|
-
const a =
|
|
667
|
+
const a = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, o = document.getElementById("room-" + a), n = o?.classList;
|
|
660
668
|
switch (e) {
|
|
661
669
|
case "room_notice":
|
|
662
670
|
(n?.contains("roombox_unsel") || n?.contains("roombox_unsel_active")) && (o?.classList.remove(), o?.classList.add("roomnoticeroombox_sel"));
|
|
@@ -671,16 +679,16 @@ const Wt = pt({
|
|
|
671
679
|
!n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && !n?.contains("complaintsroombox_sel") && !n?.contains("guestrequestroombox_sel") && (o?.classList.remove(), o?.classList.add("workordersroombox_sel"));
|
|
672
680
|
break;
|
|
673
681
|
}
|
|
674
|
-
const
|
|
682
|
+
const l = setTimeout(() => {
|
|
675
683
|
t.forEach((c) => {
|
|
676
684
|
c.classList.remove("pulse");
|
|
677
685
|
});
|
|
678
686
|
}, 4500);
|
|
679
|
-
|
|
687
|
+
L.value.push(l);
|
|
680
688
|
}
|
|
681
|
-
},
|
|
689
|
+
}, ot = () => {
|
|
682
690
|
window.open("/guest/overview.php", "_blank");
|
|
683
|
-
},
|
|
691
|
+
}, st = (e) => {
|
|
684
692
|
let t = "";
|
|
685
693
|
switch (e.type) {
|
|
686
694
|
case "complaint":
|
|
@@ -702,11 +710,11 @@ const Wt = pt({
|
|
|
702
710
|
return "#";
|
|
703
711
|
}
|
|
704
712
|
window.open(t, "_blank");
|
|
705
|
-
},
|
|
713
|
+
}, nt = (e) => {
|
|
706
714
|
e.link && window.open(e.link, "_blank");
|
|
707
|
-
},
|
|
715
|
+
}, rt = async () => {
|
|
708
716
|
pe.value = !0;
|
|
709
|
-
const e =
|
|
717
|
+
const e = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, t = r.value?.qv2Rooms?.qRoomName || r.value?.name || s.room?.name, a = {
|
|
710
718
|
type: E.value?.id,
|
|
711
719
|
propertyId: s.propertyId,
|
|
712
720
|
userId: P.value,
|
|
@@ -715,7 +723,7 @@ const Wt = pt({
|
|
|
715
723
|
};
|
|
716
724
|
switch (E.value?.id) {
|
|
717
725
|
case "complaint":
|
|
718
|
-
a.tokenId =
|
|
726
|
+
a.tokenId = r.value.tokenId, a.problemId = p.value.problem.id, a.guestName = p.value.guestName, a.guestPhone = p.value.guestPhone, a.guestEmail = p.value.guestEmail, a.guestLoyalty = p.value.guestLoyalty, a.guestMood = p.value.guestMood.id, a.checkInDate = w.fromJSDate(p.value.checkInDate).toFormat(
|
|
719
727
|
"yyyy-MM-dd"
|
|
720
728
|
), a.checkOutDate = w.fromJSDate(p.value.checkOutDate).toFormat(
|
|
721
729
|
"yyyy-MM-dd"
|
|
@@ -731,32 +739,32 @@ const Wt = pt({
|
|
|
731
739
|
a.itemId = v.value.item.id, a.issueId = v.value.issue.id, a.assignType = v.value.assignType.id, a.occupied = v.value.requestedBy.id, a.notes = v.value.notes, a.dueDate = w.fromJSDate(v.value.due).toFormat("yyyy-MM-dd"), v.value.assignType.id === 1 && (a.department = v.value.department.id), v.value.assignType.id === 2 && (a.person = v.value.person.id), f("create:todo", a);
|
|
732
740
|
break;
|
|
733
741
|
}
|
|
734
|
-
},
|
|
742
|
+
}, lt = (e) => {
|
|
735
743
|
we(), Ie(), s.hover && f("toggle", e);
|
|
736
|
-
},
|
|
737
|
-
|
|
738
|
-
},
|
|
744
|
+
}, it = (e) => {
|
|
745
|
+
be(), b.value = e;
|
|
746
|
+
}, ut = async (e) => {
|
|
739
747
|
if (console.log("selected:", e), E.value = e, O.value = [], I.value.issue = null, p.value.problem = null, v.value.item = null, v.value.issue = null, d.value.item = null, !E.value) {
|
|
740
748
|
y.value.actionItems = !1;
|
|
741
749
|
return;
|
|
742
750
|
}
|
|
743
751
|
y.value.actionItems = !0;
|
|
744
|
-
const t =
|
|
752
|
+
const t = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, a = new FormData();
|
|
745
753
|
switch (a.append("property_id", s.propertyId), a.append("area_id", t), e.id) {
|
|
746
754
|
case "complaint":
|
|
747
755
|
try {
|
|
748
|
-
|
|
756
|
+
r.value.tokenId && await Ee();
|
|
749
757
|
const n = await (await fetch("/api/client/common/getComplaintProblemsByPropertyId.php", {
|
|
750
758
|
method: "POST",
|
|
751
759
|
body: a
|
|
752
760
|
})).json();
|
|
753
761
|
n.items && (O.value = n.items);
|
|
754
|
-
const
|
|
762
|
+
const l = await z.post(
|
|
755
763
|
"/api/client/common/getComplaintMoods.php"
|
|
756
764
|
);
|
|
757
|
-
|
|
765
|
+
l.data.items.forEach((c) => {
|
|
758
766
|
c.label = c.display_name;
|
|
759
|
-
}), de.value =
|
|
767
|
+
}), de.value = l.data.items;
|
|
760
768
|
} catch (o) {
|
|
761
769
|
console.error("Error loading complaint options:", o), f("show:toast", {
|
|
762
770
|
show: !0,
|
|
@@ -793,17 +801,17 @@ const Wt = pt({
|
|
|
793
801
|
method: "POST",
|
|
794
802
|
body: a
|
|
795
803
|
})).json();
|
|
796
|
-
if (n.items && (O.value = n.items), await ge(), d.value.department =
|
|
797
|
-
(
|
|
804
|
+
if (n.items && (O.value = n.items), await ge(), d.value.department = N.value.find(
|
|
805
|
+
(l) => parseInt(l.id) === 4
|
|
798
806
|
), s.allowWhenWhere)
|
|
799
807
|
try {
|
|
800
|
-
const
|
|
801
|
-
|
|
808
|
+
const l = new FormData();
|
|
809
|
+
l.append("property_id", s.propertyId);
|
|
802
810
|
const m = await (await fetch(
|
|
803
811
|
"/api/client/common/getWhenWhereOptions.php",
|
|
804
812
|
{
|
|
805
813
|
method: "POST",
|
|
806
|
-
body:
|
|
814
|
+
body: l
|
|
807
815
|
}
|
|
808
816
|
)).json();
|
|
809
817
|
m.when && Array.isArray(m.when) ? q.value = m.when.map((h) => ({
|
|
@@ -815,8 +823,8 @@ const Wt = pt({
|
|
|
815
823
|
label: h.name,
|
|
816
824
|
value: h.id
|
|
817
825
|
})) : x.value = [];
|
|
818
|
-
} catch (
|
|
819
|
-
console.error("Error loading When/Where options:",
|
|
826
|
+
} catch (l) {
|
|
827
|
+
console.error("Error loading When/Where options:", l), q.value = [], x.value = [], f("show:toast", {
|
|
820
828
|
show: !0,
|
|
821
829
|
message: u("HC_FAILED_TO_LOAD_WHEN_WHERE_OPTIONS"),
|
|
822
830
|
variant: "error",
|
|
@@ -840,24 +848,24 @@ const Wt = pt({
|
|
|
840
848
|
const n = await (await fetch("/api/client/common/getItemsByRoomId.php", {
|
|
841
849
|
method: "POST",
|
|
842
850
|
body: a
|
|
843
|
-
})).json(),
|
|
851
|
+
})).json(), l = [];
|
|
844
852
|
let c = {
|
|
845
853
|
group: "",
|
|
846
854
|
options: []
|
|
847
855
|
};
|
|
848
856
|
n.items && (n.items.forEach((m) => {
|
|
849
|
-
m.section_name !== c.group && (c.group &&
|
|
850
|
-
}), c.group &&
|
|
851
|
-
|
|
857
|
+
m.section_name !== c.group && (c.group && l.push({ ...c }), c.group = m.section_name, c.options = []), m.label && c.options.push(m);
|
|
858
|
+
}), c.group && l.push({ ...c })), O.value = l, await Promise.all([
|
|
859
|
+
z.post(
|
|
852
860
|
"/api/client/common/getWorkOrderIssues.php"
|
|
853
861
|
),
|
|
854
862
|
ge()
|
|
855
863
|
]).then((m) => {
|
|
856
864
|
const h = m[0];
|
|
857
|
-
h.data.issues.forEach((
|
|
858
|
-
|
|
865
|
+
h.data.issues.forEach((_) => {
|
|
866
|
+
_.label = _.display_name;
|
|
859
867
|
}), he.value = h.data.issues;
|
|
860
|
-
}), v.value.department =
|
|
868
|
+
}), v.value.department = N.value.find(
|
|
861
869
|
(m) => parseInt(m.id) === 2
|
|
862
870
|
);
|
|
863
871
|
} catch (o) {
|
|
@@ -875,24 +883,24 @@ const Wt = pt({
|
|
|
875
883
|
y.value.actionItems = !1;
|
|
876
884
|
return;
|
|
877
885
|
}
|
|
878
|
-
},
|
|
886
|
+
}, ct = () => {
|
|
879
887
|
oe.value = !oe.value, ue.value = !1;
|
|
880
|
-
},
|
|
888
|
+
}, Se = () => {
|
|
881
889
|
const e = document.getElementById("comment-field"), t = document.getElementById("hidden-text");
|
|
882
890
|
e.style.height = t?.offsetHeight + "px";
|
|
883
|
-
},
|
|
891
|
+
}, J = () => {
|
|
884
892
|
const e = document.getElementById("comments-container");
|
|
885
893
|
e?.scroll({
|
|
886
894
|
top: e.scrollHeight,
|
|
887
895
|
behavior: "smooth"
|
|
888
896
|
});
|
|
889
|
-
},
|
|
890
|
-
if (e && e.type === "keydown" && e.preventDefault(),
|
|
897
|
+
}, dt = async (e) => {
|
|
898
|
+
if (e && e.type === "keydown" && e.preventDefault(), r.value.tokenId && b.value && !H.value) {
|
|
891
899
|
y.value.sendingMessage = !0;
|
|
892
900
|
try {
|
|
893
901
|
const t = new FormData();
|
|
894
|
-
t.append("tokenId",
|
|
895
|
-
const a = await
|
|
902
|
+
t.append("tokenId", r.value.tokenId), t.append("content", b.value), t.append("senderId", P.value || "");
|
|
903
|
+
const a = await z.post(
|
|
896
904
|
"/api/client/connect/sendMessage.php",
|
|
897
905
|
t
|
|
898
906
|
);
|
|
@@ -905,7 +913,7 @@ const Wt = pt({
|
|
|
905
913
|
});
|
|
906
914
|
return;
|
|
907
915
|
}
|
|
908
|
-
|
|
916
|
+
b.value = "", S.value = !a.data.closed, a.data.messages && (F(a.data.messages), a.data.messages.length > 0 && (k.value = a.data.messages[a.data.messages.length - 1].id)), J();
|
|
909
917
|
} catch (t) {
|
|
910
918
|
console.error("sendChatMessage error:", t), f("show:toast", {
|
|
911
919
|
show: !0,
|
|
@@ -917,13 +925,13 @@ const Wt = pt({
|
|
|
917
925
|
y.value.sendingMessage = !1;
|
|
918
926
|
}
|
|
919
927
|
}
|
|
920
|
-
},
|
|
921
|
-
if (!(!
|
|
928
|
+
}, mt = async () => {
|
|
929
|
+
if (!(!r.value.tokenId || !P.value)) {
|
|
922
930
|
y.value.conversationToggle = !0;
|
|
923
931
|
try {
|
|
924
|
-
const e =
|
|
925
|
-
t.append("tokenId",
|
|
926
|
-
const a = await
|
|
932
|
+
const e = S.value ? "/api/client/connect/closeConversation.php" : "/api/client/connect/openConversation.php", t = new FormData();
|
|
933
|
+
t.append("tokenId", r.value.tokenId), t.append("userId", P.value), S.value && k.value !== null && t.append("lastMsgId", k.value.toString());
|
|
934
|
+
const a = await z.post(e, t);
|
|
927
935
|
if (a.data.status === "error") {
|
|
928
936
|
f("show:toast", {
|
|
929
937
|
show: !0,
|
|
@@ -933,9 +941,9 @@ const Wt = pt({
|
|
|
933
941
|
});
|
|
934
942
|
return;
|
|
935
943
|
}
|
|
936
|
-
|
|
944
|
+
S.value = !a.data.closed, a.data.messages && (F(a.data.messages), a.data.messages.length > 0 && (k.value = a.data.messages[a.data.messages.length - 1].id)), f("show:toast", {
|
|
937
945
|
show: !0,
|
|
938
|
-
message:
|
|
946
|
+
message: S.value ? u("HC_CONVERSATION_REOPENED") : u("HC_CONVERSATION_CLOSED"),
|
|
939
947
|
variant: "success",
|
|
940
948
|
icon: "check-circle"
|
|
941
949
|
});
|
|
@@ -950,13 +958,13 @@ const Wt = pt({
|
|
|
950
958
|
y.value.conversationToggle = !1;
|
|
951
959
|
}
|
|
952
960
|
}
|
|
953
|
-
},
|
|
954
|
-
if (s.isTestEnvironment && !(!
|
|
961
|
+
}, vt = async () => {
|
|
962
|
+
if (s.isTestEnvironment && !(!r.value?.tokenId || !j.value.trim())) {
|
|
955
963
|
ve.value = !0;
|
|
956
964
|
try {
|
|
957
965
|
const e = new FormData();
|
|
958
|
-
e.append("tokenId",
|
|
959
|
-
const t = await
|
|
966
|
+
e.append("tokenId", r.value.tokenId), e.append("content", j.value.trim());
|
|
967
|
+
const t = await z.post(
|
|
960
968
|
"/api/client/connect/simulateInbound.php",
|
|
961
969
|
e
|
|
962
970
|
);
|
|
@@ -969,7 +977,7 @@ const Wt = pt({
|
|
|
969
977
|
});
|
|
970
978
|
return;
|
|
971
979
|
}
|
|
972
|
-
t.data.messages && (F(t.data.messages),
|
|
980
|
+
t.data.messages && (F(t.data.messages), S.value = !t.data.closed, t.data.messages.length > 0 && (k.value = t.data.messages[t.data.messages.length - 1].id)), j.value = "", W.value = !1, J(), f("show:toast", {
|
|
973
981
|
show: !0,
|
|
974
982
|
message: u("HC_SIMULATED_GUEST_REPLY"),
|
|
975
983
|
variant: "success",
|
|
@@ -986,79 +994,79 @@ const Wt = pt({
|
|
|
986
994
|
ve.value = !1;
|
|
987
995
|
}
|
|
988
996
|
}
|
|
989
|
-
},
|
|
997
|
+
}, pt = () => {
|
|
990
998
|
W.value = !W.value, W.value || (j.value = "");
|
|
991
|
-
},
|
|
999
|
+
}, ft = () => {
|
|
992
1000
|
$.value || ($.value = setInterval(() => {
|
|
993
1001
|
document.visibilityState === "visible" && ye(!0);
|
|
994
|
-
},
|
|
1002
|
+
}, Me));
|
|
995
1003
|
}, _e = () => {
|
|
996
1004
|
$.value && (clearInterval($.value), $.value = null);
|
|
997
1005
|
}, we = () => {
|
|
998
1006
|
if (s.align === "left" || s.align === "right") {
|
|
999
|
-
const e =
|
|
1007
|
+
const e = Y.value?.getBoundingClientRect().left, t = window.innerWidth;
|
|
1000
1008
|
ce.value = t - e < U.value ? "right" : "left";
|
|
1001
1009
|
} else {
|
|
1002
|
-
const e =
|
|
1010
|
+
const e = Y.value?.getBoundingClientRect().top, t = window.innerHeight;
|
|
1003
1011
|
ce.value = t - e < G.value ? "bottom" : "top";
|
|
1004
1012
|
}
|
|
1005
1013
|
}, Ie = () => {
|
|
1006
1014
|
if (s.position === "top" || s.position === "bottom") {
|
|
1007
|
-
const e =
|
|
1015
|
+
const e = Y.value?.getBoundingClientRect().top, t = window.innerHeight;
|
|
1008
1016
|
me.value = t - e < G.value ? "top" : "bottom";
|
|
1009
1017
|
} else {
|
|
1010
|
-
const e =
|
|
1018
|
+
const e = Y.value?.getBoundingClientRect().left, t = window.innerWidth;
|
|
1011
1019
|
me.value = t - e < U.value ? "left" : "right";
|
|
1012
1020
|
}
|
|
1013
|
-
},
|
|
1014
|
-
|
|
1015
|
-
},
|
|
1016
|
-
const a =
|
|
1017
|
-
if (o.append("property_id", s.propertyId), o.append("room_ids", JSON.stringify([a])), await
|
|
1021
|
+
}, be = () => {
|
|
1022
|
+
H.value = !H.value, H.value ? (b.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);
|
|
1023
|
+
}, ht = async (e, t) => {
|
|
1024
|
+
const a = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, o = new FormData();
|
|
1025
|
+
if (o.append("property_id", s.propertyId), o.append("room_ids", JSON.stringify([a])), await V(), A.value) {
|
|
1018
1026
|
const n = [];
|
|
1019
|
-
A.value.forEach((
|
|
1020
|
-
|
|
1021
|
-
...
|
|
1027
|
+
A.value.forEach((l) => {
|
|
1028
|
+
l.id === e && l.type === t ? n.unshift({
|
|
1029
|
+
...l,
|
|
1022
1030
|
isNew: !0
|
|
1023
1031
|
}) : n.push({
|
|
1024
|
-
...
|
|
1032
|
+
...l,
|
|
1025
1033
|
isNew: !1
|
|
1026
1034
|
});
|
|
1027
|
-
}), n.sort((
|
|
1035
|
+
}), n.sort((l, c) => l.id === e ? -1 : c.id === e ? 1 : 0), A.value = [...n];
|
|
1028
1036
|
}
|
|
1029
1037
|
};
|
|
1030
1038
|
B(() => s.open, () => {
|
|
1031
1039
|
if (s.open && s.showComments && C.value.length) {
|
|
1032
|
-
const e = setTimeout(
|
|
1033
|
-
|
|
1040
|
+
const e = setTimeout(J, 500);
|
|
1041
|
+
L.value.push(e);
|
|
1034
1042
|
}
|
|
1035
|
-
s.open || (ke(), _e(), k.value = null, C.value = [],
|
|
1043
|
+
s.open || (ke(), _e(), k.value = null, C.value = [], S.value = !1);
|
|
1036
1044
|
}), B(
|
|
1037
|
-
() => [s.open, s.showComments, Z.value,
|
|
1045
|
+
() => [s.open, s.showComments, Z.value, r.value?.tokenId],
|
|
1038
1046
|
([e, t, a, o]) => {
|
|
1039
|
-
e && t && a && o ?
|
|
1047
|
+
e && t && a && o ? ft() : _e();
|
|
1040
1048
|
}
|
|
1041
|
-
), B(
|
|
1042
|
-
const e = setTimeout(
|
|
1043
|
-
|
|
1049
|
+
), B(b, () => {
|
|
1050
|
+
const e = setTimeout(Se, 100);
|
|
1051
|
+
L.value.push(e);
|
|
1044
1052
|
}), B(() => s.allowWhenWhere, (e, t) => {
|
|
1045
1053
|
t === !0 && e === !1 && (d.value.when = null, d.value.where = null, q.value = [], x.value = []);
|
|
1046
1054
|
});
|
|
1047
|
-
const Ce = () => !!(s.room.reservations || s.room.cleaning || s.room.occupancy);
|
|
1055
|
+
const Ce = () => !!(s.room.reservations || s.room.cleaning || s.room.occupancy || s.room.hkTaskTypeId != null);
|
|
1048
1056
|
return B(() => s.open, async (e, t) => {
|
|
1049
|
-
e && !t && (Ce() ? (
|
|
1057
|
+
e && !t && (Ce() ? (r.value = s.room, R.value = [s.room]) : s.showGuestDetails && !R.value ? await se() : r.value || (r.value = s.room), V(), ne(), re(), s.showComments && ye());
|
|
1050
1058
|
}), B(
|
|
1051
1059
|
() => s.room.id,
|
|
1052
1060
|
(e, t) => {
|
|
1053
|
-
e !== t && (
|
|
1061
|
+
e !== t && (r.value = s.room, R.value = null, s.open && (Ce() ? R.value = [s.room] : s.showGuestDetails && se(), V(), ne(), re()));
|
|
1054
1062
|
}
|
|
1055
|
-
),
|
|
1063
|
+
), gt(async () => {
|
|
1056
1064
|
const e = JSON.parse(
|
|
1057
1065
|
window.localStorage.getItem("authenticated")
|
|
1058
1066
|
);
|
|
1059
|
-
P.value = e?.user?.id || window.userId || "",
|
|
1060
|
-
}),
|
|
1061
|
-
|
|
1067
|
+
P.value = e?.user?.id || window.userId || "", r.value = s.room, s.size === "sm" && (G.value = 140, U.value = 160), s.size === "lg" && (G.value = 250, U.value = 440), we(), Ie();
|
|
1068
|
+
}), _t(() => {
|
|
1069
|
+
L.value.forEach((e) => {
|
|
1062
1070
|
clearTimeout(e);
|
|
1063
1071
|
}), _e();
|
|
1064
1072
|
}), {
|
|
@@ -1068,102 +1076,105 @@ const Wt = pt({
|
|
|
1068
1076
|
actionMenuOpen: ue,
|
|
1069
1077
|
alignment: ce,
|
|
1070
1078
|
assignTypes: X,
|
|
1071
|
-
comment:
|
|
1079
|
+
comment: b,
|
|
1072
1080
|
complaint: p,
|
|
1073
1081
|
componentHeight: G,
|
|
1074
1082
|
componentWidth: U,
|
|
1075
|
-
departments:
|
|
1083
|
+
departments: N,
|
|
1076
1084
|
departmentUsers: Te,
|
|
1077
1085
|
expandActivity: Re,
|
|
1078
1086
|
expandComments: Z,
|
|
1079
1087
|
expandGuestInfo: ee,
|
|
1080
|
-
expandedStates:
|
|
1088
|
+
expandedStates: M,
|
|
1081
1089
|
expandTickets: te,
|
|
1082
|
-
guestDetailsData:
|
|
1090
|
+
guestDetailsData: Ne,
|
|
1083
1091
|
itemOptions: O,
|
|
1084
1092
|
loading: y,
|
|
1085
1093
|
messages: C,
|
|
1086
1094
|
moodOptions: de,
|
|
1087
1095
|
pmsData: R,
|
|
1088
1096
|
positioning: me,
|
|
1089
|
-
quickReplyOpen:
|
|
1097
|
+
quickReplyOpen: H,
|
|
1090
1098
|
request: d,
|
|
1091
1099
|
requestedByOptions: Q,
|
|
1092
1100
|
requestLoading: pe,
|
|
1093
1101
|
requestType: E,
|
|
1094
|
-
roomDetailsData:
|
|
1102
|
+
roomDetailsData: r,
|
|
1095
1103
|
roomNotice: I,
|
|
1096
1104
|
roomNotices: ae,
|
|
1097
1105
|
showCreateRequest: oe,
|
|
1098
1106
|
ticketsList: A,
|
|
1099
|
-
todoOptions:
|
|
1100
|
-
trigger:
|
|
1107
|
+
todoOptions: He,
|
|
1108
|
+
trigger: Y,
|
|
1101
1109
|
userId: P,
|
|
1102
1110
|
workOrder: v,
|
|
1103
1111
|
workOrderIssues: he,
|
|
1104
1112
|
whenOptions: q,
|
|
1105
1113
|
whereOptions: x,
|
|
1106
1114
|
// Guest Connect state
|
|
1107
|
-
isConversationOpen:
|
|
1115
|
+
isConversationOpen: S,
|
|
1108
1116
|
lastMessageId: k,
|
|
1109
1117
|
// Simulate Guest Reply state (test environments only)
|
|
1110
1118
|
simulateOpen: W,
|
|
1111
1119
|
simulateContent: j,
|
|
1112
1120
|
simulateLoading: ve,
|
|
1113
1121
|
// Computed
|
|
1114
|
-
cleanliness:
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1122
|
+
cleanliness: Le,
|
|
1123
|
+
greenerStayIconUrl: xe,
|
|
1124
|
+
greenerStayTooltipContent: qe,
|
|
1125
|
+
isGreenerStay: Pe,
|
|
1126
|
+
filteredReplies: Fe,
|
|
1127
|
+
groupedMessages: Be,
|
|
1128
|
+
hasGuestCallback: Ge,
|
|
1118
1129
|
hasComplaint: De,
|
|
1119
|
-
itemOptionsList:
|
|
1130
|
+
itemOptionsList: Ue,
|
|
1120
1131
|
occupied: Oe,
|
|
1121
|
-
occupancyTooltipContent:
|
|
1122
|
-
selectedAssignType:
|
|
1123
|
-
selectedDepartment:
|
|
1124
|
-
selectedRequestedBy:
|
|
1125
|
-
stayDetails:
|
|
1126
|
-
tagsList:
|
|
1127
|
-
validateToDo:
|
|
1132
|
+
occupancyTooltipContent: We,
|
|
1133
|
+
selectedAssignType: je,
|
|
1134
|
+
selectedDepartment: $e,
|
|
1135
|
+
selectedRequestedBy: Qe,
|
|
1136
|
+
stayDetails: Ye,
|
|
1137
|
+
tagsList: Ve,
|
|
1138
|
+
validateToDo: Je,
|
|
1128
1139
|
// Methods
|
|
1129
1140
|
closeRequest: ke,
|
|
1130
|
-
createCallback:
|
|
1141
|
+
createCallback: Ke,
|
|
1131
1142
|
getActivity: re,
|
|
1132
1143
|
createMessageList: F,
|
|
1133
1144
|
getChatMessages: ye,
|
|
1134
|
-
getHowLongAgo:
|
|
1145
|
+
getHowLongAgo: Xe,
|
|
1135
1146
|
getPMSData: se,
|
|
1136
1147
|
getRoomNotices: ne,
|
|
1137
1148
|
getSharedData: ge,
|
|
1138
1149
|
getStayDetails: Ee,
|
|
1139
|
-
getTicketColor:
|
|
1140
|
-
getTicketIcon:
|
|
1141
|
-
getTickets:
|
|
1150
|
+
getTicketColor: et,
|
|
1151
|
+
getTicketIcon: tt,
|
|
1152
|
+
getTickets: V,
|
|
1142
1153
|
handleFailedResponse: Ae,
|
|
1143
|
-
handlePulse:
|
|
1144
|
-
onClickActivity:
|
|
1145
|
-
onClickEditConnectGuest:
|
|
1146
|
-
onClickTicket:
|
|
1147
|
-
onCreateRequestSubmit:
|
|
1148
|
-
onHoverToggle:
|
|
1149
|
-
onSelectQuickReply:
|
|
1150
|
-
onSelectToDo:
|
|
1151
|
-
openRequest:
|
|
1152
|
-
refreshPMSData:
|
|
1153
|
-
resizeTextarea:
|
|
1154
|
-
scrollToConnectBottom:
|
|
1155
|
-
sendChatMessage:
|
|
1154
|
+
handlePulse: at,
|
|
1155
|
+
onClickActivity: nt,
|
|
1156
|
+
onClickEditConnectGuest: ot,
|
|
1157
|
+
onClickTicket: st,
|
|
1158
|
+
onCreateRequestSubmit: rt,
|
|
1159
|
+
onHoverToggle: lt,
|
|
1160
|
+
onSelectQuickReply: it,
|
|
1161
|
+
onSelectToDo: ut,
|
|
1162
|
+
openRequest: ct,
|
|
1163
|
+
refreshPMSData: Ze,
|
|
1164
|
+
resizeTextarea: Se,
|
|
1165
|
+
scrollToConnectBottom: J,
|
|
1166
|
+
sendChatMessage: dt,
|
|
1156
1167
|
setAlignment: we,
|
|
1157
1168
|
setPositioning: Ie,
|
|
1158
|
-
toggleMarkOpenClose:
|
|
1159
|
-
toggleQuickReply:
|
|
1160
|
-
updateTickets:
|
|
1169
|
+
toggleMarkOpenClose: mt,
|
|
1170
|
+
toggleQuickReply: be,
|
|
1171
|
+
updateTickets: ht,
|
|
1161
1172
|
// Simulate Guest Reply methods (test environments only)
|
|
1162
|
-
simulateGuestReply:
|
|
1163
|
-
toggleSimulateOpen:
|
|
1173
|
+
simulateGuestReply: vt,
|
|
1174
|
+
toggleSimulateOpen: pt
|
|
1164
1175
|
};
|
|
1165
1176
|
}
|
|
1166
1177
|
});
|
|
1167
1178
|
export {
|
|
1168
|
-
|
|
1179
|
+
Yt as default
|
|
1169
1180
|
};
|