@quoreadmin/ui 1.7.16 → 1.7.18
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/index131.js +151 -90
- package/dist/index140.js +291 -281
- package/dist/index185.js +7 -7
- package/dist/index191.js +23 -23
- package/dist/index192.js +1 -1
- package/dist/index193.js +1 -1
- package/dist/index196.js +2 -2
- package/dist/index198.js +14 -14
- package/dist/index199.js +1 -1
- package/dist/index200.js +1 -1
- package/dist/index201.js +3 -3
- package/dist/index202.js +6 -6
- package/dist/index203.js +2 -2
- package/dist/index204.js +2 -2
- package/dist/index205.js +1 -1
- package/dist/index220.js +1 -1
- package/dist/index224.js +1 -1
- package/dist/index226.js +1 -1
- package/dist/index232.js +105 -231
- package/dist/index233.js +38 -8
- package/dist/index234.js +78 -136
- package/dist/index235.js +20 -83
- package/dist/index236.js +20 -3632
- package/dist/index237.js +20 -55
- package/dist/index238.js +20 -77
- package/dist/index239.js +22 -52
- package/dist/index240.js +22 -215
- package/dist/index241.js +20 -10
- package/dist/index242.js +827 -48
- package/dist/index243.js +691 -50
- package/dist/index244.js +174 -52
- package/dist/index245.js +22 -75
- package/dist/index246.js +19 -722
- package/dist/index247.js +20 -39
- package/dist/index248.js +3 -64
- package/dist/index249.js +187 -11
- package/dist/index250.js +124 -696
- package/dist/index251.js +1189 -786
- package/dist/index252.js +19 -126
- package/dist/index253.js +21 -37
- package/dist/index254.js +22 -80
- package/dist/index255.js +22 -13
- package/dist/index256.js +12 -12
- package/dist/index257.js +9 -9
- package/dist/index258.js +2 -20
- package/dist/index259.js +2 -22
- package/dist/index260.js +3632 -22
- package/dist/index261.js +55 -20
- package/dist/index262.js +64 -823
- package/dist/index263.js +43 -693
- package/dist/index264.js +204 -165
- package/dist/index265.js +10 -22
- package/dist/index266.js +57 -20
- package/dist/index267.js +61 -20
- package/dist/index268.js +54 -3
- package/dist/index269.js +69 -181
- package/dist/index270.js +710 -120
- package/dist/index271.js +33 -1217
- package/dist/index272.js +64 -20
- package/dist/index273.js +11 -22
- package/dist/index274.js +705 -22
- package/dist/index275.js +820 -29
- package/dist/index276.js +253 -20
- package/dist/index277.js +8 -20
- package/dist/index278.js +138 -2
- package/dist/index279.js +83 -2
- package/dist/index280.js +1 -1
- package/dist/index285.js +1 -1
- package/dist/index286.js +1 -1
- package/dist/index287.js +1 -1
- package/dist/index288.js +137 -110
- package/dist/index290.js +62 -56
- package/dist/index291.js +31 -26
- package/dist/index294.js +15 -8
- package/dist/index297.js +1 -1
- package/dist/index299.js +36 -37
- package/dist/index305.js +2 -1518
- package/dist/index306.js +1478 -346
- package/dist/index307.js +330 -2675
- package/dist/index308.js +2717 -72
- package/dist/index309.js +75 -3759
- package/dist/index310.js +3758 -48
- package/dist/index311.js +60 -15
- package/dist/index312.js +76 -81
- package/dist/index313.js +22 -202
- package/dist/index314.js +915 -226
- package/dist/index315.js +22 -2
- package/dist/index316.js +19 -78
- package/dist/index317.js +13 -15
- package/dist/index318.js +64 -930
- package/dist/index319.js +18 -21
- package/dist/index320.js +19 -20
- package/dist/index321.js +12 -10
- package/dist/index322.js +21 -68
- package/dist/index323.js +60 -16
- package/dist/index324.js +15 -19
- package/dist/index325.js +83 -21
- package/dist/index326.js +202 -22
- package/dist/index327.js +246 -63
- package/dist/index330.js +1 -1
- package/dist/index331.js +12 -14
- package/dist/index332.js +1 -0
- package/dist/index336.js +4 -3
- package/dist/index342.js +27 -27
- package/dist/index345.js +1 -1
- package/dist/index346.js +1 -1
- package/dist/index372.js +1 -1
- package/dist/index380.js +1 -1
- package/dist/index382.js +16 -100
- package/dist/index383.js +100 -90
- package/dist/index384.js +91 -98
- package/dist/index385.js +97 -16
- package/dist/index43.js +160 -158
- package/dist/src/components/comment/comment.d.ts +27 -0
- package/dist/src/components/comment/comment.stories.d.ts +27 -0
- package/dist/src/components/comment-section/comment-section.d.ts +27 -0
- package/dist/src/components/comment-section/comment-section.stories.d.ts +27 -0
- package/dist/src/components/data-filter/data-filter.d.ts +27 -0
- package/dist/src/components/data-list/data-list.d.ts +27 -0
- package/dist/src/components/grid/grid.stories.d.ts +54 -0
- package/dist/src/components/popover/popover.d.ts +37 -0
- package/dist/src/components/popover/popover.stories.d.ts +189 -0
- package/dist/src/components/room-details-popover/room-details-popover.d.ts +60 -2
- package/dist/src/views/lists.vue.d.ts +54 -0
- package/dist/src/views/tables.vue.d.ts +27 -0
- 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 ct, ref as i, computed as _, watch as B, onMounted as dt, onUnmounted as mt } from "vue";
|
|
2
|
+
import { useI18n as vt } from "vue-i18n";
|
|
3
3
|
import { DateTime as w } from "./index164.js";
|
|
4
4
|
import "./index187.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
5
|
+
import pt from "./index2.js";
|
|
6
|
+
import ft from "./index3.js";
|
|
7
|
+
import ht from "./index4.js";
|
|
8
|
+
import yt from "./index21.js";
|
|
9
|
+
import gt from "./index28.js";
|
|
10
|
+
import _t from "./index39.js";
|
|
11
|
+
import wt from "./index20.js";
|
|
12
|
+
import It from "./index46.js";
|
|
13
|
+
import Dt from "./index47.js";
|
|
14
|
+
import Tt from "./index49.js";
|
|
15
15
|
import K from "./index188.js";
|
|
16
|
-
const
|
|
16
|
+
const Ft = ct({
|
|
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: pt,
|
|
20
|
+
QActivityItem: ft,
|
|
21
|
+
QAvatar: ht,
|
|
22
|
+
QDatePicker: wt,
|
|
23
|
+
QDivider: yt,
|
|
24
|
+
QIcon: gt,
|
|
25
|
+
QPopover: _t,
|
|
26
|
+
QTag: It,
|
|
27
|
+
QTextarea: Dt,
|
|
28
|
+
QTooltip: Tt
|
|
29
29
|
},
|
|
30
30
|
props: {
|
|
31
31
|
id: {
|
|
@@ -142,22 +142,37 @@ const Gt = mt({
|
|
|
142
142
|
teleportTo: {
|
|
143
143
|
type: String,
|
|
144
144
|
default: "body"
|
|
145
|
+
},
|
|
146
|
+
/** Whether to close the popover when the trigger scrolls out of its scrollable parent */
|
|
147
|
+
closeOnScrollOutOfView: {
|
|
148
|
+
type: Boolean,
|
|
149
|
+
default: !1
|
|
150
|
+
},
|
|
151
|
+
/** Whether to scroll the page to bring the popover into view when it opens or content changes */
|
|
152
|
+
scrollIntoView: {
|
|
153
|
+
type: Boolean,
|
|
154
|
+
default: !1
|
|
155
|
+
},
|
|
156
|
+
/** Padding (in pixels) from viewport edge when scrolling popover into view */
|
|
157
|
+
scrollIntoViewPadding: {
|
|
158
|
+
type: Number,
|
|
159
|
+
default: 20
|
|
145
160
|
}
|
|
146
161
|
},
|
|
147
162
|
emits: ["create:callback", "create:todo", "refresh:pms", "show:toast", "toggle"],
|
|
148
163
|
setup(o, { emit: h }) {
|
|
149
|
-
const { t:
|
|
164
|
+
const { t: c } = vt(), l = i(null), ie = i(!1), ue = i("left"), X = i([
|
|
150
165
|
{
|
|
151
166
|
id: 1,
|
|
152
|
-
label:
|
|
167
|
+
label: c("HC_DEPARTMENT")
|
|
153
168
|
},
|
|
154
169
|
{
|
|
155
170
|
id: 2,
|
|
156
|
-
label:
|
|
171
|
+
label: c("HC_PERSON")
|
|
157
172
|
},
|
|
158
173
|
{
|
|
159
174
|
id: 0,
|
|
160
|
-
label:
|
|
175
|
+
label: c("HC_ANYONE")
|
|
161
176
|
}
|
|
162
177
|
]), b = i(""), p = i({
|
|
163
178
|
checkInDate: /* @__PURE__ */ new Date(),
|
|
@@ -167,15 +182,15 @@ const Gt = mt({
|
|
|
167
182
|
guestMood: null,
|
|
168
183
|
guestName: "",
|
|
169
184
|
guestPhone: "",
|
|
170
|
-
inHouse: !!
|
|
185
|
+
inHouse: !!l.value?.tokenId || !1,
|
|
171
186
|
problem: null,
|
|
172
187
|
notes: "",
|
|
173
|
-
tokenId:
|
|
174
|
-
}), G = i(250), U = i(290), M = i([]),
|
|
188
|
+
tokenId: l.value?.tokenId
|
|
189
|
+
}), G = i(250), U = i(290), M = i([]), we = i([]), Z = i(!0), ee = i(!0), N = i({
|
|
175
190
|
info: !0,
|
|
176
191
|
tickets: !0,
|
|
177
192
|
comments: !0
|
|
178
|
-
}), te = i(!0),
|
|
193
|
+
}), te = i(!0), be = i(o.guestDetails), O = i([]), y = i({
|
|
179
194
|
actionItems: !1,
|
|
180
195
|
conversationToggle: !1,
|
|
181
196
|
messages: !1,
|
|
@@ -183,7 +198,7 @@ const Gt = mt({
|
|
|
183
198
|
roomNotices: !1,
|
|
184
199
|
sendingMessage: !1,
|
|
185
200
|
tickets: !1
|
|
186
|
-
}), C = i([]), ce = i([]), de = i("bottom"), R = i(null), H = i(!1), W = i(!1), j = i(""), me = i(!1), A = i(!1), k = i(null),
|
|
201
|
+
}), C = i([]), ce = i([]), de = i("bottom"), R = i(null), H = i(!1), W = i(!1), j = i(""), me = i(!1), A = i(!1), k = i(null), Q = i(null), Ce = 3e4, d = i({
|
|
187
202
|
assignType: null,
|
|
188
203
|
department: null,
|
|
189
204
|
due: /* @__PURE__ */ new Date(),
|
|
@@ -193,35 +208,35 @@ const Gt = mt({
|
|
|
193
208
|
requestedBy: null,
|
|
194
209
|
when: null,
|
|
195
210
|
where: null
|
|
196
|
-
}),
|
|
211
|
+
}), $ = i([
|
|
197
212
|
{
|
|
198
213
|
id: 0,
|
|
199
|
-
label:
|
|
214
|
+
label: c("HC_STAFF_MEMBER")
|
|
200
215
|
},
|
|
201
216
|
{
|
|
202
217
|
id: 1,
|
|
203
|
-
label:
|
|
218
|
+
label: c("HC_HOTEL_GUEST")
|
|
204
219
|
}
|
|
205
220
|
]), ve = i(!1), E = i(null), I = i({
|
|
206
221
|
endDate: /* @__PURE__ */ new Date(),
|
|
207
222
|
issue: null,
|
|
208
223
|
notes: "",
|
|
209
224
|
startDate: /* @__PURE__ */ new Date()
|
|
210
|
-
}), ae = i([]), se = i(!1), S = i([]), L = i([]),
|
|
225
|
+
}), ae = i([]), se = i(!1), S = i([]), L = i([]), Me = i([
|
|
211
226
|
{
|
|
212
|
-
label:
|
|
227
|
+
label: c("HC_COMPLAINT"),
|
|
213
228
|
id: "complaint"
|
|
214
229
|
},
|
|
215
230
|
{
|
|
216
|
-
label:
|
|
231
|
+
label: c("HC_REQUEST"),
|
|
217
232
|
id: "request"
|
|
218
233
|
},
|
|
219
234
|
{
|
|
220
|
-
label:
|
|
235
|
+
label: c("HC_ROOM_NOTICE"),
|
|
221
236
|
id: "room_notice"
|
|
222
237
|
},
|
|
223
238
|
{
|
|
224
|
-
label:
|
|
239
|
+
label: c("HC_WORK_ORDER"),
|
|
225
240
|
id: "work_order"
|
|
226
241
|
}
|
|
227
242
|
]), J = i(), P = i(null), v = i({
|
|
@@ -233,8 +248,8 @@ const Gt = mt({
|
|
|
233
248
|
notes: "",
|
|
234
249
|
person: null,
|
|
235
250
|
requestedBy: null
|
|
236
|
-
}), pe = i([]), q = i([]), x = i([]),
|
|
237
|
-
switch (
|
|
251
|
+
}), pe = i([]), q = i([]), x = i([]), Ne = _(() => {
|
|
252
|
+
switch (l.value.cleaning?.name || l.value.cleaningStatus) {
|
|
238
253
|
case "CLEAN":
|
|
239
254
|
case "INSPECTED":
|
|
240
255
|
return "CLEAN";
|
|
@@ -246,13 +261,10 @@ const Gt = mt({
|
|
|
246
261
|
default:
|
|
247
262
|
return "";
|
|
248
263
|
}
|
|
249
|
-
}), Re =
|
|
250
|
-
const e = r.value.cleaning?.name || r.value.cleaningStatus;
|
|
251
|
-
return e ? u(`HC_${e}`) : "";
|
|
252
|
-
}), Le = y(() => {
|
|
264
|
+
}), Re = _(() => {
|
|
253
265
|
const e = b.value.toLowerCase();
|
|
254
266
|
return o.quickReplies.filter((t) => t.toLowerCase().match(e));
|
|
255
|
-
}),
|
|
267
|
+
}), He = _(() => {
|
|
256
268
|
if (!C.value.length) return [];
|
|
257
269
|
const e = [];
|
|
258
270
|
let t = null;
|
|
@@ -272,11 +284,11 @@ const Gt = mt({
|
|
|
272
284
|
formattedTime: s.toFormat("h:mma").replace("AM", "am").replace("PM", "pm")
|
|
273
285
|
});
|
|
274
286
|
}), e;
|
|
275
|
-
}),
|
|
287
|
+
}), Ie = _(() => S.value.length ? !!S.value.find(
|
|
276
288
|
(t) => t.type === "complaint"
|
|
277
|
-
) : !1),
|
|
289
|
+
) : !1), Le = _(() => S.value.length ? !!S.value.find(
|
|
278
290
|
(t) => t.type === "callback"
|
|
279
|
-
) : !1),
|
|
291
|
+
) : !1), Pe = _(() => {
|
|
280
292
|
let e = [];
|
|
281
293
|
return O.value[0] && O.value[0].options === void 0 ? O.value.forEach((t) => {
|
|
282
294
|
e.push({
|
|
@@ -284,7 +296,7 @@ const Gt = mt({
|
|
|
284
296
|
label: t.display_name
|
|
285
297
|
});
|
|
286
298
|
}) : e = O.value, e;
|
|
287
|
-
}),
|
|
299
|
+
}), De = _(() => l.value.occupancy?.name === "OCCUPIED" || l.value.occupancyStatus === "OCCUPIED"), qe = _(() => De.value && Ie.value ? "HK_ROOM_STATUS_Occupied_Complaint" : "HK_ROOM_STATUS_Occupied"), xe = _(() => {
|
|
288
300
|
switch (E.value?.id) {
|
|
289
301
|
case "request":
|
|
290
302
|
case "work_order":
|
|
@@ -292,7 +304,7 @@ const Gt = mt({
|
|
|
292
304
|
default:
|
|
293
305
|
return null;
|
|
294
306
|
}
|
|
295
|
-
}),
|
|
307
|
+
}), Fe = _(() => {
|
|
296
308
|
if (M.value)
|
|
297
309
|
switch (E.value?.id) {
|
|
298
310
|
case "request":
|
|
@@ -303,30 +315,30 @@ const Gt = mt({
|
|
|
303
315
|
return null;
|
|
304
316
|
}
|
|
305
317
|
return null;
|
|
306
|
-
}),
|
|
318
|
+
}), Be = _(() => {
|
|
307
319
|
switch (E.value?.id) {
|
|
308
320
|
case "request":
|
|
309
|
-
return
|
|
321
|
+
return $.value[1];
|
|
310
322
|
case "work_order":
|
|
311
|
-
return
|
|
323
|
+
return $.value[0];
|
|
312
324
|
default:
|
|
313
325
|
return null;
|
|
314
326
|
}
|
|
315
|
-
}),
|
|
327
|
+
}), Ge = _(() => {
|
|
316
328
|
let e = "";
|
|
317
|
-
if (
|
|
329
|
+
if (l.value && l.value.reservations[0]) {
|
|
318
330
|
const t = w.fromISO(
|
|
319
|
-
|
|
320
|
-
), a = t.toFormat("MMM"), s = t.day, n = t.year,
|
|
321
|
-
|
|
322
|
-
),
|
|
323
|
-
e += a + " " + s, n !== f && (e += ", " + n), a ===
|
|
331
|
+
l.value.reservations[0].arrivalDate
|
|
332
|
+
), a = t.toFormat("MMM"), s = t.day, n = t.year, r = w.fromISO(
|
|
333
|
+
l.value.reservations[0].departureDate
|
|
334
|
+
), u = r.toFormat("MMM"), m = r.day, f = r.year;
|
|
335
|
+
e += a + " " + s, n !== f && (e += ", " + n), a === u ? e += "-" + m : e += " - " + u + " " + m, e += ", " + f;
|
|
324
336
|
}
|
|
325
337
|
return e;
|
|
326
|
-
}),
|
|
338
|
+
}), Ue = _(() => {
|
|
327
339
|
let e = ae.value;
|
|
328
340
|
return e = [...new Set(e)], e;
|
|
329
|
-
}),
|
|
341
|
+
}), We = _(() => {
|
|
330
342
|
const e = E.value?.id;
|
|
331
343
|
if (!e)
|
|
332
344
|
return !1;
|
|
@@ -342,14 +354,14 @@ const Gt = mt({
|
|
|
342
354
|
default:
|
|
343
355
|
return !1;
|
|
344
356
|
}
|
|
345
|
-
}),
|
|
357
|
+
}), Te = () => {
|
|
346
358
|
se.value = !1, H.value = !1, ie.value = !1, ve.value = !1, O.value = [], ce.value = [], pe.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;
|
|
347
|
-
},
|
|
348
|
-
h("create:callback",
|
|
359
|
+
}, je = async () => {
|
|
360
|
+
h("create:callback", l.value), h("toggle", !1);
|
|
349
361
|
}, F = (e) => {
|
|
350
362
|
const t = [];
|
|
351
363
|
(Array.isArray(e) ? e : Object.values(e)).forEach((s) => {
|
|
352
|
-
const n = s.senderType || s.sender_type,
|
|
364
|
+
const n = s.senderType || s.sender_type, r = s.senderName || "", u = s.senderId || s.sender_id, m = s.profileImg || s.profile_img, f = r ? r.split(" ") : ["", ""], g = s.user_first_name || s.guest_first_name || f[0] || "", z = s.user_last_name || s.guest_last_name || f.slice(1).join(" ") || "", re = g && z ? `${g} ${z}` : g || "Auto-Reply", le = n === "system" || n === "user", D = n === "guest";
|
|
353
365
|
let T = {
|
|
354
366
|
id: s.id,
|
|
355
367
|
isPropertyEmployee: n === "user",
|
|
@@ -360,9 +372,9 @@ const Gt = mt({
|
|
|
360
372
|
comment: s.content,
|
|
361
373
|
dateUtc: s.sent || s.created,
|
|
362
374
|
user: {
|
|
363
|
-
firstName:
|
|
375
|
+
firstName: g || "Auto-Reply",
|
|
364
376
|
icon: "",
|
|
365
|
-
id:
|
|
377
|
+
id: u || "system-message",
|
|
366
378
|
initials: "",
|
|
367
379
|
lastName: z || "",
|
|
368
380
|
name: re,
|
|
@@ -371,12 +383,12 @@ const Gt = mt({
|
|
|
371
383
|
};
|
|
372
384
|
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"), t.push(T);
|
|
373
385
|
}), C.value = t;
|
|
374
|
-
},
|
|
386
|
+
}, Qe = (e) => {
|
|
375
387
|
if (!e || e.length === 0) return;
|
|
376
388
|
(Array.isArray(e) ? e : Object.values(e)).forEach((a) => {
|
|
377
389
|
if (C.value.some((T) => T.id === a.id))
|
|
378
390
|
return;
|
|
379
|
-
const s = a.senderType || a.sender_type, n = a.senderName || "",
|
|
391
|
+
const s = a.senderType || a.sender_type, n = a.senderName || "", r = a.senderId || a.sender_id, u = a.profileImg || a.profile_img, m = n ? n.split(" ") : ["", ""], f = a.user_first_name || a.guest_first_name || m[0] || "", g = a.user_last_name || a.guest_last_name || m.slice(1).join(" ") || "", z = f && g ? `${f} ${g}` : f || "Auto-Reply", re = s === "system" || s === "user", le = s === "guest";
|
|
380
392
|
let D = {
|
|
381
393
|
id: a.id,
|
|
382
394
|
isPropertyEmployee: s === "user",
|
|
@@ -389,20 +401,20 @@ const Gt = mt({
|
|
|
389
401
|
user: {
|
|
390
402
|
firstName: f || "Auto-Reply",
|
|
391
403
|
icon: "",
|
|
392
|
-
id:
|
|
404
|
+
id: r || "system-message",
|
|
393
405
|
initials: "",
|
|
394
|
-
lastName:
|
|
406
|
+
lastName: g || "",
|
|
395
407
|
name: z,
|
|
396
|
-
src:
|
|
408
|
+
src: u || ""
|
|
397
409
|
}
|
|
398
410
|
};
|
|
399
411
|
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]), re && (D.user.icon = "property-fill"), C.value.push(D);
|
|
400
412
|
});
|
|
401
|
-
},
|
|
402
|
-
if (o.showComments &&
|
|
403
|
-
e || (
|
|
413
|
+
}, fe = async (e = !1) => {
|
|
414
|
+
if (o.showComments && l.value.tokenId) {
|
|
415
|
+
e || (y.value.messages = !0);
|
|
404
416
|
try {
|
|
405
|
-
let t = `/api/client/connect/getMessages.php?tokenId=${
|
|
417
|
+
let t = `/api/client/connect/getMessages.php?tokenId=${l.value.tokenId}`;
|
|
406
418
|
e && k.value !== null && (t += `&lastMsgId=${k.value}`);
|
|
407
419
|
const s = await (await fetch(t, {
|
|
408
420
|
method: "GET",
|
|
@@ -411,17 +423,17 @@ const Gt = mt({
|
|
|
411
423
|
if (s.status === "error")
|
|
412
424
|
throw new Error(s.message || "Failed to get messages");
|
|
413
425
|
if (A.value = !s.closed, s.messages && s.messages.length > 0) {
|
|
414
|
-
k.value = s.messages[s.messages.length - 1].id, e ?
|
|
415
|
-
const n = setTimeout(
|
|
426
|
+
k.value = s.messages[s.messages.length - 1].id, e ? Qe(s.messages) : F(s.messages);
|
|
427
|
+
const n = setTimeout(Y, 100);
|
|
416
428
|
L.value.push(n);
|
|
417
429
|
} else e || F(s.messages || []);
|
|
418
430
|
} catch (t) {
|
|
419
431
|
console.error("getChatMessages error:", t);
|
|
420
432
|
} finally {
|
|
421
|
-
e || (
|
|
433
|
+
e || (y.value.messages = !1);
|
|
422
434
|
}
|
|
423
435
|
}
|
|
424
|
-
},
|
|
436
|
+
}, $e = (e) => {
|
|
425
437
|
const t = w.utc(), a = w.fromFormat(e, "yyyy-MM-dd HH:mm:ss", { zone: "utc" }), s = t.diff(
|
|
426
438
|
a,
|
|
427
439
|
[
|
|
@@ -431,24 +443,24 @@ const Gt = mt({
|
|
|
431
443
|
"hours",
|
|
432
444
|
"minutes"
|
|
433
445
|
]
|
|
434
|
-
), n = Math.floor(s.years),
|
|
446
|
+
), n = Math.floor(s.years), r = Math.floor(s.months), u = Math.floor(s.days), m = Math.floor(s.hours), f = Math.floor(s.minutes);
|
|
435
447
|
if (n)
|
|
436
|
-
return n === 1 ?
|
|
437
|
-
if (
|
|
438
|
-
return
|
|
439
|
-
if (
|
|
440
|
-
return
|
|
448
|
+
return n === 1 ? c("HC_ONE_YEAR_AGO") : c("HC_X_YEARS_AGO", { years: n });
|
|
449
|
+
if (r)
|
|
450
|
+
return r === 1 ? c("HC_ONE_MONTH_AGO") : c("HC_X_MONTHS_AGO", { months: r });
|
|
451
|
+
if (u)
|
|
452
|
+
return u === 1 ? c("HC_ONE_DAY_AGO") : c("HC_X_DAYS_AGO", { days: u });
|
|
441
453
|
if (m)
|
|
442
|
-
return m === 1 ?
|
|
454
|
+
return m === 1 ? c("HC_ONE_HOUR_AGO") : c("HC_X_HOURS_AGO", { hours: m });
|
|
443
455
|
if (f)
|
|
444
|
-
return f === 1 ?
|
|
456
|
+
return f === 1 ? c("HC_ONE_MINUTE_AGO") : c("HC_X_MINUTES_AGO", { minutes: f });
|
|
445
457
|
if (f === 0)
|
|
446
|
-
return
|
|
447
|
-
},
|
|
448
|
-
o.showGuestDetails && oe(), ne(),
|
|
458
|
+
return c("HC_A_MOMENT_AGO");
|
|
459
|
+
}, Je = async () => {
|
|
460
|
+
o.showGuestDetails && oe(), ne(), V(), h("refresh:pms", l.value);
|
|
449
461
|
}, oe = async () => {
|
|
450
462
|
try {
|
|
451
|
-
|
|
463
|
+
y.value.pms = !0;
|
|
452
464
|
const e = new AbortController(), t = setTimeout(() => e.abort(), 45e3);
|
|
453
465
|
L.value.push(t);
|
|
454
466
|
const a = o.pmsBaseUrl;
|
|
@@ -456,11 +468,11 @@ const Gt = mt({
|
|
|
456
468
|
throw new Error("PMS base URL is required");
|
|
457
469
|
const s = {
|
|
458
470
|
Authorization: "Bearer " + (() => {
|
|
459
|
-
const
|
|
460
|
-
return
|
|
471
|
+
const g = `; ${document.cookie}`.split("; QV2Auth=");
|
|
472
|
+
return g.length === 2 && g.pop()?.split(";").shift() || "";
|
|
461
473
|
})(),
|
|
462
474
|
"Content-Type": "application/json"
|
|
463
|
-
}, n =
|
|
475
|
+
}, n = l.value?.qv2Rooms?.qRoomId || l.value?.id || o.room.id, r = await fetch(
|
|
464
476
|
`${a}/vendors/properties/statuses/${o.propertyId}/rooms`,
|
|
465
477
|
{
|
|
466
478
|
method: "POST",
|
|
@@ -469,23 +481,23 @@ const Gt = mt({
|
|
|
469
481
|
body: JSON.stringify({ roomsIds: [n] })
|
|
470
482
|
}
|
|
471
483
|
);
|
|
472
|
-
clearTimeout(t),
|
|
473
|
-
const
|
|
474
|
-
R.value = m, m.length > 0 ?
|
|
484
|
+
clearTimeout(t), r.ok || ke(r);
|
|
485
|
+
const u = await r.json(), m = u.data?.pmsRooms || u.data?.rooms || u.rooms || [];
|
|
486
|
+
R.value = m, m.length > 0 ? l.value = {
|
|
475
487
|
...m[0],
|
|
476
488
|
tokenId: m[0].tokenId || o.room.tokenId
|
|
477
|
-
} :
|
|
489
|
+
} : l.value = o.room, y.value.pms = !1;
|
|
478
490
|
} catch (e) {
|
|
479
|
-
return
|
|
491
|
+
return y.value.pms = !1, h("show:toast", {
|
|
480
492
|
show: !0,
|
|
481
|
-
message:
|
|
493
|
+
message: c("HC_FAILED_TO_LOAD_PMS_DATA"),
|
|
482
494
|
variant: "error",
|
|
483
495
|
icon: "exclamation-circle"
|
|
484
496
|
}), e;
|
|
485
497
|
}
|
|
486
498
|
}, ne = async () => {
|
|
487
499
|
try {
|
|
488
|
-
|
|
500
|
+
y.value.roomNotices = !0;
|
|
489
501
|
const e = await fetch(
|
|
490
502
|
"/api/client/common/getRoomNotices.php?propertyId=" + o.propertyId + "&roomIds=[" + o.room.id + "]"
|
|
491
503
|
);
|
|
@@ -496,14 +508,14 @@ const Gt = mt({
|
|
|
496
508
|
} catch (e) {
|
|
497
509
|
console.error("Error getting room notices:", e), ae.value = [], h("show:toast", {
|
|
498
510
|
show: !0,
|
|
499
|
-
message:
|
|
511
|
+
message: c("HC_FAILED_TO_LOAD_ROOM_NOTICES"),
|
|
500
512
|
variant: "error",
|
|
501
513
|
icon: "exclamation-circle"
|
|
502
514
|
});
|
|
503
515
|
} finally {
|
|
504
|
-
|
|
516
|
+
y.value.roomNotices = !1;
|
|
505
517
|
}
|
|
506
|
-
},
|
|
518
|
+
}, he = async () => {
|
|
507
519
|
try {
|
|
508
520
|
const e = new FormData();
|
|
509
521
|
e.append("property_id", o.propertyId), e.append("filter", "tasks_new");
|
|
@@ -516,30 +528,30 @@ const Gt = mt({
|
|
|
516
528
|
body: e
|
|
517
529
|
})
|
|
518
530
|
]), s = await t.json(), n = await a.json();
|
|
519
|
-
if (s.departments && (s.departments.forEach((
|
|
520
|
-
|
|
531
|
+
if (s.departments && (s.departments.forEach((r) => {
|
|
532
|
+
r.label = r.display_name;
|
|
521
533
|
}), M.value = s.departments), n.users) {
|
|
522
|
-
const
|
|
523
|
-
let
|
|
534
|
+
const r = [];
|
|
535
|
+
let u = {
|
|
524
536
|
group: "",
|
|
525
537
|
options: []
|
|
526
538
|
};
|
|
527
539
|
n.users.forEach((m) => {
|
|
528
|
-
m.translated_department !==
|
|
529
|
-
}),
|
|
540
|
+
m.translated_department !== u.group && (u.group && r.push({ ...u }), u.group = m.translated_department, u.options = []), u.options.push(m);
|
|
541
|
+
}), u.group && r.push({ ...u }), we.value = r;
|
|
530
542
|
}
|
|
531
543
|
} catch (e) {
|
|
532
544
|
console.error("Error getting shared data:", e), h("show:toast", {
|
|
533
545
|
show: !0,
|
|
534
|
-
message:
|
|
546
|
+
message: c("HC_FAILED_TO_LOAD_SHARED_DATA"),
|
|
535
547
|
variant: "error",
|
|
536
548
|
icon: "exclamation-circle"
|
|
537
549
|
});
|
|
538
550
|
}
|
|
539
|
-
},
|
|
551
|
+
}, Oe = async () => {
|
|
540
552
|
try {
|
|
541
553
|
const t = await (await fetch(
|
|
542
|
-
`/api/client/connect/getStayDetails.php?tokenId=${
|
|
554
|
+
`/api/client/connect/getStayDetails.php?tokenId=${l.value.tokenId}`,
|
|
543
555
|
{
|
|
544
556
|
method: "GET",
|
|
545
557
|
credentials: "include"
|
|
@@ -555,12 +567,12 @@ const Gt = mt({
|
|
|
555
567
|
} catch (e) {
|
|
556
568
|
console.error("getStayDetails error:", e), h("show:toast", {
|
|
557
569
|
show: !0,
|
|
558
|
-
message:
|
|
570
|
+
message: c("HC_FAILED_TO_LOAD_STAY_DETAILS"),
|
|
559
571
|
variant: "error",
|
|
560
572
|
icon: "exclamation-circle"
|
|
561
573
|
});
|
|
562
574
|
}
|
|
563
|
-
},
|
|
575
|
+
}, Ve = (e) => {
|
|
564
576
|
switch (e) {
|
|
565
577
|
case "complaint":
|
|
566
578
|
return "red-30";
|
|
@@ -573,7 +585,7 @@ const Gt = mt({
|
|
|
573
585
|
case "task":
|
|
574
586
|
return "green-20";
|
|
575
587
|
}
|
|
576
|
-
},
|
|
588
|
+
}, Ye = (e) => {
|
|
577
589
|
switch (e) {
|
|
578
590
|
case "complaint":
|
|
579
591
|
return "face-frown";
|
|
@@ -586,9 +598,9 @@ const Gt = mt({
|
|
|
586
598
|
case "task":
|
|
587
599
|
return "check";
|
|
588
600
|
}
|
|
589
|
-
},
|
|
601
|
+
}, V = async () => {
|
|
590
602
|
try {
|
|
591
|
-
|
|
603
|
+
y.value.tickets = !0;
|
|
592
604
|
const e = await fetch(
|
|
593
605
|
"/api/client/common/getAllToDos.php?propertyId=" + o.propertyId + "&roomIds=[" + o.room.id + "]"
|
|
594
606
|
);
|
|
@@ -599,14 +611,14 @@ const Gt = mt({
|
|
|
599
611
|
} catch (e) {
|
|
600
612
|
console.error("Error getting tickets:", e), S.value = [], h("show:toast", {
|
|
601
613
|
show: !0,
|
|
602
|
-
message:
|
|
614
|
+
message: c("HC_FAILED_TO_LOAD_TICKETS"),
|
|
603
615
|
variant: "error",
|
|
604
616
|
icon: "exclamation-circle"
|
|
605
617
|
});
|
|
606
618
|
} finally {
|
|
607
|
-
|
|
619
|
+
y.value.tickets = !1;
|
|
608
620
|
}
|
|
609
|
-
},
|
|
621
|
+
}, ke = async (e) => {
|
|
610
622
|
const t = await e.text();
|
|
611
623
|
let a;
|
|
612
624
|
try {
|
|
@@ -615,10 +627,10 @@ const Gt = mt({
|
|
|
615
627
|
a = { code: e.status, message: t };
|
|
616
628
|
}
|
|
617
629
|
return a.code === 401 ? (window.location.href = "/logout.php?unauthorized=1", { error: a }) : a;
|
|
618
|
-
},
|
|
630
|
+
}, ze = (e) => {
|
|
619
631
|
const t = document.querySelectorAll(".pulse");
|
|
620
632
|
if (t && t.length) {
|
|
621
|
-
const a =
|
|
633
|
+
const a = l.value?.qv2Rooms?.qRoomId || l.value?.id || o.room?.id, s = document.getElementById("room-" + a), n = s?.classList;
|
|
622
634
|
switch (e) {
|
|
623
635
|
case "room_notice":
|
|
624
636
|
(n?.contains("roombox_unsel") || n?.contains("roombox_unsel_active")) && (s?.classList.remove(), s?.classList.add("roomnoticeroombox_sel"));
|
|
@@ -633,16 +645,16 @@ const Gt = mt({
|
|
|
633
645
|
!n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && !n?.contains("complaintsroombox_sel") && !n?.contains("guestrequestroombox_sel") && (s?.classList.remove(), s?.classList.add("workordersroombox_sel"));
|
|
634
646
|
break;
|
|
635
647
|
}
|
|
636
|
-
const
|
|
637
|
-
t.forEach((
|
|
638
|
-
|
|
648
|
+
const r = setTimeout(() => {
|
|
649
|
+
t.forEach((u) => {
|
|
650
|
+
u.classList.remove("pulse");
|
|
639
651
|
});
|
|
640
652
|
}, 4500);
|
|
641
|
-
L.value.push(
|
|
653
|
+
L.value.push(r);
|
|
642
654
|
}
|
|
643
|
-
},
|
|
655
|
+
}, Ke = () => {
|
|
644
656
|
window.open("/guest/overview.php", "_blank");
|
|
645
|
-
},
|
|
657
|
+
}, Xe = (e) => {
|
|
646
658
|
let t = "";
|
|
647
659
|
switch (e.type) {
|
|
648
660
|
case "complaint":
|
|
@@ -664,9 +676,9 @@ const Gt = mt({
|
|
|
664
676
|
return "#";
|
|
665
677
|
}
|
|
666
678
|
window.open(t, "_blank");
|
|
667
|
-
},
|
|
679
|
+
}, Ze = async () => {
|
|
668
680
|
ve.value = !0;
|
|
669
|
-
const e =
|
|
681
|
+
const e = l.value?.qv2Rooms?.qRoomId || l.value?.id || o.room?.id, t = l.value?.qv2Rooms?.qRoomName || l.value?.name || o.room?.name, a = {
|
|
670
682
|
type: E.value?.id,
|
|
671
683
|
propertyId: o.propertyId,
|
|
672
684
|
userId: P.value,
|
|
@@ -675,7 +687,7 @@ const Gt = mt({
|
|
|
675
687
|
};
|
|
676
688
|
switch (E.value?.id) {
|
|
677
689
|
case "complaint":
|
|
678
|
-
a.tokenId =
|
|
690
|
+
a.tokenId = l.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(
|
|
679
691
|
"yyyy-MM-dd"
|
|
680
692
|
), a.checkOutDate = w.fromJSDate(p.value.checkOutDate).toFormat(
|
|
681
693
|
"yyyy-MM-dd"
|
|
@@ -691,41 +703,41 @@ const Gt = mt({
|
|
|
691
703
|
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), h("create:todo", a);
|
|
692
704
|
break;
|
|
693
705
|
}
|
|
694
|
-
},
|
|
695
|
-
|
|
696
|
-
},
|
|
697
|
-
|
|
698
|
-
},
|
|
706
|
+
}, et = (e) => {
|
|
707
|
+
ge(), _e(), o.hover && h("toggle", e);
|
|
708
|
+
}, tt = (e) => {
|
|
709
|
+
Se(), b.value = e;
|
|
710
|
+
}, at = async (e) => {
|
|
699
711
|
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) {
|
|
700
|
-
|
|
712
|
+
y.value.actionItems = !1;
|
|
701
713
|
return;
|
|
702
714
|
}
|
|
703
|
-
|
|
704
|
-
const t =
|
|
715
|
+
y.value.actionItems = !0;
|
|
716
|
+
const t = l.value?.qv2Rooms?.qRoomId || l.value?.id || o.room?.id, a = new FormData();
|
|
705
717
|
switch (a.append("property_id", o.propertyId), a.append("area_id", t), e.id) {
|
|
706
718
|
case "complaint":
|
|
707
719
|
try {
|
|
708
|
-
|
|
720
|
+
l.value.tokenId && await Oe();
|
|
709
721
|
const n = await (await fetch("/api/client/common/getComplaintProblemsByPropertyId.php", {
|
|
710
722
|
method: "POST",
|
|
711
723
|
body: a
|
|
712
724
|
})).json();
|
|
713
725
|
n.items && (O.value = n.items);
|
|
714
|
-
const
|
|
726
|
+
const r = await K.post(
|
|
715
727
|
"/api/client/common/getComplaintMoods.php"
|
|
716
728
|
);
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
}), ce.value =
|
|
729
|
+
r.data.items.forEach((u) => {
|
|
730
|
+
u.label = u.display_name;
|
|
731
|
+
}), ce.value = r.data.items;
|
|
720
732
|
} catch (s) {
|
|
721
733
|
console.error("Error loading complaint options:", s), h("show:toast", {
|
|
722
734
|
show: !0,
|
|
723
|
-
message:
|
|
735
|
+
message: c("HC_FAILED_TO_LOAD_COMPLAINT_OPTIONS"),
|
|
724
736
|
variant: "error",
|
|
725
737
|
icon: "exclamation-circle"
|
|
726
738
|
});
|
|
727
739
|
} finally {
|
|
728
|
-
|
|
740
|
+
y.value.actionItems = !1;
|
|
729
741
|
}
|
|
730
742
|
break;
|
|
731
743
|
case "room_notice":
|
|
@@ -738,32 +750,32 @@ const Gt = mt({
|
|
|
738
750
|
} catch (s) {
|
|
739
751
|
console.error("Error loading room notice options:", s), h("show:toast", {
|
|
740
752
|
show: !0,
|
|
741
|
-
message:
|
|
753
|
+
message: c("HC_FAILED_TO_LOAD_ROOM_NOTICE_OPTIONS"),
|
|
742
754
|
variant: "error",
|
|
743
755
|
icon: "exclamation-circle"
|
|
744
756
|
});
|
|
745
757
|
} finally {
|
|
746
|
-
|
|
758
|
+
y.value.actionItems = !1;
|
|
747
759
|
}
|
|
748
760
|
break;
|
|
749
761
|
case "request":
|
|
750
762
|
try {
|
|
751
|
-
d.value.requestedBy =
|
|
763
|
+
d.value.requestedBy = $.value[1], d.value.assignType = X.value[0];
|
|
752
764
|
const n = await (await fetch("/api/client/common/getHousekeepingItemsByPropertyId.php", {
|
|
753
765
|
method: "POST",
|
|
754
766
|
body: a
|
|
755
767
|
})).json();
|
|
756
|
-
if (n.items && (O.value = n.items), await
|
|
757
|
-
(
|
|
768
|
+
if (n.items && (O.value = n.items), await he(), d.value.department = M.value.find(
|
|
769
|
+
(r) => parseInt(r.id) === 4
|
|
758
770
|
), o.allowWhenWhere)
|
|
759
771
|
try {
|
|
760
|
-
const
|
|
761
|
-
|
|
772
|
+
const r = new FormData();
|
|
773
|
+
r.append("property_id", o.propertyId);
|
|
762
774
|
const m = await (await fetch(
|
|
763
775
|
"/api/client/common/getWhenWhereOptions.php",
|
|
764
776
|
{
|
|
765
777
|
method: "POST",
|
|
766
|
-
body:
|
|
778
|
+
body: r
|
|
767
779
|
}
|
|
768
780
|
)).json();
|
|
769
781
|
m.when && Array.isArray(m.when) ? q.value = m.when.map((f) => ({
|
|
@@ -775,10 +787,10 @@ const Gt = mt({
|
|
|
775
787
|
label: f.name,
|
|
776
788
|
value: f.id
|
|
777
789
|
})) : x.value = [];
|
|
778
|
-
} catch (
|
|
779
|
-
console.error("Error loading When/Where options:",
|
|
790
|
+
} catch (r) {
|
|
791
|
+
console.error("Error loading When/Where options:", r), q.value = [], x.value = [], h("show:toast", {
|
|
780
792
|
show: !0,
|
|
781
|
-
message:
|
|
793
|
+
message: c("HC_FAILED_TO_LOAD_WHEN_WHERE_OPTIONS"),
|
|
782
794
|
variant: "error",
|
|
783
795
|
icon: "exclamation-circle"
|
|
784
796
|
});
|
|
@@ -786,36 +798,36 @@ const Gt = mt({
|
|
|
786
798
|
} catch (s) {
|
|
787
799
|
console.error("Error loading request options:", s), h("show:toast", {
|
|
788
800
|
show: !0,
|
|
789
|
-
message:
|
|
801
|
+
message: c("HC_FAILED_TO_LOAD_REQUEST_OPTIONS"),
|
|
790
802
|
variant: "error",
|
|
791
803
|
icon: "exclamation-circle"
|
|
792
804
|
});
|
|
793
805
|
} finally {
|
|
794
|
-
|
|
806
|
+
y.value.actionItems = !1;
|
|
795
807
|
}
|
|
796
808
|
break;
|
|
797
809
|
case "work_order":
|
|
798
810
|
try {
|
|
799
|
-
v.value.requestedBy =
|
|
811
|
+
v.value.requestedBy = $.value[0], v.value.assignType = X.value[0];
|
|
800
812
|
const n = await (await fetch("/api/client/common/getItemsByRoomId.php", {
|
|
801
813
|
method: "POST",
|
|
802
814
|
body: a
|
|
803
|
-
})).json(),
|
|
804
|
-
let
|
|
815
|
+
})).json(), r = [];
|
|
816
|
+
let u = {
|
|
805
817
|
group: "",
|
|
806
818
|
options: []
|
|
807
819
|
};
|
|
808
820
|
n.items && (n.items.forEach((m) => {
|
|
809
|
-
m.section_name !==
|
|
810
|
-
}),
|
|
821
|
+
m.section_name !== u.group && (u.group && r.push({ ...u }), u.group = m.section_name, u.options = []), m.label && u.options.push(m);
|
|
822
|
+
}), u.group && r.push({ ...u })), O.value = r, await Promise.all([
|
|
811
823
|
K.post(
|
|
812
824
|
"/api/client/common/getWorkOrderIssues.php"
|
|
813
825
|
),
|
|
814
|
-
|
|
826
|
+
he()
|
|
815
827
|
]).then((m) => {
|
|
816
828
|
const f = m[0];
|
|
817
|
-
f.data.issues.forEach((
|
|
818
|
-
|
|
829
|
+
f.data.issues.forEach((g) => {
|
|
830
|
+
g.label = g.display_name;
|
|
819
831
|
}), pe.value = f.data.issues;
|
|
820
832
|
}), v.value.department = M.value.find(
|
|
821
833
|
(m) => parseInt(m.id) === 2
|
|
@@ -823,35 +835,35 @@ const Gt = mt({
|
|
|
823
835
|
} catch (s) {
|
|
824
836
|
console.error("Error loading work order options:", s), h("show:toast", {
|
|
825
837
|
show: !0,
|
|
826
|
-
message:
|
|
838
|
+
message: c("HC_FAILED_TO_LOAD_WORK_ORDER_OPTIONS"),
|
|
827
839
|
variant: "error",
|
|
828
840
|
icon: "exclamation-circle"
|
|
829
841
|
});
|
|
830
842
|
} finally {
|
|
831
|
-
|
|
843
|
+
y.value.actionItems = !1;
|
|
832
844
|
}
|
|
833
845
|
break;
|
|
834
846
|
default:
|
|
835
|
-
|
|
847
|
+
y.value.actionItems = !1;
|
|
836
848
|
return;
|
|
837
849
|
}
|
|
838
|
-
},
|
|
850
|
+
}, st = () => {
|
|
839
851
|
se.value = !se.value, ie.value = !1;
|
|
840
|
-
},
|
|
852
|
+
}, Ee = () => {
|
|
841
853
|
const e = document.getElementById("comment-field"), t = document.getElementById("hidden-text");
|
|
842
854
|
e.style.height = t?.offsetHeight + "px";
|
|
843
|
-
},
|
|
855
|
+
}, Y = () => {
|
|
844
856
|
const e = document.getElementById("comments-container");
|
|
845
857
|
e?.scroll({
|
|
846
858
|
top: e.scrollHeight,
|
|
847
859
|
behavior: "smooth"
|
|
848
860
|
});
|
|
849
|
-
},
|
|
850
|
-
if (e && e.type === "keydown" && e.preventDefault(),
|
|
851
|
-
|
|
861
|
+
}, ot = async (e) => {
|
|
862
|
+
if (e && e.type === "keydown" && e.preventDefault(), l.value.tokenId && b.value && !H.value) {
|
|
863
|
+
y.value.sendingMessage = !0;
|
|
852
864
|
try {
|
|
853
865
|
const t = new FormData();
|
|
854
|
-
t.append("tokenId",
|
|
866
|
+
t.append("tokenId", l.value.tokenId), t.append("content", b.value), t.append("senderId", P.value || "");
|
|
855
867
|
const a = await K.post(
|
|
856
868
|
"/api/client/connect/sendMessage.php",
|
|
857
869
|
t
|
|
@@ -859,35 +871,35 @@ const Gt = mt({
|
|
|
859
871
|
if (a.data.status === "error") {
|
|
860
872
|
h("show:toast", {
|
|
861
873
|
show: !0,
|
|
862
|
-
message:
|
|
874
|
+
message: c("HC_FAILED_TO_SEND_MESSAGE"),
|
|
863
875
|
variant: "error",
|
|
864
876
|
icon: "exclamation-circle"
|
|
865
877
|
});
|
|
866
878
|
return;
|
|
867
879
|
}
|
|
868
|
-
b.value = "", A.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)),
|
|
880
|
+
b.value = "", A.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)), Y();
|
|
869
881
|
} catch (t) {
|
|
870
882
|
console.error("sendChatMessage error:", t), h("show:toast", {
|
|
871
883
|
show: !0,
|
|
872
|
-
message:
|
|
884
|
+
message: c("HC_FAILED_TO_SEND_MESSAGE"),
|
|
873
885
|
variant: "error",
|
|
874
886
|
icon: "exclamation-circle"
|
|
875
887
|
});
|
|
876
888
|
} finally {
|
|
877
|
-
|
|
889
|
+
y.value.sendingMessage = !1;
|
|
878
890
|
}
|
|
879
891
|
}
|
|
880
|
-
},
|
|
881
|
-
if (!(!
|
|
882
|
-
|
|
892
|
+
}, nt = async () => {
|
|
893
|
+
if (!(!l.value.tokenId || !P.value)) {
|
|
894
|
+
y.value.conversationToggle = !0;
|
|
883
895
|
try {
|
|
884
896
|
const e = A.value ? "/api/client/connect/closeConversation.php" : "/api/client/connect/openConversation.php", t = new FormData();
|
|
885
|
-
t.append("tokenId",
|
|
897
|
+
t.append("tokenId", l.value.tokenId), t.append("userId", P.value), A.value && k.value !== null && t.append("lastMsgId", k.value.toString());
|
|
886
898
|
const a = await K.post(e, t);
|
|
887
899
|
if (a.data.status === "error") {
|
|
888
900
|
h("show:toast", {
|
|
889
901
|
show: !0,
|
|
890
|
-
message:
|
|
902
|
+
message: c("HC_FAILED_TO_UPDATE_CONVERSATION"),
|
|
891
903
|
variant: "error",
|
|
892
904
|
icon: "exclamation-circle"
|
|
893
905
|
});
|
|
@@ -895,27 +907,27 @@ const Gt = mt({
|
|
|
895
907
|
}
|
|
896
908
|
A.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)), h("show:toast", {
|
|
897
909
|
show: !0,
|
|
898
|
-
message: A.value ?
|
|
910
|
+
message: A.value ? c("HC_CONVERSATION_REOPENED") : c("HC_CONVERSATION_CLOSED"),
|
|
899
911
|
variant: "success",
|
|
900
912
|
icon: "check-circle"
|
|
901
913
|
});
|
|
902
914
|
} catch (e) {
|
|
903
915
|
console.error("toggleMarkOpenClose error:", e), h("show:toast", {
|
|
904
916
|
show: !0,
|
|
905
|
-
message:
|
|
917
|
+
message: c("HC_FAILED_TO_UPDATE_CONVERSATION"),
|
|
906
918
|
variant: "error",
|
|
907
919
|
icon: "exclamation-circle"
|
|
908
920
|
});
|
|
909
921
|
} finally {
|
|
910
|
-
|
|
922
|
+
y.value.conversationToggle = !1;
|
|
911
923
|
}
|
|
912
924
|
}
|
|
913
|
-
},
|
|
914
|
-
if (o.isTestEnvironment && !(!
|
|
925
|
+
}, rt = async () => {
|
|
926
|
+
if (o.isTestEnvironment && !(!l.value?.tokenId || !j.value.trim())) {
|
|
915
927
|
me.value = !0;
|
|
916
928
|
try {
|
|
917
929
|
const e = new FormData();
|
|
918
|
-
e.append("tokenId",
|
|
930
|
+
e.append("tokenId", l.value.tokenId), e.append("content", j.value.trim());
|
|
919
931
|
const t = await K.post(
|
|
920
932
|
"/api/client/connect/simulateInbound.php",
|
|
921
933
|
e
|
|
@@ -923,22 +935,22 @@ const Gt = mt({
|
|
|
923
935
|
if (t.data.status === "error") {
|
|
924
936
|
h("show:toast", {
|
|
925
937
|
show: !0,
|
|
926
|
-
message:
|
|
938
|
+
message: c("HC_FAILED_TO_SIMULATE_MESSAGE"),
|
|
927
939
|
variant: "error",
|
|
928
940
|
icon: "exclamation-circle"
|
|
929
941
|
});
|
|
930
942
|
return;
|
|
931
943
|
}
|
|
932
|
-
t.data.messages && (F(t.data.messages), A.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,
|
|
944
|
+
t.data.messages && (F(t.data.messages), A.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, Y(), h("show:toast", {
|
|
933
945
|
show: !0,
|
|
934
|
-
message:
|
|
946
|
+
message: c("HC_SIMULATED_GUEST_REPLY"),
|
|
935
947
|
variant: "success",
|
|
936
948
|
icon: "check-circle"
|
|
937
949
|
});
|
|
938
950
|
} catch (e) {
|
|
939
951
|
console.error("simulateGuestReply error:", e), h("show:toast", {
|
|
940
952
|
show: !0,
|
|
941
|
-
message:
|
|
953
|
+
message: c("HC_FAILED_TO_SIMULATE_MESSAGE"),
|
|
942
954
|
variant: "error",
|
|
943
955
|
icon: "exclamation-circle"
|
|
944
956
|
});
|
|
@@ -946,15 +958,15 @@ const Gt = mt({
|
|
|
946
958
|
me.value = !1;
|
|
947
959
|
}
|
|
948
960
|
}
|
|
949
|
-
},
|
|
961
|
+
}, lt = () => {
|
|
950
962
|
W.value = !W.value, W.value || (j.value = "");
|
|
951
|
-
},
|
|
952
|
-
|
|
953
|
-
document.visibilityState === "visible" &&
|
|
954
|
-
},
|
|
963
|
+
}, it = () => {
|
|
964
|
+
Q.value || (Q.value = setInterval(() => {
|
|
965
|
+
document.visibilityState === "visible" && fe(!0);
|
|
966
|
+
}, Ce));
|
|
955
967
|
}, ye = () => {
|
|
956
|
-
|
|
957
|
-
},
|
|
968
|
+
Q.value && (clearInterval(Q.value), Q.value = null);
|
|
969
|
+
}, ge = () => {
|
|
958
970
|
if (o.align === "left" || o.align === "right") {
|
|
959
971
|
const e = J.value?.getBoundingClientRect().left, t = window.innerWidth;
|
|
960
972
|
ue.value = t - e < U.value ? "right" : "left";
|
|
@@ -962,7 +974,7 @@ const Gt = mt({
|
|
|
962
974
|
const e = J.value?.getBoundingClientRect().top, t = window.innerHeight;
|
|
963
975
|
ue.value = t - e < G.value ? "bottom" : "top";
|
|
964
976
|
}
|
|
965
|
-
},
|
|
977
|
+
}, _e = () => {
|
|
966
978
|
if (o.position === "top" || o.position === "bottom") {
|
|
967
979
|
const e = J.value?.getBoundingClientRect().top, t = window.innerHeight;
|
|
968
980
|
de.value = t - e < G.value ? "top" : "bottom";
|
|
@@ -970,54 +982,54 @@ const Gt = mt({
|
|
|
970
982
|
const e = J.value?.getBoundingClientRect().left, t = window.innerWidth;
|
|
971
983
|
de.value = t - e < U.value ? "left" : "right";
|
|
972
984
|
}
|
|
973
|
-
},
|
|
985
|
+
}, Se = () => {
|
|
974
986
|
H.value = !H.value, H.value ? (b.value = "", N.value.info = ee.value, N.value.tickets = te.value, N.value.comments = Z.value, ee.value = !1, te.value = !1, document.getElementById("comment-field")?.focus()) : (ee.value = N.value.info, te.value = N.value.tickets, Z.value = N.value.comments);
|
|
975
|
-
},
|
|
976
|
-
const a =
|
|
977
|
-
if (s.append("property_id", o.propertyId), s.append("room_ids", JSON.stringify([a])), await
|
|
987
|
+
}, ut = async (e, t) => {
|
|
988
|
+
const a = l.value?.qv2Rooms?.qRoomId || l.value?.id || o.room?.id, s = new FormData();
|
|
989
|
+
if (s.append("property_id", o.propertyId), s.append("room_ids", JSON.stringify([a])), await V(), S.value) {
|
|
978
990
|
const n = [];
|
|
979
|
-
S.value.forEach((
|
|
980
|
-
|
|
981
|
-
...
|
|
991
|
+
S.value.forEach((r) => {
|
|
992
|
+
r.id === e && r.type === t ? n.unshift({
|
|
993
|
+
...r,
|
|
982
994
|
isNew: !0
|
|
983
995
|
}) : n.push({
|
|
984
|
-
...
|
|
996
|
+
...r,
|
|
985
997
|
isNew: !1
|
|
986
998
|
});
|
|
987
|
-
}), n.sort((
|
|
999
|
+
}), n.sort((r, u) => r.id === e ? -1 : u.id === e ? 1 : 0), S.value = [...n];
|
|
988
1000
|
}
|
|
989
1001
|
};
|
|
990
1002
|
B(() => o.open, () => {
|
|
991
1003
|
if (o.open && o.showComments && C.value.length) {
|
|
992
|
-
const e = setTimeout(
|
|
1004
|
+
const e = setTimeout(Y, 500);
|
|
993
1005
|
L.value.push(e);
|
|
994
1006
|
}
|
|
995
|
-
o.open || (
|
|
1007
|
+
o.open || (Te(), ye(), k.value = null, C.value = [], A.value = !1);
|
|
996
1008
|
}), B(
|
|
997
|
-
() => [o.open, o.showComments, Z.value,
|
|
1009
|
+
() => [o.open, o.showComments, Z.value, l.value?.tokenId],
|
|
998
1010
|
([e, t, a, s]) => {
|
|
999
|
-
e && t && a && s ?
|
|
1011
|
+
e && t && a && s ? it() : ye();
|
|
1000
1012
|
}
|
|
1001
1013
|
), B(b, () => {
|
|
1002
|
-
const e = setTimeout(
|
|
1014
|
+
const e = setTimeout(Ee, 100);
|
|
1003
1015
|
L.value.push(e);
|
|
1004
1016
|
}), B(() => o.allowWhenWhere, (e, t) => {
|
|
1005
1017
|
t === !0 && e === !1 && (d.value.when = null, d.value.where = null, q.value = [], x.value = []);
|
|
1006
1018
|
});
|
|
1007
|
-
const
|
|
1019
|
+
const Ae = () => !!(o.room.reservations || o.room.cleaning || o.room.occupancy);
|
|
1008
1020
|
return B(() => o.open, async (e, t) => {
|
|
1009
|
-
e && !t && (
|
|
1021
|
+
e && !t && (Ae() ? (l.value = o.room, R.value = [o.room]) : o.showGuestDetails && !R.value ? await oe() : l.value || (l.value = o.room), V(), ne(), o.showComments && fe());
|
|
1010
1022
|
}), B(
|
|
1011
1023
|
() => o.room.id,
|
|
1012
1024
|
(e, t) => {
|
|
1013
|
-
e !== t && (
|
|
1025
|
+
e !== t && (l.value = o.room, R.value = null, o.open && (Ae() ? R.value = [o.room] : o.showGuestDetails && oe(), V(), ne()));
|
|
1014
1026
|
}
|
|
1015
|
-
),
|
|
1027
|
+
), dt(async () => {
|
|
1016
1028
|
const e = JSON.parse(
|
|
1017
1029
|
window.localStorage.getItem("authenticated")
|
|
1018
1030
|
);
|
|
1019
|
-
P.value = e?.user?.id || window.userId || "",
|
|
1020
|
-
}),
|
|
1031
|
+
P.value = e?.user?.id || window.userId || "", l.value = o.room, o.size === "sm" && (G.value = 140, U.value = 160), o.size === "lg" && (G.value = 250, U.value = 440), ge(), _e();
|
|
1032
|
+
}), mt(() => {
|
|
1021
1033
|
L.value.forEach((e) => {
|
|
1022
1034
|
clearTimeout(e);
|
|
1023
1035
|
}), ye();
|
|
@@ -1032,29 +1044,29 @@ const Gt = mt({
|
|
|
1032
1044
|
componentHeight: G,
|
|
1033
1045
|
componentWidth: U,
|
|
1034
1046
|
departments: M,
|
|
1035
|
-
departmentUsers:
|
|
1047
|
+
departmentUsers: we,
|
|
1036
1048
|
expandComments: Z,
|
|
1037
1049
|
expandGuestInfo: ee,
|
|
1038
1050
|
expandedStates: N,
|
|
1039
1051
|
expandTickets: te,
|
|
1040
|
-
guestDetailsData:
|
|
1052
|
+
guestDetailsData: be,
|
|
1041
1053
|
itemOptions: O,
|
|
1042
|
-
loading:
|
|
1054
|
+
loading: y,
|
|
1043
1055
|
messages: C,
|
|
1044
1056
|
moodOptions: ce,
|
|
1045
1057
|
pmsData: R,
|
|
1046
1058
|
positioning: de,
|
|
1047
1059
|
quickReplyOpen: H,
|
|
1048
1060
|
request: d,
|
|
1049
|
-
requestedByOptions:
|
|
1061
|
+
requestedByOptions: $,
|
|
1050
1062
|
requestLoading: ve,
|
|
1051
1063
|
requestType: E,
|
|
1052
|
-
roomDetailsData:
|
|
1064
|
+
roomDetailsData: l,
|
|
1053
1065
|
roomNotice: I,
|
|
1054
1066
|
roomNotices: ae,
|
|
1055
1067
|
showCreateRequest: se,
|
|
1056
1068
|
ticketsList: S,
|
|
1057
|
-
todoOptions:
|
|
1069
|
+
todoOptions: Me,
|
|
1058
1070
|
trigger: J,
|
|
1059
1071
|
userId: P,
|
|
1060
1072
|
workOrder: v,
|
|
@@ -1069,59 +1081,57 @@ const Gt = mt({
|
|
|
1069
1081
|
simulateContent: j,
|
|
1070
1082
|
simulateLoading: me,
|
|
1071
1083
|
// Computed
|
|
1072
|
-
cleanliness:
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
tagsList: je,
|
|
1087
|
-
validateToDo: $e,
|
|
1084
|
+
cleanliness: Ne,
|
|
1085
|
+
filteredReplies: Re,
|
|
1086
|
+
groupedMessages: He,
|
|
1087
|
+
hasGuestCallback: Le,
|
|
1088
|
+
hasComplaint: Ie,
|
|
1089
|
+
itemOptionsList: Pe,
|
|
1090
|
+
occupied: De,
|
|
1091
|
+
occupancyTooltipContent: qe,
|
|
1092
|
+
selectedAssignType: xe,
|
|
1093
|
+
selectedDepartment: Fe,
|
|
1094
|
+
selectedRequestedBy: Be,
|
|
1095
|
+
stayDetails: Ge,
|
|
1096
|
+
tagsList: Ue,
|
|
1097
|
+
validateToDo: We,
|
|
1088
1098
|
// Methods
|
|
1089
|
-
closeRequest:
|
|
1090
|
-
createCallback:
|
|
1099
|
+
closeRequest: Te,
|
|
1100
|
+
createCallback: je,
|
|
1091
1101
|
createMessageList: F,
|
|
1092
|
-
getChatMessages:
|
|
1093
|
-
getHowLongAgo:
|
|
1102
|
+
getChatMessages: fe,
|
|
1103
|
+
getHowLongAgo: $e,
|
|
1094
1104
|
getPMSData: oe,
|
|
1095
1105
|
getRoomNotices: ne,
|
|
1096
|
-
getSharedData:
|
|
1097
|
-
getStayDetails:
|
|
1098
|
-
getTicketColor:
|
|
1099
|
-
getTicketIcon:
|
|
1100
|
-
getTickets:
|
|
1101
|
-
handleFailedResponse:
|
|
1102
|
-
handlePulse:
|
|
1103
|
-
onClickEditConnectGuest:
|
|
1104
|
-
onClickTicket:
|
|
1105
|
-
onCreateRequestSubmit:
|
|
1106
|
-
onHoverToggle:
|
|
1107
|
-
onSelectQuickReply:
|
|
1108
|
-
onSelectToDo:
|
|
1109
|
-
openRequest:
|
|
1110
|
-
refreshPMSData:
|
|
1111
|
-
resizeTextarea:
|
|
1112
|
-
scrollToConnectBottom:
|
|
1113
|
-
sendChatMessage:
|
|
1114
|
-
setAlignment:
|
|
1115
|
-
setPositioning:
|
|
1116
|
-
toggleMarkOpenClose:
|
|
1117
|
-
toggleQuickReply:
|
|
1118
|
-
updateTickets:
|
|
1106
|
+
getSharedData: he,
|
|
1107
|
+
getStayDetails: Oe,
|
|
1108
|
+
getTicketColor: Ve,
|
|
1109
|
+
getTicketIcon: Ye,
|
|
1110
|
+
getTickets: V,
|
|
1111
|
+
handleFailedResponse: ke,
|
|
1112
|
+
handlePulse: ze,
|
|
1113
|
+
onClickEditConnectGuest: Ke,
|
|
1114
|
+
onClickTicket: Xe,
|
|
1115
|
+
onCreateRequestSubmit: Ze,
|
|
1116
|
+
onHoverToggle: et,
|
|
1117
|
+
onSelectQuickReply: tt,
|
|
1118
|
+
onSelectToDo: at,
|
|
1119
|
+
openRequest: st,
|
|
1120
|
+
refreshPMSData: Je,
|
|
1121
|
+
resizeTextarea: Ee,
|
|
1122
|
+
scrollToConnectBottom: Y,
|
|
1123
|
+
sendChatMessage: ot,
|
|
1124
|
+
setAlignment: ge,
|
|
1125
|
+
setPositioning: _e,
|
|
1126
|
+
toggleMarkOpenClose: nt,
|
|
1127
|
+
toggleQuickReply: Se,
|
|
1128
|
+
updateTickets: ut,
|
|
1119
1129
|
// Simulate Guest Reply methods (test environments only)
|
|
1120
|
-
simulateGuestReply:
|
|
1121
|
-
toggleSimulateOpen:
|
|
1130
|
+
simulateGuestReply: rt,
|
|
1131
|
+
toggleSimulateOpen: lt
|
|
1122
1132
|
};
|
|
1123
1133
|
}
|
|
1124
1134
|
});
|
|
1125
1135
|
export {
|
|
1126
|
-
|
|
1136
|
+
Ft as default
|
|
1127
1137
|
};
|