@quoreadmin/ui 1.4.2 → 1.4.3
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.js +110 -85433
- package/dist/index10.js +55 -0
- package/dist/index101.js +213 -0
- package/dist/index103.js +78 -0
- package/dist/index105.js +136 -0
- package/dist/index107.js +216 -0
- package/dist/index109.js +134 -0
- package/dist/index11.js +183 -0
- package/dist/index111.js +154 -0
- package/dist/index113.js +44 -0
- package/dist/index115.js +78 -0
- package/dist/index117.js +25 -0
- package/dist/index119.js +84 -0
- package/dist/index12.js +74 -0
- package/dist/index121.js +16 -0
- package/dist/index123.js +82 -0
- package/dist/index125.js +134 -0
- package/dist/index127.js +56 -0
- package/dist/index129.js +37 -0
- package/dist/index13.js +32 -0
- package/dist/index131.js +65 -0
- package/dist/index133.js +815 -0
- package/dist/index135.js +277 -0
- package/dist/index137.js +350 -0
- package/dist/index139.js +31 -0
- package/dist/index14.js +190 -0
- package/dist/index141.js +89 -0
- package/dist/index143.js +93 -0
- package/dist/index145.js +116 -0
- package/dist/index147.js +389 -0
- package/dist/index149.js +44 -0
- package/dist/index15.js +138 -0
- package/dist/index151.js +210 -0
- package/dist/index154.js +115 -0
- package/dist/index155.js +497 -0
- package/dist/index156.js +5524 -0
- package/dist/index157.js +93 -0
- package/dist/index158.js +863 -0
- package/dist/index159.js +40 -0
- package/dist/index16.js +318 -0
- package/dist/index160.js +282 -0
- package/dist/index161.js +152 -0
- package/dist/index162.js +1201 -0
- package/dist/index163.js +774 -0
- package/dist/index164.js +1310 -0
- package/dist/index165.js +278 -0
- package/dist/index166.js +108 -0
- package/dist/index167.js +4 -0
- package/dist/index168.js +1378 -0
- package/dist/index17.js +25 -0
- package/dist/index170.js +20 -0
- package/dist/index171.js +20 -0
- package/dist/index172.js +20 -0
- package/dist/index173.js +20 -0
- package/dist/index174.js +27 -0
- package/dist/index175.js +761 -0
- package/dist/index176.js +831 -0
- package/dist/index177.js +1236 -0
- package/dist/index178.js +11279 -0
- package/dist/index179.js +38 -0
- package/dist/index18.js +48 -0
- package/dist/index180.js +117 -0
- package/dist/index181.js +46 -0
- package/dist/index182.js +1192 -0
- package/dist/index184.js +5940 -0
- package/dist/index185.js +209 -0
- package/dist/index186.js +37 -0
- package/dist/index187.js +20 -0
- package/dist/index188.js +80 -0
- package/dist/index189.js +255 -0
- package/dist/index19.js +53 -0
- package/dist/index190.js +13686 -0
- package/dist/index191.js +29 -0
- package/dist/index192.js +65 -0
- package/dist/index193.js +240 -0
- package/dist/index194.js +310 -0
- package/dist/index195.js +290 -0
- package/dist/index196.js +35 -0
- package/dist/index197.js +118 -0
- package/dist/index198.js +38 -0
- package/dist/index199.js +28 -0
- package/dist/index2.js +86 -0
- package/dist/index20.js +35 -0
- package/dist/index200.js +38 -0
- package/dist/index201.js +11 -0
- package/dist/index202.js +21 -0
- package/dist/index203.js +12 -0
- package/dist/index204.js +12 -0
- package/dist/index205.js +53 -0
- package/dist/index206.js +45 -0
- package/dist/index207.js +6 -0
- package/dist/index208.js +41 -0
- package/dist/index209.js +23 -0
- package/dist/index21.js +68 -0
- package/dist/index210.js +90 -0
- package/dist/index211.js +409 -0
- package/dist/index212.js +24 -0
- package/dist/index213.js +163 -0
- package/dist/index214.js +22 -0
- package/dist/index215.js +22 -0
- package/dist/index216.js +24 -0
- package/dist/index217.js +201 -0
- package/dist/index218.js +72 -0
- package/dist/index219.js +36 -0
- package/dist/index22.js +176 -0
- package/dist/index220.js +42 -0
- package/dist/index221.js +129 -0
- package/dist/index222.js +40 -0
- package/dist/index223.js +82 -0
- package/dist/index224.js +22 -0
- package/dist/index225.js +22 -0
- package/dist/index226.js +22 -0
- package/dist/index227.js +22 -0
- package/dist/index228.js +163 -0
- package/dist/index229.js +230 -0
- package/dist/index23.js +14 -0
- package/dist/index230.js +39 -0
- package/dist/index231.js +12 -0
- package/dist/index232.js +24 -0
- package/dist/index233.js +24 -0
- package/dist/index234.js +22 -0
- package/dist/index235.js +838 -0
- package/dist/index236.js +704 -0
- package/dist/index237.js +178 -0
- package/dist/index238.js +24 -0
- package/dist/index239.js +22 -0
- package/dist/index24.js +43 -0
- package/dist/index240.js +22 -0
- package/dist/index241.js +5 -0
- package/dist/index242.js +189 -0
- package/dist/index243.js +135 -0
- package/dist/index244.js +1225 -0
- package/dist/index245.js +22 -0
- package/dist/index246.js +24 -0
- package/dist/index247.js +24 -0
- package/dist/index248.js +31 -0
- package/dist/index249.js +22 -0
- package/dist/index25.js +123 -0
- package/dist/index250.js +22 -0
- package/dist/index251.js +4 -0
- package/dist/index252.js +4 -0
- package/dist/index253.js +3634 -0
- package/dist/index254.js +57 -0
- package/dist/index255.js +79 -0
- package/dist/index256.js +54 -0
- package/dist/index257.js +217 -0
- package/dist/index258.js +12 -0
- package/dist/index259.js +59 -0
- package/dist/index26.js +29 -0
- package/dist/index260.js +63 -0
- package/dist/index261.js +56 -0
- package/dist/index262.js +77 -0
- package/dist/index263.js +725 -0
- package/dist/index264.js +41 -0
- package/dist/index265.js +66 -0
- package/dist/index266.js +13 -0
- package/dist/index267.js +707 -0
- package/dist/index268.js +822 -0
- package/dist/index269.js +255 -0
- package/dist/index27.js +163 -0
- package/dist/index270.js +10 -0
- package/dist/index271.js +140 -0
- package/dist/index272.js +85 -0
- package/dist/index273.js +5 -0
- package/dist/index274.js +29 -0
- package/dist/index275.js +56 -0
- package/dist/index276.js +81 -0
- package/dist/index277.js +28 -0
- package/dist/index278.js +24 -0
- package/dist/index279.js +24 -0
- package/dist/index28.js +286 -0
- package/dist/index280.js +18 -0
- package/dist/index281.js +19 -0
- package/dist/index282.js +25 -0
- package/dist/index283.js +4 -0
- package/dist/index284.js +237 -0
- package/dist/index285.js +8 -0
- package/dist/index286.js +136 -0
- package/dist/index287.js +70 -0
- package/dist/index288.js +89 -0
- package/dist/index289.js +31 -0
- package/dist/index29.js +69 -0
- package/dist/index290.js +11 -0
- package/dist/index291.js +77 -0
- package/dist/index292.js +6 -0
- package/dist/index293.js +4 -0
- package/dist/index294.js +85 -0
- package/dist/index295.js +56 -0
- package/dist/index296.js +8 -0
- package/dist/index297.js +7 -0
- package/dist/index298.js +181 -0
- package/dist/index299.js +65 -0
- package/dist/index3.js +69 -0
- package/dist/index30.js +183 -0
- package/dist/index300.js +77 -0
- package/dist/index301.js +81 -0
- package/dist/index302.js +24 -0
- package/dist/index303.js +937 -0
- package/dist/index304.js +24 -0
- package/dist/index305.js +22 -0
- package/dist/index306.js +22 -0
- package/dist/index307.js +71 -0
- package/dist/index308.js +21 -0
- package/dist/index309.js +21 -0
- package/dist/index31.js +44 -0
- package/dist/index310.js +24 -0
- package/dist/index311.js +24 -0
- package/dist/index312.js +65 -0
- package/dist/index313.js +1520 -0
- package/dist/index314.js +388 -0
- package/dist/index315.js +2733 -0
- package/dist/index316.js +88 -0
- package/dist/index317.js +3772 -0
- package/dist/index318.js +62 -0
- package/dist/index319.js +17 -0
- package/dist/index32.js +55 -0
- package/dist/index320.js +86 -0
- package/dist/index321.js +204 -0
- package/dist/index322.js +248 -0
- package/dist/index323.js +11 -0
- package/dist/index324.js +15 -0
- package/dist/index325.js +57 -0
- package/dist/index326.js +14 -0
- package/dist/index327.js +16 -0
- package/dist/index328.js +60 -0
- package/dist/index329.js +54 -0
- package/dist/index33.js +38 -0
- package/dist/index330.js +33 -0
- package/dist/index331.js +4 -0
- package/dist/index332.js +7 -0
- package/dist/index333.js +4 -0
- package/dist/index334.js +25 -0
- package/dist/index335.js +43 -0
- package/dist/index336.js +4 -0
- package/dist/index337.js +13 -0
- package/dist/index338.js +22 -0
- package/dist/index339.js +19 -0
- package/dist/index34.js +35 -0
- package/dist/index340.js +12 -0
- package/dist/index341.js +12 -0
- package/dist/index342.js +4 -0
- package/dist/index343.js +11 -0
- package/dist/index344.js +12 -0
- package/dist/index345.js +16 -0
- package/dist/index346.js +39 -0
- package/dist/index347.js +23 -0
- package/dist/index348.js +58 -0
- package/dist/index349.js +31 -0
- package/dist/index35.js +19 -0
- package/dist/index350.js +9 -0
- package/dist/index351.js +54 -0
- package/dist/index352.js +8 -0
- package/dist/index353.js +14 -0
- package/dist/index354.js +9 -0
- package/dist/index355.js +30 -0
- package/dist/index356.js +4 -0
- package/dist/index357.js +72 -0
- package/dist/index358.js +169 -0
- package/dist/index359.js +22 -0
- package/dist/index36.js +47 -0
- package/dist/index360.js +22 -0
- package/dist/index361.js +66 -0
- package/dist/index362.js +39 -0
- package/dist/index363.js +33 -0
- package/dist/index364.js +13 -0
- package/dist/index365.js +6 -0
- package/dist/index366.js +6 -0
- package/dist/index367.js +15 -0
- package/dist/index368.js +9 -0
- package/dist/index369.js +14 -0
- package/dist/index37.js +42 -0
- package/dist/index370.js +7 -0
- package/dist/index371.js +35 -0
- package/dist/index372.js +33 -0
- package/dist/index373.js +30 -0
- package/dist/index374.js +63 -0
- package/dist/index375.js +19 -0
- package/dist/index376.js +103 -0
- package/dist/index377.js +93 -0
- package/dist/index378.js +100 -0
- package/dist/index379.js +5 -0
- package/dist/index38.js +32 -0
- package/dist/index380.js +4 -0
- package/dist/index381.js +4 -0
- package/dist/index382.js +19 -0
- package/dist/index383.js +15 -0
- package/dist/index384.js +8 -0
- package/dist/index385.js +34 -0
- package/dist/index39.js +39 -0
- package/dist/index4.js +23 -0
- package/dist/index40.js +44 -0
- package/dist/index41.js +1075 -0
- package/dist/index42.js +339 -0
- package/dist/index43.js +159 -0
- package/dist/index44.js +22 -0
- package/dist/index45.js +42 -0
- package/dist/index46.js +72 -0
- package/dist/index47.js +65 -0
- package/dist/index48.js +184 -0
- package/dist/index49.js +88 -0
- package/dist/index5.js +19 -0
- package/dist/index50.js +209 -0
- package/dist/index51.js +71 -0
- package/dist/index52.js +22 -0
- package/dist/index53.js +13 -0
- package/dist/index54.js +9 -0
- package/dist/index55.js +213 -0
- package/dist/index56.js +15 -0
- package/dist/index57.js +187 -0
- package/dist/index58.js +79 -0
- package/dist/index6.js +21 -0
- package/dist/index60.js +9 -0
- package/dist/index61.js +65 -0
- package/dist/index63.js +44 -0
- package/dist/index65.js +16 -0
- package/dist/index67.js +30 -0
- package/dist/index69.js +141 -0
- package/dist/index7.js +76 -0
- package/dist/index71.js +78 -0
- package/dist/index73.js +62 -0
- package/dist/index74.js +105 -0
- package/dist/index76.js +217 -0
- package/dist/index78.js +108 -0
- package/dist/index8.js +31 -0
- package/dist/index80.js +36 -0
- package/dist/index81.js +140 -0
- package/dist/index83.js +141 -0
- package/dist/index85.js +292 -0
- package/dist/index87.js +29 -0
- package/dist/index89.js +45 -0
- package/dist/index9.js +36 -0
- package/dist/index91.js +117 -0
- package/dist/index93.js +29 -0
- package/dist/index94.js +34 -0
- package/dist/index96.js +138 -0
- package/dist/index97.js +10 -0
- package/dist/index99.js +39 -0
- package/package.json +3 -4
- package/dist/index.umd.cjs +0 -1322
package/dist/index133.js
ADDED
|
@@ -0,0 +1,815 @@
|
|
|
1
|
+
import { defineComponent as Fe, ref as s, computed as p, watch as ae, onMounted as je, onUnmounted as $e } from "vue";
|
|
2
|
+
import { useI18n as ze } from "vue-i18n";
|
|
3
|
+
import { DateTime as h } from "./index156.js";
|
|
4
|
+
import "./index179.js";
|
|
5
|
+
import We from "./index2.js";
|
|
6
|
+
import Xe from "./index3.js";
|
|
7
|
+
import Je from "./index12.js";
|
|
8
|
+
import Ke from "./index20.js";
|
|
9
|
+
import Ve from "./index26.js";
|
|
10
|
+
import Ze from "./index37.js";
|
|
11
|
+
import et from "./index180.js";
|
|
12
|
+
import tt from "./index44.js";
|
|
13
|
+
import at from "./index47.js";
|
|
14
|
+
import U from "./index181.js";
|
|
15
|
+
const ht = Fe({
|
|
16
|
+
name: "QRoomDetailsPopover",
|
|
17
|
+
components: {
|
|
18
|
+
QAccordion: We,
|
|
19
|
+
QActivityItem: Xe,
|
|
20
|
+
QCommentSection: Je,
|
|
21
|
+
QDatePicker: et,
|
|
22
|
+
QDivider: Ke,
|
|
23
|
+
QIcon: Ve,
|
|
24
|
+
QPopover: Ze,
|
|
25
|
+
QTag: tt,
|
|
26
|
+
QTooltip: at
|
|
27
|
+
},
|
|
28
|
+
props: {
|
|
29
|
+
id: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ""
|
|
32
|
+
},
|
|
33
|
+
roomDetails: {
|
|
34
|
+
type: Object,
|
|
35
|
+
default: () => {
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
guestDetails: {
|
|
39
|
+
type: Object,
|
|
40
|
+
default: () => {
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
propertyId: {
|
|
44
|
+
type: [Number, String],
|
|
45
|
+
default: ""
|
|
46
|
+
},
|
|
47
|
+
propertyTimeZone: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "America/Chicago"
|
|
50
|
+
},
|
|
51
|
+
trigger: {
|
|
52
|
+
type: [Number, String],
|
|
53
|
+
default: ""
|
|
54
|
+
},
|
|
55
|
+
comments: {
|
|
56
|
+
type: Array,
|
|
57
|
+
default: () => []
|
|
58
|
+
},
|
|
59
|
+
room: {
|
|
60
|
+
type: Object,
|
|
61
|
+
default: () => {
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
showActionMenu: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: !0
|
|
67
|
+
},
|
|
68
|
+
showActionsLink: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: !0
|
|
71
|
+
},
|
|
72
|
+
showGuestDetails: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: !1
|
|
75
|
+
},
|
|
76
|
+
showComments: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: !1
|
|
79
|
+
},
|
|
80
|
+
showTickets: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: !0
|
|
83
|
+
},
|
|
84
|
+
showGuestCallback: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: !0
|
|
87
|
+
},
|
|
88
|
+
showRoomName: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: !1
|
|
91
|
+
},
|
|
92
|
+
hover: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: !1
|
|
95
|
+
},
|
|
96
|
+
size: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: "md"
|
|
99
|
+
},
|
|
100
|
+
open: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: !1
|
|
103
|
+
},
|
|
104
|
+
align: {
|
|
105
|
+
type: String,
|
|
106
|
+
default: "left"
|
|
107
|
+
},
|
|
108
|
+
position: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: "bottom"
|
|
111
|
+
},
|
|
112
|
+
locale: {
|
|
113
|
+
type: String,
|
|
114
|
+
default: "en"
|
|
115
|
+
},
|
|
116
|
+
pmsBaseUrl: {
|
|
117
|
+
type: String,
|
|
118
|
+
default: "",
|
|
119
|
+
required: !0
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
emits: ["create:callback", "create:todo", "refresh:pms", "toggle"],
|
|
123
|
+
setup(l, { emit: w }) {
|
|
124
|
+
const { t: d } = ze(), r = s(null), G = s(!1), Q = s("left"), H = s([
|
|
125
|
+
{
|
|
126
|
+
id: 1,
|
|
127
|
+
label: d("HC_DEPARTMENT")
|
|
128
|
+
// need to localize
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: 2,
|
|
132
|
+
label: d("HC_PERSON")
|
|
133
|
+
// need to localize
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 0,
|
|
137
|
+
label: d("HC_ANYONE")
|
|
138
|
+
// need to localize
|
|
139
|
+
}
|
|
140
|
+
]), k = s(""), i = s({
|
|
141
|
+
checkInDate: /* @__PURE__ */ new Date(),
|
|
142
|
+
checkOutDate: /* @__PURE__ */ new Date(),
|
|
143
|
+
guestEmail: "",
|
|
144
|
+
guestLoyalty: "",
|
|
145
|
+
guestMood: null,
|
|
146
|
+
guestName: "",
|
|
147
|
+
guestPhone: "",
|
|
148
|
+
inHouse: !!r.value?.tokenId || !1,
|
|
149
|
+
problem: null,
|
|
150
|
+
notes: "",
|
|
151
|
+
tokenId: r.value?.tokenId
|
|
152
|
+
}), R = s(250), E = s(290), O = s([]), me = s([]), F = s(!0), A = s(!0), b = s({
|
|
153
|
+
info: !0,
|
|
154
|
+
tickets: !0,
|
|
155
|
+
comments: !0
|
|
156
|
+
}), B = s(!0), pe = s(l.guestDetails), D = s([]), T = s({
|
|
157
|
+
pms: !1,
|
|
158
|
+
roomNotices: !1,
|
|
159
|
+
tickets: !1
|
|
160
|
+
}), oe = s([]), j = s([]), $ = s("bottom"), M = s(null), z = s([]), C = s(!1), u = s({
|
|
161
|
+
assignType: null,
|
|
162
|
+
department: null,
|
|
163
|
+
due: /* @__PURE__ */ new Date(),
|
|
164
|
+
item: null,
|
|
165
|
+
notes: "",
|
|
166
|
+
person: null,
|
|
167
|
+
requestedBy: null
|
|
168
|
+
}), N = s([
|
|
169
|
+
{
|
|
170
|
+
id: 0,
|
|
171
|
+
label: d("HC_STAFF_MEMBER")
|
|
172
|
+
// need to localize
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: 1,
|
|
176
|
+
label: d("HC_HOTEL_GUEST")
|
|
177
|
+
// need to localize
|
|
178
|
+
}
|
|
179
|
+
]), ve = s(!1), g = s(null), v = s({
|
|
180
|
+
endDate: /* @__PURE__ */ new Date(),
|
|
181
|
+
issue: null,
|
|
182
|
+
notes: "",
|
|
183
|
+
startDate: /* @__PURE__ */ new Date()
|
|
184
|
+
}), P = s([]), L = s(!1), _ = s([]), S = s([]), fe = s([
|
|
185
|
+
{
|
|
186
|
+
label: d("HC_COMPLAINT"),
|
|
187
|
+
id: "complaint"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
label: d("HC_REQUEST"),
|
|
191
|
+
id: "request"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
label: d("HC_ROOM_NOTICE"),
|
|
195
|
+
id: "room_notice"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
label: d("HC_WORK_ORDER"),
|
|
199
|
+
id: "work_order"
|
|
200
|
+
}
|
|
201
|
+
]), q = s(), x = s(null), n = s({
|
|
202
|
+
assignType: null,
|
|
203
|
+
department: null,
|
|
204
|
+
due: /* @__PURE__ */ new Date(),
|
|
205
|
+
item: null,
|
|
206
|
+
issue: null,
|
|
207
|
+
notes: "",
|
|
208
|
+
person: null,
|
|
209
|
+
requestedBy: null
|
|
210
|
+
}), W = s([]), X = p(() => {
|
|
211
|
+
switch (r.value.cleaning?.name) {
|
|
212
|
+
case "CLEAN":
|
|
213
|
+
case "INSPECTED":
|
|
214
|
+
return "CLEAN";
|
|
215
|
+
case "DIRTY":
|
|
216
|
+
case "PICKUP":
|
|
217
|
+
case "OUT OF ORDER":
|
|
218
|
+
case "OUT OF SERVICE":
|
|
219
|
+
return "DIRTY";
|
|
220
|
+
default:
|
|
221
|
+
return "";
|
|
222
|
+
}
|
|
223
|
+
}), ye = p(() => X.value === "CLEAN" ? "blue-10" : X.value === "DIRTY" ? "red-10" : "gray-30"), he = p(() => d(`HC_${r.value.cleaning?.name}`) || ""), ge = p(() => {
|
|
224
|
+
const e = k.value.toLowerCase();
|
|
225
|
+
return z.value.filter((a) => a.toLowerCase().match(e));
|
|
226
|
+
}), se = p(() => _.value.length ? !!_.value.find(
|
|
227
|
+
(a) => a.type === "complaint"
|
|
228
|
+
) : !1), _e = p(() => _.value.length ? !!_.value.find(
|
|
229
|
+
(a) => a.type === "callback"
|
|
230
|
+
) : !1), we = p(() => {
|
|
231
|
+
let e = [];
|
|
232
|
+
return D.value[0] && D.value[0].options === void 0 ? D.value.forEach((a) => {
|
|
233
|
+
e.push({
|
|
234
|
+
id: parseInt(a.id),
|
|
235
|
+
label: a.display_name
|
|
236
|
+
});
|
|
237
|
+
}) : e = D.value, e;
|
|
238
|
+
}), ne = p(() => r.value.occupancy?.name === "OCCUPIED"), ke = p(() => ne.value && se.value ? "HK_ROOM_STATUS_Occupied_Complaint" : "HK_ROOM_STATUS_Occupied"), De = p(() => {
|
|
239
|
+
switch (g.value?.id) {
|
|
240
|
+
case "request":
|
|
241
|
+
case "work_order":
|
|
242
|
+
return H.value[0];
|
|
243
|
+
default:
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
}), Te = p(() => {
|
|
247
|
+
if (O.value)
|
|
248
|
+
switch (g.value?.id) {
|
|
249
|
+
case "request":
|
|
250
|
+
return O.value.find((e) => parseInt(e.id) === 4);
|
|
251
|
+
case "work_order":
|
|
252
|
+
return O.value.find((e) => parseInt(e.id) === 2);
|
|
253
|
+
default:
|
|
254
|
+
return null;
|
|
255
|
+
}
|
|
256
|
+
return null;
|
|
257
|
+
}), be = p(() => {
|
|
258
|
+
switch (g.value?.id) {
|
|
259
|
+
case "request":
|
|
260
|
+
return N.value[1];
|
|
261
|
+
case "work_order":
|
|
262
|
+
return N.value[0];
|
|
263
|
+
default:
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
}), Ie = p(() => {
|
|
267
|
+
let e = "";
|
|
268
|
+
if (r.value && r.value.reservations[0]) {
|
|
269
|
+
const a = h.fromISO(
|
|
270
|
+
r.value.reservations[0].arrivalDate
|
|
271
|
+
), t = a.toFormat("MMM"), o = a.day, c = a.year, m = h.fromISO(
|
|
272
|
+
r.value.reservations[0].departureDate
|
|
273
|
+
), f = m.toFormat("MMM"), y = m.day, I = m.year;
|
|
274
|
+
e += t + " " + o, c !== I && (e += ", " + c), t === f ? e += "-" + y : e += " - " + f + " " + y, e += ", " + I;
|
|
275
|
+
}
|
|
276
|
+
return e;
|
|
277
|
+
}), Oe = p(() => {
|
|
278
|
+
let e = P.value;
|
|
279
|
+
return e = [...new Set(e)], e;
|
|
280
|
+
}), Ce = p(() => {
|
|
281
|
+
const e = g.value?.id;
|
|
282
|
+
if (!e)
|
|
283
|
+
return !1;
|
|
284
|
+
switch (e.value) {
|
|
285
|
+
case "room_notice":
|
|
286
|
+
return v.value.issue && v.value.startDate && v.value.endDate;
|
|
287
|
+
case "complaint":
|
|
288
|
+
return i.value.problem && i.value.guestName && i.value.guestMood;
|
|
289
|
+
case "work_order":
|
|
290
|
+
return n.value.item && n.value.issue && n.value.requestedBy && n.value.due && (n.value.assignType && n.value.assignType.id === 0 || n.value.assignType && n.value.assignType.id === 1 && n.value.department || n.value.assignType && n.value.assignType.id === 2 && n.value.person);
|
|
291
|
+
case "request":
|
|
292
|
+
return u.value.item && u.value.requestedBy && u.value.due && (u.value.assignType && u.value.assignType.id === 0 || u.value.assignType && u.value.assignType.id === 1 && u.value.department || u.value.assignType && u.value.assignType.id === 2 && u.value.person);
|
|
293
|
+
default:
|
|
294
|
+
return !1;
|
|
295
|
+
}
|
|
296
|
+
}), le = () => {
|
|
297
|
+
L.value = !1, C.value = !1, G.value = !1, D.value = [], j.value = [], W.value = [], g.value = null, v.value.issue = null, v.value.startDate = /* @__PURE__ */ new Date(), v.value.endDate = /* @__PURE__ */ new Date(), v.value.notes = "", i.value.guestName = "", i.value.guestEmail = "", i.value.guestPhone = "", i.value.guestMood = null, i.value.guestLoyalty = "", i.value.problem = null, i.value.checkInDate = /* @__PURE__ */ new Date(), i.value.checkOutDate = /* @__PURE__ */ new Date(), i.value.notes = "", n.value.assignType = null, n.value.department = null, n.value.person = null, n.value.due = /* @__PURE__ */ new Date(), n.value.item = null, n.value.issue = null, n.value.notes = "", u.value.assignType = null, u.value.department = null, u.value.person = null, u.value.due = /* @__PURE__ */ new Date(), u.value.item = null, u.value.notes = "";
|
|
298
|
+
}, Re = async () => {
|
|
299
|
+
w("create:callback", r.value), w("toggle", !1);
|
|
300
|
+
}, Ee = (e) => {
|
|
301
|
+
const a = [];
|
|
302
|
+
Object.values(e).forEach((t) => {
|
|
303
|
+
let o = {
|
|
304
|
+
id: t.id,
|
|
305
|
+
isPropertyEmployee: t.sender_type === "user",
|
|
306
|
+
isSent: !!t.sent,
|
|
307
|
+
isSystemMessage: t.sender_type === "system",
|
|
308
|
+
message: t.content,
|
|
309
|
+
timestamp: t.sent || t.created,
|
|
310
|
+
user: {
|
|
311
|
+
firstName: "Auto-Reply",
|
|
312
|
+
icon: "",
|
|
313
|
+
id: "system-message",
|
|
314
|
+
initials: "",
|
|
315
|
+
lastName: "",
|
|
316
|
+
src: ""
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
t.sender_type === "user" && (o.user.firstName = t.user_first_name, o.user.lastName = t.user_last_name, o.user.initials = o.user.firstName[0] + o.user.lastName[0]), t.sender_type === "guest" && (o.user.firstName = t.guest_first_name, o.user.lastName = t.guest_last_name), o.user.initials = o.user.firstName[0] + o.user.lastName[0], o.user.src = "", o.isSystemMessage && (o.user.icon = "property-fill"), t.sender_id && (o.user.id = t.sender_id), a.push(o);
|
|
320
|
+
}), e.value = a;
|
|
321
|
+
}, re = async () => {
|
|
322
|
+
l.showComments && r.value.tokenId;
|
|
323
|
+
}, Me = (e) => {
|
|
324
|
+
const a = h.utc(), t = h.fromFormat(e, "yyyy-MM-dd HH:mm:ss", { zone: "utc" }), o = a.diff(
|
|
325
|
+
t,
|
|
326
|
+
[
|
|
327
|
+
"years",
|
|
328
|
+
"months",
|
|
329
|
+
"days",
|
|
330
|
+
"hours",
|
|
331
|
+
"minutes"
|
|
332
|
+
]
|
|
333
|
+
), c = Math.floor(o.years), m = Math.floor(o.months), f = Math.floor(o.days), y = Math.floor(o.hours), I = Math.floor(o.minutes);
|
|
334
|
+
if (c)
|
|
335
|
+
return c === 1 ? d("HC_ONE_YEAR_AGO") : d("HC_X_YEARS_AGO", { years: c });
|
|
336
|
+
if (m)
|
|
337
|
+
return m === 1 ? d("HC_ONE_MONTH_AGO") : d("HC_X_MONTHS_AGO", { months: m });
|
|
338
|
+
if (f)
|
|
339
|
+
return f === 1 ? d("HC_ONE_DAY_AGO") : d("HC_X_DAYS_AGO", { days: f });
|
|
340
|
+
if (y)
|
|
341
|
+
return y === 1 ? d("HC_ONE_HOUR_AGO") : d("HC_X_HOURS_AGO", { hours: y });
|
|
342
|
+
if (I)
|
|
343
|
+
return I === 1 ? d("HC_ONE_MINUTE_AGO") : d("HC_X_MINUTES_AGO", { minutes: I });
|
|
344
|
+
if (I === 0)
|
|
345
|
+
return d("HC_A_MOMENT_AGO");
|
|
346
|
+
}, Ne = async () => {
|
|
347
|
+
l.showGuestDetails && J(), K(), Y(), w("refresh:pms", r.value);
|
|
348
|
+
}, J = async () => {
|
|
349
|
+
try {
|
|
350
|
+
T.value.pms = !0;
|
|
351
|
+
const e = new AbortController(), a = setTimeout(() => e.abort(), 45e3);
|
|
352
|
+
S.value.push(a);
|
|
353
|
+
const t = l.pmsBaseUrl;
|
|
354
|
+
if (!t)
|
|
355
|
+
throw new Error("PMS base URL is required");
|
|
356
|
+
const o = {
|
|
357
|
+
Authorization: "Bearer " + (() => {
|
|
358
|
+
const y = `; ${document.cookie}`.split("; QV2Auth=");
|
|
359
|
+
return y.length === 2 && y.pop()?.split(";").shift() || "";
|
|
360
|
+
})(),
|
|
361
|
+
"Content-Type": "application/json"
|
|
362
|
+
}, c = await fetch(
|
|
363
|
+
`${t}/vendors/properties/statuses/${l.propertyId}/rooms`,
|
|
364
|
+
{
|
|
365
|
+
method: "GET",
|
|
366
|
+
headers: o,
|
|
367
|
+
signal: e.signal
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
clearTimeout(a), c.ok || ie(c);
|
|
371
|
+
const m = await c.json();
|
|
372
|
+
M.value = m.data.pmsRooms, r.value = M.value.find(
|
|
373
|
+
(f) => f.qv2Rooms.qRoomId === l.room.id
|
|
374
|
+
), r.value || (r.value = l.room), T.value.pms = !1;
|
|
375
|
+
} catch (e) {
|
|
376
|
+
return T.value.pms = !1, e;
|
|
377
|
+
}
|
|
378
|
+
}, K = async () => {
|
|
379
|
+
try {
|
|
380
|
+
T.value.roomNotices = !0;
|
|
381
|
+
const e = await fetch(
|
|
382
|
+
"/api/client/common/getRoomNotices.php?propertyId=" + l.propertyId + "&roomIds=[" + l.room.id + "]"
|
|
383
|
+
);
|
|
384
|
+
if (!e.ok)
|
|
385
|
+
throw new Error(`HTTP error! status: ${e.status}`);
|
|
386
|
+
const a = await e.json();
|
|
387
|
+
P.value = a.notices;
|
|
388
|
+
} catch (e) {
|
|
389
|
+
console.error("Error getting room notices:", e), P.value = [];
|
|
390
|
+
} finally {
|
|
391
|
+
T.value.roomNotices = !1;
|
|
392
|
+
}
|
|
393
|
+
}, V = async () => {
|
|
394
|
+
const e = new FormData();
|
|
395
|
+
e.append("property_id", l.propertyId), e.append("filter", "tasks_new"), await Promise.all([
|
|
396
|
+
fetch("/api/client/common/getDepartments.php", {
|
|
397
|
+
method: "POST"
|
|
398
|
+
}),
|
|
399
|
+
fetch("/api/client/common/getDepartmentUsersByPropertyId.php", {
|
|
400
|
+
method: "POST",
|
|
401
|
+
body: e
|
|
402
|
+
})
|
|
403
|
+
]).then((a) => {
|
|
404
|
+
const t = a[0], o = a[1];
|
|
405
|
+
console.log("departmentList:", t), console.log("departmentUsersList:", o);
|
|
406
|
+
});
|
|
407
|
+
}, ue = async () => {
|
|
408
|
+
try {
|
|
409
|
+
const e = new FormData();
|
|
410
|
+
e.append("funcname", "get_stay_details"), e.append("token_id", r.value.tokenId);
|
|
411
|
+
const t = (await U.post(
|
|
412
|
+
"/includes/chat_api.php",
|
|
413
|
+
e
|
|
414
|
+
)).data.result;
|
|
415
|
+
if (t !== void 0 && t.error_message)
|
|
416
|
+
throw new Error(t.error_message);
|
|
417
|
+
t && t.user_name && (i.value.guestName = t.user_name), t && t.cell_phone && (i.value.guestPhone = t.cell_phone), t && t.email && (i.value.guestEmail = t.email), t && t.check_in && (i.value.checkInDate = h(
|
|
418
|
+
t.check_in
|
|
419
|
+
).toDate()), t && t.check_out && (i.value.checkOutDate = h(
|
|
420
|
+
t.check_out
|
|
421
|
+
).toDate());
|
|
422
|
+
} catch (e) {
|
|
423
|
+
console.log(e);
|
|
424
|
+
}
|
|
425
|
+
}, Se = (e) => {
|
|
426
|
+
switch (e) {
|
|
427
|
+
case "complaint":
|
|
428
|
+
return "red-30";
|
|
429
|
+
case "hk_request":
|
|
430
|
+
return "maroon-30";
|
|
431
|
+
case "callback":
|
|
432
|
+
return "teal-10";
|
|
433
|
+
case "workorder":
|
|
434
|
+
return "orange-20";
|
|
435
|
+
case "task":
|
|
436
|
+
return "green-20";
|
|
437
|
+
}
|
|
438
|
+
}, qe = (e) => {
|
|
439
|
+
switch (e) {
|
|
440
|
+
case "complaint":
|
|
441
|
+
return "face-frown";
|
|
442
|
+
case "hk_request":
|
|
443
|
+
return "concierge-bell";
|
|
444
|
+
case "callback":
|
|
445
|
+
return "phone";
|
|
446
|
+
case "workorder":
|
|
447
|
+
return "hammer";
|
|
448
|
+
case "task":
|
|
449
|
+
return "check";
|
|
450
|
+
}
|
|
451
|
+
}, Y = async () => {
|
|
452
|
+
try {
|
|
453
|
+
T.value.tickets = !0;
|
|
454
|
+
const e = await fetch(
|
|
455
|
+
"/api/client/common/getAllToDos.php?propertyId=" + l.propertyId + "&roomIds=[" + l.room.id + "]"
|
|
456
|
+
);
|
|
457
|
+
if (!e.ok)
|
|
458
|
+
throw new Error(`HTTP error! status: ${e.status}`);
|
|
459
|
+
const a = await e.json();
|
|
460
|
+
_.value = a.tickets;
|
|
461
|
+
} catch (e) {
|
|
462
|
+
console.error("Error getting tickets:", e), _.value = [];
|
|
463
|
+
} finally {
|
|
464
|
+
T.value.tickets = !1;
|
|
465
|
+
}
|
|
466
|
+
}, ie = async (e) => {
|
|
467
|
+
const a = await e.text();
|
|
468
|
+
let t;
|
|
469
|
+
try {
|
|
470
|
+
t = JSON.parse(a).response;
|
|
471
|
+
} catch {
|
|
472
|
+
t = { code: e.status, message: a };
|
|
473
|
+
}
|
|
474
|
+
return t.code === 401 ? (window.location.href = "/logout.php?unauthorized=1", { error: t }) : t;
|
|
475
|
+
}, He = (e) => {
|
|
476
|
+
const a = document.querySelectorAll(".pulse");
|
|
477
|
+
if (a && a.length) {
|
|
478
|
+
const t = document.getElementById(
|
|
479
|
+
"room-" + r.value.qv2Rooms.qRoomId
|
|
480
|
+
), o = t?.classList;
|
|
481
|
+
switch (e) {
|
|
482
|
+
case "room_notice":
|
|
483
|
+
(o?.contains("roombox_unsel") || o?.contains("roombox_unsel_active")) && (t?.classList.remove(), t?.classList.add("roomnoticeroombox_sel"));
|
|
484
|
+
break;
|
|
485
|
+
case "complaint":
|
|
486
|
+
!o?.contains("smsroombox_sel") && !o?.contains("callbackroombox_sel") && (t?.classList.remove(), t?.classList.add("complaintsroombox_sel"));
|
|
487
|
+
break;
|
|
488
|
+
case "request":
|
|
489
|
+
!o?.contains("smsroombox_sel") && !o?.contains("callbackroombox_sel") && !o?.contains("complaintsroombox_sel") && (t?.classList.remove(), t?.classList.add("guestrequestroombox_sel"));
|
|
490
|
+
break;
|
|
491
|
+
case "work_order":
|
|
492
|
+
!o?.contains("smsroombox_sel") && !o?.contains("callbackroombox_sel") && !o?.contains("complaintsroombox_sel") && !o?.contains("guestrequestroombox_sel") && (t?.classList.remove(), t?.classList.add("workordersroombox_sel"));
|
|
493
|
+
break;
|
|
494
|
+
}
|
|
495
|
+
const c = setTimeout(() => {
|
|
496
|
+
a.forEach((m) => {
|
|
497
|
+
m.classList.remove("pulse");
|
|
498
|
+
});
|
|
499
|
+
}, 4500);
|
|
500
|
+
S.value.push(c);
|
|
501
|
+
}
|
|
502
|
+
}, Ae = () => {
|
|
503
|
+
window.location.href = "/guest/overview.php";
|
|
504
|
+
}, Be = (e) => {
|
|
505
|
+
let a = "";
|
|
506
|
+
switch (e.type) {
|
|
507
|
+
case "complaint":
|
|
508
|
+
a = `/complaints/complaints_view.php?id=${e.id}`;
|
|
509
|
+
break;
|
|
510
|
+
case "request":
|
|
511
|
+
a = `/tasks/hk_request.php?id=${e.id}`;
|
|
512
|
+
break;
|
|
513
|
+
case "satisfaction-call":
|
|
514
|
+
a = `/tasks/task_callback.php?id=${e.id}`;
|
|
515
|
+
break;
|
|
516
|
+
case "work-order":
|
|
517
|
+
a = `/tasks/workorder.php?id=${e.id}`;
|
|
518
|
+
break;
|
|
519
|
+
case "task":
|
|
520
|
+
a = `/tasks/task.php?id=${e.id}`;
|
|
521
|
+
break;
|
|
522
|
+
default:
|
|
523
|
+
return "#";
|
|
524
|
+
}
|
|
525
|
+
window.open(a);
|
|
526
|
+
}, Pe = async () => {
|
|
527
|
+
const e = {
|
|
528
|
+
type: g.value?.id,
|
|
529
|
+
propertyId: l.propertyId,
|
|
530
|
+
userId: x.value,
|
|
531
|
+
areaId: r.value.qv2Rooms.qRoomId,
|
|
532
|
+
areaName: r.value.qv2Rooms.qRoomName
|
|
533
|
+
};
|
|
534
|
+
switch (g.value?.id) {
|
|
535
|
+
case "complaint":
|
|
536
|
+
e.tokenId = r.value.tokenId, e.problem = i.value.problem.id, e.guestName = i.value.guestName, e.guestPhone = i.value.guestPhone, e.guestEmail = i.value.guestEmail, e.guestLoyalty = i.value.guestLoyalty, e.guestMood = i.value.guestMood.id, e.checkInDate = h(i.value.checkInDate).format(
|
|
537
|
+
"YYYY-MM-DD"
|
|
538
|
+
), e.notes = i.value.notes, e.inHouse = "2", e.source = "dashboard", w("create:todo", e);
|
|
539
|
+
break;
|
|
540
|
+
case "request":
|
|
541
|
+
e.itemId = u.value.item.id, e.assignType = u.value.assignType.id, e.occupied = u.value.requestedBy.id, e.notes = u.value.notes, e.dueDate = h(u.value.due).format("YYYY-MM-DD"), u.value.assignType.id === 1 && (e.department = u.value.department.id), u.value.assignType.id === 2 && (e.person = u.value.person.id), w("create:todo", e);
|
|
542
|
+
break;
|
|
543
|
+
case "room_notice":
|
|
544
|
+
e.issue = v.value.issue.id, e.startDate = h(v.value.startDate).format("YYYY-MM-DD"), e.endDate = h(v.value.endDate).format("YYYY-MM-DD"), e.notes = v.value.notes, e.sendPush = "1", w("create:todo", e);
|
|
545
|
+
break;
|
|
546
|
+
case "work_order":
|
|
547
|
+
e.itemId = n.value.item.id, e.issueId = n.value.issue.id, e.assignType = n.value.assignType.id, e.occupied = n.value.requestedBy.id, e.notes = n.value.notes, e.dueDate = h(n.value.due).format("YYYY-MM-DD"), n.value.assignType.id === 1 && (e.department = n.value.department.id), n.value.assignType.id === 2 && (e.person = n.value.person.id), w("create:todo", e);
|
|
548
|
+
break;
|
|
549
|
+
}
|
|
550
|
+
}, Le = (e) => {
|
|
551
|
+
ee(), te(), l.hover && w("toggle", e);
|
|
552
|
+
}, xe = (e) => {
|
|
553
|
+
de(), k.value = e;
|
|
554
|
+
}, Ye = async (e) => {
|
|
555
|
+
if (console.log("selected:", e), g.value = e, D.value = [], v.value.issue = null, i.value.problem = null, n.value.item = null, n.value.issue = null, u.value.item = null, !g.value)
|
|
556
|
+
return;
|
|
557
|
+
const a = new FormData();
|
|
558
|
+
switch (a.append("property_id", l.propertyId), a.append("area_id", r.value.qv2Rooms.qRoomId), e.id) {
|
|
559
|
+
case "complaint":
|
|
560
|
+
try {
|
|
561
|
+
r.value.tokenId && await ue();
|
|
562
|
+
const t = await fetch("/api/client/common/getComplaintProblemsByPropertyId.php", {
|
|
563
|
+
method: "POST",
|
|
564
|
+
body: a
|
|
565
|
+
});
|
|
566
|
+
console.log("complaints:", t);
|
|
567
|
+
const o = await U.post(
|
|
568
|
+
"/api/client/common/getComplaintMoods.php"
|
|
569
|
+
);
|
|
570
|
+
o.data.items.forEach((c) => {
|
|
571
|
+
c.label = c.display_name;
|
|
572
|
+
}), j.value = o.data.items;
|
|
573
|
+
} catch (t) {
|
|
574
|
+
console.log(t);
|
|
575
|
+
}
|
|
576
|
+
break;
|
|
577
|
+
case "room_notice":
|
|
578
|
+
try {
|
|
579
|
+
const t = await fetch("/api/client/common/getRoomNoticeListByPropertyId.php", {
|
|
580
|
+
method: "POST",
|
|
581
|
+
body: a
|
|
582
|
+
});
|
|
583
|
+
console.log("room notices:", t);
|
|
584
|
+
} catch (t) {
|
|
585
|
+
console.log(t);
|
|
586
|
+
}
|
|
587
|
+
break;
|
|
588
|
+
case "request":
|
|
589
|
+
try {
|
|
590
|
+
u.value.requestedBy = N.value[1], u.value.assignType = H.value[0];
|
|
591
|
+
const t = await fetch("/api/client/common/getHousekeepingItemsByPropertyId.php", {
|
|
592
|
+
method: "POST",
|
|
593
|
+
body: a
|
|
594
|
+
});
|
|
595
|
+
console.log("requests:", t), await V(), u.value.department = O.value.find(
|
|
596
|
+
(o) => parseInt(o.id) === 4
|
|
597
|
+
);
|
|
598
|
+
} catch (t) {
|
|
599
|
+
console.log(t);
|
|
600
|
+
}
|
|
601
|
+
break;
|
|
602
|
+
case "work_order":
|
|
603
|
+
try {
|
|
604
|
+
n.value.requestedBy = N.value[0], n.value.assignType = H.value[0];
|
|
605
|
+
const t = await fetch("/api/client/common/getItemsByRoomId.php", {
|
|
606
|
+
method: "POST",
|
|
607
|
+
body: a
|
|
608
|
+
});
|
|
609
|
+
console.log("work orders:", t);
|
|
610
|
+
const o = [];
|
|
611
|
+
let c = {
|
|
612
|
+
group: "",
|
|
613
|
+
options: []
|
|
614
|
+
};
|
|
615
|
+
o.push({ ...c }), D.value = o, await Promise.all([
|
|
616
|
+
U.post(
|
|
617
|
+
"/api/client/common/getWorkOrderIssues.php"
|
|
618
|
+
),
|
|
619
|
+
V()
|
|
620
|
+
]).then((m) => {
|
|
621
|
+
const f = m[0];
|
|
622
|
+
f.data.issues.forEach((y) => {
|
|
623
|
+
y.label = y.display_name;
|
|
624
|
+
}), W.value = f.data.issues;
|
|
625
|
+
}), n.value.department = O.value.find(
|
|
626
|
+
(m) => parseInt(m.id) === 2
|
|
627
|
+
);
|
|
628
|
+
} catch (t) {
|
|
629
|
+
console.log(t);
|
|
630
|
+
}
|
|
631
|
+
break;
|
|
632
|
+
default:
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
}, Ue = () => {
|
|
636
|
+
L.value = !L.value, G.value = !1;
|
|
637
|
+
}, ce = () => {
|
|
638
|
+
const e = document.getElementById("comment-field"), a = document.getElementById("hidden-text");
|
|
639
|
+
e.style.height = a?.offsetHeight + "px";
|
|
640
|
+
}, Z = () => {
|
|
641
|
+
const e = document.getElementById("comments-container");
|
|
642
|
+
e?.scroll({
|
|
643
|
+
top: e.scrollHeight,
|
|
644
|
+
behavior: "smooth"
|
|
645
|
+
});
|
|
646
|
+
}, Ge = async (e) => {
|
|
647
|
+
if (e && e.type === "keydown" && e.preventDefault(), r.value.tokenId && k.value && !C.value)
|
|
648
|
+
try {
|
|
649
|
+
const a = new FormData();
|
|
650
|
+
a.append("funcname", "send_message_to_guest"), a.append("stay_id", r.value.tokenId), a.append("content", k.value), a.append("sender_id", x.value || "");
|
|
651
|
+
const t = await U.post(
|
|
652
|
+
"/includes/chat_api.php",
|
|
653
|
+
a
|
|
654
|
+
);
|
|
655
|
+
if (t.data.result.error_message)
|
|
656
|
+
throw new Error(t.data.result.error_message);
|
|
657
|
+
k.value = "", await re(), Z();
|
|
658
|
+
} catch (a) {
|
|
659
|
+
console.log(a);
|
|
660
|
+
}
|
|
661
|
+
}, ee = () => {
|
|
662
|
+
if (l.align === "left" || l.align === "right") {
|
|
663
|
+
const e = q.value?.getBoundingClientRect().left, a = window.innerWidth;
|
|
664
|
+
Q.value = a - e < E.value ? "right" : "left";
|
|
665
|
+
} else {
|
|
666
|
+
const e = q.value?.getBoundingClientRect().top, a = window.innerHeight;
|
|
667
|
+
Q.value = a - e < R.value ? "bottom" : "top";
|
|
668
|
+
}
|
|
669
|
+
}, te = () => {
|
|
670
|
+
if (l.position === "top" || l.position === "bottom") {
|
|
671
|
+
const e = q.value?.getBoundingClientRect().top, a = window.innerHeight;
|
|
672
|
+
$.value = a - e < R.value ? "top" : "bottom";
|
|
673
|
+
} else {
|
|
674
|
+
const e = q.value?.getBoundingClientRect().left, a = window.innerWidth;
|
|
675
|
+
$.value = a - e < E.value ? "left" : "right";
|
|
676
|
+
}
|
|
677
|
+
}, de = () => {
|
|
678
|
+
C.value = !C.value, C.value ? (k.value = "", b.value.info = A.value, b.value.tickets = B.value, b.value.comments = F.value, A.value = !1, B.value = !1, document.getElementById("comment-field")?.focus()) : (A.value = b.value.info, B.value = b.value.tickets, F.value = b.value.comments);
|
|
679
|
+
}, Qe = async (e, a) => {
|
|
680
|
+
const t = new FormData();
|
|
681
|
+
if (t.append("property_id", l.propertyId), t.append(
|
|
682
|
+
"room_ids",
|
|
683
|
+
JSON.stringify([r.value.qv2Rooms.qRoomId])
|
|
684
|
+
), await Y(), _.value) {
|
|
685
|
+
const o = [];
|
|
686
|
+
_.value.forEach((c) => {
|
|
687
|
+
c.id === e && c.type === a ? o.unshift({
|
|
688
|
+
...c,
|
|
689
|
+
isNew: !0
|
|
690
|
+
}) : o.push({
|
|
691
|
+
...c,
|
|
692
|
+
isNew: !1
|
|
693
|
+
});
|
|
694
|
+
}), o.sort((c, m) => c.id === e ? -1 : m.id === e ? 1 : 0), _.value = [...o];
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
return ae(() => l.open, () => {
|
|
698
|
+
if (l.open && l.showComments && oe.value.length) {
|
|
699
|
+
const e = setTimeout(Z, 500);
|
|
700
|
+
S.value.push(e);
|
|
701
|
+
}
|
|
702
|
+
l.open || le();
|
|
703
|
+
}), ae(k, () => {
|
|
704
|
+
const e = setTimeout(ce, 100);
|
|
705
|
+
S.value.push(e);
|
|
706
|
+
}), ae(
|
|
707
|
+
() => l.room.id,
|
|
708
|
+
(e, a) => {
|
|
709
|
+
e !== a && (M.value ? (r.value = M.value.find((t) => t.qv2Rooms.qRoomId === l.room.id), r.value || (r.value = l.room)) : r.value = l.room, Y(), K());
|
|
710
|
+
},
|
|
711
|
+
{ immediate: !0 }
|
|
712
|
+
), je(async () => {
|
|
713
|
+
const e = JSON.parse(
|
|
714
|
+
window.localStorage.getItem("authenticated")
|
|
715
|
+
);
|
|
716
|
+
x.value = e?.user?.id || "", l.showGuestDetails ? await J() : r.value = l.room, l.size === "sm" && (R.value = 140, E.value = 160), l.size === "lg" && (R.value = 250, E.value = 440), ee(), te();
|
|
717
|
+
const a = [], t = window.localStorage.getItem("quick-replies");
|
|
718
|
+
t && JSON.parse(t).forEach((o) => {
|
|
719
|
+
a.push(o.message);
|
|
720
|
+
}), z.value = a;
|
|
721
|
+
}), $e(() => {
|
|
722
|
+
S.value.forEach((e) => {
|
|
723
|
+
clearTimeout(e);
|
|
724
|
+
});
|
|
725
|
+
}), {
|
|
726
|
+
DateTime: h,
|
|
727
|
+
// Refs
|
|
728
|
+
actionMenuOpen: G,
|
|
729
|
+
alignment: Q,
|
|
730
|
+
assignTypes: H,
|
|
731
|
+
comment: k,
|
|
732
|
+
complaint: i,
|
|
733
|
+
componentHeight: R,
|
|
734
|
+
componentWidth: E,
|
|
735
|
+
departments: O,
|
|
736
|
+
departmentUsers: me,
|
|
737
|
+
expandComments: F,
|
|
738
|
+
expandGuestInfo: A,
|
|
739
|
+
expandedStates: b,
|
|
740
|
+
expandTickets: B,
|
|
741
|
+
guestDetailsData: pe,
|
|
742
|
+
itemOptions: D,
|
|
743
|
+
loading: T,
|
|
744
|
+
messages: oe,
|
|
745
|
+
moodOptions: j,
|
|
746
|
+
pmsData: M,
|
|
747
|
+
positioning: $,
|
|
748
|
+
quickReplies: z,
|
|
749
|
+
quickReplyOpen: C,
|
|
750
|
+
request: u,
|
|
751
|
+
requestedByOptions: N,
|
|
752
|
+
requestLoading: ve,
|
|
753
|
+
requestType: g,
|
|
754
|
+
roomDetailsData: r,
|
|
755
|
+
roomNotice: v,
|
|
756
|
+
roomNotices: P,
|
|
757
|
+
showCreateRequest: L,
|
|
758
|
+
ticketsList: _,
|
|
759
|
+
todoOptions: fe,
|
|
760
|
+
trigger: q,
|
|
761
|
+
userId: x,
|
|
762
|
+
workOrder: n,
|
|
763
|
+
workOrderIssues: W,
|
|
764
|
+
// Computed
|
|
765
|
+
cleanliness: X,
|
|
766
|
+
cleanlinessColor: ye,
|
|
767
|
+
cleanlinessTooltipContent: he,
|
|
768
|
+
filteredReplies: ge,
|
|
769
|
+
hasGuestCallback: _e,
|
|
770
|
+
hasComplaint: se,
|
|
771
|
+
itemOptionsList: we,
|
|
772
|
+
occupied: ne,
|
|
773
|
+
occupancyTooltipContent: ke,
|
|
774
|
+
selectedAssignType: De,
|
|
775
|
+
selectedDepartment: Te,
|
|
776
|
+
selectedRequestedBy: be,
|
|
777
|
+
stayDetails: Ie,
|
|
778
|
+
tagsList: Oe,
|
|
779
|
+
validateToDo: Ce,
|
|
780
|
+
// Methods
|
|
781
|
+
closeRequest: le,
|
|
782
|
+
createCallback: Re,
|
|
783
|
+
createMessageList: Ee,
|
|
784
|
+
getChatMessages: re,
|
|
785
|
+
getHowLongAgo: Me,
|
|
786
|
+
getPMSData: J,
|
|
787
|
+
getRoomNotices: K,
|
|
788
|
+
getSharedData: V,
|
|
789
|
+
getStayDetails: ue,
|
|
790
|
+
getTicketColor: Se,
|
|
791
|
+
getTicketIcon: qe,
|
|
792
|
+
getTickets: Y,
|
|
793
|
+
handleFailedResponse: ie,
|
|
794
|
+
handlePulse: He,
|
|
795
|
+
onClickEditConnectGuest: Ae,
|
|
796
|
+
onClickTicket: Be,
|
|
797
|
+
onCreateRequestSubmit: Pe,
|
|
798
|
+
onHoverToggle: Le,
|
|
799
|
+
onSelectQuickReply: xe,
|
|
800
|
+
onSelectToDo: Ye,
|
|
801
|
+
openRequest: Ue,
|
|
802
|
+
refreshPMSData: Ne,
|
|
803
|
+
resizeTextarea: ce,
|
|
804
|
+
scrollToConnectBottom: Z,
|
|
805
|
+
sendChatMessage: Ge,
|
|
806
|
+
setAlignment: ee,
|
|
807
|
+
setPositioning: te,
|
|
808
|
+
toggleQuickReply: de,
|
|
809
|
+
updateTickets: Qe
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
});
|
|
813
|
+
export {
|
|
814
|
+
ht as default
|
|
815
|
+
};
|