@orbitconnect/react 0.1.4 → 0.2.0

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
@@ -1134,7 +1134,7 @@ function ee(e) {
1134
1134
  let T = w, E;
1135
1135
  t[14] === Symbol.for("react.memo_cache_sentinel") ? (E = () => {
1136
1136
  for (let e of l.current.values()) e.close();
1137
- l.current.clear(), u.current?.getTracks().forEach(ne), u.current = null;
1137
+ l.current.clear(), u.current?.getTracks().forEach(re), u.current = null;
1138
1138
  }, t[14] = E) : E = t[14];
1139
1139
  let D = E, O;
1140
1140
  t[15] !== y || t[16] !== s ? (O = async (e) => {
@@ -1154,7 +1154,7 @@ function ee(e) {
1154
1154
  t && await t.setRemoteDescription({
1155
1155
  type: "answer",
1156
1156
  sdp: e.sdp
1157
- }).catch(te);
1157
+ }).catch(ne);
1158
1158
  }, t[18] = k) : k = t[18], F("meeting:answer", k);
1159
1159
  let j;
1160
1160
  t[19] === Symbol.for("react.memo_cache_sentinel") ? (j = async (e) => {
@@ -1164,7 +1164,7 @@ function ee(e) {
1164
1164
  candidate: e.candidate,
1165
1165
  sdpMid: e.sdpMid ?? null,
1166
1166
  sdpMLineIndex: e.sdpMLineIndex ?? null
1167
- }).catch(Q);
1167
+ }).catch(te);
1168
1168
  }, t[19] = j) : j = t[19], F("meeting:ice_candidate", j);
1169
1169
  let M;
1170
1170
  t[20] === Symbol.for("react.memo_cache_sentinel") ? (M = (e) => {
@@ -1190,15 +1190,15 @@ function ee(e) {
1190
1190
  toggleCamera: I
1191
1191
  }, t[22] = C, t[23] = L), L;
1192
1192
  }
1193
- function Q() {}
1194
1193
  function te() {}
