@nethesis/chat-island 0.1.1 → 0.1.3

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/index.js CHANGED
@@ -296,7 +296,7 @@ var D = /* @__PURE__ */ y(((e) => {
296
296
  return a;
297
297
  }
298
298
  t.exports = i;
299
- })), te = /* @__PURE__ */ y(((e, t) => {
299
+ })), k = /* @__PURE__ */ y(((e, t) => {
300
300
  var n = typeof Reflect == "object" ? Reflect : null, r = n && typeof n.apply == "function" ? n.apply : function(e, t, n) {
301
301
  return Function.prototype.apply.call(e, t, n);
302
302
  }, i = n && typeof n.ownKeys == "function" ? n.ownKeys : Object.getOwnPropertySymbols ? function(e) {
@@ -471,8 +471,8 @@ var D = /* @__PURE__ */ y(((e) => {
471
471
  });
472
472
  else throw TypeError("The \"emitter\" argument must be of type EventEmitter. Received type " + typeof e);
473
473
  }
474
- })), ne = /* @__PURE__ */ y(((e, t) => {
475
- var n = te(), r = D(), i = 0, a = 1, o = 2, s = 3, c = 4, l = 5, u = 6, d = 7, f = 8, p = 9, m = 10;
474
+ })), te = /* @__PURE__ */ y(((e, t) => {
475
+ var n = k(), r = D(), i = 0, a = 1, o = 2, s = 3, c = 4, l = 5, u = 6, d = 7, f = 8, p = 9, m = 10;
476
476
  t.exports = class extends n.EventEmitter {
477
477
  constructor() {
478
478
  super();
@@ -565,14 +565,14 @@ var D = /* @__PURE__ */ y(((e) => {
565
565
  e && this.write(e), this.write = function() {};
566
566
  }
567
567
  };
568
- })), k = D(), A = /* @__PURE__ */ x(O(), 1), re = /* @__PURE__ */ x(ee(), 1), j = te(), ie = /* @__PURE__ */ x(ne(), 1), ae = class extends Error {
568
+ })), A = D(), j = /* @__PURE__ */ x(O(), 1), ne = /* @__PURE__ */ x(ee(), 1), M = k(), re = /* @__PURE__ */ x(te(), 1), ie = class extends Error {
569
569
  constructor(e) {
570
570
  super(e), this.name = "TimeoutError";
571
571
  }
572
572
  };
573
573
  //#endregion
574
574
  //#region node_modules/@xmpp/events/lib/delay.js
575
- function oe(e) {
575
+ function ae(e) {
576
576
  let t, n = new Promise((n) => {
577
577
  t = setTimeout(n, e);
578
578
  });
@@ -580,32 +580,32 @@ function oe(e) {
580
580
  }
581
581
  //#endregion
582
582
  //#region node_modules/@xmpp/events/lib/timeout.js
583
- function se(e, t) {
584
- let n = oe(t);
583
+ function oe(e, t) {
584
+ let n = ae(t);
585
585
  function r() {
586
586
  clearTimeout(n.timeout);
587
587
  }
588
- let i = new ae();
588
+ let i = new ie();
589
589
  return Promise.race([e.finally(r), n.then(() => {
590
590
  throw i;
591
591
  })]);
592
592
  }
593
593
  //#endregion
594
594
  //#region node_modules/@xmpp/events/lib/onoff.js
595
- var ce = /* @__PURE__ */ new WeakMap();
596
- function le(e) {
597
- let t = ce.get(e);
595
+ var se = /* @__PURE__ */ new WeakMap();
596
+ function ce(e) {
597
+ let t = se.get(e);
598
598
  return t || (t = {
599
599
  on: (e.addEventListener ?? e.addListener).bind(e),
600
600
  off: (e.removeEventListener ?? e.removeListener).bind(e),
601
601
  once: (e.once ?? ((t, n) => e.addEventListener(t, n, { once: !0 }))).bind(e)
602
- }, ce.set(e, t)), t;
602
+ }, se.set(e, t)), t;
603
603
  }
604
604
  //#endregion
605
605
  //#region node_modules/@xmpp/events/lib/promise.js
606
- function M(e, t, n = "error", r) {
606
+ function N(e, t, n = "error", r) {
607
607
  return new Promise((i, a) => {
608
- let o, { off: s, once: c } = le(e), l = () => {
608
+ let o, { off: s, once: c } = ce(e), l = () => {
609
609
  clearTimeout(o), s(t, d), s(n, u);
610
610
  };
611
611
  function u(e) {
@@ -615,7 +615,7 @@ function M(e, t, n = "error", r) {
615
615
  i(e), l();
616
616
  }
617
617
  if (c(t, d), n && c(n, u), r) {
618
- let e = new ae();
618
+ let e = new ie();
619
619
  o = setTimeout(() => {
620
620
  l(), a(e);
621
621
  }, r);
@@ -624,14 +624,14 @@ function M(e, t, n = "error", r) {
624
624
  }
625
625
  //#endregion
626
626
  //#region node_modules/@xmpp/events/lib/Deferred.js
627
- function ue() {
627
+ function le() {
628
628
  this.promise = new Promise((e, t) => {
629
629
  this.resolve = e, this.reject = t;
630
630
  });
631
631
  }
632
632
  //#endregion
633
633
  //#region node_modules/@xmpp/events/lib/procedure.js
634
- function de(e, t = null, n) {
634
+ function ue(e, t = null, n) {
635
635
  return new Promise((r, i) => {
636
636
  function a(t) {
637
637
  e.removeListener("nonza", s), i(t);
@@ -651,38 +651,38 @@ function de(e, t = null, n) {
651
651
  }
652
652
  //#endregion
653
653
  //#region node_modules/@xmpp/events/lib/listeners.js
654
- function fe(e) {
654
+ function de(e) {
655
655
  return {
656
656
  subscribe(t) {
657
- let { on: n } = le(t);
657
+ let { on: n } = ce(t);
658
658
  for (let [t, r] of Object.entries(e)) n(t, r);
659
659
  },
660
660
  unsubscribe(t) {
661
- let { off: n } = le(t);
661
+ let { off: n } = ce(t);
662
662
  for (let [t, r] of Object.entries(e)) n(t, r);
663
663
  }
664
664
  };
665
665
  }
666
666
  //#endregion
667
667
  //#region node_modules/@xmpp/xml/lib/XMLError.js
668
- var N = class extends Error {
668
+ var fe = class extends Error {
669
669
  constructor(...e) {
670
670
  super(...e), this.name = "XMLError";
671
671
  }
672
- }, pe = class extends j.EventEmitter {
672
+ }, pe = class extends M.EventEmitter {
673
673
  constructor() {
674
674
  super();
675
- let e = new ie.default();
675
+ let e = new re.default();
676
676
  this.root = null, this.cursor = null, e.on("startElement", this.onStartElement.bind(this)), e.on("endElement", this.onEndElement.bind(this)), e.on("text", this.onText.bind(this)), this.parser = e;
677
677
  }
678
678
  onStartElement(e, t) {
679
- let n = new A.default(e, t), { root: r, cursor: i } = this;
679
+ let n = new j.default(e, t), { root: r, cursor: i } = this;
680
680
  r ? i !== r && i.append(n) : (this.root = n, this.emit("start", n)), this.cursor = n;
681
681
  }
682
682
  onEndElement(e) {
683
683
  let { root: t, cursor: n } = this;
684
684
  if (e !== n.name) {
685
- this.emit("error", new N(`${n.name} must be closed.`));
685
+ this.emit("error", new fe(`${n.name} must be closed.`));
686
686
  return;
687
687
  }
688
688
  if (n === t) {
@@ -698,7 +698,7 @@ var N = class extends Error {
698
698
  onText(e) {
699
699
  let { cursor: t } = this;
700
700
  if (!t) {
701
- this.emit("error", new N(`${e} must be a child.`));
701
+ this.emit("error", new fe(`${e} must be a child.`));
702
702
  return;
703
703
  }
704
704
  t.t(e);
@@ -710,21 +710,21 @@ var N = class extends Error {
710
710
  e && this.parser.write(e);
711
711
  }
712
712
  };
713
- pe.XMLError = N;
713
+ pe.XMLError = fe;
714
714
  //#endregion
715
715
  //#region node_modules/@xmpp/xml/index.js
716
716
  function P(...e) {
717
- return (0, re.default)(...e);
717
+ return (0, ne.default)(...e);
718
718
  }
719
719
  Object.assign(P, {
720
- Element: A.default,
721
- createElement: re.default,
720
+ Element: j.default,
721
+ createElement: ne.default,
722
722
  Parser: pe,
723
- escapeXML: k.escapeXML,
724
- unescapeXML: k.unescapeXML,
725
- escapeXMLText: k.escapeXMLText,
726
- unescapeXMLText: k.unescapeXMLText,
727
- XMLError: N,
723
+ escapeXML: A.escapeXML,
724
+ unescapeXML: A.unescapeXML,
725
+ escapeXMLText: A.escapeXMLText,
726
+ unescapeXMLText: A.unescapeXMLText,
727
+ XMLError: fe,
728
728
  xml: P
729
729
  });
730
730
  //#endregion
@@ -808,7 +808,7 @@ var I = ye.bind();
808
808
  I.jid = ye, I.JID = F, I.parse = _e, I.equal = ve, I.detectEscape = me, I.escapeLocal = he, I.unescapeLocal = ge;
809
809
  //#endregion
810
810
  //#region node_modules/@xmpp/error/index.js
811
- var be = class extends Error {
811
+ var L = class extends Error {
812
812
  constructor(e, t, n) {
813
813
  super(e + (t ? ` - ${t}` : "")), this.name = "XMPPError", this.condition = e, this.text = t, this.application = n;
814
814
  }
@@ -818,14 +818,14 @@ var be = class extends Error {
818
818
  let o = new this(t.name, i ? i.text() : "", a);
819
819
  return o.element = e, o;
820
820
  }
821
- }, xe = class extends be {
821
+ }, be = class extends L {
822
822
  constructor(...e) {
823
823
  super(...e), this.name = "StreamError";
824
824
  }
825
825
  };
826
826
  //#endregion
827
827
  //#region node_modules/@xmpp/connection/lib/util.js
828
- function Se(e) {
828
+ function xe(e) {
829
829
  let { port: t, hostname: n, protocol: r } = new URL(e);
830
830
  return n === "[::1]" && (n = "::1"), {
831
831
  port: t,
@@ -833,19 +833,19 @@ function Se(e) {
833
833
  protocol: r
834
834
  };
835
835
  }
836
- function Ce(e) {
837
- let { port: t, hostname: n } = Se(`http://${e}`);
836
+ function Se(e) {
837
+ let { port: t, hostname: n } = xe(`http://${e}`);
838
838
  return {
839
839
  port: t,
840
840
  hostname: n
841
841
  };
842
842
  }
843
- function we(e) {
844
- return e.includes("://") ? Se(e) : Ce(e);
843
+ function Ce(e) {
844
+ return e.includes("://") ? xe(e) : Se(e);
845
845
  }
846
846
  //#endregion
847
847
  //#region node_modules/@xmpp/connection/index.js
848
- var Te = "urn:ietf:params:xml:ns:xmpp-streams", Ee = "http://etherx.jabber.org/streams", De = class extends j.EventEmitter {
848
+ var we = "urn:ietf:params:xml:ns:xmpp-streams", Te = "http://etherx.jabber.org/streams", R = class extends M.EventEmitter {
849
849
  #e = null;
850
850
  #t = null;
851
851
  constructor(e = {}) {
@@ -856,7 +856,7 @@ var Te = "urn:ietf:params:xml:ns:xmpp-streams", Ee = "http://etherx.jabber.org/s
856
856
  }
857
857
  async _streamError(e, t) {
858
858
  try {
859
- await this.send(P("stream:error", {}, [P(e, { xmlns: Te }, t)]));
859
+ await this.send(P("stream:error", {}, [P(e, { xmlns: we }, t)]));
860
860
  } catch {}
861
861
  return this.disconnect();
862
862
  }
@@ -880,7 +880,7 @@ var Te = "urn:ietf:params:xml:ns:xmpp-streams", Ee = "http://etherx.jabber.org/s
880
880
  });
881
881
  }
882
882
  _attachSocket(e) {
883
- this.socket = e, this.#e ??= fe({
883
+ this.socket = e, this.#e ??= de({
884
884
  data: this._onData.bind(this),
885
885
  close: this.#r.bind(this),
886
886
  connect: () => this._status("connect"),
@@ -891,19 +891,19 @@ var Te = "urn:ietf:params:xml:ns:xmpp-streams", Ee = "http://etherx.jabber.org/s
891
891
  this.socket && this.#e?.unsubscribe(this.socket), this.socket = null;
892
892
  }
893
893
  _onElement(e) {
894
- let t = e.is("error", Ee);
894
+ let t = e.is("error", Te);
895
895
  t && this._onStreamError(e), this.emit("element", e), this.emit(this.isStanza(e) ? "stanza" : "nonza", e), t && this.disconnect();
896
896
  }
897
897
  _onStreamError(e) {
898
- let t = xe.fromElement(e);
898
+ let t = be.fromElement(e);
899
899
  if (t.condition === "see-other-host") return this._onSeeOtherHost(t);
900
900
  this.emit("error", t);
901
901
  }
902
902
  async _onSeeOtherHost(e) {
903
- let { protocol: t } = we(this.options.service), n = e.element.getChildText("see-other-host"), { port: r } = Ce(n), i;
903
+ let { protocol: t } = Ce(this.options.service), n = e.element.getChildText("see-other-host"), { port: r } = Se(n), i;
904
904
  i = r ? `${t || "xmpp:"}//${n}` : (t ? `${t}//` : "") + n;
905
905
  try {
906
- await M(this, "disconnect");
906
+ await N(this, "disconnect");
907
907
  let { domain: e, lang: t } = this.options;
908
908
  await this.connect(i), await this.open({
909
909
  domain: e,
@@ -914,7 +914,7 @@ var Te = "urn:ietf:params:xml:ns:xmpp-streams", Ee = "http://etherx.jabber.org/s
914
914
  }
915
915
  }
916
916
  _attachParser(e) {
917
- this.parser = e, this.#t ??= fe({
917
+ this.parser = e, this.#t ??= de({
918
918
  element: this._onElement.bind(this),
919
919
  error: this.#n.bind(this),
920
920
  end: this.#i.bind(this),
@@ -951,7 +951,7 @@ var Te = "urn:ietf:params:xml:ns:xmpp-streams", Ee = "http://etherx.jabber.org/s
951
951
  if (this.status !== "offline") throw Error("Connection is not offline");
952
952
  let { service: e, domain: t, lang: n } = this.options;
953
953
  await this.connect(e);
954
- let r = M(this, "online");
954
+ let r = N(this, "online");
955
955
  return await this.open({
956
956
  domain: t,
957
957
  lang: n
@@ -960,15 +960,15 @@ var Te = "urn:ietf:params:xml:ns:xmpp-streams", Ee = "http://etherx.jabber.org/s
960
960
  async connect(e) {
961
961
  this._status("connecting", e);
962
962
  let t = new this.Socket();
963
- return this._attachSocket(t), t.connect(this.socketParameters(e)), M(t, "connect");
963
+ return this._attachSocket(t), t.connect(this.socketParameters(e)), N(t, "connect");
964
964
  }
965
965
  async _closeSocket(e = this.timeout) {
966
- this._status("disconnecting"), this.socket.end(), await M(this.socket, "close", "error", e);
966
+ this._status("disconnecting"), this.socket.end(), await N(this.socket, "close", "error", e);
967
967
  }
968
968
  async open(e) {
969
969
  this._status("opening");
970
970
  let { domain: t, lang: n } = e, r = this.headerElement();
971
- return r.attrs.to = t, r.attrs["xml:lang"] = n, this.root = r, this._attachParser(new this.Parser()), await this.write(this.header(r)), M(this, "open", "error", this.timeout);
971
+ return r.attrs.to = t, r.attrs["xml:lang"] = n, this.root = r, this._attachParser(new this.Parser()), await this.write(this.header(r)), N(this, "open", "error", this.timeout);
972
972
  }
973
973
  async stop() {
974
974
  let e = await this.disconnect();
@@ -977,7 +977,7 @@ var Te = "urn:ietf:params:xml:ns:xmpp-streams", Ee = "http://etherx.jabber.org/s
977
977
  async _closeStream(e = this.timeout) {
978
978
  await this.#c("close");
979
979
  let t = this.footer(this.footerElement());
980
- return await this.write(t), this._status("closing"), M(this.parser, "end", "error", e);
980
+ return await this.write(t), this._status("closing"), N(this.parser, "end", "error", e);
981
981
  }
982
982
  async restart() {
983
983
  this._detachParser();
@@ -991,7 +991,7 @@ var Te = "urn:ietf:params:xml:ns:xmpp-streams", Ee = "http://etherx.jabber.org/s
991
991
  e.parent = this.root, await this.write(e.toString()), this.emit("send", e);
992
992
  }
993
993
  sendReceive(e, t = this.timeout) {
994
- return Promise.all([this.send(e), M(this, "element", "error", t)]).then(([, e]) => e);
994
+ return Promise.all([this.send(e), N(this, "element", "error", t)]).then(([, e]) => e);
995
995
  }
996
996
  async write(e) {
997
997
  if (this.status === "closing") throw Error("Connection is closing");
@@ -1045,10 +1045,10 @@ var Te = "urn:ietf:params:xml:ns:xmpp-streams", Ee = "http://etherx.jabber.org/s
1045
1045
  }));
1046
1046
  }
1047
1047
  };
1048
- De.prototype.NS = "", De.prototype.Socket = null, De.prototype.Parser = null;
1048
+ R.prototype.NS = "", R.prototype.Socket = null, R.prototype.Parser = null;
1049
1049
  //#endregion
1050
1050
  //#region node_modules/@xmpp/client-core/lib/Client.js
1051
- var Oe = class extends De {
1051
+ var Ee = class extends R {
1052
1052
  constructor(e) {
1053
1053
  super(e), this.transports = [];
1054
1054
  }
@@ -1089,10 +1089,10 @@ var Oe = class extends De {
1089
1089
  return this.Transport.prototype.footerElement(...e);
1090
1090
  }
1091
1091
  };
1092
- Oe.prototype.NS = "jabber:client";
1092
+ Ee.prototype.NS = "jabber:client";
1093
1093
  //#endregion
1094
1094
  //#region node_modules/@xmpp/reconnect/index.js
1095
- var ke = class extends j.EventEmitter {
1095
+ var De = class extends M.EventEmitter {
1096
1096
  constructor(e) {
1097
1097
  super(), this.delay = 1e3, this.entity = e, this._timeout = null;
1098
1098
  }
@@ -1125,36 +1125,36 @@ var ke = class extends j.EventEmitter {
1125
1125
  e.removeListener("disconnect", this.#e), clearTimeout(t);
1126
1126
  }
1127
1127
  };
1128
- function Ae({ entity: e }) {
1129
- let t = new ke(e);
1128
+ function Oe({ entity: e }) {
1129
+ let t = new De(e);
1130
1130
  return t.start(), t;
1131
1131
  }
1132
1132
  //#endregion
1133
1133
  //#region node_modules/@xmpp/websocket/lib/Socket.js
1134
- var je = "ECONNERROR";
1135
- function Me(e) {
1136
- let t = Se(e);
1134
+ var ke = "ECONNERROR";
1135
+ function Ae(e) {
1136
+ let t = xe(e);
1137
1137
  return !!(t.protocol === "wss:" || [
1138
1138
  "localhost",
1139
1139
  "127.0.0.1",
1140
1140
  "::1"
1141
1141
  ].includes(t.hostname));
1142
1142
  }
1143
- var Ne = class extends j.EventEmitter {
1143
+ var je = class extends M.EventEmitter {
1144
1144
  #e = null;
1145
1145
  socket = null;
1146
1146
  url = null;
1147
1147
  secure = !1;
1148
1148
  connect(e) {
1149
- this.url = e, this.secure = Me(e), this._attachSocket(new WebSocket(e, ["xmpp"]));
1149
+ this.url = e, this.secure = Ae(e), this._attachSocket(new WebSocket(e, ["xmpp"]));
1150
1150
  }
1151
1151
  _attachSocket(e) {
1152
- this.socket = e, this.#e ??= fe({
1152
+ this.socket = e, this.#e ??= de({
1153
1153
  open: () => this.emit("connect"),
1154
1154
  message: ({ data: e }) => this.emit("data", e),
1155
1155
  error: (e) => {
1156
1156
  let { url: t } = this, { error: n } = e;
1157
- n || (n = Error(e.message || `WebSocket ${je} ${t}`), n.errno = je, n.code = je), n.event = e, n.url = t, this.emit("error", n);
1157
+ n || (n = Error(e.message || `WebSocket ${ke} ${t}`), n.errno = ke, n.code = ke), n.event = e, n.url = t, this.emit("error", n);
1158
1158
  },
1159
1159
  close: (e) => {
1160
1160
  this._detachSocket(), this.emit("close", !e.wasClean, e);
@@ -1179,15 +1179,15 @@ var Ne = class extends j.EventEmitter {
1179
1179
  }
1180
1180
  n();
1181
1181
  }
1182
- }, Pe = class extends pe {
1182
+ }, Me = class extends pe {
1183
1183
  onStartElement(e, t) {
1184
- let n = new A.default(e, t), { cursor: r } = this;
1184
+ let n = new j.default(e, t), { cursor: r } = this;
1185
1185
  r && r.append(n), this.cursor = n;
1186
1186
  }
1187
1187
  onEndElement(e) {
1188
1188
  let { cursor: t } = this;
1189
1189
  if (e !== t.name) {
1190
- this.emit("error", new N(`${t.name} must be closed.`));
1190
+ this.emit("error", new fe(`${t.name} must be closed.`));
1191
1191
  return;
1192
1192
  }
1193
1193
  if (t.parent) {
@@ -1196,7 +1196,7 @@ var Ne = class extends j.EventEmitter {
1196
1196
  }
1197
1197
  t.is("open", "urn:ietf:params:xml:ns:xmpp-framing") ? this.emit("start", t) : t.is("close", "urn:ietf:params:xml:ns:xmpp-framing") ? this.emit("end", t) : this.emit("element", t), this.cursor = null;
1198
1198
  }
1199
- }, Fe = "urn:ietf:params:xml:ns:xmpp-framing", Ie = class extends De {
1199
+ }, Ne = "urn:ietf:params:xml:ns:xmpp-framing", Pe = class extends R {
1200
1200
  send(e, ...t) {
1201
1201
  return e.attrs.xmlns ??= this.NS, super.send(e, ...t);
1202
1202
  }
@@ -1204,27 +1204,27 @@ var Ne = class extends j.EventEmitter {
1204
1204
  for (let t of e) t.attrs.xmlns ??= this.NS, t.parent = this.root, this.socket.write(t.toString()), this.emit("send", t);
1205
1205
  }
1206
1206
  footerElement() {
1207
- return new P.Element("close", { xmlns: Fe });
1207
+ return new P.Element("close", { xmlns: Ne });
1208
1208
  }
1209
1209
  headerElement() {
1210
1210
  let e = super.headerElement();
1211
- return e.name = "open", e.attrs.xmlns = Fe, e;
1211
+ return e.name = "open", e.attrs.xmlns = Ne, e;
1212
1212
  }
1213
1213
  socketParameters(e) {
1214
1214
  return /^wss?:\/\//.test(e) ? e : void 0;
1215
1215
  }
1216
1216
  };
1217
- Ie.prototype.Socket = Ne, Ie.prototype.NS = "jabber:client", Ie.prototype.Parser = Pe;
1217
+ Pe.prototype.Socket = je, Pe.prototype.NS = "jabber:client", Pe.prototype.Parser = Me;
1218
1218
  //#endregion
1219
1219
  //#region node_modules/@xmpp/websocket/index.js
1220
- function Le({ entity: e }) {
1221
- e.transports.push(Ie);
1220
+ function Fe({ entity: e }) {
1221
+ e.transports.push(Pe);
1222
1222
  }
1223
1223
  //#endregion
1224
1224
  //#region __vite-browser-external
1225
- var Re = /* @__PURE__ */ y(((e, t) => {
1225
+ var Ie = /* @__PURE__ */ y(((e, t) => {
1226
1226
  t.exports = {};
1227
- })), ze = /* @__PURE__ */ y(((e, t) => {
1227
+ })), Le = /* @__PURE__ */ y(((e, t) => {
1228
1228
  t.exports = n;
1229
1229
  function n(e) {
1230
1230
  if (!Array.isArray(e)) throw TypeError("Middleware stack must be an array!");
@@ -1245,19 +1245,19 @@ var Re = /* @__PURE__ */ y(((e, t) => {
1245
1245
  }
1246
1246
  };
1247
1247
  }
1248
- })), L = /* @__PURE__ */ x(Re(), 1), Be = /* @__PURE__ */ x(ze(), 1), Ve = class {
1248
+ })), z = /* @__PURE__ */ x(Ie(), 1), Re = /* @__PURE__ */ x(Le(), 1), ze = class {
1249
1249
  constructor(e, t) {
1250
1250
  this.stanza = t, this.entity = e;
1251
1251
  let { name: n, attrs: r } = t, { type: i, id: a } = r;
1252
1252
  this.name = n, this.id = a || "", this.type = n === "message" ? i || "normal" : n === "presence" ? i || "available" : i || "", this.from = null, this.to = null, this.local = "", this.domain = "", this.resource = "";
1253
1253
  }
1254
- }, He = class extends Ve {
1254
+ }, Be = class extends ze {
1255
1255
  constructor(e, t) {
1256
1256
  super(e, t);
1257
1257
  let { jid: n } = e, { domain: r } = e.options ?? {}, i = t.attrs.to || n?.toString(), a = t.attrs.from || r;
1258
1258
  i && (this.to = new I(i)), a && (this.from = new I(a), this.local = this.from.local, this.domain = this.from.domain, this.resource = this.from.resource);
1259
1259
  }
1260
- }, Ue = class extends Ve {
1260
+ }, Ve = class extends ze {
1261
1261
  constructor(e, t) {
1262
1262
  super(e, t);
1263
1263
  let { jid: n } = e, { domain: r } = e.options ?? {}, i = t.attrs.from || n?.toString(), a = t.attrs.to || r;
@@ -1266,19 +1266,19 @@ var Re = /* @__PURE__ */ y(((e, t) => {
1266
1266
  };
1267
1267
  //#endregion
1268
1268
  //#region node_modules/@xmpp/middleware/index.js
1269
- function We(e, t, n) {
1269
+ function He(e, t, n) {
1270
1270
  return (r) => {
1271
1271
  let i = new n(e, r);
1272
- return (0, Be.default)(t)(i);
1272
+ return (0, Re.default)(t)(i);
1273
1273
  };
1274
1274
  }
1275
- function Ge(e) {
1275
+ function Ue(e) {
1276
1276
  return (t, n) => {
1277
1277
  n().then((t) => t && e.send(t)).catch((t) => e.emit("error", t));
1278
1278
  };
1279
1279
  }
1280
- function Ke({ entity: e }) {
1281
- let t = [Ge(e)], n = [], r = We(e, t, He), i = We(e, n, Ue);
1280
+ function We({ entity: e }) {
1281
+ let t = [Ue(e)], n = [], r = He(e, t, Be), i = He(e, n, Ve);
1282
1282
  return e.on("element", r), e.on("send", i), {
1283
1283
  use(e) {
1284
1284
  return t.push(e), e;
@@ -1290,7 +1290,7 @@ function Ke({ entity: e }) {
1290
1290
  }
1291
1291
  //#endregion
1292
1292
  //#region node_modules/@xmpp/stream-features/index.js
1293
- function qe({ middleware: e }) {
1293
+ function Ge({ middleware: e }) {
1294
1294
  function t(t, n, r) {
1295
1295
  return e.use((e, i) => {
1296
1296
  let { stanza: a } = e;
@@ -1303,14 +1303,14 @@ function qe({ middleware: e }) {
1303
1303
  }
1304
1304
  //#endregion
1305
1305
  //#region node_modules/@xmpp/id/index.js
1306
- function Je() {
1306
+ function Ke() {
1307
1307
  let e;
1308
1308
  for (; !e;) e = Math.random().toString(36).slice(2, 12);
1309
1309
  return e;
1310
1310
  }
1311
1311
  //#endregion
1312
1312
  //#region node_modules/@xmpp/middleware/lib/StanzaError.js
1313
- var Ye = class extends be {
1313
+ var qe = class extends L {
1314
1314
  constructor(e, t, n, r) {
1315
1315
  super(e, t, n), this.type = r, this.name = "StanzaError";
1316
1316
  }
@@ -1321,10 +1321,10 @@ var Ye = class extends be {
1321
1321
  };
1322
1322
  //#endregion
1323
1323
  //#region node_modules/@xmpp/iq/caller.js
1324
- function Xe({ name: e, type: t }) {
1324
+ function Je({ name: e, type: t }) {
1325
1325
  return !(e !== "iq" || t !== "error" && t !== "result");
1326
1326
  }
1327
- var Ze = class {
1327
+ var Ye = class {
1328
1328
  constructor({ entity: e, middleware: t }) {
1329
1329
  this.handlers = /* @__PURE__ */ new Map(), this.entity = e, this.middleware = t;
1330
1330
  }
@@ -1332,20 +1332,20 @@ var Ze = class {
1332
1332
  this.middleware.use(this._route.bind(this));
1333
1333
  }
1334
1334
  _route({ type: e, name: t, id: n, stanza: r }, i) {
1335
- if (!Xe({
1335
+ if (!Je({
1336
1336
  name: t,
1337
1337
  type: e
1338
1338
  })) return i();
1339
1339
  let a = this.handlers.get(n);
1340
1340
  if (!a) return i();
1341
- e === "error" ? a.reject(Ye.fromElement(r.getChild("error"))) : a.resolve(r), this.handlers.delete(n);
1341
+ e === "error" ? a.reject(qe.fromElement(r.getChild("error"))) : a.resolve(r), this.handlers.delete(n);
1342
1342
  }
1343
1343
  async request(e, t = 3e4) {
1344
- e.attrs.id || (e.attrs.id = Je());
1345
- let n = new ue();
1344
+ e.attrs.id || (e.attrs.id = Ke());
1345
+ let n = new le();
1346
1346
  this.handlers.set(e.attrs.id, n);
1347
1347
  try {
1348
- await this.entity.send(e), await se(n.promise, t);
1348
+ await this.entity.send(e), await oe(n.promise, t);
1349
1349
  } catch (t) {
1350
1350
  throw this.handlers.delete(e.attrs.id), t;
1351
1351
  }
@@ -1365,71 +1365,71 @@ var Ze = class {
1365
1365
  return this._childRequest("set", ...e);
1366
1366
  }
1367
1367
  };
1368
- function Qe(...e) {
1369
- let t = new Ze(...e);
1368
+ function Xe(...e) {
1369
+ let t = new Ye(...e);
1370
1370
  return t.start(), t;
1371
1371
  }
1372
1372
  //#endregion
1373
1373
  //#region node_modules/@xmpp/iq/callee.js
1374
- var $e = "urn:ietf:params:xml:ns:xmpp-stanzas";
1375
- function et({ name: e, type: t }) {
1374
+ var Ze = "urn:ietf:params:xml:ns:xmpp-stanzas";
1375
+ function Qe({ name: e, type: t }) {
1376
1376
  return e === "iq" && t !== "error" && t !== "result";
1377
1377
  }
1378
- function tt({ type: e }, t, n) {
1378
+ function $e({ type: e }, t, n) {
1379
1379
  return !(e !== "get" && e !== "set" || t.length !== 1 || !n);
1380
1380
  }
1381
- function nt({ stanza: e }) {
1381
+ function et({ stanza: e }) {
1382
1382
  return P("iq", {
1383
1383
  to: e.attrs.from,
1384
1384
  from: e.attrs.to,
1385
1385
  id: e.attrs.id
1386
1386
  });
1387
1387
  }
1388
- function rt(e, t) {
1389
- let n = nt(e);
1388
+ function tt(e, t) {
1389
+ let n = et(e);
1390
1390
  return n.attrs.type = "result", t && n.append(t), n;
1391
1391
  }
1392
- function it(e, t, n) {
1393
- let r = nt(e);
1392
+ function nt(e, t, n) {
1393
+ let r = et(e);
1394
1394
  return r.attrs.type = "error", n && r.append(n), r.append(t), r;
1395
1395
  }
1396
- function at(e, t) {
1397
- return P("error", { type: e }, P(t, $e));
1396
+ function rt(e, t) {
1397
+ return P("error", { type: e }, P(t, Ze));
1398
1398
  }
1399
- function ot(e) {
1399
+ function it(e) {
1400
1400
  return async function(t, n) {
1401
- if (!et(t)) return n();
1401
+ if (!Qe(t)) return n();
1402
1402
  let { stanza: r } = t, i = r.getChildElements(), [a] = i;
1403
- if (!tt(t, i, a)) return it(t, at("modify", "bad-request"), a);
1403
+ if (!$e(t, i, a)) return nt(t, rt("modify", "bad-request"), a);
1404
1404
  t.element = a;
1405
1405
  let o;
1406
1406
  try {
1407
1407
  o = await n();
1408
1408
  } catch (t) {
1409
- e.emit("error", t), o = at("cancel", "internal-server-error");
1409
+ e.emit("error", t), o = rt("cancel", "internal-server-error");
1410
1410
  }
1411
- return o ||= at("cancel", "service-unavailable"), o instanceof P.Element && o.is("error") ? it(t, o, a) : rt(t, o instanceof P.Element ? o : void 0);
1411
+ return o ||= rt("cancel", "service-unavailable"), o instanceof P.Element && o.is("error") ? nt(t, o, a) : tt(t, o instanceof P.Element ? o : void 0);
1412
1412
  };
1413
1413
  }
1414
- function st(e, t, n, r) {
1414
+ function at(e, t, n, r) {
1415
1415
  return (i, a) => i.type !== e | !i.element || !i.element.is(n, t) ? a() : r(i, a);
1416
1416
  }
1417
- function ct({ middleware: e, entity: t }) {
1418
- return e.use(ot(t)), {
1417
+ function ot({ middleware: e, entity: t }) {
1418
+ return e.use(it(t)), {
1419
1419
  get(t, n, r) {
1420
- e.use(st("get", t, n, r));
1420
+ e.use(at("get", t, n, r));
1421
1421
  },
1422
1422
  set(t, n, r) {
1423
- e.use(st("set", t, n, r));
1423
+ e.use(at("set", t, n, r));
1424
1424
  }
1425
1425
  };
1426
1426
  }
1427
1427
  //#endregion
1428
1428
  //#region node_modules/@xmpp/resolve/lib/dns.js
1429
- var lt = ["ENOTFOUND", "ENODATA"];
1430
- function ut(e, t = {}) {
1429
+ var st = ["ENOTFOUND", "ENODATA"];
1430
+ function ct(e, t = {}) {
1431
1431
  return t.all = !0, new Promise((n, r) => {
1432
- L.default.lookup(e, t, (e, t) => {
1432
+ z.default.lookup(e, t, (e, t) => {
1433
1433
  if (e) return r(e);
1434
1434
  let i = [];
1435
1435
  for (let { family: e, address: n } of t) {
@@ -1448,17 +1448,17 @@ function ut(e, t = {}) {
1448
1448
  });
1449
1449
  });
1450
1450
  }
1451
- function dt(e, { service: t, protocol: n }) {
1451
+ function lt(e, { service: t, protocol: n }) {
1452
1452
  return new Promise((r, i) => {
1453
- L.default.resolveSrv(`_${t}._${n}.${e}`, (e, a) => {
1454
- e && lt.includes(e.code) ? r([]) : e ? i(e) : r(a.map((e) => Object.assign(e, {
1453
+ z.default.resolveSrv(`_${t}._${n}.${e}`, (e, a) => {
1454
+ e && st.includes(e.code) ? r([]) : e ? i(e) : r(a.map((e) => Object.assign(e, {
1455
1455
  service: t,
1456
1456
  protocol: n
1457
1457
  })));
1458
1458
  });
1459
1459
  });
1460
1460
  }
1461
- function ft(e) {
1461
+ function ut(e) {
1462
1462
  return e.toSorted((e, t) => {
1463
1463
  let n = e.priority - t.priority;
1464
1464
  if (n !== 0) return n;
@@ -1466,10 +1466,10 @@ function ft(e) {
1466
1466
  return r === 0 ? 0 : r;
1467
1467
  });
1468
1468
  }
1469
- function pt(e, t) {
1469
+ function dt(e, t) {
1470
1470
  let n = [];
1471
1471
  return Promise.all(e.map(async (e) => {
1472
- let r = await ut(e.name, t);
1472
+ let r = await ct(e.name, t);
1473
1473
  for (let t of r) {
1474
1474
  let { port: r, service: i } = e, a = t.address;
1475
1475
  n.push({
@@ -1480,7 +1480,7 @@ function pt(e, t) {
1480
1480
  }
1481
1481
  })).then(() => n);
1482
1482
  }
1483
- function mt(e, t = {}) {
1483
+ function ft(e, t = {}) {
1484
1484
  t.srv ||= [
1485
1485
  {
1486
1486
  service: "xmpps-client",
@@ -1524,14 +1524,14 @@ function mt(e, t = {}) {
1524
1524
  }
1525
1525
  ];
1526
1526
  let n = { options: t };
1527
- return ut(e, t).then((r) => Promise.all(t.srv.map((r) => dt(e, {
1527
+ return ct(e, t).then((r) => Promise.all(t.srv.map((r) => lt(e, {
1528
1528
  ...r,
1529
1529
  family: n
1530
- }).then((e) => pt(e, t)))).then((e) => [...ft(e.flat()), ...r]));
1530
+ }).then((e) => dt(e, t)))).then((e) => [...ut(e.flat()), ...r]));
1531
1531
  }
1532
1532
  //#endregion
1533
1533
  //#region node_modules/@xmpp/xml/lib/parse.js
1534
- function ht(e) {
1534
+ function pt(e) {
1535
1535
  let t = new pe(), n = null, r = null;
1536
1536
  if (t.on("start", (e) => {
1537
1537
  n = e;
@@ -1544,19 +1544,19 @@ function ht(e) {
1544
1544
  }
1545
1545
  //#endregion
1546
1546
  //#region node_modules/@xmpp/resolve/lib/alt-connections.js
1547
- function gt(e) {
1547
+ function mt(e) {
1548
1548
  return e.startsWith("https") || e.startsWith("wss");
1549
1549
  }
1550
- function _t(e, t) {
1550
+ function ht(e, t) {
1551
1551
  let n;
1552
- if (n = gt(e.uri) && !gt(t.uri) ? -1 : !gt(e.uri) && gt(t.uri) ? 1 : 0, n !== 0) return n;
1552
+ if (n = mt(e.uri) && !mt(t.uri) ? -1 : !mt(e.uri) && mt(t.uri) ? 1 : 0, n !== 0) return n;
1553
1553
  let r;
1554
1554
  return r = e.method === t.method ? 0 : e.method === "websocket" ? -1 : t.method === "websocket" ? 1 : e.method === "xbosh" ? -1 : t.method === "xbosh" ? 1 : e.method === "httppoll" ? -1 : +(t.method === "httppoll"), r === 0 ? 0 : r;
1555
1555
  }
1556
1556
  //#endregion
1557
1557
  //#region node_modules/@xmpp/resolve/lib/http.js
1558
- function vt(e) {
1559
- return fetch(`https://${e}/.well-known/host-meta`).then((e) => e.text()).then((e) => ht(e).getChildren("Link").filter((e) => [
1558
+ function gt(e) {
1559
+ return fetch(`https://${e}/.well-known/host-meta`).then((e) => e.text()).then((e) => pt(e).getChildren("Link").filter((e) => [
1560
1560
  "urn:xmpp:alt-connections:websocket",
1561
1561
  "urn:xmpp:alt-connections:httppoll",
1562
1562
  "urn:xmpp:alt-connections:xbosh"
@@ -1565,17 +1565,17 @@ function vt(e) {
1565
1565
  href: e.href,
1566
1566
  method: e.rel.split(":").pop(),
1567
1567
  uri: e.href
1568
- })).toSorted(_t)).catch(() => []);
1568
+ })).toSorted(ht)).catch(() => []);
1569
1569
  }
1570
1570
  //#endregion
1571
1571
  //#region node_modules/@xmpp/resolve/resolve.js
1572
- function yt(...e) {
1573
- return Promise.all([mt ? mt(...e) : Promise.resolve([]), vt(...e)]).then(([e, t]) => [...e, ...t]);
1572
+ function _t(...e) {
1573
+ return Promise.all([ft ? ft(...e) : Promise.resolve([]), gt(...e)]).then(([e, t]) => [...e, ...t]);
1574
1574
  }
1575
1575
  //#endregion
1576
1576
  //#region node_modules/@xmpp/resolve/index.js
1577
- async function bt(e) {
1578
- let t = await yt(e, { srv: [{
1577
+ async function vt(e) {
1578
+ let t = await _t(e, { srv: [{
1579
1579
  service: "xmpps-client",
1580
1580
  protocol: "tcp"
1581
1581
  }, {
@@ -1584,30 +1584,30 @@ async function bt(e) {
1584
1584
  }] });
1585
1585
  return [...new Set(t.map((e) => e.uri))];
1586
1586
  }
1587
- function xt(e, t) {
1587
+ function yt(e, t) {
1588
1588
  return t.filter((t) => e._findTransport(t));
1589
1589
  }
1590
- async function St(e, t) {
1590
+ async function bt(e, t) {
1591
1591
  if (t.length === 0) throw Error("Couldn't connect");
1592
1592
  let n = t.shift(), r = e._findTransport(n);
1593
- if (!r) return St(e, t);
1593
+ if (!r) return bt(e, t);
1594
1594
  e._status("connecting", n);
1595
1595
  let i = r.prototype.socketParameters(n), a = new r.prototype.Socket();
1596
1596
  try {
1597
- a.connect(i), await M(a, "connect");
1597
+ a.connect(i), await N(a, "connect");
1598
1598
  } catch {
1599
- return St(e, t);
1599
+ return bt(e, t);
1600
1600
  }
1601
1601
  e._attachSocket(a), a.emit("connect"), e.Transport = r, e.Socket = r.prototype.Socket, e.Parser = r.prototype.Parser;
1602
1602
  }
1603
- function Ct({ entity: e }) {
1603
+ function xt({ entity: e }) {
1604
1604
  let t = e.connect;
1605
1605
  e.connect = async function(n) {
1606
1606
  if (!n || /:\/\//.test(n)) return t.call(this, n);
1607
- let r = xt(e, await bt(n));
1607
+ let r = yt(e, await vt(n));
1608
1608
  if (r.length === 0) throw Error("No compatible transport found.");
1609
1609
  try {
1610
- await St(e, r);
1610
+ await bt(e, r);
1611
1611
  } catch (t) {
1612
1612
  throw await e.disconnect(), e._status("disconnect"), t;
1613
1613
  }
@@ -1615,19 +1615,19 @@ function Ct({ entity: e }) {
1615
1615
  }
1616
1616
  //#endregion
1617
1617
  //#region node_modules/@xmpp/base64/index.js
1618
- function wt(e) {
1618
+ function St(e) {
1619
1619
  return globalThis.btoa(e);
1620
1620
  }
1621
- function Tt(e) {
1621
+ function Ct(e) {
1622
1622
  return globalThis.atob(e);
1623
1623
  }
1624
1624
  //#endregion
1625
1625
  //#region node_modules/@xmpp/sasl/lib/SASLError.js
1626
- var R = class extends be {
1626
+ var wt = class extends L {
1627
1627
  constructor(...e) {
1628
1628
  super(...e), this.name = "SASLError";
1629
1629
  }
1630
- }, z = "urn:ietf:params:xml:ns:xmpp-sasl";
1630
+ }, Tt = "urn:ietf:params:xml:ns:xmpp-sasl";
1631
1631
  function Et(e, t, n) {
1632
1632
  let r = new Set(e.getChildren("mechanism", t).map((e) => e.text()));
1633
1633
  return n._mechs.map(({ name: e }) => e).filter((e) => r.has(e));
@@ -1645,29 +1645,29 @@ async function Dt({ saslFactory: e, entity: t, mechanism: n, credentials: r }) {
1645
1645
  serviceName: a,
1646
1646
  ...r
1647
1647
  };
1648
- await de(t, i.clientFirst && P("auth", {
1649
- xmlns: z,
1648
+ await ue(t, i.clientFirst && P("auth", {
1649
+ xmlns: Tt,
1650
1650
  mechanism: i.name
1651
- }, wt(await i.response(o))), async (e, n) => {
1652
- if (e.getNS() === z) {
1651
+ }, St(await i.response(o))), async (e, n) => {
1652
+ if (e.getNS() === Tt) {
1653
1653
  if (e.name === "challenge") {
1654
- await i.challenge(Tt(e.text()));
1654
+ await i.challenge(Ct(e.text()));
1655
1655
  let n = await i.response(o);
1656
1656
  await t.send(P("response", {
1657
- xmlns: z,
1657
+ xmlns: Tt,
1658
1658
  mechanism: i.name
1659
- }, typeof n == "string" ? wt(n) : ""));
1659
+ }, typeof n == "string" ? St(n) : ""));
1660
1660
  return;
1661
1661
  }
1662
- if (e.name === "failure") throw R.fromElement(e);
1662
+ if (e.name === "failure") throw wt.fromElement(e);
1663
1663
  if (e.name === "success") return n();
1664
1664
  }
1665
1665
  });
1666
1666
  }
1667
1667
  function Ot({ streamFeatures: e, saslFactory: t }, n) {
1668
- e.use("mechanisms", z, async ({ entity: e }, r, i) => {
1669
- let a = Et(i, z, t);
1670
- if (a.length === 0) throw new R("SASL: No compatible mechanism available.");
1668
+ e.use("mechanisms", Tt, async ({ entity: e }, r, i) => {
1669
+ let a = Et(i, Tt, t);
1670
+ if (a.length === 0) throw new wt("SASL: No compatible mechanism available.");
1671
1671
  async function o(n, r) {
1672
1672
  await Dt({
1673
1673
  saslFactory: t,
@@ -1695,29 +1695,29 @@ async function At({ saslFactory: e, entity: t, mechanism: n, credentials: r, use
1695
1695
  serviceName: c,
1696
1696
  ...r
1697
1697
  };
1698
- await de(t, P("authenticate", {
1698
+ await ue(t, P("authenticate", {
1699
1699
  xmlns: kt,
1700
1700
  mechanism: s.name
1701
1701
  }, [
1702
- s.clientFirst && P("initial-response", {}, wt(await s.response(l))),
1702
+ s.clientFirst && P("initial-response", {}, St(await s.response(l))),
1703
1703
  i,
1704
1704
  ...a
1705
1705
  ]), async (e, n) => {
1706
1706
  if (e.getNS() === kt) {
1707
1707
  if (e.name === "challenge") {
1708
- await s.challenge(Tt(e.text()));
1708
+ await s.challenge(Ct(e.text()));
1709
1709
  let n = await s.response(l);
1710
1710
  await t.send(P("response", {
1711
1711
  xmlns: kt,
1712
1712
  mechanism: s.name
1713
- }, typeof n == "string" ? wt(n) : ""));
1713
+ }, typeof n == "string" ? St(n) : ""));
1714
1714
  return;
1715
1715
  }
1716
- if (e.name === "failure") throw R.fromElement(e);
1716
+ if (e.name === "failure") throw wt.fromElement(e);
1717
1717
  if (e.name === "continue") throw Error("SASL continue is not supported yet");
1718
1718
  if (e.name === "success") {
1719
1719
  let r = e.getChild("additional-data")?.text();
1720
- r && s.final && await s.final(Tt(r));
1720
+ r && s.final && await s.final(Ct(r));
1721
1721
  let i = e.getChildText("authorization-identifier");
1722
1722
  i && t._jid(i);
1723
1723
  for (let t of e.getChildElements()) o.get(t.getNS())?.[1]?.(t);
@@ -1733,7 +1733,7 @@ function jt({ streamFeatures: e, saslFactory: t }, n) {
1733
1733
  element: o,
1734
1734
  features: r
1735
1735
  }), l = !!i?.mechanism;
1736
- if (s.length === 0 && !l) throw new R("SASL: No compatible mechanism available.");
1736
+ if (s.length === 0 && !l) throw new wt("SASL: No compatible mechanism available.");
1737
1737
  await n(u, s, l ? i : null, e);
1738
1738
  async function u(n, a, o) {
1739
1739
  await i.auth({
@@ -1832,15 +1832,15 @@ function Vt({ streamFeatures: e, sm: t, entity: n, resumed: r, failed: i, enable
1832
1832
  });
1833
1833
  }
1834
1834
  function Ht(e, t) {
1835
- return de(e, Wt({ sm: t }), (e, t) => {
1835
+ return ue(e, Wt({ sm: t }), (e, t) => {
1836
1836
  if (e.is("enabled", "urn:xmpp:sm:3")) return t(e);
1837
- if (e.is("failed", "urn:xmpp:sm:3")) throw be.fromElement(e);
1837
+ if (e.is("failed", "urn:xmpp:sm:3")) throw L.fromElement(e);
1838
1838
  });
1839
1839
  }
1840
1840
  async function Ut(e, t) {
1841
- return de(e, Gt({ sm: t }), (e, t) => {
1841
+ return ue(e, Gt({ sm: t }), (e, t) => {
1842
1842
  if (e.is("resumed", "urn:xmpp:sm:3")) return t(e);
1843
- if (e.is("failed", "urn:xmpp:sm:3")) throw be.fromElement(e);
1843
+ if (e.is("failed", "urn:xmpp:sm:3")) throw L.fromElement(e);
1844
1844
  });
1845
1845
  }
1846
1846
  //#endregion
@@ -1861,7 +1861,7 @@ function Gt({ sm: e }) {
1861
1861
  });
1862
1862
  }
1863
1863
  function Kt({ streamFeatures: e, entity: t, middleware: n, bind2: r, sasl2: i }) {
1864
- let a = null, o = null, s = null, c = new j.EventEmitter();
1864
+ let a = null, o = null, s = null, c = new M.EventEmitter();
1865
1865
  Object.assign(c, {
1866
1866
  preferredMaximum: null,
1867
1867
  enabled: !1,
@@ -2034,7 +2034,7 @@ var Zt = /* @__PURE__ */ y(((e, t) => {
2034
2034
  });
2035
2035
  })))(), 1), V = "urn:xmpp:fast:0";
2036
2036
  function $t({ sasl2: e, entity: t }) {
2037
- let n = new Qt.default(), r, i = new j.EventEmitter();
2037
+ let n = new Qt.default(), r, i = new M.EventEmitter();
2038
2038
  Object.assign(i, {
2039
2039
  mechanism: null,
2040
2040
  mechanisms: [],
@@ -2087,7 +2087,7 @@ function $t({ sasl2: e, entity: t }) {
2087
2087
  features: s
2088
2088
  }), !0;
2089
2089
  } catch (e) {
2090
- return e instanceof R && ["not-authorized", "credentials-expired"].includes(e.condition) ? l() : (t.emit("error", e), !1);
2090
+ return e instanceof wt && ["not-authorized", "credentials-expired"].includes(e.condition) ? l() : (t.emit("error", e), !1);
2091
2091
  }
2092
2092
  async function l() {
2093
2093
  return await i.delete(), a(o), !1;
@@ -2220,21 +2220,21 @@ function pn(e) {
2220
2220
  function mn(e = {}) {
2221
2221
  let { resource: t, credentials: n, username: r, password: i, userAgent: a, ...o } = e, { domain: s, service: c } = o;
2222
2222
  !s && c && (o.domain = pn(c));
2223
- let l = new Oe(o);
2223
+ let l = new Ee(o);
2224
2224
  r && o.domain && (l.jid = I(r, o.domain));
2225
- let u = Ae({ entity: l }), d = Le({ entity: l }), f = hn(L.default, { entity: l }), p = hn(L.default, { entity: l }), m = Ke({ entity: l }), h = qe({ middleware: m }), g = Qe({
2225
+ let u = Oe({ entity: l }), d = Fe({ entity: l }), f = hn(z.default, { entity: l }), p = hn(z.default, { entity: l }), m = We({ entity: l }), h = Ge({ middleware: m }), g = Xe({
2226
2226
  middleware: m,
2227
2227
  entity: l
2228
- }), _ = ct({
2228
+ }), _ = ot({
2229
2229
  middleware: m,
2230
2230
  entity: l
2231
- }), v = Ct({ entity: l }), y = new Qt.default(), b = Object.entries({
2232
- ...typeof L.default == "function" && { scramsha1: L.default },
2231
+ }), v = xt({ entity: l }), y = new Qt.default(), b = Object.entries({
2232
+ ...typeof z.default == "function" && { scramsha1: z.default },
2233
2233
  plain: rn,
2234
2234
  anonymous: sn
2235
2235
  }).map(([e, t]) => ({ [e]: t(y) }));
2236
2236
  a ??= P("user-agent", { id: globalThis.crypto.randomUUID() });
2237
- let x = hn(L.default, { streamFeatures: h }), S = jt({
2237
+ let x = hn(z.default, { streamFeatures: h }), S = jt({
2238
2238
  streamFeatures: h,
2239
2239
  saslFactory: y
2240
2240
  }, dn(n ?? {
@@ -3385,7 +3385,7 @@ function Kn({ onDragStart: e, pushButton: t = !0 }) {
3385
3385
  newChatButton: e.newChatButton
3386
3386
  })));
3387
3387
  return /* @__PURE__ */ f("div", {
3388
- className: "ci-flex ci-flex-col-reverse ci-items-center ci-gap-3 ci-mb-3 ci-cursor-grab active:ci-cursor-grabbing ci-touch-none",
3388
+ className: `ci-flex ci-flex-col-reverse ci-items-center ci-gap-3 ci-mb-3 ${e ? "ci-cursor-grab active:ci-cursor-grabbing ci-touch-none" : ""}`,
3389
3389
  onPointerDown: e,
3390
3390
  children: [
3391
3391
  n.map((e) => {
@@ -4162,10 +4162,10 @@ function kr({ onSend: e, onTyping: t, onFile: n, disabled: r }) {
4162
4162
  O(o.slice(0, n) + e + o.slice(r)), requestAnimationFrame(() => {
4163
4163
  t?.focus(), t?.setSelectionRange(n + e.length, n + e.length);
4164
4164
  });
4165
- }, te = () => {
4165
+ }, k = () => {
4166
4166
  let t = o.trim();
4167
4167
  t && (l(""), Promise.resolve(e(t)).catch(() => l((e) => e || t)), window.clearTimeout(_.current), v.current = !1);
4168
- }, ne = async () => {
4168
+ }, te = async () => {
4169
4169
  if (w.current || y) return;
4170
4170
  w.current = !0;
4171
4171
  let e;
@@ -4191,7 +4191,7 @@ function kr({ onSend: e, onTyping: t, onFile: n, disabled: r }) {
4191
4191
  } finally {
4192
4192
  w.current = !1;
4193
4193
  }
4194
- }, k = (e) => {
4194
+ }, A = (e) => {
4195
4195
  C.current = e, y?.r.stop();
4196
4196
  };
4197
4197
  return y ? /* @__PURE__ */ f("div", {
@@ -4201,7 +4201,7 @@ function kr({ onSend: e, onTyping: t, onFile: n, disabled: r }) {
4201
4201
  variant: "transparent",
4202
4202
  title: "Discard",
4203
4203
  "aria-label": "Discard",
4204
- onClick: () => k(!0),
4204
+ onClick: () => A(!0),
4205
4205
  className: "ci-h-10 ci-w-10",
4206
4206
  children: Q.close
4207
4207
  }),
@@ -4213,7 +4213,7 @@ function kr({ onSend: e, onTyping: t, onFile: n, disabled: r }) {
4213
4213
  variant: "green",
4214
4214
  title: "Send voice note",
4215
4215
  "aria-label": "Send voice note",
4216
- onClick: () => k(!1),
4216
+ onClick: () => A(!1),
4217
4217
  className: "ci-h-10 ci-w-10",
4218
4218
  children: Q.send
4219
4219
  })
@@ -4260,7 +4260,7 @@ function kr({ onSend: e, onTyping: t, onFile: n, disabled: r }) {
4260
4260
  onChange: (e) => O(e.target.value),
4261
4261
  onKeyDown: (e) => {
4262
4262
  let t = (o.match(/```/g) ?? []).length % 2 == 1;
4263
- e.key === "Enter" && !e.shiftKey && !t && (e.preventDefault(), te());
4263
+ e.key === "Enter" && !e.shiftKey && !t && (e.preventDefault(), k());
4264
4264
  },
4265
4265
  className: "ci-block ci-w-full ci-resize-none ci-max-h-32 ci-pl-11 ci-pr-4 ci-py-2.5 ci-rounded-3xl ci-border-0 ci-bg-elevationL2 dark:ci-bg-elevationL2Dark ci-text-gray-900 dark:ci-text-white placeholder:ci-text-gray-500 dark:placeholder:ci-text-gray-400 ci-outline-none focus:ci-ring-2 focus:ci-ring-gray-400 dark:focus:ci-ring-gray-500 ci-text-sm",
4266
4266
  style: { height: Math.min(128, 40 + 20 * (o.split("\n").length - 1)) }
@@ -4269,14 +4269,14 @@ function kr({ onSend: e, onTyping: t, onFile: n, disabled: r }) {
4269
4269
  o.trim() ? /* @__PURE__ */ d(Z, {
4270
4270
  variant: "default",
4271
4271
  disabled: r,
4272
- onClick: te,
4272
+ onClick: k,
4273
4273
  title: "Send",
4274
4274
  className: "ci-h-10 ci-w-10",
4275
4275
  children: Q.send
4276
4276
  }) : /* @__PURE__ */ d(Z, {
4277
4277
  variant: "default",
4278
4278
  disabled: r || typeof MediaRecorder > "u",
4279
- onClick: ne,
4279
+ onClick: te,
4280
4280
  title: "Record a voice note",
4281
4281
  "aria-label": "Record a voice note",
4282
4282
  className: "ci-h-10 ci-w-10",
@@ -4325,7 +4325,7 @@ function jr({ peer: e, actions: t, onDragStart: n }) {
4325
4325
  "aria-hidden": "true"
4326
4326
  }),
4327
4327
  /* @__PURE__ */ f("div", {
4328
- className: "ci-flex ci-items-center ci-gap-3 ci-px-4 ci-py-3 ci-cursor-grab active:ci-cursor-grabbing ci-touch-none ci-rounded-t-3xl",
4328
+ className: `ci-flex ci-items-center ci-gap-3 ci-px-4 ci-py-3 ci-rounded-t-3xl ${n ? "ci-cursor-grab active:ci-cursor-grabbing ci-touch-none" : ""}`,
4329
4329
  onPointerDown: n,
4330
4330
  children: [
4331
4331
  r.kind === "group" ? /* @__PURE__ */ d(Un, {
@@ -4685,30 +4685,30 @@ function zr(e) {
4685
4685
  }
4686
4686
  }
4687
4687
  var Br = (e) => (sr(e) ? "Attachment" : $(e)).replace(/```[^\n]*\n?/g, "").replace(/(\*\*|__|~~|`)/g, "").replace(/(^|\s)[*_](\S[^*_]*)[*_]/g, "$1$2").replace(/\s+/g, " ").trim();
4688
- function Vr({ dataConfig: e, position: t = "bottom-right", theme: n, serviceWorker: r, maxHeads: a = 5, newChatButton: l = !0, notifications: u = "click", sound: p = !0 }) {
4689
- let m = o(() => zr(e), [e]), h = Ir(n), g = s(m), _ = s(p), v = s(u);
4688
+ function Vr({ dataConfig: e, position: t = "bottom-right", theme: n, serviceWorker: r, maxHeads: a = 5, newChatButton: l = !0, notifications: u = "click", sound: p = !0, drag: m = !0, onDragStart: h }) {
4689
+ let g = o(() => zr(e), [e]), _ = Ir(n), v = s(g), y = s(p), b = s(u);
4690
4690
  i(() => {
4691
- g.current = m, _.current = p, v.current = u;
4691
+ v.current = g, y.current = p, b.current = u;
4692
4692
  }, [
4693
- m,
4693
+ g,
4694
4694
  p,
4695
4695
  u
4696
4696
  ]), i(() => J.setState({
4697
4697
  maxHeads: a,
4698
4698
  newChatButton: l
4699
4699
  }), [a, l]);
4700
- let [y, b] = c(0);
4700
+ let [x, S] = c(0);
4701
4701
  i(() => {
4702
- let e = (e) => e.persisted && b((e) => e + 1);
4702
+ let e = (e) => e.persisted && S((e) => e + 1);
4703
4703
  return window.addEventListener("pageshow", e), () => window.removeEventListener("pageshow", e);
4704
4704
  }, []);
4705
- let x = s(null), S = s(/* @__PURE__ */ new Set()), C = s(!1), T = s(null), D = s(null), O = E(D, `chat-island-pos:${m?.host ?? ""}:${m?.username ?? ""}`), { open: ee, picker: te, status: ne } = J(w((e) => ({
4705
+ let C = s(null), T = s(/* @__PURE__ */ new Set()), D = s(!1), O = s(null), ee = s(null), k = E(ee, `chat-island-pos:${g?.host ?? ""}:${g?.username ?? ""}`), { open: te, picker: A, status: j } = J(w((e) => ({
4706
4706
  open: e.open,
4707
4707
  picker: e.picker,
4708
4708
  status: e.status
4709
- }))), k = o(() => ({
4709
+ }))), ne = o(() => ({
4710
4710
  send: async (e, t) => {
4711
- let n = x.current;
4711
+ let n = C.current;
4712
4712
  if (!n) throw Error("not connected");
4713
4713
  try {
4714
4714
  J.getState().addMessage(e, await n.send(e, $(t)));
@@ -4719,9 +4719,9 @@ function Vr({ dataConfig: e, position: t = "bottom-right", theme: n, serviceWork
4719
4719
  }), e;
4720
4720
  }
4721
4721
  },
4722
- typing: (e, t) => J.getState().online[e] && x.current?.typing(e, t).catch(() => {}),
4722
+ typing: (e, t) => J.getState().online[e] && C.current?.typing(e, t).catch(() => {}),
4723
4723
  upload: async (e, t) => {
4724
- let n = x.current;
4724
+ let n = C.current;
4725
4725
  if (n) try {
4726
4726
  let r = await n.upload(t);
4727
4727
  J.getState().addMessage(e, await n.send(e, t.name, r));
@@ -4733,7 +4733,7 @@ function Vr({ dataConfig: e, position: t = "bottom-right", theme: n, serviceWork
4733
4733
  }
4734
4734
  },
4735
4735
  createGroup: async (e, t, n) => {
4736
- let r = x.current, i = g.current;
4736
+ let r = C.current, i = v.current;
4737
4737
  if (r && i) try {
4738
4738
  let a = await r.createGroup(e, t, n), o = J.getState();
4739
4739
  o.setGroup(a, e, [...t, i.username], n), o.openChat(a);
@@ -4745,7 +4745,7 @@ function Vr({ dataConfig: e, position: t = "bottom-right", theme: n, serviceWork
4745
4745
  }
4746
4746
  },
4747
4747
  remove: async (e) => {
4748
- let t = x.current, n = g.current;
4748
+ let t = C.current, n = v.current;
4749
4749
  if (!t || !n) return;
4750
4750
  let r = J.getState().conversations[e];
4751
4751
  try {
@@ -4758,7 +4758,7 @@ function Vr({ dataConfig: e, position: t = "bottom-right", theme: n, serviceWork
4758
4758
  }
4759
4759
  },
4760
4760
  react: async (e, t, n) => {
4761
- let r = x.current, i = g.current?.username;
4761
+ let r = C.current, i = v.current?.username;
4762
4762
  if (!r || !i) return;
4763
4763
  let a = (J.getState().conversations[e]?.reactions?.[t]?.[i] ?? []).includes(n) ? [] : [n];
4764
4764
  try {
@@ -4776,9 +4776,9 @@ function Vr({ dataConfig: e, position: t = "bottom-right", theme: n, serviceWork
4776
4776
  }
4777
4777
  },
4778
4778
  loadOlder: async (e) => {
4779
- let t = x.current, n = J.getState().ensure(e);
4780
- if (!(!t || n.complete || S.current.has(e))) {
4781
- S.current.add(e);
4779
+ let t = C.current, n = J.getState().ensure(e);
4780
+ if (!(!t || n.complete || T.current.has(e))) {
4781
+ T.current.add(e);
4782
4782
  try {
4783
4783
  let r = await t.history(e, n.oldest);
4784
4784
  J.getState().prependHistory(e, r.messages, r.complete, r.first), J.getState().applyReactions(r.reactions);
@@ -4788,31 +4788,31 @@ function Vr({ dataConfig: e, position: t = "bottom-right", theme: n, serviceWork
4788
4788
  message: e.message
4789
4789
  });
4790
4790
  } finally {
4791
- S.current.delete(e);
4791
+ T.current.delete(e);
4792
4792
  }
4793
4793
  }
4794
4794
  }
4795
4795
  }), []);
4796
4796
  i(() => {
4797
- if (!m) return;
4797
+ if (!g) return;
4798
4798
  let e = J.getState();
4799
4799
  e.reset(), J.setState({
4800
- me: m.username,
4801
- mucHost: `conference.${m.host}`,
4800
+ me: g.username,
4801
+ mucHost: `conference.${g.host}`,
4802
4802
  maxHeads: a,
4803
4803
  newChatButton: l
4804
4804
  });
4805
- let t = new _n(m, {
4805
+ let t = new _n(g, {
4806
4806
  status: (n, a) => {
4807
4807
  if (e.setStatus(n, a), Y("chat-island-status", {
4808
4808
  status: n,
4809
4809
  error: a
4810
- }), n === "online" && r && !C.current && typeof Notification < "u") {
4810
+ }), n === "online" && r && !D.current && typeof Notification < "u") {
4811
4811
  let e = Notification.permission;
4812
- (e === "granted" || v.current === "auto" && e === "default") && i();
4812
+ (e === "granted" || b.current === "auto" && e === "default") && i();
4813
4813
  }
4814
4814
  n === "online" && t.listGroups().then((t) => t.forEach((t) => e.setGroup(t.peer, t.name, t.members, t.avatar, t.owner))).catch(() => {}).then(() => t.recent()).then((e) => {
4815
- e && (J.getState().seed(e.messages, m.username), J.getState().applyReactions(e.reactions));
4815
+ e && (J.getState().seed(e.messages, g.username), J.getState().applyReactions(e.reactions));
4816
4816
  }).catch(() => {});
4817
4817
  },
4818
4818
  typing: (t, n) => e.setTyping(t, n),
@@ -4836,7 +4836,7 @@ function Vr({ dataConfig: e, position: t = "bottom-right", theme: n, serviceWork
4836
4836
  let n = J.getState(), r = document.visibilityState === "visible";
4837
4837
  if (r && n.open === e) return;
4838
4838
  let i = n.conversations[e], a = i?.kind === "group" ? i.name ?? e : n.contacts[e]?.name ?? e, o = t.oob ? "Attachment" : $(t.body), s = i?.kind === "group" && t.nick ? `${n.contacts[t.nick]?.name ?? t.nick}: ${o}` : o;
4839
- if (_.current && xn(), Y("chat-island-notify", {
4839
+ if (y.current && xn(), Y("chat-island-notify", {
4840
4840
  peer: e,
4841
4841
  name: a,
4842
4842
  body: s
@@ -4850,18 +4850,18 @@ function Vr({ dataConfig: e, position: t = "bottom-right", theme: n, serviceWork
4850
4850
  };
4851
4851
  } catch {}
4852
4852
  };
4853
- x.current = t;
4853
+ C.current = t;
4854
4854
  let i = () => {
4855
- r && !C.current && (C.current = !0, zn(m, r).then((e) => {
4855
+ r && !D.current && (D.current = !0, zn(g, r).then((e) => {
4856
4856
  if (!e) {
4857
- C.current = !1, J.setState({ push: Notification.permission === "denied" ? "denied" : "ask" });
4857
+ D.current = !1, J.setState({ push: Notification.permission === "denied" ? "denied" : "ask" });
4858
4858
  return;
4859
4859
  }
4860
4860
  return t.enablePush(e.service, e.node).then(() => {
4861
- T.current = e, J.setState({ push: "enabled" }), Y("chat-island-push", { enabled: !0 });
4861
+ O.current = e, J.setState({ push: "enabled" }), Y("chat-island-push", { enabled: !0 });
4862
4862
  });
4863
4863
  }).catch((e) => {
4864
- C.current = !1, Y("chat-island-error", {
4864
+ D.current = !1, Y("chat-island-error", {
4865
4865
  scope: "push",
4866
4866
  message: e.message
4867
4867
  });
@@ -4873,52 +4873,52 @@ function Vr({ dataConfig: e, position: t = "bottom-right", theme: n, serviceWork
4873
4873
  });
4874
4874
  let s = () => t.stop();
4875
4875
  window.addEventListener("pagehide", s), t.start();
4876
- let c = () => Pn(m.host, m.token).then(e.setMobile).catch(() => {});
4876
+ let c = () => Pn(g.host, g.token).then(e.setMobile).catch(() => {});
4877
4877
  c();
4878
4878
  let u = window.setInterval(c, 12e4);
4879
- Nn(m.host, m.token, m.username).then(e.setContacts).catch((e) => Y("chat-island-error", {
4879
+ Nn(g.host, g.token, g.username).then(e.setContacts).catch((e) => Y("chat-island-error", {
4880
4880
  scope: "contacts",
4881
4881
  message: e.message
4882
4882
  }));
4883
- let d = X("chat-island-open", ({ username: t }) => t && e.openChat(t)), f = X("chat-island-close", () => e.closeChat()), p = X("chat-island-new", () => e.setPicker(!0)), h = X("chat-island-delete", ({ username: e }) => e && k.remove(e)), g = X("chat-island-contacts", ({ contacts: t }) => t && e.setContacts(t)), y = X("chat-island-conversations-request", () => Y("chat-island-conversations", { conversations: Lr() }));
4883
+ let d = X("chat-island-open", ({ username: t }) => t && e.openChat(t)), f = X("chat-island-close", () => e.closeChat()), p = X("chat-island-new", () => e.setPicker(!0)), m = X("chat-island-delete", ({ username: e }) => e && ne.remove(e)), h = X("chat-island-contacts", ({ contacts: t }) => t && e.setContacts(t)), _ = X("chat-island-conversations-request", () => Y("chat-island-conversations", { conversations: Lr() }));
4884
4884
  return () => {
4885
- window.removeEventListener("pagehide", s), window.clearInterval(u), y(), p(), h(), d(), f(), g(), T.current && t.disablePush(T.current.service, T.current.node).catch(() => {}), T.current = null, t.stop(), x.current = null, C.current = !1;
4885
+ window.removeEventListener("pagehide", s), window.clearInterval(u), _(), p(), m(), d(), f(), h(), O.current && t.disablePush(O.current.service, O.current.node).catch(() => {}), O.current = null, t.stop(), C.current = null, D.current = !1;
4886
4886
  };
4887
4887
  }, [
4888
- m,
4888
+ g,
4889
4889
  r,
4890
- y
4890
+ x
4891
4891
  ]);
4892
- let A = J((e) => Object.keys(e.contacts).join(","));
4892
+ let M = J((e) => Object.keys(e.contacts).join(","));
4893
4893
  i(() => {
4894
- ne === "online" && A && x.current?.announce(A.split(","));
4895
- }, [ne, A]);
4894
+ j === "online" && M && C.current?.announce(M.split(","));
4895
+ }, [j, M]);
4896
4896
  let re = J((e) => Object.values(e.conversations).map((e) => `${e.peer}:${e.kind}:${e.name ?? ""}:${(e.members ?? []).length}:${e.unread}:${e.messages[e.messages.length - 1]?.id ?? ""}`).join("|") + "#" + Object.keys(e.contacts).length + "#" + Object.values(e.online).filter(Boolean).length);
4897
4897
  i(() => Y("chat-island-conversations", { conversations: Lr() }), [re]);
4898
- let j = J((e) => Object.values(e.conversations).reduce((e, t) => e + t.unread, 0));
4899
- if (i(() => Y("chat-island-unread", { total: j }), [j]), !m) return null;
4900
- let ie = O.anchor ? {
4901
- right: O.anchor.right,
4902
- bottom: O.anchor.bottom
4903
- } : void 0, ae = ie ? "" : t === "bottom-left" ? "ci-left-4 ci-bottom-5" : "ci-right-4 ci-bottom-5";
4898
+ let ie = J((e) => Object.values(e.conversations).reduce((e, t) => e + t.unread, 0));
4899
+ if (i(() => Y("chat-island-unread", { total: ie }), [ie]), !g) return null;
4900
+ let ae = m && !h && k.anchor ? {
4901
+ right: k.anchor.right,
4902
+ bottom: k.anchor.bottom
4903
+ } : void 0, oe = ae ? "" : t === "bottom-left" ? "ci-left-4 ci-bottom-5" : "ci-right-4 ci-bottom-5";
4904
4904
  return /* @__PURE__ */ d("div", {
4905
- ref: D,
4906
- style: ie,
4907
- onClickCapture: O.onClickCapture,
4908
- className: `chat-island-root ${h ? "ci-dark" : ""} ci-fixed ${ae} ci-z-[9999] ci-flex ci-items-end ci-gap-3 ci-font-sans ci-select-none`,
4909
- "data-status": ne,
4905
+ ref: ee,
4906
+ style: ae,
4907
+ onClickCapture: k.onClickCapture,
4908
+ className: `chat-island-root ${_ ? "ci-dark" : ""} ci-fixed ${oe} ci-z-[9999] ci-flex ci-items-end ci-gap-3 ci-font-sans ci-select-none`,
4909
+ "data-status": j,
4910
4910
  children: /* @__PURE__ */ f(Rr, { children: [
4911
- ee && /* @__PURE__ */ d(jr, {
4912
- peer: ee,
4913
- actions: k,
4914
- onDragStart: O.start
4911
+ te && /* @__PURE__ */ d(jr, {
4912
+ peer: te,
4913
+ actions: ne,
4914
+ onDragStart: h ?? (m ? k.start : void 0)
4915
4915
  }),
4916
- te && /* @__PURE__ */ d(Nr, {
4916
+ A && /* @__PURE__ */ d(Nr, {
4917
4917
  onOpen: (e) => J.getState().openChat(e),
4918
- onCreateGroup: k.createGroup
4918
+ onCreateGroup: ne.createGroup
4919
4919
  }),
4920
4920
  /* @__PURE__ */ d(Kn, {
4921
- onDragStart: O.start,
4921
+ onDragStart: h ?? (m ? k.start : void 0),
4922
4922
  pushButton: u !== "auto"
4923
4923
  })
4924
4924
  ] })