@developer.notchatbot/webchat 1.2.7 → 1.2.9

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.
@@ -16964,6 +16964,25 @@ También puedes pedir hablar con nuestro equipo de los sueños!`, bd = (e) => ({
16964
16964
  }
16965
16965
  );
16966
16966
  };
16967
+ (() => {
16968
+ if (typeof document == "undefined") return;
16969
+ const e = {}, t = document.dispatchEvent.bind(document);
16970
+ document.dispatchEvent = (r) => {
16971
+ const o = r == null ? void 0 : r.type;
16972
+ return (o === "WebChatReady" || o === "EmbedChatReady") && (e[o] = !0), t(r);
16973
+ };
16974
+ const n = document.addEventListener.bind(document);
16975
+ document.addEventListener = (r, o, i) => {
16976
+ const a = r;
16977
+ if ((a === "WebChatReady" || a === "EmbedChatReady") && e[a]) {
16978
+ const l = new CustomEvent(a);
16979
+ setTimeout(() => {
16980
+ typeof o == "function" ? o.call(document, l) : o && typeof o.handleEvent == "function" && o.handleEvent(l);
16981
+ }, 0);
16982
+ }
16983
+ return n(r, o, i);
16984
+ };
16985
+ })();
16967
16986
  let En = null;
16968
16987
  const Er = {}, No = {};
16969
16988
  let et = null, Te = null, ns = !1, Wr = {};
@@ -16973,7 +16992,7 @@ const rs = {}, Cd = (e) => {
16973
16992
  return console.error("EmbedChat: elementId is required"), null;
16974
16993
  const t = document.getElementById(e.elementId);
16975
16994
  if (!t)
16976
- return console.error(`EmbedChat: Element with id "${e.elementId}" not found`), null;
16995
+ return null;
16977
16996
  let n;
16978
16997
  t.shadowRoot ? (n = t.shadowRoot, n.innerHTML = "") : n = t.attachShadow({ mode: "open" });
16979
16998
  const r = document.createElement("style");
@@ -17130,17 +17149,17 @@ typeof window != "undefined" && (window.WebChat = ym, window.EmbedChat = wm, win
17130
17149
  window.setWebChatPosition(t);
17131
17150
  }
17132
17151
  }), setTimeout(() => {
17133
- const e = new CustomEvent("WebChatReady");
17152
+ const e = new CustomEvent("WebChatReady", { bubbles: !0 });
17134
17153
  document.dispatchEvent(e);
17135
17154
  }, 0), setTimeout(() => {
17136
- const e = new CustomEvent("EmbedChatReady");
17155
+ const e = new CustomEvent("EmbedChatReady", { bubbles: !0 });
17137
17156
  document.dispatchEvent(e);
17138
17157
  }, 0));
17139
17158
  const xm = () => {
17140
- const e = new CustomEvent("WebChatReady");
17159
+ const e = new CustomEvent("WebChatReady", { bubbles: !0 });
17141
17160
  document.dispatchEvent(e);
17142
17161
  }, Ed = () => {
17143
- const e = new CustomEvent("EmbedChatReady");
17162
+ const e = new CustomEvent("EmbedChatReady", { bubbles: !0 });
17144
17163
  document.dispatchEvent(e);
17145
17164
  }, Nu = () => {
17146
17165
  xm(), Ed();
@@ -17148,7 +17167,7 @@ const xm = () => {
17148
17167
  requestAnimationFrame(() => {
17149
17168
  setTimeout(() => {
17150
17169
  Ed();
17151
- }, 50);
17170
+ }, 0);
17152
17171
  });
17153
17172
  };
17154
17173
  document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", Nu) : setTimeout(Nu, 0);