@2uinc/frontend-component-xpert-chatbot 1.40.0 → 1.40.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/index.min.js +19 -21
- package/package.json +1 -1
package/dist/lib/index.min.js
CHANGED
@@ -1444,11 +1444,11 @@ const v = /* @__PURE__ */ Ft(q0), z0 = {
|
|
1444
1444
|
xpertKey: r = null,
|
1445
1445
|
widgetMode: a = !0
|
1446
1446
|
}) => {
|
1447
|
-
const [i, u] = le(
|
1448
|
-
if (!(!t && !r))
|
1449
|
-
if (
|
1447
|
+
const [i, u] = le({}), s = lt(async () => {
|
1448
|
+
if (!(!t && !r))
|
1449
|
+
if (t)
|
1450
1450
|
try {
|
1451
|
-
const
|
1451
|
+
const d = await fetch(
|
1452
1452
|
`https://chatbot-frontend.prod.ai.2u.com/xpert-api/v1/client?client_id=${t}`,
|
1453
1453
|
{
|
1454
1454
|
method: "GET",
|
@@ -1457,39 +1457,37 @@ const v = /* @__PURE__ */ Ft(q0), z0 = {
|
|
1457
1457
|
}
|
1458
1458
|
}
|
1459
1459
|
);
|
1460
|
-
if (!
|
1460
|
+
if (!d.ok) {
|
1461
1461
|
console.error(
|
1462
|
-
`The chatbot configuration could not be loaded from the server. Status ${
|
1462
|
+
`The chatbot configuration could not be loaded from the server. Status ${d.status} - ${d.statusText}`
|
1463
1463
|
);
|
1464
1464
|
return;
|
1465
1465
|
}
|
1466
|
-
const
|
1467
|
-
|
1468
|
-
} catch (
|
1469
|
-
console.error("Unexpected error loading the chatbot configuration",
|
1466
|
+
const f = await d.json();
|
1467
|
+
u({ ...f, id: t });
|
1468
|
+
} catch (d) {
|
1469
|
+
console.error("Unexpected error loading the chatbot configuration", d);
|
1470
1470
|
}
|
1471
1471
|
else
|
1472
|
-
|
1472
|
+
u({
|
1473
1473
|
...Q0(r),
|
1474
1474
|
id: r
|
1475
1475
|
});
|
1476
|
-
u(!0);
|
1477
|
-
}
|
1478
1476
|
}, [t, r]);
|
1479
1477
|
Re(() => {
|
1480
|
-
|
1481
|
-
}, [
|
1482
|
-
const
|
1483
|
-
() => Rs({ id: "generic", ...
|
1484
|
-
[n,
|
1485
|
-
),
|
1478
|
+
s();
|
1479
|
+
}, [s]);
|
1480
|
+
const l = un(
|
1481
|
+
() => Rs({ id: "generic", ...i }, n ?? {}),
|
1482
|
+
[n, i]
|
1483
|
+
), c = un(() => t ? Object.keys(i)?.length > 0 : r ? !!n : !1, [t, i, n, r]);
|
1486
1484
|
return /* @__PURE__ */ A.jsx(
|
1487
1485
|
$e.Provider,
|
1488
1486
|
{
|
1489
1487
|
value: {
|
1490
|
-
...
|
1488
|
+
...l,
|
1491
1489
|
clientId: t,
|
1492
|
-
configurationLoaded:
|
1490
|
+
configurationLoaded: c,
|
1493
1491
|
widgetMode: a
|
1494
1492
|
},
|
1495
1493
|
children: e
|