vue-wiguet-chatweb 0.0.6 → 0.0.7
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/style.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
.bubble[data-v-a066bde3]{--r: 25px;--t: 30px;max-width:50%;min-width:250px;padding:calc(2*var(--r)/3);-webkit-mask:radial-gradient(var(--t) at var(--_d) 0,#0000 98%,#000 102%) var(--_d) 100%/calc(100% - var(--r)) var(--t) no-repeat,conic-gradient(at var(--r) var(--r),#000 75%,#0000 0) calc(var(--r)/-2) calc(var(--r)/-2) padding-box,radial-gradient(50% 50%,#000 98%,#0000 101%) 0 0/var(--r) var(--r) space padding-box;color:#fff}.left[data-v-a066bde3]{--_d: 0%;border-left:var(--t) solid #0000;margin-right:var(--t);background-color:#fcd7ae;color:#4d4d4d;place-self:start}.bubble>.content-left[data-v-a066bde3]{margin-right:10px;margin-bottom:1px}.right[data-v-a066bde3]{--_d: 100%;border-right:var(--t) solid #0000;margin-left:var(--t);background-color:#fdeedb;color:#4d4d4d;place-self:end}.bubble>.content-right[data-v-a066bde3]{margin-bottom:1px;margin-right:10px}.message[data-v-a066bde3]{text-align:initial;word-break:break-all;margin-bottom:10px}.detail-message[data-v-a066bde3]{font-size:10px;color:gray;display:flex;justify-content:space-between}.chat-message[data-v-a066bde3]{max-width:250px;min-width:90%;display:flex;flex-direction:column;justify-content:center}.header-widget[data-v-
|
1
|
+
.bubble[data-v-a066bde3]{--r: 25px;--t: 30px;max-width:50%;min-width:250px;padding:calc(2*var(--r)/3);-webkit-mask:radial-gradient(var(--t) at var(--_d) 0,#0000 98%,#000 102%) var(--_d) 100%/calc(100% - var(--r)) var(--t) no-repeat,conic-gradient(at var(--r) var(--r),#000 75%,#0000 0) calc(var(--r)/-2) calc(var(--r)/-2) padding-box,radial-gradient(50% 50%,#000 98%,#0000 101%) 0 0/var(--r) var(--r) space padding-box;color:#fff}.left[data-v-a066bde3]{--_d: 0%;border-left:var(--t) solid #0000;margin-right:var(--t);background-color:#fcd7ae;color:#4d4d4d;place-self:start}.bubble>.content-left[data-v-a066bde3]{margin-right:10px;margin-bottom:1px}.right[data-v-a066bde3]{--_d: 100%;border-right:var(--t) solid #0000;margin-left:var(--t);background-color:#fdeedb;color:#4d4d4d;place-self:end}.bubble>.content-right[data-v-a066bde3]{margin-bottom:1px;margin-right:10px}.message[data-v-a066bde3]{text-align:initial;word-break:break-all;margin-bottom:10px}.detail-message[data-v-a066bde3]{font-size:10px;color:gray;display:flex;justify-content:space-between}.chat-message[data-v-a066bde3]{max-width:250px;min-width:90%;display:flex;flex-direction:column;justify-content:center}.header-widget[data-v-c01e1ae3]{height:10%;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #CCCCCC;margin-bottom:10px}.jl2-input-chat[data-v-c01e1ae3]{padding-left:10px;height:40px;width:95%}.jl2-input-chat[data-v-c01e1ae3]:focus-visible{outline:none}.jl-inputgroup-chat[data-v-c01e1ae3]{width:100%;border:1px solid;border-color:#f28b0c;background:var(--surface-a);color:var(--surface-500);-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:13px;display:flex;justify-content:space-around;align-items:center}.jl-inputgroup-chat>input[data-v-c01e1ae3]{border:none;background:none}.jl-inputgroup-chat>input[data-v-c01e1ae3]:hover{outline:none}.form-message[data-v-c01e1ae3]{display:flex;justify-content:space-between}.form-message button[data-v-c01e1ae3],.jl-inputgroup-chat>button[data-v-c01e1ae3]{border:none!important;background:none}.form-message button[data-v-c01e1ae3],.jl-inputgroup-chat>button[data-v-c01e1ae3]:focus{box-shadow:none}.form-message button[data-v-c01e1ae3],.jl-inputgroup-chat>button[data-v-c01e1ae3]:active{box-shadow:none}.widget[data-v-c01e1ae3]{margin:auto;height:100%;display:flex;width:100%;flex-direction:column;justify-content:space-evenly}.messages-container[data-v-c01e1ae3]{height:80%;overflow-y:scroll;border-left:1px solid var(--fge-gray-lines-color);border-right:1px solid var(--fge-gray-lines-color);scrollbar-color:red transparent;scrollbar-width:thin;scrollbar-color:#F28B0C transparent;scrollbar-track-color:transparent;scrollbar-face-color:#F28B0C;scrollbar-thumb-color:#F28B0C}.messages-container[data-v-c01e1ae3]::-webkit-scrollbar{width:8px}.messages-container[data-v-c01e1ae3]::-webkit-scrollbar-track{background-color:transparent}.messages-container[data-v-c01e1ae3]::-webkit-scrollbar-thumb{background-color:#f28b0c;border-radius:8px}.input-message[data-v-c01e1ae3]{border-left:1px solid var(--fge-gray-lines-color);border-right:1px solid var(--fge-gray-lines-color)}.message-send[data-v-c01e1ae3]{border-top:1px solid var(--fge-gray-lines-color);padding-top:20px;width:90%;margin:auto}.bubble[data-v-c01e1ae3]{--r: 25px;--t: 30px;max-width:50%;min-width:250px;padding:calc(2*var(--r)/3);-webkit-mask:radial-gradient(var(--t) at var(--_d) 0,#0000 98%,#000 102%) var(--_d) 100%/calc(100% - var(--r)) var(--t) no-repeat,conic-gradient(at var(--r) var(--r),#000 75%,#0000 0) calc(var(--r)/-2) calc(var(--r)/-2) padding-box,radial-gradient(50% 50%,#000 98%,#0000 101%) 0 0/var(--r) var(--r) space padding-box;color:#fff}.left[data-v-c01e1ae3]{--_d: 0%;border-left:var(--t) solid #0000;margin-right:var(--t);background-color:#fcd7ae;color:#4d4d4d;place-self:start}.bubble>.content-left[data-v-c01e1ae3]{margin-right:10px;margin-bottom:1px}.right[data-v-c01e1ae3]{--_d: 100%;border-right:var(--t) solid #0000;margin-left:var(--t);background-color:#fdeedb;color:#4d4d4d;place-self:end}.bubble>.content-right[data-v-c01e1ae3]{margin-bottom:1px;margin-right:10px}.message[data-v-c01e1ae3]{text-align:initial;word-break:break-all;margin-bottom:10px}.detail-message[data-v-c01e1ae3]{font-size:10px;color:gray}.chat-message[data-v-c01e1ae3]{max-width:250px;min-width:90%;display:flex;flex-direction:column;justify-content:center}#chat-circle[data-v-c01e1ae3]{margin:auto;position:fixed;bottom:50px;right:50px;color:#fff;cursor:pointer}.chat-box[data-v-c01e1ae3]{display:flex;justify-content:center;align-items:center;border:2px solid #d9d9d9;border-radius:25px;padding:5px 15px 30px;background:#ffffff;position:fixed;right:30px;bottom:50px;width:450px;height:70vh;max-width:85vw;max-height:80vh;box-shadow:0 5px 35px 9px #ccc}.header-widget[data-v-4b17fe0e]{height:10%;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #CCCCCC;margin-bottom:10px}.jl2-input-chat[data-v-4b17fe0e]{padding-left:10px;height:40px;width:95%}.jl2-input-chat[data-v-4b17fe0e]:focus-visible{outline:none}.jl-inputgroup-chat[data-v-4b17fe0e]{width:100%;border:1px solid;border-color:#f28b0c;background:var(--surface-a);color:var(--surface-500);-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:13px;display:flex;justify-content:space-around;align-items:center}.jl-inputgroup-chat>input[data-v-4b17fe0e]{border:none;background:none}.jl-inputgroup-chat>input[data-v-4b17fe0e]:hover{outline:none}.form-message[data-v-4b17fe0e]{display:flex;justify-content:space-between}.form-message button[data-v-4b17fe0e],.jl-inputgroup-chat>button[data-v-4b17fe0e]{border:none!important;background:none}.form-message button[data-v-4b17fe0e],.jl-inputgroup-chat>button[data-v-4b17fe0e]:focus{box-shadow:none}.form-message button[data-v-4b17fe0e],.jl-inputgroup-chat>button[data-v-4b17fe0e]:active{box-shadow:none}.widget[data-v-4b17fe0e]{margin:auto;height:100%;display:flex;width:100%;flex-direction:column;justify-content:space-evenly}.messages-container[data-v-4b17fe0e]{height:80%;overflow-y:scroll;border-left:1px solid var(--fge-gray-lines-color);border-right:1px solid var(--fge-gray-lines-color);scrollbar-color:red transparent;scrollbar-width:thin;scrollbar-color:#F28B0C transparent;scrollbar-track-color:transparent;scrollbar-face-color:#F28B0C;scrollbar-thumb-color:#F28B0C}.messages-container[data-v-4b17fe0e]::-webkit-scrollbar{width:8px}.messages-container[data-v-4b17fe0e]::-webkit-scrollbar-track{background-color:transparent}.messages-container[data-v-4b17fe0e]::-webkit-scrollbar-thumb{background-color:#f28b0c;border-radius:8px}.input-message[data-v-4b17fe0e]{border-left:1px solid var(--fge-gray-lines-color);border-right:1px solid var(--fge-gray-lines-color)}.message-send[data-v-4b17fe0e]{border-top:1px solid var(--fge-gray-lines-color);padding-top:20px;width:90%;margin:auto}.bubble[data-v-4b17fe0e]{--r: 25px;--t: 30px;max-width:50%;min-width:250px;padding:calc(2*var(--r)/3);-webkit-mask:radial-gradient(var(--t) at var(--_d) 0,#0000 98%,#000 102%) var(--_d) 100%/calc(100% - var(--r)) var(--t) no-repeat,conic-gradient(at var(--r) var(--r),#000 75%,#0000 0) calc(var(--r)/-2) calc(var(--r)/-2) padding-box,radial-gradient(50% 50%,#000 98%,#0000 101%) 0 0/var(--r) var(--r) space padding-box;color:#fff}.left[data-v-4b17fe0e]{--_d: 0%;border-left:var(--t) solid #0000;margin-right:var(--t);background-color:#fcd7ae;color:#4d4d4d;place-self:start}.bubble>.content-left[data-v-4b17fe0e]{margin-right:10px;margin-bottom:1px}.right[data-v-4b17fe0e]{--_d: 100%;border-right:var(--t) solid #0000;margin-left:var(--t);background-color:#fdeedb;color:#4d4d4d;place-self:end}.bubble>.content-right[data-v-4b17fe0e]{margin-bottom:1px;margin-right:10px}.message[data-v-4b17fe0e]{text-align:initial;word-break:break-all;margin-bottom:10px}.detail-message[data-v-4b17fe0e]{font-size:10px;color:gray}.chat-message[data-v-4b17fe0e]{max-width:250px;min-width:90%;display:flex;flex-direction:column;justify-content:center}#chat-circle[data-v-4b17fe0e]{margin:auto;position:fixed;bottom:50px;right:50px;color:#fff;cursor:pointer}.chat-box[data-v-4b17fe0e]{display:flex;justify-content:center;align-items:center;border:2px solid #d9d9d9;border-radius:25px;padding:5px 15px 30px;background:#ffffff;position:fixed;right:30px;bottom:50px;width:450px;height:70vh;max-width:85vw;max-height:80vh;box-shadow:0 5px 35px 9px #ccc}
|
@@ -386,7 +386,7 @@ function Xe(e, t) {
|
|
386
386
|
function $r(e, t, s) {
|
387
387
|
t != null && O(Kt, e) && Kt[e](t, s._a, s, e);
|
388
388
|
}
|
389
|
-
var L = 0, ue = 1, te = 2,
|
389
|
+
var L = 0, ue = 1, te = 2, A = 3, J = 4, de = 5, ve = 6, jr = 7, Gr = 8;
|
390
390
|
function zr(e, t) {
|
391
391
|
return (e % t + t) % t;
|
392
392
|
}
|
@@ -808,32 +808,32 @@ _("hmm", an);
|
|
808
808
|
_("hmmss", on);
|
809
809
|
_("Hmm", an);
|
810
810
|
_("Hmmss", on);
|
811
|
-
C(["H", "HH"],
|
811
|
+
C(["H", "HH"], A);
|
812
812
|
C(["k", "kk"], function(e, t, s) {
|
813
813
|
var n = S(e);
|
814
|
-
t[
|
814
|
+
t[A] = n === 24 ? 0 : n;
|
815
815
|
});
|
816
816
|
C(["a", "A"], function(e, t, s) {
|
817
817
|
s._isPm = s._locale.isPM(e), s._meridiem = e;
|
818
818
|
});
|
819
819
|
C(["h", "hh"], function(e, t, s) {
|
820
|
-
t[
|
820
|
+
t[A] = S(e), w(s).bigHour = !0;
|
821
821
|
});
|
822
822
|
C("hmm", function(e, t, s) {
|
823
823
|
var n = e.length - 2;
|
824
|
-
t[
|
824
|
+
t[A] = S(e.substr(0, n)), t[J] = S(e.substr(n)), w(s).bigHour = !0;
|
825
825
|
});
|
826
826
|
C("hmmss", function(e, t, s) {
|
827
827
|
var n = e.length - 4, r = e.length - 2;
|
828
|
-
t[
|
828
|
+
t[A] = S(e.substr(0, n)), t[J] = S(e.substr(n, 2)), t[de] = S(e.substr(r)), w(s).bigHour = !0;
|
829
829
|
});
|
830
830
|
C("Hmm", function(e, t, s) {
|
831
831
|
var n = e.length - 2;
|
832
|
-
t[
|
832
|
+
t[A] = S(e.substr(0, n)), t[J] = S(e.substr(n));
|
833
833
|
});
|
834
834
|
C("Hmmss", function(e, t, s) {
|
835
835
|
var n = e.length - 4, r = e.length - 2;
|
836
|
-
t[
|
836
|
+
t[A] = S(e.substr(0, n)), t[J] = S(e.substr(n, 2)), t[de] = S(e.substr(r));
|
837
837
|
});
|
838
838
|
function xi(e) {
|
839
839
|
return (e + "").toLowerCase().charAt(0) === "p";
|
@@ -947,7 +947,7 @@ function Ui() {
|
|
947
947
|
}
|
948
948
|
function gs(e) {
|
949
949
|
var t, s = e._a;
|
950
|
-
return s && w(e).overflow === -2 && (t = s[ue] < 0 || s[ue] > 11 ? ue : s[te] < 1 || s[te] > Mt(s[L], s[ue]) ? te : s[
|
950
|
+
return s && w(e).overflow === -2 && (t = s[ue] < 0 || s[ue] > 11 ? ue : s[te] < 1 || s[te] > Mt(s[L], s[ue]) ? te : s[A] < 0 || s[A] > 24 || s[A] === 24 && (s[J] !== 0 || s[de] !== 0 || s[ve] !== 0) ? A : s[J] < 0 || s[J] > 59 ? J : s[de] < 0 || s[de] > 59 ? de : s[ve] < 0 || s[ve] > 999 ? ve : -1, w(e)._overflowDayOfYear && (t < L || t > te) && (t = te), w(e)._overflowWeeks && t === -1 && (t = jr), w(e)._overflowWeekday && t === -1 && (t = Gr), w(e).overflow = t), e;
|
951
951
|
}
|
952
952
|
var Wi = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, Hi = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, Bi = /Z|[+-]\d\d(?::?\d\d)?/, rt = [
|
953
953
|
["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
|
@@ -1116,10 +1116,10 @@ function ws(e) {
|
|
1116
1116
|
e._a[t] = n[t] = r[t];
|
1117
1117
|
for (; t < 7; t++)
|
1118
1118
|
e._a[t] = n[t] = e._a[t] == null ? t === 2 ? 1 : 0 : e._a[t];
|
1119
|
-
e._a[
|
1119
|
+
e._a[A] === 24 && e._a[J] === 0 && e._a[de] === 0 && e._a[ve] === 0 && (e._nextDay = !0, e._a[A] = 0), e._d = (e._useUTC ? Ge : ii).apply(
|
1120
1120
|
null,
|
1121
1121
|
n
|
1122
|
-
), i = e._useUTC ? e._d.getUTCDay() : e._d.getDay(), e._tzm != null && e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), e._nextDay && (e._a[
|
1122
|
+
), i = e._useUTC ? e._d.getUTCDay() : e._d.getDay(), e._tzm != null && e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), e._nextDay && (e._a[A] = 24), e._w && typeof e._w.d < "u" && e._w.d !== i && (w(e).weekdayMismatch = !0);
|
1123
1123
|
}
|
1124
1124
|
}
|
1125
1125
|
function Xi(e) {
|
@@ -1149,9 +1149,9 @@ function Ss(e) {
|
|
1149
1149
|
i = r[s], n = (t.match(Br(i, e)) || [])[0], n && (a = t.substr(0, t.indexOf(n)), a.length > 0 && w(e).unusedInput.push(a), t = t.slice(
|
1150
1150
|
t.indexOf(n) + n.length
|
1151
1151
|
), u += n.length), Ne[i] ? (n ? w(e).empty = !1 : w(e).unusedTokens.push(i), $r(i, n, e)) : e._strict && !n && w(e).unusedTokens.push(i);
|
1152
|
-
w(e).charsLeftOver = o - u, t.length > 0 && w(e).unusedInput.push(t), e._a[
|
1152
|
+
w(e).charsLeftOver = o - u, t.length > 0 && w(e).unusedInput.push(t), e._a[A] <= 12 && w(e).bigHour === !0 && e._a[A] > 0 && (w(e).bigHour = void 0), w(e).parsedDateParts = e._a.slice(0), w(e).meridiem = e._meridiem, e._a[A] = ea(
|
1153
1153
|
e._locale,
|
1154
|
-
e._a[
|
1154
|
+
e._a[A],
|
1155
1155
|
e._meridiem
|
1156
1156
|
), l = w(e).era, l !== null && (e._a[L] = e._locale.erasConvertYear(l, e._a[L])), ws(e), gs(e);
|
1157
1157
|
}
|
@@ -1375,7 +1375,7 @@ function ee(e, t) {
|
|
1375
1375
|
} : me(e) || !isNaN(+e) ? (s = {}, t ? s[t] = +e : s.milliseconds = +e) : (n = Da.exec(e)) ? (r = n[1] === "-" ? -1 : 1, s = {
|
1376
1376
|
y: 0,
|
1377
1377
|
d: S(n[te]) * r,
|
1378
|
-
h: S(n[
|
1378
|
+
h: S(n[A]) * r,
|
1379
1379
|
m: S(n[J]) * r,
|
1380
1380
|
s: S(n[de]) * r,
|
1381
1381
|
ms: S(Qt(n[ve] * 1e3)) * r
|
@@ -3826,8 +3826,8 @@ function Ft(e, t, s) {
|
|
3826
3826
|
metaTokens: !0,
|
3827
3827
|
dots: !1,
|
3828
3828
|
indexes: !1
|
3829
|
-
}, !1, function(g,
|
3830
|
-
return !c.isUndefined(
|
3829
|
+
}, !1, function(g, P) {
|
3830
|
+
return !c.isUndefined(P[g]);
|
3831
3831
|
});
|
3832
3832
|
const n = s.metaTokens, r = s.visitor || h, i = s.dots, a = s.indexes, u = (s.Blob || typeof Blob < "u" && Blob) && c.isSpecCompliantForm(t);
|
3833
3833
|
if (!c.isFunction(r))
|
@@ -3841,9 +3841,9 @@ function Ft(e, t, s) {
|
|
3841
3841
|
throw new k("Blob is not supported. Use a Buffer instead.");
|
3842
3842
|
return c.isArrayBuffer(m) || c.isTypedArray(m) ? u && typeof Blob == "function" ? new Blob([m]) : Buffer.from(m) : m;
|
3843
3843
|
}
|
3844
|
-
function h(m, g,
|
3844
|
+
function h(m, g, P) {
|
3845
3845
|
let F = m;
|
3846
|
-
if (m && !
|
3846
|
+
if (m && !P && typeof m == "object") {
|
3847
3847
|
if (c.endsWith(g, "{}"))
|
3848
3848
|
g = n ? g : g.slice(0, -2), m = JSON.stringify(m);
|
3849
3849
|
else if (c.isArray(m) && Hc(m) || (c.isFileList(m) || c.endsWith(g, "[]")) && (F = c.toArray(m)))
|
@@ -3855,7 +3855,7 @@ function Ft(e, t, s) {
|
|
3855
3855
|
);
|
3856
3856
|
}), !1;
|
3857
3857
|
}
|
3858
|
-
return ss(m) ? !0 : (t.append(Bs(
|
3858
|
+
return ss(m) ? !0 : (t.append(Bs(P, g, i), l(m)), !1);
|
3859
3859
|
}
|
3860
3860
|
const y = [], D = Object.assign(Bc, {
|
3861
3861
|
defaultVisitor: h,
|
@@ -4718,8 +4718,8 @@ class St {
|
|
4718
4718
|
const m = o[y++], g = o[y++];
|
4719
4719
|
try {
|
4720
4720
|
T = m(T);
|
4721
|
-
} catch (
|
4722
|
-
g.call(this,
|
4721
|
+
} catch (P) {
|
4722
|
+
g.call(this, P);
|
4723
4723
|
break;
|
4724
4724
|
}
|
4725
4725
|
}
|
@@ -4915,27 +4915,27 @@ function ar(e) {
|
|
4915
4915
|
return ar(Pe(e, r));
|
4916
4916
|
}, s;
|
4917
4917
|
}
|
4918
|
-
const
|
4919
|
-
|
4920
|
-
|
4921
|
-
|
4922
|
-
|
4923
|
-
|
4924
|
-
|
4925
|
-
|
4926
|
-
|
4927
|
-
|
4918
|
+
const Y = ar(Ms);
|
4919
|
+
Y.Axios = ft;
|
4920
|
+
Y.CanceledError = tt;
|
4921
|
+
Y.CancelToken = gu;
|
4922
|
+
Y.isCancel = nr;
|
4923
|
+
Y.VERSION = ir;
|
4924
|
+
Y.toFormData = Ft;
|
4925
|
+
Y.AxiosError = k;
|
4926
|
+
Y.Cancel = Y.CanceledError;
|
4927
|
+
Y.all = function(t) {
|
4928
4928
|
return Promise.all(t);
|
4929
4929
|
};
|
4930
|
-
|
4931
|
-
|
4932
|
-
|
4933
|
-
|
4934
|
-
|
4935
|
-
|
4936
|
-
|
4937
|
-
const ku =
|
4938
|
-
const t = e, s = window.VITE_BACKEND_URL ? window.VITE_BACKEND_URL : "http://
|
4930
|
+
Y.spread = wu;
|
4931
|
+
Y.isAxiosError = Su;
|
4932
|
+
Y.mergeConfig = Pe;
|
4933
|
+
Y.AxiosHeaders = fe;
|
4934
|
+
Y.formToJSON = (e) => sr(c.isHTMLForm(e) ? new FormData(e) : e);
|
4935
|
+
Y.HttpStatusCode = bu;
|
4936
|
+
Y.default = Y;
|
4937
|
+
const ku = Y, xs = async function(e) {
|
4938
|
+
const t = e, s = window.VITE_BACKEND_URL ? window.VITE_BACKEND_URL : "http://127.0.0.1:3000", n = {
|
4939
4939
|
method: t.method,
|
4940
4940
|
url: `${s}${t.url}`,
|
4941
4941
|
headers: {
|
@@ -4986,7 +4986,7 @@ const ku = P, xs = async function(e) {
|
|
4986
4986
|
return await xs(t).then((s) => s.response).catch((s) => {
|
4987
4987
|
console.error(s);
|
4988
4988
|
});
|
4989
|
-
}, Cu = (e) => (pr("data-v-
|
4989
|
+
}, Cu = (e) => (pr("data-v-c01e1ae3"), e = e(), yr(), e), Tu = { class: "widget" }, Mu = { class: "header-widget" }, Eu = /* @__PURE__ */ Cu(() => /* @__PURE__ */ x("span", null, null, -1)), Ru = { class: "input-message w-full" }, xu = ["onSubmit"], Nu = { class: "form-message" }, Au = { type: "submit" }, Yu = { class: "jl-inputgroup-chat" }, Pu = { type: "submit" }, Fu = /* @__PURE__ */ is({
|
4990
4990
|
__name: "Chat",
|
4991
4991
|
props: {
|
4992
4992
|
toggleChat: { type: Function, required: !0 },
|
@@ -5014,7 +5014,7 @@ const ku = P, xs = async function(e) {
|
|
5014
5014
|
}), r.value = null, l();
|
5015
5015
|
}, y = async (m) => {
|
5016
5016
|
m.resetConnection && T(), D();
|
5017
|
-
const
|
5017
|
+
const P = await Ou({
|
5018
5018
|
token: t.tokenAuth,
|
5019
5019
|
data: {
|
5020
5020
|
phone: t.phoneUser,
|
@@ -5022,7 +5022,7 @@ const ku = P, xs = async function(e) {
|
|
5022
5022
|
device: null
|
5023
5023
|
}
|
5024
5024
|
});
|
5025
|
-
|
5025
|
+
P && (i.value = P);
|
5026
5026
|
}, D = (m = "webchat") => {
|
5027
5027
|
const { virtualhost: g } = a.value;
|
5028
5028
|
if (!sessionStorage.getItem("tabBrowser")) {
|
@@ -5040,18 +5040,18 @@ const ku = P, xs = async function(e) {
|
|
5040
5040
|
};
|
5041
5041
|
return cr(async () => {
|
5042
5042
|
await y({ resetConnection: !1 });
|
5043
|
-
const m = `
|
5043
|
+
const m = `widget_chat_${t.phoneUser}`;
|
5044
5044
|
a.value = await Du({
|
5045
5045
|
token: t.tokenAuth,
|
5046
5046
|
data: {
|
5047
5047
|
virtualHost: m
|
5048
5048
|
}
|
5049
|
-
}),
|
5049
|
+
}), D(), l();
|
5050
5050
|
}), (m, g) => (G(), K("div", Tu, [
|
5051
5051
|
x("div", Mu, [
|
5052
5052
|
Eu,
|
5053
5053
|
Ve(jl, {
|
5054
|
-
onClick: g[0] || (g[0] = (
|
5054
|
+
onClick: g[0] || (g[0] = (P) => e.toggleChat())
|
5055
5055
|
})
|
5056
5056
|
]),
|
5057
5057
|
x("div", {
|
@@ -5060,10 +5060,10 @@ const ku = P, xs = async function(e) {
|
|
5060
5060
|
ref_key: "messagesContainer",
|
5061
5061
|
ref: u
|
5062
5062
|
}, [
|
5063
|
-
(G(!0), K(ur, null, dr(i.value, (
|
5063
|
+
(G(!0), K(ur, null, dr(i.value, (P, F) => (G(), hr(El, {
|
5064
5064
|
class: "message",
|
5065
5065
|
key: F,
|
5066
|
-
message:
|
5066
|
+
message: P
|
5067
5067
|
}, null, 8, ["message"]))), 128))
|
5068
5068
|
], 512),
|
5069
5069
|
x("div", Ru, [
|
@@ -5077,7 +5077,7 @@ const ku = P, xs = async function(e) {
|
|
5077
5077
|
]),
|
5078
5078
|
x("div", Yu, [
|
5079
5079
|
mr(x("input", {
|
5080
|
-
"onUpdate:modelValue": g[1] || (g[1] = (
|
5080
|
+
"onUpdate:modelValue": g[1] || (g[1] = (P) => r.value = P),
|
5081
5081
|
class: "jl2-input-chat",
|
5082
5082
|
required: ""
|
5083
5083
|
}, null, 512), [
|
@@ -5093,7 +5093,7 @@ const ku = P, xs = async function(e) {
|
|
5093
5093
|
]));
|
5094
5094
|
}
|
5095
5095
|
});
|
5096
|
-
const Lu = /* @__PURE__ */ Te(Fu, [["__scopeId", "data-v-
|
5096
|
+
const Lu = /* @__PURE__ */ Te(Fu, [["__scopeId", "data-v-c01e1ae3"]]), Iu = {}, Uu = {
|
5097
5097
|
width: "87",
|
5098
5098
|
height: "87",
|
5099
5099
|
viewBox: "0 0 87 87",
|
@@ -11,4 +11,4 @@ m.version="2.29.4",er(N),m.fn=d,m.min=Hi,m.max=Bi,m.now=Vi,m.utc=X,m.unix=go,m.m
|
|
11
11
|
`,NULL:"\0"};class we{constructor(t){const{command:s,headers:n,body:r,binaryBody:i,escapeHeaderValues:a,skipContentLengthHeader:o}=t;this.command=s,this.headers=Object.assign({},n||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=r||"",this.isBinaryBody=!1),this.escapeHeaderValues=a||!1,this.skipContentLengthHeader=o||!1}get body(){return!this._body&&this.isBinaryBody&&(this._body=new TextDecoder().decode(this._binaryBody)),this._body||""}get binaryBody(){return!this._binaryBody&&!this.isBinaryBody&&(this._binaryBody=new TextEncoder().encode(this._body)),this._binaryBody}static fromRawFrame(t,s){const n={},r=i=>i.replace(/^\s+|\s+$/g,"");for(const i of t.headers.reverse()){i.indexOf(":");const a=r(i[0]);let o=r(i[1]);s&&t.command!=="CONNECT"&&t.command!=="CONNECTED"&&(o=we.hdrValueUnEscape(o)),n[a]=o}return new we({command:t.command,headers:n,binaryBody:t.binaryBody,escapeHeaderValues:s})}toString(){return this.serializeCmdAndHeaders()}serialize(){const t=this.serializeCmdAndHeaders();return this.isBinaryBody?we.toUnit8Array(t,this._binaryBody).buffer:t+this._body+qe.NULL}serializeCmdAndHeaders(){const t=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const s of Object.keys(this.headers||{})){const n=this.headers[s];this.escapeHeaderValues&&this.command!=="CONNECT"&&this.command!=="CONNECTED"?t.push(`${s}:${we.hdrValueEscape(`${n}`)}`):t.push(`${s}:${n}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&t.push(`content-length:${this.bodyLength()}`),t.join(qe.LF)+qe.LF+qe.LF}isBodyEmpty(){return this.bodyLength()===0}bodyLength(){const t=this.binaryBody;return t?t.length:0}static sizeOfUTF8(t){return t?new TextEncoder().encode(t).length:0}static toUnit8Array(t,s){const n=new TextEncoder().encode(t),r=new Uint8Array([0]),i=new Uint8Array(n.length+s.length+r.length);return i.set(n),i.set(s,n.length),i.set(r,n.length+s.length),i}static marshall(t){return new we(t).serialize()}static hdrValueEscape(t){return t.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(t){return t.replace(/\\r/g,"\r").replace(/\\n/g,`
|
12
12
|
`).replace(/\\c/g,":").replace(/\\\\/g,"\\")}}const Dn=0,kt=10,Ot=13,fl=58;class ml{constructor(t,s){this.onFrame=t,this.onIncomingPing=s,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(t,s=!1){let n;if(typeof t=="string"?n=this._encoder.encode(t):n=new Uint8Array(t),s&&n[n.length-1]!==0){const r=new Uint8Array(n.length+1);r.set(n,0),r[n.length]=0,n=r}for(let r=0;r<n.length;r++){const i=n[r];this._onByte(i)}}_collectFrame(t){if(t!==Dn&&t!==Ot){if(t===kt){this.onIncomingPing();return}this._onByte=this._collectCommand,this._reinjectByte(t)}}_collectCommand(t){if(t!==Ot){if(t===kt){this._results.command=this._consumeTokenAsUTF8(),this._onByte=this._collectHeaders;return}this._consumeByte(t)}}_collectHeaders(t){if(t!==Ot){if(t===kt){this._setupCollectBody();return}this._onByte=this._collectHeaderKey,this._reinjectByte(t)}}_reinjectByte(t){this._onByte(t)}_collectHeaderKey(t){if(t===fl){this._headerKey=this._consumeTokenAsUTF8(),this._onByte=this._collectHeaderValue;return}this._consumeByte(t)}_collectHeaderValue(t){if(t!==Ot){if(t===kt){this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,this._onByte=this._collectHeaders;return}this._consumeByte(t)}}_setupCollectBody(){const t=this._results.headers.filter(s=>s[0]==="content-length")[0];t?(this._bodyBytesRemaining=parseInt(t[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(t){if(t===Dn){this._retrievedBody();return}this._consumeByte(t)}_collectBodyFixedSize(t){if(this._bodyBytesRemaining--===0){this._retrievedBody();return}this._consumeByte(t)}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw();try{this.onFrame(this._results)}catch(t){console.log("Ignoring an exception thrown by a frame handler. Original exception: ",t)}this._initState()}_consumeByte(t){this._token.push(t)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const t=new Uint8Array(this._token);return this._token=[],t}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var fe;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"})(fe=fe||(fe={}));var z;(function(e){e[e.ACTIVE=0]="ACTIVE",e[e.DEACTIVATING=1]="DEACTIVATING",e[e.INACTIVE=2]="INACTIVE"})(z=z||(z={}));class W{constructor(t){this.versions=t}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map(t=>`v${t.replace(".","")}.stomp`)}}W.V1_0="1.0",W.V1_1="1.1",W.V1_2="1.2",W.default=new W([W.V1_2,W.V1_1,W.V1_0]);function _l(e,t){e.terminate=function(){const s=()=>{};this.onerror=s,this.onmessage=s,this.onopen=s;const n=new Date,r=Math.random().toString().substring(2,8),i=this.onclose;this.onclose=a=>{const o=new Date().getTime()-n.getTime();t(`Discarded socket (#${r}) closed after ${o}ms, with code/reason: ${a.code}/${a.reason}`)},this.close(),i==null||i.call(e,{code:4001,reason:`Quick discarding socket (#${r}) without waiting for the shutdown sequence.`,wasClean:!1})}}class pl{constructor(t,s,n){this._client=t,this._webSocket=s,this._connected=!1,this._serverFrameHandlers={CONNECTED:r=>{this.debug(`connected to server ${r.headers.server}`),this._connected=!0,this._connectedVersion=r.headers.version,this._connectedVersion===W.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(r.headers),this.onConnect(r)},MESSAGE:r=>{const i=r.headers.subscription,a=this._subscriptions[i]||this.onUnhandledMessage,o=r,u=this,l=this._connectedVersion===W.V1_2?o.headers.ack:o.headers["message-id"];o.ack=(f={})=>u.ack(l,i,f),o.nack=(f={})=>u.nack(l,i,f),a(o)},RECEIPT:r=>{const i=this._receiptWatchers[r.headers["receipt-id"]];i?(i(r),delete this._receiptWatchers[r.headers["receipt-id"]]):this.onUnhandledReceipt(r)},ERROR:r=>{this.onStompError(r)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.debug=n.debug,this.stompVersions=n.stompVersions,this.connectHeaders=n.connectHeaders,this.disconnectHeaders=n.disconnectHeaders,this.heartbeatIncoming=n.heartbeatIncoming,this.heartbeatOutgoing=n.heartbeatOutgoing,this.splitLargeFrames=n.splitLargeFrames,this.maxWebSocketChunkSize=n.maxWebSocketChunkSize,this.forceBinaryWSFrames=n.forceBinaryWSFrames,this.logRawCommunication=n.logRawCommunication,this.appendMissingNULLonIncoming=n.appendMissingNULLonIncoming,this.discardWebsocketOnCommFailure=n.discardWebsocketOnCommFailure,this.onConnect=n.onConnect,this.onDisconnect=n.onDisconnect,this.onStompError=n.onStompError,this.onWebSocketClose=n.onWebSocketClose,this.onWebSocketError=n.onWebSocketError,this.onUnhandledMessage=n.onUnhandledMessage,this.onUnhandledReceipt=n.onUnhandledReceipt,this.onUnhandledFrame=n.onUnhandledFrame}get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}start(){const t=new ml(s=>{const n=we.fromRawFrame(s,this._escapeHeaderValues);this.logRawCommunication||this.debug(`<<< ${n}`),(this._serverFrameHandlers[n.command]||this.onUnhandledFrame)(n)},()=>{this.debug("<<< PONG")});this._webSocket.onmessage=s=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const n=s.data instanceof ArrayBuffer?new TextDecoder().decode(s.data):s.data;this.debug(`<<< ${n}`)}t.parseChunk(s.data,this.appendMissingNULLonIncoming)},this._webSocket.onclose=s=>{this.debug(`Connection closed to ${this._webSocket.url}`),this._cleanUp(),this.onWebSocketClose(s)},this._webSocket.onerror=s=>{this.onWebSocketError(s)},this._webSocket.onopen=()=>{const s=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),s["accept-version"]=this.stompVersions.supportedVersions(),s["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:s})}}_setupHeartbeat(t){if(t.version!==W.V1_1&&t.version!==W.V1_2||!t["heart-beat"])return;const[s,n]=t["heart-beat"].split(",").map(r=>parseInt(r,10));if(this.heartbeatOutgoing!==0&&n!==0){const r=Math.max(this.heartbeatOutgoing,n);this.debug(`send PING every ${r}ms`),this._pinger=setInterval(()=>{this._webSocket.readyState===fe.OPEN&&(this._webSocket.send(qe.LF),this.debug(">>> PING"))},r)}if(this.heartbeatIncoming!==0&&s!==0){const r=Math.max(this.heartbeatIncoming,s);this.debug(`check PONG every ${r}ms`),this._ponger=setInterval(()=>{const i=Date.now()-this._lastServerActivityTS;i>r*2&&(this.debug(`did not receive server activity for the last ${i}ms`),this._closeOrDiscardWebsocket())},r)}}_closeOrDiscardWebsocket(){this.discardWebsocketOnCommFailure?(this.debug("Discarding websocket, the underlying socket may linger for a while"),this.discardWebsocket()):(this.debug("Issuing close on the websocket"),this._closeWebsocket())}forceDisconnect(){this._webSocket&&(this._webSocket.readyState===fe.CONNECTING||this._webSocket.readyState===fe.OPEN)&&this._closeOrDiscardWebsocket()}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}discardWebsocket(){typeof this._webSocket.terminate!="function"&&_l(this._webSocket,t=>this.debug(t)),this._webSocket.terminate()}_transmit(t){const{command:s,headers:n,body:r,binaryBody:i,skipContentLengthHeader:a}=t,o=new we({command:s,headers:n,body:r,binaryBody:i,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:a});let u=o.serialize();if(this.logRawCommunication?this.debug(`>>> ${u}`):this.debug(`>>> ${o}`),this.forceBinaryWSFrames&&typeof u=="string"&&(u=new TextEncoder().encode(u)),typeof u!="string"||!this.splitLargeFrames)this._webSocket.send(u);else{let l=u;for(;l.length>0;){const f=l.substring(0,this.maxWebSocketChunkSize);l=l.substring(this.maxWebSocketChunkSize),this._webSocket.send(f),this.debug(`chunk sent = ${f.length}, remaining = ${l.length}`)}}}dispose(){if(this.connected)try{const t=Object.assign({},this.disconnectHeaders);t.receipt||(t.receipt=`close-${this._counter++}`),this.watchForReceipt(t.receipt,s=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(s)}),this._transmit({command:"DISCONNECT",headers:t})}catch(t){this.debug(`Ignoring error during disconnect ${t}`)}else(this._webSocket.readyState===fe.CONNECTING||this._webSocket.readyState===fe.OPEN)&&this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&(clearInterval(this._pinger),this._pinger=void 0),this._ponger&&(clearInterval(this._ponger),this._ponger=void 0)}publish(t){const{destination:s,headers:n,body:r,binaryBody:i,skipContentLengthHeader:a}=t,o=Object.assign({destination:s},n);this._transmit({command:"SEND",headers:o,body:r,binaryBody:i,skipContentLengthHeader:a})}watchForReceipt(t,s){this._receiptWatchers[t]=s}subscribe(t,s,n={}){n=Object.assign({},n),n.id||(n.id=`sub-${this._counter++}`),n.destination=t,this._subscriptions[n.id]=s,this._transmit({command:"SUBSCRIBE",headers:n});const r=this;return{id:n.id,unsubscribe(i){return r.unsubscribe(n.id,i)}}}unsubscribe(t,s={}){s=Object.assign({},s),delete this._subscriptions[t],s.id=t,this._transmit({command:"UNSUBSCRIBE",headers:s})}begin(t){const s=t||`tx-${this._counter++}`;this._transmit({command:"BEGIN",headers:{transaction:s}});const n=this;return{id:s,commit(){n.commit(s)},abort(){n.abort(s)}}}commit(t){this._transmit({command:"COMMIT",headers:{transaction:t}})}abort(t){this._transmit({command:"ABORT",headers:{transaction:t}})}ack(t,s,n={}){n=Object.assign({},n),this._connectedVersion===W.V1_2?n.id=t:n["message-id"]=t,n.subscription=s,this._transmit({command:"ACK",headers:n})}nack(t,s,n={}){return n=Object.assign({},n),this._connectedVersion===W.V1_2?n.id=t:n["message-id"]=t,n.subscription=s,this._transmit({command:"NACK",headers:n})}}class yl{constructor(t={}){this.stompVersions=W.default,this.connectionTimeout=0,this.reconnectDelay=5e3,this.heartbeatIncoming=1e4,this.heartbeatOutgoing=1e4,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8*1024,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this.discardWebsocketOnCommFailure=!1,this.state=z.INACTIVE;const s=()=>{};this.debug=s,this.beforeConnect=s,this.onConnect=s,this.onDisconnect=s,this.onUnhandledMessage=s,this.onUnhandledReceipt=s,this.onUnhandledFrame=s,this.onStompError=s,this.onWebSocketClose=s,this.onWebSocketError=s,this.logRawCommunication=!1,this.onChangeState=s,this.connectHeaders={},this._disconnectHeaders={},this.configure(t)}get webSocket(){var t;return(t=this._stompHandler)==null?void 0:t._webSocket}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(t){this._disconnectHeaders=t,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)}get connected(){return!!this._stompHandler&&this._stompHandler.connected}get connectedVersion(){return this._stompHandler?this._stompHandler.connectedVersion:void 0}get active(){return this.state===z.ACTIVE}_changeState(t){this.state=t,this.onChangeState(t)}configure(t){Object.assign(this,t)}activate(){const t=()=>{if(this.active){this.debug("Already ACTIVE, ignoring request to activate");return}this._changeState(z.ACTIVE),this._connect()};this.state===z.DEACTIVATING?(this.debug("Waiting for deactivation to finish before activating"),this.deactivate().then(()=>{t()})):t()}async _connect(){if(await this.beforeConnect(),this._stompHandler){this.debug("There is already a stompHandler, skipping the call to connect");return}if(!this.active){this.debug("Client has been marked inactive, will not attempt to connect");return}this.connectionTimeout>0&&(this._connectionWatcher&&clearTimeout(this._connectionWatcher),this._connectionWatcher=setTimeout(()=>{this.connected||(this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`),this.forceDisconnect())},this.connectionTimeout)),this.debug("Opening Web Socket...");const t=this._createWebSocket();this._stompHandler=new pl(this,t,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatOutgoing:this.heartbeatOutgoing,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,discardWebsocketOnCommFailure:this.discardWebsocketOnCommFailure,onConnect:s=>{if(this._connectionWatcher&&(clearTimeout(this._connectionWatcher),this._connectionWatcher=void 0),!this.active){this.debug("STOMP got connected while deactivate was issued, will disconnect now"),this._disposeStompHandler();return}this.onConnect(s)},onDisconnect:s=>{this.onDisconnect(s)},onStompError:s=>{this.onStompError(s)},onWebSocketClose:s=>{this._stompHandler=void 0,this.state===z.DEACTIVATING&&this._changeState(z.INACTIVE),this.onWebSocketClose(s),this.active&&this._schedule_reconnect()},onWebSocketError:s=>{this.onWebSocketError(s)},onUnhandledMessage:s=>{this.onUnhandledMessage(s)},onUnhandledReceipt:s=>{this.onUnhandledReceipt(s)},onUnhandledFrame:s=>{this.onUnhandledFrame(s)}}),this._stompHandler.start()}_createWebSocket(){let t;if(this.webSocketFactory)t=this.webSocketFactory();else if(this.brokerURL)t=new WebSocket(this.brokerURL,this.stompVersions.protocolVersions());else throw new Error("Either brokerURL or webSocketFactory must be provided");return t.binaryType="arraybuffer",t}_schedule_reconnect(){this.reconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this.reconnectDelay}ms`),this._reconnector=setTimeout(()=>{this._connect()},this.reconnectDelay))}async deactivate(t={}){var s;const n=t.force||!1,r=this.active;let i;if(this.state===z.INACTIVE)return this.debug("Already INACTIVE, nothing more to do"),Promise.resolve();if(this._changeState(z.DEACTIVATING),this._reconnector&&(clearTimeout(this._reconnector),this._reconnector=void 0),this._stompHandler&&this.webSocket.readyState!==fe.CLOSED){const a=this._stompHandler.onWebSocketClose;i=new Promise((o,u)=>{this._stompHandler.onWebSocketClose=l=>{a(l),o()}})}else return this._changeState(z.INACTIVE),Promise.resolve();return n?(s=this._stompHandler)==null||s.discardWebsocket():r&&this._disposeStompHandler(),i}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&this._stompHandler.dispose()}publish(t){this._checkConnection(),this._stompHandler.publish(t)}_checkConnection(){if(!this.connected)throw new TypeError("There is no underlying STOMP connection")}watchForReceipt(t,s){this._checkConnection(),this._stompHandler.watchForReceipt(t,s)}subscribe(t,s,n={}){return this._checkConnection(),this._stompHandler.subscribe(t,s,n)}unsubscribe(t,s={}){this._checkConnection(),this._stompHandler.unsubscribe(t,s)}begin(t){return this._checkConnection(),this._stompHandler.begin(t)}commit(t){this._checkConnection(),this._stompHandler.commit(t)}abort(t){this._checkConnection(),this._stompHandler.abort(t)}ack(t,s,n={}){this._checkConnection(),this._stompHandler.ack(t,s,n)}nack(t,s,n={}){this._checkConnection(),this._stompHandler.nack(t,s,n)}}class gl{constructor(t,s){hl(this,"client"),this.virtualHost=t,this.queue=s,this.client=new yl({brokerURL:window.VITE_BROKER_URL?window.VITE_BROKER_URL:"ws://192.168.20.107:15674/ws",connectHeaders:{login:window.VITE_USERNAME?window.VITE_USERNAME:"admin",passcode:window.VITE_PASSWORD?window.VITE_PASSWORD:"password",host:this.virtualHost}})}async connect(){return new Promise((t,s)=>{this.client.onConnect=()=>{t()},this.client.activate()})}async disconnectClient(){this.client.onDisconnect=()=>{},this.client.deactivate(),this.client.unsubscribe("")}async subscribe(t){await this.connect(),this.client.subscribe(`/queue/${this.queue}`,s=>{const n=JSON.parse(s.body);t(n)})}async publish(t){this.client.publish({destination:`/queue/${this.queue}`,body:JSON.stringify({data:t})})}}const wl={},Sl={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},bl=[h.createElementVNode("path",{d:"M16 31C24.2843 31 31 24.2843 31 16C31 7.71573 24.2843 1 16 1C7.71573 1 1 7.71573 1 16C1 24.2843 7.71573 31 16 31Z",stroke:"#B3B3B3","stroke-miterlimit":"10"},null,-1),h.createElementVNode("path",{d:"M19.78 22.3L15.98 16.63H15.9601L12.2001 22.3H11.0701L15.37 15.8899L11.25 9.69995H12.38L15.98 15.08H16L19.67 9.69995H20.8L16.55 15.82L20.92 22.3H19.77H19.78Z",fill:"#B3B3B3"},null,-1)];function kl(e,t){return h.openBlock(),h.createElementBlock("svg",Sl,bl)}const Ol=Ce(wl,[["render",kl]]),Dl={},Cl={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Tl=[h.createElementVNode("path",{d:"M11.9301 23.25C5.65005 23.25 0.550049 18.14 0.550049 11.87C0.550049 5.6 5.66005 0.48999 11.9301 0.48999C18.2001 0.48999 23.3101 5.6 23.3101 11.87C23.3101 18.14 18.2001 23.25 11.9301 23.25ZM11.9301 1.10999C6.00005 1.10999 1.17004 5.94 1.17004 11.87C1.17004 17.8 6.00005 22.63 11.9301 22.63C17.8601 22.63 22.6899 17.8 22.6899 11.87C22.6899 5.94 17.8601 1.10999 11.9301 1.10999Z",fill:"#F28B0C"},null,-1),h.createElementVNode("path",{d:"M8.68994 17.0601C8.63994 17.0601 8.58004 17.0501 8.54004 17.0201C8.44004 16.9701 8.38 16.8601 8.38 16.7501V6.99007C8.38 6.88007 8.44004 6.78005 8.54004 6.72005C8.64004 6.66005 8.74998 6.67005 8.84998 6.72005L17.1899 11.6001C17.2799 11.6601 17.34 11.7601 17.34 11.8701C17.34 11.9801 17.2799 12.0801 17.1899 12.1401L8.84998 17.0201C8.84998 17.0201 8.74994 17.0601 8.68994 17.0601ZM9 7.5301V16.21L16.42 11.8701L9 7.5301Z",fill:"#F28B0C"},null,-1)];function El(e,t){return h.openBlock(),h.createElementBlock("svg",Cl,Tl)}const Ml=Ce(Dl,[["render",El]]),vl={},Nl={width:"42",height:"42",viewBox:"0 0 42 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Rl=[h.createElementVNode("path",{d:"M21.04 40.9399C32.0857 40.9399 41.04 31.9856 41.04 20.9399C41.04 9.89419 32.0857 0.939941 21.04 0.939941C9.99428 0.939941 1.03998 9.89419 1.03998 20.9399C1.03998 31.9856 9.99428 40.9399 21.04 40.9399Z",stroke:"#F28B0C","stroke-width":"1.5","stroke-miterlimit":"10"},null,-1),h.createElementVNode("path",{d:"M22.87 20.36C24.92 19.57 26.38 17.5801 26.38 15.2601C26.38 12.2401 23.93 9.79004 20.91 9.79004C17.89 9.79004 15.44 12.2401 15.44 15.2601C15.44 17.6301 16.95 19.6401 19.06 20.4001C16.15 21.2601 14.02 23.9501 14.02 27.1301V31.7701C14.02 31.9401 14.16 32.08 14.33 32.08H27.76C27.93 32.08 28.07 31.9401 28.07 31.7701V27.1301C28.07 23.8901 25.86 21.16 22.87 20.36Z",fill:"#F28B0C"},null,-1)];function xl(e,t){return h.openBlock(),h.createElementBlock("svg",Nl,Rl)}const Al=Ce(vl,[["render",xl]]);function Cn(e,t){return function(){return e.apply(t,arguments)}}const{toString:Yl}=Object.prototype,{getPrototypeOf:fs}=Object,Dt=(e=>t=>{const s=Yl.call(t);return e[s]||(e[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),ne=e=>(e=e.toLowerCase(),t=>Dt(t)===e),Ct=e=>t=>typeof t===e,{isArray:Ye}=Array,Ze=Ct("undefined");function Pl(e){return e!==null&&!Ze(e)&&e.constructor!==null&&!Ze(e.constructor)&&q(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Tn=ne("ArrayBuffer");function Fl(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Tn(e.buffer),t}const Ll=Ct("string"),q=Ct("function"),En=Ct("number"),Tt=e=>e!==null&&typeof e=="object",Il=e=>e===!0||e===!1,Et=e=>{if(Dt(e)!=="object")return!1;const t=fs(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ul=ne("Date"),Wl=ne("File"),Hl=ne("Blob"),Bl=ne("FileList"),Vl=e=>Tt(e)&&q(e.pipe),$l=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||q(e.append)&&((t=Dt(e))==="formdata"||t==="object"&&q(e.toString)&&e.toString()==="[object FormData]"))},jl=ne("URLSearchParams"),Gl=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Je(e,t,{allOwnKeys:s=!1}={}){if(e===null||typeof e>"u")return;let n,r;if(typeof e!="object"&&(e=[e]),Ye(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{const i=s?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(n=0;n<a;n++)o=i[n],t.call(null,e[o],o,e)}}function Mn(e,t){t=t.toLowerCase();const s=Object.keys(e);let n=s.length,r;for(;n-- >0;)if(r=s[n],t===r.toLowerCase())return r;return null}const vn=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Nn=e=>!Ze(e)&&e!==vn;function ms(){const{caseless:e}=Nn(this)&&this||{},t={},s=(n,r)=>{const i=e&&Mn(t,r)||r;Et(t[i])&&Et(n)?t[i]=ms(t[i],n):Et(n)?t[i]=ms({},n):Ye(n)?t[i]=n.slice():t[i]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&Je(arguments[n],s);return t}const zl=(e,t,s,{allOwnKeys:n}={})=>(Je(t,(r,i)=>{s&&q(r)?e[i]=Cn(r,s):e[i]=r},{allOwnKeys:n}),e),ql=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Zl=(e,t,s,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),s&&Object.assign(e.prototype,s)},Jl=(e,t,s,n)=>{let r,i,a;const o={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)a=r[i],(!n||n(a,e,t))&&!o[a]&&(t[a]=e[a],o[a]=!0);e=s!==!1&&fs(e)}while(e&&(!s||s(e,t))&&e!==Object.prototype);return t},Kl=(e,t,s)=>{e=String(e),(s===void 0||s>e.length)&&(s=e.length),s-=t.length;const n=e.indexOf(t,s);return n!==-1&&n===s},Ql=e=>{if(!e)return null;if(Ye(e))return e;let t=e.length;if(!En(t))return null;const s=new Array(t);for(;t-- >0;)s[t]=e[t];return s},Xl=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&fs(Uint8Array)),ec=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const i=r.value;t.call(e,i[0],i[1])}},tc=(e,t)=>{let s;const n=[];for(;(s=e.exec(t))!==null;)n.push(s);return n},sc=ne("HTMLFormElement"),nc=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,n,r){return n.toUpperCase()+r}),Rn=(({hasOwnProperty:e})=>(t,s)=>e.call(t,s))(Object.prototype),rc=ne("RegExp"),xn=(e,t)=>{const s=Object.getOwnPropertyDescriptors(e),n={};Je(s,(r,i)=>{t(r,i,e)!==!1&&(n[i]=r)}),Object.defineProperties(e,n)},ic=e=>{xn(e,(t,s)=>{if(q(e)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const n=e[s];if(q(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},ac=(e,t)=>{const s={},n=r=>{r.forEach(i=>{s[i]=!0})};return Ye(e)?n(e):n(String(e).split(t)),s},oc=()=>{},lc=(e,t)=>(e=+e,Number.isFinite(e)?e:t),_s="abcdefghijklmnopqrstuvwxyz",An="0123456789",Yn={DIGIT:An,ALPHA:_s,ALPHA_DIGIT:_s+_s.toUpperCase()+An},cc=(e=16,t=Yn.ALPHA_DIGIT)=>{let s="";const{length:n}=t;for(;e--;)s+=t[Math.random()*n|0];return s};function uc(e){return!!(e&&q(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const dc=e=>{const t=new Array(10),s=(n,r)=>{if(Tt(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[r]=n;const i=Ye(n)?[]:{};return Je(n,(a,o)=>{const u=s(a,r+1);!Ze(u)&&(i[o]=u)}),t[r]=void 0,i}}return n};return s(e,0)},hc=ne("AsyncFunction"),c={isArray:Ye,isArrayBuffer:Tn,isBuffer:Pl,isFormData:$l,isArrayBufferView:Fl,isString:Ll,isNumber:En,isBoolean:Il,isObject:Tt,isPlainObject:Et,isUndefined:Ze,isDate:Ul,isFile:Wl,isBlob:Hl,isRegExp:rc,isFunction:q,isStream:Vl,isURLSearchParams:jl,isTypedArray:Xl,isFileList:Bl,forEach:Je,merge:ms,extend:zl,trim:Gl,stripBOM:ql,inherits:Zl,toFlatObject:Jl,kindOf:Dt,kindOfTest:ne,endsWith:Kl,toArray:Ql,forEachEntry:ec,matchAll:tc,isHTMLForm:sc,hasOwnProperty:Rn,hasOwnProp:Rn,reduceDescriptors:xn,freezeMethods:ic,toObjectSet:ac,toCamelCase:nc,noop:oc,toFiniteNumber:lc,findKey:Mn,global:vn,isContextDefined:Nn,ALPHABET:Yn,generateString:cc,isSpecCompliantForm:uc,toJSONObject:dc,isAsyncFn:hc,isThenable:e=>e&&(Tt(e)||q(e))&&q(e.then)&&q(e.catch)};function O(e,t,s,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),s&&(this.config=s),n&&(this.request=n),r&&(this.response=r)}c.inherits(O,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Pn=O.prototype,Fn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Fn[e]={value:e}}),Object.defineProperties(O,Fn),Object.defineProperty(Pn,"isAxiosError",{value:!0}),O.from=(e,t,s,n,r,i)=>{const a=Object.create(Pn);return c.toFlatObject(e,a,function(u){return u!==Error.prototype},o=>o!=="isAxiosError"),O.call(a,e.message,t,s,n,r),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};const fc=null;function ps(e){return c.isPlainObject(e)||c.isArray(e)}function Ln(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function In(e,t,s){return e?e.concat(t).map(function(r,i){return r=Ln(r),!s&&i?"["+r+"]":r}).join(s?".":""):t}function mc(e){return c.isArray(e)&&!e.some(ps)}const _c=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function Mt(e,t,s){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,s=c.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,P){return!c.isUndefined(P[w])});const n=s.metaTokens,r=s.visitor||f,i=s.dots,a=s.indexes,u=(s.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(r))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(c.isDate(p))return p.toISOString();if(!u&&c.isBlob(p))throw new O("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(p)||c.isTypedArray(p)?u&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function f(p,w,P){let F=p;if(p&&!P&&typeof p=="object"){if(c.endsWith(w,"{}"))w=n?w:w.slice(0,-2),p=JSON.stringify(p);else if(c.isArray(p)&&mc(p)||(c.isFileList(p)||c.endsWith(w,"[]"))&&(F=c.toArray(p)))return w=Ln(w),F.forEach(function(Pt,gu){!(c.isUndefined(Pt)||Pt===null)&&t.append(a===!0?In([w],gu,i):a===null?w:w+"[]",l(Pt))}),!1}return ps(p)?!0:(t.append(In(P,w,i),l(p)),!1)}const g=[],T=Object.assign(_c,{defaultVisitor:f,convertValue:l,isVisitable:ps});function M(p,w){if(!c.isUndefined(p)){if(g.indexOf(p)!==-1)throw Error("Circular reference detected in "+w.join("."));g.push(p),c.forEach(p,function(F,Fe){(!(c.isUndefined(F)||F===null)&&r.call(t,F,c.isString(Fe)?Fe.trim():Fe,w,T))===!0&&M(F,w?w.concat(Fe):[Fe])}),g.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return M(e),t}function Un(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ys(e,t){this._pairs=[],e&&Mt(e,this,t)}const Wn=ys.prototype;Wn.append=function(t,s){this._pairs.push([t,s])},Wn.toString=function(t){const s=t?function(n){return t.call(this,n,Un)}:Un;return this._pairs.map(function(r){return s(r[0])+"="+s(r[1])},"").join("&")};function pc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Hn(e,t,s){if(!t)return e;const n=s&&s.encode||pc,r=s&&s.serialize;let i;if(r?i=r(t,s):i=c.isURLSearchParams(t)?t.toString():new ys(t,s).toString(n),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class yc{constructor(){this.handlers=[]}use(t,s,n){return this.handlers.push({fulfilled:t,rejected:s,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){c.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Bn=yc,Vn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},gc=typeof URLSearchParams<"u"?URLSearchParams:ys,wc=typeof FormData<"u"?FormData:null,Sc=typeof Blob<"u"?Blob:null,bc=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),kc=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),re={isBrowser:!0,classes:{URLSearchParams:gc,FormData:wc,Blob:Sc},isStandardBrowserEnv:bc,isStandardBrowserWebWorkerEnv:kc,protocols:["http","https","file","blob","url","data"]};function Oc(e,t){return Mt(e,new re.classes.URLSearchParams,Object.assign({visitor:function(s,n,r,i){return re.isNode&&c.isBuffer(s)?(this.append(n,s.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Dc(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Cc(e){const t={},s=Object.keys(e);let n;const r=s.length;let i;for(n=0;n<r;n++)i=s[n],t[i]=e[i];return t}function $n(e){function t(s,n,r,i){let a=s[i++];const o=Number.isFinite(+a),u=i>=s.length;return a=!a&&c.isArray(r)?r.length:a,u?(c.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o):((!r[a]||!c.isObject(r[a]))&&(r[a]=[]),t(s,n,r[a],i)&&c.isArray(r[a])&&(r[a]=Cc(r[a])),!o)}if(c.isFormData(e)&&c.isFunction(e.entries)){const s={};return c.forEachEntry(e,(n,r)=>{t(Dc(n),r,s,0)}),s}return null}const Tc={"Content-Type":void 0};function Ec(e,t,s){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(s||JSON.stringify)(e)}const vt={transitional:Vn,adapter:["xhr","http"],transformRequest:[function(t,s){const n=s.getContentType()||"",r=n.indexOf("application/json")>-1,i=c.isObject(t);if(i&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return r&&r?JSON.stringify($n(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Oc(t,this.formSerializer).toString();if((o=c.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Mt(o?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||r?(s.setContentType("application/json",!1),Ec(t)):t}],transformResponse:[function(t){const s=this.transitional||vt.transitional,n=s&&s.forcedJSONParsing,r=this.responseType==="json";if(t&&c.isString(t)&&(n&&!this.responseType||r)){const a=!(s&&s.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?O.from(o,O.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:re.classes.FormData,Blob:re.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};c.forEach(["delete","get","head"],function(t){vt.headers[t]={}}),c.forEach(["post","put","patch"],function(t){vt.headers[t]=c.merge(Tc)});const gs=vt,Mc=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),vc=e=>{const t={};let s,n,r;return e&&e.split(`
|
13
13
|
`).forEach(function(a){r=a.indexOf(":"),s=a.substring(0,r).trim().toLowerCase(),n=a.substring(r+1).trim(),!(!s||t[s]&&Mc[s])&&(s==="set-cookie"?t[s]?t[s].push(n):t[s]=[n]:t[s]=t[s]?t[s]+", "+n:n)}),t},jn=Symbol("internals");function Ke(e){return e&&String(e).trim().toLowerCase()}function Nt(e){return e===!1||e==null?e:c.isArray(e)?e.map(Nt):String(e)}function Nc(e){const t=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=s.exec(e);)t[n[1]]=n[2];return t}const Rc=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ws(e,t,s,n,r){if(c.isFunction(n))return n.call(this,t,s);if(r&&(t=s),!!c.isString(t)){if(c.isString(n))return t.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(t)}}function xc(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,s,n)=>s.toUpperCase()+n)}function Ac(e,t){const s=c.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+s,{value:function(r,i,a){return this[n].call(this,t,r,i,a)},configurable:!0})})}class Rt{constructor(t){t&&this.set(t)}set(t,s,n){const r=this;function i(o,u,l){const f=Ke(u);if(!f)throw new Error("header name must be a non-empty string");const g=c.findKey(r,f);(!g||r[g]===void 0||l===!0||l===void 0&&r[g]!==!1)&&(r[g||u]=Nt(o))}const a=(o,u)=>c.forEach(o,(l,f)=>i(l,f,u));return c.isPlainObject(t)||t instanceof this.constructor?a(t,s):c.isString(t)&&(t=t.trim())&&!Rc(t)?a(vc(t),s):t!=null&&i(s,t,n),this}get(t,s){if(t=Ke(t),t){const n=c.findKey(this,t);if(n){const r=this[n];if(!s)return r;if(s===!0)return Nc(r);if(c.isFunction(s))return s.call(this,r,n);if(c.isRegExp(s))return s.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,s){if(t=Ke(t),t){const n=c.findKey(this,t);return!!(n&&this[n]!==void 0&&(!s||ws(this,this[n],n,s)))}return!1}delete(t,s){const n=this;let r=!1;function i(a){if(a=Ke(a),a){const o=c.findKey(n,a);o&&(!s||ws(n,n[o],o,s))&&(delete n[o],r=!0)}}return c.isArray(t)?t.forEach(i):i(t),r}clear(t){const s=Object.keys(this);let n=s.length,r=!1;for(;n--;){const i=s[n];(!t||ws(this,this[i],i,t,!0))&&(delete this[i],r=!0)}return r}normalize(t){const s=this,n={};return c.forEach(this,(r,i)=>{const a=c.findKey(n,i);if(a){s[a]=Nt(r),delete s[i];return}const o=t?xc(i):String(i).trim();o!==i&&delete s[i],s[o]=Nt(r),n[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const s=Object.create(null);return c.forEach(this,(n,r)=>{n!=null&&n!==!1&&(s[r]=t&&c.isArray(n)?n.join(", "):n)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,s])=>t+": "+s).join(`
|
14
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...s){const n=new this(t);return s.forEach(r=>n.set(r)),n}static accessor(t){const n=(this[jn]=this[jn]={accessors:{}}).accessors,r=this.prototype;function i(a){const o=Ke(a);n[o]||(Ac(r,a),n[o]=!0)}return c.isArray(t)?t.forEach(i):i(t),this}}Rt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.freezeMethods(Rt.prototype),c.freezeMethods(Rt);const me=Rt;function Ss(e,t){const s=this||gs,n=t||s,r=me.from(n.headers);let i=n.data;return c.forEach(e,function(o){i=o.call(s,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function Gn(e){return!!(e&&e.__CANCEL__)}function Qe(e,t,s){O.call(this,e??"canceled",O.ERR_CANCELED,t,s),this.name="CanceledError"}c.inherits(Qe,O,{__CANCEL__:!0});function Yc(e,t,s){const n=s.config.validateStatus;!s.status||!n||n(s.status)?e(s):t(new O("Request failed with status code "+s.status,[O.ERR_BAD_REQUEST,O.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}const Pc=re.isStandardBrowserEnv?function(){return{write:function(s,n,r,i,a,o){const u=[];u.push(s+"="+encodeURIComponent(n)),c.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),c.isString(i)&&u.push("path="+i),c.isString(a)&&u.push("domain="+a),o===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(s){const n=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(s){this.write(s,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Fc(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Lc(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function zn(e,t){return e&&!Fc(t)?Lc(e,t):t}const Ic=re.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a");let n;function r(i){let a=i;return t&&(s.setAttribute("href",a),a=s.href),s.setAttribute("href",a),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return n=r(window.location.href),function(a){const o=c.isString(a)?r(a):a;return o.protocol===n.protocol&&o.host===n.host}}():function(){return function(){return!0}}();function Uc(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Wc(e,t){e=e||10;const s=new Array(e),n=new Array(e);let r=0,i=0,a;return t=t!==void 0?t:1e3,function(u){const l=Date.now(),f=n[i];a||(a=l),s[r]=u,n[r]=l;let g=i,T=0;for(;g!==r;)T+=s[g++],g=g%e;if(r=(r+1)%e,r===i&&(i=(i+1)%e),l-a<t)return;const M=f&&l-f;return M?Math.round(T*1e3/M):void 0}}function qn(e,t){let s=0;const n=Wc(50,250);return r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,o=i-s,u=n(o),l=i<=a;s=i;const f={loaded:i,total:a,progress:a?i/a:void 0,bytes:o,rate:u||void 0,estimated:u&&a&&l?(a-i)/u:void 0,event:r};f[t?"download":"upload"]=!0,e(f)}}const xt={http:fc,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(s,n){let r=e.data;const i=me.from(e.headers).normalize(),a=e.responseType;let o;function u(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}c.isFormData(r)&&(re.isStandardBrowserEnv||re.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(e.auth){const M=e.auth.username||"",p=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(M+":"+p))}const f=zn(e.baseURL,e.url);l.open(e.method.toUpperCase(),Hn(f,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function g(){if(!l)return;const M=me.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),w={data:!a||a==="text"||a==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:M,config:e,request:l};Yc(function(F){s(F),u()},function(F){n(F),u()},w),l=null}if("onloadend"in l?l.onloadend=g:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(g)},l.onabort=function(){l&&(n(new O("Request aborted",O.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new O("Network Error",O.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let p=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const w=e.transitional||Vn;e.timeoutErrorMessage&&(p=e.timeoutErrorMessage),n(new O(p,w.clarifyTimeoutError?O.ETIMEDOUT:O.ECONNABORTED,e,l)),l=null},re.isStandardBrowserEnv){const M=(e.withCredentials||Ic(f))&&e.xsrfCookieName&&Pc.read(e.xsrfCookieName);M&&i.set(e.xsrfHeaderName,M)}r===void 0&&i.setContentType(null),"setRequestHeader"in l&&c.forEach(i.toJSON(),function(p,w){l.setRequestHeader(w,p)}),c.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&a!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",qn(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",qn(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=M=>{l&&(n(!M||M.type?new Qe(null,e,l):M),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const T=Uc(f);if(T&&re.protocols.indexOf(T)===-1){n(new O("Unsupported protocol "+T+":",O.ERR_BAD_REQUEST,e));return}l.send(r||null)})}};c.forEach(xt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Hc={getAdapter:e=>{e=c.isArray(e)?e:[e];const{length:t}=e;let s,n;for(let r=0;r<t&&(s=e[r],!(n=c.isString(s)?xt[s.toLowerCase()]:s));r++);if(!n)throw n===!1?new O(`Adapter ${s} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(c.hasOwnProp(xt,s)?`Adapter '${s}' is not available in the build`:`Unknown adapter '${s}'`);if(!c.isFunction(n))throw new TypeError("adapter is not a function");return n},adapters:xt};function bs(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qe(null,e)}function Zn(e){return bs(e),e.headers=me.from(e.headers),e.data=Ss.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Hc.getAdapter(e.adapter||gs.adapter)(e).then(function(n){return bs(e),n.data=Ss.call(e,e.transformResponse,n),n.headers=me.from(n.headers),n},function(n){return Gn(n)||(bs(e),n&&n.response&&(n.response.data=Ss.call(e,e.transformResponse,n.response),n.response.headers=me.from(n.response.headers))),Promise.reject(n)})}const Jn=e=>e instanceof me?e.toJSON():e;function Pe(e,t){t=t||{};const s={};function n(l,f,g){return c.isPlainObject(l)&&c.isPlainObject(f)?c.merge.call({caseless:g},l,f):c.isPlainObject(f)?c.merge({},f):c.isArray(f)?f.slice():f}function r(l,f,g){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l,g)}else return n(l,f,g)}function i(l,f){if(!c.isUndefined(f))return n(void 0,f)}function a(l,f){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l)}else return n(void 0,f)}function o(l,f,g){if(g in t)return n(l,f);if(g in e)return n(void 0,l)}const u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(l,f)=>r(Jn(l),Jn(f),!0)};return c.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=u[f]||r,T=g(e[f],t[f],f);c.isUndefined(T)&&g!==o||(s[f]=T)}),s}const Kn="1.4.0",ks={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ks[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Qn={};ks.transitional=function(t,s,n){function r(i,a){return"[Axios v"+Kn+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return(i,a,o)=>{if(t===!1)throw new O(r(a," has been removed"+(s?" in "+s:"")),O.ERR_DEPRECATED);return s&&!Qn[a]&&(Qn[a]=!0,console.warn(r(a," has been deprecated since v"+s+" and will be removed in the near future"))),t?t(i,a,o):!0}};function Bc(e,t,s){if(typeof e!="object")throw new O("options must be an object",O.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let r=n.length;for(;r-- >0;){const i=n[r],a=t[i];if(a){const o=e[i],u=o===void 0||a(o,i,e);if(u!==!0)throw new O("option "+i+" must be "+u,O.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new O("Unknown option "+i,O.ERR_BAD_OPTION)}}const Os={assertOptions:Bc,validators:ks},Se=Os.validators;class At{constructor(t){this.defaults=t,this.interceptors={request:new Bn,response:new Bn}}request(t,s){typeof t=="string"?(s=s||{},s.url=t):s=t||{},s=Pe(this.defaults,s);const{transitional:n,paramsSerializer:r,headers:i}=s;n!==void 0&&Os.assertOptions(n,{silentJSONParsing:Se.transitional(Se.boolean),forcedJSONParsing:Se.transitional(Se.boolean),clarifyTimeoutError:Se.transitional(Se.boolean)},!1),r!=null&&(c.isFunction(r)?s.paramsSerializer={serialize:r}:Os.assertOptions(r,{encode:Se.function,serialize:Se.function},!0)),s.method=(s.method||this.defaults.method||"get").toLowerCase();let a;a=i&&c.merge(i.common,i[s.method]),a&&c.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),s.headers=me.concat(a,i);const o=[];let u=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(s)===!1||(u=u&&w.synchronous,o.unshift(w.fulfilled,w.rejected))});const l=[];this.interceptors.response.forEach(function(w){l.push(w.fulfilled,w.rejected)});let f,g=0,T;if(!u){const p=[Zn.bind(this),void 0];for(p.unshift.apply(p,o),p.push.apply(p,l),T=p.length,f=Promise.resolve(s);g<T;)f=f.then(p[g++],p[g++]);return f}T=o.length;let M=s;for(g=0;g<T;){const p=o[g++],w=o[g++];try{M=p(M)}catch(P){w.call(this,P);break}}try{f=Zn.call(this,M)}catch(p){return Promise.reject(p)}for(g=0,T=l.length;g<T;)f=f.then(l[g++],l[g++]);return f}getUri(t){t=Pe(this.defaults,t);const s=zn(t.baseURL,t.url);return Hn(s,t.params,t.paramsSerializer)}}c.forEach(["delete","get","head","options"],function(t){At.prototype[t]=function(s,n){return this.request(Pe(n||{},{method:t,url:s,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function s(n){return function(i,a,o){return this.request(Pe(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}At.prototype[t]=s(),At.prototype[t+"Form"]=s(!0)});const Yt=At;class Ds{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(i){s=i});const n=this;this.promise.then(r=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](r);n._listeners=null}),this.promise.then=r=>{let i;const a=new Promise(o=>{n.subscribe(o),i=o}).then(r);return a.cancel=function(){n.unsubscribe(i)},a},t(function(i,a,o){n.reason||(n.reason=new Qe(i,a,o),s(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const s=this._listeners.indexOf(t);s!==-1&&this._listeners.splice(s,1)}static source(){let t;return{token:new Ds(function(r){t=r}),cancel:t}}}const Vc=Ds;function $c(e){return function(s){return e.apply(null,s)}}function jc(e){return c.isObject(e)&&e.isAxiosError===!0}const Cs={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Cs).forEach(([e,t])=>{Cs[t]=e});const Gc=Cs;function Xn(e){const t=new Yt(e),s=Cn(Yt.prototype.request,t);return c.extend(s,Yt.prototype,t,{allOwnKeys:!0}),c.extend(s,t,null,{allOwnKeys:!0}),s.create=function(r){return Xn(Pe(e,r))},s}const Y=Xn(gs);Y.Axios=Yt,Y.CanceledError=Qe,Y.CancelToken=Vc,Y.isCancel=Gn,Y.VERSION=Kn,Y.toFormData=Mt,Y.AxiosError=O,Y.Cancel=Y.CanceledError,Y.all=function(t){return Promise.all(t)},Y.spread=$c,Y.isAxiosError=jc,Y.mergeConfig=Pe,Y.AxiosHeaders=me,Y.formToJSON=e=>$n(c.isHTMLForm(e)?new FormData(e):e),Y.HttpStatusCode=Gc,Y.default=Y;const zc=Y,Ts=async function(e){const t=e,s=window.VITE_BACKEND_URL?window.VITE_BACKEND_URL:"http://192.168.20.107:8500",n={method:t.method,url:`${s}${t.url}`,headers:{Authorization:`Bearer ${e.token}`,"Content-Type":"application/json; charset=utf-8",...t.headers},data:t.data};return await zc(n).then(async function(r){return await r.data}).catch(async function(r){console.error(r);const i=await r.response.data;if(i.statusCode==401&&i.message=="Unauthorized")localStorage.clear();else throw i})},qc=async(e={})=>{const t={url:"/webchat/messages-by-app-and-phone",method:"POST",data:e.data,token:e.token};return await Ts(t).then(s=>s.response).catch(s=>{console.error(s)})},Zc=async(e={})=>{const t={url:"/webchat/send-messages-by-app-and-phone",method:"POST",data:e.data,token:e.token};return await Ts(t).then(s=>{}).catch(s=>{console.error(s)})},Jc=async(e={})=>{const t={url:"/chat/sync-virtual-host",method:"POST",data:e.data,token:e.token};return await Ts(t).then(s=>s.response).catch(s=>{console.error(s)})},Kc=e=>(h.pushScopeId("data-v-0c0433cb"),e=e(),h.popScopeId(),e),Qc={class:"widget"},Xc={class:"header-widget"},eu=Kc(()=>h.createElementVNode("span",null,null,-1)),tu={class:"input-message w-full"},su=["onSubmit"],nu={class:"form-message"},ru={type:"submit"},iu={class:"jl-inputgroup-chat"},au={type:"submit"},ou=h.defineComponent({__name:"Chat",props:{toggleChat:{type:Function,required:!0},tokenAuth:{type:String,required:!0},phoneUser:{type:String,required:!0}},setup(e){const t=e,s=h.ref("webchat"),n=h.ref(null),r=h.ref(null),i=h.ref([]),a=h.ref({virtualhost:""}),o=p=>p.startsWith("591")&&p.length===11?p.substring(3):p,u=h.ref(null),l=()=>{u.value&&(u.value.scrollTop=u.value.scrollHeight)},f=async p=>{p.preventDefault();const{virtualhost:w}=a.value;await Zc({token:t.tokenAuth,data:{virtualHost:w,queue:`widget_chat_${sessionStorage.getItem("tabBrowser")}`,device:"00000000",phone:o(t.phoneUser),app:s.value,message:r.value,widget:!0}}),r.value=null,l()},g=async p=>{p.resetConnection&&M(),T();const P=await qc({token:t.tokenAuth,data:{phone:t.phoneUser,app:s.value,device:null}});console.log(P),P&&(i.value=P)},T=(p="webchat")=>{const{virtualhost:w}=a.value;if(!sessionStorage.getItem("tabBrowser")){let F=Date.now();sessionStorage.setItem("tabBrowser",`${F}`)}n.value=new gl(`${w}`,`widget_chat_${sessionStorage.getItem("tabBrowser")}`),n.value.connect(),n.value.subscribe(async()=>{await g({resetConnection:!1});const F=document.getElementById("messages-container");F.scrollTop=F.scrollHeight})},M=()=>{var p;(p=n.value)==null||p.disconnectClient()};return h.onMounted(async()=>{await g({resetConnection:!1});const p=`WIDGET_CHAT_${t.phoneUser}`;a.value=await Jc({token:t.tokenAuth,data:{virtualHost:p}}),console.log(a.value),T(),l()}),(p,w)=>(h.openBlock(),h.createElementBlock("div",Qc,[h.createElementVNode("div",Xc,[eu,h.createVNode(Ol,{onClick:w[0]||(w[0]=P=>e.toggleChat())})]),h.createElementVNode("div",{class:"messages-container",id:"messages-container",ref_key:"messagesContainer",ref:u},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(P,F)=>(h.openBlock(),h.createBlock(cl,{class:"message",key:F,message:P},null,8,["message"]))),128))],512),h.createElementVNode("div",tu,[h.createElementVNode("form",{class:"message-send",onSubmit:h.withModifiers(f,["prevent"])},[h.createElementVNode("div",nu,[h.createElementVNode("button",ru,[h.createVNode(Al)]),h.createElementVNode("div",iu,[h.withDirectives(h.createElementVNode("input",{"onUpdate:modelValue":w[1]||(w[1]=P=>r.value=P),class:"jl2-input-chat",required:""},null,512),[[h.vModelText,r.value]]),h.createElementVNode("button",au,[h.createVNode(Ml)])])])],40,su)])]))}}),vu="",lu=Ce(ou,[["__scopeId","data-v-0c0433cb"]]),cu={},uu={width:"87",height:"87",viewBox:"0 0 87 87",fill:"none",xmlns:"http://www.w3.org/2000/svg"},du=[h.createStaticVNode('<g filter="url(#filter0_d_4007_3488)"><path d="M43.5 77C64.2107 77 81 60.2107 81 39.5C81 18.7893 64.2107 2 43.5 2C22.7893 2 6 18.7893 6 39.5C6 60.2107 22.7893 77 43.5 77Z" fill="white" stroke="#F28B0C" stroke-width="3" stroke-miterlimit="10"></path><path d="M39.705 38.885C40.6908 38.885 41.49 38.0858 41.49 37.1C41.49 36.1142 40.6908 35.315 39.705 35.315C38.7192 35.315 37.92 36.1142 37.92 37.1C37.92 38.0858 38.7192 38.885 39.705 38.885Z" fill="#F28B0C"></path><path d="M45.075 38.885C46.0608 38.885 46.86 38.0858 46.86 37.1C46.86 36.1142 46.0608 35.315 45.075 35.315C44.0892 35.315 43.29 36.1142 43.29 37.1C43.29 38.0858 44.0892 38.885 45.075 38.885Z" fill="#F28B0C"></path><path d="M50.445 38.885C51.4308 38.885 52.23 38.0858 52.23 37.1C52.23 36.1142 51.4308 35.315 50.445 35.315C49.4592 35.315 48.66 36.1142 48.66 37.1C48.66 38.0858 49.4592 38.885 50.445 38.885Z" fill="#F28B0C"></path><path d="M63.27 58.235L58.755 47.78C61.125 44.765 62.415 40.97 62.415 37.175C62.415 26.435 52.665 18.185 41.925 20.12C39.99 19.325 37.98 18.905 35.835 18.905C26.955 18.905 19.785 26.135 19.785 34.955C19.785 38.54 21 41.975 23.145 44.765L18.99 54.44C18.84 54.8 18.915 55.235 19.2 55.445C19.485 55.73 19.92 55.73 20.205 55.595L30.6 50.15C31.89 50.585 33.255 50.87 34.68 50.945C39.48 54.53 45.57 55.25 50.655 53.45L61.905 59.33C62.265 59.48 62.625 59.48 62.91 59.18C63.345 58.97 63.405 58.61 63.27 58.25V58.235ZM51.24 51.71C51.03 51.56 50.745 51.56 50.52 51.635C48.795 52.28 46.935 52.64 45.15 52.64C36.69 52.64 29.61 45.755 29.61 37.1C29.61 29.72 34.845 23.345 42.075 21.845C51.75 19.91 60.705 27.29 60.705 37.1C60.705 40.685 59.415 44.27 57.12 46.985C56.91 47.27 56.835 47.63 56.97 47.915L60.69 56.585L51.24 51.71Z" fill="#F28B0C"></path></g><defs><filter id="filter0_d_4007_3488" x="0.5" y="0.5" width="86" height="86" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="4"></feOffset><feGaussianBlur stdDeviation="2"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4007_3488"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4007_3488" result="shape"></feBlend></filter></defs>',2)];function hu(e,t){return h.openBlock(),h.createElementBlock("svg",uu,du)}const fu=Ce(cu,[["render",hu]]),mu={key:0,class:"chat-box"},_u=h.defineComponent({__name:"Widget",props:{tokenAuth:{type:String,required:!0},phoneUser:{type:String,required:!0}},setup(e){const t=h.ref(!1),s=()=>{t.value=!t.value};return(n,r)=>(h.openBlock(),h.createElementBlock("div",null,[h.createElementVNode("div",null,[h.createElementVNode("div",{id:"chat-circle",onClick:s},[h.createVNode(fu)]),t.value?(h.openBlock(),h.createElementBlock("div",mu,[h.createVNode(lu,{toggleChat:s,tokenAuth:e.tokenAuth,phoneUser:e.phoneUser},null,8,["tokenAuth","phoneUser"])])):h.createCommentVNode("",!0)])]))}}),Ru="",pu=Ce(_u,[["__scopeId","data-v-4b17fe0e"]]),yu={install(e,t){window.VITE_BACKEND_URL=t.VITE_BACKEND_URL,window.VITE_BROKER_URL=t.VITE_BROKER_URL,window.VITE_USERNAME=t.VITE_USERNAME,window.VITE_PASSWORD=t.VITE_PASSWORD}};_e.Widget=pu,_e.default=yu,Object.defineProperties(_e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
14
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...s){const n=new this(t);return s.forEach(r=>n.set(r)),n}static accessor(t){const n=(this[jn]=this[jn]={accessors:{}}).accessors,r=this.prototype;function i(a){const o=Ke(a);n[o]||(Ac(r,a),n[o]=!0)}return c.isArray(t)?t.forEach(i):i(t),this}}Rt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.freezeMethods(Rt.prototype),c.freezeMethods(Rt);const me=Rt;function Ss(e,t){const s=this||gs,n=t||s,r=me.from(n.headers);let i=n.data;return c.forEach(e,function(o){i=o.call(s,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function Gn(e){return!!(e&&e.__CANCEL__)}function Qe(e,t,s){O.call(this,e??"canceled",O.ERR_CANCELED,t,s),this.name="CanceledError"}c.inherits(Qe,O,{__CANCEL__:!0});function Yc(e,t,s){const n=s.config.validateStatus;!s.status||!n||n(s.status)?e(s):t(new O("Request failed with status code "+s.status,[O.ERR_BAD_REQUEST,O.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}const Pc=re.isStandardBrowserEnv?function(){return{write:function(s,n,r,i,a,o){const u=[];u.push(s+"="+encodeURIComponent(n)),c.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),c.isString(i)&&u.push("path="+i),c.isString(a)&&u.push("domain="+a),o===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(s){const n=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(s){this.write(s,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Fc(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Lc(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function zn(e,t){return e&&!Fc(t)?Lc(e,t):t}const Ic=re.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a");let n;function r(i){let a=i;return t&&(s.setAttribute("href",a),a=s.href),s.setAttribute("href",a),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return n=r(window.location.href),function(a){const o=c.isString(a)?r(a):a;return o.protocol===n.protocol&&o.host===n.host}}():function(){return function(){return!0}}();function Uc(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Wc(e,t){e=e||10;const s=new Array(e),n=new Array(e);let r=0,i=0,a;return t=t!==void 0?t:1e3,function(u){const l=Date.now(),f=n[i];a||(a=l),s[r]=u,n[r]=l;let g=i,T=0;for(;g!==r;)T+=s[g++],g=g%e;if(r=(r+1)%e,r===i&&(i=(i+1)%e),l-a<t)return;const M=f&&l-f;return M?Math.round(T*1e3/M):void 0}}function qn(e,t){let s=0;const n=Wc(50,250);return r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,o=i-s,u=n(o),l=i<=a;s=i;const f={loaded:i,total:a,progress:a?i/a:void 0,bytes:o,rate:u||void 0,estimated:u&&a&&l?(a-i)/u:void 0,event:r};f[t?"download":"upload"]=!0,e(f)}}const xt={http:fc,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(s,n){let r=e.data;const i=me.from(e.headers).normalize(),a=e.responseType;let o;function u(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}c.isFormData(r)&&(re.isStandardBrowserEnv||re.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(e.auth){const M=e.auth.username||"",p=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(M+":"+p))}const f=zn(e.baseURL,e.url);l.open(e.method.toUpperCase(),Hn(f,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function g(){if(!l)return;const M=me.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),w={data:!a||a==="text"||a==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:M,config:e,request:l};Yc(function(F){s(F),u()},function(F){n(F),u()},w),l=null}if("onloadend"in l?l.onloadend=g:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(g)},l.onabort=function(){l&&(n(new O("Request aborted",O.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new O("Network Error",O.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let p=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const w=e.transitional||Vn;e.timeoutErrorMessage&&(p=e.timeoutErrorMessage),n(new O(p,w.clarifyTimeoutError?O.ETIMEDOUT:O.ECONNABORTED,e,l)),l=null},re.isStandardBrowserEnv){const M=(e.withCredentials||Ic(f))&&e.xsrfCookieName&&Pc.read(e.xsrfCookieName);M&&i.set(e.xsrfHeaderName,M)}r===void 0&&i.setContentType(null),"setRequestHeader"in l&&c.forEach(i.toJSON(),function(p,w){l.setRequestHeader(w,p)}),c.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&a!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",qn(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",qn(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=M=>{l&&(n(!M||M.type?new Qe(null,e,l):M),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const T=Uc(f);if(T&&re.protocols.indexOf(T)===-1){n(new O("Unsupported protocol "+T+":",O.ERR_BAD_REQUEST,e));return}l.send(r||null)})}};c.forEach(xt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Hc={getAdapter:e=>{e=c.isArray(e)?e:[e];const{length:t}=e;let s,n;for(let r=0;r<t&&(s=e[r],!(n=c.isString(s)?xt[s.toLowerCase()]:s));r++);if(!n)throw n===!1?new O(`Adapter ${s} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(c.hasOwnProp(xt,s)?`Adapter '${s}' is not available in the build`:`Unknown adapter '${s}'`);if(!c.isFunction(n))throw new TypeError("adapter is not a function");return n},adapters:xt};function bs(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qe(null,e)}function Zn(e){return bs(e),e.headers=me.from(e.headers),e.data=Ss.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Hc.getAdapter(e.adapter||gs.adapter)(e).then(function(n){return bs(e),n.data=Ss.call(e,e.transformResponse,n),n.headers=me.from(n.headers),n},function(n){return Gn(n)||(bs(e),n&&n.response&&(n.response.data=Ss.call(e,e.transformResponse,n.response),n.response.headers=me.from(n.response.headers))),Promise.reject(n)})}const Jn=e=>e instanceof me?e.toJSON():e;function Pe(e,t){t=t||{};const s={};function n(l,f,g){return c.isPlainObject(l)&&c.isPlainObject(f)?c.merge.call({caseless:g},l,f):c.isPlainObject(f)?c.merge({},f):c.isArray(f)?f.slice():f}function r(l,f,g){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l,g)}else return n(l,f,g)}function i(l,f){if(!c.isUndefined(f))return n(void 0,f)}function a(l,f){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l)}else return n(void 0,f)}function o(l,f,g){if(g in t)return n(l,f);if(g in e)return n(void 0,l)}const u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(l,f)=>r(Jn(l),Jn(f),!0)};return c.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=u[f]||r,T=g(e[f],t[f],f);c.isUndefined(T)&&g!==o||(s[f]=T)}),s}const Kn="1.4.0",ks={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ks[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Qn={};ks.transitional=function(t,s,n){function r(i,a){return"[Axios v"+Kn+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return(i,a,o)=>{if(t===!1)throw new O(r(a," has been removed"+(s?" in "+s:"")),O.ERR_DEPRECATED);return s&&!Qn[a]&&(Qn[a]=!0,console.warn(r(a," has been deprecated since v"+s+" and will be removed in the near future"))),t?t(i,a,o):!0}};function Bc(e,t,s){if(typeof e!="object")throw new O("options must be an object",O.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let r=n.length;for(;r-- >0;){const i=n[r],a=t[i];if(a){const o=e[i],u=o===void 0||a(o,i,e);if(u!==!0)throw new O("option "+i+" must be "+u,O.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new O("Unknown option "+i,O.ERR_BAD_OPTION)}}const Os={assertOptions:Bc,validators:ks},Se=Os.validators;class At{constructor(t){this.defaults=t,this.interceptors={request:new Bn,response:new Bn}}request(t,s){typeof t=="string"?(s=s||{},s.url=t):s=t||{},s=Pe(this.defaults,s);const{transitional:n,paramsSerializer:r,headers:i}=s;n!==void 0&&Os.assertOptions(n,{silentJSONParsing:Se.transitional(Se.boolean),forcedJSONParsing:Se.transitional(Se.boolean),clarifyTimeoutError:Se.transitional(Se.boolean)},!1),r!=null&&(c.isFunction(r)?s.paramsSerializer={serialize:r}:Os.assertOptions(r,{encode:Se.function,serialize:Se.function},!0)),s.method=(s.method||this.defaults.method||"get").toLowerCase();let a;a=i&&c.merge(i.common,i[s.method]),a&&c.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),s.headers=me.concat(a,i);const o=[];let u=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(s)===!1||(u=u&&w.synchronous,o.unshift(w.fulfilled,w.rejected))});const l=[];this.interceptors.response.forEach(function(w){l.push(w.fulfilled,w.rejected)});let f,g=0,T;if(!u){const p=[Zn.bind(this),void 0];for(p.unshift.apply(p,o),p.push.apply(p,l),T=p.length,f=Promise.resolve(s);g<T;)f=f.then(p[g++],p[g++]);return f}T=o.length;let M=s;for(g=0;g<T;){const p=o[g++],w=o[g++];try{M=p(M)}catch(P){w.call(this,P);break}}try{f=Zn.call(this,M)}catch(p){return Promise.reject(p)}for(g=0,T=l.length;g<T;)f=f.then(l[g++],l[g++]);return f}getUri(t){t=Pe(this.defaults,t);const s=zn(t.baseURL,t.url);return Hn(s,t.params,t.paramsSerializer)}}c.forEach(["delete","get","head","options"],function(t){At.prototype[t]=function(s,n){return this.request(Pe(n||{},{method:t,url:s,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function s(n){return function(i,a,o){return this.request(Pe(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}At.prototype[t]=s(),At.prototype[t+"Form"]=s(!0)});const Yt=At;class Ds{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(i){s=i});const n=this;this.promise.then(r=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](r);n._listeners=null}),this.promise.then=r=>{let i;const a=new Promise(o=>{n.subscribe(o),i=o}).then(r);return a.cancel=function(){n.unsubscribe(i)},a},t(function(i,a,o){n.reason||(n.reason=new Qe(i,a,o),s(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const s=this._listeners.indexOf(t);s!==-1&&this._listeners.splice(s,1)}static source(){let t;return{token:new Ds(function(r){t=r}),cancel:t}}}const Vc=Ds;function $c(e){return function(s){return e.apply(null,s)}}function jc(e){return c.isObject(e)&&e.isAxiosError===!0}const Cs={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Cs).forEach(([e,t])=>{Cs[t]=e});const Gc=Cs;function Xn(e){const t=new Yt(e),s=Cn(Yt.prototype.request,t);return c.extend(s,Yt.prototype,t,{allOwnKeys:!0}),c.extend(s,t,null,{allOwnKeys:!0}),s.create=function(r){return Xn(Pe(e,r))},s}const Y=Xn(gs);Y.Axios=Yt,Y.CanceledError=Qe,Y.CancelToken=Vc,Y.isCancel=Gn,Y.VERSION=Kn,Y.toFormData=Mt,Y.AxiosError=O,Y.Cancel=Y.CanceledError,Y.all=function(t){return Promise.all(t)},Y.spread=$c,Y.isAxiosError=jc,Y.mergeConfig=Pe,Y.AxiosHeaders=me,Y.formToJSON=e=>$n(c.isHTMLForm(e)?new FormData(e):e),Y.HttpStatusCode=Gc,Y.default=Y;const zc=Y,Ts=async function(e){const t=e,s=window.VITE_BACKEND_URL?window.VITE_BACKEND_URL:"http://127.0.0.1:3000",n={method:t.method,url:`${s}${t.url}`,headers:{Authorization:`Bearer ${e.token}`,"Content-Type":"application/json; charset=utf-8",...t.headers},data:t.data};return await zc(n).then(async function(r){return await r.data}).catch(async function(r){console.error(r);const i=await r.response.data;if(i.statusCode==401&&i.message=="Unauthorized")localStorage.clear();else throw i})},qc=async(e={})=>{const t={url:"/webchat/messages-by-app-and-phone",method:"POST",data:e.data,token:e.token};return await Ts(t).then(s=>s.response).catch(s=>{console.error(s)})},Zc=async(e={})=>{const t={url:"/webchat/send-messages-by-app-and-phone",method:"POST",data:e.data,token:e.token};return await Ts(t).then(s=>{}).catch(s=>{console.error(s)})},Jc=async(e={})=>{const t={url:"/chat/sync-virtual-host",method:"POST",data:e.data,token:e.token};return await Ts(t).then(s=>s.response).catch(s=>{console.error(s)})},Kc=e=>(h.pushScopeId("data-v-c01e1ae3"),e=e(),h.popScopeId(),e),Qc={class:"widget"},Xc={class:"header-widget"},eu=Kc(()=>h.createElementVNode("span",null,null,-1)),tu={class:"input-message w-full"},su=["onSubmit"],nu={class:"form-message"},ru={type:"submit"},iu={class:"jl-inputgroup-chat"},au={type:"submit"},ou=h.defineComponent({__name:"Chat",props:{toggleChat:{type:Function,required:!0},tokenAuth:{type:String,required:!0},phoneUser:{type:String,required:!0}},setup(e){const t=e,s=h.ref("webchat"),n=h.ref(null),r=h.ref(null),i=h.ref([]),a=h.ref({virtualhost:""}),o=p=>p.startsWith("591")&&p.length===11?p.substring(3):p,u=h.ref(null),l=()=>{u.value&&(u.value.scrollTop=u.value.scrollHeight)},f=async p=>{p.preventDefault();const{virtualhost:w}=a.value;await Zc({token:t.tokenAuth,data:{virtualHost:w,queue:`widget_chat_${sessionStorage.getItem("tabBrowser")}`,device:"00000000",phone:o(t.phoneUser),app:s.value,message:r.value,widget:!0}}),r.value=null,l()},g=async p=>{p.resetConnection&&M(),T();const P=await qc({token:t.tokenAuth,data:{phone:t.phoneUser,app:s.value,device:null}});P&&(i.value=P)},T=(p="webchat")=>{const{virtualhost:w}=a.value;if(!sessionStorage.getItem("tabBrowser")){let F=Date.now();sessionStorage.setItem("tabBrowser",`${F}`)}n.value=new gl(`${w}`,`widget_chat_${sessionStorage.getItem("tabBrowser")}`),n.value.connect(),n.value.subscribe(async()=>{await g({resetConnection:!1});const F=document.getElementById("messages-container");F.scrollTop=F.scrollHeight})},M=()=>{var p;(p=n.value)==null||p.disconnectClient()};return h.onMounted(async()=>{await g({resetConnection:!1});const p=`widget_chat_${t.phoneUser}`;a.value=await Jc({token:t.tokenAuth,data:{virtualHost:p}}),T(),l()}),(p,w)=>(h.openBlock(),h.createElementBlock("div",Qc,[h.createElementVNode("div",Xc,[eu,h.createVNode(Ol,{onClick:w[0]||(w[0]=P=>e.toggleChat())})]),h.createElementVNode("div",{class:"messages-container",id:"messages-container",ref_key:"messagesContainer",ref:u},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(P,F)=>(h.openBlock(),h.createBlock(cl,{class:"message",key:F,message:P},null,8,["message"]))),128))],512),h.createElementVNode("div",tu,[h.createElementVNode("form",{class:"message-send",onSubmit:h.withModifiers(f,["prevent"])},[h.createElementVNode("div",nu,[h.createElementVNode("button",ru,[h.createVNode(Al)]),h.createElementVNode("div",iu,[h.withDirectives(h.createElementVNode("input",{"onUpdate:modelValue":w[1]||(w[1]=P=>r.value=P),class:"jl2-input-chat",required:""},null,512),[[h.vModelText,r.value]]),h.createElementVNode("button",au,[h.createVNode(Ml)])])])],40,su)])]))}}),vu="",lu=Ce(ou,[["__scopeId","data-v-c01e1ae3"]]),cu={},uu={width:"87",height:"87",viewBox:"0 0 87 87",fill:"none",xmlns:"http://www.w3.org/2000/svg"},du=[h.createStaticVNode('<g filter="url(#filter0_d_4007_3488)"><path d="M43.5 77C64.2107 77 81 60.2107 81 39.5C81 18.7893 64.2107 2 43.5 2C22.7893 2 6 18.7893 6 39.5C6 60.2107 22.7893 77 43.5 77Z" fill="white" stroke="#F28B0C" stroke-width="3" stroke-miterlimit="10"></path><path d="M39.705 38.885C40.6908 38.885 41.49 38.0858 41.49 37.1C41.49 36.1142 40.6908 35.315 39.705 35.315C38.7192 35.315 37.92 36.1142 37.92 37.1C37.92 38.0858 38.7192 38.885 39.705 38.885Z" fill="#F28B0C"></path><path d="M45.075 38.885C46.0608 38.885 46.86 38.0858 46.86 37.1C46.86 36.1142 46.0608 35.315 45.075 35.315C44.0892 35.315 43.29 36.1142 43.29 37.1C43.29 38.0858 44.0892 38.885 45.075 38.885Z" fill="#F28B0C"></path><path d="M50.445 38.885C51.4308 38.885 52.23 38.0858 52.23 37.1C52.23 36.1142 51.4308 35.315 50.445 35.315C49.4592 35.315 48.66 36.1142 48.66 37.1C48.66 38.0858 49.4592 38.885 50.445 38.885Z" fill="#F28B0C"></path><path d="M63.27 58.235L58.755 47.78C61.125 44.765 62.415 40.97 62.415 37.175C62.415 26.435 52.665 18.185 41.925 20.12C39.99 19.325 37.98 18.905 35.835 18.905C26.955 18.905 19.785 26.135 19.785 34.955C19.785 38.54 21 41.975 23.145 44.765L18.99 54.44C18.84 54.8 18.915 55.235 19.2 55.445C19.485 55.73 19.92 55.73 20.205 55.595L30.6 50.15C31.89 50.585 33.255 50.87 34.68 50.945C39.48 54.53 45.57 55.25 50.655 53.45L61.905 59.33C62.265 59.48 62.625 59.48 62.91 59.18C63.345 58.97 63.405 58.61 63.27 58.25V58.235ZM51.24 51.71C51.03 51.56 50.745 51.56 50.52 51.635C48.795 52.28 46.935 52.64 45.15 52.64C36.69 52.64 29.61 45.755 29.61 37.1C29.61 29.72 34.845 23.345 42.075 21.845C51.75 19.91 60.705 27.29 60.705 37.1C60.705 40.685 59.415 44.27 57.12 46.985C56.91 47.27 56.835 47.63 56.97 47.915L60.69 56.585L51.24 51.71Z" fill="#F28B0C"></path></g><defs><filter id="filter0_d_4007_3488" x="0.5" y="0.5" width="86" height="86" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="4"></feOffset><feGaussianBlur stdDeviation="2"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4007_3488"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4007_3488" result="shape"></feBlend></filter></defs>',2)];function hu(e,t){return h.openBlock(),h.createElementBlock("svg",uu,du)}const fu=Ce(cu,[["render",hu]]),mu={key:0,class:"chat-box"},_u=h.defineComponent({__name:"Widget",props:{tokenAuth:{type:String,required:!0},phoneUser:{type:String,required:!0}},setup(e){const t=h.ref(!1),s=()=>{t.value=!t.value};return(n,r)=>(h.openBlock(),h.createElementBlock("div",null,[h.createElementVNode("div",null,[h.createElementVNode("div",{id:"chat-circle",onClick:s},[h.createVNode(fu)]),t.value?(h.openBlock(),h.createElementBlock("div",mu,[h.createVNode(lu,{toggleChat:s,tokenAuth:e.tokenAuth,phoneUser:e.phoneUser},null,8,["tokenAuth","phoneUser"])])):h.createCommentVNode("",!0)])]))}}),Ru="",pu=Ce(_u,[["__scopeId","data-v-4b17fe0e"]]),yu={install(e,t){window.VITE_BACKEND_URL=t.VITE_BACKEND_URL,window.VITE_BROKER_URL=t.VITE_BROKER_URL,window.VITE_USERNAME=t.VITE_USERNAME,window.VITE_PASSWORD=t.VITE_PASSWORD}};_e.Widget=pu,_e.default=yu,Object.defineProperties(_e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
package/src/components/Chat.vue
CHANGED
@@ -122,7 +122,6 @@ const getMessagesByApp = async (param:{resetConnection:boolean}) => {
|
|
122
122
|
});
|
123
123
|
//const messagesData = store.getters.get_messages_chat;
|
124
124
|
const messagesData = getMessages
|
125
|
-
console.log(messagesData)
|
126
125
|
if (messagesData) {
|
127
126
|
|
128
127
|
messages.value = messagesData;
|
@@ -157,7 +156,7 @@ const disconnectMsRabbit = () => {
|
|
157
156
|
|
158
157
|
onMounted(async () => {
|
159
158
|
await getMessagesByApp({resetConnection:false})
|
160
|
-
const virtualHostUniqueUser = `
|
159
|
+
const virtualHostUniqueUser = `widget_chat_${props.phoneUser}`
|
161
160
|
// await store.dispatch('syncVirtualHostCentral',{
|
162
161
|
// token:props.tokenAuth,
|
163
162
|
// data:{
|
@@ -170,7 +169,6 @@ onMounted(async () => {
|
|
170
169
|
virtualHost:virtualHostUniqueUser
|
171
170
|
}
|
172
171
|
})
|
173
|
-
console.log(virtualHost.value)
|
174
172
|
connectMsRabbit()
|
175
173
|
scrollToBottom()
|
176
174
|
});
|