@2uinc/frontend-component-xpert-chatbot 1.39.0 → 1.40.1

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.
@@ -1444,12 +1444,12 @@ const v = /* @__PURE__ */ Ft(q0), z0 = {
1444
1444
  xpertKey: r = null,
1445
1445
  widgetMode: a = !0
1446
1446
  }) => {
1447
- const [i, u] = le(!1), [s, l] = le({}), c = lt(async () => {
1448
- if (!(!t && !r)) {
1449
- if (u(!1), t)
1447
+ const [i, u] = le({}), s = lt(async () => {
1448
+ if (!(!t && !r))
1449
+ if (t)
1450
1450
  try {
1451
- const p = await fetch(
1452
- `https://xpert-api-services.prod.ai.2u.com/v1/client?client_id=${t}`,
1451
+ const d = await fetch(
1452
+ `https://chatbot-frontend.prod.ai.2u.com/xpert-api/v1/client?client_id=${t}`,
1453
1453
  {
1454
1454
  method: "GET",
1455
1455
  headers: {
@@ -1457,39 +1457,37 @@ const v = /* @__PURE__ */ Ft(q0), z0 = {
1457
1457
  }
1458
1458
  }
1459
1459
  );
1460
- if (!p.ok) {
1460
+ if (!d.ok) {
1461
1461
  console.error(
1462
- `The chatbot configuration could not be loaded from the server. Status ${p.status} - ${p.statusText}`
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 h = await p.json();
1467
- l({ ...h, id: t });
1468
- } catch (p) {
1469
- console.error("Unexpected error loading the chatbot configuration", p);
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
- l({
1472
+ u({
1473
1473
  ...Q0(r),
1474
1474
  id: r
1475
1475
  });
1476
- u(!0);
1477
- }
1478
1476
  }, [t, r]);
1479
1477
  Re(() => {
1480
- c();
1481
- }, [c]);
1482
- const d = un(
1483
- () => Rs({ id: "generic", ...s }, n ?? {}),
1484
- [n, s]
1485
- ), f = un(() => t || r ? i : !!n, [t, i, n, r]);
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
- ...d,
1488
+ ...l,
1491
1489
  clientId: t,
1492
- configurationLoaded: f,
1490
+ configurationLoaded: c,
1493
1491
  widgetMode: a
1494
1492
  },
1495
1493
  children: e
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2uinc/frontend-component-xpert-chatbot",
3
- "version": "1.39.0",
3
+ "version": "1.40.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/2uinc/frontend-component-xpert-chatbot.git"