@ethora/chat-component 26.3.25 → 26.3.26

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/main.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as g, jsxs as U, Fragment as je } from "react/jsx-runtime";
2
2
  import * as Pt from "react";
3
- import Ge, { useRef as be, useState as le, useCallback as de, useEffect as ge, createContext as JA, useContext as Kd, createElement as j6, useMemo as Ve, Fragment as Ku, forwardRef as W6, PureComponent as Y6 } from "react";
3
+ import Ge, { useRef as be, useState as le, useCallback as de, useEffect as pe, createContext as JA, useContext as Kd, createElement as j6, useMemo as Ve, Fragment as Ku, forwardRef as W6, PureComponent as Y6 } from "react";
4
4
  function ci(e) {
5
5
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
6
6
  }
@@ -8828,7 +8828,7 @@ function O5(e, t) {
8828
8828
  };
8829
8829
  return r(e);
8830
8830
  }
8831
- let pe = class cy extends Error {
8831
+ let ge = class cy extends Error {
8832
8832
  static from(t, n, i, r, s, a) {
8833
8833
  const o = new cy(t.message, n || t.code, i, r, s);
8834
8834
  return o.cause = t, o.name = t.name, t.status != null && o.status == null && (o.status = t.status), a && Object.assign(o, a), o;
@@ -8876,20 +8876,20 @@ let pe = class cy extends Error {
8876
8876
  };
8877
8877
  }
8878
8878
  };
8879
- pe.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
8880
- pe.ERR_BAD_OPTION = "ERR_BAD_OPTION";
8881
- pe.ECONNABORTED = "ECONNABORTED";
8882
- pe.ETIMEDOUT = "ETIMEDOUT";
8883
- pe.ECONNREFUSED = "ECONNREFUSED";
8884
- pe.ERR_NETWORK = "ERR_NETWORK";
8885
- pe.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
8886
- pe.ERR_DEPRECATED = "ERR_DEPRECATED";
8887
- pe.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
8888
- pe.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
8889
- pe.ERR_CANCELED = "ERR_CANCELED";
8890
- pe.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
8891
- pe.ERR_INVALID_URL = "ERR_INVALID_URL";
8892
- pe.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
8879
+ ge.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
8880
+ ge.ERR_BAD_OPTION = "ERR_BAD_OPTION";
8881
+ ge.ECONNABORTED = "ECONNABORTED";
8882
+ ge.ETIMEDOUT = "ETIMEDOUT";
8883
+ ge.ECONNREFUSED = "ECONNREFUSED";
8884
+ ge.ERR_NETWORK = "ERR_NETWORK";
8885
+ ge.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
8886
+ ge.ERR_DEPRECATED = "ERR_DEPRECATED";
8887
+ ge.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
8888
+ ge.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
8889
+ ge.ERR_CANCELED = "ERR_CANCELED";
8890
+ ge.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
8891
+ ge.ERR_INVALID_URL = "ERR_INVALID_URL";
8892
+ ge.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
8893
8893
  const L5 = null;
8894
8894
  function Vf(e) {
8895
8895
  return q.isPlainObject(e) || q.isArray(e);
@@ -8933,7 +8933,7 @@ function fu(e, t, n) {
8933
8933
  if (q.isBoolean(p))
8934
8934
  return p.toString();
8935
8935
  if (!u && q.isBlob(p))
8936
- throw new pe("Blob is not supported. Use a Buffer instead.");
8936
+ throw new ge("Blob is not supported. Use a Buffer instead.");
8937
8937
  return q.isArrayBuffer(p) || q.isTypedArray(p) ? u && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
8938
8938
  }
8939
8939
  function l(p, v, b) {
@@ -8962,9 +8962,9 @@ function fu(e, t, n) {
8962
8962
  function h(p, v, b = 0) {
8963
8963
  if (!q.isUndefined(p)) {
8964
8964
  if (b > A)
8965
- throw new pe(
8965
+ throw new ge(
8966
8966
  "Object is too deeply nested (" + b + " levels). Max depth: " + A,
8967
- pe.ERR_FORM_DATA_DEPTH_EXCEEDED
8967
+ ge.ERR_FORM_DATA_DEPTH_EXCEEDED
8968
8968
  );
8969
8969
  if (f.indexOf(p) !== -1)
8970
8970
  throw Error("Circular reference detected in " + v.join("."));
@@ -9189,7 +9189,7 @@ const wa = {
9189
9189
  return JSON.parse(t, er(this, "parseReviver"));
9190
9190
  } catch (A) {
9191
9191
  if (o)
9192
- throw A.name === "SyntaxError" ? pe.from(A, pe.ERR_BAD_RESPONSE, this, null, er(this, "response")) : A;
9192
+ throw A.name === "SyntaxError" ? ge.from(A, ge.ERR_BAD_RESPONSE, this, null, er(this, "response")) : A;
9193
9193
  }
9194
9194
  }
9195
9195
  return t;
@@ -9231,7 +9231,7 @@ function ol(e, t) {
9231
9231
  function my(e) {
9232
9232
  return !!(e && e.__CANCEL__);
9233
9233
  }
9234
- let ka = class extends pe {
9234
+ let ka = class extends ge {
9235
9235
  /**
9236
9236
  * A `CanceledError` is an object that is thrown when an operation is canceled.
9237
9237
  *
@@ -9242,14 +9242,14 @@ let ka = class extends pe {
9242
9242
  * @returns {CanceledError} The created error.
9243
9243
  */
9244
9244
  constructor(t, n, i) {
9245
- super(t ?? "canceled", pe.ERR_CANCELED, n, i), this.name = "CanceledError", this.__CANCEL__ = !0;
9245
+ super(t ?? "canceled", ge.ERR_CANCELED, n, i), this.name = "CanceledError", this.__CANCEL__ = !0;
9246
9246
  }
9247
9247
  };
9248
9248
  function py(e, t, n) {
9249
9249
  const i = n.config.validateStatus;
9250
- !n.status || !i || i(n.status) ? e(n) : t(new pe(
9250
+ !n.status || !i || i(n.status) ? e(n) : t(new ge(
9251
9251
  "Request failed with status code " + n.status,
9252
- n.status >= 400 && n.status < 500 ? pe.ERR_BAD_REQUEST : pe.ERR_BAD_RESPONSE,
9252
+ n.status >= 400 && n.status < 500 ? ge.ERR_BAD_REQUEST : ge.ERR_BAD_RESPONSE,
9253
9253
  n.config,
9254
9254
  n.request,
9255
9255
  n
@@ -9507,17 +9507,17 @@ const AI = (e) => encodeURIComponent(e).replace(
9507
9507
  "onloadend" in v ? v.onloadend = b : v.onreadystatechange = function() {
9508
9508
  !v || v.readyState !== 4 || v.status === 0 && !(v.responseURL && v.responseURL.startsWith("file:")) || setTimeout(b);
9509
9509
  }, v.onabort = function() {
9510
- v && (i(new pe("Request aborted", pe.ECONNABORTED, e, v)), p(), v = null);
9510
+ v && (i(new ge("Request aborted", ge.ECONNABORTED, e, v)), p(), v = null);
9511
9511
  }, v.onerror = function(C) {
9512
- const E = C && C.message ? C.message : "Network Error", y = new pe(E, pe.ERR_NETWORK, e, v);
9512
+ const E = C && C.message ? C.message : "Network Error", y = new ge(E, ge.ERR_NETWORK, e, v);
9513
9513
  y.event = C || null, i(y), p(), v = null;
9514
9514
  }, v.ontimeout = function() {
9515
9515
  let C = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
9516
9516
  const E = r.transitional || vh;
9517
9517
  r.timeoutErrorMessage && (C = r.timeoutErrorMessage), i(
9518
- new pe(
9518
+ new ge(
9519
9519
  C,
9520
- E.clarifyTimeoutError ? pe.ETIMEDOUT : pe.ECONNABORTED,
9520
+ E.clarifyTimeoutError ? ge.ETIMEDOUT : ge.ECONNABORTED,
9521
9521
  e,
9522
9522
  v
9523
9523
  )
@@ -9530,9 +9530,9 @@ const AI = (e) => encodeURIComponent(e).replace(
9530
9530
  const k = $5(r.url);
9531
9531
  if (k && !ht.protocols.includes(k)) {
9532
9532
  i(
9533
- new pe(
9533
+ new ge(
9534
9534
  "Unsupported protocol " + k + ":",
9535
- pe.ERR_BAD_REQUEST,
9535
+ ge.ERR_BAD_REQUEST,
9536
9536
  e
9537
9537
  )
9538
9538
  );
@@ -9549,12 +9549,12 @@ const AI = (e) => encodeURIComponent(e).replace(
9549
9549
  r = !0, o();
9550
9550
  const c = u instanceof Error ? u : this.reason;
9551
9551
  i.abort(
9552
- c instanceof pe ? c : new ka(c instanceof Error ? c.message : c)
9552
+ c instanceof ge ? c : new ka(c instanceof Error ? c.message : c)
9553
9553
  );
9554
9554
  }
9555
9555
  };
9556
9556
  let a = t && setTimeout(() => {
9557
- a = null, s(new pe(`timeout of ${t}ms exceeded`, pe.ETIMEDOUT));
9557
+ a = null, s(new ge(`timeout of ${t}ms exceeded`, ge.ETIMEDOUT));
9558
9558
  }, t);
9559
9559
  const o = () => {
9560
9560
  e && (a && clearTimeout(a), a = null, e.forEach((u) => {
@@ -9703,9 +9703,9 @@ const wh = "1.16.0", K0 = 64 * 1024, { isFunction: eo } = q, Z0 = (e, ...t) => {
9703
9703
  let C = k && k[b];
9704
9704
  if (C)
9705
9705
  return C.call(k);
9706
- throw new pe(
9706
+ throw new ge(
9707
9707
  `Response type '${b}' is not supported`,
9708
- pe.ERR_NOT_SUPPORT,
9708
+ ge.ERR_NOT_SUPPORT,
9709
9709
  w
9710
9710
  );
9711
9711
  });
@@ -9758,18 +9758,18 @@ const wh = "1.16.0", K0 = 64 * 1024, { isFunction: eo } = q, Z0 = (e, ...t) => {
9758
9758
  let W;
9759
9759
  try {
9760
9760
  if (Y && typeof k == "string" && k.startsWith("data:") && mI(k) > B)
9761
- throw new pe(
9761
+ throw new ge(
9762
9762
  "maxContentLength size of " + B + " exceeded",
9763
- pe.ERR_BAD_RESPONSE,
9763
+ ge.ERR_BAD_RESPONSE,
9764
9764
  b,
9765
9765
  R
9766
9766
  );
9767
9767
  if (G && w !== "get" && w !== "head") {
9768
9768
  const ie = await v(_, C);
9769
9769
  if (typeof ie == "number" && isFinite(ie) && ie > O)
9770
- throw new pe(
9770
+ throw new ge(
9771
9771
  "Request body larger than maxBodyLength limit",
9772
- pe.ERR_BAD_REQUEST,
9772
+ ge.ERR_BAD_REQUEST,
9773
9773
  b,
9774
9774
  R
9775
9775
  );
@@ -9809,9 +9809,9 @@ const wh = "1.16.0", K0 = 64 * 1024, { isFunction: eo } = q, Z0 = (e, ...t) => {
9809
9809
  if (Y) {
9810
9810
  const ie = q.toFiniteNumber(Z.headers.get("content-length"));
9811
9811
  if (ie != null && ie > B)
9812
- throw new pe(
9812
+ throw new ge(
9813
9813
  "maxContentLength size of " + B + " exceeded",
9814
- pe.ERR_BAD_RESPONSE,
9814
+ ge.ERR_BAD_RESPONSE,
9815
9815
  b,
9816
9816
  R
9817
9817
  );
@@ -9829,9 +9829,9 @@ const wh = "1.16.0", K0 = 64 * 1024, { isFunction: eo } = q, Z0 = (e, ...t) => {
9829
9829
  let ae = 0;
9830
9830
  const De = (Pe) => {
9831
9831
  if (Y && (ae = Pe, ae > B))
9832
- throw new pe(
9832
+ throw new ge(
9833
9833
  "maxContentLength size of " + B + " exceeded",
9834
- pe.ERR_BAD_RESPONSE,
9834
+ ge.ERR_BAD_RESPONSE,
9835
9835
  b,
9836
9836
  R
9837
9837
  );
@@ -9852,9 +9852,9 @@ const wh = "1.16.0", K0 = 64 * 1024, { isFunction: eo } = q, Z0 = (e, ...t) => {
9852
9852
  if (Y && !d && !te) {
9853
9853
  let ie;
9854
9854
  if (he != null && (typeof he.byteLength == "number" ? ie = he.byteLength : typeof he.size == "number" ? ie = he.size : typeof he == "string" && (ie = typeof i == "function" ? new i().encode(he).byteLength : he.length)), typeof ie == "number" && ie > B)
9855
- throw new pe(
9855
+ throw new ge(
9856
9856
  "maxContentLength size of " + B + " exceeded",
9857
- pe.ERR_BAD_RESPONSE,
9857
+ ge.ERR_BAD_RESPONSE,
9858
9858
  b,
9859
9859
  R
9860
9860
  );
@@ -9870,14 +9870,14 @@ const wh = "1.16.0", K0 = 64 * 1024, { isFunction: eo } = q, Z0 = (e, ...t) => {
9870
9870
  });
9871
9871
  });
9872
9872
  } catch (T) {
9873
- if (j && j(), $ && $.aborted && $.reason instanceof pe) {
9873
+ if (j && j(), $ && $.aborted && $.reason instanceof ge) {
9874
9874
  const H = $.reason;
9875
9875
  throw H.config = b, R && (H.request = R), T !== H && (H.cause = T), H;
9876
9876
  }
9877
9877
  throw T && T.name === "TypeError" && /Load failed|fetch/i.test(T.message) ? Object.assign(
9878
- new pe(
9878
+ new ge(
9879
9879
  "Network Error",
9880
- pe.ERR_NETWORK,
9880
+ ge.ERR_NETWORK,
9881
9881
  b,
9882
9882
  R,
9883
9883
  T && T.response
@@ -9885,7 +9885,7 @@ const wh = "1.16.0", K0 = 64 * 1024, { isFunction: eo } = q, Z0 = (e, ...t) => {
9885
9885
  {
9886
9886
  cause: T.cause || T
9887
9887
  }
9888
- ) : pe.from(T, T && T.code, b, R, T && T.response);
9888
+ ) : ge.from(T, T && T.code, b, R, T && T.response);
9889
9889
  }
9890
9890
  };
9891
9891
  }, gI = /* @__PURE__ */ new Map(), vy = (e) => {
@@ -9923,7 +9923,7 @@ function vI(e, t) {
9923
9923
  i = e[a];
9924
9924
  let o;
9925
9925
  if (r = i, !bI(i) && (r = kh[(o = String(i)).toLowerCase()], r === void 0))
9926
- throw new pe(`Unknown adapter '${o}'`);
9926
+ throw new ge(`Unknown adapter '${o}'`);
9927
9927
  if (r && (q.isFunction(r) || (r = r.get(t))))
9928
9928
  break;
9929
9929
  s[o || "#" + a] = r;
@@ -9935,7 +9935,7 @@ function vI(e, t) {
9935
9935
  let o = n ? a.length > 1 ? `since :
9936
9936
  ` + a.map($0).join(`
9937
9937
  `) : " " + $0(a[0]) : "as no adapter specified";
9938
- throw new pe(
9938
+ throw new ge(
9939
9939
  "There is no suitable adapter to dispatch the request " + o,
9940
9940
  "ERR_NOT_SUPPORT"
9941
9941
  );
@@ -10000,9 +10000,9 @@ du.transitional = function(t, n, i) {
10000
10000
  }
10001
10001
  return (s, a, o) => {
10002
10002
  if (t === !1)
10003
- throw new pe(
10003
+ throw new ge(
10004
10004
  r(a, " has been removed" + (n ? " in " + n : "")),
10005
- pe.ERR_DEPRECATED
10005
+ ge.ERR_DEPRECATED
10006
10006
  );
10007
10007
  return n && !tp[a] && (tp[a] = !0, console.warn(
10008
10008
  r(
@@ -10017,7 +10017,7 @@ du.spelling = function(t) {
10017
10017
  };
10018
10018
  function yI(e, t, n) {
10019
10019
  if (typeof e != "object")
10020
- throw new pe("options must be an object", pe.ERR_BAD_OPTION_VALUE);
10020
+ throw new ge("options must be an object", ge.ERR_BAD_OPTION_VALUE);
10021
10021
  const i = Object.keys(e);
10022
10022
  let r = i.length;
10023
10023
  for (; r-- > 0; ) {
@@ -10025,14 +10025,14 @@ function yI(e, t, n) {
10025
10025
  if (a) {
10026
10026
  const o = e[s], A = o === void 0 || a(o, s, e);
10027
10027
  if (A !== !0)
10028
- throw new pe(
10028
+ throw new ge(
10029
10029
  "option " + s + " must be " + A,
10030
- pe.ERR_BAD_OPTION_VALUE
10030
+ ge.ERR_BAD_OPTION_VALUE
10031
10031
  );
10032
10032
  continue;
10033
10033
  }
10034
10034
  if (n !== !0)
10035
- throw new pe("Unknown option " + s, pe.ERR_BAD_OPTION);
10035
+ throw new ge("Unknown option " + s, ge.ERR_BAD_OPTION);
10036
10036
  }
10037
10037
  }
10038
10038
  const Oo = {
@@ -10359,7 +10359,7 @@ Ze.CancelToken = wI;
10359
10359
  Ze.isCancel = my;
10360
10360
  Ze.VERSION = wh;
10361
10361
  Ze.toFormData = fu;
10362
- Ze.AxiosError = pe;
10362
+ Ze.AxiosError = ge;
10363
10363
  Ze.Cancel = Ze.CanceledError;
10364
10364
  Ze.all = function(t) {
10365
10365
  return Promise.all(t);
@@ -15425,7 +15425,7 @@ const pw = (e = {}) => {
15425
15425
  s,
15426
15426
  i
15427
15427
  ]);
15428
- return ge(() => {
15428
+ return pe(() => {
15429
15429
  if (!n || typeof window > "u") return;
15430
15430
  const I = (N) => {
15431
15431
  const B = N.data ?? {}, O = N.notification?.title || B.title || "New message", Y = N.notification?.body || B.body || "You have a new message.", G = y(B.jid || ""), X = B.userJid || "", $ = N.messageId || B.msgID || String(Date.now()), R = xy(N), j = document.visibilityState === "visible", W = Date.now(), T = N.messageId || B.msgID || `${G}|${X}|${O}|${Y}`, H = h.current.get(T), Z = N.messageId || B.msgID, te = WI(a, Z), he = !!(H && W - H < 3e4), ie = window._ethoraAppLoadTime || Date.now(), ue = Date.now() - ie < 2e3, V = R ? !1 : !!N.isHistory, fe = jI({
@@ -15462,7 +15462,7 @@ const pw = (e = {}) => {
15462
15462
  }, e.firebaseConfig || o?.pushNotifications?.firebaseConfig)), As.add(I), () => {
15463
15463
  As.delete(I), As.size === 0 && us && (us(), us = null);
15464
15464
  };
15465
- }, [o, n, a, y, D]), ge(() => {
15465
+ }, [o, n, a, y, D]), pe(() => {
15466
15466
  if (!n || typeof window > "u" || !("serviceWorker" in navigator)) return;
15467
15467
  const I = (N) => {
15468
15468
  const B = N?.data;
@@ -15485,7 +15485,7 @@ const pw = (e = {}) => {
15485
15485
  return navigator.serviceWorker.addEventListener("message", I), () => {
15486
15486
  navigator.serviceWorker.removeEventListener("message", I);
15487
15487
  };
15488
- }, [n, P]), ge(() => {
15488
+ }, [n, P]), pe(() => {
15489
15489
  if (!n || typeof window > "u") return;
15490
15490
  const I = new URL(window.location.href);
15491
15491
  if (I.searchParams.get("fromPush") !== "1") return;
@@ -15506,11 +15506,11 @@ const pw = (e = {}) => {
15506
15506
  I.searchParams.delete("fromPush"), window.history.replaceState({}, document.title, I.toString());
15507
15507
  } catch {
15508
15508
  }
15509
- }, [n, P]), ge(() => {
15509
+ }, [n, P]), pe(() => {
15510
15510
  (!r || C.current !== s) && (c.current = !1, l.current = null, d(null), Ad(""), p.current = "", w.current = !1, os = !1, tr = null), C.current = s || "";
15511
- }, [r, s]), ge(() => {
15511
+ }, [r, s]), pe(() => {
15512
15512
  r && (t || c.current || (c.current = !0, x()));
15513
- }, [r, t, x]), ge(() => {
15513
+ }, [r, t, x]), pe(() => {
15514
15514
  if (!n || !r || t || typeof window > "u" || typeof Notification > "u") return;
15515
15515
  const I = () => {
15516
15516
  os || Notification.permission === "granted" && x();
@@ -15518,7 +15518,7 @@ const pw = (e = {}) => {
15518
15518
  return window.addEventListener("focus", I), document.addEventListener("visibilitychange", I), () => {
15519
15519
  window.removeEventListener("focus", I), document.removeEventListener("visibilitychange", I);
15520
15520
  };
15521
- }, [n, t, r, x]), ge(() => {
15521
+ }, [n, t, r, x]), pe(() => {
15522
15522
  if (!n || !f) return;
15523
15523
  const I = Object.keys(a || {}).filter(Boolean).sort(), N = I.map((Y) => `${Y}:${A[Y] || "idle"}`).join(",");
15524
15524
  if (N === p.current)
@@ -19484,10 +19484,10 @@ const aB = (e) => {
19484
19484
  console.error("Reconnection failed:", y);
19485
19485
  })));
19486
19486
  };
19487
- return ge(() => (i && (i.status === "offline" || i.status === "error") && l < 3 && E(), () => {
19488
- }), [i?.status, l]), ge(() => {
19487
+ return pe(() => (i && (i.status === "offline" || i.status === "error") && l < 3 && E(), () => {
19488
+ }), [i?.status, l]), pe(() => {
19489
19489
  K.dispatch(Tv(t));
19490
- }, [t]), ge(() => {
19490
+ }, [t]), pe(() => {
19491
19491
  if (!t?.initBeforeLoad) {
19492
19492
  a("idle");
19493
19493
  return;
@@ -19586,9 +19586,9 @@ const aB = (e) => {
19586
19586
  t?.baseUrl,
19587
19587
  t?.customAppToken,
19588
19588
  t?.appId
19589
- ]), ge(() => {
19589
+ ]), pe(() => {
19590
19590
  t?.initBeforeLoad && i && (i.status === "online" || i.status === "connecting") && a("ready");
19591
- }, [i, i?.status, t?.initBeforeLoad]), ge(() => {
19591
+ }, [i, i?.status, t?.initBeforeLoad]), pe(() => {
19592
19592
  if (typeof window > "u")
19593
19593
  return;
19594
19594
  const y = () => {
@@ -22550,7 +22550,7 @@ const sP = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
22550
22550
  return e.__ethoraLoaderStats || (e.__ethoraLoaderStats = {}), e.__ethoraLoaderStats;
22551
22551
  }, Dn = (e, t) => {
22552
22552
  const n = be(!1);
22553
- ge(() => {
22553
+ pe(() => {
22554
22554
  const i = pg();
22555
22555
  i[e] || (i[e] = {
22556
22556
  count: 0,
@@ -22570,7 +22570,7 @@ const sP = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
22570
22570
  });
22571
22571
  }
22572
22572
  n.current = t;
22573
- }, [e, t]), ge(() => () => {
22573
+ }, [e, t]), pe(() => () => {
22574
22574
  if (!n.current) return;
22575
22575
  const r = pg()[e];
22576
22576
  if (!r) return;
@@ -22642,16 +22642,16 @@ const sP = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
22642
22642
  fe !== void 0 ? V.scrollTop = fe : V.scrollTop = V.scrollHeight;
22643
22643
  }
22644
22644
  }, [n, D, R]);
22645
- ge(() => {
22645
+ pe(() => {
22646
22646
  D.length > 0 && k(
22647
22647
  new Date(D[D.length - 1].date).getTime()
22648
22648
  );
22649
- }, []), ge(() => {
22649
+ }, []), pe(() => {
22650
22650
  if (P) return;
22651
22651
  new Date(
22652
22652
  D[D.length - 1]?.date
22653
22653
  )?.getTime() > b && v((fe) => fe += 1);
22654
- }, [D.length]), ge(() => {
22654
+ }, [D.length]), pe(() => {
22655
22655
  j();
22656
22656
  }, [n]);
22657
22657
  const W = de(() => {
@@ -22682,12 +22682,12 @@ const sP = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
22682
22682
  H();
22683
22683
  }, 50));
22684
22684
  };
22685
- ge(() => {
22685
+ pe(() => {
22686
22686
  const V = _.current;
22687
22687
  return V && V.addEventListener("scroll", Z, !0), () => {
22688
22688
  V && V.removeEventListener("scroll", Z, !0);
22689
22689
  };
22690
- }, []), ge(() => {
22690
+ }, []), pe(() => {
22691
22691
  if (D.length > 30) {
22692
22692
  const V = x.current;
22693
22693
  if (V && O.current) {
@@ -22696,12 +22696,12 @@ const sP = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
22696
22696
  }
22697
22697
  O.current = null;
22698
22698
  }
22699
- }, [D.length, u]), ge(() => {
22699
+ }, [D.length, u]), pe(() => {
22700
22700
  if (c.length > 0) {
22701
22701
  const V = c[c.length - 1], fe = V && P;
22702
22702
  V && V.id !== C.current && fe && (C.current = V.id, T());
22703
22703
  }
22704
- }, [c, P]), ge(() => {
22704
+ }, [c, P]), pe(() => {
22705
22705
  if (!x.current) return;
22706
22706
  const fe = D.length > w.current, ae = l?.length > 0 && !X.current;
22707
22707
  X.current = l?.length > 0, G.current || (fe || ae) && R().then(() => {
@@ -38347,7 +38347,7 @@ const D4 = ({ text: e }) => e ? /* @__PURE__ */ g(
38347
38347
  },
38348
38348
  [X]
38349
38349
  );
38350
- ge(() => {
38350
+ pe(() => {
38351
38351
  b(s), s && X(s);
38352
38352
  }, [s, X]);
38353
38353
  const R = d || e, j = h || t, W = de(
@@ -38611,7 +38611,7 @@ const D4 = ({ text: e }) => e ? /* @__PURE__ */ g(
38611
38611
  }, l = (f) => {
38612
38612
  o(!!f.target.value);
38613
38613
  };
38614
- return ge(() => {
38614
+ return pe(() => {
38615
38615
  if (r && t) {
38616
38616
  const f = setTimeout(() => {
38617
38617
  A.current?.focus();
@@ -38658,7 +38658,7 @@ const D4 = ({ text: e }) => e ? /* @__PURE__ */ g(
38658
38658
  const [r, s] = le(!1), a = be(null), o = be(null), A = n === "right" ? { top: "60px", right: "-140px" } : { top: "60px", right: "0px" }, u = (c) => {
38659
38659
  c.preventDefault(), s((l) => !l);
38660
38660
  };
38661
- return ge(() => {
38661
+ return pe(() => {
38662
38662
  const c = (l) => {
38663
38663
  a.current && !a.current.contains(l.target) && o.current && !o.current.contains(l.target) && s(!1);
38664
38664
  };
@@ -39076,7 +39076,7 @@ const qi = ({
39076
39076
  ), p = (v) => {
39077
39077
  l.current && !l.current.contains(v.target) && a(!1);
39078
39078
  };
39079
- return ge(() => (s ? document.addEventListener("mousedown", p) : document.removeEventListener("mousedown", p), () => {
39079
+ return pe(() => (s ? document.addEventListener("mousedown", p) : document.removeEventListener("mousedown", p), () => {
39080
39080
  document.removeEventListener("mousedown", p);
39081
39081
  }), [s]), /* @__PURE__ */ U(tG, { ref: l, children: [
39082
39082
  /* @__PURE__ */ U(
@@ -39155,9 +39155,9 @@ const F4 = ({
39155
39155
  }, 100),
39156
39156
  [s]
39157
39157
  );
39158
- return ge(() => {
39158
+ return pe(() => {
39159
39159
  l(a);
39160
- }, [a, l]), ge(() => {
39160
+ }, [a, l]), pe(() => {
39161
39161
  u(Object.values(s));
39162
39162
  }, [s]), /* @__PURE__ */ U("div", { style: { maxHeight: "100px", ...e }, children: [
39163
39163
  i ? /* @__PURE__ */ g(Mr, { children: "Select Users (max 20)" }) : /* @__PURE__ */ g("div", { style: { fontSize: "14px", fontWeight: 600 }, children: "Select Users (max 20)" }),
@@ -41094,7 +41094,7 @@ const jG = /* @__PURE__ */ ci(UG), WG = Q.div`
41094
41094
  setVisible: n
41095
41095
  }) => {
41096
41096
  const { config: i } = St();
41097
- return ge(() => {
41097
+ return pe(() => {
41098
41098
  const { overflow: r } = document.body.style;
41099
41099
  return e && (document.body.style.overflow = "hidden"), () => {
41100
41100
  document.body.style.overflow = r;
@@ -42171,11 +42171,11 @@ const Jb = Q.div`
42171
42171
  ), r = (f) => t(An(f)), [s, a] = le(n?.isProfileOpen), [o, A] = le(n?.isAssetsOpen), [u, c] = le(null), l = (f, d) => {
42172
42172
  c({ message: f, type: d }), setTimeout(() => c(null), 3e3);
42173
42173
  };
42174
- return ge(() => {
42174
+ return pe(() => {
42175
42175
  s !== n.isProfileOpen && zp({ isProfileOpen: s }).then(({ data: f }) => {
42176
42176
  r(f.user), l("Saved", "success");
42177
42177
  }).catch(() => l("Error", "error"));
42178
- }, [s]), ge(() => {
42178
+ }, [s]), pe(() => {
42179
42179
  o !== n?.isAssetsOpen && zp({ isAssetsOpen: o }).then(({ data: f }) => {
42180
42180
  r(f.user), l("Saved", "success");
42181
42181
  }).catch(() => l("Error", "error"));
@@ -43121,7 +43121,7 @@ const Jb = Q.div`
43121
43121
  isSmallScreen: i
43122
43122
  }) => {
43123
43123
  const { client: r, setClient: s } = Lt(), [a, o] = le(!1), [A, u] = le(""), c = Fe(), { config: l } = St(), { activeRoomJID: f } = we((E) => E.rooms), d = be(null);
43124
- ge(() => {
43124
+ pe(() => {
43125
43125
  const E = (e || []).filter((y) => !Zb(y)).map(Yz).filter(Boolean);
43126
43126
  if (E.length && (E.forEach((y) => {
43127
43127
  c(au({ jid: y }));
@@ -43159,7 +43159,7 @@ const Jb = Q.div`
43159
43159
  }
43160
43160
  return y.get(E) || [];
43161
43161
  }, [e, A]);
43162
- ge(() => {
43162
+ pe(() => {
43163
43163
  if (t)
43164
43164
  return document.addEventListener("mousedown", h), () => {
43165
43165
  document.removeEventListener("mousedown", h);
@@ -43580,7 +43580,7 @@ const $4 = ({
43580
43580
  ] })
43581
43581
  ] }), aq = (e, t, n) => {
43582
43582
  const i = Fe();
43583
- ge(() => {
43583
+ pe(() => {
43584
43584
  if (!(typeof window > "u")) {
43585
43585
  if (n?.setRoomJidInPath && e && typeof e == "string") {
43586
43586
  const r = e.split("@")[0], s = new URLSearchParams(window.location.search);
@@ -43716,11 +43716,11 @@ const lq = (e) => {
43716
43716
  },
43717
43717
  [v, k, b, n, o]
43718
43718
  );
43719
- ge(() => () => {
43719
+ pe(() => () => {
43720
43720
  l.current.forEach((I) => clearTimeout(I)), l.current.clear(), f.current.clear();
43721
- }, []), ge(() => {
43721
+ }, []), pe(() => {
43722
43722
  v()?.enabled || (l.current.forEach((N) => clearTimeout(N)), l.current.clear(), f.current.clear(), p(/* @__PURE__ */ new Set()));
43723
- }, [v]), ge(() => {
43723
+ }, [v]), pe(() => {
43724
43724
  v()?.enabled && Object.keys(c || {}).forEach((N) => {
43725
43725
  if (!h.has(N)) return;
43726
43726
  const B = c[N];
@@ -44172,7 +44172,7 @@ const lq = (e) => {
44172
44172
  t && (t.scrollIntoView({ behavior: "smooth", block: "center" }), t.classList.add("message-highlight"), setTimeout(() => t.classList.remove("message-highlight"), 2e3));
44173
44173
  }, pq = (e, t, n, i) => {
44174
44174
  const { client: r } = Lt(), s = Fe(), a = n6();
44175
- ge(() => {
44175
+ pe(() => {
44176
44176
  r && e && (r.setActiveRoomJid(e), r.promoteRoomHistory(e), r.presenceInRoomStanza(
44177
44177
  e,
44178
44178
  0,
@@ -44187,7 +44187,7 @@ const lq = (e) => {
44187
44187
  } catch {
44188
44188
  }
44189
44189
  })), r && !e && r.setActiveRoomJid(null);
44190
- }, [r, e]), ge(() => {
44190
+ }, [r, e]), pe(() => {
44191
44191
  const o = t?.[e], A = !!e && !fq(o), u = async () => {
44192
44192
  if (!r || !e) return;
44193
44193
  await r.presenceInRoomStanza(e, 0, a2, !0).catch(() => !1) || r.prioritizeRoomPresence(e).catch(() => {
@@ -44271,7 +44271,7 @@ const lq = (e) => {
44271
44271
  !1
44272
44272
  );
44273
44273
  }, [n]);
44274
- return ge(() => {
44274
+ return pe(() => {
44275
44275
  const a = setTimeout(() => {
44276
44276
  s();
44277
44277
  }, 100);
@@ -44316,7 +44316,7 @@ const lq = (e) => {
44316
44316
  ), x = () => {
44317
44317
  a(ui({ isEdit: !1 }));
44318
44318
  };
44319
- ge(() => {
44319
+ pe(() => {
44320
44320
  const W = Date.now();
44321
44321
  return a(
44322
44322
  Yf({
@@ -45734,7 +45734,7 @@ const Nq = ({ src: e }) => {
45734
45734
  const t = we(
45735
45735
  (c) => c.chatSettingStore.config
45736
45736
  ), n = be(null), i = be(null), [r, s] = le(!1), [a, o] = le(1);
45737
- ge(() => (i.current = fa.create({
45737
+ pe(() => (i.current = fa.create({
45738
45738
  container: n.current,
45739
45739
  waveColor: "#C4C4C4",
45740
45740
  progressColor: t?.colors?.primary || "#0052CD",
@@ -48831,7 +48831,7 @@ button {
48831
48831
  `;
48832
48832
  function B6(e) {
48833
48833
  const t = be(null), n = be(null);
48834
- return n.current && n.current.update(e), ge(() => (n.current = new N1({
48834
+ return n.current && n.current.update(e), pe(() => (n.current = new N1({
48835
48835
  ...e,
48836
48836
  ref: t
48837
48837
  }), () => {
@@ -48955,7 +48955,7 @@ const kV = Q.div`
48955
48955
  let N = S, B = D;
48956
48956
  return S + 320 > _ && (N = _ - 320 - 10), D + 435 > I && (B = I - 435 - 10), { adjustedX: N, adjustedY: B };
48957
48957
  };
48958
- return ge(() => {
48958
+ return pe(() => {
48959
48959
  if (typeof window > "u" || !i)
48960
48960
  return;
48961
48961
  const S = () => {
@@ -49306,7 +49306,7 @@ const kV = Q.div`
49306
49306
  }
49307
49307
  `, GV = ({ url: e }) => {
49308
49308
  const [t, n] = le(null), [i, r] = le(!0), [s, a] = le(null);
49309
- if (ge(() => {
49309
+ if (pe(() => {
49310
49310
  const A = async () => {
49311
49311
  r(!0), a(null), n(null);
49312
49312
  try {
@@ -49353,7 +49353,7 @@ const kV = Q.div`
49353
49353
  y: 0
49354
49354
  }
49355
49355
  ), [k, w] = le(null);
49356
- ge(() => {
49356
+ pe(() => {
49357
49357
  if (e && e.body && typeof e.body == "string") {
49358
49358
  const B = e.body.match(qV);
49359
49359
  w(B ? B[0] : null);
@@ -50143,9 +50143,9 @@ const kV = Q.div`
50143
50143
  }
50144
50144
  }, iJ = (e, t) => {
50145
50145
  const [n, i] = le(!1);
50146
- return ge(() => {
50146
+ return pe(() => {
50147
50147
  typeof window < "u" && nJ();
50148
- }, []), ge(() => {
50148
+ }, []), pe(() => {
50149
50149
  if (!(typeof window > "u" || typeof localStorage > "u"))
50150
50150
  try {
50151
50151
  const r = localStorage.getItem(qd);
@@ -50526,9 +50526,9 @@ const lJ = ({
50526
50526
  }
50527
50527
  })();
50528
50528
  };
50529
- ge(() => () => {
50529
+ pe(() => () => {
50530
50530
  b && P.xmppPassword === "" && (ee.log("closing client"), b.close(), w(null));
50531
- }, [b, w, P.xmppPassword]), ge(() => {
50531
+ }, [b, w, P.xmppPassword]), pe(() => {
50532
50532
  i(Tv(n));
50533
50533
  const { changed: T } = Zw(n);
50534
50534
  T && (f.current = !1, d.current.clear(), h.current.clear(), p.current.clear(), i(fh()), i(Lv()), i(Ke({ roomJID: null })), dr.pause(), dr.purge().catch((H) => {
@@ -50569,7 +50569,7 @@ const lJ = ({
50569
50569
  }
50570
50570
  D && H.includes(D);
50571
50571
  }, [D, i, j, e]);
50572
- return ge(() => {
50572
+ return pe(() => {
50573
50573
  let T;
50574
50574
  const H = async () => {
50575
50575
  n?.translates?.enabled && !n?.translates?.translations && i(Sv(n?.translates?.translations));
@@ -50660,11 +50660,13 @@ const lJ = ({
50660
50660
  n?.initBeforeLoad,
50661
50661
  E,
50662
50662
  C
50663
- ]), ge(() => {
50663
+ ]), pe(() => {
50664
50664
  b && x.current["initClient:wait_online:start"] && b.status === "online" && N("initClient:wait_online", "initClient:wait_online:start");
50665
- }, [b?.status]), ge(() => {
50665
+ }, [b?.status]), pe(() => {
50666
50666
  W(Object.values(S));
50667
- }, [S, D, W]), {
50667
+ }, [S, D, W]), pe(() => () => {
50668
+ i(Ke({ roomJID: null }));
50669
+ }, [i]), {
50668
50670
  client: b,
50669
50671
  inited: r,
50670
50672
  isRetrying: c,
@@ -50734,7 +50736,7 @@ const lJ = ({
50734
50736
  (T) => p(Ke(T)),
50735
50737
  h
50736
50738
  );
50737
- ge(() => {
50739
+ pe(() => {
50738
50740
  if (typeof window > "u")
50739
50741
  return;
50740
50742
  const T = () => {
@@ -50775,7 +50777,7 @@ const lJ = ({
50775
50777
  wasAutoSelected: v,
50776
50778
  config: t
50777
50779
  }), G = Object.keys(k || {}).length > 0, $ = (I || !!_ && !Y && G) && !(C && !G), R = Y && !I, j = !!(t?.enableRoomsRetry?.enabled && N && N !== "norooms"), W = !B && !R && !j && s.xmppPassword !== "" && s.xmppUsername !== "" && f && !$;
50778
- return Dn("chat-wrapper-connecting-loader", R), Dn("chat-wrapper-retry-loader", j), Dn("chat-wrapper-startup-loader", W), ge(() => {
50780
+ return Dn("chat-wrapper-connecting-loader", R), Dn("chat-wrapper-retry-loader", j), Dn("chat-wrapper-startup-loader", W), pe(() => {
50779
50781
  if (typeof window > "u") return;
50780
50782
  const T = window.location.pathname, H = () => {
50781
50783
  const te = window.location.pathname === T;
@@ -50933,7 +50935,7 @@ const lJ = ({
50933
50935
  return console.error("Login failed:", A), null;
50934
50936
  }
50935
50937
  }, [e?.user?.email, e?.user?.password]), o = Fe();
50936
- return ge(() => {
50938
+ return pe(() => {
50937
50939
  let A = !1;
50938
50940
  return (async () => {
50939
50941
  i?.baseUrl && Eh(i.baseUrl, i.customAppToken);
@@ -51310,7 +51312,7 @@ const wJ = Ct`
51310
51312
  ] });
51311
51313
  }, QJ = () => {
51312
51314
  const [e, t] = le(() => typeof document > "u" ? !1 : !document.hidden);
51313
- return ge(() => {
51315
+ return pe(() => {
51314
51316
  if (typeof document > "u")
51315
51317
  return;
51316
51318
  const n = () => {
@@ -51363,20 +51365,20 @@ const UJ = JA(void 0), jJ = 3, WJ = 3e4, YJ = ({ children: e, config: t }) => {
51363
51365
  (N) => N.filter((B) => I - B.timestamp < f)
51364
51366
  );
51365
51367
  }, [f]);
51366
- ge(() => {
51368
+ pe(() => {
51367
51369
  const I = setInterval(() => {
51368
51370
  r && y();
51369
51371
  }, 1e3);
51370
51372
  return () => clearInterval(I);
51371
- }, [r, y]), ge(() => {
51373
+ }, [r, y]), pe(() => {
51372
51374
  r && y();
51373
51375
  }, [r, y]);
51374
51376
  const S = de((I) => {
51375
51377
  I && i((N) => N.filter((B) => B.roomJID !== I));
51376
51378
  }, []);
51377
- ge(() => {
51379
+ pe(() => {
51378
51380
  a && S(a);
51379
- }, [a, S]), ge(() => {
51381
+ }, [a, S]), pe(() => {
51380
51382
  c && typeof window < "u" && "Notification" in window && Notification.permission === "default" && Notification.requestPermission();
51381
51383
  }, [c]);
51382
51384
  const D = de(() => {
@@ -51450,7 +51452,7 @@ const UJ = JA(void 0), jJ = 3, WJ = 3e4, YJ = ({ children: e, config: t }) => {
51450
51452
  },
51451
51453
  [A, c, r, x, P]
51452
51454
  );
51453
- return ge(() => {
51455
+ return pe(() => {
51454
51456
  if (!c) return;
51455
51457
  const I = wA.addCallback(
51456
51458
  _
@@ -51499,7 +51501,7 @@ const UJ = JA(void 0), jJ = 3, WJ = 3e4, YJ = ({ children: e, config: t }) => {
51499
51501
  ] });
51500
51502
  }, GJ = () => {
51501
51503
  const e = Fe();
51502
- return ge(() => () => {
51504
+ return pe(() => () => {
51503
51505
  }, []), {
51504
51506
  navigateToMessage: (t, n) => {
51505
51507
  e(Ke({ roomJID: t })), setTimeout(() => {
@@ -51587,7 +51589,7 @@ const UJ = JA(void 0), jJ = 3, WJ = 3e4, YJ = ({ children: e, config: t }) => {
51587
51589
  ), n = be(
51588
51590
  Q2(K.getState().rooms.rooms)
51589
51591
  );
51590
- return ge(() => K.subscribe(() => {
51592
+ return pe(() => K.subscribe(() => {
51591
51593
  const r = K.getState().rooms.rooms, s = Q2(r);
51592
51594
  n.current !== s && (n.current = s, t(F2(r)));
51593
51595
  }), []), Ve(() => e, [e]);