@enegelai/bot-widget 1.12.6 → 1.13.0
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/README.md +6 -0
- package/dist/enegelaibot.umd.js +115 -105
- package/dist/index.es.js +270 -215
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2,9 +2,9 @@ var ja = Object.defineProperty;
|
|
|
2
2
|
var Ha = (c, e, a) => e in c ? ja(c, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : c[e] = a;
|
|
3
3
|
var ge = (c, e, a) => Ha(c, typeof e != "symbol" ? e + "" : e, a);
|
|
4
4
|
import { css as X, LitElement as ut, html as g, svg as le } from "lit";
|
|
5
|
-
import { property as v, customElement as J, queryAll as Qt, query as Ce, eventOptions as
|
|
5
|
+
import { property as v, customElement as J, queryAll as Qt, query as Ce, eventOptions as Tt } from "lit/decorators.js";
|
|
6
6
|
import { unsafeHTML as W } from "lit-html/directives/unsafe-html.js";
|
|
7
|
-
import { when as
|
|
7
|
+
import { when as ee } from "lit/directives/when.js";
|
|
8
8
|
import { registerIconLibrary as Ba } from "@shoelace-style/shoelace";
|
|
9
9
|
import "@shoelace-style/shoelace/dist/components/button/button.js";
|
|
10
10
|
import "@shoelace-style/shoelace/dist/components/avatar/avatar.js";
|
|
@@ -234,8 +234,8 @@ var ca = { exports: {} };
|
|
|
234
234
|
function N($, V) {
|
|
235
235
|
var C = this, Ie, Le, ne, se = "loglevel";
|
|
236
236
|
typeof $ == "string" ? se += ":" + $ : typeof $ == "symbol" && (se = void 0);
|
|
237
|
-
function mt(
|
|
238
|
-
var R = (s[
|
|
237
|
+
function mt(j) {
|
|
238
|
+
var R = (s[j] || "silent").toUpperCase();
|
|
239
239
|
if (!(typeof window === a || !se)) {
|
|
240
240
|
try {
|
|
241
241
|
window.localStorage[se] = R;
|
|
@@ -249,21 +249,21 @@ var ca = { exports: {} };
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
function Re() {
|
|
252
|
-
var
|
|
252
|
+
var j;
|
|
253
253
|
if (!(typeof window === a || !se)) {
|
|
254
254
|
try {
|
|
255
|
-
|
|
255
|
+
j = window.localStorage[se];
|
|
256
256
|
} catch {
|
|
257
257
|
}
|
|
258
|
-
if (typeof
|
|
258
|
+
if (typeof j === a)
|
|
259
259
|
try {
|
|
260
260
|
var R = window.document.cookie, qe = encodeURIComponent(se), Ye = R.indexOf(qe + "=");
|
|
261
|
-
Ye !== -1 && (
|
|
261
|
+
Ye !== -1 && (j = /^([^;]+)/.exec(
|
|
262
262
|
R.slice(Ye + qe.length + 1)
|
|
263
263
|
)[1]);
|
|
264
264
|
} catch {
|
|
265
265
|
}
|
|
266
|
-
return C.levels[
|
|
266
|
+
return C.levels[j] === void 0 && (j = void 0), j;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
function Qe() {
|
|
@@ -278,11 +278,11 @@ var ca = { exports: {} };
|
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
function ve(
|
|
282
|
-
var R =
|
|
281
|
+
function ve(j) {
|
|
282
|
+
var R = j;
|
|
283
283
|
if (typeof R == "string" && C.levels[R.toUpperCase()] !== void 0 && (R = C.levels[R.toUpperCase()]), typeof R == "number" && R >= 0 && R <= C.levels.SILENT)
|
|
284
284
|
return R;
|
|
285
|
-
throw new TypeError("log.setLevel() called with invalid level: " +
|
|
285
|
+
throw new TypeError("log.setLevel() called with invalid level: " + j);
|
|
286
286
|
}
|
|
287
287
|
C.name = $, C.levels = {
|
|
288
288
|
TRACE: 0,
|
|
@@ -293,25 +293,25 @@ var ca = { exports: {} };
|
|
|
293
293
|
SILENT: 5
|
|
294
294
|
}, C.methodFactory = V || T, C.getLevel = function() {
|
|
295
295
|
return ne ?? Le ?? Ie;
|
|
296
|
-
}, C.setLevel = function(
|
|
297
|
-
return ne = ve(
|
|
298
|
-
}, C.setDefaultLevel = function(
|
|
299
|
-
Le = ve(
|
|
296
|
+
}, C.setLevel = function(j, R) {
|
|
297
|
+
return ne = ve(j), R !== !1 && mt(ne), K.call(C);
|
|
298
|
+
}, C.setDefaultLevel = function(j) {
|
|
299
|
+
Le = ve(j), Re() || C.setLevel(j, !1);
|
|
300
300
|
}, C.resetLevel = function() {
|
|
301
301
|
ne = null, Qe(), K.call(C);
|
|
302
|
-
}, C.enableAll = function(
|
|
303
|
-
C.setLevel(C.levels.TRACE,
|
|
304
|
-
}, C.disableAll = function(
|
|
305
|
-
C.setLevel(C.levels.SILENT,
|
|
302
|
+
}, C.enableAll = function(j) {
|
|
303
|
+
C.setLevel(C.levels.TRACE, j);
|
|
304
|
+
}, C.disableAll = function(j) {
|
|
305
|
+
C.setLevel(C.levels.SILENT, j);
|
|
306
306
|
}, C.rebuild = function() {
|
|
307
307
|
if (f !== C && (Ie = ve(f.getLevel())), K.call(C), f === C)
|
|
308
|
-
for (var
|
|
309
|
-
r[
|
|
308
|
+
for (var j in r)
|
|
309
|
+
r[j].rebuild();
|
|
310
310
|
}, Ie = ve(
|
|
311
311
|
f ? f.getLevel() : "WARN"
|
|
312
312
|
);
|
|
313
|
-
var
|
|
314
|
-
|
|
313
|
+
var z = Re();
|
|
314
|
+
z != null && (ne = ve(z)), K.call(C);
|
|
315
315
|
}
|
|
316
316
|
f = new N(), f.getLogger = function(V) {
|
|
317
317
|
if (typeof V != "symbol" && typeof V != "string" || V === "")
|
|
@@ -497,7 +497,7 @@ const Ke = /* @__PURE__ */ aa(Ua), Wa = X`
|
|
|
497
497
|
color: white;
|
|
498
498
|
}
|
|
499
499
|
`;
|
|
500
|
-
var Ya = Object.defineProperty, Xa = Object.getOwnPropertyDescriptor,
|
|
500
|
+
var Ya = Object.defineProperty, Xa = Object.getOwnPropertyDescriptor, Et = (c, e, a, n) => {
|
|
501
501
|
for (var s = n > 1 ? void 0 : n ? Xa(e, a) : e, r = c.length - 1, f; r >= 0; r--)
|
|
502
502
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
503
503
|
return n && s && Ya(e, a, s), s;
|
|
@@ -511,13 +511,13 @@ let Ge = class extends ut {
|
|
|
511
511
|
}
|
|
512
512
|
};
|
|
513
513
|
Ge.styles = ia;
|
|
514
|
-
|
|
514
|
+
Et([
|
|
515
515
|
v({ type: String })
|
|
516
516
|
], Ge.prototype, "color", 2);
|
|
517
|
-
|
|
517
|
+
Et([
|
|
518
518
|
v({ type: String })
|
|
519
519
|
], Ge.prototype, "svg", 2);
|
|
520
|
-
Ge =
|
|
520
|
+
Ge = Et([
|
|
521
521
|
J("cb-icon")
|
|
522
522
|
], Ge);
|
|
523
523
|
let Ga = (c) => crypto.getRandomValues(new Uint8Array(c)), Za = (c, e, a) => {
|
|
@@ -803,7 +803,7 @@ var dc = Object.defineProperty, O = (c, e, a, n) => {
|
|
|
803
803
|
};
|
|
804
804
|
const A = Ke.noConflict();
|
|
805
805
|
A.setLevel("info");
|
|
806
|
-
const
|
|
806
|
+
const te = "cb_";
|
|
807
807
|
class L extends Ct {
|
|
808
808
|
constructor() {
|
|
809
809
|
super(...arguments), this.actionIdCounter = 0, this.currentLoadContext = {}, this.prefilledFormValues = {}, this.wsClient = null, this.replyMessage = null, this.streamingResponseInProgress = !1, this.streamingResponseLastText = null, this.streamingResponseBuffer = null, this.streamingResponseTagStartPos = 0, this.streamingResponseCurrentTag = null;
|
|
@@ -942,7 +942,7 @@ class L extends Ct {
|
|
|
942
942
|
A.info("form has no fields", e);
|
|
943
943
|
return;
|
|
944
944
|
}
|
|
945
|
-
const r = `${
|
|
945
|
+
const r = `${te}${this.setting.botId}.${this.conversationId}.form.${n}`, f = localStorage.getItem(r);
|
|
946
946
|
if (f) {
|
|
947
947
|
let w = null;
|
|
948
948
|
try {
|
|
@@ -984,19 +984,20 @@ class L extends Ct {
|
|
|
984
984
|
}
|
|
985
985
|
// Lazy initialization: avoid connecting until we actually need to send something
|
|
986
986
|
async getWsClient() {
|
|
987
|
+
var s, r;
|
|
987
988
|
if (this.wsClient)
|
|
988
989
|
return this.wsClient;
|
|
989
|
-
|
|
990
|
-
return A.info(`Initiating ws connection to ${a} ...`), this.wsClient = new tc({
|
|
990
|
+
let a = `${this.setting.url.startsWith("localhost") ? "ws" : "wss"}://${this.setting.url}/api/bot/connect/${this.setting.orgId}/${this.setting.botId}/${this.conversationId}`;
|
|
991
|
+
return ((r = (s = this.botSettings) == null ? void 0 : s.botAdvancedSettings) == null ? void 0 : r.enableMultiModalConnection) && (a += "?multiModal=true", A.info("MultiModal connection enabled - adding multiModal=true parameter")), A.info(`Initiating ws connection to ${a} ...`), this.wsClient = new tc({
|
|
991
992
|
url: a,
|
|
992
993
|
orgId: this.setting.orgId,
|
|
993
994
|
botId: this.setting.botId,
|
|
994
995
|
convId: this.conversationId,
|
|
995
|
-
onConnecting: (
|
|
996
|
-
this.handleWscConnecting(
|
|
996
|
+
onConnecting: (f) => {
|
|
997
|
+
this.handleWscConnecting(f);
|
|
997
998
|
},
|
|
998
|
-
onMessage: (
|
|
999
|
-
this.handleWscMessage(
|
|
999
|
+
onMessage: (f) => {
|
|
1000
|
+
this.handleWscMessage(f);
|
|
1000
1001
|
}
|
|
1001
1002
|
}), await this.wsClient.start(), this.connectWs = "true", this.wsClient;
|
|
1002
1003
|
}
|
|
@@ -1034,7 +1035,7 @@ class L extends Ct {
|
|
|
1034
1035
|
this.replyMessage ? this.insertMessage(n, -1) : this.addMessage(n);
|
|
1035
1036
|
} else {
|
|
1036
1037
|
if (this.replyMessage)
|
|
1037
|
-
this.streamingResponseInProgress ? (this.finishStreamingResponse(e.text), this.streamingResponseInProgress = !1) : (this.replyMessage.data.text = e.text, this.updateMessage(this.replyMessage, "")), this.replyMessage = null;
|
|
1038
|
+
"userName" in e && (this.replyMessage.data.userName = e.userName), "userAvatar" in e && (this.replyMessage.data.userAvatar = e.userAvatar), this.streamingResponseInProgress ? (this.finishStreamingResponse(e.text), this.streamingResponseInProgress = !1) : (this.replyMessage.data.text = e.text, this.updateMessage(this.replyMessage, "")), this.replyMessage = null;
|
|
1038
1039
|
else {
|
|
1039
1040
|
const n = {
|
|
1040
1041
|
id: (e == null ? void 0 : e.id) || null,
|
|
@@ -1057,7 +1058,7 @@ class L extends Ct {
|
|
|
1057
1058
|
break;
|
|
1058
1059
|
}
|
|
1059
1060
|
case "typing": {
|
|
1060
|
-
this.replyMessage = {
|
|
1061
|
+
this.replyMessage || (this.replyMessage = {
|
|
1061
1062
|
id: (e == null ? void 0 : e.id) || null,
|
|
1062
1063
|
author: "assistant",
|
|
1063
1064
|
type: "text",
|
|
@@ -1065,7 +1066,37 @@ class L extends Ct {
|
|
|
1065
1066
|
data: {
|
|
1066
1067
|
text: ""
|
|
1067
1068
|
}
|
|
1068
|
-
}, this.addMessage(this.replyMessage);
|
|
1069
|
+
}, this.addMessage(this.replyMessage));
|
|
1070
|
+
break;
|
|
1071
|
+
}
|
|
1072
|
+
case "typing-stopped": {
|
|
1073
|
+
this.replyMessage && typeof this.replyMessage.id == "string" && this.replyMessage.isThinking && (this.removeMessage(this.replyMessage.id), this.replyMessage = null);
|
|
1074
|
+
break;
|
|
1075
|
+
}
|
|
1076
|
+
case "agent-connected": {
|
|
1077
|
+
this.addMessage({
|
|
1078
|
+
id: (e == null ? void 0 : e.id) || null,
|
|
1079
|
+
author: "assistant",
|
|
1080
|
+
type: "text",
|
|
1081
|
+
data: {
|
|
1082
|
+
text: "_Joined chat_",
|
|
1083
|
+
...e.userName && { userName: e.userName },
|
|
1084
|
+
...e.userAvatar && { userAvatar: e.userAvatar }
|
|
1085
|
+
}
|
|
1086
|
+
});
|
|
1087
|
+
break;
|
|
1088
|
+
}
|
|
1089
|
+
case "agent-disconnected": {
|
|
1090
|
+
this.addMessage({
|
|
1091
|
+
id: (e == null ? void 0 : e.id) || null,
|
|
1092
|
+
author: "assistant",
|
|
1093
|
+
type: "text",
|
|
1094
|
+
data: {
|
|
1095
|
+
text: "_Left chat_",
|
|
1096
|
+
...e.userName && { userName: e.userName },
|
|
1097
|
+
...e.userAvatar && { userAvatar: e.userAvatar }
|
|
1098
|
+
}
|
|
1099
|
+
});
|
|
1069
1100
|
break;
|
|
1070
1101
|
}
|
|
1071
1102
|
case "form": {
|
|
@@ -1250,7 +1281,7 @@ class L extends Ct {
|
|
|
1250
1281
|
A.info("submitForm: No form is active - ignored");
|
|
1251
1282
|
return;
|
|
1252
1283
|
}
|
|
1253
|
-
const a = `${
|
|
1284
|
+
const a = `${te}${this.setting.botId}.${this.conversationId}.form.${this.form.name}`;
|
|
1254
1285
|
await this.sendFormData(this.form.name, e), localStorage.setItem(a, JSON.stringify(e)), "name" in e && (this.feedbackName = e.name), "email" in e && (this.feedbackEmail = e.email), this.form = null;
|
|
1255
1286
|
}
|
|
1256
1287
|
async sendFormData(e, a) {
|
|
@@ -1355,42 +1386,42 @@ class L extends Ct {
|
|
|
1355
1386
|
}
|
|
1356
1387
|
}
|
|
1357
1388
|
O([
|
|
1358
|
-
oe({ prefix:
|
|
1389
|
+
oe({ prefix: te }),
|
|
1359
1390
|
q({ value: "en" })
|
|
1360
1391
|
], L.prototype, "language");
|
|
1361
1392
|
O([
|
|
1362
|
-
oe({ prefix:
|
|
1393
|
+
oe({ prefix: te }),
|
|
1363
1394
|
q({ value: "light" })
|
|
1364
1395
|
], L.prototype, "theme");
|
|
1365
1396
|
O([
|
|
1366
|
-
oe({ prefix:
|
|
1397
|
+
oe({ prefix: te }),
|
|
1367
1398
|
q({ type: Boolean, value: !1 })
|
|
1368
1399
|
], L.prototype, "open");
|
|
1369
1400
|
O([
|
|
1370
1401
|
q({ type: Boolean, value: !1 })
|
|
1371
1402
|
], L.prototype, "alwaysOpen");
|
|
1372
1403
|
O([
|
|
1373
|
-
oe({ prefix:
|
|
1404
|
+
oe({ prefix: te }),
|
|
1374
1405
|
q({ value: "false" })
|
|
1375
1406
|
], L.prototype, "connectWs");
|
|
1376
1407
|
O([
|
|
1377
|
-
oe({ prefix:
|
|
1408
|
+
oe({ prefix: te }),
|
|
1378
1409
|
q({ value: xe() })
|
|
1379
1410
|
], L.prototype, "conversationId");
|
|
1380
1411
|
O([
|
|
1381
|
-
oe({ prefix:
|
|
1412
|
+
oe({ prefix: te }),
|
|
1382
1413
|
q({ value: 0 })
|
|
1383
1414
|
], L.prototype, "lastConversationUpdate");
|
|
1384
1415
|
O([
|
|
1385
|
-
oe({ prefix:
|
|
1416
|
+
oe({ prefix: te }),
|
|
1386
1417
|
q({ type: Array, value: [] })
|
|
1387
1418
|
], L.prototype, "messages");
|
|
1388
1419
|
O([
|
|
1389
|
-
oe({ prefix:
|
|
1420
|
+
oe({ prefix: te }),
|
|
1390
1421
|
q({ value: 0 })
|
|
1391
1422
|
], L.prototype, "unreadMessages");
|
|
1392
1423
|
O([
|
|
1393
|
-
oe({ prefix:
|
|
1424
|
+
oe({ prefix: te }),
|
|
1394
1425
|
q({
|
|
1395
1426
|
type: Array,
|
|
1396
1427
|
value: []
|
|
@@ -1456,14 +1487,14 @@ O([
|
|
|
1456
1487
|
q({ type: Boolean, value: !1 })
|
|
1457
1488
|
], L.prototype, "connected");
|
|
1458
1489
|
O([
|
|
1459
|
-
oe({ prefix:
|
|
1490
|
+
oe({ prefix: te }),
|
|
1460
1491
|
q({ value: "true" })
|
|
1461
1492
|
], L.prototype, "shouldEngage");
|
|
1462
1493
|
O([
|
|
1463
1494
|
q({ type: Boolean, value: !1 })
|
|
1464
1495
|
], L.prototype, "engage");
|
|
1465
1496
|
O([
|
|
1466
|
-
oe({ prefix:
|
|
1497
|
+
oe({ prefix: te }),
|
|
1467
1498
|
q({
|
|
1468
1499
|
type: Object,
|
|
1469
1500
|
value: {
|
|
@@ -1483,7 +1514,7 @@ O([
|
|
|
1483
1514
|
})
|
|
1484
1515
|
], L.prototype, "setting");
|
|
1485
1516
|
O([
|
|
1486
|
-
oe({ prefix:
|
|
1517
|
+
oe({ prefix: te }),
|
|
1487
1518
|
q({ type: Object, value: {} })
|
|
1488
1519
|
], L.prototype, "context");
|
|
1489
1520
|
O([
|
|
@@ -1517,11 +1548,11 @@ O([
|
|
|
1517
1548
|
q({ type: Array, value: [] })
|
|
1518
1549
|
], L.prototype, "feedbackMessages");
|
|
1519
1550
|
O([
|
|
1520
|
-
oe({ prefix:
|
|
1551
|
+
oe({ prefix: te }),
|
|
1521
1552
|
q({ type: String, value: "" })
|
|
1522
1553
|
], L.prototype, "feedbackName");
|
|
1523
1554
|
O([
|
|
1524
|
-
oe({ prefix:
|
|
1555
|
+
oe({ prefix: te }),
|
|
1525
1556
|
q({ type: String, value: "" })
|
|
1526
1557
|
], L.prototype, "feedbackEmail");
|
|
1527
1558
|
const p = new L(), fc = X`
|
|
@@ -1607,7 +1638,7 @@ var lc = Object.defineProperty, bc = (c, e, a, n) => {
|
|
|
1607
1638
|
Ba("system", {
|
|
1608
1639
|
resolver: (c) => ""
|
|
1609
1640
|
});
|
|
1610
|
-
class
|
|
1641
|
+
class ae extends ut {
|
|
1611
1642
|
constructor() {
|
|
1612
1643
|
super(...arguments), this.lang = "en";
|
|
1613
1644
|
}
|
|
@@ -1624,14 +1655,14 @@ class te extends ut {
|
|
|
1624
1655
|
}
|
|
1625
1656
|
bc([
|
|
1626
1657
|
v({ type: String })
|
|
1627
|
-
],
|
|
1658
|
+
], ae.prototype, "lang");
|
|
1628
1659
|
var hc = Object.defineProperty, uc = Object.getOwnPropertyDescriptor, na = (c, e, a, n) => {
|
|
1629
1660
|
for (var s = n > 1 ? void 0 : n ? uc(e, a) : e, r = c.length - 1, f; r >= 0; r--)
|
|
1630
1661
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
1631
1662
|
return n && s && hc(e, a, s), s;
|
|
1632
1663
|
};
|
|
1633
1664
|
const pc = '<svg viewBox="0 0 16 16" width="16px" height="16px"><path fill="currentColor" d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"></path></svg>';
|
|
1634
|
-
let ot = class extends
|
|
1665
|
+
let ot = class extends ae {
|
|
1635
1666
|
constructor() {
|
|
1636
1667
|
super(...arguments), this.title = "ChatBot";
|
|
1637
1668
|
}
|
|
@@ -1642,13 +1673,13 @@ let ot = class extends te {
|
|
|
1642
1673
|
*/
|
|
1643
1674
|
renderExp() {
|
|
1644
1675
|
return g` <header class="cb-header" part="header">
|
|
1645
|
-
${
|
|
1676
|
+
${ee(
|
|
1646
1677
|
p.setting.logoUrl !== "",
|
|
1647
1678
|
() => g`<img class="cb-header-logo" part="header-logo" src="${p.setting.logoUrl}" />`,
|
|
1648
1679
|
() => g`<div class="cb-header-logo" part="header-logo">${W(p.setting.logoSvg)}</div>`
|
|
1649
1680
|
)}
|
|
1650
1681
|
<div class="cb-header-title" part="header-title">${this.title}</div>
|
|
1651
|
-
${
|
|
1682
|
+
${ee(
|
|
1652
1683
|
p.alwaysOpen,
|
|
1653
1684
|
() => g``,
|
|
1654
1685
|
() => g`<div class="cb-header-close" part="header-close">${W(pc)}</div>`
|
|
@@ -1657,13 +1688,13 @@ let ot = class extends te {
|
|
|
1657
1688
|
}
|
|
1658
1689
|
render() {
|
|
1659
1690
|
return g` <header class="cb-header" part="header">
|
|
1660
|
-
${
|
|
1691
|
+
${ee(
|
|
1661
1692
|
p.setting.logoUrl !== "",
|
|
1662
1693
|
() => g`<img class="cb-header-img" part="header-logo" src="${p.setting.logoUrl}" />`,
|
|
1663
1694
|
() => g`<div class="cb-header-logo" part="header-logo">${W(p.setting.logoSvg)}</div>`
|
|
1664
1695
|
)}
|
|
1665
1696
|
<div class="cb-header-title" part="header-title">${this.title}</div>
|
|
1666
|
-
${
|
|
1697
|
+
${ee(
|
|
1667
1698
|
p.alwaysOpen,
|
|
1668
1699
|
() => g`<div></div>`,
|
|
1669
1700
|
() => g`<div @click=${this._clickCloseHandler} class="cb-header-close" part="header-close">${W(p.setting.closeSvg)}</div>`
|
|
@@ -1720,7 +1751,7 @@ var mc = Object.defineProperty, yc = Object.getOwnPropertyDescriptor, vc = (c, e
|
|
|
1720
1751
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
1721
1752
|
return n && s && mc(e, a, s), s;
|
|
1722
1753
|
};
|
|
1723
|
-
let St = class extends
|
|
1754
|
+
let St = class extends ae {
|
|
1724
1755
|
constructor() {
|
|
1725
1756
|
super(...arguments), this.year = (/* @__PURE__ */ new Date()).getFullYear();
|
|
1726
1757
|
}
|
|
@@ -2027,9 +2058,9 @@ var sa = { exports: {} };
|
|
|
2027
2058
|
function D(t) {
|
|
2028
2059
|
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = i.onElement, d = i.withCallback, l = i.avoidDuplicate, h = l === void 0 || l, b = i.once, u = b !== void 0 && b, y = i.useCapture, m = y !== void 0 && y, x = arguments.length > 2 ? arguments[2] : void 0, k = o || [];
|
|
2029
2060
|
function M(E) {
|
|
2030
|
-
|
|
2061
|
+
z(d) && d.call(x, E, this), u && M.destroy();
|
|
2031
2062
|
}
|
|
2032
|
-
return
|
|
2063
|
+
return j(k) && (k = document.querySelectorAll(k)), M.destroy = function() {
|
|
2033
2064
|
_(k, function(E) {
|
|
2034
2065
|
var I = K(E, t, M);
|
|
2035
2066
|
I.found && I.all.splice(I.evt, 1), E.removeEventListener && E.removeEventListener(t, M, m);
|
|
@@ -2061,14 +2092,14 @@ var sa = { exports: {} };
|
|
|
2061
2092
|
function V(t) {
|
|
2062
2093
|
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", o = arguments.length > 2 && arguments[2] !== void 0 && arguments[2];
|
|
2063
2094
|
if (!t || i === "") return !1;
|
|
2064
|
-
if (i === "none") return
|
|
2095
|
+
if (i === "none") return z(o) && o(), !1;
|
|
2065
2096
|
var d = mt(), l = i.split(" ");
|
|
2066
2097
|
_(l, function(h) {
|
|
2067
2098
|
T(t, "g" + h);
|
|
2068
2099
|
}), D(d, { onElement: t, avoidDuplicate: !1, once: !0, withCallback: function(h, b) {
|
|
2069
2100
|
_(l, function(u) {
|
|
2070
2101
|
N(b, "g" + u);
|
|
2071
|
-
}),
|
|
2102
|
+
}), z(o) && o();
|
|
2072
2103
|
} });
|
|
2073
2104
|
}
|
|
2074
2105
|
function C(t) {
|
|
@@ -2106,17 +2137,17 @@ var sa = { exports: {} };
|
|
|
2106
2137
|
}
|
|
2107
2138
|
function Qe(t, i, o) {
|
|
2108
2139
|
if (re(t)) console.error("Inject assets error");
|
|
2109
|
-
else if (
|
|
2140
|
+
else if (z(i) && (o = i, i = !1), j(i) && i in window) z(o) && o();
|
|
2110
2141
|
else {
|
|
2111
2142
|
var d;
|
|
2112
2143
|
if (t.indexOf(".css") !== -1) {
|
|
2113
|
-
if ((d = document.querySelectorAll('link[href="' + t + '"]')) && d.length > 0) return void (
|
|
2144
|
+
if ((d = document.querySelectorAll('link[href="' + t + '"]')) && d.length > 0) return void (z(o) && o());
|
|
2114
2145
|
var l = document.getElementsByTagName("head")[0], h = l.querySelectorAll('link[rel="stylesheet"]'), b = document.createElement("link");
|
|
2115
|
-
return b.rel = "stylesheet", b.type = "text/css", b.href = t, b.media = "all", h ? l.insertBefore(b, h[0]) : l.appendChild(b), void (
|
|
2146
|
+
return b.rel = "stylesheet", b.type = "text/css", b.href = t, b.media = "all", h ? l.insertBefore(b, h[0]) : l.appendChild(b), void (z(o) && o());
|
|
2116
2147
|
}
|
|
2117
2148
|
if ((d = document.querySelectorAll('script[src="' + t + '"]')) && d.length > 0) {
|
|
2118
|
-
if (
|
|
2119
|
-
if (
|
|
2149
|
+
if (z(o)) {
|
|
2150
|
+
if (j(i)) return Re(function() {
|
|
2120
2151
|
return window[i] !== void 0;
|
|
2121
2152
|
}, function() {
|
|
2122
2153
|
o();
|
|
@@ -2126,8 +2157,8 @@ var sa = { exports: {} };
|
|
|
2126
2157
|
} else {
|
|
2127
2158
|
var u = document.createElement("script");
|
|
2128
2159
|
u.type = "text/javascript", u.src = t, u.onload = function() {
|
|
2129
|
-
if (
|
|
2130
|
-
if (
|
|
2160
|
+
if (z(o)) {
|
|
2161
|
+
if (j(i)) return Re(function() {
|
|
2131
2162
|
return window[i] !== void 0;
|
|
2132
2163
|
}, function() {
|
|
2133
2164
|
o();
|
|
@@ -2141,10 +2172,10 @@ var sa = { exports: {} };
|
|
|
2141
2172
|
function ve() {
|
|
2142
2173
|
return "navigator" in window && window.navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i);
|
|
2143
2174
|
}
|
|
2144
|
-
function
|
|
2175
|
+
function z(t) {
|
|
2145
2176
|
return typeof t == "function";
|
|
2146
2177
|
}
|
|
2147
|
-
function
|
|
2178
|
+
function j(t) {
|
|
2148
2179
|
return typeof t == "string";
|
|
2149
2180
|
}
|
|
2150
2181
|
function R(t) {
|
|
@@ -2157,7 +2188,7 @@ var sa = { exports: {} };
|
|
|
2157
2188
|
return t && t.length && isFinite(t.length);
|
|
2158
2189
|
}
|
|
2159
2190
|
function _e(t) {
|
|
2160
|
-
return n(t) === "object" && t != null && !
|
|
2191
|
+
return n(t) === "object" && t != null && !z(t) && !qe(t);
|
|
2161
2192
|
}
|
|
2162
2193
|
function re(t) {
|
|
2163
2194
|
return t == null;
|
|
@@ -2315,7 +2346,7 @@ var sa = { exports: {} };
|
|
|
2315
2346
|
function xa(t, i, o, d) {
|
|
2316
2347
|
var l = t.querySelector(".gslide-media"), h = new Image(), b = "gSlideTitle_" + o, u = "gSlideDesc_" + o;
|
|
2317
2348
|
h.addEventListener("load", function() {
|
|
2318
|
-
|
|
2349
|
+
z(d) && d();
|
|
2319
2350
|
}, !1), h.src = i.href, i.sizes != "" && i.srcset != "" && (h.sizes = i.sizes, h.srcset = i.srcset), h.alt = "", re(i.alt) || i.alt === "" || (h.alt = i.alt), i.title !== "" && h.setAttribute("aria-labelledby", b), i.description !== "" && h.setAttribute("aria-describedby", u), i.hasOwnProperty("_hasCustomWidth") && i._hasCustomWidth && (h.style.width = i.width), i.hasOwnProperty("_hasCustomHeight") && i._hasCustomHeight && (h.style.height = i.height), l.insertBefore(h, l.firstChild);
|
|
2320
2351
|
}
|
|
2321
2352
|
function ka(t, i, o, d) {
|
|
@@ -2334,7 +2365,7 @@ var sa = { exports: {} };
|
|
|
2334
2365
|
T(m, "".concat(k, "-video gvideo")), m.appendChild(I), m.setAttribute("data-id", b), m.setAttribute("data-index", o);
|
|
2335
2366
|
var U = Y(l.settings.plyr, "config") ? l.settings.plyr.config : {}, fe = new Plyr("#" + b, U);
|
|
2336
2367
|
fe.on("ready", function(de) {
|
|
2337
|
-
y[b] = de.detail.plyr,
|
|
2368
|
+
y[b] = de.detail.plyr, z(d) && d();
|
|
2338
2369
|
}), Re(function() {
|
|
2339
2370
|
return t.querySelector("iframe") && t.querySelector("iframe").dataset.ready == "true";
|
|
2340
2371
|
}, function() {
|
|
@@ -2348,7 +2379,7 @@ var sa = { exports: {} };
|
|
|
2348
2379
|
}
|
|
2349
2380
|
function Ca(t, i, o, d) {
|
|
2350
2381
|
var l, h = this, b = t.querySelector(".gslide-media"), u = !(!Y(i, "href") || !i.href) && i.href.split("#").pop().trim(), y = !(!Y(i, "content") || !i.content) && i.content;
|
|
2351
|
-
if (y && (
|
|
2382
|
+
if (y && (j(y) && (l = ne('<div class="ginlined-content">'.concat(y, "</div>"))), R(y))) {
|
|
2352
2383
|
y.style.display == "none" && (y.style.display = "block");
|
|
2353
2384
|
var m = document.createElement("div");
|
|
2354
2385
|
m.className = "ginlined-content", m.appendChild(y), l = m;
|
|
@@ -2362,13 +2393,13 @@ var sa = { exports: {} };
|
|
|
2362
2393
|
if (!l) return console.error("Unable to append inline slide content", i), !1;
|
|
2363
2394
|
b.style.height = i.height, b.style.width = i.width, b.appendChild(l), this.events["inlineclose" + u] = D("click", { onElement: b.querySelectorAll(".gtrigger-close"), withCallback: function(M) {
|
|
2364
2395
|
M.preventDefault(), h.close();
|
|
2365
|
-
} }),
|
|
2396
|
+
} }), z(d) && d();
|
|
2366
2397
|
}
|
|
2367
2398
|
function Sa(t, i, o, d) {
|
|
2368
2399
|
var l = t.querySelector(".gslide-media"), h = function(b) {
|
|
2369
2400
|
var u = b.url, y = b.allow, m = b.callback, x = b.appendTo, k = document.createElement("iframe");
|
|
2370
2401
|
return k.className = "vimeo-video gvideo", k.src = u, k.style.width = "100%", k.style.height = "100%", y && k.setAttribute("allow", y), k.onload = function() {
|
|
2371
|
-
k.onload = null, T(k, "node-ready"),
|
|
2402
|
+
k.onload = null, T(k, "node-ready"), z(m) && m();
|
|
2372
2403
|
}, x && x.appendChild(k), k;
|
|
2373
2404
|
}({ url: i.href, callback: d });
|
|
2374
2405
|
l.parentNode.style.maxWidth = i.width, l.parentNode.style.height = i.height, l.appendChild(h);
|
|
@@ -2439,16 +2470,16 @@ var sa = { exports: {} };
|
|
|
2439
2470
|
var t = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, o = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
|
|
2440
2471
|
if (Q(i, "loaded")) return !1;
|
|
2441
2472
|
var d = this.instance.settings, l = this.slideConfig, h = ve();
|
|
2442
|
-
|
|
2473
|
+
z(d.beforeSlideLoad) && d.beforeSlideLoad({ index: this.index, slide: i, player: !1 });
|
|
2443
2474
|
var b = l.type, u = l.descPosition, y = i.querySelector(".gslide-media"), m = i.querySelector(".gslide-title"), x = i.querySelector(".gslide-desc"), k = i.querySelector(".gdesc-inner"), M = o, E = "gSlideTitle_" + this.index, I = "gSlideDesc_" + this.index;
|
|
2444
|
-
if (
|
|
2445
|
-
|
|
2475
|
+
if (z(d.afterSlideLoad) && (M = function() {
|
|
2476
|
+
z(o) && o(), d.afterSlideLoad({ index: t.index, slide: i, player: t.instance.getSlidePlayerInstance(t.index) });
|
|
2446
2477
|
}), l.title == "" && l.description == "" ? k && k.parentNode.parentNode.removeChild(k.parentNode) : (m && l.title !== "" ? (m.id = E, m.innerHTML = l.title) : m.parentNode.removeChild(m), x && l.description !== "" ? (x.id = I, h && d.moreLength > 0 ? (l.smallDescription = this.slideShortDesc(l.description, d.moreLength, d.moreText), x.innerHTML = l.smallDescription, this.descriptionEvents(x, l)) : x.innerHTML = l.description) : x.parentNode.removeChild(x), T(y.parentNode, "desc-".concat(u)), T(k.parentNode, "description-".concat(u))), T(y, "gslide-".concat(b)), T(i, "loaded"), b !== "video") {
|
|
2447
|
-
if (b !== "external") return b === "inline" ? (Ca.apply(this.instance, [i, l, this.index, M]), void (l.draggable && new jt({ dragEl: i.querySelector(".gslide-inline"), toleranceX: d.dragToleranceX, toleranceY: d.dragToleranceY, slide: i, instance: this.instance }))) : void (b !== "image" ?
|
|
2478
|
+
if (b !== "external") return b === "inline" ? (Ca.apply(this.instance, [i, l, this.index, M]), void (l.draggable && new jt({ dragEl: i.querySelector(".gslide-inline"), toleranceX: d.dragToleranceX, toleranceY: d.dragToleranceY, slide: i, instance: this.instance }))) : void (b !== "image" ? z(M) && M() : xa(i, l, this.index, function() {
|
|
2448
2479
|
var U = i.querySelector("img");
|
|
2449
2480
|
l.draggable && new jt({ dragEl: U, toleranceX: d.dragToleranceX, toleranceY: d.dragToleranceY, slide: i, instance: t.instance }), l.zoomable && U.naturalWidth > U.offsetWidth && (T(U, "zoomable"), new wa(U, i, function() {
|
|
2450
2481
|
t.instance.resize();
|
|
2451
|
-
})),
|
|
2482
|
+
})), z(M) && M();
|
|
2452
2483
|
}));
|
|
2453
2484
|
Sa.apply(this, [i, l, this.index, M]);
|
|
2454
2485
|
} else ka.apply(this.instance, [i, l, this.index, M]);
|
|
@@ -2509,15 +2540,15 @@ var sa = { exports: {} };
|
|
|
2509
2540
|
typeof o == "function" && o.apply(this.el, arguments);
|
|
2510
2541
|
}
|
|
2511
2542
|
} }]);
|
|
2512
|
-
function
|
|
2543
|
+
function ce(t, i) {
|
|
2513
2544
|
var o = new Ma(t);
|
|
2514
2545
|
return o.add(i), o;
|
|
2515
2546
|
}
|
|
2516
|
-
var
|
|
2547
|
+
var Aa = f(function t(i, o) {
|
|
2517
2548
|
s(this, t), this.element = typeof i == "string" ? document.querySelector(i) : i, this.start = this.start.bind(this), this.move = this.move.bind(this), this.end = this.end.bind(this), this.cancel = this.cancel.bind(this), this.element.addEventListener("touchstart", this.start, !1), this.element.addEventListener("touchmove", this.move, !1), this.element.addEventListener("touchend", this.end, !1), this.element.addEventListener("touchcancel", this.cancel, !1), this.preV = { x: null, y: null }, this.pinchStartLen = null, this.zoom = 1, this.isDoubleTap = !1;
|
|
2518
2549
|
var d = function() {
|
|
2519
2550
|
};
|
|
2520
|
-
this.rotate =
|
|
2551
|
+
this.rotate = ce(this.element, o.rotate || d), this.touchStart = ce(this.element, o.touchStart || d), this.multipointStart = ce(this.element, o.multipointStart || d), this.multipointEnd = ce(this.element, o.multipointEnd || d), this.pinch = ce(this.element, o.pinch || d), this.swipe = ce(this.element, o.swipe || d), this.tap = ce(this.element, o.tap || d), this.doubleTap = ce(this.element, o.doubleTap || d), this.longTap = ce(this.element, o.longTap || d), this.singleTap = ce(this.element, o.singleTap || d), this.pressMove = ce(this.element, o.pressMove || d), this.twoFingerPressMove = ce(this.element, o.twoFingerPressMove || d), this.touchMove = ce(this.element, o.touchMove || d), this.touchEnd = ce(this.element, o.touchEnd || d), this.touchCancel = ce(this.element, o.touchCancel || d), this.translateContainer = this.element, this._cancelAllHandler = this.cancelAll.bind(this), window.addEventListener("scroll", this._cancelAllHandler), this.delta = null, this.last = null, this.now = null, this.tapTimeout = null, this.singleTapTimeout = null, this.longTapTimeout = null, this.swipeTimeout = null, this.x1 = this.x2 = this.y1 = this.y2 = null, this.preTapPosition = { x: null, y: null };
|
|
2521
2552
|
}, [{ key: "start", value: function(t) {
|
|
2522
2553
|
if (t.touches) if (t.target && t.target.nodeName && ["a", "button", "input"].indexOf(t.target.nodeName.toLowerCase()) >= 0) console.log("ignore drag for this touched element", t.target.nodeName.toLowerCase());
|
|
2523
2554
|
else {
|
|
@@ -2586,9 +2617,9 @@ var sa = { exports: {} };
|
|
|
2586
2617
|
N(d, "greset");
|
|
2587
2618
|
} }), d.style.opacity = "", h && (h.style.opacity = "");
|
|
2588
2619
|
}
|
|
2589
|
-
function
|
|
2620
|
+
function Ta(t) {
|
|
2590
2621
|
if (t.events.hasOwnProperty("touch")) return !1;
|
|
2591
|
-
var i, o, d, l = se(), h = l.width, b = l.height, u = !1, y = null, m = null, x = null, k = !1, M = 1, E = 1, I = !1, U = !1, fe = null, de = null, G = null, $e = null, ue = 0, Ve = 0, Fe = !1, De = !1, pe = {}, Oe = {}, Ft = 0, Dt = 0, La = document.getElementById("glightbox-slider"), ct = document.querySelector(".goverlay"), qa = new
|
|
2622
|
+
var i, o, d, l = se(), h = l.width, b = l.height, u = !1, y = null, m = null, x = null, k = !1, M = 1, E = 1, I = !1, U = !1, fe = null, de = null, G = null, $e = null, ue = 0, Ve = 0, Fe = !1, De = !1, pe = {}, Oe = {}, Ft = 0, Dt = 0, La = document.getElementById("glightbox-slider"), ct = document.querySelector(".goverlay"), qa = new Aa(La, { touchStart: function(B) {
|
|
2592
2623
|
if (u = !0, (Q(B.targetTouches[0].target, "ginner-container") || $(B.targetTouches[0].target, ".gslide-desc") || B.targetTouches[0].target.nodeName.toLowerCase() == "a") && (u = !1), $(B.targetTouches[0].target, ".gslide-inline") && !Q(B.targetTouches[0].target.parentNode, "gslide-inline") && (u = !1), u) {
|
|
2593
2624
|
if (Oe = B.targetTouches[0], pe.pageX = B.targetTouches[0].pageX, pe.pageY = B.targetTouches[0].pageY, Ft = B.targetTouches[0].clientX, Dt = B.targetTouches[0].clientY, y = t.activeSlide, m = y.querySelector(".gslide-media"), d = y.querySelector(".gslide-inline"), x = null, Q(m, "gslide-image") && (x = m.querySelector("img")), (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) > 769 && (m = y.querySelector(".ginner-container")), N(ct, "greset"), B.pageX > 20 && B.pageX < window.innerWidth - 20) return;
|
|
2594
2625
|
B.preventDefault();
|
|
@@ -2596,8 +2627,8 @@ var sa = { exports: {} };
|
|
|
2596
2627
|
}, touchMove: function(B) {
|
|
2597
2628
|
if (u && (Oe = B.targetTouches[0], !I && !U)) {
|
|
2598
2629
|
if (d && d.offsetHeight > b) {
|
|
2599
|
-
var
|
|
2600
|
-
if (Math.abs(
|
|
2630
|
+
var ie = pe.pageX - Oe.pageX;
|
|
2631
|
+
if (Math.abs(ie) <= 13) return !1;
|
|
2601
2632
|
}
|
|
2602
2633
|
k = !0;
|
|
2603
2634
|
var Me, it = B.targetTouches[0].clientX, Oa = B.targetTouches[0].clientY, Pa = Ft - it, za = Dt - Oa;
|
|
@@ -2607,8 +2638,8 @@ var sa = { exports: {} };
|
|
|
2607
2638
|
}, touchEnd: function() {
|
|
2608
2639
|
if (u) {
|
|
2609
2640
|
if (k = !1, U || I) return G = fe, void ($e = de);
|
|
2610
|
-
var B = Math.abs(parseInt(Ve)),
|
|
2611
|
-
if (!(B > 29 && x)) return B < 29 &&
|
|
2641
|
+
var B = Math.abs(parseInt(Ve)), ie = Math.abs(parseInt(ue));
|
|
2642
|
+
if (!(B > 29 && x)) return B < 29 && ie < 25 ? (T(ct, "greset"), ct.style.opacity = 1, yt(m)) : void 0;
|
|
2612
2643
|
t.close();
|
|
2613
2644
|
}
|
|
2614
2645
|
}, multipointEnd: function() {
|
|
@@ -2620,14 +2651,14 @@ var sa = { exports: {} };
|
|
|
2620
2651
|
}, pinch: function(B) {
|
|
2621
2652
|
if (!x || k) return !1;
|
|
2622
2653
|
I = !0, x.scaleX = x.scaleY = M * B.zoom;
|
|
2623
|
-
var
|
|
2624
|
-
if (U = !0,
|
|
2625
|
-
|
|
2654
|
+
var ie = M * B.zoom;
|
|
2655
|
+
if (U = !0, ie <= 1) return U = !1, ie = 1, $e = null, G = null, fe = null, de = null, void x.setAttribute("style", "");
|
|
2656
|
+
ie > 4.5 && (ie = 4.5), x.style.transform = "scale3d(".concat(ie, ", ").concat(ie, ", 1)"), E = ie;
|
|
2626
2657
|
}, pressMove: function(B) {
|
|
2627
2658
|
if (U && !I) {
|
|
2628
|
-
var
|
|
2629
|
-
G && (
|
|
2630
|
-
var it = "translate3d(".concat(
|
|
2659
|
+
var ie = Oe.pageX - pe.pageX, Me = Oe.pageY - pe.pageY;
|
|
2660
|
+
G && (ie += G), $e && (Me += $e), fe = ie, de = Me;
|
|
2661
|
+
var it = "translate3d(".concat(ie, "px, ").concat(Me, "px, 0)");
|
|
2631
2662
|
E && (it += " scale3d(".concat(E, ", ").concat(E, ", 1)")), C(x, it);
|
|
2632
2663
|
}
|
|
2633
2664
|
}, swipe: function(B) {
|
|
@@ -2645,7 +2676,7 @@ var sa = { exports: {} };
|
|
|
2645
2676
|
} });
|
|
2646
2677
|
t.events.touch = qa;
|
|
2647
2678
|
}
|
|
2648
|
-
var Bt = ve(), Rt = ve() !== null || document.createTouch !== void 0 || "ontouchstart" in window || "onmsgesturechange" in window || navigator.msMaxTouchPoints, Vt = document.getElementsByTagName("html")[0],
|
|
2679
|
+
var Bt = ve(), Rt = ve() !== null || document.createTouch !== void 0 || "ontouchstart" in window || "onmsgesturechange" in window || navigator.msMaxTouchPoints, Vt = document.getElementsByTagName("html")[0], Ea = { selector: ".glightbox", elements: null, skin: "clean", theme: "clean", closeButton: !0, startAt: null, autoplayVideos: !0, autofocusVideos: !0, descPosition: "bottom", width: "900px", height: "506px", videosWidth: "960px", beforeSlideChange: null, afterSlideChange: null, beforeSlideLoad: null, afterSlideLoad: null, slideInserted: null, slideRemoved: null, slideExtraAttributes: null, onOpen: null, onClose: null, loop: !1, zoomable: !0, draggable: !0, dragAutoSnap: !1, dragToleranceX: 40, dragToleranceY: 65, preload: !0, oneSlidePerOpen: !1, touchNavigation: !0, touchFollowAxis: !0, keyboardNavigation: !0, closeOnOutsideClick: !0, plugins: !1, plyr: { css: "https://cdn.plyr.io/3.6.12/plyr.css", js: "https://cdn.plyr.io/3.6.12/plyr.js", config: { ratio: "16:9", fullscreen: { enabled: !0, iosNative: !0 }, youtube: { noCookie: !0, rel: 0, showinfo: 0, iv_load_policy: 3 }, vimeo: { byline: !1, portrait: !1, title: !1, transparent: !1 } } }, openEffect: "zoom", closeEffect: "zoom", slideEffect: "slide", moreText: "See more", moreLength: 60, cssEfects: { fade: { in: "fadeIn", out: "fadeOut" }, zoom: { in: "zoomIn", out: "zoomOut" }, slide: { in: "slideInRight", out: "slideOutLeft" }, slideBack: { in: "slideInLeft", out: "slideOutRight" }, none: { in: "none", out: "none" } }, svg: { close: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" xml:space="preserve"><g><g><path d="M505.943,6.058c-8.077-8.077-21.172-8.077-29.249,0L6.058,476.693c-8.077,8.077-8.077,21.172,0,29.249C10.096,509.982,15.39,512,20.683,512c5.293,0,10.586-2.019,14.625-6.059L505.943,35.306C514.019,27.23,514.019,14.135,505.943,6.058z"/></g></g><g><g><path d="M505.942,476.694L35.306,6.059c-8.076-8.077-21.172-8.077-29.248,0c-8.077,8.076-8.077,21.171,0,29.248l470.636,470.636c4.038,4.039,9.332,6.058,14.625,6.058c5.293,0,10.587-2.019,14.624-6.057C514.018,497.866,514.018,484.771,505.942,476.694z"/></g></g></svg>', next: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"> <g><path d="M360.731,229.075l-225.1-225.1c-5.3-5.3-13.8-5.3-19.1,0s-5.3,13.8,0,19.1l215.5,215.5l-215.5,215.5c-5.3,5.3-5.3,13.8,0,19.1c2.6,2.6,6.1,4,9.5,4c3.4,0,6.9-1.3,9.5-4l225.1-225.1C365.931,242.875,365.931,234.275,360.731,229.075z"/></g></svg>', prev: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"><g><path d="M145.188,238.575l215.5-215.5c5.3-5.3,5.3-13.8,0-19.1s-13.8-5.3-19.1,0l-225.1,225.1c-5.3,5.3-5.3,13.8,0,19.1l225.1,225c2.6,2.6,6.1,4,9.5,4s6.9-1.3,9.5-4c5.3-5.3,5.3-13.8,0-19.1L145.188,238.575z"/></g></svg>' }, slideHTML: `<div class="gslide">
|
|
2649
2680
|
<div class="gslide-inner-content">
|
|
2650
2681
|
<div class="ginner-container">
|
|
2651
2682
|
<div class="gslide-media">
|
|
@@ -2669,7 +2700,7 @@ var sa = { exports: {} };
|
|
|
2669
2700
|
</div>
|
|
2670
2701
|
</div>` }, Ia = f(function t() {
|
|
2671
2702
|
var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2672
|
-
s(this, t), this.customOptions = i, this.settings = S(
|
|
2703
|
+
s(this, t), this.customOptions = i, this.settings = S(Ea, i), this.effectsClasses = this.getAnimationClasses(), this.videoPlayers = {}, this.apiEvents = [], this.fullElementsList = !1;
|
|
2673
2704
|
}, [{ key: "init", value: function() {
|
|
2674
2705
|
var t = this, i = this.getSelector();
|
|
2675
2706
|
i && (this.baseEvents = D("click", { onElement: i, withCallback: function(o, d) {
|
|
@@ -2690,7 +2721,7 @@ var sa = { exports: {} };
|
|
|
2690
2721
|
var b = document.createElement("style");
|
|
2691
2722
|
b.type = "text/css", b.className = "gcss-styles", b.innerText = ".gscrollbar-fixer {margin-right: ".concat(h, "px}"), document.head.appendChild(b), T(l, "gscrollbar-fixer");
|
|
2692
2723
|
}
|
|
2693
|
-
T(l, "glightbox-open"), T(Vt, "glightbox-open"), Bt && (T(document.body, "glightbox-mobile"), this.settings.slideEffect = "slide"), this.showSlide(o, !0), this.elements.length === 1 ? (T(this.prevButton, "glightbox-button-hidden"), T(this.nextButton, "glightbox-button-hidden")) : (N(this.prevButton, "glightbox-button-hidden"), N(this.nextButton, "glightbox-button-hidden")), this.lightboxOpen = !0, this.trigger("open"),
|
|
2724
|
+
T(l, "glightbox-open"), T(Vt, "glightbox-open"), Bt && (T(document.body, "glightbox-mobile"), this.settings.slideEffect = "slide"), this.showSlide(o, !0), this.elements.length === 1 ? (T(this.prevButton, "glightbox-button-hidden"), T(this.nextButton, "glightbox-button-hidden")) : (N(this.prevButton, "glightbox-button-hidden"), N(this.nextButton, "glightbox-button-hidden")), this.lightboxOpen = !0, this.trigger("open"), z(this.settings.onOpen) && this.settings.onOpen(), Rt && this.settings.touchNavigation && Ta(this), this.settings.keyboardNavigation && va(this);
|
|
2694
2725
|
} }, { key: "openAt", value: function() {
|
|
2695
2726
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
2696
2727
|
this.open(null, t);
|
|
@@ -2744,21 +2775,21 @@ var sa = { exports: {} };
|
|
|
2744
2775
|
}
|
|
2745
2776
|
(this.settings.preload && this.index == 0 && i == 0 || this.index - 1 == i || this.index + 1 == i) && this.preloadSlide(i), this.index === 0 && i === 0 && (this.index = 1), this.updateNavigationClasses(), u = this.slidesContainer.querySelectorAll(".gslide")[i], y = this.getSlidePlayerInstance(i), l.slideNode = u;
|
|
2746
2777
|
}
|
|
2747
|
-
this.trigger("slide_inserted", { index: i, slide: u, slideNode: u, slideConfig: d, slideIndex: i, trigger: null, player: y }),
|
|
2778
|
+
this.trigger("slide_inserted", { index: i, slide: u, slideNode: u, slideConfig: d, slideIndex: i, trigger: null, player: y }), z(this.settings.slideInserted) && this.settings.slideInserted({ index: i, slide: u, player: y });
|
|
2748
2779
|
} }, { key: "removeSlide", value: function() {
|
|
2749
2780
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1;
|
|
2750
2781
|
if (t < 0 || t > this.elements.length - 1) return !1;
|
|
2751
2782
|
var i = this.slidesContainer && this.slidesContainer.querySelectorAll(".gslide")[t];
|
|
2752
|
-
i && (this.getActiveSlideIndex() == t && (t == this.elements.length - 1 ? this.prevSlide() : this.nextSlide()), i.parentNode.removeChild(i)), this.elements.splice(t, 1), this.trigger("slide_removed", t),
|
|
2783
|
+
i && (this.getActiveSlideIndex() == t && (t == this.elements.length - 1 ? this.prevSlide() : this.nextSlide()), i.parentNode.removeChild(i)), this.elements.splice(t, 1), this.trigger("slide_removed", t), z(this.settings.slideRemoved) && this.settings.slideRemoved(t);
|
|
2753
2784
|
} }, { key: "slideAnimateIn", value: function(t, i) {
|
|
2754
2785
|
var o = this, d = t.querySelector(".gslide-media"), l = t.querySelector(".gslide-description"), h = { index: this.prevActiveSlideIndex, slide: this.prevActiveSlide, slideNode: this.prevActiveSlide, slideIndex: this.prevActiveSlide, slideConfig: re(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].slideConfig, trigger: re(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].node, player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) }, b = { index: this.index, slide: this.activeSlide, slideNode: this.activeSlide, slideConfig: this.elements[this.index].slideConfig, slideIndex: this.index, trigger: this.elements[this.index].node, player: this.getSlidePlayerInstance(this.index) };
|
|
2755
2786
|
if (d.offsetWidth > 0 && l && (Le(l), l.style.display = ""), N(t, this.effectsClasses), i) V(t, this.settings.cssEfects[this.settings.openEffect].in, function() {
|
|
2756
|
-
o.settings.autoplayVideos && o.slidePlayerPlay(t), o.trigger("slide_changed", { prev: h, current: b }),
|
|
2787
|
+
o.settings.autoplayVideos && o.slidePlayerPlay(t), o.trigger("slide_changed", { prev: h, current: b }), z(o.settings.afterSlideChange) && o.settings.afterSlideChange.apply(o, [h, b]);
|
|
2757
2788
|
});
|
|
2758
2789
|
else {
|
|
2759
2790
|
var u = this.settings.slideEffect, y = u !== "none" ? this.settings.cssEfects[u].in : u;
|
|
2760
2791
|
this.prevActiveSlideIndex > this.index && this.settings.slideEffect == "slide" && (y = this.settings.cssEfects.slideBack.in), V(t, y, function() {
|
|
2761
|
-
o.settings.autoplayVideos && o.slidePlayerPlay(t), o.trigger("slide_changed", { prev: h, current: b }),
|
|
2792
|
+
o.settings.autoplayVideos && o.slidePlayerPlay(t), o.trigger("slide_changed", { prev: h, current: b }), z(o.settings.afterSlideChange) && o.settings.afterSlideChange.apply(o, [h, b]);
|
|
2762
2793
|
});
|
|
2763
2794
|
}
|
|
2764
2795
|
setTimeout(function() {
|
|
@@ -2769,7 +2800,7 @@ var sa = { exports: {} };
|
|
|
2769
2800
|
var t = this.prevActiveSlide;
|
|
2770
2801
|
N(t, this.effectsClasses), T(t, "prev");
|
|
2771
2802
|
var i = this.settings.slideEffect, o = i !== "none" ? this.settings.cssEfects[i].out : i;
|
|
2772
|
-
this.slidePlayerPause(t), this.trigger("slide_before_change", { prev: { index: this.prevActiveSlideIndex, slide: this.prevActiveSlide, slideNode: this.prevActiveSlide, slideIndex: this.prevActiveSlideIndex, slideConfig: re(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].slideConfig, trigger: re(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].node, player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) }, current: { index: this.index, slide: this.activeSlide, slideNode: this.activeSlide, slideIndex: this.index, slideConfig: this.elements[this.index].slideConfig, trigger: this.elements[this.index].node, player: this.getSlidePlayerInstance(this.index) } }),
|
|
2803
|
+
this.slidePlayerPause(t), this.trigger("slide_before_change", { prev: { index: this.prevActiveSlideIndex, slide: this.prevActiveSlide, slideNode: this.prevActiveSlide, slideIndex: this.prevActiveSlideIndex, slideConfig: re(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].slideConfig, trigger: re(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].node, player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) }, current: { index: this.index, slide: this.activeSlide, slideNode: this.activeSlide, slideIndex: this.index, slideConfig: this.elements[this.index].slideConfig, trigger: this.elements[this.index].node, player: this.getSlidePlayerInstance(this.index) } }), z(this.settings.beforeSlideChange) && this.settings.beforeSlideChange.apply(this, [{ index: this.prevActiveSlideIndex, slide: this.prevActiveSlide, player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) }, { index: this.index, slide: this.activeSlide, player: this.getSlidePlayerInstance(this.index) }]), this.prevActiveSlideIndex > this.index && this.settings.slideEffect == "slide" && (o = this.settings.cssEfects.slideBack.out), V(t, o, function() {
|
|
2773
2804
|
var d = t.querySelector(".ginner-container"), l = t.querySelector(".gslide-media"), h = t.querySelector(".gslide-description");
|
|
2774
2805
|
d.style.transform = "", l.style.transform = "", N(l, "greset"), l.style.opacity = "", h && (h.style.opacity = ""), N(t, "prev");
|
|
2775
2806
|
});
|
|
@@ -2933,7 +2964,7 @@ var sa = { exports: {} };
|
|
|
2933
2964
|
t.events = null;
|
|
2934
2965
|
}
|
|
2935
2966
|
var d = document.body;
|
|
2936
|
-
N(Vt, "glightbox-open"), N(d, "glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"), t.modal.parentNode.removeChild(t.modal), t.trigger("close"),
|
|
2967
|
+
N(Vt, "glightbox-open"), N(d, "glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"), t.modal.parentNode.removeChild(t.modal), t.trigger("close"), z(t.settings.onClose) && t.settings.onClose();
|
|
2937
2968
|
var l = document.querySelector(".gcss-styles");
|
|
2938
2969
|
l && l.parentNode.removeChild(l), t.lightboxOpen = !1, t.closing = null;
|
|
2939
2970
|
});
|
|
@@ -2941,7 +2972,7 @@ var sa = { exports: {} };
|
|
|
2941
2972
|
this.close(), this.clearAllEvents(), this.baseEvents && this.baseEvents.destroy();
|
|
2942
2973
|
} }, { key: "on", value: function(t, i) {
|
|
2943
2974
|
var o = arguments.length > 2 && arguments[2] !== void 0 && arguments[2];
|
|
2944
|
-
if (!t || !
|
|
2975
|
+
if (!t || !z(i)) throw new TypeError("Event name and callback must be defined");
|
|
2945
2976
|
this.apiEvents.push({ evt: t, once: o, callback: i });
|
|
2946
2977
|
} }, { key: "once", value: function(t, i) {
|
|
2947
2978
|
this.on(t, i, !0);
|
|
@@ -3022,7 +3053,7 @@ var $c = Object.defineProperty, Mc = Object.getOwnPropertyDescriptor, oa = (c, e
|
|
|
3022
3053
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
3023
3054
|
return n && s && $c(e, a, s), s;
|
|
3024
3055
|
};
|
|
3025
|
-
let rt = class extends
|
|
3056
|
+
let rt = class extends ae {
|
|
3026
3057
|
constructor() {
|
|
3027
3058
|
super(...arguments), this.files = [];
|
|
3028
3059
|
}
|
|
@@ -3062,7 +3093,7 @@ oa([
|
|
|
3062
3093
|
rt = oa([
|
|
3063
3094
|
J("cb-uploading")
|
|
3064
3095
|
], rt);
|
|
3065
|
-
const
|
|
3096
|
+
const Ac = X`
|
|
3066
3097
|
${me}
|
|
3067
3098
|
:host {
|
|
3068
3099
|
}
|
|
@@ -3083,10 +3114,10 @@ const Tc = X`
|
|
|
3083
3114
|
margin-right: 0.2em;
|
|
3084
3115
|
}
|
|
3085
3116
|
`;
|
|
3086
|
-
var
|
|
3087
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
3117
|
+
var Tc = Object.defineProperty, Ec = Object.getOwnPropertyDescriptor, It = (c, e, a, n) => {
|
|
3118
|
+
for (var s = n > 1 ? void 0 : n ? Ec(e, a) : e, r = c.length - 1, f; r >= 0; r--)
|
|
3088
3119
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
3089
|
-
return n && s &&
|
|
3120
|
+
return n && s && Tc(e, a, s), s;
|
|
3090
3121
|
};
|
|
3091
3122
|
let Ze = class extends ut {
|
|
3092
3123
|
constructor() {
|
|
@@ -3157,7 +3188,7 @@ const Ut = {
|
|
|
3157
3188
|
doc: zc,
|
|
3158
3189
|
docx: jc
|
|
3159
3190
|
};
|
|
3160
|
-
let Je = class extends
|
|
3191
|
+
let Je = class extends ae {
|
|
3161
3192
|
constructor() {
|
|
3162
3193
|
super(...arguments), this.filename = "", this.url = "";
|
|
3163
3194
|
}
|
|
@@ -3187,7 +3218,7 @@ let Je = class extends te {
|
|
|
3187
3218
|
`;
|
|
3188
3219
|
}
|
|
3189
3220
|
};
|
|
3190
|
-
Je.styles =
|
|
3221
|
+
Je.styles = Ac;
|
|
3191
3222
|
Lt([
|
|
3192
3223
|
v({ type: String })
|
|
3193
3224
|
], Je.prototype, "filename", 2);
|
|
@@ -4672,7 +4703,7 @@ var Nc = Object.defineProperty, Uc = Object.getOwnPropertyDescriptor, Be = (c, e
|
|
|
4672
4703
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
4673
4704
|
return n && s && Nc(e, a, s), s;
|
|
4674
4705
|
};
|
|
4675
|
-
let ke = class extends
|
|
4706
|
+
let ke = class extends ae {
|
|
4676
4707
|
constructor() {
|
|
4677
4708
|
super(...arguments), this.store = new pt(this, p), this.type = "assistant", this.suppressFeedback = !1, this.lightbox = kc({
|
|
4678
4709
|
touchNavigation: !0,
|
|
@@ -4755,12 +4786,12 @@ let ke = class extends te {
|
|
|
4755
4786
|
});
|
|
4756
4787
|
}
|
|
4757
4788
|
render() {
|
|
4758
|
-
return
|
|
4789
|
+
return ee(
|
|
4759
4790
|
this.message.data || this.message.isThinking,
|
|
4760
4791
|
() => g`
|
|
4761
4792
|
<div class="cb-message-row" part="bot-message">
|
|
4762
4793
|
<!-- message -->
|
|
4763
|
-
${
|
|
4794
|
+
${ee(
|
|
4764
4795
|
this._isBot,
|
|
4765
4796
|
() => this.renderBotMessage(this.message),
|
|
4766
4797
|
() => this.renderUserMessage(this.message)
|
|
@@ -4798,7 +4829,7 @@ let ke = class extends te {
|
|
|
4798
4829
|
renderMessageContent(c) {
|
|
4799
4830
|
var e;
|
|
4800
4831
|
return c.isThinking ? g`<cb-thinking></cb-thinking>` : c.isUploading ? g`<cb-uploading .files="${c.data.files || []}"></cb-uploading>` : c.type === "text" ? g`<div class="cb-message-text">
|
|
4801
|
-
${
|
|
4832
|
+
${ee(
|
|
4802
4833
|
c.data.userName,
|
|
4803
4834
|
() => g`<div class="assistant-message-user-name">${c.data.userName}</div>`,
|
|
4804
4835
|
() => null
|
|
@@ -4865,7 +4896,7 @@ let ke = class extends te {
|
|
|
4865
4896
|
<cb-icon slot="icon" svg="${Wt}" color="white"></cb-icon>
|
|
4866
4897
|
//appState.appearanceUserMessageAvatarPosition
|
|
4867
4898
|
</sl-avatar>-->
|
|
4868
|
-
${
|
|
4899
|
+
${ee(
|
|
4869
4900
|
p.appearanceUserMessageAvatarPosition === "left",
|
|
4870
4901
|
() => g`
|
|
4871
4902
|
<div class="avatar user-avatar">${W(p.setting.userIconSvg)}</div>
|
|
@@ -4888,7 +4919,7 @@ let ke = class extends te {
|
|
|
4888
4919
|
<cb-icon slot="icon" svg="${Wt}" color="white"></cb-icon>
|
|
4889
4920
|
//appState.appearanceUserMessageAvatarPosition
|
|
4890
4921
|
</sl-avatar>-->
|
|
4891
|
-
${
|
|
4922
|
+
${ee(
|
|
4892
4923
|
p.appearanceUserMessageAvatarPosition === "left",
|
|
4893
4924
|
() => g`
|
|
4894
4925
|
<div class="avatar user-avatar">${W(p.setting.userIconSvg)}</div>
|
|
@@ -4932,7 +4963,7 @@ var Wc = Object.defineProperty, Yc = Object.getOwnPropertyDescriptor, ye = (c, e
|
|
|
4932
4963
|
};
|
|
4933
4964
|
const we = Ke.noConflict();
|
|
4934
4965
|
we.setLevel("info");
|
|
4935
|
-
let be = class extends
|
|
4966
|
+
let be = class extends ae {
|
|
4936
4967
|
constructor() {
|
|
4937
4968
|
super(...arguments), this.messages = [], this.actions = [], this.form = null, this.suppressFeedback = !1, this.calendlyInjected = !1, this.activeCalendlyAction = -1, this.hubspotMeetingInjected = !1, this.activeHubspotMeetingAction = -1;
|
|
4938
4969
|
}
|
|
@@ -5014,7 +5045,7 @@ let be = class extends te {
|
|
|
5014
5045
|
return a || n[0], g`<div class="cb-form-field">
|
|
5015
5046
|
<label class="cb-form-field-label"
|
|
5016
5047
|
>${c.title}
|
|
5017
|
-
${
|
|
5048
|
+
${ee(
|
|
5018
5049
|
e,
|
|
5019
5050
|
() => g`*`,
|
|
5020
5051
|
() => g``
|
|
@@ -5242,13 +5273,13 @@ ye([
|
|
|
5242
5273
|
Ce(".cb-input-form")
|
|
5243
5274
|
], be.prototype, "_inputForm", 2);
|
|
5244
5275
|
ye([
|
|
5245
|
-
|
|
5276
|
+
Tt({ capture: !1, passive: !0 })
|
|
5246
5277
|
], be.prototype, "invokeLinkAction", 1);
|
|
5247
5278
|
ye([
|
|
5248
|
-
|
|
5279
|
+
Tt({ capture: !1, passive: !0 })
|
|
5249
5280
|
], be.prototype, "invokeCalendlyAction", 1);
|
|
5250
5281
|
ye([
|
|
5251
|
-
|
|
5282
|
+
Tt({ capture: !1, passive: !0 })
|
|
5252
5283
|
], be.prototype, "invokeHubspotMeetingAction", 1);
|
|
5253
5284
|
be = ye([
|
|
5254
5285
|
J("cb-message-list")
|
|
@@ -5301,7 +5332,7 @@ var Jc = Object.defineProperty, Kc = Object.getOwnPropertyDescriptor, Se = (c, e
|
|
|
5301
5332
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5302
5333
|
return n && s && Jc(e, a, s), s;
|
|
5303
5334
|
};
|
|
5304
|
-
let he = class extends
|
|
5335
|
+
let he = class extends ae {
|
|
5305
5336
|
constructor() {
|
|
5306
5337
|
super(...arguments), this.placeholder = "Type a message...", this.sendButtonLabel = "Send", this.enableFileUpload = !1, this.value = "", this.loading = !1, this.disabled = !1, this.currentKey = "";
|
|
5307
5338
|
}
|
|
@@ -5346,7 +5377,7 @@ let he = class extends te {
|
|
|
5346
5377
|
}
|
|
5347
5378
|
render() {
|
|
5348
5379
|
return g`
|
|
5349
|
-
${
|
|
5380
|
+
${ee(
|
|
5350
5381
|
this.loading,
|
|
5351
5382
|
() => g`<sl-progress-bar style="--height: 2px;" indeterminate></sl-progress-bar>`,
|
|
5352
5383
|
() => g``
|
|
@@ -5368,22 +5399,30 @@ let he = class extends te {
|
|
|
5368
5399
|
@keydown=${this._keyDownHandler}
|
|
5369
5400
|
></sl-textarea>
|
|
5370
5401
|
|
|
5371
|
-
<
|
|
5402
|
+
<div class="cb-input-buttons" part="user-input-buttons-wrapper">
|
|
5372
5403
|
<sl-button @click=${this._sendHandler} name="send" label="Send" size="small" class="send-button" variant="text" ?disabled=${this.value.length === 0} ?loading=${this.loading} circle>
|
|
5373
|
-
|
|
5404
|
+
${ee(
|
|
5405
|
+
p.setting.sendIconSvg !== "",
|
|
5406
|
+
() => g`<cb-icon part="user-input-send-icon" svg="${p.setting.sendIconSvg}"></cb-icon>`,
|
|
5407
|
+
() => g`<cb-icon part="user-input-send-icon" svg="${Gc}"></cb-icon>`
|
|
5408
|
+
)}
|
|
5374
5409
|
</sl-button>
|
|
5375
|
-
${
|
|
5410
|
+
${ee(
|
|
5376
5411
|
this.enableFileUpload,
|
|
5377
5412
|
() => g`
|
|
5378
5413
|
<sl-button @click=${this._sendFileHandler} name="paperclip" label="Attachment" size="small" class="paperclip-button" variant="text" circle>
|
|
5379
|
-
|
|
5414
|
+
${ee(
|
|
5415
|
+
p.setting.attachIconSvg !== "",
|
|
5416
|
+
() => g`<cb-icon part="user-input-attach-icon" svg="${p.setting.attachIconSvg}"></cb-icon>`,
|
|
5417
|
+
() => g`<cb-icon part="user-input-attach-icon" svg="${Zc}"></cb-icon>`
|
|
5418
|
+
)}
|
|
5380
5419
|
<!-- select file input -->
|
|
5381
5420
|
<input type="file" id="file" name="file" class="file-input" />
|
|
5382
5421
|
</sl-button>
|
|
5383
5422
|
`,
|
|
5384
5423
|
() => g``
|
|
5385
5424
|
)}
|
|
5386
|
-
</
|
|
5425
|
+
</div>
|
|
5387
5426
|
</div>
|
|
5388
5427
|
`;
|
|
5389
5428
|
}
|
|
@@ -5459,7 +5498,7 @@ var ei = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, gt = (c, e
|
|
|
5459
5498
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5460
5499
|
return n && s && ei(e, a, s), s;
|
|
5461
5500
|
};
|
|
5462
|
-
let Ne = class extends
|
|
5501
|
+
let Ne = class extends ae {
|
|
5463
5502
|
constructor() {
|
|
5464
5503
|
super(...arguments), this.open = !1, this.label = "Dialog", this.zindex = 100;
|
|
5465
5504
|
}
|
|
@@ -5521,7 +5560,7 @@ var ai = Object.defineProperty, ci = Object.getOwnPropertyDescriptor, la = (c, e
|
|
|
5521
5560
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5522
5561
|
return n && s && ai(e, a, s), s;
|
|
5523
5562
|
};
|
|
5524
|
-
let dt = class extends
|
|
5563
|
+
let dt = class extends ae {
|
|
5525
5564
|
constructor() {
|
|
5526
5565
|
super(...arguments), this.open = !1;
|
|
5527
5566
|
}
|
|
@@ -5634,7 +5673,7 @@ var ni = Object.defineProperty, si = Object.getOwnPropertyDescriptor, Ue = (c, e
|
|
|
5634
5673
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5635
5674
|
return n && s && ni(e, a, s), s;
|
|
5636
5675
|
};
|
|
5637
|
-
let
|
|
5676
|
+
let Te = class extends ae {
|
|
5638
5677
|
constructor() {
|
|
5639
5678
|
super(...arguments), this.open = !1, this.clearMessageDialogOpen = !1, this.customRequest = !1;
|
|
5640
5679
|
}
|
|
@@ -5667,7 +5706,7 @@ let Ee = class extends te {
|
|
|
5667
5706
|
Enable it for your own backend.
|
|
5668
5707
|
</sl-switch>
|
|
5669
5708
|
</div> -->
|
|
5670
|
-
${
|
|
5709
|
+
${ee(
|
|
5671
5710
|
this.customRequest,
|
|
5672
5711
|
() => null,
|
|
5673
5712
|
() => this.renderInternalServices()
|
|
@@ -5754,25 +5793,25 @@ let Ee = class extends te {
|
|
|
5754
5793
|
});
|
|
5755
5794
|
}
|
|
5756
5795
|
};
|
|
5757
|
-
|
|
5796
|
+
Te.styles = ii;
|
|
5758
5797
|
Ue([
|
|
5759
5798
|
v({ type: Boolean })
|
|
5760
|
-
],
|
|
5799
|
+
], Te.prototype, "open", 2);
|
|
5761
5800
|
Ue([
|
|
5762
5801
|
v({ type: Object })
|
|
5763
|
-
],
|
|
5802
|
+
], Te.prototype, "setting", 2);
|
|
5764
5803
|
Ue([
|
|
5765
5804
|
v({ type: Boolean })
|
|
5766
|
-
],
|
|
5805
|
+
], Te.prototype, "clearMessageDialogOpen", 2);
|
|
5767
5806
|
Ue([
|
|
5768
5807
|
Ce("sl-dialog")
|
|
5769
|
-
],
|
|
5808
|
+
], Te.prototype, "dialog", 2);
|
|
5770
5809
|
Ue([
|
|
5771
5810
|
v({ type: Boolean })
|
|
5772
|
-
],
|
|
5773
|
-
|
|
5811
|
+
], Te.prototype, "customRequest", 2);
|
|
5812
|
+
Te = Ue([
|
|
5774
5813
|
J("cb-setting")
|
|
5775
|
-
],
|
|
5814
|
+
], Te);
|
|
5776
5815
|
const oi = X`
|
|
5777
5816
|
${me}
|
|
5778
5817
|
:host {
|
|
@@ -5892,7 +5931,7 @@ var ri = Object.defineProperty, di = Object.getOwnPropertyDescriptor, ba = (c, e
|
|
|
5892
5931
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5893
5932
|
return n && s && ri(e, a, s), s;
|
|
5894
5933
|
};
|
|
5895
|
-
let ft = class extends
|
|
5934
|
+
let ft = class extends ae {
|
|
5896
5935
|
constructor() {
|
|
5897
5936
|
super(...arguments), this.store = new pt(this, p), this.open = !1;
|
|
5898
5937
|
}
|
|
@@ -5931,12 +5970,12 @@ let ft = class extends te {
|
|
|
5931
5970
|
<div class="cb-anchor ${this.open ? "open" : ""}" part="anchor" @click=${this._clickHandler.bind(this)}>
|
|
5932
5971
|
<sl-popup placement="${this.getPopupPlacement()}" distance="16" ?active="${p.engage && !p.open}">
|
|
5933
5972
|
<sl-button slot="anchor" label="Start" size="large" variant="primary" class="anchor-button" circle>
|
|
5934
|
-
${
|
|
5973
|
+
${ee(
|
|
5935
5974
|
this.open,
|
|
5936
5975
|
() => g`<div class="cb-anchor-icon" part="anchor-icon">${le`${W(p.setting.anchorCloseSvg)}`}</div>`,
|
|
5937
5976
|
() => g`<div class="cb-anchor-icon" part="anchor-icon">${le`${W(p.setting.anchorOpenSvg)}`}</div>`
|
|
5938
5977
|
)}
|
|
5939
|
-
${
|
|
5978
|
+
${ee(
|
|
5940
5979
|
!this.open && p.unreadMessages > 0,
|
|
5941
5980
|
() => g`<sl-badge part="anchor-badge" class="cb-anchor-badge" variant="${this.getBadgeVariant()}" pill>${p.unreadMessages}</sl-badge>`,
|
|
5942
5981
|
() => null
|
|
@@ -5991,7 +6030,7 @@ const Gt = {
|
|
|
5991
6030
|
icon: hi
|
|
5992
6031
|
}
|
|
5993
6032
|
};
|
|
5994
|
-
let lt = class extends
|
|
6033
|
+
let lt = class extends ae {
|
|
5995
6034
|
constructor() {
|
|
5996
6035
|
super(...arguments), this.status = "info";
|
|
5997
6036
|
}
|
|
@@ -6012,7 +6051,7 @@ var gi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, yi = (c, e
|
|
|
6012
6051
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
6013
6052
|
return n && s && gi(e, a, s), s;
|
|
6014
6053
|
};
|
|
6015
|
-
let Mt = class extends
|
|
6054
|
+
let Mt = class extends ae {
|
|
6016
6055
|
render() {
|
|
6017
6056
|
return g` <sl-alert variant="danger" open>
|
|
6018
6057
|
<cb-status-icon status="error" slot="icon"></cb-status-icon>
|
|
@@ -6037,6 +6076,16 @@ const vi = X`
|
|
|
6037
6076
|
z-index: 1000;
|
|
6038
6077
|
}
|
|
6039
6078
|
|
|
6079
|
+
.cb-feedback-dialog {
|
|
6080
|
+
--width: 60vw;
|
|
6081
|
+
}
|
|
6082
|
+
|
|
6083
|
+
@media (max-width: 640px) {
|
|
6084
|
+
.cb-feedback-dialog {
|
|
6085
|
+
--width: 100vw;
|
|
6086
|
+
}
|
|
6087
|
+
}
|
|
6088
|
+
|
|
6040
6089
|
.cb-header {
|
|
6041
6090
|
display: flex;
|
|
6042
6091
|
padding: 0px 0px 20px 0px;
|
|
@@ -6112,7 +6161,7 @@ var wi = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, We = (c, e
|
|
|
6112
6161
|
return n && s && wi(e, a, s), s;
|
|
6113
6162
|
};
|
|
6114
6163
|
const Zt = Ke.noConflict(), ki = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16"><path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/></svg>';
|
|
6115
|
-
let
|
|
6164
|
+
let Ee = class extends ae {
|
|
6116
6165
|
constructor() {
|
|
6117
6166
|
super(...arguments), this.store = new pt(this, p), this.zindex = 100;
|
|
6118
6167
|
}
|
|
@@ -6131,7 +6180,7 @@ let Ae = class extends te {
|
|
|
6131
6180
|
}
|
|
6132
6181
|
// todo render empty if feedback is disabled
|
|
6133
6182
|
render() {
|
|
6134
|
-
return g` <sl-dialog ?no-header=${!0} ?open=${p.feedback} @sl-hide=${this._cancelHandler}
|
|
6183
|
+
return g` <sl-dialog ?no-header=${!0} ?open=${p.feedback} @sl-hide=${this._cancelHandler} class="cb-feedback-dialog">
|
|
6135
6184
|
<div style="">
|
|
6136
6185
|
<h2>Please share your feedback</h2>
|
|
6137
6186
|
<div class="cb-feedback-messages-wrapper">
|
|
@@ -6176,25 +6225,25 @@ let Ae = class extends te {
|
|
|
6176
6225
|
this._comments.value = "", await p.submitFeedback(c, e, a);
|
|
6177
6226
|
}
|
|
6178
6227
|
};
|
|
6179
|
-
|
|
6228
|
+
Ee.styles = vi;
|
|
6180
6229
|
We([
|
|
6181
6230
|
v({ type: Number })
|
|
6182
|
-
],
|
|
6231
|
+
], Ee.prototype, "zindex", 2);
|
|
6183
6232
|
We([
|
|
6184
6233
|
Ce("#cb-feedback-rating-el")
|
|
6185
|
-
],
|
|
6234
|
+
], Ee.prototype, "_rating", 2);
|
|
6186
6235
|
We([
|
|
6187
6236
|
Ce("#cb-feedback-comments-el")
|
|
6188
|
-
],
|
|
6237
|
+
], Ee.prototype, "_comments", 2);
|
|
6189
6238
|
We([
|
|
6190
6239
|
Ce("#cb-feedback-name-el")
|
|
6191
|
-
],
|
|
6240
|
+
], Ee.prototype, "_name", 2);
|
|
6192
6241
|
We([
|
|
6193
6242
|
Ce("#cb-feedback-email-el")
|
|
6194
|
-
],
|
|
6195
|
-
|
|
6243
|
+
], Ee.prototype, "_email", 2);
|
|
6244
|
+
Ee = We([
|
|
6196
6245
|
J("cb-dialog-feedback")
|
|
6197
|
-
],
|
|
6246
|
+
], Ee);
|
|
6198
6247
|
class Jt extends Error {
|
|
6199
6248
|
constructor(a, n, s) {
|
|
6200
6249
|
const r = a.status || a.status === 0 ? a.status : "", f = a.statusText || "", w = `${r} ${f}`.trim(), S = w ? `status code ${w}` : "an unknown error";
|
|
@@ -6267,7 +6316,7 @@ const ga = (c = {}, e = {}) => ({
|
|
|
6267
6316
|
formData: "multipart/form-data",
|
|
6268
6317
|
arrayBuffer: "*/*",
|
|
6269
6318
|
blob: "*/*"
|
|
6270
|
-
}, xt = 2147483647, ya = Symbol("stop"),
|
|
6319
|
+
}, xt = 2147483647, ya = Symbol("stop"), Ai = {
|
|
6271
6320
|
json: !0,
|
|
6272
6321
|
parseJson: !0,
|
|
6273
6322
|
stringifyJson: !0,
|
|
@@ -6279,7 +6328,7 @@ const ga = (c = {}, e = {}) => ({
|
|
|
6279
6328
|
throwHttpErrors: !0,
|
|
6280
6329
|
onDownloadProgress: !0,
|
|
6281
6330
|
fetch: !0
|
|
6282
|
-
},
|
|
6331
|
+
}, Ti = {
|
|
6283
6332
|
method: !0,
|
|
6284
6333
|
headers: !0,
|
|
6285
6334
|
body: !0,
|
|
@@ -6296,7 +6345,7 @@ const ga = (c = {}, e = {}) => ({
|
|
|
6296
6345
|
dispatcher: !0,
|
|
6297
6346
|
duplex: !0,
|
|
6298
6347
|
priority: !0
|
|
6299
|
-
},
|
|
6348
|
+
}, Ei = (c) => ma.includes(c) ? c.toUpperCase() : c, Ii = ["get", "put", "head", "delete", "options", "trace"], Li = [408, 413, 429, 500, 502, 503, 504], qi = [413, 429, 503], Kt = {
|
|
6300
6349
|
limit: 2,
|
|
6301
6350
|
methods: Ii,
|
|
6302
6351
|
statusCodes: Li,
|
|
@@ -6343,7 +6392,7 @@ async function zi(c, { signal: e }) {
|
|
|
6343
6392
|
const ji = (c, e) => {
|
|
6344
6393
|
const a = {};
|
|
6345
6394
|
for (const n in e)
|
|
6346
|
-
!(n in
|
|
6395
|
+
!(n in Ti) && !(n in Ai) && !(n in c) && (a[n] = e[n]);
|
|
6347
6396
|
return a;
|
|
6348
6397
|
};
|
|
6349
6398
|
class bt {
|
|
@@ -6364,7 +6413,7 @@ class bt {
|
|
|
6364
6413
|
beforeError: [],
|
|
6365
6414
|
afterResponse: []
|
|
6366
6415
|
}, a.hooks),
|
|
6367
|
-
method:
|
|
6416
|
+
method: Ei(a.method ?? this._input.method),
|
|
6368
6417
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
6369
6418
|
prefixUrl: String(a.prefixUrl || ""),
|
|
6370
6419
|
retry: Oi(a.retry),
|
|
@@ -6518,12 +6567,12 @@ class bt {
|
|
|
6518
6567
|
}
|
|
6519
6568
|
}
|
|
6520
6569
|
/*! MIT License © Sindre Sorhus */
|
|
6521
|
-
const
|
|
6570
|
+
const At = (c) => {
|
|
6522
6571
|
const e = (a, n) => bt.create(a, nt(c, n));
|
|
6523
6572
|
for (const a of ma)
|
|
6524
6573
|
e[a] = (n, s) => bt.create(n, nt(c, s, { method: a }));
|
|
6525
|
-
return e.create = (a) =>
|
|
6526
|
-
}, Hi =
|
|
6574
|
+
return e.create = (a) => At(nt(a)), e.extend = (a) => (typeof a == "function" && (a = a(c ?? {})), At(nt(c, a))), e.stop = ya, e;
|
|
6575
|
+
}, Hi = At();
|
|
6527
6576
|
Hi.extend({
|
|
6528
6577
|
hooks: {
|
|
6529
6578
|
beforeRequest: [
|
|
@@ -6558,9 +6607,9 @@ var Ri = Object.defineProperty, Vi = Object.getOwnPropertyDescriptor, H = (c, e,
|
|
|
6558
6607
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
6559
6608
|
return n && s && Ri(e, a, s), s;
|
|
6560
6609
|
};
|
|
6561
|
-
const
|
|
6562
|
-
|
|
6563
|
-
let
|
|
6610
|
+
const Ae = Ke.noConflict();
|
|
6611
|
+
Ae.setLevel("info");
|
|
6612
|
+
let P = class extends ae {
|
|
6564
6613
|
constructor() {
|
|
6565
6614
|
super(...arguments), this.store = new pt(this, p), this.displayLicense = !1, this.name = "ChatBot", this.orgId = "", this.botId = "", this.url = "ws://localhost:3070", this.logoUrl = "", this.logoSvg = `<svg width="34" height="34" viewBox="0 0 400 400" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6566
6615
|
<g clip-path="url(#clip0_830_887)">
|
|
@@ -6588,7 +6637,7 @@ let j = class extends te {
|
|
|
6588
6637
|
<rect width="400" height="400" fill="white"/>
|
|
6589
6638
|
</clipPath>
|
|
6590
6639
|
</defs>
|
|
6591
|
-
</svg>`, this.popupLogoSvg = "", this.popupLogoUrl = "", this.botIconSvg = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24"> <path d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z" /></svg>', this.userIconSvg = '<svg fill="currentColor" viewBox="0 0 24 24" width="24" height="24"> <path d="M12 4a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 10c4.42 0 8 1.79 8 4v2H4v-2c0-2.21 3.58-4 8-4Z" /></svg>', this.systemIconSvg = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24"> <path d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z"/></svg>', this.agentIconSvg = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24"> <path d="M18.72,14.76C19.07,13.91 19.26,13 19.26,12C19.26,11.28 19.15,10.59 18.96,9.95C18.31,10.1 17.63,10.18 16.92,10.18C13.86,10.18 11.15,8.67 9.5,6.34C8.61,8.5 6.91,10.26 4.77,11.22C4.73,11.47 4.73,11.74 4.73,12A7.27,7.27 0 0,0 12,19.27C13.05,19.27 14.06,19.04 14.97,18.63C15.54,19.72 15.8,20.26 15.78,20.26C14.14,20.81 12.87,21.08 12,21.08C9.58,21.08 7.27,20.13 5.57,18.42C4.53,17.38 3.76,16.11 3.33,14.73H2V10.18H3.09C3.93,6.04 7.6,2.92 12,2.92C14.4,2.92 16.71,3.87 18.42,5.58C19.69,6.84 20.54,8.45 20.89,10.18H22V14.67H22V14.69L22,14.73H21.94L18.38,18L13.08,17.4V15.73H17.91L18.72,14.76M9.27,11.77C9.57,11.77 9.86,11.89 10.07,12.11C10.28,12.32 10.4,12.61 10.4,12.91C10.4,13.21 10.28,13.5 10.07,13.71C9.86,13.92 9.57,14.04 9.27,14.04C8.64,14.04 8.13,13.54 8.13,12.91C8.13,12.28 8.64,11.77 9.27,11.77M14.72,11.77C15.35,11.77 15.85,12.28 15.85,12.91C15.85,13.54 15.35,14.04 14.72,14.04C14.09,14.04 13.58,13.54 13.58,12.91A1.14,1.14 0 0,1 14.72,11.77Z" /></svg>', this.anchorOpenSvg = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" d="M16 8c0 3.866-3.582 7-8 7a9 9 0 0 1-2.347-.306c-.584.296-1.925.864-4.181 1.234c-.2.032-.352-.176-.273-.362c.354-.836.674-1.95.77-2.966C.744 11.37 0 9.76 0 8c0-3.866 3.582-7 8-7s8 3.134 8 7M5 8a1 1 0 1 0-2 0a1 1 0 0 0 2 0m4 0a1 1 0 1 0-2 0a1 1 0 0 0 2 0m3 1a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>', this.anchorCloseSvg = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"/></svg>', this.stream = !1, this.customRequest = !1, this.enableFileUpload = !1, this.uploadFileUrl = "", this.open = !1, this.alwaysOpen = !1, this.prefilledFormFields = "{}", this.loading = !1, this.showSetting = !1, this.showAuthAlert = !1, this.handleAddMessage = (c) => {
|
|
6640
|
+
</svg>`, this.popupLogoSvg = "", this.popupLogoUrl = "", this.botIconSvg = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24"> <path d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z" /></svg>', this.userIconSvg = '<svg fill="currentColor" viewBox="0 0 24 24" width="24" height="24"> <path d="M12 4a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 10c4.42 0 8 1.79 8 4v2H4v-2c0-2.21 3.58-4 8-4Z" /></svg>', this.systemIconSvg = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24"> <path d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z"/></svg>', this.agentIconSvg = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24"> <path d="M18.72,14.76C19.07,13.91 19.26,13 19.26,12C19.26,11.28 19.15,10.59 18.96,9.95C18.31,10.1 17.63,10.18 16.92,10.18C13.86,10.18 11.15,8.67 9.5,6.34C8.61,8.5 6.91,10.26 4.77,11.22C4.73,11.47 4.73,11.74 4.73,12A7.27,7.27 0 0,0 12,19.27C13.05,19.27 14.06,19.04 14.97,18.63C15.54,19.72 15.8,20.26 15.78,20.26C14.14,20.81 12.87,21.08 12,21.08C9.58,21.08 7.27,20.13 5.57,18.42C4.53,17.38 3.76,16.11 3.33,14.73H2V10.18H3.09C3.93,6.04 7.6,2.92 12,2.92C14.4,2.92 16.71,3.87 18.42,5.58C19.69,6.84 20.54,8.45 20.89,10.18H22V14.67H22V14.69L22,14.73H21.94L18.38,18L13.08,17.4V15.73H17.91L18.72,14.76M9.27,11.77C9.57,11.77 9.86,11.89 10.07,12.11C10.28,12.32 10.4,12.61 10.4,12.91C10.4,13.21 10.28,13.5 10.07,13.71C9.86,13.92 9.57,14.04 9.27,14.04C8.64,14.04 8.13,13.54 8.13,12.91C8.13,12.28 8.64,11.77 9.27,11.77M14.72,11.77C15.35,11.77 15.85,12.28 15.85,12.91C15.85,13.54 15.35,14.04 14.72,14.04C14.09,14.04 13.58,13.54 13.58,12.91A1.14,1.14 0 0,1 14.72,11.77Z" /></svg>', this.anchorOpenSvg = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" d="M16 8c0 3.866-3.582 7-8 7a9 9 0 0 1-2.347-.306c-.584.296-1.925.864-4.181 1.234c-.2.032-.352-.176-.273-.362c.354-.836.674-1.95.77-2.966C.744 11.37 0 9.76 0 8c0-3.866 3.582-7 8-7s8 3.134 8 7M5 8a1 1 0 1 0-2 0a1 1 0 0 0 2 0m4 0a1 1 0 1 0-2 0a1 1 0 0 0 2 0m3 1a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>', this.anchorCloseSvg = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"/></svg>', this.sendIconSvg = "", this.attachIconSvg = "", this.stream = !1, this.customRequest = !1, this.enableFileUpload = !1, this.uploadFileUrl = "", this.open = !1, this.alwaysOpen = !1, this.prefilledFormFields = "{}", this.loading = !1, this.showSetting = !1, this.showAuthAlert = !1, this.handleAddMessage = (c) => {
|
|
6592
6641
|
this._addMessageHandler(c);
|
|
6593
6642
|
}, this.handleStateEvent = (c) => {
|
|
6594
6643
|
this._stateEventHandler(c);
|
|
@@ -6628,7 +6677,7 @@ let j = class extends te {
|
|
|
6628
6677
|
p.addActions(c);
|
|
6629
6678
|
}
|
|
6630
6679
|
render() {
|
|
6631
|
-
return p.disabled && !this.alwaysOpen ? (
|
|
6680
|
+
return p.disabled && !this.alwaysOpen ? (Ae.info("Bot is disabled until settings are loaded"), null) : g`
|
|
6632
6681
|
<div class="cb-wrapper${p.open ? " cb-open" : ""}" part="wrapper${p.open ? " open" : ""}" exportparts="wrapper${p.open ? " open" : ""}">
|
|
6633
6682
|
<cb-header title="${this.name}" exportparts="header, header-logo, header-title, header-close"></cb-header>
|
|
6634
6683
|
<cb-message-list
|
|
@@ -6654,11 +6703,11 @@ let j = class extends te {
|
|
|
6654
6703
|
?loading=${p.connecting}
|
|
6655
6704
|
?disabled=${p.connecting || p.form}
|
|
6656
6705
|
?enable-file-upload=${p.setting.uploadImages && p.connected}
|
|
6657
|
-
exportparts="user-input-control,user-input, user-input-wrapper, user-input-base, user-input-textarea"
|
|
6706
|
+
exportparts="user-input-control,user-input, user-input-wrapper, user-input-base, user-input-textarea, user-input-buttons-wrapper, user-input-send-icon, user-input-attach-icon"
|
|
6658
6707
|
></cb-user-input>`;
|
|
6659
6708
|
}
|
|
6660
6709
|
connectedCallback() {
|
|
6661
|
-
super.connectedCallback(),
|
|
6710
|
+
super.connectedCallback(), Ae.info("connectedCallback"), this.initCssVariables(), addEventListener("c7o:bot:stateEvent", this.handleStateEvent), addEventListener("message:send", this.handleAddMessage), addEventListener("chatbot:toggle", this.handleToggleEvent), addEventListener("form:submit", this.handleFormSubmitEvent), addEventListener("message:send:file", this._uploadFileHandler);
|
|
6662
6711
|
}
|
|
6663
6712
|
extractCssVariable(c, e, a) {
|
|
6664
6713
|
let n = c.getPropertyValue(e).trim();
|
|
@@ -6687,26 +6736,26 @@ let j = class extends te {
|
|
|
6687
6736
|
|
|
6688
6737
|
*/
|
|
6689
6738
|
disconnectedCallback() {
|
|
6690
|
-
|
|
6739
|
+
Ae.info("disconnectedCallback"), super.disconnectedCallback(), window.removeEventListener("c7o:bot:stateEvent", this.handleStateEvent), window.removeEventListener("message:send", this.handleAddMessage), window.removeEventListener("chatbot:toggle", this.handleToggleEvent), window.removeEventListener("form:submit", this.handleFormSubmitEvent), window.removeEventListener("message:send:file", this._uploadFileHandler);
|
|
6691
6740
|
}
|
|
6692
6741
|
// This is called when component is loaded, with all the settings (props) values
|
|
6693
6742
|
// Use to initialize
|
|
6694
6743
|
// This is also called when state changes - ??? - i.e. when message added to the array
|
|
6695
6744
|
updated(c) {
|
|
6696
|
-
super.updated(c), c.size > 0 && (
|
|
6745
|
+
super.updated(c), c.size > 0 && (Ae.info("updated,_changedProperties:", c), this._initSetting()), setTimeout(() => {
|
|
6697
6746
|
this._scrollToBottom();
|
|
6698
6747
|
}, 0);
|
|
6699
6748
|
}
|
|
6700
6749
|
// initialize setting
|
|
6701
6750
|
_initSetting() {
|
|
6702
|
-
|
|
6751
|
+
Ae.info("_initSetting");
|
|
6703
6752
|
const c = p.setting;
|
|
6704
|
-
c.orgId = this.orgId, c.botId = this.botId, c.url = this.url, c.logoUrl = this.logoUrl, c.logoSvg = this.logoSvg, c.closeSvg = this.closeSvg, c.popupLogoSvg = this.popupLogoSvg, c.popupLogoUrl = this.popupLogoUrl, c.botIconSvg = this.botIconSvg, c.userIconSvg = this.userIconSvg, c.systemIconSvg = this.systemIconSvg, c.agentIconSvg = this.agentIconSvg, c.anchorOpenSvg = this.anchorOpenSvg, c.anchorCloseSvg = this.anchorCloseSvg, p.setSetting(c);
|
|
6753
|
+
c.orgId = this.orgId, c.botId = this.botId, c.url = this.url, c.logoUrl = this.logoUrl, c.logoSvg = this.logoSvg, c.closeSvg = this.closeSvg, c.popupLogoSvg = this.popupLogoSvg, c.popupLogoUrl = this.popupLogoUrl, c.botIconSvg = this.botIconSvg, c.userIconSvg = this.userIconSvg, c.systemIconSvg = this.systemIconSvg, c.agentIconSvg = this.agentIconSvg, c.anchorOpenSvg = this.anchorOpenSvg, c.anchorCloseSvg = this.anchorCloseSvg, c.sendIconSvg = this.sendIconSvg, c.attachIconSvg = this.attachIconSvg, p.setSetting(c);
|
|
6705
6754
|
let e = {};
|
|
6706
6755
|
try {
|
|
6707
6756
|
e = JSON.parse(this.prefilledFormFields);
|
|
6708
6757
|
} catch (a) {
|
|
6709
|
-
|
|
6758
|
+
Ae.error(`Failed to parse prefilled-form-fields attribute value, error: ${(a == null ? void 0 : a.message) || ""}`), e = {};
|
|
6710
6759
|
}
|
|
6711
6760
|
p.setPrefilledFormFields(e), this.open && (p.open = !0), this.alwaysOpen && (p.open = !0, p.alwaysOpen = !0);
|
|
6712
6761
|
}
|
|
@@ -6740,7 +6789,7 @@ let j = class extends te {
|
|
|
6740
6789
|
// for example, user profile, current product user is viewing on the web page, etc.
|
|
6741
6790
|
setContext(c = {}) {
|
|
6742
6791
|
p.setContext(c).catch((e) => {
|
|
6743
|
-
|
|
6792
|
+
Ae.error(`Failed to set context, error: ${(e == null ? void 0 : e.message) || ""}`);
|
|
6744
6793
|
});
|
|
6745
6794
|
}
|
|
6746
6795
|
getContext() {
|
|
@@ -6828,91 +6877,97 @@ let j = class extends te {
|
|
|
6828
6877
|
(e = this._messageList) == null || e.scrollToBottom();
|
|
6829
6878
|
}
|
|
6830
6879
|
};
|
|
6831
|
-
|
|
6880
|
+
P.styles = Wa;
|
|
6832
6881
|
H([
|
|
6833
6882
|
v({ type: Boolean, attribute: "display-license" })
|
|
6834
|
-
],
|
|
6883
|
+
], P.prototype, "displayLicense", 2);
|
|
6835
6884
|
H([
|
|
6836
6885
|
v({ type: String, attribute: "name" })
|
|
6837
|
-
],
|
|
6886
|
+
], P.prototype, "name", 2);
|
|
6838
6887
|
H([
|
|
6839
6888
|
v({ type: String, attribute: "org-id" })
|
|
6840
|
-
],
|
|
6889
|
+
], P.prototype, "orgId", 2);
|
|
6841
6890
|
H([
|
|
6842
6891
|
v({ type: String, attribute: "bot-id" })
|
|
6843
|
-
],
|
|
6892
|
+
], P.prototype, "botId", 2);
|
|
6844
6893
|
H([
|
|
6845
6894
|
v({ type: String, attribute: "url" })
|
|
6846
|
-
],
|
|
6895
|
+
], P.prototype, "url", 2);
|
|
6847
6896
|
H([
|
|
6848
6897
|
v({ type: String, attribute: "logo-url" })
|
|
6849
|
-
],
|
|
6898
|
+
], P.prototype, "logoUrl", 2);
|
|
6850
6899
|
H([
|
|
6851
6900
|
v({ type: String, attribute: "logo-svg" })
|
|
6852
|
-
],
|
|
6901
|
+
], P.prototype, "logoSvg", 2);
|
|
6853
6902
|
H([
|
|
6854
6903
|
v({ type: String, attribute: "close-svg" })
|
|
6855
|
-
],
|
|
6904
|
+
], P.prototype, "closeSvg", 2);
|
|
6856
6905
|
H([
|
|
6857
6906
|
v({ type: String, attribute: "popup-logo-svg" })
|
|
6858
|
-
],
|
|
6907
|
+
], P.prototype, "popupLogoSvg", 2);
|
|
6859
6908
|
H([
|
|
6860
6909
|
v({ type: String, attribute: "popup-logo-url" })
|
|
6861
|
-
],
|
|
6910
|
+
], P.prototype, "popupLogoUrl", 2);
|
|
6862
6911
|
H([
|
|
6863
6912
|
v({ type: String, attribute: "bot-icon-svg" })
|
|
6864
|
-
],
|
|
6913
|
+
], P.prototype, "botIconSvg", 2);
|
|
6865
6914
|
H([
|
|
6866
6915
|
v({ type: String, attribute: "user-icon-svg" })
|
|
6867
|
-
],
|
|
6916
|
+
], P.prototype, "userIconSvg", 2);
|
|
6868
6917
|
H([
|
|
6869
6918
|
v({ type: String, attribute: "system-icon-svg" })
|
|
6870
|
-
],
|
|
6919
|
+
], P.prototype, "systemIconSvg", 2);
|
|
6871
6920
|
H([
|
|
6872
6921
|
v({ type: String, attribute: "agent-icon-svg" })
|
|
6873
|
-
],
|
|
6922
|
+
], P.prototype, "agentIconSvg", 2);
|
|
6874
6923
|
H([
|
|
6875
6924
|
v({ type: String, attribute: "anchor-open-svg" })
|
|
6876
|
-
],
|
|
6925
|
+
], P.prototype, "anchorOpenSvg", 2);
|
|
6877
6926
|
H([
|
|
6878
6927
|
v({ type: String, attribute: "anchor-close-svg" })
|
|
6879
|
-
],
|
|
6928
|
+
], P.prototype, "anchorCloseSvg", 2);
|
|
6929
|
+
H([
|
|
6930
|
+
v({ type: String, attribute: "send-icon-svg" })
|
|
6931
|
+
], P.prototype, "sendIconSvg", 2);
|
|
6932
|
+
H([
|
|
6933
|
+
v({ type: String, attribute: "attach-icon-svg" })
|
|
6934
|
+
], P.prototype, "attachIconSvg", 2);
|
|
6880
6935
|
H([
|
|
6881
6936
|
v({ type: Boolean, attribute: "stream" })
|
|
6882
|
-
],
|
|
6937
|
+
], P.prototype, "stream", 2);
|
|
6883
6938
|
H([
|
|
6884
6939
|
v({ type: Boolean, attribute: "custom-request" })
|
|
6885
|
-
],
|
|
6940
|
+
], P.prototype, "customRequest", 2);
|
|
6886
6941
|
H([
|
|
6887
6942
|
v({ type: Boolean, attribute: "enable-file-upload" })
|
|
6888
|
-
],
|
|
6943
|
+
], P.prototype, "enableFileUpload", 2);
|
|
6889
6944
|
H([
|
|
6890
6945
|
v({ type: String, attribute: "upload-file-url" })
|
|
6891
|
-
],
|
|
6946
|
+
], P.prototype, "uploadFileUrl", 2);
|
|
6892
6947
|
H([
|
|
6893
6948
|
v({ type: Boolean, attribute: "open" })
|
|
6894
|
-
],
|
|
6949
|
+
], P.prototype, "open", 2);
|
|
6895
6950
|
H([
|
|
6896
6951
|
v({ type: Boolean, attribute: "always-open" })
|
|
6897
|
-
],
|
|
6952
|
+
], P.prototype, "alwaysOpen", 2);
|
|
6898
6953
|
H([
|
|
6899
6954
|
v({ type: String, attribute: "prefilled-form-fields" })
|
|
6900
|
-
],
|
|
6955
|
+
], P.prototype, "prefilledFormFields", 2);
|
|
6901
6956
|
H([
|
|
6902
6957
|
v({ type: Boolean })
|
|
6903
|
-
],
|
|
6958
|
+
], P.prototype, "loading", 2);
|
|
6904
6959
|
H([
|
|
6905
6960
|
v({ type: Boolean })
|
|
6906
|
-
],
|
|
6961
|
+
], P.prototype, "showSetting", 2);
|
|
6907
6962
|
H([
|
|
6908
6963
|
v({ type: Boolean })
|
|
6909
|
-
],
|
|
6964
|
+
], P.prototype, "showAuthAlert", 2);
|
|
6910
6965
|
H([
|
|
6911
6966
|
Ce("cb-message-list")
|
|
6912
|
-
],
|
|
6913
|
-
|
|
6967
|
+
], P.prototype, "_messageList", 2);
|
|
6968
|
+
P = H([
|
|
6914
6969
|
J("enegelai-bot")
|
|
6915
|
-
],
|
|
6970
|
+
], P);
|
|
6916
6971
|
export {
|
|
6917
|
-
|
|
6972
|
+
P as default
|
|
6918
6973
|
};
|