lr-chatbot 0.39.16 → 0.39.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +42 -42
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -14142,7 +14142,7 @@ function M2(t, r, e) {
|
|
|
14142
14142
|
}
|
|
14143
14143
|
const P2 = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;
|
|
14144
14144
|
function Ql(t) {
|
|
14145
|
-
return typeof t != "string" ? t :
|
|
14145
|
+
return typeof t != "string" ? t : P2.exec(t) ? parseFloat(t) : t;
|
|
14146
14146
|
}
|
|
14147
14147
|
function ec(t, r) {
|
|
14148
14148
|
return t.substr(-r.length) === r;
|
|
@@ -14400,13 +14400,13 @@ function Ci(t) {
|
|
|
14400
14400
|
if (typeof t != "string")
|
|
14401
14401
|
throw new lt(3);
|
|
14402
14402
|
const r = N2(t);
|
|
14403
|
-
if (
|
|
14403
|
+
if (j2.exec(r))
|
|
14404
14404
|
return {
|
|
14405
14405
|
red: parseInt(`${r[1]}${r[2]}`, 16),
|
|
14406
14406
|
green: parseInt(`${r[3]}${r[4]}`, 16),
|
|
14407
14407
|
blue: parseInt(`${r[5]}${r[6]}`, 16)
|
|
14408
14408
|
};
|
|
14409
|
-
if (
|
|
14409
|
+
if (H2.exec(r)) {
|
|
14410
14410
|
const s = parseFloat((parseInt(`${r[7]}${r[8]}`, 16) / 255).toFixed(2));
|
|
14411
14411
|
return {
|
|
14412
14412
|
red: parseInt(`${r[1]}${r[2]}`, 16),
|
|
@@ -14415,13 +14415,13 @@ function Ci(t) {
|
|
|
14415
14415
|
alpha: s
|
|
14416
14416
|
};
|
|
14417
14417
|
}
|
|
14418
|
-
if (
|
|
14418
|
+
if (U2.exec(r))
|
|
14419
14419
|
return {
|
|
14420
14420
|
red: parseInt(`${r[1]}${r[1]}`, 16),
|
|
14421
14421
|
green: parseInt(`${r[2]}${r[2]}`, 16),
|
|
14422
14422
|
blue: parseInt(`${r[3]}${r[3]}`, 16)
|
|
14423
14423
|
};
|
|
14424
|
-
if (
|
|
14424
|
+
if (z2.exec(r)) {
|
|
14425
14425
|
const s = parseFloat((parseInt(`${r[4]}${r[4]}`, 16) / 255).toFixed(2));
|
|
14426
14426
|
return {
|
|
14427
14427
|
red: parseInt(`${r[1]}${r[1]}`, 16),
|
|
@@ -18763,8 +18763,7 @@ class db extends $d {
|
|
|
18763
18763
|
}
|
|
18764
18764
|
async loadTranslations(r) {
|
|
18765
18765
|
var s;
|
|
18766
|
-
const { fetchServerTranslations: e = !0, updateHost: n = !1 } = r, i = this.translationsLoaderGetter();
|
|
18767
|
-
let a = await i.getLanguageTranslations({ fetchServerTranslations: e });
|
|
18766
|
+
const { fetchServerTranslations: e = !0, updateHost: n = !1 } = r, i = this.translationsLoaderGetter(), a = await i.getLanguageTranslations({ fetchServerTranslations: e });
|
|
18768
18767
|
await this.setI18nResources(i.config.language, a), e && ((s = this.resolveServerTranslationsLoadedPromise) == null || s.call(this)), n && this.host.requestUpdate();
|
|
18769
18768
|
}
|
|
18770
18769
|
async setI18nResources(r, e) {
|
|
@@ -18948,7 +18947,7 @@ const Va = {
|
|
|
18948
18947
|
uk: []
|
|
18949
18948
|
}, vb = /((([a-zA-Z]+(-[a-zA-Z0-9]+){0,2})|\*)(;q=[0-1](\.[0-9]+)?)?)*/g;
|
|
18950
18949
|
function yb(t) {
|
|
18951
|
-
return ((t || "").match(vb)
|
|
18950
|
+
return ((t || "").match(vb) ?? []).map(function(e) {
|
|
18952
18951
|
if (!e)
|
|
18953
18952
|
return;
|
|
18954
18953
|
const n = e.split(";"), i = n[0].split("-"), a = i.length === 3;
|
|
@@ -18997,7 +18996,7 @@ const on = (t) => (Array.isArray(Va[t]) ? Va[t] : [Va[t]]).filter((e) => !!e), w
|
|
|
18997
18996
|
}, Cb = (t, r) => {
|
|
18998
18997
|
var a;
|
|
18999
18998
|
if (!t || !r) return null;
|
|
19000
|
-
const e =
|
|
18999
|
+
const e = /^\/([a-z]{2})(\/|$)/i.exec(t), n = (a = e == null ? void 0 : e[1]) == null ? void 0 : a.toLowerCase();
|
|
19001
19000
|
return n ? on(r).find((s) => s.toLowerCase().startsWith(n)) ?? null : null;
|
|
19002
19001
|
}, xb = (t, r) => on(r).find((i) => i.toLowerCase().startsWith(`${t}-${r}`.toLowerCase())), Eb = (t, r) => on(r).filter((i) => Cs(r, i)).find((i) => i.toLowerCase() === t.toLowerCase()), Ab = (t) => {
|
|
19003
19002
|
const r = on(t);
|
|
@@ -20754,39 +20753,38 @@ class vo {
|
|
|
20754
20753
|
});
|
|
20755
20754
|
});
|
|
20756
20755
|
B(this, "request", async ({
|
|
20757
|
-
|
|
20758
|
-
|
|
20759
|
-
|
|
20760
|
-
|
|
20761
|
-
|
|
20762
|
-
|
|
20763
|
-
...o
|
|
20756
|
+
path: r,
|
|
20757
|
+
type: e,
|
|
20758
|
+
query: n,
|
|
20759
|
+
format: i,
|
|
20760
|
+
body: a,
|
|
20761
|
+
...s
|
|
20764
20762
|
}) => {
|
|
20765
|
-
const
|
|
20766
|
-
return
|
|
20767
|
-
...
|
|
20763
|
+
const o = (i && this.format) ?? void 0;
|
|
20764
|
+
return e === "multipart/form-data" && a && a !== null && typeof a == "object" && (s.headers && (s.headers.common = "Accept: */*", s.headers.post = "", s.headers.put = ""), a = this.createFormData(a)), this.instance.request({
|
|
20765
|
+
...s,
|
|
20768
20766
|
headers: {
|
|
20769
|
-
...
|
|
20770
|
-
...
|
|
20767
|
+
...e && e !== "multipart/form-data" ? { "Content-Type": e } : {},
|
|
20768
|
+
...s.headers ?? {}
|
|
20771
20769
|
},
|
|
20772
|
-
params:
|
|
20773
|
-
responseType:
|
|
20774
|
-
data:
|
|
20775
|
-
url:
|
|
20770
|
+
params: n,
|
|
20771
|
+
responseType: o,
|
|
20772
|
+
data: a,
|
|
20773
|
+
url: r,
|
|
20776
20774
|
topMostError: new Error("Enhanced stack trace")
|
|
20777
|
-
}).then(this.successHandler ?? ((
|
|
20778
|
-
this.axiosErrorHandler((
|
|
20779
|
-
var u, d, h
|
|
20780
|
-
if (
|
|
20781
|
-
const
|
|
20782
|
-
|
|
20783
|
-
headers: (
|
|
20784
|
-
method: (
|
|
20785
|
-
data: (
|
|
20786
|
-
baseURL: (
|
|
20775
|
+
}).then(this.successHandler ?? ((l) => l.data)).catch(
|
|
20776
|
+
this.axiosErrorHandler((l) => {
|
|
20777
|
+
var c, u, d, h;
|
|
20778
|
+
if (l.type === "axios-error") {
|
|
20779
|
+
const p = l.error;
|
|
20780
|
+
p.config = {
|
|
20781
|
+
headers: (c = p.config) == null ? void 0 : c.headers,
|
|
20782
|
+
method: (u = p.config) == null ? void 0 : u.method,
|
|
20783
|
+
data: (d = p.config) == null ? void 0 : d.data,
|
|
20784
|
+
baseURL: (h = p.config) == null ? void 0 : h.baseURL
|
|
20787
20785
|
};
|
|
20788
20786
|
}
|
|
20789
|
-
throw
|
|
20787
|
+
throw l.error;
|
|
20790
20788
|
})
|
|
20791
20789
|
);
|
|
20792
20790
|
});
|
|
@@ -22846,6 +22844,7 @@ let Ot = class extends fe {
|
|
|
22846
22844
|
formResetCallback() {
|
|
22847
22845
|
this.value = 0;
|
|
22848
22846
|
}
|
|
22847
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22849
22848
|
formStateRestoreCallback(t) {
|
|
22850
22849
|
this.value = t;
|
|
22851
22850
|
}
|
|
@@ -23332,6 +23331,7 @@ let In = class extends fe {
|
|
|
23332
23331
|
firstUpdated() {
|
|
23333
23332
|
this._isMobileDevice && this.setElement();
|
|
23334
23333
|
}
|
|
23334
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23335
23335
|
updated(t) {
|
|
23336
23336
|
t.has("_isDragging") && !this._isDragging && this._isClickEventRemoved && setTimeout(() => {
|
|
23337
23337
|
this._isClickEventRemoved = !1;
|
|
@@ -23420,7 +23420,7 @@ let It = class extends fe {
|
|
|
23420
23420
|
Jn(this, mi, t);
|
|
23421
23421
|
}
|
|
23422
23422
|
getVersion() {
|
|
23423
|
-
return "LR Chatbot - v0.39.
|
|
23423
|
+
return "LR Chatbot - v0.39.17";
|
|
23424
23424
|
}
|
|
23425
23425
|
async connectedCallback() {
|
|
23426
23426
|
super.connectedCallback(), this._conversationHistoryTask.run();
|
|
@@ -23505,18 +23505,18 @@ let It = class extends fe {
|
|
|
23505
23505
|
if (!this.deepChat)
|
|
23506
23506
|
throw Error("Deep Chat should be initialized at this point");
|
|
23507
23507
|
this.disableDeepChatTextInput(), [qa.INITIAL, qa.ERROR].includes(this._conversationHistoryTask.status) && this._conversationHistoryTask.run();
|
|
23508
|
-
|
|
23508
|
+
const t = await this._conversationHistoryTask.taskComplete;
|
|
23509
23509
|
this.setInitialMessages(), t != null && t.messages && (this.deepChat.history = [
|
|
23510
23510
|
...this.deepChat.history ?? [],
|
|
23511
23511
|
...t.messages.map((r) => ({
|
|
23512
23512
|
role: r.sender === "system" ? "ai" : "user",
|
|
23513
23513
|
html: Wn({
|
|
23514
23514
|
apiUrl: this.apiUrl,
|
|
23515
|
-
conversationId: this.getCurrentConversationId() ??
|
|
23515
|
+
conversationId: this.getCurrentConversationId() ?? "",
|
|
23516
23516
|
messageId: r.messageId ?? "",
|
|
23517
23517
|
score: r.score ?? void 0,
|
|
23518
23518
|
slot: r.message ?? "",
|
|
23519
|
-
showMessageRating: r.popUpRate
|
|
23519
|
+
showMessageRating: r.popUpRate ?? !1
|
|
23520
23520
|
})
|
|
23521
23521
|
}))
|
|
23522
23522
|
]), this.enableDeepChatTextInput(), this._conversationHistoryTask = this.createConversationHistoryTask();
|
|
@@ -23589,11 +23589,11 @@ let It = class extends fe {
|
|
|
23589
23589
|
});
|
|
23590
23590
|
this._shouldEndConversation = s.message_status === "end_conversation", this.setConversationTimeout(), this.observeInputChanges(), r.onResponse({ html: o, role: "ai" });
|
|
23591
23591
|
} catch {
|
|
23592
|
-
const
|
|
23592
|
+
const e = Wn({
|
|
23593
23593
|
slot: be("chatbot:errorMessage")
|
|
23594
23594
|
});
|
|
23595
23595
|
r.onResponse({
|
|
23596
|
-
html:
|
|
23596
|
+
html: e
|
|
23597
23597
|
});
|
|
23598
23598
|
}
|
|
23599
23599
|
}
|