1195
- function ne(e) {
1194
+ function ne() {}
1195
+ function re(e) {
1196
1196
  return e.stop();
1197
1197
  }
1198
1198
  //#endregion
1199
1199
  //#region src/meeting/MeetingProvider.tsx
1200
- var re = 0;
1201
- function ie({ children: e }) {
1200
+ var ie = 0;
1201
+ function ae({ children: e }) {
1202
1202
  let n = Y(), { socket: i } = A(), { play: a } = U(), [c, u] = s(null), [d, f] = s(null), [p, m] = s(/* @__PURE__ */ new Map()), [h, g] = s([]), _ = o(null), v = o(null);
1203
1203
  r(() => {
1204
1204
  _.current = n.meeting?.meetingId ?? null;
@@ -1220,7 +1220,7 @@ function ie({ children: e }) {
1220
1220
  F("meeting:reaction", (e) => {
1221
1221
  if (e.meeting_id !== _.current) return;
1222
1222
  let t = {
1223
- id: `r-${++re}`,
1223
+ id: `r-${++ie}`,
1224
1224
  emoji: e.emoji,
1225
1225
  name: e.display_name
1226
1226
  };
@@ -1301,13 +1301,13 @@ function ie({ children: e }) {
1301
1301
  }
1302
1302
  //#endregion
1303
1303
  //#region src/offline/QueueManager.ts
1304
- var ae = [
1304
+ var oe = [
1305
1305
  2e3,
1306
1306
  5e3,
1307
1307
  15e3,
1308
1308
  3e4,
1309
1309
  6e4
1310
- ], oe = 5e3, se = class {
1310
+ ], se = 5e3, ce = class {
1311
1311
  storage;
1312
1312
  sendFn = null;
1313
1313
  listeners = /* @__PURE__ */ new Map();
@@ -1459,7 +1459,7 @@ var ae = [
1459
1459
  }), setTimeout(() => this.storage.remove(e.localId), 2e3), !0;
1460
1460
  } catch (t) {
1461
1461
  let n = t instanceof Error ? t.message : String(t), r = e.retries + 1;
1462
- if (r >= oe) await this.storage.update(e.localId, {
1462
+ if (r >= se) await this.storage.update(e.localId, {
1463
1463
  status: "failed",
1464
1464
  retries: r,
1465
1465
  updatedAt: Date.now()
@@ -1475,7 +1475,7 @@ var ae = [
1475
1475
  retries: r,
1476
1476
  updatedAt: Date.now()
1477
1477
  });
1478
- let t = ae[Math.min(r - 1, ae.length - 1)], n = Math.random() * t * .2, i = setTimeout(() => {
1478
+ let t = oe[Math.min(r - 1, oe.length - 1)], n = Math.random() * t * .2, i = setTimeout(() => {
1479
1479
  this.retryTimers.delete(e.localId), this.online && !this.paused && (e.retries = r, e.status = "queued", this.storage.update(e.localId, {
1480
1480
  status: "queued",
1481
1481
  updatedAt: Date.now()
@@ -1486,11 +1486,11 @@ var ae = [
1486
1486
  return !1;
1487
1487
  }
1488
1488
  }
1489
- }, ce = "orbitconnect_offline_db", le = 1, $ = "queue", ue = class {
1489
+ }, le = "orbitconnect_offline_db", Q = 1, $ = "queue", ue = class {
1490
1490
  db = null;
1491
1491
  async open() {
1492
1492
  if (!this.db) return new Promise((e, t) => {
1493
- let n = indexedDB.open(ce, le);
1493
+ let n = indexedDB.open(le, Q);
1494
1494
  n.onupgradeneeded = (e) => {
1495
1495
  let t = e.target.result;
1496
1496
  if (!t.objectStoreNames.contains($)) {
@@ -1719,7 +1719,7 @@ function me() {
1719
1719
  //#region src/offline/OfflineQueueProvider.tsx
1720
1720
  function he({ children: e }) {
1721
1721
  let { apiClient: n } = v(), { socket: i, status: c } = A(), [u, d] = s(navigator.onLine), f = o(null), p = o(null), m = o(null), h = o(null), g = o(c);
1722
- f.current ||= new ue(), p.current ||= new se(f.current), m.current ||= new de(), h.current ||= new fe();
1722
+ f.current ||= new ue(), p.current ||= new ce(f.current), m.current ||= new de(), h.current ||= new fe();
1723
1723
  let _ = p.current;
1724
1724
  r(() => {
1725
1725
  _.setSendFn(async (e) => {
@@ -1886,7 +1886,7 @@ function Te(e) {
1886
1886
  e2eSessionKey: C
1887
1887
  }, t[10] = h, t[11] = d, t[12] = a, t[13] = n, t[14] = v, t[15] = C, t[16] = O) : O = t[16];
1888
1888
  let k = O, A;
1889
- t[17] === f ? A = t[18] : (A = /* @__PURE__ */ l(he, { children: /* @__PURE__ */ l(G, { children: /* @__PURE__ */ l(ie, { children: f }) }) }), t[17] = f, t[18] = A);
1889
+ t[17] === f ? A = t[18] : (A = /* @__PURE__ */ l(he, { children: /* @__PURE__ */ l(G, { children: /* @__PURE__ */ l(ae, { children: f }) }) }), t[17] = f, t[18] = A);
1890
1890
  let j;
1891
1891
  t[19] !== A || t[20] !== k ? (j = /* @__PURE__ */ l(_.Provider, {
1892
1892
  value: k,
@@ -1971,11 +1971,12 @@ function ke(e, t) {
1971
1971
  time: r ? new Date(r.created_at).toLocaleTimeString([], {
1972
1972
  hour: "2-digit",
1973
1973
  minute: "2-digit"
1974
- }) : ""
1974
+ }) : "",
1975
+ context: e.context ?? null
1975
1976
  };
1976
1977
  }
1977
1978
  function Ae() {
1978
- let e = (0, g.c)(25), { apiClient: t, appUserId: n } = v(), i;
1979
+ let e = (0, g.c)(30), { apiClient: t, appUserId: n } = v(), i;
1979
1980
  e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = [], e[0] = i) : i = e[0];
1980
1981
  let [a, c] = s(i), [l, u] = s(!0), d;
1981
1982
  e[1] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ new Map(), e[1] = d) : d = e[1];
@@ -2064,20 +2065,39 @@ function Ae() {
2064
2065
  }));
2065
2066
  }, e[16] = w) : w = e[16], F("presence:changed", w);
2066
2067
  let T;
2067
- e[17] !== t || e[18] !== n ? (T = async (e) => {
2068
- let r = await t.post("/conversations", {
2068
+ e[17] === Symbol.for("react.memo_cache_sentinel") ? (T = (e) => {
2069
+ let { conversation_id: t, context: n } = e;
2070
+ c((e) => e.map((e) => e.id === t ? {
2071
+ ...e,
2072
+ context: n
2073
+ } : e));
2074
+ }, e[17] = T) : T = e[17], F("conversation:context_updated", T);
2075
+ let E;
2076
+ e[18] !== t || e[19] !== n ? (E = async (e, r) => {
2077
+ let i = await t.post("/conversations", {
2069
2078
  type: "direct",
2070
- participant_id: e
2079
+ participant_id: e,
2080
+ ...r ? { context: r } : {}
2071
2081
  });
2072
- return c((e) => [ke(r, n), ...e]), r.id;
2073
- }, e[17] = t, e[18] = n, e[19] = T) : T = e[19];
2074
- let E = T, D;
2075
- return e[20] !== a || e[21] !== E || e[22] !== l || e[23] !== m ? (D = {
2082
+ return c((e) => [ke(i, n), ...e]), i.id;
2083
+ }, e[18] = t, e[19] = n, e[20] = E) : E = e[20];
2084
+ let D = E, O;
2085
+ e[21] !== t || e[22] !== n ? (O = async (e, r) => {
2086
+ let i = await t.post("/conversations", {
2087
+ type: "group",
2088
+ participant_ids: e,
2089
+ ...r ? { context: r } : {}
2090
+ });
2091
+ return c((e) => [ke(i, n), ...e]), i.id;
2092
+ }, e[21] = t, e[22] = n, e[23] = O) : O = e[23];
2093
+ let k = O, A;
2094
+ return e[24] !== a || e[25] !== D || e[26] !== k || e[27] !== l || e[28] !== m ? (A = {
2076
2095
  conversations: a,
2077
2096
  loading: l,
2078
- createDirect: E,
2097
+ createDirect: D,
2098
+ createGroup: k,
2079
2099
  refresh: m
2080
- }, e[20] = a, e[21] = E, e[22] = l, e[23] = m, e[24] = D) : D = e[24], D;
2100
+ }, e[24] = a, e[25] = D, e[26] = k, e[27] = l, e[28] = m, e[29] = A) : A = e[29], A;
2081
2101
  }
2082
2102
  function je(e) {
2083
2103
  return [e.id, {
@@ -3925,8 +3945,8 @@ function pt(e) {
3925
3945
  }, t[52] = Z) : Z = t[52];
3926
3946
  let ee;
3927
3947
  t[53] === X ? ee = t[54] : (ee = X.filter(gt), t[53] = X, t[54] = ee);
3928
- let Q;
3929
- return t[55] !== T || t[56] !== ee ? (Q = /* @__PURE__ */ l("div", {
3948
+ let te;
3949
+ return t[55] !== T || t[56] !== ee ? (te = /* @__PURE__ */ l("div", {
3930
3950
  ref: y,
3931
3951
  role: "menu",
3932
3952
  className: "absolute z-50 min-w-[160px] rounded-xl border overflow-hidden",
@@ -3946,7 +3966,7 @@ function pt(e) {
3946
3966
  children: e.icon
3947
3967
  }), e.label]
3948
3968
  }, e.label))
3949
- }), t[55] = T, t[56] = ee, t[57] = Q) : Q = t[57], Q;
3969
+ }), t[55] = T, t[56] = ee, t[57] = te) : te = t[57], te;
3950
3970
  }
3951
3971
  function mt(e) {
3952
3972
  e.currentTarget.style.backgroundColor = "transparent";
@@ -4696,25 +4716,25 @@ function Ft(e) {
4696
4716
  children: s
4697
4717
  }), t[14] = e, t[15] = s, t[16] = c) : c = t[16], c;
4698
4718
  }
4699
- let J = i ? "var(--oc-bubble-sender)" : "var(--oc-bubble-receiver)", Y = i ? "var(--oc-bubble-sender-fg)" : "var(--oc-bubble-receiver-fg)", X = i ? b ? "14px" : "14px 14px 4px 14px" : b ? "14px" : "14px 14px 14px 4px", Z = B === "queued" || B === "sending" ? .7 : 1, ee = m?.type === "image" || m?.type === "video", Q = m?.type === "sticker", te = ee && !r, ne;
4700
- t[17] !== D || t[18] !== v ? (ne = function() {
4719
+ let J = i ? "var(--oc-bubble-sender)" : "var(--oc-bubble-receiver)", Y = i ? "var(--oc-bubble-sender-fg)" : "var(--oc-bubble-receiver-fg)", X = i ? b ? "14px" : "14px 14px 4px 14px" : b ? "14px" : "14px 14px 14px 4px", Z = B === "queued" || B === "sending" ? .7 : 1, ee = m?.type === "image" || m?.type === "video", te = m?.type === "sticker", ne = ee && !r, re;
4720
+ t[17] !== D || t[18] !== v ? (re = function() {
4701
4721
  !D || !v || D(v.messageId ?? v.senderName);
4702
- }, t[17] = D, t[18] = v, t[19] = ne) : ne = t[19];
4703
- let re = ne, ie = `flex flex-col gap-0.5 max-w-full ${i ? "items-end" : "items-start"}`, ae;
4704
- t[20] === Symbol.for("react.memo_cache_sentinel") ? (ae = () => H(!0), t[20] = ae) : ae = t[20];
4705
- let oe;
4706
- t[21] !== U || t[22] !== G ? (oe = () => {
4707
- !U && !G && H(!1);
4708
- }, t[21] = U, t[22] = G, t[23] = oe) : oe = t[23];
4722
+ }, t[17] = D, t[18] = v, t[19] = re) : re = t[19];
4723
+ let ie = re, ae = `flex flex-col gap-0.5 max-w-full ${i ? "items-end" : "items-start"}`, oe;
4724
+ t[20] === Symbol.for("react.memo_cache_sentinel") ? (oe = () => H(!0), t[20] = oe) : oe = t[20];
4709
4725
  let se;
4710
- t[24] === F ? se = t[25] : (se = F ? {
4726
+ t[21] !== U || t[22] !== G ? (se = () => {
4727
+ !U && !G && H(!1);
4728
+ }, t[21] = U, t[22] = G, t[23] = se) : se = t[23];
4729
+ let ce;
4730
+ t[24] === F ? ce = t[25] : (ce = F ? {
4711
4731
  backgroundColor: "rgba(234,179,8,0.12)",
4712
4732
  borderRadius: "8px",
4713
4733
  padding: "2px 4px",
4714
4734
  margin: "-2px -4px"
4715
- } : void 0, t[24] = F, t[25] = se);
4716
- let ce = `relative flex items-end gap-2 max-w-[85%] ${i ? "flex-row-reverse" : ""}`, le;
4717
- t[26] !== E || t[27] !== w || t[28] !== T || t[29] !== i ? (le = w && /* @__PURE__ */ l("button", {
4735
+ } : void 0, t[24] = F, t[25] = ce);
4736
+ let le = `relative flex items-end gap-2 max-w-[85%] ${i ? "flex-row-reverse" : ""}`, Q;
4737
+ t[26] !== E || t[27] !== w || t[28] !== T || t[29] !== i ? (Q = w && /* @__PURE__ */ l("button", {
4718
4738
  onClick: E,
4719
4739
  className: "flex-shrink-0 flex items-center justify-center w-5 h-5 rounded border-2 cursor-pointer transition-colors",
4720
4740
  style: {
@@ -4734,7 +4754,7 @@ function Ft(e) {
4734
4754
  strokeLinejoin: "round",
4735
4755
  children: /* @__PURE__ */ l("polyline", { points: "20 6 9 17 4 12" })
4736
4756
  })
4737
- }), t[26] = E, t[27] = w, t[28] = T, t[29] = i, t[30] = le) : le = t[30];
4757
+ }), t[26] = E, t[27] = w, t[28] = T, t[29] = i, t[30] = Q) : Q = t[30];
4738
4758
  let $;
4739
4759
  t[31] !== f || t[32] !== b || t[33] !== i || t[34] !== p ? ($ = !i && /* @__PURE__ */ l("div", {
4740
4760
  style: { opacity: +!b },
@@ -4744,7 +4764,7 @@ function Ft(e) {
4744
4764
  size: 28
4745
4765
  })
4746
4766
  }), t[31] = f, t[32] = b, t[33] = i, t[34] = p, t[35] = $) : $ = t[35];
4747
- let ue = Q ? "transparent" : B === "failed" ? "var(--oc-bubble-failed, rgba(239,68,68,0.15))" : J, de;
4767
+ let ue = te ? "transparent" : B === "failed" ? "var(--oc-bubble-failed, rgba(239,68,68,0.15))" : J, de;
4748
4768
  t[36] === B ? de = t[37] : (de = B === "failed" ? {
4749
4769
  border: "1px solid var(--oc-destructive, #ef4444)",
4750
4770
  borderStyle: "dashed"
@@ -4758,7 +4778,7 @@ function Ft(e) {
4758
4778
  ...de
4759
4779
  }, t[38] = X, t[39] = Y, t[40] = Z, t[41] = de, t[42] = ue, t[43] = fe) : fe = t[43];
4760
4780
  let pe;
4761
- t[44] !== m || t[45] !== X || t[46] !== r || t[47] !== C || t[48] !== S || t[49] !== re || t[50] !== z || t[51] !== b || t[52] !== ee || t[53] !== B || t[54] !== R || t[55] !== te || t[56] !== I || t[57] !== x || t[58] !== v || t[59] !== i || t[60] !== d || t[61] !== a ? (pe = x ? /* @__PURE__ */ l("div", {
4781
+ t[44] !== m || t[45] !== X || t[46] !== r || t[47] !== C || t[48] !== S || t[49] !== ie || t[50] !== z || t[51] !== b || t[52] !== ee || t[53] !== B || t[54] !== R || t[55] !== ne || t[56] !== I || t[57] !== x || t[58] !== v || t[59] !== i || t[60] !== d || t[61] !== a ? (pe = x ? /* @__PURE__ */ l("div", {
4762
4782
  className: "px-3.5 py-2.5 text-sm italic",
4763
4783
  style: { color: "var(--oc-muted-foreground, #fff)" },
4764
4784
  children: "This message was recalled"
@@ -4785,10 +4805,10 @@ function Ft(e) {
4785
4805
  borderColor: "var(--oc-reply-border)",
4786
4806
  backgroundColor: i ? "var(--oc-reply-bg-sender)" : "var(--oc-reply-bg-receiver)"
4787
4807
  },
4788
- onClick: re,
4808
+ onClick: ie,
4789
4809
  role: "button",
4790
4810
  tabIndex: 0,
4791
- onKeyDown: (e) => e.key === "Enter" && re(),
4811
+ onKeyDown: (e) => e.key === "Enter" && ie(),
4792
4812
  "aria-label": "Jump to original message",
4793
4813
  children: [
4794
4814
  /* @__PURE__ */ u("div", {
@@ -4886,7 +4906,7 @@ function Ft(e) {
4886
4906
  sender: i
4887
4907
  }, e[0]) : null;
4888
4908
  })(),
4889
- te && !b && /* @__PURE__ */ l(Nt, {
4909
+ ne && !b && /* @__PURE__ */ l(Nt, {
4890
4910
  time: a,
4891
4911
  sender: i,
4892
4912
  status: d,
@@ -4894,7 +4914,7 @@ function Ft(e) {
4894
4914
  edited: C,
4895
4915
  offlineStatus: B
4896
4916
  })
4897
- ] }), t[44] = m, t[45] = X, t[46] = r, t[47] = C, t[48] = S, t[49] = re, t[50] = z, t[51] = b, t[52] = ee, t[53] = B, t[54] = R, t[55] = te, t[56] = I, t[57] = x, t[58] = v, t[59] = i, t[60] = d, t[61] = a, t[62] = pe) : pe = t[62];
4917
+ ] }), t[44] = m, t[45] = X, t[46] = r, t[47] = C, t[48] = S, t[49] = ie, t[50] = z, t[51] = b, t[52] = ee, t[53] = B, t[54] = R, t[55] = ne, t[56] = I, t[57] = x, t[58] = v, t[59] = i, t[60] = d, t[61] = a, t[62] = pe) : pe = t[62];
4898
4918
  let me;
4899
4919
  t[63] !== fe || t[64] !== pe ? (me = /* @__PURE__ */ l("div", {
4900
4920
  className: "relative overflow-hidden",
@@ -4949,16 +4969,16 @@ function Ft(e) {
4949
4969
  ]
4950
4970
  }), t[66] = n, t[67] = V, t[68] = U, t[69] = M, t[70] = A, t[71] = j, t[72] = P, t[73] = L, t[74] = k, t[75] = N, t[76] = O, t[77] = E, t[78] = I, t[79] = G, t[80] = w, t[81] = i, t[82] = he) : he = t[82];
4951
4971
  let ge;
4952
- t[83] !== me || t[84] !== he || t[85] !== ce || t[86] !== le || t[87] !== $ ? (ge = /* @__PURE__ */ u("div", {
4972
+ t[83] !== me || t[84] !== he || t[85] !== le || t[86] !== Q || t[87] !== $ ? (ge = /* @__PURE__ */ u("div", {
4953
4973
  ref: q,
4954
- className: ce,
4974
+ className: le,
4955
4975
  children: [
4956
- le,
4976
+ Q,
4957
4977
  $,
4958
4978
  me,
4959
4979
  he
4960
4980
  ]
4961
- }), t[83] = me, t[84] = he, t[85] = ce, t[86] = le, t[87] = $, t[88] = ge) : ge = t[88];
4981
+ }), t[83] = me, t[84] = he, t[85] = le, t[86] = Q, t[87] = $, t[88] = ge) : ge = t[88];
4962
4982
  let _e;
4963
4983
  t[89] !== B || t[90] !== i ? (_e = B === "failed" && /* @__PURE__ */ u("div", {
4964
4984
  className: `flex items-center gap-1.5 text-[11px] mt-0.5 ${i ? "pr-1 justify-end" : "pl-9"}`,
@@ -5011,26 +5031,26 @@ function Ft(e) {
5011
5031
  children: y.map(It)
5012
5032
  }), t[92] = y, t[93] = i, t[94] = ve) : ve = t[94];
5013
5033
  let ye;
5014
- t[95] !== C || t[96] !== b || t[97] !== B || t[98] !== te || t[99] !== i || t[100] !== d || t[101] !== a ? (ye = (!b || C) && !te && /* @__PURE__ */ l(Nt, {
5034
+ t[95] !== C || t[96] !== b || t[97] !== B || t[98] !== ne || t[99] !== i || t[100] !== d || t[101] !== a ? (ye = (!b || C) && !ne && /* @__PURE__ */ l(Nt, {
5015
5035
  time: a,
5016
5036
  sender: i,
5017
5037
  status: d,
5018
5038
  edited: C,
5019
5039
  offlineStatus: B
5020
- }), t[95] = C, t[96] = b, t[97] = B, t[98] = te, t[99] = i, t[100] = d, t[101] = a, t[102] = ye) : ye = t[102];
5040
+ }), t[95] = C, t[96] = b, t[97] = B, t[98] = ne, t[99] = i, t[100] = d, t[101] = a, t[102] = ye) : ye = t[102];
5021
5041
  let be;
5022
- return t[103] !== ge || t[104] !== _e || t[105] !== ve || t[106] !== ye || t[107] !== ie || t[108] !== oe || t[109] !== se ? (be = /* @__PURE__ */ u("div", {
5023
- className: ie,
5024
- onMouseEnter: ae,
5025
- onMouseLeave: oe,
5026
- style: se,
5042
+ return t[103] !== ge || t[104] !== _e || t[105] !== ve || t[106] !== ye || t[107] !== ae || t[108] !== se || t[109] !== ce ? (be = /* @__PURE__ */ u("div", {
5043
+ className: ae,
5044
+ onMouseEnter: oe,
5045
+ onMouseLeave: se,
5046
+ style: ce,
5027
5047
  children: [
5028
5048
  ge,
5029
5049
  _e,
5030
5050
  ve,
5031
5051
  ye
5032
5052
  ]
5033
- }), t[103] = ge, t[104] = _e, t[105] = ve, t[106] = ye, t[107] = ie, t[108] = oe, t[109] = se, t[110] = be) : be = t[110], be;
5053
+ }), t[103] = ge, t[104] = _e, t[105] = ve, t[106] = ye, t[107] = ae, t[108] = se, t[109] = ce, t[110] = be) : be = t[110], be;
5034
5054
  }
5035
5055
  function It(e, t) {
5036
5056
  return /* @__PURE__ */ u("span", {
@@ -6363,8 +6383,8 @@ function un(e) {
6363
6383
  Z
6364
6384
  ]
6365
6385
  }), t[41] = K, t[42] = X, t[43] = Z, t[44] = ee) : ee = t[44];
6366
- let Q;
6367
- t[45] !== x || t[46] !== h ? (Q = h === "search" && /* @__PURE__ */ l("div", {
6386
+ let te;
6387
+ t[45] !== x || t[46] !== h ? (te = h === "search" && /* @__PURE__ */ l("div", {
6368
6388
  className: "flex-shrink-0 px-3 pt-2 pb-1",
6369
6389
  children: /* @__PURE__ */ u("div", {
6370
6390
  className: "flex items-center gap-2 rounded-xl px-3 h-9 border",
@@ -6404,11 +6424,11 @@ function un(e) {
6404
6424
  style: { color: "var(--oc-foreground)" }
6405
6425
  })]
6406
6426
  })
6407
- }), t[45] = x, t[46] = h, t[47] = Q) : Q = t[47];
6408
- let te;
6409
- t[48] === Symbol.for("react.memo_cache_sentinel") ? (te = { scrollbarWidth: "none" }, t[48] = te) : te = t[48];
6427
+ }), t[45] = x, t[46] = h, t[47] = te) : te = t[47];
6410
6428
  let ne;
6411
- t[49] !== B || t[50] !== y || t[51] !== R || t[52] !== E || t[53] !== x || t[54] !== w || t[55] !== h ? (ne = E ? /* @__PURE__ */ l("div", {
6429
+ t[48] === Symbol.for("react.memo_cache_sentinel") ? (ne = { scrollbarWidth: "none" }, t[48] = ne) : ne = t[48];
6430
+ let re;
6431
+ t[49] !== B || t[50] !== y || t[51] !== R || t[52] !== E || t[53] !== x || t[54] !== w || t[55] !== h ? (re = E ? /* @__PURE__ */ l("div", {
6412
6432
  className: "flex items-center justify-center h-full text-sm",
6413
6433
  style: { color: "var(--oc-muted-foreground)" },
6414
6434
  children: "Loading…"
@@ -6425,15 +6445,15 @@ function un(e) {
6425
6445
  }) : B ? /* @__PURE__ */ l(ln, {
6426
6446
  stickers: B.stickers,
6427
6447
  onSelect: R
6428
- }) : null, t[49] = B, t[50] = y, t[51] = R, t[52] = E, t[53] = x, t[54] = w, t[55] = h, t[56] = ne) : ne = t[56];
6429
- let re;
6430
- t[57] === ne ? re = t[58] : (re = /* @__PURE__ */ l("div", {
6431
- className: "flex-1 overflow-y-auto",
6432
- style: te,
6433
- children: ne
6434
- }), t[57] = ne, t[58] = re);
6448
+ }) : null, t[49] = B, t[50] = y, t[51] = R, t[52] = E, t[53] = x, t[54] = w, t[55] = h, t[56] = re) : re = t[56];
6435
6449
  let ie;
6436
- t[59] === h ? ie = t[60] : (ie = (h === "featured" || h === "search") && /* @__PURE__ */ l("div", {
6450
+ t[57] === re ? ie = t[58] : (ie = /* @__PURE__ */ l("div", {
6451
+ className: "flex-1 overflow-y-auto",
6452
+ style: ne,
6453
+ children: re
6454
+ }), t[57] = re, t[58] = ie);
6455
+ let ae;
6456
+ t[59] === h ? ae = t[60] : (ae = (h === "featured" || h === "search") && /* @__PURE__ */ l("div", {
6437
6457
  className: "flex-shrink-0 flex items-center justify-end px-3 py-1.5 border-t",
6438
6458
  style: { borderColor: "var(--oc-border)" },
6439
6459
  children: /* @__PURE__ */ l("span", {
@@ -6444,19 +6464,19 @@ function un(e) {
6444
6464
  },
6445
6465
  children: "Powered by Tenor"
6446
6466
  })
6447
- }), t[59] = h, t[60] = ie);
6448
- let ae;
6449
- return t[61] !== ee || t[62] !== Q || t[63] !== re || t[64] !== ie ? (ae = /* @__PURE__ */ u("div", {
6467
+ }), t[59] = h, t[60] = ae);
6468
+ let oe;
6469
+ return t[61] !== ee || t[62] !== te || t[63] !== ie || t[64] !== ae ? (oe = /* @__PURE__ */ u("div", {
6450
6470
  ref: m,
6451
6471
  className: "flex flex-col rounded-2xl border overflow-hidden",
6452
6472
  style: V,
6453
6473
  children: [
6454
6474
  ee,
6455
- Q,
6456
- re,
6457
- ie
6475
+ te,
6476
+ ie,
6477
+ ae
6458
6478
  ]
6459
- }), t[61] = ee, t[62] = Q, t[63] = re, t[64] = ie, t[65] = ae) : ae = t[65], ae;
6479
+ }), t[61] = ee, t[62] = te, t[63] = ie, t[64] = ae, t[65] = oe) : oe = t[65], oe;
6460
6480
  }
6461
6481
  //#endregion
6462
6482
  //#region src/components/chat/QuickMessages.tsx
@@ -7019,8 +7039,8 @@ function wn(e) {
7019
7039
  let e = window.getSelection();
7020
7040
  e && e.rangeCount > 0 && v.current?.contains(e.anchorNode) && (X.current = e.getRangeAt(0).cloneRange());
7021
7041
  }, t[11] = Z) : Z = t[11];
7022
- let ee = Z, Q;
7023
- t[12] === a ? Q = t[13] : (Q = (e) => {
7042
+ let ee = Z, te;
7043
+ t[12] === a ? te = t[13] : (te = (e) => {
7024
7044
  let t = v.current;
7025
7045
  if (!t) return;
7026
7046
  t.focus();
@@ -7035,30 +7055,30 @@ function wn(e) {
7035
7055
  r.insertNode(i), r.setStartAfter(i), r.collapse(!0), n.removeAllRanges(), n.addRange(r), X.current = r.cloneRange();
7036
7056
  } else t.innerText += e;
7037
7057
  N(!0), F(t.innerText.length), a?.();
7038
- }, t[12] = a, t[13] = Q);
7039
- let te = Q, ne;
7040
- t[14] === Symbol.for("react.memo_cache_sentinel") ? (ne = (e) => {
7058
+ }, t[12] = a, t[13] = te);
7059
+ let ne = te, re;
7060
+ t[14] === Symbol.for("react.memo_cache_sentinel") ? (re = (e) => {
7041
7061
  let t = v.current;
7042
7062
  if (!t) return;
7043
7063
  t.focus(), t.innerText = e;
7044
7064
  let n = document.createRange(), r = window.getSelection();
7045
7065
  n.selectNodeContents(t), n.collapse(!1), r?.removeAllRanges(), r?.addRange(n), N(!0), F(e.length);
7046
- }, t[14] = ne) : ne = t[14];
7047
- let re = ne, ie;
7048
- t[15] === i ? ie = t[16] : (ie = (e) => {
7066
+ }, t[14] = re) : re = t[14];
7067
+ let ie = re, ae;
7068
+ t[15] === i ? ae = t[16] : (ae = (e) => {
7049
7069
  i?.({
7050
7070
  type: "sticker",
7051
7071
  url: e.url,
7052
7072
  filename: e.title ?? "sticker"
7053
7073
  }), D(!1);
7054
- }, t[15] = i, t[16] = ie);
7055
- let ae = ie, oe = jn, se, ce;
7056
- if (t[17] === Symbol.for("react.memo_cache_sentinel") ? (se = () => {
7074
+ }, t[15] = i, t[16] = ae);
7075
+ let oe = ae, se = jn, ce, le;
7076
+ if (t[17] === Symbol.for("react.memo_cache_sentinel") ? (ce = () => {
7057
7077
  let e = (e) => {
7058
7078
  e.key === "Escape" && (x(!1), C(!1), D(!1), k(!1), L(null));
7059
7079
  };
7060
7080
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
7061
- }, ce = [], t[17] = se, t[18] = ce) : (se = t[17], ce = t[18]), r(se, ce), w) {
7081
+ }, le = [], t[17] = ce, t[18] = le) : (ce = t[17], le = t[18]), r(ce, le), w) {
7062
7082
  let e;
7063
7083
  t[19] === Symbol.for("react.memo_cache_sentinel") ? (e = { backgroundColor: "var(--oc-composer-bg)" }, t[19] = e) : e = t[19];
7064
7084
  let n;
@@ -7077,11 +7097,11 @@ function wn(e) {
7077
7097
  })
7078
7098
  }), t[23] = n, t[24] = a), a;
7079
7099
  }
7080
- let le;
7081
- t[25] === I ? le = t[26] : (le = I && /* @__PURE__ */ l(yn, {
7100
+ let Q;
7101
+ t[25] === I ? Q = t[26] : (Q = I && /* @__PURE__ */ l(yn, {
7082
7102
  onFormat: Y,
7083
7103
  position: I
7084
- }), t[25] = I, t[26] = le);
7104
+ }), t[25] = I, t[26] = Q);
7085
7105
  let $;
7086
7106
  t[27] === Symbol.for("react.memo_cache_sentinel") ? ($ = { backgroundColor: "var(--oc-composer-bg)" }, t[27] = $) : $ = t[27];
7087
7107
  let ue;
@@ -7228,7 +7248,7 @@ function wn(e) {
7228
7248
  ]
7229
7249
  })
7230
7250
  }), O && /* @__PURE__ */ l(hn, {
7231
- onSelect: re,
7251
+ onSelect: ie,
7232
7252
  onClose: () => k(!1),
7233
7253
  onManage: () => {
7234
7254
  k(!1), j(!0);
@@ -7248,7 +7268,7 @@ function wn(e) {
7248
7268
  suppressContentEditableWarning: !0,
7249
7269
  onKeyDown: V,
7250
7270
  onInput: U,
7251
- onPaste: oe,
7271
+ onPaste: se,
7252
7272
  onBlur: ee,
7253
7273
  "data-placeholder": h,
7254
7274
  className: "px-3.5 py-2.5 text-sm leading-relaxed outline-none max-h-[120px] overflow-y-auto empty:before:content-[attr(data-placeholder)] empty:before:pointer-events-none",
@@ -7387,15 +7407,15 @@ function wn(e) {
7387
7407
  ]
7388
7408
  }), t[79] = _e, t[80] = ve, t[81] = De, t[82] = Ne, t[83] = Pe, t[84] = Fe) : Fe = t[84];
7389
7409
  let Ie;
7390
- t[85] !== te || t[86] !== b ? (Ie = b && /* @__PURE__ */ l("div", {
7410
+ t[85] !== ne || t[86] !== b ? (Ie = b && /* @__PURE__ */ l("div", {
7391
7411
  className: "absolute bottom-full right-0 mb-2 z-50",
7392
7412
  children: /* @__PURE__ */ l(Ut, {
7393
7413
  onSelect: (e) => {
7394
- te(e), v.current?.focus();
7414
+ ne(e), v.current?.focus();
7395
7415
  },
7396
7416
  onClose: () => x(!1)
7397
7417
  })
7398
- }), t[85] = te, t[86] = b, t[87] = Ie) : Ie = t[87];
7418
+ }), t[85] = ne, t[86] = b, t[87] = Ie) : Ie = t[87];
7399
7419
  let Le;
7400
7420
  t[88] !== i || t[89] !== S ? (Le = S && /* @__PURE__ */ l("div", {
7401
7421
  className: "absolute bottom-full left-0 mb-2 z-50",
@@ -7407,15 +7427,15 @@ function wn(e) {
7407
7427
  })
7408
7428
  }), t[88] = i, t[89] = S, t[90] = Le) : Le = t[90];
7409
7429
  let Re;
7410
- t[91] !== ae || t[92] !== E || t[93] !== f || t[94] !== p ? (Re = E && /* @__PURE__ */ l("div", {
7430
+ t[91] !== oe || t[92] !== E || t[93] !== f || t[94] !== p ? (Re = E && /* @__PURE__ */ l("div", {
7411
7431
  className: "absolute bottom-full right-0 mb-2 z-50",
7412
7432
  children: /* @__PURE__ */ l(un, {
7413
- onSelect: ae,
7433
+ onSelect: oe,
7414
7434
  onClose: () => D(!1),
7415
7435
  customPacks: f,
7416
7436
  tenorApiKey: p
7417
7437
  })
7418
- }), t[91] = ae, t[92] = E, t[93] = f, t[94] = p, t[95] = Re) : Re = t[95];
7438
+ }), t[91] = oe, t[92] = E, t[93] = f, t[94] = p, t[95] = Re) : Re = t[95];
7419
7439
  let ze;
7420
7440
  t[96] !== ge || t[97] !== Fe || t[98] !== Ie || t[99] !== Le || t[100] !== Re ? (ze = /* @__PURE__ */ u("footer", {
7421
7441
  className: "flex-shrink-0 border-t border-border relative",
@@ -7434,11 +7454,11 @@ function wn(e) {
7434
7454
  onClose: () => j(!1)
7435
7455
  }), t[102] = m, t[103] = A, t[104] = Be) : Be = t[104];
7436
7456
  let Ve;
7437
- return t[105] !== le || t[106] !== ze || t[107] !== Be ? (Ve = /* @__PURE__ */ u(c, { children: [
7438
- le,
7457
+ return t[105] !== Q || t[106] !== ze || t[107] !== Be ? (Ve = /* @__PURE__ */ u(c, { children: [
7458
+ Q,
7439
7459
  ze,
7440
7460
  Be
7441
- ] }), t[105] = le, t[106] = ze, t[107] = Be, t[108] = Ve) : Ve = t[108], Ve;
7461
+ ] }), t[105] = Q, t[106] = ze, t[107] = Be, t[108] = Ve) : Ve = t[108], Ve;
7442
7462
  }
7443
7463
  function Tn(e) {
7444
7464
  return !e;
@@ -8357,38 +8377,38 @@ function Qn({ onViewProfile: e, onClose: t }) {
8357
8377
  })
8358
8378
  });
8359
8379
  }
8360
- function $n({ conversationName: e, avatarSrc: t, isOnline: n, presenceStatus: i, renderHeader: a, chatBanner: d, messages: f, typingUsers: p, onBack: m, onCall: h, onVideoCall: g, onSend: _, onTyping: v, onCallBack: b, replyingTo: x, onDismissReply: S, onReplyMessage: C, batchMode: w, batchSelectedCount: T = 0, batchSelectedIds: E, onToggleBatchSelect: D, onBatchDelete: O, onBatchRecall: k, onBatchForward: A, onBatchCancel: j, searchActive: M, searchQuery: N = "", onSearchToggle: P, onSearchChange: F, searchResultIds: I, searchCurrentIndex: L = 0, onSearchNext: R, onSearchPrev: z, onForwardMessage: B, onRecallMessage: V, onDeleteMessage: H, onInfoMessage: U, onEditMessage: W, onReactMessage: G, onPinMessage: K, pinnedMessages: q, isGroup: J, otherUserId: Y, stickerPacks: X, tenorApiKey: Z, defaultQuickMessages: ee, onMediaOpen: Q, imageSet: te }) {
8361
- let ne = y(), re = o(null), ie = o(null), ae = o(null), oe = o(/* @__PURE__ */ new Map()), [se, ce] = s(!1), [le, $] = s(0), [ue, de] = s(null), [fe, pe] = s(!1), [me, he] = s(!1), ge = o(null), _e = o(!0), ve = o(f.length);
8380
+ function $n({ conversationName: e, avatarSrc: t, isOnline: n, presenceStatus: i, renderHeader: a, chatBanner: d, messages: f, typingUsers: p, onBack: m, onCall: h, onVideoCall: g, onSend: _, onTyping: v, onCallBack: b, replyingTo: x, onDismissReply: S, onReplyMessage: C, batchMode: w, batchSelectedCount: T = 0, batchSelectedIds: E, onToggleBatchSelect: D, onBatchDelete: O, onBatchRecall: k, onBatchForward: A, onBatchCancel: j, searchActive: M, searchQuery: N = "", onSearchToggle: P, onSearchChange: F, searchResultIds: I, searchCurrentIndex: L = 0, onSearchNext: R, onSearchPrev: z, onForwardMessage: B, onRecallMessage: V, onDeleteMessage: H, onInfoMessage: U, onEditMessage: W, onReactMessage: G, onPinMessage: K, pinnedMessages: q, isGroup: J, otherUserId: Y, stickerPacks: X, tenorApiKey: Z, defaultQuickMessages: ee, onMediaOpen: te, imageSet: ne }) {
8381
+ let re = y(), ie = o(null), ae = o(null), oe = o(null), se = o(/* @__PURE__ */ new Map()), [ce, le] = s(!1), [Q, $] = s(0), [ue, de] = s(null), [fe, pe] = s(!1), [me, he] = s(!1), ge = o(null), _e = o(!0), ve = o(f.length);
8362
8382
  function ye(e) {
8363
- let t = oe.current.get(e);
8383
+ let t = se.current.get(e);
8364
8384
  t && (t.scrollIntoView({
8365
8385
  behavior: "smooth",
8366
8386
  block: "center"
8367
8387
  }), de(e), setTimeout(() => de(null), 1500));
8368
8388
  }
8369
8389
  r(() => {
8370
- ie.current?.scrollIntoView({ behavior: "instant" }), ve.current = f.length;
8390
+ ae.current?.scrollIntoView({ behavior: "instant" }), ve.current = f.length;
8371
8391
  }, []), r(() => {
8372
- p && p.length > 0 && ae.current?.scrollIntoView({
8392
+ p && p.length > 0 && oe.current?.scrollIntoView({
8373
8393
  behavior: "smooth",
8374
8394
  block: "center"
8375
8395
  });
8376
8396
  }, [p]), r(() => {
8377
8397
  let e = f.length - ve.current;
8378
- if (ve.current = f.length, !(e <= 0)) if (_e.current) ie.current?.scrollIntoView({ behavior: "smooth" });
8398
+ if (ve.current = f.length, !(e <= 0)) if (_e.current) ae.current?.scrollIntoView({ behavior: "smooth" });
8379
8399
  else {
8380
8400
  let t = f.slice(-e).filter((e) => !e.sender).length;
8381
8401
  t > 0 && $((e) => e + t);
8382
8402
  }
8383
8403
  }, [f, f.length]);
8384
8404
  function be() {
8385
- let e = re.current;
8405
+ let e = ie.current;
8386
8406
  if (!e) return;
8387
8407
  let t = e.scrollHeight - e.scrollTop - e.clientHeight;
8388
- _e.current = t < 80, ce(t > 200), t < 80 && $(0);
8408
+ _e.current = t < 80, le(t > 200), t < 80 && $(0);
8389
8409
  }
8390
8410
  function xe() {
8391
- ie.current?.scrollIntoView({ behavior: "smooth" }), $(0);
8411
+ ae.current?.scrollIntoView({ behavior: "smooth" }), $(0);
8392
8412
  }
8393
8413
  r(() => {
8394
8414
  if (!I?.length) return;
@@ -8405,7 +8425,7 @@ function $n({ conversationName: e, avatarSrc: t, isOnline: n, presenceStatus: i,
8405
8425
  }
8406
8426
  Se.push(/* @__PURE__ */ l("div", {
8407
8427
  ref: (t) => {
8408
- t ? oe.current.set(e.id, t) : oe.current.delete(e.id);
8428
+ t ? se.current.set(e.id, t) : se.current.delete(e.id);
8409
8429
  },
8410
8430
  children: /* @__PURE__ */ l(Ft, {
8411
8431
  ...e,
@@ -8424,14 +8444,14 @@ function $n({ conversationName: e, avatarSrc: t, isOnline: n, presenceStatus: i,
8424
8444
  onEdit: () => W?.(e.id),
8425
8445
  onReact: (t) => G?.(e.id, t),
8426
8446
  onPin: K ? () => K(e.id, !!e.pinned) : void 0,
8427
- onMediaOpen: Q,
8428
- imageSet: te
8447
+ onMediaOpen: te,
8448
+ imageSet: ne
8429
8449
  })
8430
8450
  }, e.id));
8431
8451
  }), /* @__PURE__ */ u("div", {
8432
8452
  className: "flex flex-col h-full bg-background text-foreground font-body relative",
8433
8453
  children: [
8434
- ne.showChatHeader && /* @__PURE__ */ u("header", {
8454
+ re.showChatHeader && /* @__PURE__ */ u("header", {
8435
8455
  className: "flex-shrink-0 h-[60px] flex items-center gap-1 px-1 border-b border-border z-10",
8436
8456
  style: {
8437
8457
  backgroundColor: "rgba(13,17,23,0.95)",
@@ -8485,10 +8505,10 @@ function $n({ conversationName: e, avatarSrc: t, isOnline: n, presenceStatus: i,
8485
8505
  children: i
8486
8506
  })] })] })
8487
8507
  }),
8488
- h && ne.showAudioIcon && /* @__PURE__ */ l("button", {
8508
+ h && re.showAudioIcon && /* @__PURE__ */ l("button", {
8489
8509
  onClick: h,
8490
8510
  className: "w-10 h-10 flex items-center justify-center rounded-xl border-none bg-transparent cursor-pointer text-muted-foreground",
8491
- children: ne.callIcon ?? /* @__PURE__ */ l("svg", {
8511
+ children: re.callIcon ?? /* @__PURE__ */ l("svg", {
8492
8512
  width: "20",
8493
8513
  height: "20",
8494
8514
  viewBox: "0 0 24 24",
@@ -8500,10 +8520,10 @@ function $n({ conversationName: e, avatarSrc: t, isOnline: n, presenceStatus: i,
8500
8520
  children: /* @__PURE__ */ l("path", { d: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.15 12a19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 3.06 1h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L7.09 8.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 21 16z" })
8501
8521
  })
8502
8522
  }),
8503
- g && ne.showVideoIcon && /* @__PURE__ */ l("button", {
8523
+ g && re.showVideoIcon && /* @__PURE__ */ l("button", {
8504
8524
  onClick: g,
8505
8525
  className: "w-10 h-10 flex items-center justify-center rounded-xl border-none bg-transparent cursor-pointer text-muted-foreground",
8506
- children: ne.VideoCallIcon ?? /* @__PURE__ */ u("svg", {
8526
+ children: re.VideoCallIcon ?? /* @__PURE__ */ u("svg", {
8507
8527
  width: "20",
8508
8528
  height: "20",
8509
8529
  viewBox: "0 0 24 24",
@@ -8522,7 +8542,7 @@ function $n({ conversationName: e, avatarSrc: t, isOnline: n, presenceStatus: i,
8522
8542
  })]
8523
8543
  })
8524
8544
  }),
8525
- P && ne.showSearchIcon && /* @__PURE__ */ l("button", {
8545
+ P && re.showSearchIcon && /* @__PURE__ */ l("button", {
8526
8546
  onClick: P,
8527
8547
  className: "w-10 h-10 flex items-center justify-center rounded-xl border-none bg-transparent cursor-pointer",
8528
8548
  style: { color: M ? "var(--oc-primary, #3b82f6)" : "var(--oc-muted-foreground)" },
@@ -8695,7 +8715,7 @@ function $n({ conversationName: e, avatarSrc: t, isOnline: n, presenceStatus: i,
8695
8715
  onUnpin: K ? (e) => K(e, !0) : void 0
8696
8716
  }),
8697
8717
  /* @__PURE__ */ u("main", {
8698
- ref: re,
8718
+ ref: ie,
8699
8719
  onScroll: be,
8700
8720
  className: "flex-1 overflow-y-auto px-4 py-3 flex flex-col gap-2 scrollbar-none relative",
8701
8721
  children: [
@@ -8715,7 +8735,7 @@ function $n({ conversationName: e, avatarSrc: t, isOnline: n, presenceStatus: i,
8715
8735
  2,
8716
8736
  3
8717
8737
  ].map((e) => /* @__PURE__ */ l("span", {
8718
- ref: ae,
8738
+ ref: oe,
8719
8739
  className: "w-1.5 h-1.5 rounded-full block",
8720
8740
  style: {
8721
8741
  backgroundColor: "var(--oc-typing-dot)",
@@ -8726,29 +8746,29 @@ function $n({ conversationName: e, avatarSrc: t, isOnline: n, presenceStatus: i,
8726
8746
  })]
8727
8747
  }),
8728
8748
  /* @__PURE__ */ l("div", {
8729
- ref: ie,
8749
+ ref: ae,
8730
8750
  className: "h-px"
8731
8751
  })
8732
8752
  ]
8733
8753
  }),
8734
- (se || le > 0) && /* @__PURE__ */ l("div", {
8754
+ (ce || Q > 0) && /* @__PURE__ */ l("div", {
8735
8755
  className: "flex justify-end px-4 py-2 pointer-events-none",
8736
8756
  children: /* @__PURE__ */ u("button", {
8737
8757
  onClick: xe,
8738
8758
  className: "flex items-center gap-2 rounded-full border-none cursor-pointer z-20 shadow-lg transition-all pointer-events-auto",
8739
8759
  style: {
8740
- backgroundColor: le > 0 ? "var(--oc-primary, #3b82f6)" : "var(--oc-card, #1e1e1e)",
8741
- color: le > 0 ? "#fff" : "var(--oc-foreground)",
8742
- padding: le > 0 ? "6px 14px 6px 10px" : "10px",
8743
- border: le > 0 ? "none" : "1px solid var(--oc-border)"
8760
+ backgroundColor: Q > 0 ? "var(--oc-primary, #3b82f6)" : "var(--oc-card, #1e1e1e)",
8761
+ color: Q > 0 ? "#fff" : "var(--oc-foreground)",
8762
+ padding: Q > 0 ? "6px 14px 6px 10px" : "10px",
8763
+ border: Q > 0 ? "none" : "1px solid var(--oc-border)"
8744
8764
  },
8745
8765
  "aria-label": "Scroll to bottom",
8746
- children: [le > 0 && /* @__PURE__ */ u("span", {
8766
+ children: [Q > 0 && /* @__PURE__ */ u("span", {
8747
8767
  className: "text-xs font-semibold leading-none",
8748
8768
  children: [
8749
- le,
8769
+ Q,
8750
8770
  " new ",
8751
- le === 1 ? "message" : "messages"
8771
+ Q === 1 ? "message" : "messages"
8752
8772
  ]
8753
8773
  }), /* @__PURE__ */ l("svg", {
8754
8774
  width: "16",
@@ -9646,30 +9666,30 @@ function gr(e) {
9646
9666
  t[27] === Symbol.for("react.memo_cache_sentinel") ? (Z = () => {
9647
9667
  T.current = !1, w(!1), A.current = null;
9648
9668
  }, t[27] = Z) : Z = t[27];
9649
- let ee = Z, Q = i.length > 1, te;
9650
- t[28] === Symbol.for("react.memo_cache_sentinel") ? (te = {
9669
+ let ee = Z, te = i.length > 1, ne;
9670
+ t[28] === Symbol.for("react.memo_cache_sentinel") ? (ne = {
9651
9671
  position: "relative",
9652
9672
  width: "100vw",
9653
9673
  height: "100vh"
9654
- }, t[28] = te) : te = t[28];
9655
- let ne;
9656
- t[29] === Symbol.for("react.memo_cache_sentinel") ? (ne = {
9674
+ }, t[28] = ne) : ne = t[28];
9675
+ let re;
9676
+ t[29] === Symbol.for("react.memo_cache_sentinel") ? (re = {
9657
9677
  ...mr,
9658
9678
  position: "absolute",
9659
9679
  top: 16,
9660
9680
  right: 16,
9661
9681
  zIndex: 10,
9662
9682
  fontSize: 22
9663
- }, t[29] = ne) : ne = t[29];
9664
- let re;
9665
- t[30] === a ? re = t[31] : (re = /* @__PURE__ */ l("button", {
9683
+ }, t[29] = re) : re = t[29];
9684
+ let ie;
9685
+ t[30] === a ? ie = t[31] : (ie = /* @__PURE__ */ l("button", {
9666
9686
  "aria-label": "Close",
9667
9687
  onClick: a,
9668
- style: ne,
9688
+ style: re,
9669
9689
  children: "✕"
9670
- }), t[30] = a, t[31] = re);
9671
- let ie = p > 1 ? C ? "grabbing" : "grab" : "default", ae;
9672
- t[32] === ie ? ae = t[33] : (ae = {
9690
+ }), t[30] = a, t[31] = ie);
9691
+ let ae = p > 1 ? C ? "grabbing" : "grab" : "default", oe;
9692
+ t[32] === ae ? oe = t[33] : (oe = {
9673
9693
  position: "relative",
9674
9694
  width: "100%",
9675
9695
  height: "100%",
@@ -9677,54 +9697,54 @@ function gr(e) {
9677
9697
  alignItems: "center",
9678
9698
  justifyContent: "center",
9679
9699
  overflow: "hidden",
9680
- cursor: ie,
9700
+ cursor: ae,
9681
9701
  userSelect: "none"
9682
- }, t[32] = ie, t[33] = ae);
9683
- let oe;
9684
- t[34] !== x || t[35] !== y ? (oe = y && !x && /* @__PURE__ */ l("div", {
9702
+ }, t[32] = ae, t[33] = oe);
9703
+ let se;
9704
+ t[34] !== x || t[35] !== y ? (se = y && !x && /* @__PURE__ */ l("div", {
9685
9705
  style: {
9686
9706
  color: "#fff",
9687
9707
  fontSize: 14,
9688
9708
  opacity: .7
9689
9709
  },
9690
9710
  children: "Loading…"
9691
- }), t[34] = x, t[35] = y, t[36] = oe) : oe = t[36];
9692
- let se;
9693
- t[37] === x ? se = t[38] : (se = x && /* @__PURE__ */ l("div", {
9711
+ }), t[34] = x, t[35] = y, t[36] = se) : se = t[36];
9712
+ let ce;
9713
+ t[37] === x ? ce = t[38] : (ce = x && /* @__PURE__ */ l("div", {
9694
9714
  style: {
9695
9715
  color: "#fff",
9696
9716
  fontSize: 14,
9697
9717
  opacity: .7
9698
9718
  },
9699
9719
  children: "Failed to load image"
9700
- }), t[37] = x, t[38] = se);
9701
- let ce = M.name ?? "Image", le = `scale(${p}) translate(${_.x}px, ${_.y}px)`, $ = C ? "none" : "transform 0.1s ease", ue = y || x ? "none" : "block", de;
9702
- t[39] !== le || t[40] !== $ || t[41] !== ue ? (de = {
9720
+ }), t[37] = x, t[38] = ce);
9721
+ let le = M.name ?? "Image", Q = `scale(${p}) translate(${_.x}px, ${_.y}px)`, $ = C ? "none" : "transform 0.1s ease", ue = y || x ? "none" : "block", de;
9722
+ t[39] !== Q || t[40] !== $ || t[41] !== ue ? (de = {
9703
9723
  maxWidth: "90vw",
9704
9724
  maxHeight: "90vh",
9705
9725
  objectFit: "contain",
9706
- transform: le,
9726
+ transform: Q,
9707
9727
  transformOrigin: "center center",
9708
9728
  transition: $,
9709
9729
  display: ue,
9710
9730
  pointerEvents: "none"
9711
- }, t[39] = le, t[40] = $, t[41] = ue, t[42] = de) : de = t[42];
9731
+ }, t[39] = Q, t[40] = $, t[41] = ue, t[42] = de) : de = t[42];
9712
9732
  let fe, pe;
9713
9733
  t[43] === Symbol.for("react.memo_cache_sentinel") ? (fe = () => b(!1), pe = () => {
9714
9734
  b(!1), S(!0);
9715
9735
  }, t[43] = fe, t[44] = pe) : (fe = t[43], pe = t[44]);
9716
9736
  let me;
9717
- t[45] !== M.url || t[46] !== ce || t[47] !== de ? (me = /* @__PURE__ */ l("img", {
9737
+ t[45] !== M.url || t[46] !== le || t[47] !== de ? (me = /* @__PURE__ */ l("img", {
9718
9738
  src: M.url,
9719
- alt: ce,
9739
+ alt: le,
9720
9740
  style: de,
9721
9741
  onLoad: fe,
9722
9742
  onError: pe,
9723
9743
  draggable: !1
9724
- }), t[45] = M.url, t[46] = ce, t[47] = de, t[48] = me) : me = t[48];
9744
+ }), t[45] = M.url, t[46] = le, t[47] = de, t[48] = me) : me = t[48];
9725
9745
  let he;
9726
- t[49] !== H || t[50] !== W || t[51] !== X || t[52] !== J || t[53] !== ae || t[54] !== oe || t[55] !== se || t[56] !== me ? (he = /* @__PURE__ */ u("div", {
9727
- style: ae,
9746
+ t[49] !== H || t[50] !== W || t[51] !== X || t[52] !== J || t[53] !== oe || t[54] !== se || t[55] !== ce || t[56] !== me ? (he = /* @__PURE__ */ u("div", {
9747
+ style: oe,
9728
9748
  onWheel: B,
9729
9749
  onMouseDown: H,
9730
9750
  onMouseMove: W,
@@ -9734,11 +9754,11 @@ function gr(e) {
9734
9754
  onTouchMove: X,
9735
9755
  onTouchEnd: ee,
9736
9756
  children: [
9737
- oe,
9738
9757
  se,
9758
+ ce,
9739
9759
  me
9740
9760
  ]
9741
- }), t[49] = H, t[50] = W, t[51] = X, t[52] = J, t[53] = ae, t[54] = oe, t[55] = se, t[56] = me, t[57] = he) : he = t[57];
9761
+ }), t[49] = H, t[50] = W, t[51] = X, t[52] = J, t[53] = oe, t[54] = se, t[55] = ce, t[56] = me, t[57] = he) : he = t[57];
9742
9762
  let ge;
9743
9763
  t[58] === Symbol.for("react.memo_cache_sentinel") ? (ge = {
9744
9764
  position: "absolute",
@@ -9751,13 +9771,13 @@ function gr(e) {
9751
9771
  zIndex: 10
9752
9772
  }, t[58] = ge) : ge = t[58];
9753
9773
  let _e;
9754
- t[59] !== d || t[60] !== Q ? (_e = Q && /* @__PURE__ */ l("button", {
9774
+ t[59] !== d || t[60] !== te ? (_e = te && /* @__PURE__ */ l("button", {
9755
9775
  "aria-label": "Previous image",
9756
9776
  disabled: d === 0,
9757
9777
  onClick: () => R(Math.max(0, d - 1)),
9758
9778
  style: d === 0 ? hr : mr,
9759
9779
  children: "‹"
9760
- }), t[59] = d, t[60] = Q, t[61] = _e) : _e = t[61];
9780
+ }), t[59] = d, t[60] = te, t[61] = _e) : _e = t[61];
9761
9781
  let ve, ye;
9762
9782
  t[62] === Symbol.for("react.memo_cache_sentinel") ? (ve = /* @__PURE__ */ l("button", {
9763
9783
  "aria-label": "Zoom out",
@@ -9785,13 +9805,13 @@ function gr(e) {
9785
9805
  children: "+"
9786
9806
  }), t[68] = Se) : Se = t[68];
9787
9807
  let Ce;
9788
- t[69] !== d || t[70] !== i.length || t[71] !== Q ? (Ce = Q && /* @__PURE__ */ l("button", {
9808
+ t[69] !== d || t[70] !== i.length || t[71] !== te ? (Ce = te && /* @__PURE__ */ l("button", {
9789
9809
  "aria-label": "Next image",
9790
9810
  disabled: d === i.length - 1,
9791
9811
  onClick: () => R(Math.min(i.length - 1, d + 1)),
9792
9812
  style: d === i.length - 1 ? hr : mr,
9793
9813
  children: "›"
9794
- }), t[69] = d, t[70] = i.length, t[71] = Q, t[72] = Ce) : Ce = t[72];
9814
+ }), t[69] = d, t[70] = i.length, t[71] = te, t[72] = Ce) : Ce = t[72];
9795
9815
  let we;
9796
9816
  t[73] !== _e || t[74] !== xe || t[75] !== Ce ? (we = /* @__PURE__ */ u("div", {
9797
9817
  style: ge,
@@ -9804,14 +9824,14 @@ function gr(e) {
9804
9824
  ]
9805
9825
  }), t[73] = _e, t[74] = xe, t[75] = Ce, t[76] = we) : we = t[76];
9806
9826
  let Te;
9807
- return t[77] !== re || t[78] !== he || t[79] !== we ? (Te = /* @__PURE__ */ u("div", {
9808
- style: te,
9827
+ return t[77] !== ie || t[78] !== he || t[79] !== we ? (Te = /* @__PURE__ */ u("div", {
9828
+ style: ne,
9809
9829
  children: [
9810
- re,
9830
+ ie,
9811
9831
  he,
9812
9832
  we
9813
9833
  ]
9814
- }), t[77] = re, t[78] = he, t[79] = we, t[80] = Te) : Te = t[80], Te;
9834
+ }), t[77] = ie, t[78] = he, t[79] = we, t[80] = Te) : Te = t[80], Te;
9815
9835
  }
9816
9836
  function _r(e) {
9817
9837
  return pr(e + dr);
@@ -10555,47 +10575,63 @@ function Wr() {
10555
10575
  }
10556
10576
  //#endregion
10557
10577
  //#region src/widgets/Chat.tsx
10558
- function Gr({ conversationId: e, onCallRequest: t, renderHeader: n, chatBanner: i, defaultQuickMessages: d }) {
10559
- let { apiClient: f, baseUrl: p } = v(), { initiateCall: m } = P(), { conversations: h, loading: g, createDirect: _ } = Ae(), { records: y } = Re(), [b, x] = s(e ?? null), [S, C] = s("chats"), [w, T] = s(!1), [E, D] = s([]), [O, k] = s(!1);
10578
+ function Gr({ conversationId: e, onCallRequest: t, renderHeader: n, chatBanner: i, defaultQuickMessages: d, onOpenChatBox: f, onChatBoxClosed: p }) {
10579
+ let { apiClient: m, baseUrl: h } = v(), { initiateCall: g } = P(), { conversations: _, loading: y, createDirect: b } = Ae(), { records: x } = Re(), [S, C] = s(e ?? null), [w, T] = s("chats"), [E, D] = s(!1), [O, k] = s([]), [A, j] = s(!1);
10580
+ function M(e) {
10581
+ if (C(e), f) {
10582
+ let t = _.find((t) => t.id === e);
10583
+ t && f(t);
10584
+ }
10585
+ }
10560
10586
  r(() => {
10561
- e && x(e);
10587
+ e && M(e);
10562
10588
  }, [e]);
10563
- let [A, j] = s(null), [M, N] = s(!1), [I, L] = s([]), [R, z] = s(null), [B, V] = s(null), [H, U] = s(null), [W, G] = s(!1), [K, q] = s(""), [J, Y] = s([]), [X, Z] = s(0), [ee, Q] = s(null), [te, ne] = s("offline");
10589
+ let [N, I] = s(null), [L, R] = s(!1), [z, B] = s([]), [V, H] = s(null), [U, W] = s(null), [G, K] = s(null), [q, J] = s(!1), [Y, X] = s(""), [Z, ee] = s([]), [te, ne] = s(0), [re, ie] = s(null), [ae, oe] = s("offline");
10564
10590
  r(() => {
10565
- b && ne(h.find((e) => e.id === b)?.presenceStatus ?? "offline");
10566
- }, [b, h]), F("presence:changed", ({ app_user_id: e, status: t }) => {
10567
- b && h.find((e) => e.id === b)?.otherUserId === e && ne(t);
10591
+ S && oe(_.find((e) => e.id === S)?.presenceStatus ?? "offline");
10592
+ }, [S, _]), F("presence:changed", ({ app_user_id: e, status: t }) => {
10593
+ S && _.find((e) => e.id === S)?.otherUserId === e && oe(t);
10568
10594
  });
10569
- let { messages: re, typingUsers: ie, pinnedMessages: ae, sendMessage: oe, sendTyping: se, markRead: ce, editMessageLocally: le } = Fe(b ?? ""), $ = a(() => re.flatMap((e) => e.attachment?.type === "image" ? [e.attachment] : []), [re]), ue = o(/* @__PURE__ */ new Set());
10595
+ let { messages: se, typingUsers: ce, pinnedMessages: le, sendMessage: Q, sendTyping: $, markRead: ue, editMessageLocally: de } = Fe(S ?? ""), fe = a(() => {
10596
+ let e = _.find((e) => e.id === S)?.avatarSrc;
10597
+ return e ? se.map((t) => ({
10598
+ ...t,
10599
+ avatarSrc: e
10600
+ })) : se;
10601
+ }, [
10602
+ se,
10603
+ S,
10604
+ _
10605
+ ]), pe = a(() => fe.flatMap((e) => e.attachment?.type === "image" ? [e.attachment] : []), [fe]), me = o(/* @__PURE__ */ new Set());
10570
10606
  r(() => {
10571
- ue.current = /* @__PURE__ */ new Set(), Q(null);
10572
- }, [b]), r(() => {
10573
- b && re.forEach((e) => {
10574
- !e.sender && e.id && !ue.current.has(e.id) && (ue.current.add(e.id), ce(e.id));
10607
+ me.current = /* @__PURE__ */ new Set(), ie(null);
10608
+ }, [S]), r(() => {
10609
+ S && se.forEach((e) => {
10610
+ !e.sender && e.id && !me.current.has(e.id) && (me.current.add(e.id), ue(e.id));
10575
10611
  });
10576
10612
  }, [
10577
- re,
10578
- b,
10579
- ce
10613
+ se,
10614
+ S,
10615
+ ue
10580
10616
  ]);
10581
- function de(e, t) {
10582
- e.type === "image" ? Q({
10617
+ function he(e, t) {
10618
+ e.type === "image" ? ie({
10583
10619
  type: "image",
10584
10620
  attachment: e,
10585
- imageSet: t ?? $
10586
- }) : e.type === "video" ? Q({
10621
+ imageSet: t ?? pe
10622
+ }) : e.type === "video" ? ie({
10587
10623
  type: "video",
10588
10624
  attachment: e
10589
- }) : Q({
10625
+ }) : ie({
10590
10626
  type: "document",
10591
10627
  attachment: e
10592
10628
  });
10593
10629
  }
10594
- function fe() {
10595
- Q(null);
10630
+ function ge() {
10631
+ ie(null);
10596
10632
  }
10597
- function pe(e) {
10598
- j({
10633
+ function _e(e) {
10634
+ I({
10599
10635
  messageId: e.id,
10600
10636
  senderName: e.sender ? "You" : e.senderName ?? "Unknown",
10601
10637
  content: e.content ?? "",
@@ -10603,119 +10639,119 @@ function Gr({ conversationId: e, onCallRequest: t, renderHeader: n, chatBanner:
10603
10639
  attachmentType: e.attachment?.type
10604
10640
  });
10605
10641
  }
10606
- async function me(e) {
10607
- if (b) try {
10608
- await f.delete(`/messages/${e}`);
10642
+ async function ve(e) {
10643
+ if (S) try {
10644
+ await m.delete(`/messages/${e}`);
10609
10645
  } catch (e) {
10610
10646
  console.error("[Chat] delete failed", e);
10611
10647
  }
10612
10648
  }
10613
- async function he(e) {
10614
- if (b && confirm("Recall this message for everyone?")) try {
10615
- await f.patch(`/messages/${e}/recall`, {});
10649
+ async function ye(e) {
10650
+ if (S && confirm("Recall this message for everyone?")) try {
10651
+ await m.patch(`/messages/${e}/recall`, {});
10616
10652
  } catch (e) {
10617
10653
  console.error("[Chat] recall failed", e);
10618
10654
  }
10619
10655
  }
10620
- async function ge(e) {
10621
- z(e);
10656
+ async function be(e) {
10657
+ H(e);
10622
10658
  }
10623
- async function _e(e) {
10659
+ async function xe(e) {
10624
10660
  try {
10625
- B ? await f.post("/messages/batch", {
10661
+ U ? await m.post("/messages/batch", {
10626
10662
  action: "forward",
10627
- message_ids: B,
10663
+ message_ids: U,
10628
10664
  target_conversation_ids: e
10629
- }) : R && await f.post(`/messages/${R}/forward`, { target_conversation_ids: e });
10665
+ }) : V && await m.post(`/messages/${V}/forward`, { target_conversation_ids: e });
10630
10666
  } catch (e) {
10631
10667
  console.error("[Chat] forward failed", e);
10632
10668
  } finally {
10633
- z(null), V(null);
10669
+ H(null), W(null);
10634
10670
  }
10635
10671
  }
10636
- async function ve(e, t) {
10672
+ async function Se(e, t) {
10637
10673
  try {
10638
- await f.post(`/messages/${e}/reactions`, { reaction_type: t });
10674
+ await m.post(`/messages/${e}/reactions`, { reaction_type: t });
10639
10675
  } catch (e) {
10640
10676
  console.error("[Chat] react failed", e);
10641
10677
  }
10642
10678
  }
10643
- async function ye(e, t) {
10679
+ async function Ce(e, t) {
10644
10680
  try {
10645
- t ? await f.delete(`/messages/${e}/pin`) : await f.post(`/messages/${e}/pin`, {});
10681
+ t ? await m.delete(`/messages/${e}/pin`) : await m.post(`/messages/${e}/pin`, {});
10646
10682
  } catch (e) {
10647
10683
  console.error("[Chat] pin failed", e);
10648
10684
  }
10649
10685
  }
10650
- async function be(e) {
10651
- let t = re.find((t) => t.id === e);
10686
+ async function we(e) {
10687
+ let t = se.find((t) => t.id === e);
10652
10688
  if (!t) return;
10653
10689
  let n = window.prompt("Edit message:", t.content ?? "");
10654
10690
  if (!(n === null || n === t.content)) try {
10655
- await f.patch(`/messages/${e}`, { content: n }), le(e, n);
10691
+ await m.patch(`/messages/${e}`, { content: n }), de(e, n);
10656
10692
  } catch (e) {
10657
10693
  console.error("[Chat] edit failed", e);
10658
10694
  }
10659
10695
  }
10660
- async function xe() {
10661
- if (I.length) try {
10662
- await f.post("/messages/batch", {
10696
+ async function Te() {
10697
+ if (z.length) try {
10698
+ await m.post("/messages/batch", {
10663
10699
  action: "delete",
10664
- message_ids: I
10700
+ message_ids: z
10665
10701
  });
10666
10702
  } catch (e) {
10667
10703
  console.error("[Chat] batch delete failed", e);
10668
10704
  } finally {
10669
- N(!1), L([]);
10705
+ R(!1), B([]);
10670
10706
  }
10671
10707
  }
10672
- async function Se() {
10673
- if (I.length && confirm(`Recall ${I.length} message(s) for everyone?`)) try {
10674
- await f.post("/messages/batch", {
10708
+ async function Ee() {
10709
+ if (z.length && confirm(`Recall ${z.length} message(s) for everyone?`)) try {
10710
+ await m.post("/messages/batch", {
10675
10711
  action: "recall",
10676
- message_ids: I
10712
+ message_ids: z
10677
10713
  });
10678
10714
  } catch (e) {
10679
10715
  console.error("[Chat] batch recall failed", e);
10680
10716
  } finally {
10681
- N(!1), L([]);
10717
+ R(!1), B([]);
10682
10718
  }
10683
10719
  }
10684
- function Ce() {
10685
- V([...I]), N(!1), L([]);
10720
+ function De() {
10721
+ W([...z]), R(!1), B([]);
10686
10722
  }
10687
- function we(e) {
10688
- if (q(e), Z(0), !e.trim()) {
10689
- Y([]);
10723
+ function Oe(e) {
10724
+ if (X(e), ne(0), !e.trim()) {
10725
+ ee([]);
10690
10726
  return;
10691
10727
  }
10692
10728
  let t = e.toLowerCase();
10693
- Y(re.filter((e) => e.content?.toLowerCase().includes(t)).map((e) => e.id));
10729
+ ee(se.filter((e) => e.content?.toLowerCase().includes(t)).map((e) => e.id));
10694
10730
  }
10695
- function Te() {
10696
- G((e) => (e && (q(""), Y([]), Z(0)), !e));
10731
+ function ke() {
10732
+ J((e) => (e && (X(""), ee([]), ne(0)), !e));
10697
10733
  }
10698
- function Ee() {
10699
- J.length && Z((e) => (e + 1) % J.length);
10734
+ function je() {
10735
+ Z.length && ne((e) => (e + 1) % Z.length);
10700
10736
  }
10701
- function De() {
10702
- J.length && Z((e) => (e - 1 + J.length) % J.length);
10737
+ function Me() {
10738
+ Z.length && ne((e) => (e - 1 + Z.length) % Z.length);
10703
10739
  }
10704
- async function Oe() {
10705
- T(!0), k(!0);
10740
+ async function Ne() {
10741
+ D(!0), j(!0);
10706
10742
  try {
10707
- D(await f.get("/app-users"));
10743
+ k(await m.get("/app-users"));
10708
10744
  } catch {
10709
- D([]);
10745
+ k([]);
10710
10746
  } finally {
10711
- k(!1);
10747
+ j(!1);
10712
10748
  }
10713
10749
  }
10714
- async function ke(e) {
10715
- T(!1), x(await _(e));
10750
+ async function Pe(e) {
10751
+ D(!1), M(await b(e));
10716
10752
  }
10717
- if (b) {
10718
- let e = h.find((e) => e.id === b), r = e?.otherUserId ?? e?.id ?? "", a = h.map((e) => ({
10753
+ if (S) {
10754
+ let e = _.find((e) => e.id === S), r = e?.otherUserId ?? e?.id ?? "", a = _.map((e) => ({
10719
10755
  id: e.id,
10720
10756
  name: e.name,
10721
10757
  avatarSrc: e.avatarSrc
@@ -10727,36 +10763,40 @@ function Gr({ conversationId: e, onCallRequest: t, renderHeader: n, chatBanner:
10727
10763
  isOnline: e?.online,
10728
10764
  isGroup: e?.isGroup,
10729
10765
  otherUserId: r,
10730
- presenceStatus: te,
10766
+ presenceStatus: ae,
10731
10767
  renderHeader: n,
10732
10768
  chatBanner: i,
10733
10769
  defaultQuickMessages: d,
10734
- messages: re,
10735
- typingUsers: ie,
10770
+ messages: fe,
10771
+ typingUsers: ce,
10736
10772
  onBack: () => {
10737
- x(null);
10773
+ if (p) {
10774
+ let e = _.find((e) => e.id === S);
10775
+ e && p(e);
10776
+ }
10777
+ C(null);
10738
10778
  },
10739
- onCall: t || m ? () => {
10740
- r ? m(r, "voice", b ?? void 0) : t?.(r, "voice");
10779
+ onCall: t || g ? () => {
10780
+ r ? g(r, "voice", S ?? void 0) : t?.(r, "voice");
10741
10781
  } : void 0,
10742
- onVideoCall: t || m ? () => {
10743
- r ? m(r, "video", b ?? void 0) : t?.(r, "video");
10782
+ onVideoCall: t || g ? () => {
10783
+ r ? g(r, "video", S ?? void 0) : t?.(r, "video");
10744
10784
  } : void 0,
10745
10785
  onSend: (e, t) => {
10746
- A ? (f.post(`/conversations/${b}/messages/reply`, {
10786
+ N ? (m.post(`/conversations/${S}/messages/reply`, {
10747
10787
  content: e,
10748
- reply_to_message_id: A.messageId,
10788
+ reply_to_message_id: N.messageId,
10749
10789
  ...t?.mediaId ? { media_id: t.mediaId } : {}
10750
- }).catch(console.error), j(null)) : t?.type === "location" ? oe(e, void 0, {
10790
+ }).catch(console.error), I(null)) : t?.type === "location" ? Q(e, void 0, {
10751
10791
  attachment_type: "location",
10752
10792
  lat: t.location?.lat,
10753
10793
  lng: t.location?.lng,
10754
10794
  label: t.location?.label
10755
- }) : t?.type === "sticker" ? oe("", void 0, {
10795
+ }) : t?.type === "sticker" ? Q("", void 0, {
10756
10796
  attachment_type: "sticker",
10757
10797
  sticker_url: t?.url,
10758
10798
  filename: t?.filename
10759
- }) : oe(e, t?.mediaId, t ? {
10799
+ }) : Q(e, t?.mediaId, t ? {
10760
10800
  attachment_type: t.type,
10761
10801
  filename: t.filename,
10762
10802
  size: t.size,
@@ -10767,72 +10807,72 @@ function Gr({ conversationId: e, onCallRequest: t, renderHeader: n, chatBanner:
10767
10807
  }
10768
10808
  } : void 0);
10769
10809
  },
10770
- onTyping: se,
10810
+ onTyping: $,
10771
10811
  onCallBack: (e, t) => {
10772
- let n = h.find((e) => e.id === b)?.otherUserId;
10773
- n && m(n, t);
10812
+ let n = _.find((e) => e.id === S)?.otherUserId;
10813
+ n && g(n, t);
10774
10814
  },
10775
- replyingTo: A,
10776
- onDismissReply: () => j(null),
10777
- onReplyMessage: pe,
10778
- batchMode: M,
10779
- batchSelectedIds: I,
10780
- batchSelectedCount: I.length,
10815
+ replyingTo: N,
10816
+ onDismissReply: () => I(null),
10817
+ onReplyMessage: _e,
10818
+ batchMode: L,
10819
+ batchSelectedIds: z,
10820
+ batchSelectedCount: z.length,
10781
10821
  onToggleBatchSelect: (e) => {
10782
- M || N(!0), L((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
10822
+ L || R(!0), B((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
10783
10823
  },
10784
- onBatchDelete: xe,
10785
- onBatchRecall: Se,
10786
- onBatchForward: Ce,
10824
+ onBatchDelete: Te,
10825
+ onBatchRecall: Ee,
10826
+ onBatchForward: De,
10787
10827
  onBatchCancel: () => {
10788
- N(!1), L([]);
10828
+ R(!1), B([]);
10789
10829
  },
10790
- searchActive: W,
10791
- searchQuery: K,
10792
- onSearchToggle: Te,
10793
- onSearchChange: we,
10794
- searchResultIds: J,
10795
- searchCurrentIndex: X,
10796
- onSearchNext: Ee,
10797
- onSearchPrev: De,
10798
- onDeleteMessage: me,
10799
- onRecallMessage: he,
10800
- onForwardMessage: ge,
10801
- onInfoMessage: (e) => U(e),
10802
- onEditMessage: be,
10803
- onReactMessage: ve,
10804
- onPinMessage: ye,
10805
- pinnedMessages: ae,
10806
- onMediaOpen: de,
10807
- imageSet: $
10830
+ searchActive: q,
10831
+ searchQuery: Y,
10832
+ onSearchToggle: ke,
10833
+ onSearchChange: Oe,
10834
+ searchResultIds: Z,
10835
+ searchCurrentIndex: te,
10836
+ onSearchNext: je,
10837
+ onSearchPrev: Me,
10838
+ onDeleteMessage: ve,
10839
+ onRecallMessage: ye,
10840
+ onForwardMessage: be,
10841
+ onInfoMessage: (e) => K(e),
10842
+ onEditMessage: we,
10843
+ onReactMessage: Se,
10844
+ onPinMessage: Ce,
10845
+ pinnedMessages: le,
10846
+ onMediaOpen: he,
10847
+ imageSet: pe
10808
10848
  }),
10809
10849
  /* @__PURE__ */ l(Hr, {
10810
- active: ee,
10811
- onClose: fe
10850
+ active: re,
10851
+ onClose: ge
10812
10852
  }),
10813
- (R || B) && /* @__PURE__ */ l(rr, {
10853
+ (V || U) && /* @__PURE__ */ l(rr, {
10814
10854
  conversations: a,
10815
- onConfirm: _e,
10855
+ onConfirm: xe,
10816
10856
  onClose: () => {
10817
- z(null), V(null);
10857
+ H(null), W(null);
10818
10858
  }
10819
10859
  }),
10820
- H && /* @__PURE__ */ l(sr, {
10821
- messageId: H,
10822
- apiBaseUrl: p,
10823
- authToken: f.userToken,
10824
- onClose: () => U(null)
10860
+ G && /* @__PURE__ */ l(sr, {
10861
+ messageId: G,
10862
+ apiBaseUrl: h,
10863
+ authToken: m.userToken,
10864
+ onClose: () => K(null)
10825
10865
  }),
10826
10866
  /* @__PURE__ */ l(Wr, {})
10827
10867
  ] });
10828
10868
  }
10829
- return w ? /* @__PURE__ */ u("div", {
10869
+ return E ? /* @__PURE__ */ u("div", {
10830
10870
  className: "flex flex-col h-full bg-background text-foreground",
10831
10871
  children: [
10832
10872
  /* @__PURE__ */ u("header", {
10833
10873
  className: "flex-shrink-0 h-14 flex items-center gap-3 px-4 border-b border-border",
10834
10874
  children: [/* @__PURE__ */ l("button", {
10835
- onClick: () => T(!1),
10875
+ onClick: () => D(!1),
10836
10876
  className: "w-8 h-8 flex items-center justify-center rounded-xl border-none bg-transparent cursor-pointer text-muted-foreground",
10837
10877
  children: /* @__PURE__ */ l("svg", {
10838
10878
  width: "20",
@@ -10852,14 +10892,14 @@ function Gr({ conversationId: e, onCallRequest: t, renderHeader: n, chatBanner:
10852
10892
  }),
10853
10893
  /* @__PURE__ */ l("div", {
10854
10894
  className: "flex-1 overflow-y-auto",
10855
- children: O ? /* @__PURE__ */ l("div", {
10895
+ children: A ? /* @__PURE__ */ l("div", {
10856
10896
  className: "flex items-center justify-center h-24 text-sm text-muted-foreground",
10857
10897
  children: "Loading users…"
10858
- }) : E.length === 0 ? /* @__PURE__ */ l("div", {
10898
+ }) : O.length === 0 ? /* @__PURE__ */ l("div", {
10859
10899
  className: "flex items-center justify-center h-24 text-sm text-muted-foreground",
10860
10900
  children: "No users found"
10861
- }) : E.map((e) => /* @__PURE__ */ u("button", {
10862
- onClick: () => ke(e.id),
10901
+ }) : O.map((e) => /* @__PURE__ */ u("button", {
10902
+ onClick: () => Pe(e.id),
10863
10903
  className: "w-full h-16 flex items-center gap-3 px-4 border-none bg-transparent cursor-pointer text-left border-b",
10864
10904
  style: { borderBottomColor: "rgba(48,54,61,0.6)" },
10865
10905
  children: [/* @__PURE__ */ l("div", {
@@ -10873,20 +10913,20 @@ function Gr({ conversationId: e, onCallRequest: t, renderHeader: n, chatBanner:
10873
10913
  }),
10874
10914
  /* @__PURE__ */ l(Wr, {})
10875
10915
  ]
10876
- }) : S === "calls" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(tr, {
10877
- records: y,
10916
+ }) : w === "calls" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(tr, {
10917
+ records: x,
10878
10918
  onCall: (e, n) => t?.(e, n),
10879
- activeTab: S,
10880
- onTabChange: C
10881
- }), /* @__PURE__ */ l(Wr, {})] }) : g ? /* @__PURE__ */ l("div", {
10919
+ activeTab: w,
10920
+ onTabChange: T
10921
+ }), /* @__PURE__ */ l(Wr, {})] }) : y ? /* @__PURE__ */ l("div", {
10882
10922
  className: "flex-1 flex items-center justify-center bg-background text-muted-foreground text-sm",
10883
10923
  children: "Loading…"
10884
10924
  }) : /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(Ke, {
10885
- conversations: h,
10886
- onSelect: x,
10887
- onNewChat: Oe,
10888
- activeTab: S,
10889
- onTabChange: C
10925
+ conversations: _,
10926
+ onSelect: M,
10927
+ onNewChat: Ne,
10928
+ activeTab: w,
10929
+ onTabChange: T
10890
10930
  }), /* @__PURE__ */ l(Wr, {})] });
10891
10931
  }
10892
10932
  //#endregion
@@ -11643,8 +11683,8 @@ function yi(e) {
11643
11683
  }), t[21] = T, t[22] = Z);
11644
11684
  let ee;
11645
11685
  t[23] !== Y || t[24] !== Z ? (ee = /* @__PURE__ */ u("div", { children: [Y, Z] }), t[23] = Y, t[24] = Z, t[25] = ee) : ee = t[25];
11646
- let Q;
11647
- t[26] === v ? Q = t[27] : (Q = v && /* @__PURE__ */ l("button", {
11686
+ let te;
11687
+ t[26] === v ? te = t[27] : (te = v && /* @__PURE__ */ l("button", {
11648
11688
  onClick: v,
11649
11689
  className: "w-9 h-9 rounded-lg flex items-center justify-center border-none cursor-pointer pointer-events-auto",
11650
11690
  style: { background: "rgba(0,0,0,0.4)" },
@@ -11674,71 +11714,71 @@ function yi(e) {
11674
11714
  })
11675
11715
  ]
11676
11716
  })
11677
- }), t[26] = v, t[27] = Q);
11678
- let te;
11679
- t[28] !== ee || t[29] !== Q ? (te = /* @__PURE__ */ u("div", {
11717
+ }), t[26] = v, t[27] = te);
11718
+ let ne;
11719
+ t[28] !== ee || t[29] !== te ? (ne = /* @__PURE__ */ u("div", {
11680
11720
  className: "absolute top-0 left-0 right-0 px-4 pt-12 pb-6 flex justify-between items-start z-20 pointer-events-none",
11681
11721
  style: q,
11682
- children: [ee, Q]
11683
- }), t[28] = ee, t[29] = Q, t[30] = te) : te = t[30];
11684
- let ne;
11685
- t[31] !== V || t[32] !== z || t[33] !== k ? (ne = /* @__PURE__ */ l(gi, {
11722
+ children: [ee, te]
11723
+ }), t[28] = ee, t[29] = te, t[30] = ne) : ne = t[30];
11724
+ let re;
11725
+ t[31] !== V || t[32] !== z || t[33] !== k ? (re = /* @__PURE__ */ l(gi, {
11686
11726
  participant: z,
11687
11727
  isLocal: V,
11688
11728
  position: k,
11689
11729
  onPositionChange: A,
11690
11730
  onClick: U
11691
- }), t[31] = V, t[32] = z, t[33] = k, t[34] = ne) : ne = t[34];
11692
- let re = i.length + 1, ie;
11693
- t[35] !== y || t[36] !== p ? (ie = () => {
11731
+ }), t[31] = V, t[32] = z, t[33] = k, t[34] = re) : re = t[34];
11732
+ let ie = i.length + 1, ae;
11733
+ t[35] !== y || t[36] !== p ? (ae = () => {
11694
11734
  let e = !y;
11695
11735
  b(e), p?.(e);
11696
- }, t[35] = y, t[36] = p, t[37] = ie) : ie = t[37];
11697
- let ae;
11698
- t[38] !== x || t[39] !== m ? (ae = () => {
11736
+ }, t[35] = y, t[36] = p, t[37] = ae) : ae = t[37];
11737
+ let oe;
11738
+ t[38] !== x || t[39] !== m ? (oe = () => {
11699
11739
  let e = !x;
11700
11740
  S(e), m?.(e);
11701
- }, t[38] = x, t[39] = m, t[40] = ae) : ae = t[40];
11702
- let oe;
11703
- t[41] === d ? oe = t[42] : (oe = d ? () => w(bi) : void 0, t[41] = d, t[42] = oe);
11741
+ }, t[38] = x, t[39] = m, t[40] = oe) : oe = t[40];
11704
11742
  let se;
11705
- t[43] !== x || t[44] !== y || t[45] !== f || t[46] !== _ || t[47] !== h || t[48] !== re || t[49] !== ie || t[50] !== ae || t[51] !== oe ? (se = /* @__PURE__ */ l("div", {
11743
+ t[41] === d ? se = t[42] : (se = d ? () => w(bi) : void 0, t[41] = d, t[42] = se);
11744
+ let ce;
11745
+ t[43] !== x || t[44] !== y || t[45] !== f || t[46] !== _ || t[47] !== h || t[48] !== ie || t[49] !== ae || t[50] !== oe || t[51] !== se ? (ce = /* @__PURE__ */ l("div", {
11706
11746
  className: "absolute bottom-0 left-0 right-0 z-20",
11707
11747
  children: /* @__PURE__ */ l(ni, {
11708
11748
  muted: y,
11709
11749
  cameraOff: x,
11710
11750
  speakerOn: !1,
11711
- participantCount: re,
11712
- onMute: ie,
11713
- onCamera: ae,
11751
+ participantCount: ie,
11752
+ onMute: ae,
11753
+ onCamera: oe,
11714
11754
  onParticipants: h,
11715
11755
  onMore: _,
11716
11756
  onEnd: f,
11717
- onChat: oe,
11757
+ onChat: se,
11718
11758
  showScreen: !0
11719
11759
  })
11720
- }), t[43] = x, t[44] = y, t[45] = f, t[46] = _, t[47] = h, t[48] = re, t[49] = ie, t[50] = ae, t[51] = oe, t[52] = se) : se = t[52];
11721
- let ce;
11722
- t[53] === Symbol.for("react.memo_cache_sentinel") ? (ce = () => w(!1), t[53] = ce) : ce = t[53];
11760
+ }), t[43] = x, t[44] = y, t[45] = f, t[46] = _, t[47] = h, t[48] = ie, t[49] = ae, t[50] = oe, t[51] = se, t[52] = ce) : ce = t[52];
11723
11761
  let le;
11724
- t[54] !== C || t[55] !== d ? (le = /* @__PURE__ */ l(ai, {
11762
+ t[53] === Symbol.for("react.memo_cache_sentinel") ? (le = () => w(!1), t[53] = le) : le = t[53];
11763
+ let Q;
11764
+ t[54] !== C || t[55] !== d ? (Q = /* @__PURE__ */ l(ai, {
11725
11765
  open: C,
11726
11766
  conversationId: d,
11727
- onClose: ce
11728
- }), t[54] = C, t[55] = d, t[56] = le) : le = t[56];
11767
+ onClose: le
11768
+ }), t[54] = C, t[55] = d, t[56] = Q) : Q = t[56];
11729
11769
  let $;
11730
- return t[57] !== te || t[58] !== ne || t[59] !== se || t[60] !== le || t[61] !== K ? ($ = /* @__PURE__ */ u("div", {
11770
+ return t[57] !== ne || t[58] !== re || t[59] !== ce || t[60] !== Q || t[61] !== K ? ($ = /* @__PURE__ */ u("div", {
11731
11771
  className: "fixed inset-0 z-50 overflow-hidden font-body",
11732
11772
  style: W,
11733
11773
  children: [
11734
11774
  G,
11735
11775
  K,
11736
- te,
11737
11776
  ne,
11738
- se,
11739
- le
11777
+ re,
11778
+ ce,
11779
+ Q
11740
11780
  ]
11741
- }), t[57] = te, t[58] = ne, t[59] = se, t[60] = le, t[61] = K, t[62] = $) : $ = t[62], $;
11781
+ }), t[57] = ne, t[58] = re, t[59] = ce, t[60] = Q, t[61] = K, t[62] = $) : $ = t[62], $;
11742
11782
  }
11743
11783
  function bi(e) {
11744
11784
  return !e;
@@ -12657,26 +12697,26 @@ function Qi(e) {
12657
12697
  t[25] === S ? Z = t[26] : (Z = /* @__PURE__ */ l(qi, { reactions: S }), t[25] = S, t[26] = Z);
12658
12698
  let ee;
12659
12699
  t[27] === Symbol.for("react.memo_cache_sentinel") ? (ee = { background: "linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, transparent 100%)" }, t[27] = ee) : ee = t[27];
12660
- let Q;
12661
- t[28] === Symbol.for("react.memo_cache_sentinel") ? (Q = { textShadow: "0 1px 4px rgba(0,0,0,0.7)" }, t[28] = Q) : Q = t[28];
12662
12700
  let te;
12663
- t[29] === n ? te = t[30] : (te = /* @__PURE__ */ l("p", {
12701
+ t[28] === Symbol.for("react.memo_cache_sentinel") ? (te = { textShadow: "0 1px 4px rgba(0,0,0,0.7)" }, t[28] = te) : te = t[28];
12702
+ let ne;
12703
+ t[29] === n ? ne = t[30] : (ne = /* @__PURE__ */ l("p", {
12664
12704
  className: "text-base font-semibold text-white",
12665
- style: Q,
12705
+ style: te,
12666
12706
  children: n
12667
- }), t[29] = n, t[30] = te);
12668
- let ne;
12669
- t[31] === Symbol.for("react.memo_cache_sentinel") ? (ne = { color: "rgba(255,255,255,0.7)" }, t[31] = ne) : ne = t[31];
12707
+ }), t[29] = n, t[30] = ne);
12670
12708
  let re;
12671
- t[32] === N ? re = t[33] : (re = /* @__PURE__ */ l("p", {
12709
+ t[31] === Symbol.for("react.memo_cache_sentinel") ? (re = { color: "rgba(255,255,255,0.7)" }, t[31] = re) : re = t[31];
12710
+ let ie;
12711
+ t[32] === N ? ie = t[33] : (ie = /* @__PURE__ */ l("p", {
12672
12712
  className: "text-sm font-mono",
12673
- style: ne,
12713
+ style: re,
12674
12714
  children: N
12675
- }), t[32] = N, t[33] = re);
12676
- let ie;
12677
- t[34] !== te || t[35] !== re ? (ie = /* @__PURE__ */ u("div", { children: [te, re] }), t[34] = te, t[35] = re, t[36] = ie) : ie = t[36];
12715
+ }), t[32] = N, t[33] = ie);
12678
12716
  let ae;
12679
- t[37] === V ? ae = t[38] : (ae = V && /* @__PURE__ */ u("div", {
12717
+ t[34] !== ne || t[35] !== ie ? (ae = /* @__PURE__ */ u("div", { children: [ne, ie] }), t[34] = ne, t[35] = ie, t[36] = ae) : ae = t[36];
12718
+ let oe;
12719
+ t[37] === V ? oe = t[38] : (oe = V && /* @__PURE__ */ u("div", {
12680
12720
  className: "flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold text-white",
12681
12721
  style: {
12682
12722
  background: "rgba(79,142,247,0.25)",
@@ -12693,18 +12733,18 @@ function Qi(e) {
12693
12733
  strokeLinejoin: "round",
12694
12734
  children: /* @__PURE__ */ l("path", { d: "M2 3h20v14H2zM8 21h8M12 17v4" })
12695
12735
  }), /* @__PURE__ */ u("span", { children: [V.name, " sharing"] })]
12696
- }), t[37] = V, t[38] = ae);
12697
- let oe;
12698
- t[39] === b.length ? oe = t[40] : (oe = b.length > 0 && /* @__PURE__ */ u("div", {
12736
+ }), t[37] = V, t[38] = oe);
12737
+ let se;
12738
+ t[39] === b.length ? se = t[40] : (se = b.length > 0 && /* @__PURE__ */ u("div", {
12699
12739
  className: "flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold text-white",
12700
12740
  style: {
12701
12741
  background: "rgba(234,179,8,0.25)",
12702
12742
  border: "1px solid rgba(234,179,8,0.4)"
12703
12743
  },
12704
12744
  children: [/* @__PURE__ */ l("span", { children: "✋" }), /* @__PURE__ */ l("span", { children: b.length })]
12705
- }), t[39] = b.length, t[40] = oe);
12706
- let se;
12707
- t[41] === v ? se = t[42] : (se = v && /* @__PURE__ */ l("button", {
12745
+ }), t[39] = b.length, t[40] = se);
12746
+ let ce;
12747
+ t[41] === v ? ce = t[42] : (ce = v && /* @__PURE__ */ l("button", {
12708
12748
  onClick: v,
12709
12749
  className: "w-9 h-9 rounded-lg flex items-center justify-center border-none cursor-pointer",
12710
12750
  style: { background: "rgba(0,0,0,0.4)" },
@@ -12734,22 +12774,22 @@ function Qi(e) {
12734
12774
  })
12735
12775
  ]
12736
12776
  })
12737
- }), t[41] = v, t[42] = se);
12738
- let ce;
12739
- t[43] !== ae || t[44] !== oe || t[45] !== se ? (ce = /* @__PURE__ */ u("div", {
12777
+ }), t[41] = v, t[42] = ce);
12778
+ let le;
12779
+ t[43] !== oe || t[44] !== se || t[45] !== ce ? (le = /* @__PURE__ */ u("div", {
12740
12780
  className: "flex items-center gap-3 pointer-events-auto",
12741
12781
  children: [
12742
- ae,
12743
12782
  oe,
12744
- se
12783
+ se,
12784
+ ce
12745
12785
  ]
12746
- }), t[43] = ae, t[44] = oe, t[45] = se, t[46] = ce) : ce = t[46];
12747
- let le;
12748
- t[47] !== ie || t[48] !== ce ? (le = /* @__PURE__ */ u("div", {
12786
+ }), t[43] = oe, t[44] = se, t[45] = ce, t[46] = le) : le = t[46];
12787
+ let Q;
12788
+ t[47] !== ae || t[48] !== le ? (Q = /* @__PURE__ */ u("div", {
12749
12789
  className: "absolute top-0 left-0 right-0 px-4 pt-12 pb-6 flex justify-between items-start z-20 pointer-events-none",
12750
12790
  style: ee,
12751
- children: [ie, ce]
12752
- }), t[47] = ie, t[48] = ce, t[49] = le) : le = t[49];
12791
+ children: [ae, le]
12792
+ }), t[47] = ae, t[48] = le, t[49] = Q) : Q = t[49];
12753
12793
  let $;
12754
12794
  t[50] === Symbol.for("react.memo_cache_sentinel") ? ($ = () => M(!0), t[50] = $) : $ = t[50];
12755
12795
  let ue;
@@ -12775,16 +12815,16 @@ function Qi(e) {
12775
12815
  onClose: () => M(!1)
12776
12816
  }), t[63] = z, t[64] = I, t[65] = b, t[66] = j, t[67] = de) : de = t[67];
12777
12817
  let fe;
12778
- return t[68] !== X || t[69] !== Z || t[70] !== le || t[71] !== ue || t[72] !== de ? (fe = /* @__PURE__ */ u("div", {
12818
+ return t[68] !== X || t[69] !== Z || t[70] !== Q || t[71] !== ue || t[72] !== de ? (fe = /* @__PURE__ */ u("div", {
12779
12819
  className: "relative flex flex-col h-full bg-black font-body overflow-hidden",
12780
12820
  children: [
12781
12821
  X,
12782
12822
  Z,
12783
- le,
12823
+ Q,
12784
12824
  ue,
12785
12825
  de
12786
12826
  ]
12787
- }), t[68] = X, t[69] = Z, t[70] = le, t[71] = ue, t[72] = de, t[73] = fe) : fe = t[73], fe;
12827
+ }), t[68] = X, t[69] = Z, t[70] = Q, t[71] = ue, t[72] = de, t[73] = fe) : fe = t[73], fe;
12788
12828
  }
12789
12829
  function $i(e) {
12790
12830
  return e.isScreenSharing;
@@ -13265,8 +13305,116 @@ function Ca(e) {
13265
13305
  }
13266
13306
  function wa() {}
13267
13307
  //#endregion
13308
+ //#region src/components/chat/ConversationContextCard.tsx
13309
+ var Ta = {
13310
+ pending: "#f59e0b",
13311
+ confirmed: "#10b981",
13312
+ active: "#3b82f6",
13313
+ completed: "#6b7280",
13314
+ cancelled: "#ef4444"
13315
+ };
13316
+ function Ea(e) {
13317
+ let t = (0, g.c)(25), { context: n, className: r } = e;
13318
+ if (!n) return null;
13319
+ let i = n.status ? Ta[n.status] ?? "#6b7280" : void 0, a = `orbit-context-card ${r ?? ""}`, o;
13320
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = {
13321
+ padding: "12px 16px",
13322
+ borderBottom: "1px solid var(--orbit-border, #e5e7eb)",
13323
+ backgroundColor: "var(--orbit-surface, #f9fafb)"
13324
+ }, t[0] = o) : o = t[0];
13325
+ let s = n.title || n.actor ? 6 : 0, c;
13326
+ t[1] === s ? c = t[2] : (c = {
13327
+ display: "flex",
13328
+ alignItems: "center",
13329
+ justifyContent: "space-between",
13330
+ marginBottom: s
13331
+ }, t[1] = s, t[2] = c);
13332
+ let d;
13333
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (d = {
13334
+ fontSize: 11,
13335
+ fontWeight: 600,
13336
+ textTransform: "uppercase",
13337
+ letterSpacing: "0.05em",
13338
+ color: "var(--orbit-text-secondary, #6b7280)"
13339
+ }, t[3] = d) : d = t[3];
13340
+ let f;
13341
+ t[4] === n.type ? f = t[5] : (f = /* @__PURE__ */ l("span", {
13342
+ style: d,
13343
+ children: n.type
13344
+ }), t[4] = n.type, t[5] = f);
13345
+ let p;
13346
+ t[6] !== n.status || t[7] !== i ? (p = n.status && /* @__PURE__ */ l("span", {
13347
+ style: {
13348
+ fontSize: 11,
13349
+ fontWeight: 500,
13350
+ color: i,
13351
+ textTransform: "capitalize"
13352
+ },
13353
+ children: n.status
13354
+ }), t[6] = n.status, t[7] = i, t[8] = p) : p = t[8];
13355
+ let m;
13356
+ t[9] !== c || t[10] !== f || t[11] !== p ? (m = /* @__PURE__ */ u("div", {
13357
+ style: c,
13358
+ children: [f, p]
13359
+ }), t[9] = c, t[10] = f, t[11] = p, t[12] = m) : m = t[12];
13360
+ let h;
13361
+ t[13] === n.title ? h = t[14] : (h = n.title && /* @__PURE__ */ l("div", {
13362
+ style: {
13363
+ fontSize: 14,
13364
+ fontWeight: 600,
13365
+ color: "var(--orbit-text, #111827)",
13366
+ marginBottom: 2
13367
+ },
13368
+ children: n.title
13369
+ }), t[13] = n.title, t[14] = h);
13370
+ let _;
13371
+ t[15] === n.actor ? _ = t[16] : (_ = n.actor && /* @__PURE__ */ u("div", {
13372
+ style: {
13373
+ display: "flex",
13374
+ alignItems: "center",
13375
+ gap: 6,
13376
+ marginBottom: 2
13377
+ },
13378
+ children: [n.actor.avatar && /* @__PURE__ */ l("img", {
13379
+ src: n.actor.avatar,
13380
+ alt: "",
13381
+ style: {
13382
+ width: 16,
13383
+ height: 16,
13384
+ borderRadius: "50%",
13385
+ objectFit: "cover"
13386
+ }
13387
+ }), /* @__PURE__ */ l("span", {
13388
+ style: {
13389
+ fontSize: 12,
13390
+ color: "var(--orbit-text-secondary, #6b7280)"
13391
+ },
13392
+ children: n.actor.name
13393
+ })]
13394
+ }), t[15] = n.actor, t[16] = _);
13395
+ let v;
13396
+ t[17] === n.subtitle ? v = t[18] : (v = n.subtitle && /* @__PURE__ */ l("div", {
13397
+ style: {
13398
+ fontSize: 12,
13399
+ color: "var(--orbit-text-secondary, #6b7280)"
13400
+ },
13401
+ children: n.subtitle
13402
+ }), t[17] = n.subtitle, t[18] = v);
13403
+ let y;
13404
+ return t[19] !== a || t[20] !== _ || t[21] !== v || t[22] !== m || t[23] !== h ? (y = /* @__PURE__ */ u("div", {
13405
+ className: a,
13406
+ style: o,
13407
+ children: [
13408
+ m,
13409
+ h,
13410
+ _,
13411
+ v
13412
+ ]
13413
+ }), t[19] = a, t[20] = _, t[21] = v, t[22] = m, t[23] = h, t[24] = y) : y = t[24], y;
13414
+ }
13415
+ //#endregion
13268
13416
  //#region src/components/meeting/ScreenShareView.tsx
13269
- function Ta(e) {
13417
+ function Da(e) {
13270
13418
  let t = (0, g.c)(8), { stream: n, presenterName: i } = e, a = o(null), s, c;
13271
13419
  t[0] === n ? (s = t[1], c = t[2]) : (s = () => {
13272
13420
  a.current && (a.current.srcObject = n);
@@ -13308,4 +13456,4 @@ function Ta(e) {
13308
13456
  }), t[6] = i, t[7] = m), m;
13309
13457
  }
13310
13458
  //#endregion
13311
- export { Qt as AttachmentPicker, tt as AttachmentRenderer, rn as AudioRecorder, Be as Avatar, In as BatchToolbar, Ue as BottomNav, rt as CallBanner, ni as CallControls, tr as CallHistory, li as CallScreen, Gr as Chat, $n as ChatBox, wn as Composer, Ke as ConversationList, rr as ConversationPicker, Rr as DocumentViewer, Ut as EmojiPicker, ba as EscalationButton, ya as IconBtn, gr as ImageViewer, ai as InCallChatPanel, wi as IncomingCallModal, Ot as LinkPreview, Ca as MediaMessage, Hr as MediaViewer, q as MeetingContext, ie as MeetingProvider, Qi as MeetingRoom, sa as MeetingWidget, pt as MessageActionMenu, Ft as MessageBubble, sr as MessageInfoSheet, Mn as MessageInput, xa as MessageList, he as OfflineQueueProvider, Te as OrbitProvider, Mi as ParticipantGrid, St as ReactionDialog, Fn as ReplyComposer, Ta as ScreenShareView, un as StickerPicker, D as ThemeProvider, Oi as VideoCall, yi as VideoCallScreen, Sr as VideoViewer, na as WaitingRoom, S as darkTheme, Tt as extractUrls, C as lightTheme, y as useAppConfig, P as useCall, Re as useCallHistory, Ae as useConversations, Jt as useMedia, Y as useMeeting, J as useMeetingContext, Fe as useMessages, ha as useNotifications, me as useOfflineQueue, v as useOrbit, F as useOrbitEvent, A as useOrbitListener, da as usePresence, ma as useRealtime, T as useTheme };
13459
+ export { Qt as AttachmentPicker, tt as AttachmentRenderer, rn as AudioRecorder, Be as Avatar, In as BatchToolbar, Ue as BottomNav, rt as CallBanner, ni as CallControls, tr as CallHistory, li as CallScreen, Gr as Chat, $n as ChatBox, wn as Composer, Ea as ConversationContextCard, Ke as ConversationList, rr as ConversationPicker, Rr as DocumentViewer, Ut as EmojiPicker, ba as EscalationButton, ya as IconBtn, gr as ImageViewer, ai as InCallChatPanel, wi as IncomingCallModal, Ot as LinkPreview, Ca as MediaMessage, Hr as MediaViewer, q as MeetingContext, ae as MeetingProvider, Qi as MeetingRoom, sa as MeetingWidget, pt as MessageActionMenu, Ft as MessageBubble, sr as MessageInfoSheet, Mn as MessageInput, xa as MessageList, he as OfflineQueueProvider, Te as OrbitProvider, Mi as ParticipantGrid, St as ReactionDialog, Fn as ReplyComposer, Da as ScreenShareView, un as StickerPicker, D as ThemeProvider, Oi as VideoCall, yi as VideoCallScreen, Sr as VideoViewer, na as WaitingRoom, S as darkTheme, Tt as extractUrls, C as lightTheme, y as useAppConfig, P as useCall, Re as useCallHistory, Ae as useConversations, Jt as useMedia, Y as useMeeting, J as useMeetingContext, Fe as useMessages, ha as useNotifications, me as useOfflineQueue, v as useOrbit, F as useOrbitEvent, A as useOrbitListener, da as usePresence, ma as useRealtime, T as useTheme };