bstp-agent-widget 0.2.52 → 0.2.54

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.
@@ -23759,8 +23759,27 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
23759
23759
  t.style.setProperty("--agent-widget-drawer-width", "0px");
23760
23760
  return;
23761
23761
  }
23762
- return t.style.setProperty("--agent-widget-drawer-width", `${j}px`), () => {
23763
- t.style.setProperty("--agent-widget-drawer-width", "0px");
23762
+ let n = () => {
23763
+ let e = Array.from(document.querySelectorAll(`.${db.content}`));
23764
+ for (let t of e) {
23765
+ let e = t.getBoundingClientRect();
23766
+ if (e.width > 0 && e.height > 0) return t;
23767
+ }
23768
+ return e[0] ?? null;
23769
+ }, r = () => {
23770
+ let e = n(), r = e ? e.clientWidth : j, i = Math.max(0, Math.floor(r));
23771
+ t.style.setProperty("--agent-widget-drawer-width", `${i}px`);
23772
+ };
23773
+ r();
23774
+ let i = n(), a = typeof ResizeObserver < "u" ? new ResizeObserver(() => {
23775
+ r();
23776
+ }) : null;
23777
+ i && a && a.observe(i);
23778
+ let o = () => {
23779
+ r();
23780
+ };
23781
+ return window.addEventListener("resize", o), () => {
23782
+ a?.disconnect(), window.removeEventListener("resize", o), t.style.setProperty("--agent-widget-drawer-width", "0px");
23764
23783
  };
23765
23784
  }, [e, j]), /* @__PURE__ */ T(w, { children: /* @__PURE__ */ E(ub, {
23766
23785
  opened: e,